diff --git a/3d-bin-packing/3d-bin-packing-tests.ts b/3d-bin-packing/3d-bin-packing-tests.ts new file mode 100644 index 0000000000..4562c26ce9 --- /dev/null +++ b/3d-bin-packing/3d-bin-packing-tests.ts @@ -0,0 +1,52 @@ +/// + +import packer = require("3d-bin-packing"); +import samchon = require("samchon-framework"); + +function main(): void +{ + /////////////////////////// + // CONSTRUCT OBJECTS + /////////////////////////// + let wrapperArray: bws.packer.WrapperArray = new packer.WrapperArray(); + let instanceArray: bws.packer.InstanceArray = new packer.InstanceArray(); + + // Wrappers + wrapperArray.push + ( + new packer.Wrapper("Large", 1000, 40, 40, 15, 0), + new packer.Wrapper("Medium", 700, 20, 20, 10, 0), + new packer.Wrapper("Small", 500, 15, 15, 8, 0) + ); + + /////// + // Each Instance is repeated #15 + /////// + instanceArray.insert(instanceArray.end(), 15, new packer.Product("Eraser", 1, 2, 5)); + instanceArray.insert(instanceArray.end(), 15, new packer.Product("Book", 15, 30, 3)); + instanceArray.insert(instanceArray.end(), 15, new packer.Product("Drink", 3, 3, 10)); + instanceArray.insert(instanceArray.end(), 15, new packer.Product("Umbrella", 5, 5, 20)); + + // Wrappers also can be packed into another Wrapper. + instanceArray.insert(instanceArray.end(), 15, new packer.Wrapper("Notebook-Box", 2000, 30, 40, 4, 2)); + instanceArray.insert(instanceArray.end(), 15, new packer.Wrapper("Tablet-Box", 2500, 20, 28, 2, 0)); + + /////////////////////////// + // BEGINS PACKING + /////////////////////////// + // CONSTRUCT PACKER + let my_packer: bws.packer.Packer = new packer.Packer(wrapperArray, instanceArray); + + /////// + // PACK (OPTIMIZE) + let result: bws.packer.WrapperArray = my_packer.optimize(); + /////// + + /////////////////////////// + // TRACE PACKING RESULT + /////////////////////////// + let xml: samchon.library.XML = result.toXML(); + console.log(xml.toString()); +} + +main(); \ No newline at end of file diff --git a/3d-bin-packing/3d-bin-packing.d.ts b/3d-bin-packing/3d-bin-packing.d.ts new file mode 100644 index 0000000000..afd3af6050 --- /dev/null +++ b/3d-bin-packing/3d-bin-packing.d.ts @@ -0,0 +1,1500 @@ +// Type definitions for 3d-bin-packing +// Project: https://github.com/betterwaysystems/packer +// Definitions by: Jeongho Nam +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// +/// +/// +/// + +declare module "3d-bin-packing" +{ + export = bws.packer; +} +declare var ReactDataGrid: typeof AdazzleReactDataGrid.ReactDataGrid; +declare namespace boxologic { + /** + *

An abstract instance of boxologic.

+ * + *

{@link st_Instance} represents a physical, tangible instance of 3-dimension.

+ * + * @author Jeongho Nam + */ + abstract class Instance { + /** + * Width of the tangible instance, length on the X-axis in 3D. + */ + width: number; + /** + * Height of the tangible instance, length on the Y-axis in 3D. + */ + height: number; + /** + * Length of the tangible instance, length on the Z-axis in 3D. + */ + length: number; + /** + * Width considering layout placement. + */ + layout_width: number; + /** + * Height considering layout placement. + */ + layout_height: number; + /** + * Length considering layout placement. + */ + layout_length: number; + /** + * Volume, Width x Height x Length. + */ + volume: number; + /** + * Construct from size members. + * + * @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(width: number, height: number, length: number); + } +} +declare namespace bws.packer { + /** + * @brief Packer, a solver of 3d bin packing with multiple wrappers. + * + * @details + *

Packer is a facade class supporting packing operations in user side. You can solve a packing problem + * by constructing Packer class with {@link WrapperArray wrappers} and {@link InstanceArray instances} to + * pack and executing {@link optimize Packer.optimize()} method.

+ * + *

In background side, deducting packing solution, those algorithms are used.

+ * + * + * @author Jeongho Nam + */ + class Packer extends samchon.protocol.Entity { + /** + * Candidate wrappers who can contain instances. + */ + protected wrapperArray: WrapperArray; + /** + * Instances trying to pack into the wrapper. + */ + protected instanceArray: InstanceArray; + /** + * Default Constructor. + */ + constructor(); + /** + * Construct from members. + * + * @param wrapperArray Candidate wrappers who can contain instances. + * @param instanceArray Instances to be packed into some wrappers. + */ + constructor(wrapperArray: WrapperArray, instanceArray: InstanceArray); + /** + * @inheritdoc + */ + construct(xml: samchon.library.XML): void; + /** + * Get wrapperArray. + */ + getWrapperArray(): WrapperArray; + /** + * Get instanceArray. + */ + getInstanceArray(): InstanceArray; + /** + *

Deduct + * + */ + optimize(): WrapperArray; + /** + * @brief Initialize sequence list (gene_array). + * + * @details + *

Deducts initial sequence list by such assumption:

+ * + *
    + *
  • Cost of larger wrapper is less than smaller one, within framework of price per volume unit.
  • + *
      + *
    • Wrapper Larger: (price: $1,000, volume: 100cm^3 -> price per volume unit: $10 / cm^3)
    • + *
    • Wrapper Smaller: (price: $700, volume: 50cm^3 -> price per volume unit: $14 / cm^3)
    • + *
    • Larger's cost is less than Smaller, within framework of price per volume unit
    • + *
    + *
+ * + *

Method {@link initGenes initGenes()} constructs {@link WrapperGroup WrapperGroups} corresponding + * with the {@link wrapperArray} and allocates {@link instanceArray instances} to a {@link WrapperGroup}, + * has the smallest cost between containbles.

+ * + *

After executing packing solution by {@link WrapperGroup.optimize WrapperGroup.optimize()}, trying to + * {@link repack re-pack} each {@link WrapperGroup} to another type of {@link Wrapper}, deducts the best + * solution between them. It's the initial sequence list of genetic algorithm.

+ * + * @return Initial sequence list. + */ + protected initGenes(): GAWrapperArray; + /** + * Try to repack each wrappers to another type. + * + * @param $wrappers Wrappers to repack. + * @return Re-packed wrappers. + */ + protected repack($wrappers: WrapperArray): WrapperArray; + /** + * @inheritdoc + */ + TAG(): string; + /** + * @inheritdoc + */ + toXML(): samchon.library.XML; + } +} +declare namespace flex { + class TabNavigator extends React.Component { + render(): JSX.Element; + private handle_change(index, event); + } + class NavigatorContent extends React.Component { + render(): JSX.Element; + } + interface TabNavigatorProps extends React.Props { + selectedIndex?: number; + style?: React.CSSProperties; + } + interface NavigatorContentProps extends React.Props { + label: string; + } +} +declare namespace boxologic { + /** + * A box, trying to pack into a {@link Pallet}. + * + * @author Bill Knechtel,
+ * Migrated and Refactored by Jeongho Nam + */ + class Box extends Instance { + /** + * Coordinate-X of the box placement in a {@link Pallet}. + */ + cox: number; + /** + * Coordinate-Y of the box placement in a {@link Pallet}. + */ + coy: number; + /** + * Coordinate-Z of the box placement in a {@link Pallet}. + */ + coz: number; + /** + * Whether the {@link Box} is packed into a {@link Pallet}. + */ + is_packed: boolean; + overlapped_boxes: std.HashSet; + /** + * Construct from an instance. + * + * @param instance An instance adapts with. + */ + constructor(instance: bws.packer.Instance); + hit_test(obj: Box): boolean; + private hit_test_single(obj); + private hit_test_point(x, y, z); + } +} +/** + *

A set of programs that calculate the best fit for boxes on a pallet migrated from language C.

+ * + *
    + *
  • Original Boxologic: https://github.com/exad/boxologic
  • + *
+ * + * @author Bill Knechtel,
+ * Migrated and Refactored by Jeongho Nam + */ +declare namespace boxologic { + /** + *

A facade class of boxologic.

+ * + *

The Boxologic class dudcts the best solution of packing boxes to a pallet.

+ * + *
    + *
  • Reference: https://github.com/exad/boxologic
  • + *
+ * + * @author Bill Knechtel,
+ * Migrated and Refactored by Jeongho Nam + */ + class Boxologic { + /** + * A Wrapper to pack instances. + */ + private wrapper; + /** + * Instances trying to put into the wrapper. + */ + private instanceArray; + /** + * Instances failed to pack by overloading. + */ + private leftInstances; + /** + * A pallet containing {@link Box boxes}. + * + * @see Wrapper + */ + private pallet; + /** + * Boxes, trying to pack into the {@link pallet}. + */ + private box_array; + /** + * Sum of all boxes' volume. + */ + private total_box_volume; + /** + *

All different lengths of {@link box_array all box} dimensions along with evaluation values.

+ * + *

In other word, the layer_map stores those entries; each {@link Boxbox}'s length on each + * axis as a key (width, height or length) and evaluation value as a value. The evaluation + * value means sum of minimum gaps between the key and other {@link Box boxes}' width, height and length + *

+ * + * + FOR i := 0 to box_array.size() + WHILE key IN width, length and height in box_array[i] + BEGIN + value := 0 + FOR j to box_array.size() + value += min + ( + abs(key - box_array[j].width), + abs(key - box_array[j].height), + abs(key - box_array[j].length) + ) + layer_map.insert({key, value}); + END + * + * + *
    + *
  • key: A dimension value
  • + *
  • value: Evaluation weight value for the corresponding key.
  • + *
+ */ + private layer_map; + /** + * {@link List} of {@link Scrapped} instances, edges of layers under construction. + * + * @see Scrapped + * @see scrap_min_z + */ + private scrap_list; + /** + * The topology {@link Scrapped}, the edge of the current layer under construction. + * + * @see Scrapped + * @see scrap_list + */ + private scrap_min_z; + /** + * Index of the current {@link box}. + */ + private cboxi; + /** + * Candidate {@link Box.layout_width layout_width} of the {@link cboxi current box}. + */ + private cbox_layout_width; + /** + * Candidate {@link Box.layout_height layout_height} of the {@link cboxi current box}. + */ + private cbox_layout_height; + /** + * Candidate {@link Box.layout_length layout_length} of the {@link cboxi current box}. + */ + private cbox_layout_length; + /** + * Current layer's key on iteration. + */ + private layer_thickness; + /** + * Previous layer's key had iterated. + */ + private pre_layer; + /** + * Key of the unevened layer in the current packing layer. + */ + private layer_in_layer; + /** + * Little Z, gotten from {@link Scrapped.cumz cumz} in {@link min_scrap_z} + */ + private lilz; + /** + * Remained (unfilled) {@link Pallet.layout_height layout_height} of the {@link pallet}. + */ + private remain_layout_height; + /** + * Remained (unfilled) {@link Pallet.layout_length layout_length} of the {@link pallet}. + */ + private remain_layout_length; + /** + * Packed (filled) {@link Pallet.layout_height layout_height} of the {@link pallet}. + */ + private packed_layout_height; + /** + * Packed {@link Pallet.vo1lume volume} of the {@lnk pallet}. + */ + private packed_volume; + private boxi; + private bboxi; + private boxx; + private boxy; + private boxz; + private bboxx; + private bboxy; + private bboxz; + private bfx; + private bfy; + private bfz; + private bbfx; + private bbfy; + private bbfz; + /** + *

Whether the packing is on progress.

+ * + *

The {@link packing} is a flag variable for terminating iterations in + * {@link iterate_orientations iterate_orientations()}, who deducts the best packing solution.

+ */ + private packing; + /** + * Whether packing a layer is done. + */ + private layer_done; + /** + * Whether the current packing layer is evened. + */ + private evened; + /** + * Whether the best solution is deducted. + */ + private packing_best; + /** + * Whether the utilization degree of pallet space is 100%. + */ + private hundred_percent; + /** + * The best orientation of the pallet, which can deduct the {@link best_solution_volume}. + */ + private best_orientation; + /** + * The best layer, which can deduct the {@link best_solution_volume}. + */ + private best_layer; + /** + * The best volume, fit the best utilization degree of the pallet space. + */ + private best_solution_volume; + /** + * Construct from a wrapper and instances. + * + * @param wrapper A Wrapper to pack instances. + * @param instanceArray Instances trying to put into the wrapper. + */ + constructor(wrapper: bws.packer.Wrapper, instanceArray: bws.packer.InstanceArray); + /** + *

Encode data

+ * + *

Encodes {@link bws.packer Packer}'s data to be suitable for the + * {@link boxologic Boxologic}'s parametric data.

+ */ + private encode(); + /** + *

Decode data

+ * + *

Decodes the Boxologic's optimization result data to be suitable for the Packer's own.

+ */ + private decode(); + private inspect_validity(); + /** + *

Pack instances to the {@link wrapper}.

+ * + *

The {@link Boxologic.pack} is an adaptor method between {@link bws.packer Packer} and + * {@link boxologic}. It encodes data from {@link bws.packer Packer}, deducts the best packing + * solution decodes the optimization result and returns it.

+ * + *

The optimization result is returned as a {@link Pair} like below:

+ *
    + *
  • first: The {@link wrapper} with packed instances.
  • + *
  • second: {@link leftInstances Left instances failed to pack} by overloading.
  • + *
+ * + * @return A pair of {@link wrapper} with packed instances and + * {@link leftInstances instances failed to pack} by overloading. + */ + pack(): std.Pair; + /** + *

Execute iterations by calling proper functions.

+ * + *

Iterations are done and parameters of the best solution are found.

+ */ + private iterate_orientations(); + /** + * Iterate a layer. + * + * @param thickness Thickness of the iterating layer. + */ + private iterate_layer(thickness); + /** + *

Construct layers.

+ * + *

Creates all possible layer heights by giving a weight value to each of them.

+ */ + private construct_layers(); + /** + *

Packs the boxes found and arranges all variables and records properly.

+ * + *

Update the linked list and the Boxlist[] array as a box is packed.

+ */ + private pack_layer(); + /** + * Find the most proper layer height by looking at the unpacked boxes and + * the remaining empty space available. + */ + private find_layer(thickness); + /** + *

Determine the gap with the samllest z value in the current layer.

+ * + *

Find the most proper boxes by looking at all six possible orientations, + * empty space given, adjacent boxes, and pallet limits.

+ * + * @param hmx Maximum available x-dimension of the current gap to be filled. + * @param hy Current layer thickness value. + * @param hmy Current layer thickness value. + * @param hz Z-dimension of the current gap to be filled. + * @param hmz Maximum available z-dimension to the current gap to be filled. + */ + private find_box(hmx, hy, hmy, hz, hmz); + /** + *

Analyzes each unpacked {@link Box box} to find the best fitting one to the empty space.

+ * + *

Used by {@link find_box find_box()} to analyze box dimensions.

+ * + * @param x index of a {@link Box box} in the {@link box_array}. + * + * @param hmx Maximum available x-dimension of the current gap to be filled. + * @param hy Current layer thickness value. + * @param hmy Current layer thickness value. + * @param hz Z-dimension of the current gap to be filled. + * @param hmz Maximum available z-dimension to the current gap to be filled. + * + * @param dim1 X-dimension of the orientation of the box being examined. + * @param dim2 Y-dimension of the orientation of the box being examined. + * @param dim3 Z-dimension of the orientation of the box being examined. + */ + private analyze_box(index, hmx, hy, hmy, hz, hmz, dim1, dim2, dim3); + /** + * After finding each box, the candidate boxes and the condition of the layer are examined. + */ + private check_found(); + /** + * After packing of each box, 100% packing condition is checked. + */ + private volume_check(); + /** + *

Find the first to be packed gap in the layer edge.

+ * + *

Determine the gap with the {@link scrap_min_z smallest z} value in the current layer.

+ */ + private find_smallest_z(); + /** + *

Determine {@link box_arrray boxes}.

+ * + *

Using the parameters found, packs the best solution found and reports.

+ */ + private report_results(); + /** + *

Determine a {@link Box}.

+ * + *

Transforms the found co-ordinate system to the one entered by the user and write them to the + * report.

+ */ + private write_box_file(); + } +} +declare namespace boxologic { + /** + * A pallet containing boxes. + * + * @author Bill Knechtel,
+ * Migrated and Refactored by Jeongho Nam + */ + class Pallet extends Instance { + /** + * Construct from a wrapper. + * + * @param wrapper A wrapper wrapping instances. + */ + constructor(wrapper: bws.packer.Wrapper); + /** + * Set placement orientation. + */ + set_orientation(orientation: number): void; + } +} +declare namespace boxologic { + /** + *

Cumulated lengths of current layer.

+ * + *

{@link Scrapped} represents an edge of the current layer under construction.

+ * + * @author Bill Knechtel,
+ * Migrated and Refactored by Jeongho Nam + */ + class Scrap { + /** + * Cumulated length on the X-axis in 3D. + */ + cumx: number; + /** + * Cumulated length on the Z-axis in 3D. + */ + cumz: number; + /** + * Default Constructor. + */ + constructor(); + /** + * Initialization Constructor. + * + * @param cumx Cumulated length on the x-axis. + * @param cumz Cumulated length on the z-axis. + */ + constructor(cumx: number, cumz: number); + } +} +declare namespace bws.packer { + /** + * Bridge of {@link Packer} for {@link InstanceForm repeated instances}. + * + * @author Jeongho Nam + */ + class PackerForm extends samchon.protocol.Entity { + /** + * Form of Instances to pack. + */ + private instanceFormArray; + /** + * Type of Wrappers to be used. + */ + private wrapperArray; + /** + * Default Constructor. + */ + constructor(); + /** + * Initializer Constructor. + * + * @param instanceFormArray Form of Instances to pack. + * @param wrapperArray Type of Wrappers to be used. + */ + constructor(instanceFormArray: InstanceFormArray, wrapperArray: WrapperArray); + construct(xml: samchon.library.XML): void; + optimize(): WrapperArray; + getInstanceFormArray(): InstanceFormArray; + getWrapperArray(): WrapperArray; + TAG(): string; + toXML(): samchon.library.XML; + toPacker(): Packer; + } + /** + * An array of {@link InstanceForm} objects. + * + * @author Jeongho Nam + */ + class InstanceFormArray extends samchon.protocol.EntityArrayCollection { + /** + * Default Constructor. + */ + constructor(); + createChild(xml: samchon.library.XML): InstanceForm; + TAG(): string; + CHILD_TAG(): string; + /** + * Convert {@link InstanceForm} objects to {@link InstanceArray}. + * + * @return An array of instance containing repeated instances in {@link InstanceForm} objects. + */ + toInstanceArray(): InstanceArray; + } + /** + *

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 6140babecd..7ebdcc514f 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -695,7 +695,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](heap/heap.d.ts) [heap](https://github.com/qiao/heap.js) by [Ryan McNamara](https://github.com/ryan10132) * [:link:](heatmap.js/heatmap.d.ts) [heatmap.js](https://github.com/pa7/heatmap.js) by [Yang Guan](https://github.com/lookuptable) * [:link:](hellojs/hellojs.d.ts) [hello.js](http://adodson.com/hello.js) by [Pavel Zika](https://github.com/PavelPZ) -* [:link:](helmet/helmet.d.ts) [helmet](https://github.com/helmetjs/helmet) by [Cyril Schumacher](https://github.com/cyrilschumacher) +* [:link:](helmet/helmet.d.ts) [helmet](https://github.com/helmetjs/helmet) by [Cyril Schumacher](https://github.com/cyrilschumacher), [Evan Hahn](https://github.com/EvanHahn) * [:link:](highcharts/highcharts.d.ts) [Highcharts](http://www.highcharts.com) by [Damiano Gambarotto](http://github.com/damianog), [Dan Lewi Harkestad](http://github.com/baltie) * [:link:](highcharts-ng/highcharts-ng.d.ts) [highcharts-ng](https://github.com/pablojim/highcharts-ng) by [Scott Hatcher](https://github.com/scatcher) * [:link:](highland/highland.d.ts) [Highland](http://highlandjs.org) by [Bart van der Schoor](https://github.com/Bartvds) @@ -1123,10 +1123,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/CybozuLabs-md5/CybozuLabs-md5-tests.ts b/CybozuLabs-md5/CybozuLabs-md5-tests.ts new file mode 100644 index 0000000000..16dd05b059 --- /dev/null +++ b/CybozuLabs-md5/CybozuLabs-md5-tests.ts @@ -0,0 +1,9 @@ +/// + +var hash: string; +hash = CybozuLabs.MD5.calc("abc"); +hash = CybozuLabs.MD5.calc("abc", CybozuLabs.MD5.BY_ASCII); +hash = CybozuLabs.MD5.calc("abc", CybozuLabs.MD5.BY_UTF16); + +var version: string; +version = CybozuLabs.MD5.VERSION; \ No newline at end of file diff --git a/CybozuLabs-md5/CybozuLabs-md5.d.ts b/CybozuLabs-md5/CybozuLabs-md5.d.ts new file mode 100644 index 0000000000..6e1f31739d --- /dev/null +++ b/CybozuLabs-md5/CybozuLabs-md5.d.ts @@ -0,0 +1,11 @@ +// Type definitions for CybozuLabs.MD5 +// Project: http://labs.cybozu.co.jp/blog/mitsunari/2007/07/md5js_1.html +// Definitions by: MIZUNE Pine +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace CybozuLabs.MD5 { + var VERSION: string; + var BY_ASCII: number; + var BY_UTF16: number; + function calc(str: string, option?: number): string; +} diff --git a/FileSaver/FileSaver-tests.ts b/FileSaver/FileSaver-tests.ts index 4cfae373e3..bf05141aaf 100644 --- a/FileSaver/FileSaver-tests.ts +++ b/FileSaver/FileSaver-tests.ts @@ -1,5 +1,14 @@ /// +import {saveAs as importedSaveAs} from "file-saver"; +function testImportedSaveAs() { + var data: Blob = new Blob(["Hello, world!"], {type: "text/plain;charset=utf-8"}); + var filename: string = 'hello world.txt'; + var disableAutoBOM = true; + + importedSaveAs(data, filename, disableAutoBOM); +} + /** * @summary Test for "saveAs" function. */ diff --git a/FileSaver/FileSaver.d.ts b/FileSaver/FileSaver.d.ts index 6919fa385f..534ce4fe1c 100644 --- a/FileSaver/FileSaver.d.ts +++ b/FileSaver/FileSaver.d.ts @@ -15,7 +15,7 @@ interface FileSaver { * @type {Blob} */ data: Blob, - + /** * @summary File name. * @type {DOMString} @@ -31,3 +31,8 @@ interface FileSaver { } declare var saveAs: FileSaver; + +declare module "file-saver" { + var fileSaver: { saveAs: typeof saveAs }; + export = fileSaver +} diff --git a/README.md b/README.md index 5c218aaa19..b188982fbf 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Please see the [contribution guide](http://definitelytyped.org/guides/contributi * Directly from the GitHub repos * [NuGet packages](http://nuget.org/packages?q=DefinitelyTyped) -* [TypeScript Definition manager](https://github.com/DefinitelyTyped/tsd) +* [Typings - TypeScript Definition Manager](https://github.com/typings/typings) ## List of definitions @@ -32,7 +32,7 @@ Please see the [contribution guide](http://definitelytyped.org/guides/contributi ## Requested definitions -Here is are the [currently requested definitions](https://github.com/DefinitelyTyped/DefinitelyTyped/labels/Definition%3ARequest). +Here are the [currently requested definitions](https://github.com/DefinitelyTyped/DefinitelyTyped/labels/Definition%3ARequest). ## License diff --git a/ace/ace.d.ts b/ace/ace.d.ts index 4a137075b0..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 { @@ -1037,6 +1034,8 @@ declare namespace AceAjax { **/ export interface Editor { + on(ev: string, callback: (e: any) => any): void; + addEventListener(ev: 'change', callback: (ev: EditorChangeEvent) => any): void; addEventListener(ev: string, callback: Function): void; diff --git a/ace/tests/ace-default-tests.ts b/ace/tests/ace-default-tests.ts index f8a280c1a2..798550dec9 100644 --- a/ace/tests/ace-default-tests.ts +++ b/ace/tests/ace-default-tests.ts @@ -5,6 +5,9 @@ var editor = ace.edit("editor"); editor.setTheme("ace/theme/monokai"); editor.getSession().setMode("ace/mode/javascript"); +editor.on("blur", (e) => e); +editor.on("change", (e) => e); + editor.setTheme("ace/theme/twilight"); editor.getSession().setMode("ace/mode/javascript"); diff --git a/adal-angular/adal-tests.ts b/adal-angular/adal-tests.ts index 598134d0a0..db984d95ba 100644 --- a/adal-angular/adal-tests.ts +++ b/adal-angular/adal-tests.ts @@ -12,4 +12,14 @@ var config : adal.Config = { var auth = new AuthenticationContext(config); -var userName: string = auth.getCachedUser().userName; \ No newline at end of file +Logging.log = (message: string) => { + console.log(message); +} + +Logging.level = 4; + +auth.info("Logging message"); + +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 c5a64efd0b..a896d687ec 100644 --- a/adal-angular/adal.d.ts +++ b/adal-angular/adal.d.ts @@ -4,37 +4,51 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare var AuthenticationContext: adal.AuthenticationContextStatic; +declare var Logging: adal.Logging; declare module 'adal' { - export = AuthenticationContext; + export = { AuthenticationContext, Logging }; } 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 { + log: (message: string) => void; + level: LoggingLevel; + } + + enum LoggingLevel { + ERROR = 0, + WARNING = 1, + INFO = 2, + VERBOSE = 3 } interface AuthenticationContextStatic { @@ -51,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; /** @@ -118,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. @@ -134,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/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 a54ed5d515..27998956b8 100644 --- a/amcharts/AmCharts.d.ts +++ b/amcharts/AmCharts.d.ts @@ -26,6 +26,19 @@ declare namespace AmCharts { /** Clears all the charts on page, removes listeners and intervals. */ function clear(); + + /** 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 @@ -36,7 +49,7 @@ declare namespace AmCharts { chart.dataProvider = chartData; chart.write("chartdiv"); */ - class AmPieChart { + class AmPieChart extends AmChart { /** Name of the field in chart's dataProvider which holds slice's alpha. */ alphaField: string; /** Pie lean angle (for 3D effect). Valid range is 0 - 90. */ @@ -187,19 +200,6 @@ declare namespace AmCharts { rollOverSlice(index: number); /** Shows slice. index - the number of a slice or Slice object. */ showSlice(index: number); - - /** Adds event listener of the type "clickSlice" or "pullInSlice" or "pullOutSlice" to the object. - @param type Always "clickSlice" or "pullInSlice" or "pullOutSlice". - @param handler - If the type is "clickSlice", dispatched when user clicks on a slice. - If the type is "pullInSlice", dispatched when user clicks on a slice and the slice is pulled-in. - If the type is "pullOutSlice", dispatched when user clicks on a slice and the slice is pulled-out. - If the type is "rollOutSlice", dispatched when user rolls-out of the slice. - If the type is "rollOverSlice", dispatched when user rolls-over the slice. - */ - addListener(type: string, handler: (e: {/** Always "rollOverSlice". */ - type: string; dataItem: Slice; - }) => void ); } /** AmRadarChart is the class you have to use for radar and polar chart types. @@ -1016,7 +1016,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/angular-deferred-bootstrap/angular-deferred-bootstrap-tests.ts b/angular-deferred-bootstrap/angular-deferred-bootstrap-tests.ts new file mode 100644 index 0000000000..d8a07444d1 --- /dev/null +++ b/angular-deferred-bootstrap/angular-deferred-bootstrap-tests.ts @@ -0,0 +1,11 @@ +/// +/// + +deferredBootstrapper.bootstrap( + { + element: window.document, + module: "myApp", + resolve: { + configuration: ["$http", ($http: ng.IHttpService) => $http.get("config.json")] + } + }); diff --git a/angular-deferred-bootstrap/angular-deferred-bootstrap.d.ts b/angular-deferred-bootstrap/angular-deferred-bootstrap.d.ts new file mode 100644 index 0000000000..a76226761c --- /dev/null +++ b/angular-deferred-bootstrap/angular-deferred-bootstrap.d.ts @@ -0,0 +1,20 @@ +// Type definitions for angular-deferred-bootstrap v0.1.9 +// Project: https://github.com/philippd/angular-deferred-bootstrap +// Definitions by: Markus Wagner +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare var deferredBootstrapper: angular.IDeferredBootstrapperStatic; + +declare module angular { + interface IDeferredBootstrapperStatic { + bootstrap(configParam: IConfigParam): ng.IPromise + } + + interface IConfigParam { + element?: Node, + module?: string, + resolve: any + } +} \ No newline at end of file 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..10979ae15c --- /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 + */ + var Component: (component: iComponent) => ngESDecorator; + + /** + * Register config block + */ + var Config: () => ngESDecorator; + + /** + * Register constant + * + * @param {string} name - constant name + * + * @returns {ngESDecorator} - decorated class + */ + var Constant: (name: string) => ngESDecorator; + + /** + * Register controller + * + * @param {string} name - controller name + * + * @returns {ngESDecorator} - decorated class + */ + var Controller: (name: string) => ngESDecorator; + + /** + * Register decorator + * + * @param {string} name - provider name to decorate + * + * @returns {ngESDecorator} - decorated class + */ + var Decorator: (name: string) => ngESDecorator; + + /** + * Register directive + * + * @param {string} name - directive selector, can be in hyphen-case + * + * @returns {ngESDecorator} - decorated class + */ + var Directive: (name: string) => ngESDecorator; + + /** + * Register factory + * + * @param {string} name - factory name + * + * @returns {ngESDecorator} - decorated class + */ + var Factory: (name: string) => ngESDecorator; + + /** + * Register filter + * + * @param {string} name - filter name + * + * @returns {ngESDecorator} - decorated class + */ + var Filter: (name: string) => ngESDecorator; + + /** + * Add $inject property to target + * + * @param {Array} dependencies - dependencies to inject + * + * @returns {ngESDecorator} - decorated class + */ + var Inject: (...dependencies: Array) => ngESDecorator; + + /** + * Inject dependencies as properties to target + * + * @param {Array} dependencies - dependencies to inject + * + * @returns {ngESDecorator} - decorated class + */ + var InjectAsProperty: (...dependencies: Array) => ngESDecorator; + + /** + * Attach target to the specified module + * + * @param {string} name - module name + * + * @returns {ngESDecorator} - decorated class + */ + var Module: (name: string) => ngESDecorator; + + /** + * Register provider + * + * @param {string} name - provider name + * + * @returns {ngESDecorator} - decorated class + */ + var Provider: (name: string) => ngESDecorator; + + /** + * Register run block + * + * @returns {ngESDecorator} - decorated class + */ + var Run: () => ngESDecorator; + + /** + * Register service + * + * @param {string} name - service name + * + * @returns {ngESDecorator} - decorated class + */ + var Service: (name: string) => ngESDecorator; + + /** + * Register value + * + * @param {string} name - value name + * + * @returns {ngESDecorator} - decorated class + */ + var Value: (name: string) => ngESDecorator; + + export { + Component, + Config, + Constant, + Controller, + Decorator, + Directive, + Factory, + Filter, + Inject, + InjectAsProperty, + Module, + Provider, + Run, + Service, + Value, + } +} diff --git a/angular-local-storage/angular-local-storage.d.ts b/angular-local-storage/angular-local-storage.d.ts index b2bcf377d2..7efc681491 100644 --- a/angular-local-storage/angular-local-storage.d.ts +++ b/angular-local-storage/angular-local-storage.d.ts @@ -56,6 +56,15 @@ declare namespace angular.local.storage { * @param val */ set(key:string, val:string):boolean; + /** + * Directly adds a value to cookies with an expiration. + * Note: Typically used as a fallback if local storage is not supported. + * Returns: Boolean + * @param key + * @param val + * @param daysToExpiry + */ + set(key:string, val:string, daysToExpiry:number):boolean; /** * Directly get a value from a cookie. * Returns: value from local storage diff --git a/angular-material/angular-material-tests.ts b/angular-material/angular-material-tests.ts index 3c70dd27e8..4464c599e3 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'); @@ -55,6 +59,28 @@ myApp.controller('DialogController', ($scope: ng.IScope, $mdDialog: ng.material. $scope['confirmDialog'] = () => { $mdDialog.show($mdDialog.confirm().htmlContent('Confirm!')); }; + $scope['promptDialog'] = () => { + $mdDialog.show($mdDialog.prompt().textContent('Prompt!')); + }; + $scope['promptDialog'] = () => { + $mdDialog.show($mdDialog.prompt().htmlContent('Prompt!')); + }; + $scope['promptDialog'] = () => { + $mdDialog.show($mdDialog.prompt().cancel('Prompt "Cancel" button text')); + }; + $scope['promptDialog'] = () => { + $mdDialog.show($mdDialog.prompt().placeholder('Prompt input placeholder text')); + }; + $scope['promptDialog'] = () => { + $mdDialog.show($mdDialog.prompt().initialValue('Buddy')); + }; + $scope['prerenderedDialog'] = () => { + $mdDialog.show({ + template: 'Hello!', + contentElement: '#myDialog', + clickOutsideToClose: true + }); + }; $scope['hideDialog'] = $mdDialog.hide.bind($mdDialog, 'hide'); $scope['cancelDialog'] = $mdDialog.cancel.bind($mdDialog, 'cancel'); }); @@ -93,8 +119,64 @@ 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(); + }); }); myApp.controller('ToastController', ($scope: ng.IScope, $mdToast: ng.material.IToastService) => { $scope['openToast'] = () => $mdToast.show($mdToast.simple().textContent('Hello!')); }); + +myApp.controller('PanelController', ($scope: ng.IScope, $mdPanel: ng.material.IPanelService) => { + $scope['createPanel'] = () => { + var config = { + template: '

      Hello!

      ', + hasBackdrop: true, + disableParentScroll: true, + zIndex: 150 + }; + + $mdPanel.create(config); + + var panelRef = $mdPanel.create(config); + panelRef.open() + .then((ref: ng.material.IPanelRef) => { + ref.addClass('foo'); + ref.removeClass('bar'); + ref.close(); + }) + .finally(() => { + panelRef = undefined; + }); + }; + + $scope['openPanel'] = () => { + $mdPanel.open({ + template: '

      Hello!

      ', + hasBackdrop: true, + disableParentScroll: true, + zIndex: 150 + }) + .then((panelRef: ng.material.IPanelRef) => { + panelRef.addClass('foo'); + panelRef.removeClass('bar'); + panelRef.close(); + }); + }; + + $scope['newPanelPosition'] = () => { + $mdPanel.newPanelPosition().absolute().center(); + $mdPanel.newPanelPosition().relativeTo('.demo-menu-open-button').addPanelPosition("ALIGN_START", "BELOW"); + }; + + $scope['newPanelAnimation'] = () => { + $mdPanel.newPanelAnimation().openFrom('.some-target'); + $mdPanel.newPanelAnimation().openFrom({top: 0, left: 0}); + }; +}); diff --git a/angular-material/angular-material.d.ts b/angular-material/angular-material.d.ts index 12fe28a9b8..23da7bceb2 100644 --- a/angular-material/angular-material.d.ts +++ b/angular-material/angular-material.d.ts @@ -1,9 +1,15 @@ -// 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: Matt Traynham +// Definitions by: Alex Staroselsky , Blake Bigelow , Peter Hajdu // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// + +declare module 'angular-material' { +    var _: string; +   export = _; +} + declare namespace angular.material { interface IBottomSheetOptions { @@ -13,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 } @@ -60,9 +67,16 @@ declare namespace angular.material { cancel(cancel: string): IConfirmDialog; } + interface IPromptDialog extends IPresetDialog { + cancel(cancel: string): IPromptDialog; + placeholder(placeholder: string): IPromptDialog; + initialValue(initialValue: string): IPromptDialog; + } + interface IDialogOptions { templateUrl?: string; template?: string; + contentElement?: string|Element; autoWrap?: boolean; // default: true targetEvent?: MouseEvent; openFrom?: any; @@ -70,7 +84,7 @@ declare namespace angular.material { scope?: angular.IScope; // default: new child scope preserveScope?: boolean; // default: false disableParentScroll?: boolean; // default: true - hasBackdrop?: boolean // default: true + hasBackdrop?: boolean; // default: true clickOutsideToClose?: boolean; // default: false escapeToClose?: boolean; // default: true focusOnOpen?: boolean; // default: true @@ -83,13 +97,15 @@ declare namespace angular.material { onShowing?: Function; onComplete?: Function; onRemoving?: Function; - fullscreen?: boolean; + skipHide?: boolean; + fullscreen?: boolean; // default: false } interface IDialogService { - show(dialog: IDialogOptions|IAlertDialog|IConfirmDialog): angular.IPromise; + show(dialog: IDialogOptions|IAlertDialog|IConfirmDialog|IPromptDialog): angular.IPromise; confirm(): IConfirmDialog; alert(): IAlertDialog; + prompt(): IPromptDialog; hide(response?: any): angular.IPromise; cancel(response?: any): void; } @@ -119,6 +135,7 @@ declare namespace angular.material { } interface ISidenavService { + (component: string, enableWait: boolean): angular.IPromise; (component: string): ISidenavObject; } @@ -230,6 +247,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 { @@ -271,4 +289,98 @@ declare namespace angular.material { grey: IPalette; 'blue-grey': IPalette; } + + interface IPanelConfig { + template?: string; + templateUrl?: string; + controller?: string|Function; + controllerAs?: string; + bindToController?: boolean; // default: true + locals?: {[index: string]: any}; + resolve?: {[index: string]: angular.IPromise} + attachTo?: string|JQuery|Element; + propagateContainerEvents?: boolean; + panelClass?: string; + zIndex?: number; // default: 80 + position?: IPanelPosition; + clickOutsideToClose?: boolean; // default: false + escapeToClose?: boolean; // default: false + trapFocus?: boolean; // default: false + focusOnOpen?: boolean; // default: true + fullscreen?: boolean; // default: false + animation?: IPanelAnimation; + hasBackdrop?: boolean; // default: false + disableParentScroll?: boolean; // default: false + onDomAdded?: Function; + onOpenComplete?: Function; + onRemoving?: Function; + onDomRemoved?: Function; + origin?: string|JQuery|Element; + } + + interface IPanelRef { + id: string; + config: IPanelConfig; + isAttached: boolean; + open(): angular.IPromise; + close(): angular.IPromise; + attach(): angular.IPromise; + detach(): angular.IPromise; + show(): angular.IPromise; + hide(): angular.IPromise; + destroy(): void; + addClass(newClass: string): void; + removeClass(oldClass: string): void; + toggleClass(toggleClass: string): void; + updatePosition(position: IPanelPosition): void; + } + + interface IPanelPosition { + absolute(): IPanelPosition; + relativeTo(someElement: string|JQuery|Element): IPanelPosition; + top(top?: string): IPanelPosition; // default: '0' + bottom(bottom?: string): IPanelPosition; // default: '0' + start(start?: string): IPanelPosition; // default: '0' + end(end?: string): IPanelPosition; // default: '0' + left(left?: string): IPanelPosition; // default: '0' + right(right?: string): IPanelPosition; // default: '0' + centerHorizontally(): IPanelPosition; + centerVertically(): IPanelPosition; + center(): IPanelPosition; + addPanelPosition(xPosition: string, yPosition: string): IPanelPosition; + withOffsetX(offsetX: string): IPanelPosition; + withOffsetY(offsetY: string): IPanelPosition; + } + + interface IPanelAnimation { + openFrom(from: string|Element|Event|{top: number, left: number}): IPanelAnimation; + closeTo(to: string|Element|{top: number, left: number}): IPanelAnimation; + withAnimation(cssClass: string|{open: string, close: string}): IPanelAnimation; + } + + interface IPanelService { + create(opt_config: IPanelConfig): IPanelRef; + 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-q-spread/angular-q-spread-tests.ts b/angular-q-spread/angular-q-spread-tests.ts new file mode 100644 index 0000000000..932ecc4fa9 --- /dev/null +++ b/angular-q-spread/angular-q-spread-tests.ts @@ -0,0 +1,42 @@ +/// + +interface IMyService { + getFirstname(): ng.IPromise; + getLastname(): ng.IPromise; +} + +interface IScope { + name: string; +} + +function TestCtrl($scope: IScope, $q: ng.IQService, MyService: IMyService) { + $scope.name = null; + + function firstCallback(firstname: string, lastname: string) + { + return firstname + ' ' + lastname; + } + + function anotherCallback(fullname: string) + { + $scope.name = fullname; + } + + function failureCallback(reason: any) + { + alert('Could not load data: ' + reason); + } + + $q + .all([ + MyService.getFirstname(), + MyService.getLastname() + ]) + .spread(firstCallback) + .then(anotherCallback) + .catch(failureCallback); +}; + +TestCtrl.$inject = ['$scope', '$q', 'MyService']; + +angular.module('test').controller('TestCtrl', TestCtrl); diff --git a/angular-q-spread/angular-q-spread.d.ts b/angular-q-spread/angular-q-spread.d.ts new file mode 100644 index 0000000000..3eb37dc4e0 --- /dev/null +++ b/angular-q-spread/angular-q-spread.d.ts @@ -0,0 +1,17 @@ +// Type definitions for angular-q-spread module +// Project: https://www.npmjs.com/package/angular-q-spread +// Definitions by: rafw87 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module angular { + interface IPromise { + /** + This method can be used as a replacement for then. Similarly, it takes two parameters, a callback when all promises are resolved and a callback for failure. The resolve callback is going to be called with the result of the list of promises passed to $q.all as separate parameters instead of one parameters which is an array. + * @param successCallback Callback for resolved promise, similar to then's one, but takes multiple parameters instead of single array parameter + * @param errorCallback Callback for error, the same as for then + */ + spread(successCallback: (...promiseValues: any[]) => IPromise|TResult, errorCallback?: (reason: any) => any): IPromise; + } +} diff --git a/angular-translate/angular-translate.d.ts b/angular-translate/angular-translate.d.ts index c4eca39a95..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 { @@ -68,10 +68,11 @@ declare namespace angular.translate { loaderCache(): any; isReady(): boolean; onReady(): angular.IPromise; + resolveClientLocale():string; } interface ITranslateProvider extends angular.IServiceProvider { - translations(): ITranslationTable; + translations(key?: string): ITranslationTable; translations(key: string, translationTable: ITranslationTable): ITranslateProvider; cloakClassName(): string; cloakClassName(name: string): ITranslateProvider; @@ -94,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; @@ -111,6 +113,7 @@ declare namespace angular.translate { registerAvailableLanguageKeys(): string[]; registerAvailableLanguageKeys(languageKeys: string[], aliases?: ILanguageKeyAlias): ITranslateProvider; useLoaderCache(cache?: any): ITranslateProvider; + resolveClientLocale():string; } } diff --git a/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts b/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts index 7851d2da37..d92c90bc60 100644 --- a/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts +++ b/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts @@ -181,6 +181,10 @@ testApp.controller('TestCtrl', ( $log.log('modal rendered'); }); + modalInstance.closed.then(()=> { + $log.log('modal closed'); + }); + modalInstance.result.then((closeResult:any)=> { $log.log('modal closed', closeResult); }, (dismissResult:any)=> { diff --git a/angular-ui-bootstrap/angular-ui-bootstrap.d.ts b/angular-ui-bootstrap/angular-ui-bootstrap.d.ts index 29ad03485b..dd129d141d 100644 --- a/angular-ui-bootstrap/angular-ui-bootstrap.d.ts +++ b/angular-ui-bootstrap/angular-ui-bootstrap.d.ts @@ -270,6 +270,11 @@ declare namespace angular.ui.bootstrap { * A promise that is resolved when a modal is rendered. */ rendered: angular.IPromise; + + /** + * A promise that is resolved when a modal is closed and the animation completes. + */ + closed: angular.IPromise; } interface IModalScope extends angular.IScope { @@ -382,6 +387,19 @@ declare namespace angular.ui.bootstrap { * @default 'model-open' */ openedClass?: string; + + /** + * CSS class(es) to be added to the top modal window. + */ + + windowTopClass?: string; + + /** + * Appends the modal to a specific element. + * + * @default 'body' + */ + appendTo?: angular.IAugmentedJQuery; } interface IModalStackService { 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 0512528097..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; @@ -35,7 +29,7 @@ declare namespace angular.ui { /** * String HTML content, or function that returns an HTML string */ - template?: string | {(): string}; + template?: string | {(params: IStateParamsService): string}; /** * String URL path to template file OR Function, returns URL path string */ @@ -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; @@ -229,9 +227,9 @@ declare namespace angular.ui { */ notify?: boolean; /** - * {boolean=false}, If true will force transition even if the state or params have not changed, aka a reload of the same state. It differs from reloadOnSearch because you'd use this when you want to force a reload when everything is the same, including search params. + * {boolean=false|string|IState}, If true will force transition even if the state or params have not changed, aka a reload of the same state. It differs from reloadOnSearch because you'd use this when you want to force a reload when everything is the same, including search params. */ - reload?: boolean; + reload?: boolean | string | IState; } interface IHrefOptions { diff --git a/angular-websocket/angular-websocket-tests.ts b/angular-websocket/angular-websocket-tests.ts new file mode 100644 index 0000000000..e7cb30fe49 --- /dev/null +++ b/angular-websocket/angular-websocket-tests.ts @@ -0,0 +1,71 @@ +/// + +let dummySocket: ng.websocket.IWebSocket; +let dummyPromise: ng.IPromise; +let dummyScope: ng.IScope; + +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) => {}) + .onClose((event) => {}) + .onError((event) => {}) + .onMessage((event) => {}); + +socket.onMessage((event) => {}, { filter: /Some Filter/ }) + .onMessage((event) => {}, { filter: 'Some Filter' }) + .onMessage((event) => {}, { filter: 'Some Filter', autoApply: true }) + .onMessage((event) => {}, { autoApply: false }); + +socket.close(true); +socket.close(); + +socket.send("Some great data here!").finally(() => {}); +socket.send({ list: [1, 2, 3, 4] }); + +socket.socket.send("data"); +socket.socket.close(); +socket.socket.close(1); +socket.socket.close(1, "reason"); + +socket.sendQueue.push({ message: "msg", defered: dummyPromise }); + +socket.onOpenCallbacks.push((event: Event) => {}); +socket.onCloseCallbacks.push((event: CloseEvent) => {}); +socket.onErrorCallbacks.push((event: Event) => {}); +socket.onMessageCallbacks.push({ fn: (event: MessageEvent) => {}, pattern: 'Some Filter', autoApply: true }); +socket.onMessageCallbacks.push({ fn: (event: MessageEvent) => {}, pattern: /Some Filter/, autoApply: true }); +socket.onMessageCallbacks.push({ fn: (event: MessageEvent) => {}, pattern: undefined, autoApply: true }); + +socket.readyState = 0; + +socket.initialTimeout = 10; + +socket.maxTimeout = 5000; + diff --git a/angular-websocket/angular-websocket.d.ts b/angular-websocket/angular-websocket.d.ts new file mode 100644 index 0000000000..6929561f9c --- /dev/null +++ b/angular-websocket/angular-websocket.d.ts @@ -0,0 +1,157 @@ +// Type definitions for angular-websocket v2.0 +// Project: https://github.com/AngularClass/angular-websocket +// Definitions by: Nick Veys +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +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. + * + * @param url url to connect to + * @return websocket instance + */ + (url: string, protocols?: string | string[] | IWebSocketConfigOptions, options?: IWebSocketConfigOptions): IWebSocket; + } + + /** Options available to be specified for IWebSocket.onMessage */ + type IWebSocketMessageOptions = { + + /** + * If specified, only messages that match the filter will cause the message event + * to be fired. + */ + filter?: string | RegExp; + + /** If true, each message handled will safely call `$rootScope.$digest()`. */ + autoApply?: boolean; + } + + /** Type corresponding to onMessage callbaks stored in $Websocket#onMessageCallbacks instance. */ + type IWebSocketMessageHandler = { + fn: (evt: MessageEvent) => void; + pattern: string | RegExp; + autoApply: boolean; + } + + /** Type corresponding to items stored in $WebSocket#sendQueue instance. */ + type IWebSocketQueueItem = { + message: any; + defered: ng.IPromise; + } + + interface IWebSocket { + + /** + * Adds a callback to be executed each time a socket connection is opened for + * this instance. + * + * @param event event object + * @returns this instance, for method chaining + */ + onOpen(callback: (event: Event) => void): IWebSocket; + + /** + * Adds a callback to be executed each time a socket connection is closed for + * this instance. + * + * @param event event object + * @returns this instance, for method chaining + */ + onClose(callback: (event: CloseEvent) => void): IWebSocket; + + /** + * Adds a callback to be executed each time a socket connection is closed for + * this instance. + * + * @param event event object + * @returns this instance, for method chaining + */ + onError(callback: (event: Event) => void): IWebSocket; + + /** + * Adds a callback to be executed each time a socket connection has an error for + * this instance. + * + * @param event event object + * @returns this instance, for method chaining + */ + onMessage(callback: (event: MessageEvent) => void, options?: IWebSocketMessageOptions): IWebSocket; + + /** + * Closes the underlying socket, as long as no data is still being sent from the client. + * + * @param force if `true`, force close even if data is still being sent + * @returns this instance, for method chaining + */ + close(force?: boolean): IWebSocket; + + /** + * Adds data to a queue, and attempts to send if the socket is ready. + * + * @param data data to send, if this is an object, it will be stringified before sending + */ + send(data: string | {}): ng.IPromise; + + /** + * WebSocket instance. + */ + socket: WebSocket; + + /** + * Queue of send calls to be made on socket when socket is able to receive data. + */ + sendQueue: IWebSocketQueueItem[]; + + /** + * List of callbacks to be executed when the socket is opened. + */ + onOpenCallbacks: ((evt: Event) => void)[]; + + /** + * List of callbacks to be executed when a message is received from the socket. + */ + onMessageCallbacks: IWebSocketMessageHandler[]; + + /** + * List of callbacks to be executed when an error is received from the socket. + */ + onErrorCallbacks: ((evt: Event) => void)[]; + + /** + * List of callbacks to be executed when the socket is closed. + */ + onCloseCallbacks: ((evt: CloseEvent) => void)[]; + + /** + * Returns either the readyState value from the underlying WebSocket instance + * or a proprietary value representing the internal state + */ + readyState: number; + + /** + * The initial timeout. + */ + initialTimeout: number; + + /** + * Maximun timeout used to determine reconnection delay. + */ + maxTimeout: number; + } +} 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 2f3cbc0f18..2451976bf5 100644 --- a/angularjs/angular-animate.d.ts +++ b/angularjs/angular-animate.d.ts @@ -19,14 +19,14 @@ declare namespace angular.animate { } interface IAnimateCallbackObject { - eventFn?: (element: IAugmentedJQuery, doneFunction: Function, options: IAnimationOptions) => any; - setClass?: (element: IAugmentedJQuery, addedClasses: string, removedClasses: string, doneFunction: Function, options: IAnimationOptions) => any; - addClass?: (element: IAugmentedJQuery, addedClasses: string, doneFunction: Function, options: IAnimationOptions) => any; - removeClass?: (element: IAugmentedJQuery, removedClasses: string, doneFunction: Function, options: IAnimationOptions) => any; - enter?: (element: IAugmentedJQuery, doneFunction: Function, options: IAnimationOptions) => any; - leave?: (element: IAugmentedJQuery, doneFunction: Function, options: IAnimationOptions) => any; - move?: (element: IAugmentedJQuery, doneFunction: Function, options: IAnimationOptions) => any; - animate?: (element: IAugmentedJQuery, fromStyles: string, toStyles: string, doneFunction: Function, options: IAnimationOptions) => any; + eventFn?: (element: JQuery, doneFunction: Function, options: IAnimationOptions) => any; + setClass?: (element: JQuery, addedClasses: string, removedClasses: string, doneFunction: Function, options: IAnimationOptions) => any; + addClass?: (element: JQuery, addedClasses: string, doneFunction: Function, options: IAnimationOptions) => any; + removeClass?: (element: JQuery, removedClasses: string, doneFunction: Function, options: IAnimationOptions) => any; + enter?: (element: JQuery, doneFunction: Function, options: IAnimationOptions) => any; + leave?: (element: JQuery, doneFunction: Function, options: IAnimationOptions) => any; + move?: (element: JQuery, doneFunction: Function, options: IAnimationOptions) => any; + animate?: (element: JQuery, fromStyles: string, toStyles: string, doneFunction: Function, options: IAnimationOptions) => any; } interface IAnimationPromise extends IPromise {} @@ -43,7 +43,7 @@ declare namespace angular.animate { * @param container the container element that will capture each of the animation events that are fired on itself as well as among its children * @param callback the callback function that will be fired when the listener is triggered */ - on(event: string, container: JQuery, callback: Function): void; + on(event: string, container: JQuery, callback: (element?: JQuery, phase?: string) => any): void; /** * Deregisters an event listener based on the event which has been associated with the provided element. @@ -52,7 +52,7 @@ declare namespace angular.animate { * @param container the container element the event listener was placed on * @param callback the callback function that was registered as the listener */ - off(event: string, container?: JQuery, callback?: Function): void; + off(event: string, container?: JQuery, callback?: (element?: JQuery, phase?: string) => any): void; /** * Associates the provided element with a host parent element to allow the element to be animated even if it exists outside of the DOM structure of the Angular application. @@ -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. @@ -183,16 +183,6 @@ declare namespace angular.animate { * see https://docs.angularjs.org/api/ngAnimate/#applying-directive-specific-styles-to-an-animation */ interface IAnimationOptions { - /** - * The ending CSS styles (a key/value object) that will be applied across the animation via a CSS transition. - */ - to?: Object; - - /** - * The starting CSS styles (a key/value object) that will be applied at the start of the animation. - */ - from?: Object; - /** * The DOM event (e.g. enter, leave, move). When used, a generated CSS class of ng-EVENT and * ng-EVENT-active will be applied to the element during the animation. Multiple events can be provided when @@ -200,6 +190,12 @@ declare namespace angular.animate { */ event?: string; + /** + * Indicates that the ng-prefix will be added to the event class. Setting to false or + * omitting will turn ng-EVENT and ng-EVENT-active in EVENT and EVENT-active. Unused if event is omitted. + */ + structural?: boolean; + /** * The CSS easing value that will be applied to the transition or keyframe animation (or both). */ @@ -208,12 +204,22 @@ declare namespace angular.animate { /** * The raw CSS transition style that will be used (e.g. 1s linear all). */ - transition?: string; + transitionStyle?: string; /** * The raw CSS keyframe animation style that will be used (e.g. 1s my_animation linear). */ - keyframe?: string; + keyframeStyle?: string; + + /** + * The starting CSS styles (a key/value object) that will be applied at the start of the animation. + */ + from?: Object; + + /** + * The ending CSS styles (a key/value object) that will be applied across the animation via a CSS transition. + */ + to?: Object; /** * A space separated list of CSS classes that will be added to the element and spread across the animation. @@ -250,11 +256,16 @@ declare namespace angular.animate { /** * The numeric index representing the stagger item (e.g. a value of 5 is equal to the sixth item * in the stagger; therefore when a stagger option value of 0.1 is used then there will be a stagger delay of 600ms) - * applyClassesEarly - Whether or not the classes being added or removed will be used when detecting the animation. - * This is set by $animate when enter/leave/move animations are fired to ensure that the CSS classes are resolved in time. - * (Note that this will prevent any transitions from occuring on the classes being added and removed.) + * */ staggerIndex?: number; + + /** + * Whether or not the provided from and to styles will be removed once the animation is closed. This is useful for + * when the styles are used purely for the sake of the animation and do not have a lasting visual effect on the element + * (e.g. a colapse and open animation). By default this value is set to false. + */ + cleanupStyles?: boolean; } interface IAnimateCssRunner { diff --git a/angularjs/angular-component-router.d.ts b/angularjs/angular-component-router.d.ts index 2c56ef3a21..3b037b58b1 100644 --- a/angularjs/angular-component-router.d.ts +++ b/angularjs/angular-component-router.d.ts @@ -428,4 +428,55 @@ declare namespace angular { interface OnReuse { $routerOnReuse(next?: angular.ComponentInstruction, prev?: angular.ComponentInstruction): any; } + + /** + * Runtime representation a type that a Component or other object is instances of. + * + * An example of a `Type` is `MyCustomComponent` class, which in JavaScript is be represented by + * the `MyCustomComponent` constructor function. + */ + interface Type extends Function { + } + + /** + * `RouteDefinition` defines a route within a {@link RouteConfig} decorator. + * + * Supported keys: + * - `path` or `aux` (requires exactly one of these) + * - `component`, `loader`, `redirectTo` (requires exactly one of these) + * - `name` or `as` (optional) (requires exactly one of these) + * - `data` (optional) + * + * See also {@link Route}, {@link AsyncRoute}, {@link AuxRoute}, and {@link Redirect}. + */ + interface RouteDefinition { + path?: string; + aux?: string; + component?: Type | ComponentDefinition | string; + loader?: Function; + redirectTo?: any[]; + as?: string; + name?: string; + data?: any; + useAsDefault?: boolean; + } + + /** + * Represents either a component type (`type` is `component`) or a loader function + * (`type` is `loader`). + * + * See also {@link RouteDefinition}. + */ + interface ComponentDefinition { + type: string; + loader?: Function; + component?: Type; + } + + // Supplement IComponentOptions from angular.d.ts with router-specific + // fields. + interface IComponentOptions { + $canActivate?: () => boolean; + $routeConfig?: RouteDefinition[]; + } } diff --git a/angularjs/angular-mocks-tests.ts b/angularjs/angular-mocks-tests.ts index 8790e68cf3..ed72401d0c 100644 --- a/angularjs/angular-mocks-tests.ts +++ b/angularjs/angular-mocks-tests.ts @@ -137,15 +137,19 @@ requestHandler = httpBackendService.expect('GET', /test.local/); requestHandler = httpBackendService.expect('GET', /test.local/, 'response data'); requestHandler = httpBackendService.expect('GET', /test.local/, 'response data', { header: 'value' }); requestHandler = httpBackendService.expect('GET', /test.local/, 'response data', function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.expect('GET', /test.local\/(\d+)/, 'response data', function (headers: Object): boolean { return true; }, ['id']); requestHandler = httpBackendService.expect('GET', /test.local/, /response data/); requestHandler = httpBackendService.expect('GET', /test.local/, /response data/, { header: 'value' }); requestHandler = httpBackendService.expect('GET', /test.local/, /response data/, function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.expect('GET', /test.local\/(\d+)/, /response data/, function (headers: Object): boolean { return true; }, ['id']); requestHandler = httpBackendService.expect('GET', /test.local/, function (data: string): boolean { return true; }); requestHandler = httpBackendService.expect('GET', /test.local/, function (data: string): boolean { return true; }, { header: 'value' }); requestHandler = httpBackendService.expect('GET', /test.local/, function (data: string): boolean { return true; }, function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.expect('GET', /test.local\/(\d+)/, function (data: string): boolean { return true; }, function (headers: Object): boolean { return true; }, ['id']); requestHandler = httpBackendService.expect('GET', /test.local/, { key: 'value' }); requestHandler = httpBackendService.expect('GET', /test.local/, { key: 'value' }, { header: 'value' }); requestHandler = httpBackendService.expect('GET', /test.local/, { key: 'value' }, function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.expect('GET', /test.local\/(\d+)/, { key: 'value' }, function (headers: Object): boolean { return true; }, ['id']); requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }); requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, 'response data'); requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, 'response data', { header: 'value' }); @@ -163,17 +167,21 @@ requestHandler = httpBackendService.expect('GET', (url: string) => { return true requestHandler = httpBackendService.expectDELETE('http://test.local'); requestHandler = httpBackendService.expectDELETE('http://test.local', { header: 'value' }); requestHandler = httpBackendService.expectDELETE(/test.local/, { header: 'value' }); +requestHandler = httpBackendService.expectDELETE(/test.local\/(\d+)/, { header: 'value' }, ['id']); requestHandler = httpBackendService.expectDELETE((url: string) => { return true; }, { header: 'value' }); requestHandler = httpBackendService.expectGET('http://test.local'); requestHandler = httpBackendService.expectGET('http://test.local', { header: 'value' }); requestHandler = httpBackendService.expectGET(/test.local/, { header: 'value' }); +requestHandler = httpBackendService.expectGET(/test.local\/(\d+)/, { header: 'value' }, ['id']); requestHandler = httpBackendService.expectGET((url: string) => { return true; }, { header: 'value' }); requestHandler = httpBackendService.expectHEAD('http://test.local'); requestHandler = httpBackendService.expectHEAD('http://test.local', { header: 'value' }); requestHandler = httpBackendService.expectHEAD(/test.local/, { header: 'value' }); +requestHandler = httpBackendService.expectHEAD(/test.local\/(\d+)/, { header: 'value' }, ['id']); requestHandler = httpBackendService.expectHEAD((url: string) => { return true; }, { header: 'value' }); requestHandler = httpBackendService.expectJSONP('http://test.local'); requestHandler = httpBackendService.expectJSONP(/test.local/); +requestHandler = httpBackendService.expectJSONP(/test.local\/(\d+)/, ['id']); requestHandler = httpBackendService.expectJSONP((url: string) => { return true; }); requestHandler = httpBackendService.expectPATCH('http://test.local'); @@ -188,12 +196,15 @@ requestHandler = httpBackendService.expectPATCH('http://test.local', { key: 'val requestHandler = httpBackendService.expectPATCH(/test.local/); requestHandler = httpBackendService.expectPATCH(/test.local/, 'response data'); requestHandler = httpBackendService.expectPATCH(/test.local/, 'response data', { header: 'value' }); +requestHandler = httpBackendService.expectPATCH(/test.local\/(\d+)/, 'response data', { header: 'value' }, ['id']); requestHandler = httpBackendService.expectPATCH(/test.local/, /response data/); requestHandler = httpBackendService.expectPATCH(/test.local/, /response data/, { header: 'value' }); requestHandler = httpBackendService.expectPATCH(/test.local/, function (data: string): boolean { return true; }); requestHandler = httpBackendService.expectPATCH(/test.local/, function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.expectPATCH(/test.local\/(\d+)/, function (data: string): boolean { return true; }, { header: 'value' }, ['id']); requestHandler = httpBackendService.expectPATCH(/test.local/, { key: 'value' }); requestHandler = httpBackendService.expectPATCH(/test.local/, { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.expectPATCH(/test.local\/(\d+)/, { key: 'value' }, { header: 'value' }, ['id']); requestHandler = httpBackendService.expectPATCH((url: string) => { return true; }); requestHandler = httpBackendService.expectPATCH((url: string) => { return true; }, 'response data'); requestHandler = httpBackendService.expectPATCH((url: string) => { return true; }, 'response data', { header: 'value' }); @@ -216,12 +227,15 @@ requestHandler = httpBackendService.expectPOST('http://test.local', { key: 'valu requestHandler = httpBackendService.expectPOST(/test.local/); requestHandler = httpBackendService.expectPOST(/test.local/, 'response data'); requestHandler = httpBackendService.expectPOST(/test.local/, 'response data', { header: 'value' }); +requestHandler = httpBackendService.expectPOST(/test.local\/(\d+)/, 'response data', { header: 'value' }, ['id']); requestHandler = httpBackendService.expectPOST(/test.local/, /response data/); requestHandler = httpBackendService.expectPOST(/test.local/, /response data/, { header: 'value' }); +requestHandler = httpBackendService.expectPOST(/test.local\/(\d+)/, /response data/, { header: 'value' }, ['id']); requestHandler = httpBackendService.expectPOST(/test.local/, function (data: string): boolean { return true; }); requestHandler = httpBackendService.expectPOST(/test.local/, function (data: string): boolean { return true; }, { header: 'value' }); requestHandler = httpBackendService.expectPOST(/test.local/, { key: 'value' }); requestHandler = httpBackendService.expectPOST(/test.local/, { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.expectPOST(/test.local\/(\d+)/, { key: 'value' }, { header: 'value' }, ['id']); requestHandler = httpBackendService.expectPOST((url: string) => { return true; }); requestHandler = httpBackendService.expectPOST((url: string) => { return true; }, 'response data'); requestHandler = httpBackendService.expectPOST((url: string) => { return true; }, 'response data', { header: 'value' }); @@ -244,12 +258,16 @@ requestHandler = httpBackendService.expectPUT('http://test.local', { key: 'value requestHandler = httpBackendService.expectPUT(/test.local/); requestHandler = httpBackendService.expectPUT(/test.local/, 'response data'); requestHandler = httpBackendService.expectPUT(/test.local/, 'response data', { header: 'value' }); +requestHandler = httpBackendService.expectPUT(/test.local\/(\d+)/, 'response data', { header: 'value' }, ['id']); requestHandler = httpBackendService.expectPUT(/test.local/, /response data/); requestHandler = httpBackendService.expectPUT(/test.local/, /response data/, { header: 'value' }); +requestHandler = httpBackendService.expectPUT(/test.local\/(\d+)/, /response data/, { header: 'value' }, ['id']); requestHandler = httpBackendService.expectPUT(/test.local/, function (data: string): boolean { return true; }); requestHandler = httpBackendService.expectPUT(/test.local/, function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.expectPUT(/test.local\/(\d+)/, function (data: string): boolean { return true; }, { header: 'value' }, ['id']); requestHandler = httpBackendService.expectPUT(/test.local/, { key: 'value' }); requestHandler = httpBackendService.expectPUT(/test.local/, { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.expectPUT(/test.local\/(\d+)/, { key: 'value' }, { header: 'value' }, ['id']); requestHandler = httpBackendService.expectPUT((url: string) => { return true; }); requestHandler = httpBackendService.expectPUT((url: string) => { return true; }, 'response data'); requestHandler = httpBackendService.expectPUT((url: string) => { return true; }, 'response data', { header: 'value' }); @@ -276,16 +294,24 @@ requestHandler = httpBackendService.when('GET', 'http://test.local', { key: 'val requestHandler = httpBackendService.when('GET', /test.local/); requestHandler = httpBackendService.when('GET', /test.local/, 'response data'); requestHandler = httpBackendService.when('GET', /test.local/, 'response data', { header: 'value' }); +requestHandler = httpBackendService.when('GET', /test.local\/(\d+)/, 'response data', { header: 'value' }, ['id']); requestHandler = httpBackendService.when('GET', /test.local/, 'response data', function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.when('GET', /test.local\/(\d+)/, 'response data', function (headers: Object): boolean { return true; }, ['id']); requestHandler = httpBackendService.when('GET', /test.local/, /response data/); requestHandler = httpBackendService.when('GET', /test.local/, /response data/, { header: 'value' }); +requestHandler = httpBackendService.when('GET', /test.local\/(\d+)/, /response data/, { header: 'value' }, ['id']); requestHandler = httpBackendService.when('GET', /test.local/, /response data/, function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.when('GET', /test.local\/(\d+)/, /response data/, function (headers: Object): boolean { return true; }, ['id']); requestHandler = httpBackendService.when('GET', /test.local/, function (data: string): boolean { return true; }); requestHandler = httpBackendService.when('GET', /test.local/, function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.when('GET', /test.local\/(\d+)/, function (data: string): boolean { return true; }, { header: 'value' }, ['id']); requestHandler = httpBackendService.when('GET', /test.local/, function (data: string): boolean { return true; }, function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.when('GET', /test.local\/(\d+)/, function (data: string): boolean { return true; }, function (headers: Object): boolean { return true; }, ['id']); requestHandler = httpBackendService.when('GET', /test.local/, { key: 'value' }); requestHandler = httpBackendService.when('GET', /test.local/, { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.when('GET', /test.local\/(\d+)/, { key: 'value' }, { header: 'value' }, ['id']); requestHandler = httpBackendService.when('GET', /test.local/, { key: 'value' }, function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.when('GET', /test.local\/(\d+)/, { key: 'value' }, function (headers: Object): boolean { return true; }, ['id']); requestHandler = httpBackendService.when('GET', (url: string) => { return true; }); requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, 'response data'); requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, 'response data', { header: 'value' }); @@ -303,17 +329,21 @@ requestHandler = httpBackendService.when('GET', (url: string) => { return true; requestHandler = httpBackendService.whenDELETE('http://test.local'); requestHandler = httpBackendService.whenDELETE('http://test.local', { header: 'value' }); requestHandler = httpBackendService.whenDELETE(/test.local/, { header: 'value' }); +requestHandler = httpBackendService.whenDELETE(/test.local\/(\d+)/, { header: 'value' }, ['id']); requestHandler = httpBackendService.whenDELETE((url: string) => { return true; }, { header: 'value' }); requestHandler = httpBackendService.whenGET('http://test.local'); requestHandler = httpBackendService.whenGET('http://test.local', { header: 'value' }); requestHandler = httpBackendService.whenGET(/test.local/, { header: 'value' }); +requestHandler = httpBackendService.whenGET(/test.local\/(\d+)/, { header: 'value' }, ['id']); requestHandler = httpBackendService.whenGET((url: string) => { return true; }, { header: 'value' }); requestHandler = httpBackendService.whenHEAD('http://test.local'); requestHandler = httpBackendService.whenHEAD('http://test.local', { header: 'value' }); requestHandler = httpBackendService.whenHEAD(/test.local/, { header: 'value' }); +requestHandler = httpBackendService.whenHEAD(/test.local\/(\d+)/, { header: 'value' }, ['id']); requestHandler = httpBackendService.whenHEAD((url: string) => { return true; }, { header: 'value' }); requestHandler = httpBackendService.whenJSONP('http://test.local'); requestHandler = httpBackendService.whenJSONP(/test.local/); +requestHandler = httpBackendService.whenJSONP(/test.local\/(\d+)/, ['id']); requestHandler = httpBackendService.whenJSONP((url: string) => { return true; }); requestHandler = httpBackendService.whenPATCH('http://test.local'); @@ -328,12 +358,16 @@ requestHandler = httpBackendService.whenPATCH('http://test.local', { key: 'value requestHandler = httpBackendService.whenPATCH(/test.local/); requestHandler = httpBackendService.whenPATCH(/test.local/, 'response data'); requestHandler = httpBackendService.whenPATCH(/test.local/, 'response data', { header: 'value' }); +requestHandler = httpBackendService.whenPATCH(/test.local\/(\d+)/, 'response data', { header: 'value' }, ['id']); requestHandler = httpBackendService.whenPATCH(/test.local/, /response data/); requestHandler = httpBackendService.whenPATCH(/test.local/, /response data/, { header: 'value' }); +requestHandler = httpBackendService.whenPATCH(/test.local\/(\d+)/, /response data/, { header: 'value' }, ['id']); requestHandler = httpBackendService.whenPATCH(/test.local/, function (data: string): boolean { return true; }); requestHandler = httpBackendService.whenPATCH(/test.local/, function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.whenPATCH(/test.local\/(\d+)/, function (data: string): boolean { return true; }, { header: 'value' }, ['id']); requestHandler = httpBackendService.whenPATCH(/test.local/, { key: 'value' }); requestHandler = httpBackendService.whenPATCH(/test.local/, { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.whenPATCH(/test.local\/(\d+)/, { key: 'value' }, { header: 'value' }, ['id']); requestHandler = httpBackendService.whenPATCH((url: string) => { return true; }); requestHandler = httpBackendService.whenPATCH((url: string) => { return true; }, 'response data'); requestHandler = httpBackendService.whenPATCH((url: string) => { return true; }, 'response data', { header: 'value' }); @@ -356,12 +390,16 @@ requestHandler = httpBackendService.whenPOST('http://test.local', { key: 'value' requestHandler = httpBackendService.whenPOST(/test.local/); requestHandler = httpBackendService.whenPOST(/test.local/, 'response data'); requestHandler = httpBackendService.whenPOST(/test.local/, 'response data', { header: 'value' }); +requestHandler = httpBackendService.whenPOST(/test.local\/(\d+)/, 'response data', { header: 'value' }, ['id']); requestHandler = httpBackendService.whenPOST(/test.local/, /response data/); requestHandler = httpBackendService.whenPOST(/test.local/, /response data/, { header: 'value' }); +requestHandler = httpBackendService.whenPOST(/test.local\/(\d+)/, /response data/, { header: 'value' }, ['id']); requestHandler = httpBackendService.whenPOST(/test.local/, function (data: string): boolean { return true; }); requestHandler = httpBackendService.whenPOST(/test.local/, function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.whenPOST(/test.local\/(\d+)/, function (data: string): boolean { return true; }, { header: 'value' }, ['id']); requestHandler = httpBackendService.whenPOST(/test.local/, { key: 'value' }); requestHandler = httpBackendService.whenPOST(/test.local/, { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.whenPOST(/test.local\/(\d+)/, { key: 'value' }, { header: 'value' }, ['id']); requestHandler = httpBackendService.whenPOST((url: string) => { return true; }); requestHandler = httpBackendService.whenPOST((url: string) => { return true; }, 'response data'); requestHandler = httpBackendService.whenPOST((url: string) => { return true; }, 'response data', { header: 'value' }); @@ -384,12 +422,16 @@ requestHandler = httpBackendService.whenPUT('http://test.local', { key: 'value' requestHandler = httpBackendService.whenPUT(/test.local/); requestHandler = httpBackendService.whenPUT(/test.local/, 'response data'); requestHandler = httpBackendService.whenPUT(/test.local/, 'response data', { header: 'value' }); +requestHandler = httpBackendService.whenPUT(/test.local\/(\d+)/, 'response data', { header: 'value' }, ['id']); requestHandler = httpBackendService.whenPUT(/test.local/, /response data/); requestHandler = httpBackendService.whenPUT(/test.local/, /response data/, { header: 'value' }); +requestHandler = httpBackendService.whenPUT(/test.local\/(\d+)/, /response data/, { header: 'value' }, ['id']); requestHandler = httpBackendService.whenPUT(/test.local/, function (data: string): boolean { return true; }); requestHandler = httpBackendService.whenPUT(/test.local/, function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.whenPUT(/test.local\/(\d+)/, function (data: string): boolean { return true; }, { header: 'value' }, ['id']); requestHandler = httpBackendService.whenPUT(/test.local/, { key: 'value' }); requestHandler = httpBackendService.whenPUT(/test.local/, { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.whenPUT(/test.local\/(\d+)/, { key: 'value' }, { header: 'value' }, ['id']); requestHandler = httpBackendService.whenPUT((url: string) => { return true; }); requestHandler = httpBackendService.whenPUT((url: string) => { return true; }, 'response data'); requestHandler = httpBackendService.whenPUT((url: string) => { return true; }, 'response data', { header: 'value' }); @@ -410,6 +452,13 @@ requestHandler.passThrough().passThrough(); requestHandler.respond((method, url, data, headers) => [404, 'data', { header: 'value' }, 'responseText']); requestHandler.respond((method, url, data, headers) => [404, 'data', { header: 'value' }, 'responseText']).respond({}); requestHandler.respond((method, url, data, headers) => { return [404, { key: 'value' }, { header: 'value' }, 'responseText']; }); +requestHandler.respond((method, url, data, headers, params) => { + if(params.id === 1) { + return [200, { key: 'value'}, { header: 'value'}, 'responseText']; + } else { + return [404, { key: 'value' }, { header: 'value' }, 'responseText']; + } +}); requestHandler.respond('data'); requestHandler.respond('data').respond({}); requestHandler.respond(expectedData); diff --git a/angularjs/angular-mocks.d.ts b/angularjs/angular-mocks.d.ts index 9031cc56d1..d1b204862f 100644 --- a/angularjs/angular-mocks.d.ts +++ b/angularjs/angular-mocks.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Angular JS 1.3 (ngMock, ngMockE2E module) +// Type definitions for Angular JS 1.5 (ngMock, ngMockE2E module) // Project: http://angularjs.org // Definitions by: Diego Vilar , Tony Curtis // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -157,8 +157,9 @@ declare namespace angular { * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + * @param keys Array of keys to assign to regex matches in the request url. */ - expect(method: string, url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean)) :mock.IRequestHandler; + expect(method: string, url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean), keys?: Object[]) :mock.IRequestHandler; /** * Creates a new request expectation for DELETE requests. @@ -166,8 +167,9 @@ declare namespace angular { * Returns an object with respond method that controls how a matched request is handled. * @param url HTTP url string, regular expression or function that receives a url and returns true if the url is as expected. * @param headers HTTP headers object to be compared with the HTTP headers in the request. + * @param keys Array of keys to assign to regex matches in the request url. */ - expectDELETE(url: string | RegExp | ((url: string) => boolean), headers?: Object): mock.IRequestHandler; + expectDELETE(url: string | RegExp | ((url: string) => boolean), headers?: Object, keys?: Object[]): mock.IRequestHandler; /** * Creates a new request expectation for GET requests. @@ -175,8 +177,9 @@ declare namespace angular { * Returns an object with respond method that controls how a matched request is handled. * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. * @param headers HTTP headers object to be compared with the HTTP headers in the request. + * @param keys Array of keys to assign to regex matches in the request url. */ - expectGET(url: string | RegExp | ((url: string) => boolean), headers?: Object): mock.IRequestHandler; + expectGET(url: string | RegExp | ((url: string) => boolean), headers?: Object, keys?: Object[]): mock.IRequestHandler; /** * Creates a new request expectation for HEAD requests. @@ -184,16 +187,19 @@ declare namespace angular { * Returns an object with respond method that controls how a matched request is handled. * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. * @param headers HTTP headers object to be compared with the HTTP headers in the request. + * @param keys Array of keys to assign to regex matches in the request url. */ - expectHEAD(url: string | RegExp | ((url: string) => boolean), headers?: Object): mock.IRequestHandler; + expectHEAD(url: string | RegExp | ((url: string) => boolean), headers?: Object, keys?: Object[]): mock.IRequestHandler; + /** * Creates a new request expectation for JSONP requests. * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, or if function returns false. * Returns an object with respond method that controls how a matched request is handled. * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. - */ - expectJSONP(url: string | RegExp | ((url: string) => boolean)): mock.IRequestHandler; + * @param keys Array of keys to assign to regex matches in the request url. + */ + expectJSONP(url: string | RegExp | ((url: string) => boolean), keys?: Object[]): mock.IRequestHandler; /** * Creates a new request expectation for PATCH requests. @@ -202,8 +208,9 @@ declare namespace angular { * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + * @param keys Array of keys to assign to regex matches in the request url. */ - expectPATCH(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object): mock.IRequestHandler; + expectPATCH(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object, keys?: Object[]): mock.IRequestHandler; /** * Creates a new request expectation for POST requests. @@ -212,8 +219,9 @@ declare namespace angular { * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + * @param keys Array of keys to assign to regex matches in the request url. */ - expectPOST(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object): mock.IRequestHandler; + expectPOST(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object, keys?: Object[]): mock.IRequestHandler; /** * Creates a new request expectation for PUT requests. @@ -222,8 +230,9 @@ declare namespace angular { * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + * @param keys Array of keys to assign to regex matches in the request url. */ - expectPUT(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object): mock.IRequestHandler; + expectPUT(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object, keys?: Object[]): mock.IRequestHandler; /** * Creates a new backend definition. @@ -232,40 +241,46 @@ declare namespace angular { * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + * @param keys Array of keys to assign to regex matches in the request url. */ - when(method: string, url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler; + when(method: string, url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean), keys?: Object[]): mock.IRequestHandler; /** * Creates a new backend definition for DELETE requests. * Returns an object with respond method that controls how a matched request is handled. * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + * @param keys Array of keys to assign to regex matches in the request url. */ - whenDELETE(url: string | RegExp | ((url: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler; + whenDELETE(url: string | RegExp | ((url: string) => boolean), headers?: Object | ((object: Object) => boolean), keys?: Object[]): mock.IRequestHandler; /** * Creates a new backend definition for GET requests. * Returns an object with respond method that controls how a matched request is handled. * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + * @param keys Array of keys to assign to regex matches in request url described above + * @param keys Array of keys to assign to regex matches in the request url. */ - whenGET(url: string | RegExp | ((url: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler; + whenGET(url: string | RegExp | ((url: string) => boolean), headers?: Object | ((object: Object) => boolean), keys?: Object[]): mock.IRequestHandler; /** * Creates a new backend definition for HEAD requests. * Returns an object with respond method that controls how a matched request is handled. * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + * @param keys Array of keys to assign to regex matches in the request url. */ - whenHEAD(url: string | RegExp | ((url: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler; + whenHEAD(url: string | RegExp | ((url: string) => boolean), headers?: Object | ((object: Object) => boolean), keys?: Object[]): mock.IRequestHandler; /** * Creates a new backend definition for JSONP requests. * Returns an object with respond method that controls how a matched request is handled. * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + * @param keys Array of keys to assign to regex matches in the request url. */ - whenJSONP(url: string | RegExp | ((url: string) => boolean)): mock.IRequestHandler; + whenJSONP(url: string | RegExp | ((url: string) => boolean), keys?: Object[]): mock.IRequestHandler; /** * Creates a new backend definition for PATCH requests. @@ -273,8 +288,9 @@ declare namespace angular { * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + * @param keys Array of keys to assign to regex matches in the request url. */ - whenPATCH(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler; + whenPATCH(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean), keys?: Object[]): mock.IRequestHandler; /** * Creates a new backend definition for POST requests. @@ -282,8 +298,9 @@ declare namespace angular { * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + * @param keys Array of keys to assign to regex matches in the request url. */ - whenPOST(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler; + whenPOST(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean), keys?: Object[]): mock.IRequestHandler; /** * Creates a new backend definition for PUT requests. @@ -291,8 +308,9 @@ declare namespace angular { * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + * @param keys Array of keys to assign to regex matches in the request url. */ - whenPUT(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler; + whenPUT(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean), keys?: Object[]): mock.IRequestHandler; } export module mock { @@ -302,9 +320,9 @@ declare namespace angular { /** * Controls the response for a matched request using a function to construct the response. * Returns the RequestHandler object for possible overrides. - * @param func Function that receives the request HTTP method, url, data, and headers and returns an array containing response status (number), data, headers, and status text. + * @param func Function that receives the request HTTP method, url, data, headers, and an array of keys to regex matches in the request url and returns an array containing response status (number), data, headers, and status text. */ - respond(func: ((method: string, url: string, data: string | Object, headers: Object) => [number, string | Object, Object, string])): IRequestHandler; + respond(func: ((method: string, url: string, data: string | Object, headers: Object, params?: any) => [number, string | Object, Object, string])): IRequestHandler; /** * Controls the response for a matched request using supplied static data to construct the response. diff --git a/angularjs/angular-resource.d.ts b/angularjs/angular-resource.d.ts index 0fb9351342..441a7e1d3d 100644 --- a/angularjs/angular-resource.d.ts +++ b/angularjs/angular-resource.d.ts @@ -95,7 +95,7 @@ declare namespace angular.resource { (params: Object, data: Object, success?: Function, error?: Function): IResourceArray; } - // Baseclass for everyresource with default actions. + // Baseclass for every resource with default actions. // If you define your new actions for the resource, you will need // to extend this interface and typecast the ResourceClass to it. // @@ -113,7 +113,7 @@ declare namespace angular.resource { // Also, static calls always return the IResource (or IResourceArray) retrieved // https://github.com/angular/angular.js/blob/v1.2.0/src/ngResource/resource.js#L538-L549 interface IResourceClass { - new(dataOrParams? : any) : T; + new(dataOrParams? : any) : T & IResource; get: IResourceMethod; query: IResourceArrayMethod; diff --git a/angularjs/angular-tests.ts b/angularjs/angular-tests.ts index 0539ae62ac..ef3e29b4c8 100644 --- a/angularjs/angular-tests.ts +++ b/angularjs/angular-tests.ts @@ -476,6 +476,8 @@ function test_angular_forEach() { var element = angular.element("div.myApp"); var scope: ng.IScope = element.scope(); var isolateScope: ng.IScope = element.isolateScope(); +isolateScope = element.find('div.foo').isolateScope(); +isolateScope = element.children().isolateScope(); // $timeout signature tests @@ -867,7 +869,7 @@ angular.module('docsTabsExample', []) angular.module('componentExample', []) .component('counter', { - require: ['^ctrl'], + require: {'ctrl': '^ctrl'}, bindings: { count: '=' }, @@ -1096,6 +1098,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) { @@ -1103,11 +1111,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 3d2b248637..e64496604f 100644 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -41,7 +41,6 @@ declare namespace angular { interface IAngularBootstrapConfig { strictDi?: boolean; - debugInfoEnabled?: boolean; } /////////////////////////////////////////////////////////////////////////// @@ -81,7 +80,7 @@ declare namespace angular { * * If jQuery is available, angular.element is an alias for the jQuery function. If jQuery is not available, angular.element delegates to Angular's built-in subset of jQuery, called "jQuery lite" or "jqLite." */ - element: IAugmentedJQueryStatic; + element: JQueryStatic; equals(value1: any, value2: any): boolean; extend(destination: any, ...sources: any[]): any; @@ -119,14 +118,14 @@ 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; + isString(value: any): value is string; isUndefined(value: any): boolean; lowercase(str: string): string; @@ -156,7 +155,7 @@ declare namespace angular { noop(...args: any[]): void; reloadWithDebugInfo(): void; - toJson(obj: any, pretty?: boolean): string; + toJson(obj: any, pretty?: boolean | number): string; uppercase(str: string): string; version: { full: string; @@ -388,10 +387,11 @@ declare namespace angular { $invalid: boolean; $submitted: boolean; $error: any; + $name: string; $pending: any; - $addControl(control: INgModelController): void; - $removeControl(control: INgModelController): void; - $setValidity(validationErrorKey: string, isValid: boolean, control: INgModelController): void; + $addControl(control: INgModelController | IFormController): void; + $removeControl(control: INgModelController | IFormController): void; + $setValidity(validationErrorKey: string, isValid: boolean, control: INgModelController | IFormController): void; $setDirty(): void; $setPristine(): void; $commitViewValue(): void; @@ -874,7 +874,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 { @@ -883,6 +883,24 @@ declare namespace angular { unwrapPromises(): boolean; unwrapPromises(value: boolean): IParseProvider; + + /** + * Configure $parse service to add literal values that will be present as literal at expressions. + * + * @param literalName Token for the literal value. The literal name value must be a valid literal name. + * @param literalValue Value for this literal. All literal values must be primitives or `undefined`. + **/ + addLiteral(literalName: string, literalValue: any): void; + + /** + * Allows defining the set of characters that are allowed in Angular expressions. The function identifierStart will get called to know if a given character is a valid character to be the first character for an identifier. The function identifierContinue will get called to know if a given character is a valid character to be a follow-up identifier character. The functions identifierStart and identifierContinue will receive as arguments the single character to be identifier and the character code point. These arguments will be string and numeric. Keep in mind that the string parameter can be two characters long depending on the character representation. It is expected for the function to return true or false, whether that character is allowed or not. + * Since this function will be called extensivelly, keep the implementation of these functions fast, as the performance of these functions have a direct impact on the expressions parsing speed. + * + * @param identifierStart The function that will decide whether the given character is a valid identifier start character. + * @param identifierContinue The function that will decide whether the given character is a valid identifier continue character. + **/ + setIdentifierFns(identifierStart?: (character: string, codePoint: number) => boolean, + identifierContinue?: (character: string, codePoint: number) => boolean): void; } interface ICompiledExpression { @@ -968,7 +986,10 @@ declare namespace angular { // DocumentService // see http://docs.angularjs.org/api/ng.$document /////////////////////////////////////////////////////////////////////////// - interface IDocumentService extends IAugmentedJQuery {} + interface IDocumentService extends JQuery { + // Must return intersection type for index signature compatibility with JQuery + [index: number]: HTMLElement & Document; + } /////////////////////////////////////////////////////////////////////////// // ExceptionHandlerService @@ -1231,15 +1252,15 @@ declare namespace angular { // This corresponds to the "publicLinkFn" returned by $compile. interface ITemplateLinkingFunction { - (scope: IScope, cloneAttachFn?: ICloneAttachFunction): IAugmentedJQuery; + (scope: IScope, cloneAttachFn?: ICloneAttachFunction): JQuery; } // 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): IAugmentedJQuery; + (scope: IScope, cloneAttachFn: ICloneAttachFunction): JQuery; // If one argument is provided, then it's assumed to be the cloneAttachFn. - (cloneAttachFn?: ICloneAttachFunction): IAugmentedJQuery; + (cloneAttachFn?: ICloneAttachFunction): JQuery; } /////////////////////////////////////////////////////////////////////////// @@ -1656,50 +1677,6 @@ declare namespace angular { // see http://angularjs.blogspot.com.br/2015/11/angularjs-15-beta2-and-14-releases.html // and http://toddmotto.com/exploring-the-angular-1-5-component-method/ /////////////////////////////////////////////////////////////////////////// - /** - * Runtime representation a type that a Component or other object is instances of. - * - * An example of a `Type` is `MyCustomComponent` class, which in JavaScript is be represented by - * the `MyCustomComponent` constructor function. - */ - interface Type extends Function { - } - - /** - * `RouteDefinition` defines a route within a {@link RouteConfig} decorator. - * - * Supported keys: - * - `path` or `aux` (requires exactly one of these) - * - `component`, `loader`, `redirectTo` (requires exactly one of these) - * - `name` or `as` (optional) (requires exactly one of these) - * - `data` (optional) - * - * See also {@link Route}, {@link AsyncRoute}, {@link AuxRoute}, and {@link Redirect}. - */ - interface RouteDefinition { - path?: string; - aux?: string; - component?: Type | ComponentDefinition | string; - loader?: Function; - redirectTo?: any[]; - as?: string; - name?: string; - data?: any; - useAsDefault?: boolean; - } - - /** - * Represents either a component type (`type` is `component`) or a loader function - * (`type` is `loader`). - * - * See also {@link RouteDefinition}. - */ - interface ComponentDefinition { - type: string; - loader?: Function; - component?: Type; - } - /** * Component definition object (a simplified directive definition object) */ @@ -1709,7 +1686,7 @@ declare namespace angular { * controller if passed as a string. Empty function by default. * Use the array form to define dependencies (necessary if strictDi is enabled and you require dependency injection) */ - controller?: string | Function | (string | Function)[]; + controller?: string | Function | (string | Function)[] | IComponentController; /** * An identifier name for a reference to the controller. If present, the controller will be published to scope under * the controllerAs name. If not present, this will default to be the same as the component name. @@ -1742,11 +1719,58 @@ declare namespace angular { * Whether transclusion is enabled. Enabled by default. */ transclude?: boolean | string | {[slot: string]: string}; - require?: string | string[] | {[controller: 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?: IAugmentedJQuery, $attrs?: IAttributes ): string; + ( $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. + * @url https://docs.angularjs.org/guide/component + */ + interface IComponentController { + /** + * Called on each controller after all the controllers on an element have been constructed and had their bindings + * initialized (and before the pre & post linking functions for the directives on this element). This is a good + * place to put initialization code for your controller. + */ + $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 + * { 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; + /** + * Called on a controller when its containing scope is destroyed. Use this hook for releasing external resources, + * watches and event handlers. + */ + $onDestroy?(): void; + /** + * Called after this controller's element and its children have been linked. Similar to the post-link function this + * hook can be used to set up DOM event handlers and do direct DOM manipulation. Note that child elements that contain + * templateUrl directives will not have been compiled and linked since they are waiting for their template to load + * asynchronously and their own compilation and linking has been suspended until that occurs. This hook can be considered + * analogous to the ngAfterViewInit and ngAfterContentInit hooks in Angular 2. Since the compilation process is rather + * different in Angular 1 there is no direct mapping and care should be taken when upgrading. + */ + $postLink?(): void; + } + + interface IChangesObject { + currentValue: any; + previousValue: any; + isFirstChange(): boolean; } /////////////////////////////////////////////////////////////////////////// @@ -1762,7 +1786,7 @@ declare namespace angular { interface IDirectiveLinkFn { ( scope: IScope, - instanceElement: IAugmentedJQuery, + instanceElement: JQuery, instanceAttributes: IAttributes, controller: {}, transclude: ITranscludeFunction @@ -1776,7 +1800,7 @@ declare namespace angular { interface IDirectiveCompileFn { ( - templateElement: IAugmentedJQuery, + templateElement: JQuery, templateAttributes: IAttributes, /** * @deprecated @@ -1785,7 +1809,7 @@ declare namespace angular { * that is passed to the link function instead. */ transclude: ITranscludeFunction - ): IDirectivePrePost; + ): void | IDirectivePrePost; } interface IDirective { @@ -1818,44 +1842,14 @@ declare namespace angular { } /** - * angular.element - * when calling angular.element, angular returns a jQuery object, - * augmented with additional methods like e.g. scope. - * see: http://docs.angularjs.org/api/angular.element + * These interfaces are kept for compatibility with older versions of these type definitions. + * Actually, Angular doesn't create a special subclass of jQuery objects. It extends jQuery.prototype + * like jQuery plugins do, that's why all jQuery objects have these Angular-specific methods, not + * only those returned from angular.element. + * See: http://docs.angularjs.org/api/angular.element */ - interface IAugmentedJQueryStatic extends JQueryStatic { - (selector: string, context?: any): IAugmentedJQuery; - (element: Element): IAugmentedJQuery; - (object: {}): IAugmentedJQuery; - (elementArray: Element[]): IAugmentedJQuery; - (object: JQuery): IAugmentedJQuery; - (func: Function): IAugmentedJQuery; - (array: any[]): IAugmentedJQuery; - (): IAugmentedJQuery; - } - - interface IAugmentedJQuery extends JQuery { - // TODO: events, how to define? - //$destroy - - find(selector: string): IAugmentedJQuery; - find(element: any): IAugmentedJQuery; - find(obj: JQuery): IAugmentedJQuery; - controller(): any; - controller(name: string): any; - injector(): any; - scope(): IScope; - - /** - * Overload for custom scope interfaces - */ - scope(): T; - isolateScope(): IScope; - - inheritedData(key: string, value: any): JQuery; - inheritedData(obj: { [key: string]: any; }): JQuery; - inheritedData(key?: string): any; - } + interface IAugmentedJQueryStatic extends JQueryStatic {} + interface IAugmentedJQuery extends JQuery {} /////////////////////////////////////////////////////////////////////////// // AUTO module (angular.js) @@ -1870,6 +1864,33 @@ declare namespace angular { annotate(fn: Function, strictDi?: boolean): string[]; annotate(inlineAnnotatedFunction: any[]): string[]; get(name: string, caller?: string): T; + get(name: '$anchorScroll'): IAnchorScrollService + get(name: '$cacheFactory'): ICacheFactoryService + get(name: '$compile'): ICompileService + get(name: '$controller'): IControllerService + get(name: '$document'): IDocumentService + get(name: '$exceptionHandler'): IExceptionHandlerService + get(name: '$filter'): IFilterService + get(name: '$http'): IHttpService + get(name: '$httpBackend'): IHttpBackendService + get(name: '$httpParamSerializer'): IHttpParamSerializer + get(name: '$httpParamSerializerJQLike'): IHttpParamSerializer + get(name: '$interpolate'): IInterpolateService + get(name: '$interval'): IIntervalService + get(name: '$locale'): ILocaleService + get(name: '$location'): ILocationService + get(name: '$log'): ILogService + get(name: '$parse'): IParseService + get(name: '$q'): IQService + get(name: '$rootElement'): IRootElementService + get(name: '$rootScope'): IRootScopeService + get(name: '$sce'): ISCEService + get(name: '$sceDelegate'): ISCEDelegateService + get(name: '$templateCache'): ITemplateCacheService + get(name: '$templateRequest'): ITemplateRequestService + get(name: '$timeout'): ITimeoutService + get(name: '$window'): IWindowService + get(name: '$xhrFactory'): IXhrFactory has(name: string): boolean; instantiate(typeConstructor: Function, locals?: any): T; invoke(inlineAnnotatedFunction: any[]): any; @@ -1930,3 +1951,20 @@ declare namespace angular { (obj: Object): string; } } + +interface JQuery { + // TODO: events, how to define? + //$destroy + + find(element: any): JQuery; + find(obj: JQuery): JQuery; + controller(name?: string): any; + injector(): ng.auto.IInjectorService; + /** It's declared generic for custom scope interfaces */ + scope(): T; + isolateScope(): T; + + inheritedData(key: string, value: any): JQuery; + inheritedData(obj: { [key: string]: any; }): JQuery; + inheritedData(key?: string): any; +} 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/angularjs/legacy/angular-mocks-1.3-tests.ts b/angularjs/legacy/angular-mocks-1.3-tests.ts new file mode 100644 index 0000000000..3a3db64470 --- /dev/null +++ b/angularjs/legacy/angular-mocks-1.3-tests.ts @@ -0,0 +1,403 @@ +/// + +/////////////////////////////////////// +// IAngularStatic +/////////////////////////////////////// +var angular: ng.IAngularStatic; +var mock: ng.IMockStatic; + +mock = angular.mock; + + +/////////////////////////////////////// +// IMockStatic +/////////////////////////////////////// +var date: Date; + +mock.dump({ key: 'value' }); + +mock.inject( + function () { return 1; }, + function () { return 2; } + ); + +mock.inject( + ['$rootScope', function ($rootScope: ng.IRootScopeService) { return 1; }]); + +// This overload is not documented on the website, but flows from +// how the injector works. +mock.inject( + ['$rootScope', function ($rootScope: ng.IRootScopeService) { return 1; }], + ['$rootScope', function ($rootScope: ng.IRootScopeService) { return 2; }]); + +mock.module('module1', 'module2'); +mock.module( + function () { return 1; }, + function () { return 2; } + ); +mock.module({ module1: function () { return 1; } }); + +date = mock.TzDate(-7, '2013-1-1T15:00:00Z'); +date = mock.TzDate(-8, 12345678); + + +/////////////////////////////////////// +// IExceptionHandlerProvider +/////////////////////////////////////// +var exceptionHandlerProvider: ng.IExceptionHandlerProvider; + +exceptionHandlerProvider.mode('log'); + + +/////////////////////////////////////// +// ITimeoutService +/////////////////////////////////////// +var timeoutService: ng.ITimeoutService; + +timeoutService.flush(); +timeoutService.flush(1234); +timeoutService.flushNext(); +timeoutService.flushNext(1234); +timeoutService.verifyNoPendingTasks(); + +//////////////////////////////////////// +// IIntervalService +//////////////////////////////////////// +var intervalService: ng.IIntervalService; +var intervalServiceTimeActuallyAdvanced: number; + +intervalServiceTimeActuallyAdvanced = intervalService.flush(); +intervalServiceTimeActuallyAdvanced = intervalService.flush(1234); + +/////////////////////////////////////// +// ILogService, ILogCall +/////////////////////////////////////// +var logService: ng.ILogService; +var logCall: ng.ILogCall; +var logs: string[]; + +logService.assertEmpty(); +logService.reset(); + +logCall = logService.debug; +logCall = logService.error; +logCall = logService.info; +logCall = logService.log; +logCall = logService.warn; + +logs = logCall.logs; + + +/////////////////////////////////////// +// IHttpBackendService +/////////////////////////////////////// +var httpBackendService: ng.IHttpBackendService; +var requestHandler: ng.mock.IRequestHandler; + +httpBackendService.flush(); +httpBackendService.flush(1234); +httpBackendService.resetExpectations(); +httpBackendService.verifyNoOutstandingExpectation(); +httpBackendService.verifyNoOutstandingRequest(); + +requestHandler = httpBackendService.expect('GET', 'http://test.local'); +requestHandler = httpBackendService.expect('GET', 'http://test.local', 'response data'); +requestHandler = httpBackendService.expect('GET', 'http://test.local', 'response data', { header: 'value' }); +requestHandler = httpBackendService.expect('GET', 'http://test.local', 'response data', function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.expect('GET', 'http://test.local', /response data/); +requestHandler = httpBackendService.expect('GET', 'http://test.local', /response data/, { header: 'value' }); +requestHandler = httpBackendService.expect('GET', 'http://test.local', /response data/, function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.expect('GET', 'http://test.local', function (data: string): boolean { return true; }); +requestHandler = httpBackendService.expect('GET', 'http://test.local', function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.expect('GET', 'http://test.local', function (data: string): boolean { return true; }, function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.expect('GET', 'http://test.local', { key: 'value' }); +requestHandler = httpBackendService.expect('GET', 'http://test.local', { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.expect('GET', 'http://test.local', { key: 'value' }, function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.expect('GET', /test.local/); +requestHandler = httpBackendService.expect('GET', /test.local/, 'response data'); +requestHandler = httpBackendService.expect('GET', /test.local/, 'response data', { header: 'value' }); +requestHandler = httpBackendService.expect('GET', /test.local/, 'response data', function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.expect('GET', /test.local/, /response data/); +requestHandler = httpBackendService.expect('GET', /test.local/, /response data/, { header: 'value' }); +requestHandler = httpBackendService.expect('GET', /test.local/, /response data/, function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.expect('GET', /test.local/, function (data: string): boolean { return true; }); +requestHandler = httpBackendService.expect('GET', /test.local/, function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.expect('GET', /test.local/, function (data: string): boolean { return true; }, function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.expect('GET', /test.local/, { key: 'value' }); +requestHandler = httpBackendService.expect('GET', /test.local/, { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.expect('GET', /test.local/, { key: 'value' }, function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }); +requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, 'response data'); +requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, 'response data', { header: 'value' }); +requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, 'response data', function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, /response data/); +requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, /response data/, { header: 'value' }); +requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, /response data/, function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, function (data: string): boolean { return true; }); +requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, function (data: string): boolean { return true; }, function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, { key: 'value' }); +requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, { key: 'value' }, function (headers: Object): boolean { return true; }); + +requestHandler = httpBackendService.expectDELETE('http://test.local'); +requestHandler = httpBackendService.expectDELETE('http://test.local', { header: 'value' }); +requestHandler = httpBackendService.expectDELETE(/test.local/, { header: 'value' }); +requestHandler = httpBackendService.expectDELETE((url: string) => { return true; }, { header: 'value' }); +requestHandler = httpBackendService.expectGET('http://test.local'); +requestHandler = httpBackendService.expectGET('http://test.local', { header: 'value' }); +requestHandler = httpBackendService.expectGET(/test.local/, { header: 'value' }); +requestHandler = httpBackendService.expectGET((url: string) => { return true; }, { header: 'value' }); +requestHandler = httpBackendService.expectHEAD('http://test.local'); +requestHandler = httpBackendService.expectHEAD('http://test.local', { header: 'value' }); +requestHandler = httpBackendService.expectHEAD(/test.local/, { header: 'value' }); +requestHandler = httpBackendService.expectHEAD((url: string) => { return true; }, { header: 'value' }); +requestHandler = httpBackendService.expectJSONP('http://test.local'); +requestHandler = httpBackendService.expectJSONP(/test.local/); +requestHandler = httpBackendService.expectJSONP((url: string) => { return true; }); + +requestHandler = httpBackendService.expectPATCH('http://test.local'); +requestHandler = httpBackendService.expectPATCH('http://test.local', 'response data'); +requestHandler = httpBackendService.expectPATCH('http://test.local', 'response data', { header: 'value' }); +requestHandler = httpBackendService.expectPATCH('http://test.local', /response data/); +requestHandler = httpBackendService.expectPATCH('http://test.local', /response data/, { header: 'value' }); +requestHandler = httpBackendService.expectPATCH('http://test.local', function (data: string): boolean { return true; }); +requestHandler = httpBackendService.expectPATCH('http://test.local', function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.expectPATCH('http://test.local', { key: 'value' }); +requestHandler = httpBackendService.expectPATCH('http://test.local', { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.expectPATCH(/test.local/); +requestHandler = httpBackendService.expectPATCH(/test.local/, 'response data'); +requestHandler = httpBackendService.expectPATCH(/test.local/, 'response data', { header: 'value' }); +requestHandler = httpBackendService.expectPATCH(/test.local/, /response data/); +requestHandler = httpBackendService.expectPATCH(/test.local/, /response data/, { header: 'value' }); +requestHandler = httpBackendService.expectPATCH(/test.local/, function (data: string): boolean { return true; }); +requestHandler = httpBackendService.expectPATCH(/test.local/, function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.expectPATCH(/test.local/, { key: 'value' }); +requestHandler = httpBackendService.expectPATCH(/test.local/, { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.expectPATCH((url: string) => { return true; }); +requestHandler = httpBackendService.expectPATCH((url: string) => { return true; }, 'response data'); +requestHandler = httpBackendService.expectPATCH((url: string) => { return true; }, 'response data', { header: 'value' }); +requestHandler = httpBackendService.expectPATCH((url: string) => { return true; }, /response data/); +requestHandler = httpBackendService.expectPATCH((url: string) => { return true; }, /response data/, { header: 'value' }); +requestHandler = httpBackendService.expectPATCH((url: string) => { return true; }, function (data: string): boolean { return true; }); +requestHandler = httpBackendService.expectPATCH((url: string) => { return true; }, function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.expectPATCH((url: string) => { return true; }, { key: 'value' }); +requestHandler = httpBackendService.expectPATCH((url: string) => { return true; }, { key: 'value' }, { header: 'value' }); + +requestHandler = httpBackendService.expectPOST('http://test.local'); +requestHandler = httpBackendService.expectPOST('http://test.local', 'response data'); +requestHandler = httpBackendService.expectPOST('http://test.local', 'response data', { header: 'value' }); +requestHandler = httpBackendService.expectPOST('http://test.local', /response data/); +requestHandler = httpBackendService.expectPOST('http://test.local', /response data/, { header: 'value' }); +requestHandler = httpBackendService.expectPOST('http://test.local', function (data: string): boolean { return true; }); +requestHandler = httpBackendService.expectPOST('http://test.local', function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.expectPOST('http://test.local', { key: 'value' }); +requestHandler = httpBackendService.expectPOST('http://test.local', { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.expectPOST(/test.local/); +requestHandler = httpBackendService.expectPOST(/test.local/, 'response data'); +requestHandler = httpBackendService.expectPOST(/test.local/, 'response data', { header: 'value' }); +requestHandler = httpBackendService.expectPOST(/test.local/, /response data/); +requestHandler = httpBackendService.expectPOST(/test.local/, /response data/, { header: 'value' }); +requestHandler = httpBackendService.expectPOST(/test.local/, function (data: string): boolean { return true; }); +requestHandler = httpBackendService.expectPOST(/test.local/, function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.expectPOST(/test.local/, { key: 'value' }); +requestHandler = httpBackendService.expectPOST(/test.local/, { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.expectPOST((url: string) => { return true; }); +requestHandler = httpBackendService.expectPOST((url: string) => { return true; }, 'response data'); +requestHandler = httpBackendService.expectPOST((url: string) => { return true; }, 'response data', { header: 'value' }); +requestHandler = httpBackendService.expectPOST((url: string) => { return true; }, /response data/); +requestHandler = httpBackendService.expectPOST((url: string) => { return true; }, /response data/, { header: 'value' }); +requestHandler = httpBackendService.expectPOST((url: string) => { return true; }, function (data: string): boolean { return true; }); +requestHandler = httpBackendService.expectPOST((url: string) => { return true; }, function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.expectPOST((url: string) => { return true; }, { key: 'value' }); +requestHandler = httpBackendService.expectPOST((url: string) => { return true; }, { key: 'value' }, { header: 'value' }); + +requestHandler = httpBackendService.expectPUT('http://test.local'); +requestHandler = httpBackendService.expectPUT('http://test.local', 'response data'); +requestHandler = httpBackendService.expectPUT('http://test.local', 'response data', { header: 'value' }); +requestHandler = httpBackendService.expectPUT('http://test.local', /response data/); +requestHandler = httpBackendService.expectPUT('http://test.local', /response data/, { header: 'value' }); +requestHandler = httpBackendService.expectPUT('http://test.local', function (data: string): boolean { return true; }); +requestHandler = httpBackendService.expectPUT('http://test.local', function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.expectPUT('http://test.local', { key: 'value' }); +requestHandler = httpBackendService.expectPUT('http://test.local', { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.expectPUT(/test.local/); +requestHandler = httpBackendService.expectPUT(/test.local/, 'response data'); +requestHandler = httpBackendService.expectPUT(/test.local/, 'response data', { header: 'value' }); +requestHandler = httpBackendService.expectPUT(/test.local/, /response data/); +requestHandler = httpBackendService.expectPUT(/test.local/, /response data/, { header: 'value' }); +requestHandler = httpBackendService.expectPUT(/test.local/, function (data: string): boolean { return true; }); +requestHandler = httpBackendService.expectPUT(/test.local/, function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.expectPUT(/test.local/, { key: 'value' }); +requestHandler = httpBackendService.expectPUT(/test.local/, { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.expectPUT((url: string) => { return true; }); +requestHandler = httpBackendService.expectPUT((url: string) => { return true; }, 'response data'); +requestHandler = httpBackendService.expectPUT((url: string) => { return true; }, 'response data', { header: 'value' }); +requestHandler = httpBackendService.expectPUT((url: string) => { return true; }, /response data/); +requestHandler = httpBackendService.expectPUT((url: string) => { return true; }, /response data/, { header: 'value' }); +requestHandler = httpBackendService.expectPUT((url: string) => { return true; }, function (data: string): boolean { return true; }); +requestHandler = httpBackendService.expectPUT((url: string) => { return true; }, function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.expectPUT((url: string) => { return true; }, { key: 'value' }); +requestHandler = httpBackendService.expectPUT((url: string) => { return true; }, { key: 'value' }, { header: 'value' }); + +requestHandler = httpBackendService.when('GET', 'http://test.local'); +requestHandler = httpBackendService.when('GET', 'http://test.local', 'response data'); +requestHandler = httpBackendService.when('GET', 'http://test.local', 'response data', { header: 'value' }); +requestHandler = httpBackendService.when('GET', 'http://test.local', 'response data', function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.when('GET', 'http://test.local', /response data/); +requestHandler = httpBackendService.when('GET', 'http://test.local', /response data/, { header: 'value' }); +requestHandler = httpBackendService.when('GET', 'http://test.local', /response data/, function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.when('GET', 'http://test.local', function (data: string): boolean { return true; }); +requestHandler = httpBackendService.when('GET', 'http://test.local', function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.when('GET', 'http://test.local', function (data: string): boolean { return true; }, function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.when('GET', 'http://test.local', { key: 'value' }); +requestHandler = httpBackendService.when('GET', 'http://test.local', { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.when('GET', 'http://test.local', { key: 'value' }, function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.when('GET', /test.local/); +requestHandler = httpBackendService.when('GET', /test.local/, 'response data'); +requestHandler = httpBackendService.when('GET', /test.local/, 'response data', { header: 'value' }); +requestHandler = httpBackendService.when('GET', /test.local/, 'response data', function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.when('GET', /test.local/, /response data/); +requestHandler = httpBackendService.when('GET', /test.local/, /response data/, { header: 'value' }); +requestHandler = httpBackendService.when('GET', /test.local/, /response data/, function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.when('GET', /test.local/, function (data: string): boolean { return true; }); +requestHandler = httpBackendService.when('GET', /test.local/, function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.when('GET', /test.local/, function (data: string): boolean { return true; }, function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.when('GET', /test.local/, { key: 'value' }); +requestHandler = httpBackendService.when('GET', /test.local/, { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.when('GET', /test.local/, { key: 'value' }, function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.when('GET', (url: string) => { return true; }); +requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, 'response data'); +requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, 'response data', { header: 'value' }); +requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, 'response data', function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, /response data/); +requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, /response data/, { header: 'value' }); +requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, /response data/, function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, function (data: string): boolean { return true; }); +requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, function (data: string): boolean { return true; }, function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, { key: 'value' }); +requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, { key: 'value' }, function (headers: Object): boolean { return true; }); + +requestHandler = httpBackendService.whenDELETE('http://test.local'); +requestHandler = httpBackendService.whenDELETE('http://test.local', { header: 'value' }); +requestHandler = httpBackendService.whenDELETE(/test.local/, { header: 'value' }); +requestHandler = httpBackendService.whenDELETE((url: string) => { return true; }, { header: 'value' }); +requestHandler = httpBackendService.whenGET('http://test.local'); +requestHandler = httpBackendService.whenGET('http://test.local', { header: 'value' }); +requestHandler = httpBackendService.whenGET(/test.local/, { header: 'value' }); +requestHandler = httpBackendService.whenGET((url: string) => { return true; }, { header: 'value' }); +requestHandler = httpBackendService.whenHEAD('http://test.local'); +requestHandler = httpBackendService.whenHEAD('http://test.local', { header: 'value' }); +requestHandler = httpBackendService.whenHEAD(/test.local/, { header: 'value' }); +requestHandler = httpBackendService.whenHEAD((url: string) => { return true; }, { header: 'value' }); +requestHandler = httpBackendService.whenJSONP('http://test.local'); +requestHandler = httpBackendService.whenJSONP(/test.local/); +requestHandler = httpBackendService.whenJSONP((url: string) => { return true; }); + +requestHandler = httpBackendService.whenPATCH('http://test.local'); +requestHandler = httpBackendService.whenPATCH('http://test.local', 'response data'); +requestHandler = httpBackendService.whenPATCH('http://test.local', 'response data', { header: 'value' }); +requestHandler = httpBackendService.whenPATCH('http://test.local', /response data/); +requestHandler = httpBackendService.whenPATCH('http://test.local', /response data/, { header: 'value' }); +requestHandler = httpBackendService.whenPATCH('http://test.local', function (data: string): boolean { return true; }); +requestHandler = httpBackendService.whenPATCH('http://test.local', function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.whenPATCH('http://test.local', { key: 'value' }); +requestHandler = httpBackendService.whenPATCH('http://test.local', { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.whenPATCH(/test.local/); +requestHandler = httpBackendService.whenPATCH(/test.local/, 'response data'); +requestHandler = httpBackendService.whenPATCH(/test.local/, 'response data', { header: 'value' }); +requestHandler = httpBackendService.whenPATCH(/test.local/, /response data/); +requestHandler = httpBackendService.whenPATCH(/test.local/, /response data/, { header: 'value' }); +requestHandler = httpBackendService.whenPATCH(/test.local/, function (data: string): boolean { return true; }); +requestHandler = httpBackendService.whenPATCH(/test.local/, function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.whenPATCH(/test.local/, { key: 'value' }); +requestHandler = httpBackendService.whenPATCH(/test.local/, { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.whenPATCH((url: string) => { return true; }); +requestHandler = httpBackendService.whenPATCH((url: string) => { return true; }, 'response data'); +requestHandler = httpBackendService.whenPATCH((url: string) => { return true; }, 'response data', { header: 'value' }); +requestHandler = httpBackendService.whenPATCH((url: string) => { return true; }, /response data/); +requestHandler = httpBackendService.whenPATCH((url: string) => { return true; }, /response data/, { header: 'value' }); +requestHandler = httpBackendService.whenPATCH((url: string) => { return true; }, function (data: string): boolean { return true; }); +requestHandler = httpBackendService.whenPATCH((url: string) => { return true; }, function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.whenPATCH((url: string) => { return true; }, { key: 'value' }); +requestHandler = httpBackendService.whenPATCH((url: string) => { return true; }, { key: 'value' }, { header: 'value' }); + +requestHandler = httpBackendService.whenPOST('http://test.local'); +requestHandler = httpBackendService.whenPOST('http://test.local', 'response data'); +requestHandler = httpBackendService.whenPOST('http://test.local', 'response data', { header: 'value' }); +requestHandler = httpBackendService.whenPOST('http://test.local', /response data/); +requestHandler = httpBackendService.whenPOST('http://test.local', /response data/, { header: 'value' }); +requestHandler = httpBackendService.whenPOST('http://test.local', function (data: string): boolean { return true; }); +requestHandler = httpBackendService.whenPOST('http://test.local', function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.whenPOST('http://test.local', { key: 'value' }); +requestHandler = httpBackendService.whenPOST('http://test.local', { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.whenPOST(/test.local/); +requestHandler = httpBackendService.whenPOST(/test.local/, 'response data'); +requestHandler = httpBackendService.whenPOST(/test.local/, 'response data', { header: 'value' }); +requestHandler = httpBackendService.whenPOST(/test.local/, /response data/); +requestHandler = httpBackendService.whenPOST(/test.local/, /response data/, { header: 'value' }); +requestHandler = httpBackendService.whenPOST(/test.local/, function (data: string): boolean { return true; }); +requestHandler = httpBackendService.whenPOST(/test.local/, function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.whenPOST(/test.local/, { key: 'value' }); +requestHandler = httpBackendService.whenPOST(/test.local/, { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.whenPOST((url: string) => { return true; }); +requestHandler = httpBackendService.whenPOST((url: string) => { return true; }, 'response data'); +requestHandler = httpBackendService.whenPOST((url: string) => { return true; }, 'response data', { header: 'value' }); +requestHandler = httpBackendService.whenPOST((url: string) => { return true; }, /response data/); +requestHandler = httpBackendService.whenPOST((url: string) => { return true; }, /response data/, { header: 'value' }); +requestHandler = httpBackendService.whenPOST((url: string) => { return true; }, function (data: string): boolean { return true; }); +requestHandler = httpBackendService.whenPOST((url: string) => { return true; }, function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.whenPOST((url: string) => { return true; }, { key: 'value' }); +requestHandler = httpBackendService.whenPOST((url: string) => { return true; }, { key: 'value' }, { header: 'value' }); + +requestHandler = httpBackendService.whenPUT('http://test.local'); +requestHandler = httpBackendService.whenPUT('http://test.local', 'response data'); +requestHandler = httpBackendService.whenPUT('http://test.local', 'response data', { header: 'value' }); +requestHandler = httpBackendService.whenPUT('http://test.local', /response data/); +requestHandler = httpBackendService.whenPUT('http://test.local', /response data/, { header: 'value' }); +requestHandler = httpBackendService.whenPUT('http://test.local', function (data: string): boolean { return true; }); +requestHandler = httpBackendService.whenPUT('http://test.local', function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.whenPUT('http://test.local', { key: 'value' }); +requestHandler = httpBackendService.whenPUT('http://test.local', { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.whenPUT(/test.local/); +requestHandler = httpBackendService.whenPUT(/test.local/, 'response data'); +requestHandler = httpBackendService.whenPUT(/test.local/, 'response data', { header: 'value' }); +requestHandler = httpBackendService.whenPUT(/test.local/, /response data/); +requestHandler = httpBackendService.whenPUT(/test.local/, /response data/, { header: 'value' }); +requestHandler = httpBackendService.whenPUT(/test.local/, function (data: string): boolean { return true; }); +requestHandler = httpBackendService.whenPUT(/test.local/, function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.whenPUT(/test.local/, { key: 'value' }); +requestHandler = httpBackendService.whenPUT(/test.local/, { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.whenPUT((url: string) => { return true; }); +requestHandler = httpBackendService.whenPUT((url: string) => { return true; }, 'response data'); +requestHandler = httpBackendService.whenPUT((url: string) => { return true; }, 'response data', { header: 'value' }); +requestHandler = httpBackendService.whenPUT((url: string) => { return true; }, /response data/); +requestHandler = httpBackendService.whenPUT((url: string) => { return true; }, /response data/, { header: 'value' }); +requestHandler = httpBackendService.whenPUT((url: string) => { return true; }, function (data: string): boolean { return true; }); +requestHandler = httpBackendService.whenPUT((url: string) => { return true; }, function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.whenPUT((url: string) => { return true; }, { key: 'value' }); +requestHandler = httpBackendService.whenPUT((url: string) => { return true; }, { key: 'value' }, { header: 'value' }); + + +/////////////////////////////////////// +// IRequestHandler +/////////////////////////////////////// +var expectedData = { key: 'value'}; +requestHandler.passThrough(); +requestHandler.passThrough().passThrough(); +requestHandler.respond((method, url, data, headers) => [404, 'data', { header: 'value' }, 'responseText']); +requestHandler.respond((method, url, data, headers) => [404, 'data', { header: 'value' }, 'responseText']).respond({}); +requestHandler.respond((method, url, data, headers) => { return [404, { key: 'value' }, { header: 'value' }, 'responseText']; }); +requestHandler.respond('data'); +requestHandler.respond('data').respond({}); +requestHandler.respond(expectedData); +requestHandler.respond({ key: 'value' }); +requestHandler.respond({ key: 'value' }, { header: 'value' }); +requestHandler.respond({ key: 'value' }, { header: 'value' }, 'responseText'); +requestHandler.respond(404, 'data'); +requestHandler.respond(404, 'data').respond({}); +requestHandler.respond(404, { key: 'value' }); +requestHandler.respond(404, { key: 'value' }, { header: 'value' }); +requestHandler.respond(404, { key: 'value' }, { header: 'value' }, 'responseText'); diff --git a/angularjs/legacy/angular-mocks-1.3.d.ts b/angularjs/legacy/angular-mocks-1.3.d.ts new file mode 100644 index 0000000000..1850ac266c --- /dev/null +++ b/angularjs/legacy/angular-mocks-1.3.d.ts @@ -0,0 +1,318 @@ +// Type definitions for Angular JS 1.3 (ngMock, ngMockE2E module) +// Project: http://angularjs.org +// Definitions by: Diego Vilar , Tony Curtis +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module "angular-mocks/ngMock" { + var _: string; + export = _; +} + +declare module "angular-mocks/ngMockE2E" { + var _: string; + export = _; +} + +declare module "angular-mocks/ngAnimateMock" { + var _: string; + export = _; +} + +/////////////////////////////////////////////////////////////////////////////// +// ngMock module (angular-mocks.js) +/////////////////////////////////////////////////////////////////////////////// +declare module angular { + + /////////////////////////////////////////////////////////////////////////// + // AngularStatic + // We reopen it to add the MockStatic definition + /////////////////////////////////////////////////////////////////////////// + interface IAngularStatic { + mock: IMockStatic; + } + + // see https://docs.angularjs.org/api/ngMock/function/angular.mock.inject + interface IInjectStatic { + (...fns: Function[]): any; + (...inlineAnnotatedConstructor: any[]): any; // this overload is undocumented, but works + strictDi(val?: boolean): void; + } + + interface IMockStatic { + // see https://docs.angularjs.org/api/ngMock/function/angular.mock.dump + dump(obj: any): string; + + inject: IInjectStatic + + // see https://docs.angularjs.org/api/ngMock/function/angular.mock.module + module(...modules: any[]): any; + + // see https://docs.angularjs.org/api/ngMock/type/angular.mock.TzDate + TzDate(offset: number, timestamp: number): Date; + TzDate(offset: number, timestamp: string): Date; + } + + /////////////////////////////////////////////////////////////////////////// + // ExceptionHandlerService + // see https://docs.angularjs.org/api/ngMock/service/$exceptionHandler + // see https://docs.angularjs.org/api/ngMock/provider/$exceptionHandlerProvider + /////////////////////////////////////////////////////////////////////////// + interface IExceptionHandlerProvider extends IServiceProvider { + mode(mode: string): void; + } + + /////////////////////////////////////////////////////////////////////////// + // TimeoutService + // see https://docs.angularjs.org/api/ngMock/service/$timeout + // Augments the original service + /////////////////////////////////////////////////////////////////////////// + interface ITimeoutService { + flush(delay?: number): void; + flushNext(expectedDelay?: number): void; + verifyNoPendingTasks(): void; + } + + /////////////////////////////////////////////////////////////////////////// + // IntervalService + // see https://docs.angularjs.org/api/ngMock/service/$interval + // Augments the original service + /////////////////////////////////////////////////////////////////////////// + interface IIntervalService { + flush(millis?: number): number; + } + + /////////////////////////////////////////////////////////////////////////// + // LogService + // see https://docs.angularjs.org/api/ngMock/service/$log + // Augments the original service + /////////////////////////////////////////////////////////////////////////// + interface ILogService { + assertEmpty(): void; + reset(): void; + } + + interface ILogCall { + logs: string[]; + } + + /////////////////////////////////////////////////////////////////////////// + // HttpBackendService + // see https://docs.angularjs.org/api/ngMock/service/$httpBackend + /////////////////////////////////////////////////////////////////////////// + interface IHttpBackendService { + /** + * Flushes all pending requests using the trained responses. + * @param count Number of responses to flush (in the order they arrived). If undefined, all pending requests will be flushed. + */ + flush(count?: number): void; + + /** + * Resets all request expectations, but preserves all backend definitions. + */ + resetExpectations(): void; + + /** + * Verifies that all of the requests defined via the expect api were made. If any of the requests were not made, verifyNoOutstandingExpectation throws an exception. + */ + verifyNoOutstandingExpectation(): void; + + /** + * Verifies that there are no outstanding requests that need to be flushed. + */ + verifyNoOutstandingRequest(): void; + + /** + * Creates a new request expectation. + * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. + * Returns an object with respond method that controls how a matched request is handled. + * @param method HTTP method. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. + * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + */ + expect(method: string, url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean)) :mock.IRequestHandler; + + /** + * Creates a new request expectation for DELETE requests. + * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url is as expected. + * @param headers HTTP headers object to be compared with the HTTP headers in the request. + */ + expectDELETE(url: string | RegExp | ((url: string) => boolean), headers?: Object): mock.IRequestHandler; + + /** + * Creates a new request expectation for GET requests. + * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + * @param headers HTTP headers object to be compared with the HTTP headers in the request. + */ + expectGET(url: string | RegExp | ((url: string) => boolean), headers?: Object): mock.IRequestHandler; + + /** + * Creates a new request expectation for HEAD requests. + * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + * @param headers HTTP headers object to be compared with the HTTP headers in the request. + */ + expectHEAD(url: string | RegExp | ((url: string) => boolean), headers?: Object): mock.IRequestHandler; + + /** + * Creates a new request expectation for JSONP requests. + * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, or if function returns false. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + */ + expectJSONP(url: string | RegExp | ((url: string) => boolean)): mock.IRequestHandler; + + /** + * Creates a new request expectation for PATCH requests. + * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. + * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + */ + expectPATCH(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object): mock.IRequestHandler; + + /** + * Creates a new request expectation for POST requests. + * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. + * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + */ + expectPOST(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object): mock.IRequestHandler; + + /** + * Creates a new request expectation for PUT requests. + * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. + * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + */ + expectPUT(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object): mock.IRequestHandler; + + /** + * Creates a new backend definition. + * Returns an object with respond method that controls how a matched request is handled. + * @param method HTTP method. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. + * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + */ + when(method: string, url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler; + + /** + * Creates a new backend definition for DELETE requests. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + */ + whenDELETE(url: string | RegExp | ((url: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler; + + /** + * Creates a new backend definition for GET requests. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + */ + whenGET(url: string | RegExp | ((url: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler; + + /** + * Creates a new backend definition for HEAD requests. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + */ + whenHEAD(url: string | RegExp | ((url: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler; + + /** + * Creates a new backend definition for JSONP requests. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + */ + whenJSONP(url: string | RegExp | ((url: string) => boolean)): mock.IRequestHandler; + + /** + * Creates a new backend definition for PATCH requests. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. + * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + */ + whenPATCH(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler; + + /** + * Creates a new backend definition for POST requests. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. + * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + */ + whenPOST(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler; + + /** + * Creates a new backend definition for PUT requests. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. + * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + */ + whenPUT(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler; + } + + export module mock { + // returned interface by the the mocked HttpBackendService expect/when methods + interface IRequestHandler { + + /** + * Controls the response for a matched request using a function to construct the response. + * Returns the RequestHandler object for possible overrides. + * @param func Function that receives the request HTTP method, url, data, and headers and returns an array containing response status (number), data, headers, and status text. + */ + respond(func: ((method: string, url: string, data: string | Object, headers: Object) => [number, string | Object, Object, string])): IRequestHandler; + + /** + * Controls the response for a matched request using supplied static data to construct the response. + * Returns the RequestHandler object for possible overrides. + * @param status HTTP status code to add to the response. + * @param data Data to add to the response. + * @param headers Headers object to add to the response. + * @param responseText Response text to add to the response. + */ + respond(status: number, data: string | Object, headers?: Object, responseText?: string): IRequestHandler; + + /** + * Controls the response for a matched request using the HTTP status code 200 and supplied static data to construct the response. + * Returns the RequestHandler object for possible overrides. + * @param data Data to add to the response. + * @param headers Headers object to add to the response. + * @param responseText Response text to add to the response. + */ + respond(data: string | Object, headers?: Object, responseText?: string): IRequestHandler; + + // Available when ngMockE2E is loaded + /** + * Any request matching a backend definition or expectation with passThrough handler will be passed through to the real backend (an XHR request will be made to the server.) + */ + passThrough(): IRequestHandler; + } + + } + +} + +/////////////////////////////////////////////////////////////////////////////// +// functions attached to global object (window) +/////////////////////////////////////////////////////////////////////////////// +//Use `angular.mock.module` instead of `module`, as `module` conflicts with commonjs. +//declare var module: (...modules: any[]) => any; +declare var inject: angular.IInjectStatic; \ 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-tests.ts b/applicationinsights-js/applicationinsights-js-tests.ts new file mode 100644 index 0000000000..b8f5ba7bec --- /dev/null +++ b/applicationinsights-js/applicationinsights-js-tests.ts @@ -0,0 +1,157 @@ +/// +// More samples on: https://github.com/Microsoft/ApplicationInsights-JS/blob/master/API-reference.md + +var config: Microsoft.ApplicationInsights.IConfig = { + instrumentationKey: "", + endpointUrl: "endpointUrl", + emitLineDelimitedJson: false, + accountId: "accountId", + sessionRenewalMs: 30, + sessionExpirationMs: 24 * 60 * 60 * 1000, + maxBatchSizeInBytes: 100 * 1024, + maxBatchInterval: 15, + enableDebug: false, + disableTelemetry: false, + verboseLogging: false, + diagnosticLogInterval: 10, + samplingPercentage: 100, + autoTrackPageVisitTime: true, + disableExceptionTracking: false, + disableAjaxTracking: false, + overridePageViewDuration: false, + maxAjaxCallsPerView: -1, + disableDataLossAnalysis: true, + disableCorrelationHeaders: true, + disableFlushOnBeforeUnload: false, + enableSessionStorageBuffer: false, + cookieDomain: "" +}; + +var appInsights: Microsoft.ApplicationInsights.IAppInsights = { + config: config, + context: null, + queue: null, + + startTrackPage(name?: string) { return null; }, + stopTrackPage(name?: string, url?: string, properties?: { [name: string]: string; }, measurements?: { [name: string]: number; }) { return null; }, + trackPageView(name?: string, url?: string, properties?: { [name: string]: string; }, measurements?: { [name: string]: number; }, duration?: number) { return null; }, + startTrackEvent(name: string) { return null }, + stopTrackEvent(name: string, properties?: { [name: string]: string; }, measurements?: { [name: string]: number; }) { return null }, + trackEvent(name: string, properties?: { [name: string]: string; }, measurements?: { [name: string]: number; }) { return null }, + trackAjax(id: string, absoluteUrl: string, pathName: string, totalTime: number, success: boolean, resultCode: number, method?: string) { return null }, + trackException(exception: Error, handledAt?: string, properties?: { [name: string]: string; }, measurements?: { [name: string]: number; }, severityLevel?: AI.SeverityLevel) { return null }, + trackMetric(name: string, average: number, sampleCount?: number, min?: number, max?: number, properties?: { [name: string]: string; }) { return null }, + trackTrace(message: string, properties?: { [name: string]: string; }) { return null }, + flush() { return null }, + setAuthenticatedUserContext(authenticatedUserId: string, accountId?: string) { return null }, + clearAuthenticatedUserContext() { return null }, + _onerror(message: string, url: string, lineNumber: number, columnNumber: number, error: Error) { return null } +}; + +// trackPageView +appInsights.trackPageView("page1"); +appInsights.trackPageView("page2", "http://example.com", null, null, 1000); + +// startTrackPage +appInsights.startTrackPage("page"); + +// stopTrackPage +appInsights.stopTrackPage("page"); +appInsights.stopTrackPage("page", "http://example.com", null, null); + +// trackEvent +appInsights.trackEvent("page1"); +appInsights.trackEvent("page1", null, null); + +// trackMetric +appInsights.trackMetric("page1", 999); +appInsights.trackMetric("page1", 999, 1, 1, 2, null); + +// trackException +appInsights.trackException(new Error("sample error")); +appInsights.trackException(new Error("sample error"), "handledAt", null, null); + +// trackTrace +appInsights.trackTrace("message"); +appInsights.trackTrace("message", null); + +// flush +appInsights.flush(); + +// setAuthenticatedUserContext +appInsights.setAuthenticatedUserContext("userId"); +appInsights.setAuthenticatedUserContext("userId", "accountId"); + +// set config dynamically +appInsights.config.instrumentationKey = ""; + + +// TelementryContext +var context: Microsoft.ApplicationInsights.ITelemetryContext = appInsights.context; + +context.application.ver = "v0.0.0"; +context.application.build = "1.1.1"; + +context.device.type = "sampleDevice"; +context.device.locale = "en-US"; + +context.user.id = "userId"; +context.user.authenticatedId = "authId"; + +context.session.id = "sessionId"; +context.session.isFirst = true; + +context.location.ip = "127.0.0.1"; + +context.operation.id = "1"; +context.operation.syntheticSource = "testAgent"; + +// track +var data = new Microsoft.Telemetry.Base(); +var envelope = new Microsoft.ApplicationInsights.Telemetry.Common.Envelope(data, "name"); + +context.track(envelope); + +context.addTelemetryInitializer((envelope) => false); + +// track event +var eventObj = new Microsoft.ApplicationInsights.Telemetry.Event("test", null, null); +var eventData = new Microsoft.ApplicationInsights.Telemetry.Common.Data(Microsoft.ApplicationInsights.Telemetry.Event.dataType, eventObj); +var eventEnvelope = new Microsoft.ApplicationInsights.Telemetry.Common.Envelope(eventData, Microsoft.ApplicationInsights.Telemetry.Event.envelopeType); +context.track(eventEnvelope); + +// track exception +var exceptionObj = new Microsoft.ApplicationInsights.Telemetry.Exception(new Error(), "handledAt", null, null, AI.SeverityLevel.Critical); +var exceptionData = new Microsoft.ApplicationInsights.Telemetry.Common.Data(Microsoft.ApplicationInsights.Telemetry.Exception.dataType, exceptionObj); +var exceptionEnvelope = new Microsoft.ApplicationInsights.Telemetry.Common.Envelope(exceptionData, Microsoft.ApplicationInsights.Telemetry.Exception.envelopeType); +context.track(exceptionEnvelope); + +// track metric +var metricObj = new Microsoft.ApplicationInsights.Telemetry.Metric("name", 1234, 1, 0, 100, null); +var metricData = new Microsoft.ApplicationInsights.Telemetry.Common.Data(Microsoft.ApplicationInsights.Telemetry.Metric.dataType, metricObj); +var metricEnvelope = new Microsoft.ApplicationInsights.Telemetry.Common.Envelope(metricData, Microsoft.ApplicationInsights.Telemetry.Metric.envelopeType); +context.track(metricEnvelope); + +// track page view +var pageViewObj = new Microsoft.ApplicationInsights.Telemetry.PageView("page name", "url", 999, null, null); +var pageViewData = new Microsoft.ApplicationInsights.Telemetry.Common.Data(Microsoft.ApplicationInsights.Telemetry.PageView.dataType, pageViewObj); +var pageViewEnvelope = new Microsoft.ApplicationInsights.Telemetry.Common.Envelope(pageViewData, Microsoft.ApplicationInsights.Telemetry.PageView.envelopeType); +context.track(pageViewEnvelope); + +// track page view performance +var pageViewPerfObj = new Microsoft.ApplicationInsights.Telemetry.PageViewPerformance("page name", "url", 999, null, null); +var pageViewPerfData = new Microsoft.ApplicationInsights.Telemetry.Common.Data(Microsoft.ApplicationInsights.Telemetry.PageViewPerformance.dataType, pageViewPerfObj); +var pageViewPerfEnvelope = new Microsoft.ApplicationInsights.Telemetry.Common.Envelope(pageViewPerfData, Microsoft.ApplicationInsights.Telemetry.PageViewPerformance.envelopeType); +context.track(pageViewPerfEnvelope); + +// track remote dependency +var remoteDepObj = new Microsoft.ApplicationInsights.Telemetry.RemoteDependencyData("id", "url", "command", 1, true, 1234, "GET"); +var remoteDepData = new Microsoft.ApplicationInsights.Telemetry.Common.Data(Microsoft.ApplicationInsights.Telemetry.RemoteDependencyData.dataType, remoteDepObj); +var remoteDepEnvelope = new Microsoft.ApplicationInsights.Telemetry.Common.Envelope(remoteDepData, Microsoft.ApplicationInsights.Telemetry.RemoteDependencyData.envelopeType); +context.track(pageViewPerfEnvelope); + +// track trace +var traceObj = new Microsoft.ApplicationInsights.Telemetry.Trace("message", null); +var traceData = new Microsoft.ApplicationInsights.Telemetry.Common.Data(Microsoft.ApplicationInsights.Telemetry.Trace.dataType, traceObj); +var traceEnvelope = new Microsoft.ApplicationInsights.Telemetry.Common.Envelope(traceData, Microsoft.ApplicationInsights.Telemetry.Trace.envelopeType); +context.track(traceEnvelope); \ No newline at end of file diff --git a/applicationinsights-js/applicationinsights-js.d.ts b/applicationinsights-js/applicationinsights-js.d.ts new file mode 100644 index 0000000000..ba154e5fe6 --- /dev/null +++ b/applicationinsights-js/applicationinsights-js.d.ts @@ -0,0 +1,796 @@ +// 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 + +declare module AI { + enum SeverityLevel { + Verbose = 0, + Information = 1, + Warning = 2, + Error = 3, + Critical = 4, + } + + enum DependencyKind { + SQL = 0, + Http = 1, + Other = 2, + } + + enum DependencySourceType { + Undefined = 0, + Aic = 1, + Apmc = 2, + } + + class StackFrame { + level: number; + method: string; + assembly: string; + fileName: string; + line: number; + constructor(); + } + + class ExceptionDetails { + id: number; + outerId: number; + typeName: string; + message: string; + hasFullStack: boolean; + stack: string; + parsedStack: StackFrame[]; + constructor(); + } + + enum DataPointType { + Measurement = 0, + Aggregation = 1, + } + + class DataPoint { + name: string; + kind: AI.DataPointType; + value: number; + count: number; + min: number; + max: number; + stdDev: number; + constructor(); + } + + class EventData extends Microsoft.Telemetry.Domain { + ver: number; + name: string; + properties: any; + measurements: any; + constructor(); + } + + class PageViewData extends AI.EventData { + ver: number; + url: string; + name: string; + duration: string; + referrer: string; + referrerData: string; + properties: any; + measurements: any; + constructor(); + } + + class PageViewPerfData extends AI.PageViewData { + ver: number; + url: string; + perfTotal: string; + name: string; + duration: string; + networkConnect: string; + referrer: string; + sentRequest: string; + referrerData: string; + receivedResponse: string; + domProcessing: string; + properties: any; + measurements: any; + constructor(); + } + + class RemoteDependencyData extends Microsoft.Telemetry.Domain { + ver: number; + name: string; + id: string; + resultCode: string; + kind: AI.DataPointType; + value: number; + count: number; + min: number; + max: number; + stdDev: number; + dependencyKind: AI.DependencyKind; + success: boolean; + async: boolean; + dependencySource: AI.DependencySourceType; + commandName: string; + dependencyTypeName: string; + properties: any; + constructor(); + } + + class MessageData extends Microsoft.Telemetry.Domain { + ver: number; + message: string; + severityLevel: AI.SeverityLevel; + properties: any; + constructor(); + } +} + +declare module Microsoft.ApplicationInsights.Context { + interface IApplication { + /** + * The application version. + */ + ver: string; + /** + * The application build version. + */ + build: string; + } + + interface IDevice { + /** + * The type for the current device. + */ + type: string; + /** + * A device unique ID. + */ + id: string; + /** + * The device OEM for the current device. + */ + oemName: string; + /** + * The device model for the current device. + */ + model: string; + /** + * The IANA interface type for the internet connected network adapter. + */ + network: number; + /** + * The application screen resolution. + */ + resolution: string; + /** + * The current display language of the operating system. + */ + locale: string; + /** + * The IP address. + */ + ip: string; + /** + * The device language. + */ + language: string; + /** + * The OS name. + */ + os: string; + /** + * The OS version. + */ + osversion: string; + } + + interface ILocation { + /** + * Client IP address for reverse lookup + */ + ip: string; + } + + interface IInternal { + /** + * The SDK version used to create this telemetry item. + */ + sdkVersion: string; + /** + * The SDK agent version. + */ + agentVersion: string; + } + + interface ISample { + /** + * Sample rate + */ + sampleRate: number; + } + + interface ISession { + /** + * The session ID. + */ + id: string; + /** + * The true if this is the first session + */ + isFirst: boolean; + /** + * The date at which this guid was genereated. + * Per the spec the ID will be regenerated if more than acquisitionSpan milliseconds ellapse from this time. + */ + acquisitionDate: number; + /** + * The date at which this session ID was last reported. + * This value should be updated whenever telemetry is sent using this ID. + * Per the spec the ID will be regenerated if more than renewalSpan milliseconds elapse from this time with no activity. + */ + renewalDate: number; + } + + interface IOperation { + /** + * Operation id + */ + id: string; + /** + * Operation name + */ + name: string; + /** + * Parent operation id + */ + parentId: string; + /** + * Root operation id + */ + rootId: string; + /** + * Synthetic source of the operation + */ + syntheticSource: string; + } + + interface IUser { + /** + * The telemetry configuration. + */ + config: any; + /** + * The user ID. + */ + id: string; + /** + * Authenticated user id + */ + authenticatedId: string; + /** + * The account ID. + */ + accountId: string; + /** + * The account acquisition date. + */ + accountAcquisitionDate: string; + /** + * The user agent string. + */ + agent: string; + /** + * The store region. + */ + storeRegion: string; + } +} + +declare module Microsoft.Telemetry { + class Domain { + constructor(); + } + + class Base { + baseType: string; + constructor(); + } + + class Data extends Microsoft.Telemetry.Base { + baseType: string; + baseData: TDomain; + constructor(); + } +} + +declare module Microsoft.ApplicationInsights.Telemetry { + + class Event implements Microsoft.ApplicationInsights.ISerializable { + static envelopeType: string; + static dataType: string; + ver: number; + name: string; + properties: any; + measurements: any; + aiDataContract: { + ver: Microsoft.ApplicationInsights.FieldType; + name: Microsoft.ApplicationInsights.FieldType; + properties: Microsoft.ApplicationInsights.FieldType; + measurements: Microsoft.ApplicationInsights.FieldType; + }; + /** + * Constructs a new instance of the EventTelemetry object + */ + constructor(name: string, properties?: Object, measurements?: Object); + } + + class Exception implements Microsoft.ApplicationInsights.ISerializable { + static envelopeType: string; + static dataType: string; + ver: number; + handledAt: string; + exceptions: AI.ExceptionDetails[]; + severityLevel: AI.SeverityLevel; + problemId: string; + crashThreadId: number; + properties: any; + measurements: any; + aiDataContract: { + ver: Microsoft.ApplicationInsights.FieldType; + handledAt: Microsoft.ApplicationInsights.FieldType; + exceptions: Microsoft.ApplicationInsights.FieldType; + severityLevel: Microsoft.ApplicationInsights.FieldType; + properties: Microsoft.ApplicationInsights.FieldType; + measurements: Microsoft.ApplicationInsights.FieldType; + }; + /** + * Constructs a new isntance of the ExceptionTelemetry object + */ + constructor(exception: Error, handledAt?: string, properties?: Object, measurements?: Object, severityLevel?: AI.SeverityLevel); + /** + * Creates a simple exception with 1 stack frame. Useful for manual constracting of exception. + */ + static CreateSimpleException(message: string, typeName: string, assembly: string, fileName: string, details: string, line: number, handledAt?: string): Telemetry.Exception; + } + + class Metric implements Microsoft.ApplicationInsights.ISerializable { + static envelopeType: string; + static dataType: string; + ver: number; + metrics: AI.DataPoint[]; + properties: any; + aiDataContract: { + ver: Microsoft.ApplicationInsights.FieldType; + metrics: Microsoft.ApplicationInsights.FieldType; + properties: Microsoft.ApplicationInsights.FieldType; + }; + /** + * Constructs a new instance of the MetricTelemetry object + */ + constructor(name: string, value: number, count?: number, min?: number, max?: number, properties?: Object); + } + + class PageView extends AI.PageViewData implements Microsoft.ApplicationInsights.ISerializable { + static envelopeType: string; + static dataType: string; + aiDataContract: { + ver: Microsoft.ApplicationInsights.FieldType; + name: Microsoft.ApplicationInsights.FieldType; + url: Microsoft.ApplicationInsights.FieldType; + duration: Microsoft.ApplicationInsights.FieldType; + properties: Microsoft.ApplicationInsights.FieldType; + measurements: Microsoft.ApplicationInsights.FieldType; + }; + /** + * Constructs a new instance of the PageEventTelemetry object + */ + constructor(name?: string, url?: string, durationMs?: number, properties?: any, measurements?: any); + } + + class PageViewPerformance extends AI.PageViewPerfData implements Microsoft.ApplicationInsights.ISerializable { + static envelopeType: string; + static dataType: string; + aiDataContract: { + ver: Microsoft.ApplicationInsights.FieldType; + name: Microsoft.ApplicationInsights.FieldType; + url: Microsoft.ApplicationInsights.FieldType; + duration: Microsoft.ApplicationInsights.FieldType; + perfTotal: Microsoft.ApplicationInsights.FieldType; + networkConnect: Microsoft.ApplicationInsights.FieldType; + sentRequest: Microsoft.ApplicationInsights.FieldType; + receivedResponse: Microsoft.ApplicationInsights.FieldType; + domProcessing: Microsoft.ApplicationInsights.FieldType; + properties: Microsoft.ApplicationInsights.FieldType; + measurements: Microsoft.ApplicationInsights.FieldType; + }; + /** + * Field indicating whether this instance of PageViewPerformance is valid and should be sent + */ + private isValid; + /** + * Indicates whether this instance of PageViewPerformance is valid and should be sent + */ + getIsValid(): boolean; + private durationMs; + /** + * Gets the total duration (PLT) in milliseconds. Check getIsValid() before using this method. + */ + getDurationMs(): number; + /** + * Constructs a new instance of the PageEventTelemetry object + */ + constructor(name: string, url: string, unused: number, properties?: any, measurements?: any); + static getPerformanceTiming(): PerformanceTiming; + /** + * Returns true is window performance timing API is supported, false otherwise. + */ + static isPerformanceTimingSupported(): PerformanceTiming; + /** + * As page loads different parts of performance timing numbers get set. When all of them are set we can report it. + * Returns true if ready, false otherwise. + */ + static isPerformanceTimingDataReady(): boolean; + static getDuration(start: any, end: any): number; + } + + class RemoteDependencyData extends AI.RemoteDependencyData implements Microsoft.ApplicationInsights.ISerializable { + static envelopeType: string; + static dataType: string; + aiDataContract: { + id: Microsoft.ApplicationInsights.FieldType; + ver: Microsoft.ApplicationInsights.FieldType; + name: Microsoft.ApplicationInsights.FieldType; + kind: Microsoft.ApplicationInsights.FieldType; + value: Microsoft.ApplicationInsights.FieldType; + count: Microsoft.ApplicationInsights.FieldType; + min: Microsoft.ApplicationInsights.FieldType; + max: Microsoft.ApplicationInsights.FieldType; + stdDev: Microsoft.ApplicationInsights.FieldType; + dependencyKind: Microsoft.ApplicationInsights.FieldType; + success: Microsoft.ApplicationInsights.FieldType; + async: Microsoft.ApplicationInsights.FieldType; + dependencySource: Microsoft.ApplicationInsights.FieldType; + commandName: Microsoft.ApplicationInsights.FieldType; + dependencyTypeName: Microsoft.ApplicationInsights.FieldType; + properties: Microsoft.ApplicationInsights.FieldType; + resultCode: Microsoft.ApplicationInsights.FieldType; + }; + /** + * Constructs a new instance of the RemoteDependencyData object + */ + constructor(id: string, absoluteUrl: string, commandName: string, value: number, success: boolean, resultCode: number, method?: string); + private formatDependencyName(method, absoluteUrl); + } + + class Trace extends AI.MessageData implements Microsoft.ApplicationInsights.ISerializable { + static envelopeType: string; + static dataType: string; + aiDataContract: { + ver: Microsoft.ApplicationInsights.FieldType; + message: Microsoft.ApplicationInsights.FieldType; + severityLevel: Microsoft.ApplicationInsights.FieldType; + measurements: Microsoft.ApplicationInsights.FieldType; + properties: Microsoft.ApplicationInsights.FieldType; + }; + /** + * Constructs a new instance of the MetricTelemetry object + */ + constructor(message: string, properties?: Object); + } +} + +declare module Microsoft.ApplicationInsights.Telemetry.Common { + class Base extends Microsoft.Telemetry.Base implements Microsoft.ApplicationInsights.ISerializable { + /** + * The data contract for serializing this object. + */ + aiDataContract: {}; + } + + class Data extends Microsoft.Telemetry.Data implements Microsoft.ApplicationInsights.ISerializable { + /** + * The data contract for serializing this object. + */ + aiDataContract: { + baseType: FieldType; + baseData: FieldType; + }; + /** + * Constructs a new instance of telemetry data. + */ + constructor(type: string, data: TDomain); + } + + class Envelope implements IEnvelope { + ver: number; + name: string; + time: string; + sampleRate: number; + seq: string; + iKey: string; + flags: number; + deviceId: string; + os: string; + osVer: string; + appId: string; + appVer: string; + userId: string; + tags: any; + data: Base; + + /** + * The data contract for serializing this object. + */ + aiDataContract: any; + /** + * Constructs a new instance of telemetry data. + */ + constructor(data: Microsoft.Telemetry.Base, name: string); + } + + class DataSanitizer { + static sanitizeKeyAndAddUniqueness(key: any, map: any): any; + static sanitizeKey(name: any): any; + static sanitizeString(value: any): any; + static sanitizeUrl(url: any): any; + static sanitizeMessage(message: any): any; + static sanitizeException(exception: any): any; + static sanitizeProperties(properties: any): any; + static sanitizeMeasurements(measurements: any): any; + static padNumber(num: any): string; + } +} + +declare module Microsoft.ApplicationInsights { + interface IConfig { + instrumentationKey?: string; + endpointUrl?: string; + emitLineDelimitedJson?: boolean; + accountId?: string; + sessionRenewalMs?: number; + sessionExpirationMs?: number; + maxBatchSizeInBytes?: number; + maxBatchInterval?: number; + enableDebug?: boolean; + disableExceptionTracking?: boolean; + disableTelemetry?: boolean; + verboseLogging?: boolean; + diagnosticLogInterval?: number; + samplingPercentage?: number; + autoTrackPageVisitTime?: boolean; + disableAjaxTracking?: boolean; + overridePageViewDuration?: boolean; + maxAjaxCallsPerView?: number; + disableDataLossAnalysis?: boolean; + disableCorrelationHeaders?: boolean; + disableFlushOnBeforeUnload?: boolean; + enableSessionStorageBuffer?: boolean; + cookieDomain?: string; + url?: string; + } + + /** + * Enum is used in aiDataContract to describe how fields are serialized. + * For instance: (Fieldtype.Required | FieldType.Array) will mark the field as required and indicate it's an array + */ + enum FieldType { + Default = 0, + Required = 1, + Array = 2, + Hidden = 4, + } + + interface ISerializable { + /** + * The set of fields for a serializeable object. + * This defines the serialization order and a value of true/false + * for each field defines whether the field is required or not. + */ + aiDataContract: any; + } + + interface IEnvelope extends ISerializable { + ver: number; + name: string; + time: string; + sampleRate: number; + seq: string; + iKey: string; + flags: number; + deviceId: string; + os: string; + osVer: string; + appId: string; + appVer: string; + userId: string; + tags: { + [name: string]: any; + }; + } + + interface ITelemetryContext { + /** + * The object describing a component tracked by this object. + */ + application: Context.IApplication; + /** + * The object describing a device tracked by this object. + */ + device: Context.IDevice; + /** + * The object describing internal settings. + */ + internal: Context.IInternal; + /** + * The object describing a location tracked by this object. + */ + location: Context.ILocation; + /** + * The object describing a operation tracked by this object. + */ + operation: Context.IOperation; + /** + * The object describing sampling settings. + */ + sample: Context.ISample; + /** + * The object describing a user tracked by this object. + */ + user: Context.IUser; + /** + * The object describing a session tracked by this object. + */ + session: Context.ISession; + /** + * Adds telemetry initializer to the collection. Telemetry initializers will be called one by one + * before telemetry item is pushed for sending and in the order they were added. + */ + addTelemetryInitializer(telemetryInitializer: (envelope: Microsoft.ApplicationInsights.IEnvelope) => boolean): any; + /** + * Tracks telemetry object. + */ + track(envelope: Microsoft.ApplicationInsights.IEnvelope): any; + } + + interface IAppInsights { + config: IConfig; + context: ITelemetryContext; + queue: (() => void)[]; + /** + * Starts timing how long the user views a page or other item. Call this when the page opens. + * This method doesn't send any telemetry. Call {@link stopTrackTelemetry} to log the page when it closes. + * @param name A string that idenfities this item, unique within this HTML document. Defaults to the document title. + */ + startTrackPage(name?: string): any; + /** + * Logs how long a page or other item was visible, after {@link startTrackPage}. Call this when the page closes. + * @param name The string you used as the name in startTrackPage. Defaults to the document title. + * @param url String - a relative or absolute URL that identifies the page or other item. Defaults to the window location. + * @param properties map[string, string] - additional data used to filter pages and metrics in the portal. Defaults to empty. + * @param measurements map[string, number] - metrics associated with this page, displayed in Metrics Explorer on the portal. Defaults to empty. + */ + stopTrackPage(name?: string, url?: string, properties?: { + [name: string]: string; + }, measurements?: { + [name: string]: number; + }): any; + /** + * Logs that a page or other item was viewed. + * @param name The string you used as the name in startTrackPage. Defaults to the document title. + * @param url String - a relative or absolute URL that identifies the page or other item. Defaults to the window location. + * @param properties map[string, string] - additional data used to filter pages and metrics in the portal. Defaults to empty. + * @param measurements map[string, number] - metrics associated with this page, displayed in Metrics Explorer on the portal. Defaults to empty. + * @param duration number - the number of milliseconds it took to load the page. Defaults to undefined. If set to default value, page load time is calculated internally. + */ + trackPageView(name?: string, url?: string, properties?: { + [name: string]: string; + }, measurements?: { + [name: string]: number; + }, duration?: number): any; + /** + * Start timing an extended event. Call {@link stopTrackEvent} to log the event when it ends. + * @param name A string that identifies this event uniquely within the document. + */ + startTrackEvent(name: string): any; + /** + * Log an extended event that you started timing with {@link startTrackEvent}. + * @param name The string you used to identify this event in startTrackEvent. + * @param properties map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty. + * @param measurements map[string, number] - metrics associated with this event, displayed in Metrics Explorer on the portal. Defaults to empty. + */ + stopTrackEvent(name: string, properties?: { + [name: string]: string; + }, measurements?: { + [name: string]: number; + }): any; + /** + * Log a user action or other occurrence. + * @param name A string to identify this event in the portal. + * @param properties map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty. + * @param measurements map[string, number] - metrics associated with this event, displayed in Metrics Explorer on the portal. Defaults to empty. + */ + trackEvent(name: string, properties?: { + [name: string]: string; + }, measurements?: { + [name: string]: number; + }): any; + /** + * Log an AJAX request + * @param id Event id + * @param absoluteUrl Full url + * @param pathName Leave this parameter blank + * @param totalTime Total time it took for AJAX request to complete + * @param success Whether AJAX request succeeded or failed + * @param resultCode Result code returned from AJAX call + * @param method HTTP verb that was used (GET, POST) + */ + trackAjax(id: string, absoluteUrl: string, pathName: string, totalTime: number, success: boolean, resultCode: number, method?: string): any; + /** + * Log an exception you have caught. + * @param exception An Error from a catch clause, or the string error message. + * @param properties map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty. + * @param measurements map[string, number] - metrics associated with this event, displayed in Metrics Explorer on the portal. Defaults to empty. + * @param severityLevel AI.SeverityLevel - severity level + */ + trackException(exception: Error, handledAt?: string, properties?: { + [name: string]: string; + }, measurements?: { + [name: string]: number; + }, severityLevel?: AI.SeverityLevel): any; + /** + * Log a numeric value that is not associated with a specific event. Typically used to send regular reports of performance indicators. + * To send a single measurement, use just the first two parameters. If you take measurements very frequently, you can reduce the + * telemetry bandwidth by aggregating multiple measurements and sending the resulting average at intervals. + * @param name A string that identifies the metric. + * @param average Number representing either a single measurement, or the average of several measurements. + * @param sampleCount The number of measurements represented by the average. Defaults to 1. + * @param min The smallest measurement in the sample. Defaults to the average. + * @param max The largest measurement in the sample. Defaults to the average. + */ + trackMetric(name: string, average: number, sampleCount?: number, min?: number, max?: number, properties?: { + [name: string]: string; + }): any; + /** + * Log a diagnostic message. + * @param message A message string + * @param properties map[string, string] - additional data used to filter traces in the portal. Defaults to empty. + */ + trackTrace(message: string, properties?: { + [name: string]: string; + }): any; + /** + * Immediately send all queued telemetry. + */ + flush(): any; + /** + * Sets the autheticated user id and the account id in this session. + * User auth id and account id should be of type string. They should not contain commas, semi-colons, equal signs, spaces, or vertical-bars. + * + * @param authenticatedUserId {string} - The authenticated user id. A unique and persistent string that represents each authenticated user in the service. + * @param accountId {string} - An optional string to represent the account associated with the authenticated user. + */ + setAuthenticatedUserContext(authenticatedUserId: string, accountId?: string): any; + /** + * Clears the authenticated user id and the account id from the user context. + */ + clearAuthenticatedUserContext(): any; + downloadAndSetup?(config: Microsoft.ApplicationInsights.IConfig): void; + /** + * The custom error handler for Application Insights + * @param {string} message - The error message + * @param {string} url - The url where the error was raised + * @param {number} lineNumber - The line number where the error was raised + * @param {number} columnNumber - The column number for the line where the error was raised + * @param {Error} error - The Error object + */ + _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/applicationinsights/applicationinsights.d.ts b/applicationinsights/applicationinsights.d.ts index 17ca4a479f..96d5773fa5 100644 --- a/applicationinsights/applicationinsights.d.ts +++ b/applicationinsights/applicationinsights.d.ts @@ -341,9 +341,31 @@ interface Client { trackMetric(name: string, value: number, count?:number, min?: number, max?: number, stdDev?: number, properties?: { [key: string]: string; }): void; + + /** + * Log an incoming http request to your server. The request data will be tracked during the response "finish" event if it is successful or the request "error" + * event if it fails. The request duration is automatically calculated as the timespan between when the trackRequest method was called, and when the response "finish" + * or request "error" events were fired. + * @param request The http.ServerRequest object to track + * @param response The http.ServerResponse object for this request + * @param properties map[string, string] - additional data used to filter requests in the portal. Defaults to empty. + */ trackRequest(request: any /* http.ServerRequest */, response: any /* http.ServerResponse */, properties?: { [key: string]: string; }): void; + + /** + * Log an incoming http request to your server. The request data is tracked synchronously rather than waiting for the response "finish"" or request "error"" events. + * Use this if you need your request telemetry to respect custom app insights operation and user context (for example if you set any appInsights.client.context.tags). + * @param request The http.ServerRequest object to track + * @param response The http.ServerResponse object for this request + * @param ellapsedMilliseconds The duration for this request. Defaults to 0. + * @param properties map[string, string] - additional data used to filter requests in the portal. Defaults to empty. + * @param error An error that was returned for this request if it was unsuccessful. Defaults to null. + */ + trackRequestSync(request: any /*http.ServerRequest */, response: any /*http.ServerResponse */, ellapsedMilliseconds?: number, properties?: { + [key: string]: string;}, error?: any) : void; + /** * Log information about a dependency of your app. Typically used to track the time database calls or outgoing http requests take from your server. * @param name The name of the dependency (i.e. "myDatabse") 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/argv/argv-tests.ts b/argv/argv-tests.ts new file mode 100644 index 0000000000..6d73c53ec7 --- /dev/null +++ b/argv/argv-tests.ts @@ -0,0 +1,15 @@ +/// +import argv = require('argv'); +argv.version( 'v1.0' ); +argv.info( 'Special script info' ); +argv.clear() +.option({ + name: 'option', + short: 'o', + type: 'string', + description: 'Defines an option for your script', + example: "'script --opiton=value' or 'script -o value'" +}) +.run([ '--option=123', '-o', '123' ]); +argv.run(); +argv.help(); diff --git a/argv/argv.d.ts b/argv/argv.d.ts new file mode 100644 index 0000000000..182ffde861 --- /dev/null +++ b/argv/argv.d.ts @@ -0,0 +1,59 @@ +// Type definitions for argv +// Project: https://www.npmjs.com/package/argv +// Definitions by: Hookclaw +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +declare module "argv" { + // argv module + type args = { + targets:string[], + options:{[key:string]:any} + }; + + type helpOption = { + name: string, + type: string, + short?: string, + description?: string, + example?: string + }; + + type module = { + mod: string, + description: string, + options: {[key:string]:helpOption} + }; + + type typeFunction = (value:any, ...arglist:any[]) => any; + + type argv = { + + // Runs the arguments parser + run: ( argv?:string[] ) => args, + + // Adding options to definitions list + option: ( mod:helpOption|helpOption[] ) => argv, + + // Creating module + mod: ( object:module|module[] ) => argv, + + // Creates custom type function + type: ( name:string|{[key:string]:typeFunction}, callback?:typeFunction ) => any, + + // Setting version number, and auto setting version option + version: ( v:string ) => argv, + + // Description setup + info: ( mod:string, description?:module ) => argv, + + // Cleans out current options + clear: () => argv, + + // Prints out the help doc + help: ( mod?:string ) => argv + + }; + + var argv:argv; + + export = argv; +} diff --git a/array-find-index/array-find-index-tests.ts b/array-find-index/array-find-index-tests.ts new file mode 100644 index 0000000000..8c69a531e2 --- /dev/null +++ b/array-find-index/array-find-index-tests.ts @@ -0,0 +1,10 @@ +/// + +import * as arrayFindIndex from 'array-find-index'; + +arrayFindIndex(['rainbow', 'unicorn', 'pony'], x => x === 'unicorn'); + +const ctx = {foo: 'rainbow'}; +arrayFindIndex(['rainbow', 'unicorn', 'pony'], function (x) { + return x === this.foo; +}, ctx); diff --git a/array-find-index/array-find-index.d.ts b/array-find-index/array-find-index.d.ts new file mode 100644 index 0000000000..650cac2a16 --- /dev/null +++ b/array-find-index/array-find-index.d.ts @@ -0,0 +1,13 @@ +// Type definitions for array-find-index +// Project: https://github.com/sindresorhus/array-find-index +// Definitions by: Sam Verschueren +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module "array-find-index" { + type Predicate = (element: any, index: number, array: any[]) => boolean; + + function arrayFindIndex(arr: any[], predicate: Predicate): number; + function arrayFindIndex(arr: any[], predicate: Predicate, ctx: any): number; + namespace arrayFindIndex {} + export = arrayFindIndex; +} diff --git a/async/async-tests.ts b/async/async-tests.ts index 037481b6fa..63640cecf6 100644 --- a/async/async-tests.ts +++ b/async/async-tests.ts @@ -378,6 +378,7 @@ async.auto({ async.retry(3, function (callback, results) { }, function (err, result) { }); async.retry({ times: 3, interval: 200 }, function (callback, results) { }, function (err, result) { }); +async.retry({ times: 3, interval: (retryCount) => { return 200 * retryCount; } }, function (callback, results) { }, function (err, result) { }); async.parallel([ @@ -391,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 066685e3c7..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 @@ -12,10 +12,10 @@ interface AsyncResultObjectCallback { (err: Error, results: Dictionary): v interface AsyncFunction { (callback: (err?: Error, result?: T) => void): void; } interface AsyncIterator { (item: T, callback: ErrorCallback): void; } -interface AsyncForEachOfIterator { (item: T, key: number, callback: ErrorCallback): void; } +interface AsyncForEachOfIterator { (item: T, key: number|string, callback: ErrorCallback): void; } interface AsyncResultIterator { (item: T, callback: AsyncResultCallback): void; } interface AsyncMemoIterator { (memo: R, item: T, callback: AsyncResultCallback): void; } -interface AsyncBooleanIterator { (item: T, callback: (truthValue: boolean) => void): void; } +interface AsyncBooleanIterator { (item: T, callback: (err: string, truthValue: boolean) => void): void; } interface AsyncWorker { (task: T, callback: ErrorCallback): void; } interface AsyncVoidFunction { (callback: ErrorCallback): void; } @@ -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,26 +100,35 @@ 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; - filter(arr: T[], iterator: AsyncBooleanIterator, callback?: (results: T[]) => any): any; - select(arr: T[], iterator: AsyncBooleanIterator, callback?: (results: T[]) => any): any; - filterSeries(arr: T[], iterator: AsyncBooleanIterator, callback?: (results: T[]) => any): any; - selectSeries(arr: T[], iterator: AsyncBooleanIterator, callback?: (results: T[]) => any): any; - filterLimit(arr: T[], limit: number, iterator: AsyncBooleanIterator, callback?: (results: T[]) => any): any; - selectLimit(arr: T[], limit: number, iterator: AsyncBooleanIterator, callback?: (results: T[]) => any): any; - reject(arr: T[], iterator: AsyncBooleanIterator, callback?: (results: T[]) => any): any; - rejectSeries(arr: T[], iterator: AsyncBooleanIterator, callback?: (results: T[]) => any): any; - rejectLimit(arr: T[], limit: number, iterator: AsyncBooleanIterator, callback?: (results: T[]) => any): 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; + selectSeries(arr: T[], iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): any; + filterLimit(arr: T[], limit: number, iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): any; + selectLimit(arr: T[], limit: number, iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): any; + reject(arr: T[], iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): any; + rejectSeries(arr: T[], iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): any; + rejectLimit(arr: T[], limit: number, iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): any; reduce(arr: T[], memo: R, iterator: AsyncMemoIterator, callback?: AsyncResultCallback): any; inject(arr: T[], memo: R, iterator: AsyncMemoIterator, callback?: AsyncResultCallback): any; foldl(arr: T[], memo: R, iterator: AsyncMemoIterator, callback?: AsyncResultCallback): any; 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?: (result: T) => void): any; - detectSeries(arr: T[], iterator: AsyncBooleanIterator, callback?: (result: T) => void): any; - detectLimit(arr: T[], limit: number, iterator: AsyncBooleanIterator, callback?: (result: T) => void): 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 }, task: (callback: AsyncResultCallback, results : any) => void, callback: (error: Error, results: any) => void): void; - iterator(tasks: Function[]): Function; + retry(opts: { times: number, interval: number|((retryCount: number) => number) }, task: (callback: AsyncResultCallback, results : any) => void, callback: (error: Error, results: any) => void): void; + 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/atmosphere/atmosphere.d.ts b/atmosphere/atmosphere.d.ts index bf26ba0db4..e62df1ea64 100644 --- a/atmosphere/atmosphere.d.ts +++ b/atmosphere/atmosphere.d.ts @@ -55,7 +55,7 @@ declare namespace Atmosphere { connectTimeout?: number; reconnectInterval?: number; dropHeaders?: boolean; - uuid?: number; + uuid?: string; async?: boolean; shared?: boolean; readResponsesHeaders?: boolean; @@ -102,5 +102,6 @@ declare namespace Atmosphere { } declare var atmosphere:Atmosphere.Atmosphere; - - +declare module 'atmosphere' { + export = atmosphere; +} diff --git a/atom/atom.d.ts b/atom/atom.d.ts index 31fa76eb4a..389d6ef16e 100644 --- a/atom/atom.d.ts +++ b/atom/atom.d.ts @@ -456,82 +456,111 @@ declare namespace AtomCore { // TBD } - interface ISelection /* extends Theorist.Model */ { - cursor:ICursor; - marker:IDisplayBufferMarker; - editor:IEditor; - initialScreenRange:any; - wordwise:boolean; - needsAutoscroll:boolean; - retainSelection:boolean; - subscriptionCounts:any; + interface ISelection { + // https://atom.io/docs/api/v1.7.3/Selection - destroy():any; - finalize():any; - clearAutoscroll():any; - isEmpty():boolean; - isReversed():boolean; - isSingleScreenLine():boolean; - getScreenRange():TextBuffer.IRange; - setScreenRange(screenRange:any, options:any):any; - getBufferRange():TextBuffer.IRange; - setBufferRange(bufferRange:any, options:any):any; - getBufferRowRange():number[]; - autoscroll():void; - getText():string; - clear():boolean; - selectWord():TextBuffer.IRange; - expandOverWord():any; - selectLine(row?:any):TextBuffer.IRange; - expandOverLine():boolean; - selectToScreenPosition(position:any):any; - selectToBufferPosition(position:any):any; - selectRight():boolean; - selectLeft():boolean; - selectUp(rowCount?:any):boolean; - selectDown(rowCount?:any):boolean; - selectToTop():any; - selectToBottom():any; - selectAll():any; - selectToBeginningOfLine():any; - selectToFirstCharacterOfLine():any; - selectToEndOfLine():any; - selectToBeginningOfWord():any; - selectToEndOfWord():any; - selectToBeginningOfNextWord():any; - selectToPreviousWordBoundary():any; - selectToNextWordBoundary():any; - addSelectionBelow():any; - getGoalBufferRange():any; - addSelectionAbove():any[]; - insertText(text:string, options?:any):any; - normalizeIndents(text:string, indentBasis:number):any; - indent(_arg?:any):any; - indentSelectedRows():TextBuffer.IRange[]; - setIndentationForLine(line:string, indentLevel:number):any; - backspace():any; - backspaceToBeginningOfWord():any; - backspaceToBeginningOfLine():any; - delete():any; - deleteToEndOfWord():any; - deleteSelectedText():any; - deleteLine():any; - joinLines():any; - outdentSelectedRows():any[]; - autoIndentSelectedRows():any; - toggleLineComments():any; - cutToEndOfLine(maintainClipboard:any):any; - cut(maintainClipboard:any):any; - copy(maintainClipboard:any):any; - fold():any; - modifySelection(fn:()=>any):any; - plantTail():any; - intersectsBufferRange(bufferRange:any):any; - intersectsWith(otherSelection:any):any; - merge(otherSelection:any, options:any):any; - compare(otherSelection:any):any; - getRegionRects():any[]; - screenRangeChanged():any; + // Event Subscription + onDidChangeRange(callback: (event: { + oldBufferRange: TextBuffer.IRange; + oldScreenRange: TextBuffer.IRange; + newBufferRange: TextBuffer.IRange; + newScreenRange: TextBuffer.IRange; + selection: ISelection; + }) => {}): Disposable; + onDidDestroy(callback: () => {}): Disposable; + + // Managing the selection range + getScreenRange(): TextBuffer.IRange; + setScreenRange(screenRange: TextBuffer.IRange, options?: { + preserveFolds?: boolean; + autoscroll?: boolean; + }): void; + getBufferRange(): TextBuffer.IRange; + setBufferRange(bufferRange: TextBuffer.IRange, options?: { + preserveFolds?: boolean; + autoscroll?: boolean; + }): void; + getBufferRowRange(): [number]; + + // Info about the selection + isEmpty(): boolean; + isReversed(): boolean; + isSingleScreenLine(): boolean; + getText(): string; + intersectsBufferRange(bufferRange: TextBuffer.IRange): boolean; + intersectsWith(otherSelection: ISelection): boolean; + + // Modifying the selected range + clear(options?: {autoscroll?: boolean}): void; + selectToScreenPosition(position: any): void; + selectToBufferPosition(position: any): void; + selectRight(columnCount?: number): void; + selectLeft(columnCount?: number): void; + selectUp(rowCount: number): void; + selectDown(rowCount: number): void; + selectToTop(): void; + selectToBottom(): void; + selectAll(): void; + selectToBeginningOfLine(): void; + selectToFirstCharacterOfLine(): void; + selectToEndOfLine(): void; + selectToEndOfBufferLine(): void; + selectToBeginningOfWord(): void; + selectToEndOfWord(): void; + selectToBeginningOfNextWord(): void; + selectToPreviousWordBoundary(): void; + selectToNextWordBoundary(): void; + selectToPreviousSubwordBoundary(): void; + selectToNextSubwordBoundary(): void; + selectToBeginningOfNextParagraph(): void; + selectToBeginningOfPreviousParagraph(): void; + selectWord(): TextBuffer.IRange; + expandOverWord(): void; + selectLine(row?: number): void; + expandOverLine(): void; + + // Modifying the selected text + insertText(text: string, options?: { + select: boolean; + autoIndent: boolean; + autoIndentNewline: boolean; + autoDecreaseIndent: boolean; + normalizeLineEndings?: boolean; + undo?: 'skip'; + }): void; + backspace(): void; + deleteToPreviousWordBoundary(): void; + deleteToNextWordBoundary(): void; + deleteToBeginningOfWord(): void; + deleteToBeginningOfLine(): void; + delete(): void; + deleteToEndOfLine(): void; + deleteToEndOfWord(): void; + deleteToBeginningOfSubword(): void; + deleteToEndOfSubword(): void; + deleteSelectedText(): void; + deleteLine(): void; + joinLines(): void; + outdentSelectedRows(): void; + autoIndentSelectedRows(): void; + toggleLineComments(): void; + cutToEndOfLine(): void; + cutToEndOfBufferLine(): void; + cut(maintainClipboard?: boolean, fullLine?: boolean): void; + copy(maintainClipboard?: boolean, fullLine?: boolean): void; + fold(): void; + indentSelectedRows(): void; + + // Managing multiple selections + addSelectionBelow(): void; + addSelectionAbove(): void; + merge(otherSelection: ISelection, options?: { + preserveFolds?: boolean; + autoscroll?: boolean; + }): void; + + // Comparing to other selections + compare(otherSelection: ISelection): any; } interface IDecorationParams { diff --git a/auth0.lock/auth0.lock-tests.ts b/auth0.lock/auth0.lock-tests.ts index fd646ee1bb..07a7cf8323 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..7a459afd97 100644 --- a/auth0.lock/auth0.lock.d.ts +++ b/auth0.lock/auth0.lock.d.ts @@ -1,10 +1,70 @@ -// 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; height: 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/autobahn/autobahn.d.ts b/autobahn/autobahn.d.ts index 9ca4c562cc..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; @@ -181,7 +182,7 @@ declare namespace autobahn { open(): void; - close(reason: string, message: string): void; + close(reason?: string, message?: string): void; onopen: (session: Session, details: any) => void; onclose: (reason: string, details: any) => boolean; 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-tests.ts b/avoscloud-sdk/avoscloud-sdk-tests.ts new file mode 100644 index 0000000000..41926ba2d7 --- /dev/null +++ b/avoscloud-sdk/avoscloud-sdk-tests.ts @@ -0,0 +1,222 @@ +/// +import * as AV from 'avoscloud-sdk' +// 创建一个新的 TestObject 对象 +AV.initialize('uay57kigwe0b6f5n0e1d4z4xhydsml3dor24bzwvzr57wdap','kfgz7jjfsk55r5a8a3y4ttd3je1ko11bkibcikonk32oozww'); +var TestObject = AV.Object.extend('TestObject'); + +function avobject_Test() { + + + var testObject = new TestObject(); + + testObject.set("testBoolean", false); + testObject.set("testInteger", 178); + testObject.set("testString", "leancloud"); + testObject.set("testDate", new Date()); + testObject.set("testArray", ["leancloud","is","great"]); + testObject.set("testDictionary", {key:"value"}); + + + testObject.increment("testInteger"); + testObject.addUnique("testArray", "service"); + + testObject.save(); +} + +function test_query() { + + var TestObject = AV.Object.extend('TestObject') + var todoObject = new TestObject(); + + var query = new AV.Query(TestObject); + + query.equalTo("testString", "leancloud"); + query.notEqualTo("testString", "aws"); + query.greaterThan("testInteger", 150); + query.limit(10); + query.skip(10); + + // Sorts the results in ascending order by the score field + query.ascending("testString"); + + // Sorts the results in descending order by the score field + query.descending("testString"); + + // Restricts to wins < 50 + query.lessThan("testInteger", 50); + + // Restricts to wins <= 50 + query.lessThanOrEqualTo("testInteger", 50); + + // Restricts to wins > 50 + query.greaterThan("testInteger", 50); + + // Restricts to wins >= 50 + query.greaterThanOrEqualTo("testInteger", 50); + + // Finds scores from any of Jonathan, Dario, or Shawn + query.containedIn("testString", + ["leancloud", "aws", "azure"]); + + // Finds scores from anyone who is neither Jonathan, Dario, nor Shawn + query.notContainedIn("testString", + ["leancloud", "aws", "azure"]); + + // Finds objects that have the score set + query.exists("testInteger"); + + // Finds objects that don't have the score set + query.doesNotExist("testInteger"); + + query.select("testInteger", "leancloud"); + + // Find objects where the array in arrayKey contains 2. + query.equalTo("arrayKey", 2); + + // Find objects where the array in arrayKey contains all of the elements 2, 3, and 4. + query.containsAll("arrayKey", [2, 3, 4]); + + query.startsWith("testString", "l"); +} + +function test_file() { + + var base64 = "V29ya2luZyBhdCBQYXJzZSBpcyBncmVhdCE="; + var file = new AV.File("myfile.txt", { base64: base64 }); + + var bytes = [ 0xBE, 0xEF, 0xCA, 0xFE ]; + var file = new AV.File("myfile.txt", bytes); + + var file = new AV.File("myfile.zzz", {}, "image/png"); + + var src = file.url(); + + file.save().then( + () => { + // The file has been saved to Parse. + }, + (error) => { + // The file either could n ot be read, or could not be saved to Parse. + }); + + // TODO: Check +} + +function test_analytics() { + + var dimensions = { + // Define ranges to bucket data points into meaningful segments + priceRange: '1000-1500', + // Did the user filter the query? + source: 'craigslist', + // Do searches happen more often on weekdays or weekends? + dayType: 'weekday' + }; + // Send the dimensions to Parse along with the 'search' event + AV.Analytics.track('search', dimensions); + + var codeString = '404'; + AV.Analytics.track('error', { code: codeString }) +} + +function test_user_acl_roles() { + + var user = new AV.User(); + user.set("username", "my name"); + user.set("password", "my pass"); + user.set("email", "email@example.com"); + +// other fields can be set just like with Parse.Object + user.set("phone", "415-392-0202"); + + var currentUser = AV.User.current(); + if (currentUser) { + // do stuff with the user + } else { + // show the signup or login page + } + + AV.User.become("session-token-here").then(function (user) { + // The current user is now set to user. + }, function (error) { + // The token could not be validated. + }); + + var groupACL = new AV.ACL(); + + var userList: AV.User[] = [AV.User.current()]; + // userList is an array with the users we are sending this message to. + for (var i = 0; i < userList.length; i++) { + groupACL.setReadAccess(userList[i], true); + groupACL.setWriteAccess(userList[i], true); + } + + groupACL.setPublicReadAccess(true); + + AV.User.requestPasswordReset("email@example.com").then(function (data) { + // The current user is now set to user. + }, function (error) { + // The token could not be validated. + }); + + // By specifying no write privileges for the ACL, we can ensure the role cannot be altered. + var role = new AV.Role("Administrator", groupACL); + role.getUsers().add(role); + role.getRoles().add(role); + role.save(); + + AV.User.logOut().then(function (data) { + // logged out + }); +} + + +function test_push() { + + AV.Push.send({ + channels: [ "Gia nts", "Mets" ], + data: { + alert: "The Giants won against the Mets 2-3." + } + }, { + success: () => { + // Push was successful + }, + error: (error: any) => { + // Handle error + } + }); + + var query = new AV.Query(AV.Installation); + query.equalTo('injuryReports', true); + + AV.Push.send({ + where: query, // Set our Installation query + data: { + alert: "Willie Hayes injured by own pop fly." + } + }, { + success: function() { + // Push was successful + }, + error: function(error: any) { + // Handle error + } + }); +} + + +function test_promise() { + let resolved = AV.Promise.as(true); + let rejected = AV.Promise.error("an error object"); + AV.Promise.when([resolved, rejected]).then(function() { + // success + }, function() { + // failed + }); + + // can check whether an object is a Parse.Promise object or not + AV.Promise.is(resolved); +} + + diff --git a/avoscloud-sdk/avoscloud-sdk.d.ts b/avoscloud-sdk/avoscloud-sdk.d.ts new file mode 100644 index 0000000000..deb416290d --- /dev/null +++ b/avoscloud-sdk/avoscloud-sdk.d.ts @@ -0,0 +1,806 @@ +// Type definitions for avoscloud-sdk 0.6.10 +// Project: https://leancloud.cn/ +// Definitions by: Wu Jun +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module "avoscloud-sdk" { + namespace AV { + + var applicationId: string; + var applicationKey: string; + var masterKey: string; + + interface SuccessOption { + success?: Function; + } + + interface ErrorOption { + error?: Function; + } + + interface SuccessFailureOptions extends SuccessOption, ErrorOption { + } + + interface WaitOption { + /** + * Set to true to wait for the server to confirm success + * before triggering an event. + */ + wait?: boolean; + } + + interface UseMasterKeyOption { + /** + * In Cloud Code and Node only, causes the Master Key to be used for this request. + */ + useMasterKey?: boolean; + } + + interface SilentOption { + /** + * Set to true to avoid firing the event. + */ + silent?: boolean; + } + + /** + * A Promise is returned by async methods as a hook to provide callbacks to be + * called when the async task is fulfilled. + * + *

      Typical usage would be like:

      +     *    query.find().then(function(results) {
      +     *      results[0].set("foo", "bar");
      +     *      return results[0].saveAsync();
      +     *    }).then(function(result) {
      +     *      console.log("Updated " + result.id);
      +     *    });
      +     * 

      + * + * @see AV.Promise.prototype.then + * @class + */ + + interface IPromise { + + then(resolvedCallback: (value: T) => IPromise, rejectedCallback?: (reason: any) => IPromise): IPromise; + then(resolvedCallback: (value: T) => U, rejectedCallback?: (reason: any) => IPromise): IPromise; + then(resolvedCallback: (value: T) => U, rejectedCallback?: (reason: any) => U): IPromise; + } + + class Promise { + + static as(resolvedValue: U): Promise; + static error(error: U): Promise; + static is(possiblePromise: any): Boolean; + static when(promises: Promise[]): Promise; + + always(callback: Function): Promise; + done(callback: Function): Promise; + fail(callback: Function): Promise; + reject(error: any): void; + resolve(result: any): void; + then(resolvedCallback: (value: T) => Promise, + rejectedCallback?: (reason: any) => Promise): IPromise; + then(resolvedCallback: (value: T) => U, + rejectedCallback?: (reason: any) => IPromise): IPromise; + then(resolvedCallback: (value: T) => U, + rejectedCallback?: (reason: any) => U): IPromise; + } + + interface IBaseObject { + toJSON(): any; + } + + class BaseObject implements IBaseObject { + toJSON(): any; + } + + /** + * Creates a new ACL. + * If no argument is given, the ACL has no permissions for anyone. + * If the argument is a AV.User, the ACL will have read and write + * permission for only that user. + * If the argument is any other JSON object, that object will be interpretted + * as a serialized ACL created with toJSON(). + * @see AV.Object#setACL + * @class + * + *

      An ACL, or Access Control List can be added to any + * AV.Object to restrict access to only a subset of users + * of your application.

      + */ + class ACL extends BaseObject { + + permissionsById: any; + + constructor(arg1?: any); + + setPublicReadAccess(allowed: boolean): void; + getPublicReadAccess(): boolean; + + setPublicWriteAccess(allowed: boolean): void; + getPublicWriteAccess(): boolean; + + setReadAccess(userId: User, allowed: boolean): void; + getReadAccess(userId: User): boolean; + + setReadAccess(userId: string, allowed: boolean): void; + getReadAccess(userId: string): boolean; + + setRoleReadAccess(role: Role, allowed: boolean): void; + setRoleReadAccess(role: string, allowed: boolean): void; + getRoleReadAccess(role: Role): boolean; + getRoleReadAccess(role: string): boolean; + + setRoleWriteAccess(role: Role, allowed: boolean): void; + setRoleWriteAccess(role: string, allowed: boolean): void; + getRoleWriteAccess(role: Role): boolean; + getRoleWriteAccess(role: string): boolean; + + setWriteAccess(userId: User, allowed: boolean): void; + setWriteAccess(userId: string, allowed: boolean): void; + getWriteAccess(userId: User): boolean; + getWriteAccess(userId: string): boolean; + } + + + /** + * A AV.File is a local representation of a file that is saved to the AV + * cloud. + * @class + * @param name {String} The file's name. This will be prefixed by a unique + * value once the file has finished saving. The file name must begin with + * an alphanumeric character, and consist of alphanumeric characters, + * periods, spaces, underscores, or dashes. + * @param data {Array} The data for the file, as either: + * 1. an Array of byte value Numbers, or + * 2. an Object like { base64: "..." } with a base64-encoded String. + * 3. a File object selected with a file upload control. (3) only works + * in Firefox 3.6+, Safari 6.0.2+, Chrome 7+, and IE 10+. + * For example:
      +     * var fileUploadControl = $("#profilePhotoFileUpload")[0];
      +     * if (fileUploadControl.files.length > 0) {
      +     *   var file = fileUploadControl.files[0];
      +     *   var name = "photo.jpg";
      +     *   var AVFile = new AV.File(name, file);
      +     *   AVFile.save().then(function() {
      +     *     // The file has been saved to AV.
      +     *   }, function(error) {
      +     *     // The file either could not be read, or could not be saved to AV.
      +     *   });
      +     * }
      + * @param type {String} Optional Content-Type header to use for the file. If + * this is omitted, the content type will be inferred from the name's + * extension. + */ + class File { + + constructor(name: string, data: any, type?: string); + name(): string; + url(): string; + save(options?: SuccessFailureOptions): Promise; + + } + + /** + * Creates a new GeoPoint with any of the following forms:
      + *
      +     *   new GeoPoint(otherGeoPoint)
      +     *   new GeoPoint(30, 30)
      +     *   new GeoPoint([30, 30])
      +     *   new GeoPoint({latitude: 30, longitude: 30})
      +     *   new GeoPoint()  // defaults to (0, 0)
      +     *   
      + * @class + * + *

      Represents a latitude / longitude point that may be associated + * with a key in a AVObject or used as a reference point for geo queries. + * This allows proximity-based queries on the key.

      + * + *

      Only one key in a class may contain a GeoPoint.

      + * + *

      Example:

      +     *   var point = new AV.GeoPoint(30.0, -20.0);
      +     *   var object = new AV.Object("PlaceObject");
      +     *   object.set("location", point);
      +     *   object.save();

      + */ + class GeoPoint extends BaseObject { + + latitude: number; + longitude: number; + + constructor(arg1?: any, arg2?: any); + + current(options?: SuccessFailureOptions): GeoPoint; + radiansTo(point: GeoPoint): number; + kilometersTo(point: GeoPoint): number; + milesTo(point: GeoPoint): number; + } + + /** + * A class that is used to access all of the children of a many-to-many relationship. + * Each instance of AV.Relation is associated with a particular parent object and key. + */ + class Relation extends BaseObject { + + parent: Object; + key: string; + targetClassName: string; + + constructor(parent?: Object, key?: string); + + //Adds a AV.Object or an array of AV.Objects to the relation. + add(object: Object): void; + + // Returns a AV.Query that is limited to objects in this relation. + query(): Query; + + // Removes a AV.Object or an array of AV.Objects from this relation. + remove(object: Object): void; + } + + /** + * Creates a new model with defined attributes. A client id (cid) is + * automatically generated and assigned for you. + * + *

      You won't normally call this method directly. It is recommended that + * you use a subclass of AV.Object instead, created by calling + * extend.

      + * + *

      However, if you don't want to use a subclass, or aren't sure which + * subclass is appropriate, you can use this form:

      +     *     var object = new AV.Object("ClassName");
      +     * 
      + * That is basically equivalent to:
      +     *     var MyClass = AV.Object.extend("ClassName");
      +     *     var object = new MyClass();
      +     * 

      + * + * @param {Object} attributes The initial set of data to store in the object. + * @param {Object} options A set of Backbone-like options for creating the + * object. The only option currently supported is "collection". + * @see AV.Object.extend + * + * @class + * + *

      The fundamental unit of AV data, which implements the Backbone Model + * interface.

      + */ + class Object extends BaseObject { + + id: any; + createdAt:any; + updatedAt:any; + attributes: any; + cid: string; + changed: boolean; + className: string; + + constructor(className?: string, options?: any); + constructor(attributes?: string[], options?: any); + + static extend(className: string, protoProps?: any, classProps?: any): any; + static fetchAll(list: Object[], options: SuccessFailureOptions): Promise; + static fetchAllIfNeeded(list: Object[], options: SuccessFailureOptions): Promise; + static destroyAll(list: Object[], options?: Object.DestroyAllOptions): Promise; + static saveAll(list: Object[], options?: Object.SaveAllOptions): Promise; + + initialize(): void; + add(attr: string, item: any): Object; + addUnique(attr: string, item: any): any; + change(options: any): Object; + changedAttributes(diff: any): boolean; + clear(options: any): any; + clone(): Object; + destroy(options?: Object.DestroyOptions): Promise; + dirty(attr: String): boolean; + dirtyKeys(): string[]; + escape(attr: string): string; + existed(): boolean; + 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; + isValid(): boolean; + op(attr: string): any; + previous(attr: string): any; + previousAttributes(): any; + relation(attr: string): Relation; + remove(attr: string, item: any): any; + save(options?: Object.SaveOptions, arg2?: any, arg3?: any): Promise; + set(key: string, value: any, options?: Object.SetOptions): boolean; + setACL(acl: ACL, options?: SuccessFailureOptions): boolean; + unset(attr: string, options?: any): any; + validate(attrs: any, options?: SuccessFailureOptions): boolean; + } + + namespace Object { + interface DestroyOptions extends SuccessFailureOptions, WaitOption, UseMasterKeyOption { } + + interface DestroyAllOptions extends SuccessFailureOptions, UseMasterKeyOption { } + + interface FetchOptions extends SuccessFailureOptions, UseMasterKeyOption { } + + interface SaveOptions extends SuccessFailureOptions, SilentOption, UseMasterKeyOption, WaitOption { } + + interface SaveAllOptions extends SuccessFailureOptions, UseMasterKeyOption { } + + interface SetOptions extends ErrorOption, SilentOption { + promise?: any; + } + } + + /** + * Every AV application installed on a device registered for + * push notifications has an associated Installation object. + */ + class Installation extends Object { + + badge: any; + channels: string[]; + timeZone: any; + deviceType: string; + pushType: string; + installationId: string; + deviceToken: string; + channelUris: string; + appName: string; + appVersion: string; + AVVersion: string; + appIdentifier: string; + + } + + /** + * Creates a new instance with the given models and options. Typically, you + * will not call this method directly, but will instead make a subclass using + * AV.Collection.extend. + * + * @param {Array} models An array of instances of AV.Object. + * + * @param {Object} options An optional object with Backbone-style options. + * Valid options are:
        + *
      • model: The AV.Object subclass that this collection contains. + *
      • query: An instance of AV.Query to use when fetching items. + *
      • comparator: A string property name or function to sort by. + *
      + * + * @see AV.Collection.extend + * + * @class + * + *

      Provides a standard collection class for our sets of models, ordered + * or unordered. For more information, see the + * Backbone + * documentation.

      + */ + class Collection extends Events implements IBaseObject { + + model: Object; + models: Object[]; + query: Query; + comparator: (object: Object) => any; + + constructor(models?: Object[], options?: Collection.Options); + static extend(instanceProps: any, classProps: any): any; + + initialize(): void; + add(models: any[], options?: Collection.AddOptions): Collection; + at(index: number): Object; + fetch(options?: Collection.FetchOptions): Promise; + create(model: Object, options?: Collection.CreateOptions): Object; + get(id: string): Object; + getByCid(cid: any): any; + pluck(attr: string): any[]; + remove(model: any, options?: Collection.RemoveOptions): Collection; + remove(models: any[], options?: Collection.RemoveOptions): Collection; + reset(models: any[], options?: Collection.ResetOptions): Collection; + sort(options?: Collection.SortOptions): Collection; + toJSON(): any; + } + + namespace Collection { + interface Options { + model?: Object; + query?: Query; + comparator?: string; + } + + interface AddOptions extends SilentOption { + /** + * The index at which to add the models. + */ + at?: number; + } + + interface CreateOptions extends SuccessFailureOptions, WaitOption, SilentOption, UseMasterKeyOption { + } + + interface FetchOptions extends SuccessFailureOptions, SilentOption, UseMasterKeyOption { } + + interface RemoveOptions extends SilentOption { } + + interface ResetOptions extends SilentOption { } + + interface SortOptions extends SilentOption { } + } + + /** + * @class + * + *

      AV.Events is a fork of Backbone's Events module, provided for your + * convenience.

      + * + *

      A module that can be mixed in to any object in order to provide + * it with custom events. You may bind callback functions to an event + * with `on`, or remove these functions with `off`. + * Triggering an event fires all callbacks in the order that `on` was + * called. + * + *

      +     *     var object = {};
      +     *     _.extend(object, AV.Events);
      +     *     object.on('expand', function(){ alert('expanded'); });
      +     *     object.trigger('expand');

      + * + *

      For more information, see the + * Backbone + * documentation.

      + */ + class Events { + + static off(events: string[], callback?: Function, context?: any): Events; + static on(events: string[], callback?: Function, context?: any): Events; + static trigger(events: string[]): Events; + static bind(): Events; + static unbind(): Events; + + on(eventName: string, callback?: Function, context?: any): Events; + off(eventName?: string, callback?: Function, context?: any): Events; + trigger(eventName: string, ...args: any[]): Events; + bind(eventName: string, callback: Function, context?: any): Events; + unbind(eventName?: string, callback?: Function, context?: any): Events; + + } + + /** + * Creates a new AV AV.Query for the given AV.Object subclass. + * @param objectClass - + * An instance of a subclass of AV.Object, or a AV className string. + * @class + * + *

      AV.Query defines a query that is used to fetch AV.Objects. The + * most common use case is finding all objects that match a query through the + * find method. For example, this sample code fetches all objects + * of class MyClass. It calls a different function depending on + * whether the fetch succeeded or not. + * + *

      +     * var query = new AV.Query(MyClass);
      +     * query.find({
      +     *   success: function(results) {
      +     *     // results is an array of AV.Object.
      +     *   },
      +     *
      +     *   error: function(error) {
      +     *     // error is an instance of AV.Error.
      +     *   }
      +     * });

      + * + *

      A AV.Query can also be used to retrieve a single object whose id is + * known, through the get method. For example, this sample code fetches an + * object of class MyClass and id myId. It calls a + * different function depending on whether the fetch succeeded or not. + * + *

      +     * var query = new AV.Query(MyClass);
      +     * query.get(myId, {
      +     *   success: function(object) {
      +     *     // object is an instance of AV.Object.
      +     *   },
      +     *
      +     *   error: function(object, error) {
      +     *     // error is an instance of AV.Error.
      +     *   }
      +     * });

      + * + *

      A AV.Query can also be used to count the number of objects that match + * the query without retrieving all of those objects. For example, this + * sample code counts the number of objects of the class MyClass + *

      +     * var query = new AV.Query(MyClass);
      +     * query.count({
      +     *   success: function(number) {
      +     *     // There are number instances of MyClass.
      +     *   },
      +     *
      +     *   error: function(error) {
      +     *     // error is an instance of AV.Error.
      +     *   }
      +     * });

      + */ + class Query extends BaseObject { + + objectClass: any; + className: string; + + constructor(objectClass: any); + + static and(...var_args: Query[]): Query; + static or(...var_args: Query[]): Query; + + addAscending(key: string): Query; + addAscending(key: string[]): Query; + addDescending(key: string): Query; + addDescending(key: string[]): Query; + ascending(key: string): Query; + ascending(key: string[]): Query; + collection(items?: Object[], options?: Collection.Options): Collection; + containedIn(key: string, values: any[]): Query; + contains(key: string, substring: string): Query; + containsAll(key: string, values: any[]): Query; + count(options?: Query.CountOptions): Promise; + descending(key: string): Query; + descending(key: string[]): Query; + doesNotExist(key: string): Query; + doesNotMatchKeyInQuery(key: string, queryKey: string, query: Query): Query; + doesNotMatchQuery(key: string, query: Query): Query; + each(callback: Function, options?: SuccessFailureOptions): Promise; + endsWith(key: string, suffix: string): Query; + equalTo(key: string, value: any): Query; + exists(key: string): Query; + find(options?: Query.FindOptions): Promise; + first(options?: Query.FirstOptions): Promise; + get(objectId: string, options?: Query.GetOptions): Promise; + greaterThan(key: string, value: any): Query; + greaterThanOrEqualTo(key: string, value: any): Query; + include(key: string): Query; + include(keys: string[]): Query; + lessThan(key: string, value: any): Query; + lessThanOrEqualTo(key: string, value: any): Query; + limit(n: number): Query; + matches(key: string, regex: RegExp, modifiers: any): Query; + matchesKeyInQuery(key: string, queryKey: string, query: Query): Query; + matchesQuery(key: string, query: Query): Query; + near(key: string, point: GeoPoint): Query; + notContainedIn(key: string, values: any[]): Query; + notEqualTo(key: string, value: any): Query; + select(...keys: string[]): Query; + skip(n: number): Query; + startsWith(key: string, prefix: string): Query; + withinGeoBox(key: string, southwest: GeoPoint, northeast: GeoPoint): Query; + withinKilometers(key: string, point: GeoPoint, maxDistance: number): Query; + withinMiles(key: string, point: GeoPoint, maxDistance: number): Query; + withinRadians(key: string, point: GeoPoint, maxDistance: number): Query; + } + + namespace Query { + interface CountOptions extends SuccessFailureOptions, UseMasterKeyOption { } + interface FindOptions extends SuccessFailureOptions, UseMasterKeyOption { } + interface FirstOptions extends SuccessFailureOptions, UseMasterKeyOption { } + interface GetOptions extends SuccessFailureOptions, UseMasterKeyOption { } + } + + /** + * Represents a Role on the AV server. Roles represent groupings of + * Users for the purposes of granting permissions (e.g. specifying an ACL + * for an Object). Roles are specified by their sets of child users and + * child roles, all of which are granted any permissions that the parent + * role has. + * + *

      Roles must have a name (which cannot be changed after creation of the + * role), and must specify an ACL.

      + * @class + * A AV.Role is a local representation of a role persisted to the AV + * cloud. + */ + class Role extends Object { + + constructor(name: string, acl: ACL); + + getRoles(): Relation; + getUsers(): Relation; + getName(): string; + setName(name: string, options?: SuccessFailureOptions): any; + } + + /** + * @class + * + *

      A AV.User object is a local representation of a user persisted to the + * AV cloud. This class is a subclass of a AV.Object, and retains the + * same functionality of a AV.Object, but also extends it with various + * user specific methods, like authentication, signing up, and validation of + * uniqueness.

      + */ + class User extends Object { + + static current(): User; + static signUp(username: string, password: string, attrs: any, options?: SuccessFailureOptions): Promise; + static logIn(username: string, password: string, options?: SuccessFailureOptions): Promise; + static logOut(): Promise; + static allowCustomUserClass(isAllowed: boolean): void; + static become(sessionToken: string, options?: SuccessFailureOptions): Promise; + static requestPasswordReset(email: string, options?: SuccessFailureOptions): Promise; + + signUp(attrs: any, options?: SuccessFailureOptions): Promise; + logIn(options?: SuccessFailureOptions): Promise; + fetch(options?: SuccessFailureOptions): Promise; + save(arg1?: any, arg2?: any, arg3?: any): Promise; + authenticated(): boolean; + isCurrent(): boolean; + + getEmail(): string; + setEmail(email: string, options: SuccessFailureOptions): boolean; + + getUsername(): string; + setUsername(username: string, options?: SuccessFailureOptions): boolean; + + setPassword(password: string, options?: SuccessFailureOptions): boolean; + getSessionToken(): string; + } + + namespace Analytics { + + function track(name: string, dimensions: any):Promise; + } + + + class Error { + + code: ErrorCode; + message: string; + + constructor(code: ErrorCode, message: string); + + } + + enum ErrorCode { + + OTHER_CAUSE = -1, + INTERNAL_SERVER_ERROR = 1, + CONNECTION_FAILED = 100, + OBJECT_NOT_FOUND = 101, + INVALID_QUERY = 102, + INVALID_CLASS_NAME = 103, + MISSING_OBJECT_ID = 104, + INVALID_KEY_NAME = 105, + INVALID_POINTER = 106, + INVALID_JSON = 107, + COMMAND_UNAVAILABLE = 108, + NOT_INITIALIZED = 109, + INCORRECT_TYPE = 111, + INVALID_CHANNEL_NAME = 112, + PUSH_MISCONFIGURED = 115, + OBJECT_TOO_LARGE = 116, + OPERATION_FORBIDDEN = 119, + CACHE_MISS = 120, + INVALID_NESTED_KEY = 121, + INVALID_FILE_NAME = 122, + INVALID_ACL = 123, + TIMEOUT = 124, + INVALID_EMAIL_ADDRESS = 125, + MISSING_CONTENT_TYPE = 126, + MISSING_CONTENT_LENGTH = 127, + INVALID_CONTENT_LENGTH = 128, + FILE_TOO_LARGE = 129, + FILE_SAVE_ERROR = 130, + DUPLICATE_VALUE = 137, + INVALID_ROLE_NAME = 139, + EXCEEDED_QUOTA = 140, + SCRIPT_FAILED = 141, + VALIDATION_ERROR = 142, + INVALID_IMAGE_DATA = 150, + UNSAVED_FILE_ERROR = 151, + INVALID_PUSH_TIME_ERROR = 152, + FILE_DELETE_ERROR = 153, + REQUEST_LIMIT_EXCEEDED = 155, + INVALID_EVENT_NAME = 160, + USERNAME_MISSING = 200, + PASSWORD_MISSING = 201, + USERNAME_TAKEN = 202, + EMAIL_TAKEN = 203, + EMAIL_MISSING = 204, + EMAIL_NOT_FOUND = 205, + SESSION_MISSING = 206, + MUST_CREATE_USER_THROUGH_SIGNUP = 207, + ACCOUNT_ALREADY_LINKED = 208, + INVALID_SESSION_TOKEN = 209, + LINKED_ID_MISSING = 250, + INVALID_LINKED_SESSION = 251, + UNSUPPORTED_SERVICE = 252, + AGGREGATE_ERROR = 600, + FILE_READ_ERROR = 601, + X_DOMAIN_REQUEST = 602 + } + + /** + * @class + * A AV.Op is an atomic operation that can be applied to a field in a + * AV.Object. For example, calling object.set("foo", "bar") + * is an example of a AV.Op.Set. Calling object.unset("foo") + * is a AV.Op.Unset. These operations are stored in a AV.Object and + * sent to the server as part of object.save() operations. + * Instances of AV.Op should be immutable. + * + * You should not create subclasses of AV.Op or instantiate AV.Op + * directly. + */ + namespace Op { + + interface BaseOperation extends IBaseObject { + objects(): any[]; + } + + interface Add extends BaseOperation { + } + + interface AddUnique extends BaseOperation { + } + + interface Increment extends IBaseObject { + amount: number; + } + + interface Relation extends IBaseObject { + added(): Object[]; + removed: Object[]; + } + + interface Set extends IBaseObject { + value(): any; + } + + interface Unset extends IBaseObject { + } + + } + + /** + * Contains functions to deal with Push in AV + * @name AV.Push + * @namespace + */ + namespace Push { + function send(data: PushData, options?: SendOptions): Promise; + + interface PushData { + channels?: string[]; + push_time?: Date; + expiration_time?: Date; + expiration_interval?: number; + where?: Query; + data?: any; + alert?: string; + badge?: string; + sound?: string; + title?: string; + } + + interface SendOptions { + success?: () => void; + error?: (error: Error) => void; + } + } + + /** + * Call this method first to set up your authentication tokens for AV. + * @param {String} applicationId Your Application ID. + * @param {String} applicationKey Your Application Key. + * @param {String} masterKey (optional) Your Application Master Key. (Node.js only!) + */ + function initialize(applicationId: string, applicationKey: string, masterKey?: string): void; + + } + + export = AV; +} + +declare module 'leanengine' { + import alias = require('avoscloud-sdk'); + export = alias; +} diff --git a/aws-lambda/aws-lambda-tests.ts b/aws-lambda/aws-lambda-tests.ts new file mode 100644 index 0000000000..fd289dcb7f --- /dev/null +++ b/aws-lambda/aws-lambda-tests.ts @@ -0,0 +1,49 @@ +/// + +import lambda = require('aws-lambda'); + +var str: string; +var date: Date; +var sns: lambda.SNS; +var kinesis: lambda.Kinesis; +var recordsList: lambda.Record[]; +var anyObj: any; +var num: number; + +/* Records */ +var records: lambda.Records; + +recordsList = records.Records; + +/* Record */ +var record: lambda.Record; + +str = record.EventVersion; +str = record.EventSubscriptionArn; +str = record.EnventSource; +sns = record.Sns; +kinesis = record.kinesis; + +/* SNS */ +str = sns.Type; +str = sns.MessageId; +str = sns.TopicArn; +str = sns.Subject; +str = sns.Message; +date = sns.Timestamp; + +/* Kinesis */ +var kinesis: lambda.Kinesis; + +str = kinesis.data; + +/* Context */ +var context: lambda.Context; + +context.log(str, anyObj); +context.fail(str); +context.succeed(str); +context.succeed(anyObj); +context.succeed(str, anyObj); +str = context.awsRequestId; +num = context.getRemainingTimeInMillis(); \ No newline at end of file diff --git a/aws-lambda/aws-lambda.d.ts b/aws-lambda/aws-lambda.d.ts new file mode 100644 index 0000000000..cdd8e2f506 --- /dev/null +++ b/aws-lambda/aws-lambda.d.ts @@ -0,0 +1,43 @@ +// Type definitions for AWS Lambda +// Project: http://docs.aws.amazon.com/lambda +// Definitions by: Michael Skarum +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module "aws-lambda" { + + export interface Records { + Records: Record[]; + } + interface Record { + EventVersion: string; + EventSubscriptionArn: string; + EnventSource: string; + Sns: SNS; + kinesis: Kinesis; + } + interface SNS { + Type: string; + MessageId: string; + TopicArn: string; + Subject: string; + Message: string; + Timestamp: Date; + } + + interface Kinesis { + data: string; + } + + export interface Context { + log(message: string, object: any): void; + fail(message: string): void; + succeed(message: string): void; + succeed(object: any): void; + succeed(message: string, object: any): void; + awsRequestId: string; + getRemainingTimeInMillis(): number; + } + + + export type Callback = (error?: Error, message?: string) => void; +} \ No newline at end of file diff --git a/aws-sdk/aws-sdk-tests.ts b/aws-sdk/aws-sdk-tests.ts index 7411beb930..b771b86172 100644 --- a/aws-sdk/aws-sdk-tests.ts +++ b/aws-sdk/aws-sdk-tests.ts @@ -11,6 +11,32 @@ creds = new AWS.Credentials(str, str, str); str = creds.accessKeyId; +/* + * ECS + */ +var ecs:AWS.ECS + +ecs = new AWS.ECS(); +ecs = new AWS.ECS({apiVersion: '2012-11-05'}); + +ecs.describeClusters({ + clusters: ['STRING_VALUE', 'STRING_VALUE'] + }, + function(err, data) { + if (err) console.log(err, err.stack); // an error occurred + else console.log(data); // successful response + }); + +ecs.describeTasks({ + cluster: 'STRING_VALUE', + tasks: ['STRING_VALUE', 'STRING_VALUE'] + }, + function(err, data) { + if (err) console.log(err, err.stack); // an error occurred + else console.log(data); // successful response + }); + + /* * SQS */ @@ -253,4 +279,107 @@ sqs.setQueueAttributes({ else console.log(data); // successful response }); - \ No newline at end of file + +var dynamoDBDocClient:AWS.DynamoDB.DocumentClient; +dynamoDBDocClient = new AWS.DynamoDB.DocumentClient(); +dynamoDBDocClient = new AWS.DynamoDB.DocumentClient({}); +dynamoDBDocClient.createSet([1, 2, 3], { validate: true }); +dynamoDBDocClient.get( + { + TableName: 'TABLE_NAME', + Key: { userId: 'abc123', email: 'abc123@abc123.com' } + }, + function(err, data) { + if (err) console.log(err, err.stack); // an error occurred + else console.log(data); // successful response + } +); +dynamoDBDocClient.put( + { + TableName: 'TABLE_NAME', + Item: { + userId: 'abc123', + email: 'abc123@abc123.com', + firstName: 'Matt', + lastName: 'Forrester the ' + new Date().getTime() + } + }, + function(err, data) { + if (err) console.log(err, err.stack); // an error occurred + else console.log(data); // successful response + } +); +dynamoDBDocClient.delete( + { + TableName: 'TABLE_NAME', + Key: { + userId: 'abc123', + email: 'abc123@abc123.com' + } + }, + function(err, data) { + if (err) console.log(err, err.stack); // an error occurred + else console.log(data); // successful response + } +); +dynamoDBDocClient.update( + { + TableName: 'TABLE_NAME', + Key: { + userId: 'abc123', + email: 'abc123@abc123.com' + }, + AttributeUpdates: { + thingsWithWheels: { + Action: 'PUT', + Value: dynamoDBDocClient.createSet( + [ + 'SkateBoard', + 'Skates', + 'Mountain Bike', + 'Evolve Electric Skateboard' + ], + { validate: true } + ) + }, + age: { + Action: 'PUT', + Value: 35 + } + } + }, + function(err, data) { + if (err) console.log(err, err.stack); // an error occurred + else console.log(data); // successful response + } +); +dynamoDBDocClient.scan( + { + TableName: 'TABLE_NAME', + KeyConditions: { + age: { + ComparisonOperator: 'EQ', + AttributeValueList: [35] + } + } + }, + function(err, data) { + if (err) console.log(err, err.stack); // an error occurred + else console.log(data); // successful response + } +); +dynamoDBDocClient.query( + { + TableName: 'TABLE_NAME', + KeyConditions: { + userId: { + ComparisonOperator: 'EQ', + AttributeValueList: ['abc123'] + } + } + }, + function(err, data) { + if (err) console.log(err, err.stack); // an error occurred + else console.log(data); // successful response + } +); diff --git a/aws-sdk/aws-sdk.d.ts b/aws-sdk/aws-sdk.d.ts index eb54a5991d..cb35f34e97 100644 --- a/aws-sdk/aws-sdk.d.ts +++ b/aws-sdk/aws-sdk.d.ts @@ -9,1189 +9,1805 @@ declare module "aws-sdk" { - export var config: ClientConfig; - - export function Config(json: any): void; - - export class Credentials { - constructor(accessKeyId: string, secretAccessKey: string, sessionToken?: string); - accessKeyId: string; - } - - export interface Logger { - write?: (chunk: any, encoding?: string, callback?: () => void) => void; - log?: (...messages: any[]) => void; - } - - export interface HttpOptions { - proxy?: string; - agent?: any; - timeout?: number; - xhrAsync?: boolean; - xhrWithCredentials?: boolean; - } - - export class Endpoint { - constructor(endpoint:string); - - host:string; - hostname:string; - href:string; - port:number; - protocol:string; - } - - export interface Services { - autoscaling?: any; - cloudformation?: any; - cloudfront?: any; - cloudsearch?: any; - cloudsearchdomain?: any; - cloudtrail?: any; - cloudwatch?: any; - cloudwatchlogs?: any; - cognitoidentity?: any; - cognitosync?: any; - datapipeline?: any; - directconnect?: any; - dynamodb?: any; - ec2?: any; - ecs?: any; - elasticache?: any; - elasticbeanstalk?: any; - elastictranscoder?: any; - elb?: any; - emr?: any; - glacier?: any; - httpOptions?: HttpOptions; - iam?: any; - importexport?: any; - kinesis?: any; - opsworks?: any; - rds?: any; - redshift?: any; - route53?: any; - route53domains?: any; - s3?: any; - ses?: any; - simpledb?: any; - sns?: any; - sqs?: any; - storagegateway?: any; - sts?: any; - support?: any; - swf?: any; - } - - export interface ClientConfigPartial extends Services { - credentials?: Credentials; - region?: string; - computeChecksums?: boolean; - convertResponseTypes?: boolean; - logger?: Logger; - maxRedirects?: number; - maxRetries?: number; - paramValidation?: boolean; - s3ForcePathStyle?: boolean; - apiVersion?: any; - apiVersions?: Services; - signatureVersion?: string; - sslEnabled?: boolean; - systemClockOffset?: number; - } - - export interface ClientConfig extends ClientConfigPartial { - update?: (options: ClientConfigPartial, allUnknownKeys?: boolean) => void; - getCredentials?: (callback: (err?: any) => void) => void ; - loadFromPath?: (path: string) => void; - credentials: Credentials; - region: string; - } - - export class SQS { - constructor(options?: any); - endpoint:Endpoint; - - addPermission(params: SQS.AddPermissionParams, callback: (err:Error, data:any) => void): void; - changeMessageVisibility(params: SQS.ChangeMessageVisibilityParams, callback: (err:Error, data:any) => void): void; - changeMessageVisibilityBatch(params: SQS.ChangeMessageVisibilityBatchParams, callback: (err:Error, data:SQS.ChangeMessageVisibilityBatchResponse) => void): void; - createQueue(params: SQS.CreateQueueParams, callback: (err: Error, data: SQS.CreateQueueResult) => void): void; - deleteMessage(params: SQS.DeleteMessageParams, callback: (err: Error, data: any) => void): void; - deleteMessageBatch(params: SQS.DeleteMessageBatchParams, callback: (err: Error, data: SQS.DeleteMessageBatchResult) => void): void; - deleteQueue(params: { QueueUrl: string; }, callback: (err: Error, data: any) => void): void; - getQueueAttributes(params: SQS.GetQueueAttributesParams, callback: (err: Error, data: SQS.GetQueueAttributesResult) => void): void; - getQueueUrl(params: SQS.GetQueueUrlParams, callback: (err: Error, data: { QueueUrl: string; }) => void): void; - listDeadLetterSourceQueues(params: {QueueUrl:string}, callback: (err: Error, data: {queueUrls: string[]}) => void): void; - listQueues(params: {QueueNamePrefix?:string}, callback: (err: Error, data: {QueueUrls: string[]}) => void): void; - purgeQueue(params: {QueueUrl: string}, callback: (err: Error, data: any) => void): void; - receiveMessage(params: SQS.ReceiveMessageParams, callback: (err: Error, data: SQS.ReceiveMessageResult) => void): void; - removePermission(params: {QueueUrl: string, Label: string}, callback: (err: Error, data: any) => void): void; - sendMessage(params: SQS.SendMessageParams, callback: (err: Error, data: SQS.SendMessageResult) => void): void; - sendMessageBatch(params: SQS.SendMessageBatchParams, callback: (err: Error, data: SQS.SendMessageBatchResult) => void): void; - setQueueAttributes(params: SQS.SetQueueAttributesParams, callback: (err: Error, data: any) => void): void; - } - - export class SES { - constructor(options?: any); - public client: Ses.Client; - } - - export class SNS { - constructor(options?: any); - public client: Sns.Client; - } - - export class SimpleWorkflow { - constructor(options?: any); - public client: Swf.Client; - } - - export class S3 { - constructor(options?: any); - putObject(params: s3.PutObjectRequest, callback: (err: any, data: any) => void): void; - getObject(params: s3.GetObjectRequest, callback: (err: any, data: any) => void): void; - } - - export class ECS { - constructor(options?: any); - - createService(params: ecs.CreateServicesParams, callback: (err: any, data: any) => void): void; - describeServices(params: ecs.DescribeServicesParams, callback: (err: any, data: any) => void): void; - describeTaskDefinition(params: ecs.DescribeTaskDefinitionParams, callback: (err: any, data: any) => void): void; - registerTaskDefinition(params: ecs.RegisterTaskDefinitionParams, callback: (err: any, data: any) => void): void; - updateService(params: ecs.UpdateServiceParams, callback: (err: any, data: any) => void): void; - } - - export class DynamoDB { - constructor(options?: any); - } - - export module DynamoDB { - export class DocumentClient { - constructor(options?: any); - } - } - - export module SQS { - - export interface SqsOptions { - params?: any; - endpoint?: string; - accessKeyId?: string; - secretAccessKey?: string; - sessionToken?: Credentials; - credentials?: Credentials; - credentialProvider?: any; - region?: string; - maxRetries?: number; - maxRedirects?: number; - sslEnabled?: boolean; - paramValidation?: boolean; - computeChecksums?: boolean; - convertResponseTypes?: boolean; - correctClockSkew?: boolean; - s3ForcePathStyle?: boolean; - s3BucketEndpoint?: boolean; - httpOptions?: HttpOptions; - apiVersion?: string; - apiVersions?: { [serviceName:string]: string}; - logger?: Logger; - systemClockOffset?: number; - signatureVersion?: string; - signatureCache?: boolean; - } - - export interface AddPermissionParams { - QueueUrl: string; - Label: string; - AWSAccountIds:string[]; - Actions:string[]; - } - - export interface ChangeMessageVisibilityParams { - QueueUrl: string, - ReceiptHandle: string, - VisibilityTimeout: number - } - - export interface ChangeMessageVisibilityBatchParams { - QueueUrl: string, - Entries: { Id: string; ReceiptHandle: string; VisibilityTimeout?: number; }[] - } - - export interface ChangeMessageVisibilityBatchResponse { - Successful: { Id:string }[]; - Failed: BatchResultErrorEntry[]; - } - - export interface SendMessageParams { - QueueUrl: string; - MessageBody: string; - DelaySeconds?: number; - MessageAttributes?: { [name:string]: MessageAttribute; } - } - - export interface ReceiveMessageParams { - QueueUrl: string; - MaxNumberOfMessages?: number; - VisibilityTimeout?: number; - AttributeNames?: string[]; - MessageAttributeNames?: string[]; - WaitTimeSeconds?:number; - } - - export interface DeleteMessageBatchParams { - QueueUrl: string; - Entries: DeleteMessageBatchRequestEntry[]; - } - - export interface DeleteMessageBatchRequestEntry { - Id: string; - ReceiptHandle: string; - } - - export interface DeleteMessageParams { - QueueUrl: string; - ReceiptHandle: string; - } - - export interface SendMessageBatchParams { - QueueUrl: string; - Entries: SendMessageBatchRequestEntry[]; - } - - export interface SendMessageBatchRequestEntry { - Id: string; - MessageBody: string; - DelaySeconds?: number; - MessageAttributes?: { [name:string]: MessageAttribute; } - } - - export interface CreateQueueParams { - QueueName: string; - Attributes: QueueAttributes; - } - - export interface QueueAttributes { - [name:string]: any; - DelaySeconds?: number; - MaximumMessageSize?: number; - MessageRetentionPeriod?: number; - Policy?: any; - ReceiveMessageWaitTimeSeconds?: number; - VisibilityTimeout?: number; - RedrivePolicy?: any; - } - - export interface GetQueueAttributesParams { - QueueUrl: string; - AttributeNames: string[]; - } - - export interface GetQueueAttributesResult { - Attributes: {[name:string]: string}; - } - - export interface GetQueueUrlParams { - QueueName: string; - QueueOwnerAWSAccountId?: string; - } - - export interface SendMessageResult { - MessageId: string; - MD5OfMessageBody: string; - MD5OfMessageAttributes: string; - } - - export interface ReceiveMessageResult { - Messages: Message[]; - } - - export interface Message { - MessageId: string; - ReceiptHandle: string; - MD5OfBody: string; - Body: string; - Attributes: { [name:string]:any }; - MD5OfMessageAttributes:string; - MessageAttributes: { [name:string]: MessageAttribute; } - } - - export interface MessageAttribute { - StringValue?: string; - BinaryValue?: any; //(Buffer, Typed Array, Blob, String) - StringListValues?: string[]; - BinaryListValues?: any[]; - DataType: string; - } - - export interface DeleteMessageBatchResult { - Successful: DeleteMessageBatchResultEntry[]; - Failed: BatchResultErrorEntry[]; - } - - export interface DeleteMessageBatchResultEntry { - Id: string; - } - - export interface BatchResultErrorEntry { - Id: string; - Code: string; - Message?: string; - SenderFault: boolean; - } - - export interface SendMessageBatchResult { - Successful: SendMessageBatchResultEntry[]; - Failed: BatchResultErrorEntry[]; - } - - export interface SendMessageBatchResultEntry { - Id: string; - MessageId: string; - MD5OfMessageBody: string; - MD5OfMessageAttributes:string; - } - - export interface CreateQueueResult { - QueueUrl: string; - } - - export interface SetQueueAttributesParams { - QueueUrl: string; - Attributes: QueueAttributes; - } - - } - - export module Ses { - - export interface Client { - config: ClientConfig; - - sendEmail(params: any, callback: (err: any, data: SendEmailResult) => void): void; - } - - export interface SendEmailRequest { - Source: string; - Destination: Destination; - Message: Message; - ReplyToAddresses: string[]; - ReturnPath: string; - } - - export class Destination { - ToAddresses: string[]; - CcAddresses: string[]; - BccAddresses: string[]; - } - - export class Message { - Subject: Content; - Body: Body; - } - - export class Content { - Data: string; - Charset: string; - } - - export class Body { - Text: Content; - Html: Content; - } - - export class SendEmailResult { - MessageId: string; - } - - } - - export module Swf { - - export class Client { - //constructor(options?: any); - public config: ClientConfig; - - countClosedWorkflowExecutions(params: any, callback: (err: any, data: any) => void): void; - countOpenWorkflowExecutions(params: any, callback: (err: any, data: any) => void): void; - countPendingActivityTasks(params: any, callback: (err: any, data: any) => void): void; - countPendingDecisionTasks(params: any, callback: (err: any, data: any) => void): void; - deprecateActivityType(params: any, callback: (err: any, data: any) => void): void; - deprecateDomain(params: any, callback: (err: any, data: any) => void): void; - deprecateWorkflowType(params: any, callback: (err: any, data: any) => void): void; - describeActivityType(params: any, callback: (err: any, data: any) => void): void; - describeDomain(params: any, callback: (err: any, data: any) => void): void; - describeWorkflowExecution(params: any, callback: (err: any, data: any) => void): void; - describeWorkflowType(params: any, callback: (err: any, data: any) => void): void; - getWorkflowExecutionHistory(params: any, callback: (err: any, data: any) => void): void; - listActivityTypes(params: any, callback: (err: any, data: any) => void): void; - listClosedWorkflowExecutions(params: any, callback: (err: any, data: any) => void): void; - listDomains(params: any, callback: (err: any, data: any) => void): void; - listOpenWorkflowExecutions(params: any, callback: (err: any, data: any) => void): void; - listWorkflowTypes(params: any, callback: (err: any, data: any) => void): void; - pollForActivityTask(params: any, callback: (err: any, data: ActivityTask) => void): void; - pollForDecisionTask(params: any, callback: (err: any, data: DecisionTask) => void): void; - recordActivityTaskHeartbeat(params: any, callback: (err: any, data: any) => void): void; - registerActivityType(params: any, callback: (err: any, data: any) => void): void; - registerDomain(params: any, callback: (err: any, data: any) => void): void; - registerWorkflowType(params: any, callback: (err: any, data: any) => void): void; - requestCancelWorkflowExecution(params: any, callback: (err: any, data: any) => void): void; - respondActivityTaskCanceled(params: RespondActivityTaskCanceledRequest, callback: (err: any, data: any) => void): void; - respondActivityTaskCompleted(params: RespondActivityTaskCompletedRequest, callback: (err: any, data: any) => void): void; - respondActivityTaskFailed(params: RespondActivityTaskFailedRequest, callback: (err: any, data: any) => void): void; - respondDecisionTaskCompleted(params: RespondDecisionTaskCompletedRequest, callback: (err: any, data: any) => void): void; - signalWorkflowExecution(params: any, callback: (err: any, data: any) => void): void; - startWorkflowExecution(params: any, callback: (err: any, data: StartWorkflowExecutionResult) => void): void; - terminateWorkflowExecution(params: any, callback: (err: any, data: any) => void): void; - } - - export interface PollForActivityTaskRequest { - domain?: string; - taskList?: TaskList; - identity?: string; - } - - export interface TaskList { - name?: string; - } - - export interface PollForDecisionTaskRequest { - domain?: string; - taskList?: TaskList; - identity?: string; - nextPageToken?: string; - maximumPageSize?: number; - reverseOrder?: Boolean; - } - - export interface StartWorkflowExecutionRequest { - domain?: string; - workflowId?: string; - workflowType?: WorkflowType; - taskList?: TaskList; - input?: string; - executionStartToCloseTimeout?: string; - tagList?: string[]; - taskStartToCloseTimeout?: string; - childPolicy?: string; - } - - export interface WorkflowType { - name?: string; - version?: string; - } - - export interface RespondDecisionTaskCompletedRequest { - taskToken?: string; - decisions?: Decision[]; - executionContext?: string; - } - - export interface Decision { - decisionType?: string; - scheduleActivityTaskDecisionAttributes?: ScheduleActivityTaskDecisionAttributes; - requestCancelActivityTaskDecisionAttributes?: RequestCancelActivityTaskDecisionAttributes; - completeWorkflowExecutionDecisionAttributes?: CompleteWorkflowExecutionDecisionAttributes; - failWorkflowExecutionDecisionAttributes?: FailWorkflowExecutionDecisionAttributes; - cancelWorkflowExecutionDecisionAttributes?: CancelWorkflowExecutionDecisionAttributes; - continueAsNewWorkflowExecutionDecisionAttributes?: ContinueAsNewWorkflowExecutionDecisionAttributes; - recordMarkerDecisionAttributes?: RecordMarkerDecisionAttributes; - startTimerDecisionAttributes?: StartTimerDecisionAttributes; - cancelTimerDecisionAttributes?: CancelTimerDecisionAttributes; - signalExternalWorkflowExecutionDecisionAttributes?: SignalExternalWorkflowExecutionDecisionAttributes; - requestCancelExternalWorkflowExecutionDecisionAttributes?: RequestCancelExternalWorkflowExecutionDecisionAttributes; - startChildWorkflowExecutionDecisionAttributes?: StartChildWorkflowExecutionDecisionAttributes; - } - - export interface ScheduleActivityTaskDecisionAttributes { - activityType?: ActivityType; - activityId?: string; - control?: string; - input?: string; - scheduleToCloseTimeout?: string; - taskList?: TaskList; - scheduleToStartTimeout?: string; - startToCloseTimeout?: string; - heartbeatTimeout?: string; - } - - export interface ActivityType { - name?: string; - version?: string; - } - - export interface RequestCancelActivityTaskDecisionAttributes { - activityId?: string; - } - - export interface CompleteWorkflowExecutionDecisionAttributes { - result?: string; - } - - export interface FailWorkflowExecutionDecisionAttributes { - reason?: string; - details?: string; - } - - export interface CancelWorkflowExecutionDecisionAttributes { - details?: string; - } - - export interface ContinueAsNewWorkflowExecutionDecisionAttributes { - input?: string; - executionStartToCloseTimeout?: string; - taskList?: TaskList; - taskStartToCloseTimeout?: string; - childPolicy?: string; - tagList?: string[]; - workflowTypeVersion?: string; - } - - export interface RecordMarkerDecisionAttributes { - markerName?: string; - details?: string; - } - - export interface StartTimerDecisionAttributes { - timerId?: string; - control?: string; - startToFireTimeout?: string; - } - - export interface CancelTimerDecisionAttributes { - timerId?: string; - } - - export interface SignalExternalWorkflowExecutionDecisionAttributes { - workflowId?: string; - runId?: string; - signalName?: string; - input?: string; - control?: string; - } - - export interface RequestCancelExternalWorkflowExecutionDecisionAttributes { - workflowId?: string; - runId?: string; - control?: string; - } - - export interface StartChildWorkflowExecutionDecisionAttributes { - workflowType?: WorkflowType; - workflowId?: string; - control?: string; - input?: string; - executionStartToCloseTimeout?: string; - taskList?: TaskList; - taskStartToCloseTimeout?: string; - childPolicy?: string; - tagList?: string[]; - } - - export interface RespondActivityTaskCompletedRequest { - taskToken?: string; - result?: string; - } - - export interface RespondActivityTaskFailedRequest { - taskToken?: string; - reason?: string; - details?: string; - } - - export interface RespondActivityTaskCanceledRequest { - taskToken?: string; - details?: string; - } - - export interface DecisionTask { - taskToken?: string; - startedEventId?: number; - workflowExecution?: WorkflowExecution; - workflowType?: WorkflowType; - events?: HistoryEvent[]; - nextPageToken?: string; - previousStartedEventId?: number; - } - - export interface WorkflowExecution { - workflowId?: string; - runId?: string; - } - - export interface HistoryEvent { - eventTimestamp?: any; - eventType?: string; - eventId?: number; - workflowExecutionStartedEventAttributes?: WorkflowExecutionStartedEventAttributes; - workflowExecutionCompletedEventAttributes?: WorkflowExecutionCompletedEventAttributes; - completeWorkflowExecutionFailedEventAttributes?: CompleteWorkflowExecutionFailedEventAttributes; - workflowExecutionFailedEventAttributes?: WorkflowExecutionFailedEventAttributes; - failWorkflowExecutionFailedEventAttributes?: FailWorkflowExecutionFailedEventAttributes; - workflowExecutionTimedOutEventAttributes?: WorkflowExecutionTimedOutEventAttributes; - workflowExecutionCanceledEventAttributes?: WorkflowExecutionCanceledEventAttributes; - cancelWorkflowExecutionFailedEventAttributes?: CancelWorkflowExecutionFailedEventAttributes; - workflowExecutionContinuedAsNewEventAttributes?: WorkflowExecutionContinuedAsNewEventAttributes; - continueAsNewWorkflowExecutionFailedEventAttributes?: ContinueAsNewWorkflowExecutionFailedEventAttributes; - workflowExecutionTerminatedEventAttributes?: WorkflowExecutionTerminatedEventAttributes; - workflowExecutionCancelRequestedEventAttributes?: WorkflowExecutionCancelRequestedEventAttributes; - decisionTaskScheduledEventAttributes?: DecisionTaskScheduledEventAttributes; - decisionTaskStartedEventAttributes?: DecisionTaskStartedEventAttributes; - decisionTaskCompletedEventAttributes?: DecisionTaskCompletedEventAttributes; - decisionTaskTimedOutEventAttributes?: DecisionTaskTimedOutEventAttributes; - activityTaskScheduledEventAttributes?: ActivityTaskScheduledEventAttributes; - activityTaskStartedEventAttributes?: ActivityTaskStartedEventAttributes; - activityTaskCompletedEventAttributes?: ActivityTaskCompletedEventAttributes; - activityTaskFailedEventAttributes?: ActivityTaskFailedEventAttributes; - activityTaskTimedOutEventAttributes?: ActivityTaskTimedOutEventAttributes; - activityTaskCanceledEventAttributes?: ActivityTaskCanceledEventAttributes; - activityTaskCancelRequestedEventAttributes?: ActivityTaskCancelRequestedEventAttributes; - workflowExecutionSignaledEventAttributes?: WorkflowExecutionSignaledEventAttributes; - markerRecordedEventAttributes?: MarkerRecordedEventAttributes; - timerStartedEventAttributes?: TimerStartedEventAttributes; - timerFiredEventAttributes?: TimerFiredEventAttributes; - timerCanceledEventAttributes?: TimerCanceledEventAttributes; - startChildWorkflowExecutionInitiatedEventAttributes?: StartChildWorkflowExecutionInitiatedEventAttributes; - childWorkflowExecutionStartedEventAttributes?: ChildWorkflowExecutionStartedEventAttributes; - childWorkflowExecutionCompletedEventAttributes?: ChildWorkflowExecutionCompletedEventAttributes; - childWorkflowExecutionFailedEventAttributes?: ChildWorkflowExecutionFailedEventAttributes; - childWorkflowExecutionTimedOutEventAttributes?: ChildWorkflowExecutionTimedOutEventAttributes; - childWorkflowExecutionCanceledEventAttributes?: ChildWorkflowExecutionCanceledEventAttributes; - childWorkflowExecutionTerminatedEventAttributes?: ChildWorkflowExecutionTerminatedEventAttributes; - signalExternalWorkflowExecutionInitiatedEventAttributes?: SignalExternalWorkflowExecutionInitiatedEventAttributes; - externalWorkflowExecutionSignaledEventAttributes?: ExternalWorkflowExecutionSignaledEventAttributes; - signalExternalWorkflowExecutionFailedEventAttributes?: SignalExternalWorkflowExecutionFailedEventAttributes; - externalWorkflowExecutionCancelRequestedEventAttributes?: ExternalWorkflowExecutionCancelRequestedEventAttributes; - requestCancelExternalWorkflowExecutionInitiatedEventAttributes?: RequestCancelExternalWorkflowExecutionInitiatedEventAttributes; - requestCancelExternalWorkflowExecutionFailedEventAttributes?: RequestCancelExternalWorkflowExecutionFailedEventAttributes; - scheduleActivityTaskFailedEventAttributes?: ScheduleActivityTaskFailedEventAttributes; - requestCancelActivityTaskFailedEventAttributes?: RequestCancelActivityTaskFailedEventAttributes; - startTimerFailedEventAttributes?: StartTimerFailedEventAttributes; - cancelTimerFailedEventAttributes?: CancelTimerFailedEventAttributes; - startChildWorkflowExecutionFailedEventAttributes?: StartChildWorkflowExecutionFailedEventAttributes; - } - - export interface WorkflowExecutionStartedEventAttributes { - input?: string; - executionStartToCloseTimeout?: string; - taskStartToCloseTimeout?: string; - childPolicy?: string; - taskList?: TaskList; - workflowType?: WorkflowType; - tagList?: string[]; - continuedExecutionRunId?: string; - parentWorkflowExecution?: WorkflowExecution; - parentInitiatedEventId?: number; - } - - export interface WorkflowExecutionCompletedEventAttributes { - result?: string; - decisionTaskCompletedEventId?: number; - } - - export interface CompleteWorkflowExecutionFailedEventAttributes { - cause?: string; - decisionTaskCompletedEventId?: number; - } - - export interface WorkflowExecutionFailedEventAttributes { - reason?: string; - details?: string; - decisionTaskCompletedEventId?: number; - } - - export interface FailWorkflowExecutionFailedEventAttributes { - cause?: string; - decisionTaskCompletedEventId?: number; - } - - export interface WorkflowExecutionTimedOutEventAttributes { - timeoutType?: string; - childPolicy?: string; - } - - export interface WorkflowExecutionCanceledEventAttributes { - details?: string; - decisionTaskCompletedEventId?: number; - } - - export interface CancelWorkflowExecutionFailedEventAttributes { - cause?: string; - decisionTaskCompletedEventId?: number; - } - - export interface WorkflowExecutionContinuedAsNewEventAttributes { - input?: string; - decisionTaskCompletedEventId?: number; - newExecutionRunId?: string; - executionStartToCloseTimeout?: string; - taskList?: TaskList; - taskStartToCloseTimeout?: string; - childPolicy?: string; - tagList?: string[]; - workflowType?: WorkflowType; - } - - export interface ContinueAsNewWorkflowExecutionFailedEventAttributes { - cause?: string; - decisionTaskCompletedEventId?: number; - } - - export interface WorkflowExecutionTerminatedEventAttributes { - reason?: string; - details?: string; - childPolicy?: string; - cause?: string; - } - - export interface WorkflowExecutionCancelRequestedEventAttributes { - externalWorkflowExecution?: WorkflowExecution; - externalInitiatedEventId?: number; - cause?: string; - } - - export interface DecisionTaskScheduledEventAttributes { - taskList?: TaskList; - startToCloseTimeout?: string; - } - - export interface DecisionTaskStartedEventAttributes { - identity?: string; - scheduledEventId?: number; - } - - export interface DecisionTaskCompletedEventAttributes { - executionContext?: string; - scheduledEventId?: number; - startedEventId?: number; - } - - export interface DecisionTaskTimedOutEventAttributes { - timeoutType?: string; - scheduledEventId?: number; - startedEventId?: number; - } - - export interface ActivityTaskScheduledEventAttributes { - activityType?: ActivityType; - activityId?: string; - input?: string; - control?: string; - scheduleToStartTimeout?: string; - scheduleToCloseTimeout?: string; - startToCloseTimeout?: string; - taskList?: TaskList; - decisionTaskCompletedEventId?: number; - heartbeatTimeout?: string; - } - - export interface ActivityTaskStartedEventAttributes { - identity?: string; - scheduledEventId?: number; - } - - export interface ActivityTaskCompletedEventAttributes { - result?: string; - scheduledEventId?: number; - startedEventId?: number; - } - - export interface ActivityTaskFailedEventAttributes { - reason?: string; - details?: string; - scheduledEventId?: number; - startedEventId?: number; - } - - export interface ActivityTaskTimedOutEventAttributes { - timeoutType?: string; - scheduledEventId?: number; - startedEventId?: number; - details?: string; - } - - export interface ActivityTaskCanceledEventAttributes { - details?: string; - scheduledEventId?: number; - startedEventId?: number; - latestCancelRequestedEventId?: number; - } - - export interface ActivityTaskCancelRequestedEventAttributes { - decisionTaskCompletedEventId?: number; - activityId?: string; - } - - export interface WorkflowExecutionSignaledEventAttributes { - signalName?: string; - input?: string; - externalWorkflowExecution?: WorkflowExecution; - externalInitiatedEventId?: number; - } - - export interface MarkerRecordedEventAttributes { - markerName?: string; - details?: string; - decisionTaskCompletedEventId?: number; - } - - export interface TimerStartedEventAttributes { - timerId?: string; - control?: string; - startToFireTimeout?: string; - decisionTaskCompletedEventId?: number; - } - - export interface TimerFiredEventAttributes { - timerId?: string; - startedEventId?: number; - } - - export interface TimerCanceledEventAttributes { - timerId?: string; - startedEventId?: number; - decisionTaskCompletedEventId?: number; - } - - export interface StartChildWorkflowExecutionInitiatedEventAttributes { - workflowId?: string; - workflowType?: WorkflowType; - control?: string; - input?: string; - executionStartToCloseTimeout?: string; - taskList?: TaskList; - decisionTaskCompletedEventId?: number; - childPolicy?: string; - taskStartToCloseTimeout?: string; - tagList?: string[]; - } - - export interface ChildWorkflowExecutionStartedEventAttributes { - workflowExecution?: WorkflowExecution; - workflowType?: WorkflowType; - initiatedEventId?: number; - } - - export interface ChildWorkflowExecutionCompletedEventAttributes { - workflowExecution?: WorkflowExecution; - workflowType?: WorkflowType; - result?: string; - initiatedEventId?: number; - startedEventId?: number; - } - - export interface ChildWorkflowExecutionFailedEventAttributes { - workflowExecution?: WorkflowExecution; - workflowType?: WorkflowType; - reason?: string; - details?: string; - initiatedEventId?: number; - startedEventId?: number; - } - - export interface ChildWorkflowExecutionTimedOutEventAttributes { - workflowExecution?: WorkflowExecution; - workflowType?: WorkflowType; - timeoutType?: string; - initiatedEventId?: number; - startedEventId?: number; - } - - export interface ChildWorkflowExecutionCanceledEventAttributes { - workflowExecution?: WorkflowExecution; - workflowType?: WorkflowType; - details?: string; - initiatedEventId?: number; - startedEventId?: number; - } - - export interface ChildWorkflowExecutionTerminatedEventAttributes { - workflowExecution?: WorkflowExecution; - workflowType?: WorkflowType; - initiatedEventId?: number; - startedEventId?: number; - } - - export interface SignalExternalWorkflowExecutionInitiatedEventAttributes { - workflowId?: string; - runId?: string; - signalName?: string; - input?: string; - decisionTaskCompletedEventId?: number; - control?: string; - } - - export interface ExternalWorkflowExecutionSignaledEventAttributes { - workflowExecution?: WorkflowExecution; - initiatedEventId?: number; - } - - export interface SignalExternalWorkflowExecutionFailedEventAttributes { - workflowId?: string; - runId?: string; - cause?: string; - initiatedEventId?: number; - decisionTaskCompletedEventId?: number; - control?: string; - } - - export interface ExternalWorkflowExecutionCancelRequestedEventAttributes { - workflowExecution?: WorkflowExecution; - initiatedEventId?: number; - } - - export interface RequestCancelExternalWorkflowExecutionInitiatedEventAttributes { - workflowId?: string; - runId?: string; - decisionTaskCompletedEventId?: number; - control?: string; - } - - export interface RequestCancelExternalWorkflowExecutionFailedEventAttributes { - workflowId?: string; - runId?: string; - cause?: string; - initiatedEventId?: number; - decisionTaskCompletedEventId?: number; - control?: string; - } - - export interface ScheduleActivityTaskFailedEventAttributes { - activityType?: ActivityType; - activityId?: string; - cause?: string; - decisionTaskCompletedEventId?: number; - } - - export interface RequestCancelActivityTaskFailedEventAttributes { - activityId?: string; - cause?: string; - decisionTaskCompletedEventId?: number; - } - - export interface StartTimerFailedEventAttributes { - timerId?: string; - cause?: string; - decisionTaskCompletedEventId?: number; - } - - export interface CancelTimerFailedEventAttributes { - timerId?: string; - cause?: string; - decisionTaskCompletedEventId?: number; - } - - export interface StartChildWorkflowExecutionFailedEventAttributes { - workflowType?: WorkflowType; - cause?: string; - workflowId?: string; - initiatedEventId?: number; - decisionTaskCompletedEventId?: number; - control?: string; - } - - export interface ActivityTask { - taskToken?: string; - activityId?: string; - startedEventId?: number; - workflowExecution?: WorkflowExecution; - activityType?: ActivityType; - input?: string; - } - - export interface PollForActivityTaskResult { - activityTask?: ActivityTask; - } - - export interface PollForDecisionTaskResult { - decisionTask?: DecisionTask; - } - - export interface StartWorkflowExecutionResult { - run?: Run; - } - - export interface Run { - runId?: string; - } - - } - - export module Sns { - - export interface Client { - config: ClientConfig; - - publicTopic(params: PublishRequest, callback: (err: any, data: PublishResult) => void): void; - createTopic(params: CreateTopicRequest, callback: (err: any, data: CreateTopicResult) => void): void; - deleteTopic(params: DeleteTopicRequest, callback: (err: any, data: any) => void): void; - } - - export interface PublishRequest { - TopicArn?: string; - Message?: string; - MessageStructure?: string; - Subject?: string; - } - - export interface PublishResult { - MessageId?: string; - } - - export interface CreateTopicRequest { - Name?: string; - } - - export interface CreateTopicResult { - TopicArn?: string; - } - - export interface DeleteTopicRequest { - TopicArn?: string; - } - - } - - export module s3 { - - export interface PutObjectRequest { - ACL?: string; - Body?: any; - Bucket: string; - CacheControl?: string; - ContentDisposition?: string; - ContentEncoding?: string; - ContentLanguage?: string; - ContentLength?: string; - ContentMD5?: string; - ContentType?: string; - Expires?: any; - GrantFullControl?: string; - GrantRead?: string; - GrantReadACP?: string; - GrantWriteACP?: string; - Key: string; - Metadata?: string[]; - ServerSideEncryption?: string; - StorageClass?: string; - WebsiteRedirectLocation?: string; - } - - export interface GetObjectRequest { - Bucket: string; - IfMatch?: string; - IfModifiedSince?: any; - IfNoneMatch?: string; - IfUnmodifiedSince?: any; - Key: string; - Range?: string; - ResponseCacheControl?: string; - ResponseContentDisposition?: string; - ResponseContentEncoding?: string; - ResponseContentLanguage?: string; - ResponseContentType?: string; - ResponseExpires?: any; - VersionId?: string; - } - - } - - export module ecs { - export interface CreateServicesParams { - desiredCount: number; - serviceName: string; - taskDefinition: string; - clientToken?: string; - cluster?: string; - deploymentConfiguration?: { - maximumPercent?: number; - minimumHealthyPercent?: number; - }; - loadBalancers?: { - containerName?: string; - containerPort?: number; - loadBalancerName?: string; - }[]; - role?: string; - } - - export interface DescribeServicesParams { - services: string[]; - cluster: string; - } - - export interface DescribeTaskDefinitionParams { - taskDefinition: string; - } - - export interface RegisterTaskDefinitionParams { - containerDefinitions: { - command?: string[], - cpu?: number, - disableNetworking?: boolean, - dnsSearchDomains?: string[], - dnsServers?: string[], - dockerLabels?: any, - dockerSecurityOptions?: string[], - entryPoint?: string[], - environment?: any[], - essential?: boolean, - extraHosts?: { - hostName: string, - ipAddress: string - }[]; - hostname?: string, - image?: string, - links?: string[], - logConfiguration?: { - logDriver: string, - options: any - }[], - memory?: number, - mountPoints?: { - containerPath: string, - readOnly: boolean, - sourceVolume: string - }[]; - name?: string, - portMappings?: { - containerPort?: number, - hostPort?: number, - protocol: string - }[]; - privileged?: boolean, - readonlyRootFilesystem?: boolean, - ulimits?: { - hardLimit: number, - name: string, - softLimit: number - }[]; - user?: string, - volumesFrom?: { - readOnly?: boolean, - sourceContainer?: string - }[], - workingDirectory?: string - }[]; - family: string; - volumes?: { - host: { - sourcePath: string - }, - name: string - }[]; - } - - export interface UpdateServiceParams { - service: string; - cluster?: string; - deploymentConfiguration?: { - maximumPercent: number; - minimumHealthyPercent: number; - }; - desiredCount?: number; - taskDefinition: string; - } - } + export var config: ClientConfig; + + export function Config(json: any): void; + + export class Credentials { + constructor(accessKeyId: string, secretAccessKey: string, sessionToken?: string); + accessKeyId: string; + } + + export class EnvironmentCredentials extends Credentials { + constructor(profile: string); + } + + export interface Logger { + write?: (chunk: any, encoding?: string, callback?: () => void) => void; + log?: (...messages: any[]) => void; + } + + export interface HttpOptions { + proxy?: string; + agent?: any; + timeout?: number; + xhrAsync?: boolean; + xhrWithCredentials?: boolean; + } + + export class Endpoint { + constructor(endpoint: string); + + host: string; + hostname: string; + href: string; + port: number; + protocol: string; + } + + interface AwsError extends Error { + stack: string; + } + + export interface Services { + autoscaling?: any; + cloudformation?: any; + cloudfront?: any; + cloudsearch?: any; + cloudsearchdomain?: any; + cloudtrail?: any; + cloudwatch?: any; + cloudwatchlogs?: any; + cognitoidentity?: any; + cognitosync?: any; + datapipeline?: any; + directconnect?: any; + dynamodb?: any; + ec2?: any; + ecs?: any; + elasticache?: any; + elasticbeanstalk?: any; + elastictranscoder?: any; + elb?: any; + emr?: any; + glacier?: any; + httpOptions?: HttpOptions; + iam?: any; + importexport?: any; + kinesis?: any; + opsworks?: any; + rds?: any; + redshift?: any; + route53?: any; + route53domains?: any; + s3?: any; + ses?: any; + simpledb?: any; + sns?: any; + sqs?: any; + storagegateway?: any; + sts?: any; + support?: any; + swf?: any; + } + + export interface ClientConfigPartial extends Services { + credentials?: Credentials; + region?: string; + accessKeyId?: string; + secretAccessKey?: string; + computeChecksums?: boolean; + convertResponseTypes?: boolean; + logger?: Logger; + maxRedirects?: number; + maxRetries?: number; + paramValidation?: boolean; + s3ForcePathStyle?: boolean; + apiVersion?: any; + apiVersions?: Services; + signatureVersion?: string; + sslEnabled?: boolean; + systemClockOffset?: number; + } + + export interface ClientConfig extends ClientConfigPartial { + update?: (options: ClientConfigPartial, allUnknownKeys?: boolean) => void; + getCredentials?: (callback: (err?: any) => void) => void; + loadFromPath?: (path: string) => void; + credentials: Credentials; + region: string; + } + + export class Lambda { + constructor(options?: any); + endpoint: Endpoint; + + addPermission(params: Lambda.AddPermissionParams, callback: (err: AwsError, data: any) => void): void; + createAlias(params: Lambda.CreateAliasParams, callback: (err: AwsError, data: any) => void): void; + createEventSourceMapping(params: Lambda.CreateEventSourceMappingParams, callback: (err: AwsError, data: any) => void): void; + createFunction(params: Lambda.CreateFunctionParams, callback: (err: AwsError, data: any) => void): void; + deleteAlias(params: Lambda.DeleteAliasParams, callback: (err: AwsError, data: any) => void): void; + deleteEventSourceMapping(params: Lambda.DeleteEventSourceMappingParams, callback: (err: AwsError, data: any) => void): void; + deleteFunction(params: Lambda.DeleteFunctionParams, callback: (err: AwsError, data: any) => void): void; + getAlias(params: Lambda.GetAliasParams, callback: (err: AwsError, data: any) => void): void; + getEventSourceMapping(params: Lambda.GetEventSourceMappingParams, callback: (err: AwsError, data: any) => void): void; + getFunction(params: Lambda.GetFunctionParams, callback: (err: AwsError, data: any) => void): void; + getFunctionConfiguration(params: Lambda.GetFunctionConfigurationParams, callback: (err: AwsError, data: any) => void): void; + getPolicy(params: Lambda.GetPolicyParams, callback: (err: AwsError, data: any) => void): void; + invoke(params: Lambda.InvokeParams, callback: (err: AwsError, data: any) => void): void; + listAliases(params: Lambda.ListAliasesParams, callback: (err: AwsError, data: any) => void): void; + listEventSourceMappings(params: Lambda.ListEventSourceMappingsParams, callback: (err: AwsError, data: any) => void): void; + listFunctions(params: Lambda.ListFunctionsParams, callback: (err: AwsError, data: any) => void): void; + listVersionsByFunction(params: Lambda.ListVersionsByFunctionParams, callback: (err: AwsError, data: any) => void): void; + publishVersion(params: Lambda.PublishVersionParams, callback: (err: AwsError, data: any) => void): void; + removePermission(params: Lambda.RemovePermissionParams, callback: (err: AwsError, data: any) => void): void; + updateAlias(params: Lambda.UpdateAliasParams, callback: (err: AwsError, data: any) => void): void; + updateEventSourceMapping(params: Lambda.UpdateEventSourceMappingParams, callback: (err: AwsError, data: any) => void): void; + updateFunctionCode(params: Lambda.UpdateFunctionCodeParams, callback: (err: AwsError, data: any) => void): void; + updateFunctionConfiguration(params: Lambda.UpdateFunctionConfigurationParams, callback: (err: AwsError, data: any) => void): void; + } + + export class SQS { + constructor(options?: any); + endpoint: Endpoint; + + addPermission(params: SQS.AddPermissionParams, callback: (err: AwsError, data: any) => void): void; + changeMessageVisibility(params: SQS.ChangeMessageVisibilityParams, callback: (err: AwsError, data: any) => void): void; + changeMessageVisibilityBatch(params: SQS.ChangeMessageVisibilityBatchParams, callback: (err: AwsError, data: SQS.ChangeMessageVisibilityBatchResponse) => void): void; + createQueue(params: SQS.CreateQueueParams, callback: (err: AwsError, data: SQS.CreateQueueResult) => void): void; + deleteMessage(params: SQS.DeleteMessageParams, callback: (err: AwsError, data: any) => void): void; + deleteMessageBatch(params: SQS.DeleteMessageBatchParams, callback: (err: AwsError, data: SQS.DeleteMessageBatchResult) => void): void; + deleteQueue(params: { QueueUrl: string; }, callback: (err: AwsError, data: any) => void): void; + getQueueAttributes(params: SQS.GetQueueAttributesParams, callback: (err: AwsError, data: SQS.GetQueueAttributesResult) => void): void; + getQueueUrl(params: SQS.GetQueueUrlParams, callback: (err: AwsError, data: { QueueUrl: string; }) => void): void; + listDeadLetterSourceQueues(params: { QueueUrl: string }, callback: (err: AwsError, data: { queueUrls: string[] }) => void): void; + listQueues(params: { QueueNamePrefix?: string }, callback: (err: AwsError, data: { QueueUrls: string[] }) => void): void; + purgeQueue(params: { QueueUrl: string }, callback: (err: AwsError, data: any) => void): void; + receiveMessage(params: SQS.ReceiveMessageParams, callback: (err: AwsError, data: SQS.ReceiveMessageResult) => void): void; + removePermission(params: { QueueUrl: string, Label: string }, callback: (err: AwsError, data: any) => void): void; + sendMessage(params: SQS.SendMessageParams, callback: (err: AwsError, data: SQS.SendMessageResult) => void): void; + sendMessageBatch(params: SQS.SendMessageBatchParams, callback: (err: AwsError, data: SQS.SendMessageBatchResult) => void): void; + setQueueAttributes(params: SQS.SetQueueAttributesParams, callback: (err: AwsError, data: any) => void): void; + } + + export class SES { + constructor(options?: any); + endpoint: Endpoint; + + sendEmail(params: any, callback: (err: any, data: SES.SendEmailResult) => void): void; + } + + export class SNS { + constructor(options?: any); + endpoint: Endpoint; + + publish(request: Sns.PublishRequest, callback: (err: any, data: any) => void): void; + } + + export class SWF { + constructor(options?: any); + endpoint: Endpoint; + + countClosedWorkflowExecutions(params: any, callback: (err: any, data: any) => void): void; + countOpenWorkflowExecutions(params: any, callback: (err: any, data: any) => void): void; + countPendingActivityTasks(params: any, callback: (err: any, data: any) => void): void; + countPendingDecisionTasks(params: any, callback: (err: any, data: any) => void): void; + deprecateActivityType(params: any, callback: (err: any, data: any) => void): void; + deprecateDomain(params: any, callback: (err: any, data: any) => void): void; + deprecateWorkflowType(params: any, callback: (err: any, data: any) => void): void; + describeActivityType(params: any, callback: (err: any, data: any) => void): void; + describeDomain(params: any, callback: (err: any, data: any) => void): void; + describeWorkflowExecution(params: any, callback: (err: any, data: any) => void): void; + describeWorkflowType(params: any, callback: (err: any, data: any) => void): void; + getWorkflowExecutionHistory(params: any, callback: (err: any, data: any) => void): void; + listActivityTypes(params: any, callback: (err: any, data: any) => void): void; + listClosedWorkflowExecutions(params: any, callback: (err: any, data: any) => void): void; + listDomains(params: any, callback: (err: any, data: any) => void): void; + listOpenWorkflowExecutions(params: any, callback: (err: any, data: any) => void): void; + listWorkflowTypes(params: any, callback: (err: any, data: any) => void): void; + pollForActivityTask(params: any, callback: (err: any, data: Swf.ActivityTask) => void): void; + pollForDecisionTask(params: any, callback: (err: any, data: Swf.DecisionTask) => void): void; + recordActivityTaskHeartbeat(params: any, callback: (err: any, data: any) => void): void; + registerActivityType(params: any, callback: (err: any, data: any) => void): void; + registerDomain(params: any, callback: (err: any, data: any) => void): void; + registerWorkflowType(params: any, callback: (err: any, data: any) => void): void; + requestCancelWorkflowExecution(params: any, callback: (err: any, data: any) => void): void; + respondActivityTaskCanceled(params: Swf.RespondActivityTaskCanceledRequest, callback: (err: any, data: any) => void): void; + respondActivityTaskCompleted(params: Swf.RespondActivityTaskCompletedRequest, callback: (err: any, data: any) => void): void; + respondActivityTaskFailed(params: Swf.RespondActivityTaskFailedRequest, callback: (err: any, data: any) => void): void; + respondDecisionTaskCompleted(params: Swf.RespondDecisionTaskCompletedRequest, callback: (err: any, data: any) => void): void; + signalWorkflowExecution(params: any, callback: (err: any, data: any) => void): void; + startWorkflowExecution(params: any, callback: (err: any, data: Swf.StartWorkflowExecutionResult) => void): void; + terminateWorkflowExecution(params: any, callback: (err: any, data: any) => void): void; + + } + + export class S3 { + constructor(options?: any); + endpoint: Endpoint; + + getObject(params: s3.GetObjectRequest, callback: (err: Error, data: any) => void): void; + putObject(params: s3.PutObjectRequest, callback: (err: Error, data: any) => void): void; + deleteObject(params: s3.DeleteObjectRequest, callback: (err: Error, data: any) => void): void; + headObject(params: s3.HeadObjectRequest, callback: (err: Error, data: any) => void): void; + getSignedUrl(operation: string, params: any): string; + getSignedUrl(operation: string, params: any, callback: (err: Error, url: string) => void): void; + upload(params?: s3.PutObjectRequest, options?: s3.UploadOptions, callback?: (err: Error, data: any) => void): void; + listObjects(params: s3.ListObjectRequest, callback: (err: Error, data: s3.ListObjectResponse) => void): void; + listObjectsV2(params: s3.ListObjectV2Request, callback: (err: Error, data: s3.ListObjectV2Response) => void): void; + } + + export class STS { + constructor(options?: any); + endpoint: Endpoint; + + /** + * Returns a set of temporary security credentials (consisting of an access key ID, a secret access key, and a security token) that you can use to access AWS resources that you might not normally have access to. + */ + assumeRole(params: sts.AssumeRoleParams, callback: (err: any, data: sts.AssumeRoleCallbackData) => void): void; + + /** + * Returns a set of temporary security credentials for users who have been authenticated via a SAML authentication response. + */ + assumeRoleWithSAML(params: sts.AssumeRoleWithSAMLParams, callback: (err: any, data: any) => void): void; + + /** + * Returns a set of temporary security credentials for users who have been authenticated in a mobile or web application with a web identity provider, such as Amazon Cognito, Login with Amazon, Facebook, Google, or any OpenID Connect-compatible identity provider. + */ + assumeRoleWithWebIdentity(params: sts.AssumeRoleWithWebIdentityParams, callback: (err: any, data: any) => void): void; + + /** + * Creates a credentials object from STS response data containing credentials information. + */ + credentialsFrom(params: sts.CredentialsFromParams, callback: (err: any, data: any) => void): void; + + /** + * Decodes additional information about the authorization status of a request from an encoded message returned in response to an AWS request. + */ + decodeAuthorizationMessage(params: sts.DecodeAuthorizationMessageParams, callback: (err: any, data: any) => void): void; + + /** + * Returns details about the IAM identity whose credentials are used to call the API. + */ + getCallerIdentity(params: {}, callback: (err: any, data: any) => void): void; + + /** + * Returns a set of temporary security credentials (consisting of an access key ID, a secret access key, and a security token) for a federated user. + */ + getFederationToken(params: sts.GetFederationTokenParams, callback: (err: any, data: any) => void): void; + + /** + * Returns a set of temporary credentials for an AWS account or IAM user. + */ + getSessionToken(params: sts.GetSessionTokenParams, callback: (err: any, data: any) => void): void; + + } + + export class ECS { + constructor(options?: any); + endpoint: Endpoint; + /** + * Runs and maintains a desired number of tasks from a specified task definition. If the number of tasks running in a service drops below desiredCount, Amazon ECS spawns another instantiation of the task in the specified cluster. To update an existing service, see UpdateService. + */ + createService(params: ecs.CreateServicesParams, callback: (err: any, data: any) => void): void; + /** + * Describes one or more of your clusters. + */ + describeClusters(params: ecs.DescribeClustersParams, callback: (err: any, data: any) => void): void; + /** + * Describes the specified services running in your cluster. + */ + describeServices(params: ecs.DescribeServicesParams, callback: (err: any, data: any) => void): void; + /** + * Describes a specified task or tasks. + */ + describeTasks(params: ecs.DescribeTasksParams, callback: (err: any, data: any) => void): void; + /** + * Describes a task definition. You can specify a family and revision to find information about a specific task definition, or you can simply specify the family to find the latest ACTIVE revision in that family. + */ + describeTaskDefinition(params: ecs.DescribeTaskDefinitionParams, callback: (err: any, data: any) => void): void; + /** + * Registers a new task definition from the supplied family and containerDefinitions. Optionally, you can add data volumes to your containers with the volumes parameter. For more information about task definition parameters and defaults, see Amazon ECS Task Definitions in the Amazon EC2 Container Service Developer Guide. + */ + registerTaskDefinition(params: ecs.RegisterTaskDefinitionParams, callback: (err: any, data: any) => void): void; + /** + * Modifies the desired count, deployment configuration, or task definition used in a service. + */ + updateService(params: ecs.UpdateServiceParams, callback: (err: any, data: any) => void): void; + } + + export class DynamoDB { + constructor(options?: any); + endpoint: Endpoint; + createTable(params: any, next: (err: any, data: any) => void): void; + deleteTable(params: any, next: (err: any, data: any) => void): void; + } + + // ========================================================== + + export module DynamoDB { + + interface _DDBDC_Generic { + TableName: string; + ExpressionAttributeNames?: { [someKey: string]: string }; + ReturnConsumedCapacity?: "INDEXES" | "TOTAL" | "NONE"; + } + + type _DDBDC_ComparisonOperator = "EQ" | "NE" | "IN" | "LE" | "LT" | "GE" | "GT" | "BETWEEN" | "NOT_NULL" | "NULL" | "CONTAINS" | "NOT_CONTAINS" | "BEGINS_WITH" + type _DDBDC_Keys = { [someKey: string]: any }; + type _DDBDC_KeyComparison = { + [someKey: string]: { + AttributeValueList: any[]; + ComparisonOperator: _DDBDC_ComparisonOperator; + } + }; + + interface _DDBDC_Reader extends _DDBDC_Generic { + ConsistentRead?: boolean; + ProjectionExpression?: string; + AttributesToGet?: string[]; + } + + interface _DDBDC_Writer extends _DDBDC_Generic { + ExpressionAttributeValues?: _DDBDC_Keys; + ReturnItemCollectionMetrics?: "SIZE" | "NONE"; + ReturnValues?: "NONE" | "ALL_OLD" | "UPDATED_OLD" | "ALL_NEW" | "UPDATED_NEW"; + ConditionExpression?: string; + ConditionalOperator?: "AND" | "OR"; + Expected?: { + [someKey: string]: { + AttributeValueList?: any[]; + ComparisonOperator?: _DDBDC_ComparisonOperator; + Exists: boolean; + Value?: any; + } + } + } + + interface UpdateParam extends _DDBDC_Writer { + Key: _DDBDC_Keys; + AttributeUpdates: { + [someKey: string]: { + Action: "PUT" | "ADD" | "DELETE"; + Value: any + } + } + } + + interface QueryParam extends _DDBDC_Reader { + ConditionalOperator?: "AND" | "OR"; + ExclusiveStartKey?: _DDBDC_Keys; + ExpressionAttributeValues?: _DDBDC_Keys; + FilterExpression?: string; + IndexName?: string; + KeyConditionExpression?: string; + KeyConditions?: _DDBDC_KeyComparison; + Limit?: number; + QueryFilter?: _DDBDC_KeyComparison; + ScanIndexForward?: boolean; + Select?: "ALL_ATTRIBUTES" | "ALL_PROJECTED_ATTRIBUTES" | "SPECIFIC_ATTRIBUTES" | "COUNT"; + } + + interface ScanParam extends QueryParam { + Segment?: number; + ScanFilter?: _DDBDC_KeyComparison; + TotalSegments?: number; + } + + interface GetParam extends _DDBDC_Reader { + Key: _DDBDC_Keys; + } + + interface PutParam extends _DDBDC_Writer { + Item: _DDBDC_Keys; + } + + interface DeleteParam extends _DDBDC_Writer { + Key: _DDBDC_Keys; + } + + export class DocumentClient { + constructor(options?: any); + get(params: GetParam, next: (err: any, data: any) => void): void; + put(params: PutParam, next: (err: any, data: any) => void): void; + delete(params: DeleteParam, next: (err: any, data: any) => void): void; + query(params: QueryParam, next: (err: any, data: any) => void): void; + scan(params: ScanParam, next: (err: any, data: any) => void): void; + update(params: UpdateParam, next: (err: any, data: any) => void): void; + createSet(list: any[], options?: { validate?: boolean }): { values: any[], type: string }; + batchGet(params: any, next: (err: any, data: any) => void): void; + batchWrite(params: any, next: (err: any, data: any) => void): void; + } + + } + + // =========================================================== + + export module Lambda { + + export interface AddPermissionParams { + Action: string; + FunctionName: string; + Principal: string; + StatementId: string; + Qualifier?: string; + SourceAccount?: string; + SourceArn?: string; + } + + export interface CreateAliasParams { + FunctionName: string; + FunctionVersion: string; + Name: string; + Description?: string; + } + + export interface CreateEventSourceMappingParams { + EventSourceArn: string; + FunctionName: string; + StartingPosition: string; /* TRIM_HORIZON | LATEST */ + BatchSize?: number; + Enabled?: boolean + } + + export interface CreateFunctionParams { + Code: { + S3Bucket?: string; + S3Key?: string; + S3ObjectVersion?: string; + ZipFile?: any; // new Buffer('...') || string; + }, + FunctionName: string; + Handler: string; + Role: string; + Runtime: string; /* 'nodejs | java8 | python2.7', */ + Description?: string; + MemorySize?: number; + Publish?: boolean; + Timeout?: number; + VpcConfig?: { + SecurityGroupIds?: string[]; + SubnetIds?: string[]; + } + } + + export interface DeleteAliasParams { + FunctionName: string; + Name: string; + } + + export interface DeleteEventSourceMappingParams { + UUID: string; + } + + export interface DeleteFunctionParams { + FunctionName: string; + Qualifier?: string; + } + export interface GetAliasParams { + FunctionName: string; + Name: string; + } + + export interface GetEventSourceMappingParams { + UUID: string; + } + + export interface GetFunctionParams { + FunctionName: string; + Qualifier?: string; + } + + export interface GetFunctionConfigurationParams { + FunctionName: string; + Qualifier?: string; + } + + export interface GetPolicyParams { + FunctionName: string; + Qualifier?: string; + } + + export interface InvokeParams { + FunctionName: string; + ClientContext?: string; + InvocationType?: string;/* 'Event | RequestResponse | DryRun' */ + LogType?: string; /* 'None | Tail' */ + Payload?: any; /* new Buffer('...') || string */ + Qualifier?: string; + } + + export interface ListAliasesParams { + FunctionName: string; + FunctionVersion?: string; + Marker?: string; + MaxItems?: number + } + + export interface ListEventSourceMappingsParams { + EventSourceArn?: string; + FunctionName?: string; + Marker?: string; + MaxItems?: number + } + + export interface ListFunctionsParams { + Marker?: string; + MaxItems?: number + } + + export interface ListVersionsByFunctionParams { + FunctionName: string; + Marker?: string; + MaxItems?: number + } + + export interface PublishVersionParams { + FunctionName: string; + CodeSha256?: string; + Description?: string; + } + + export interface RemovePermissionParams { + FunctionName: string; + StatementId: string; + Qualifier?: string; + } + + export interface UpdateAliasParams { + FunctionName: string; + Name: string; + Description?: string; + FunctionVersion?: string; + } + + export interface UpdateEventSourceMappingParams { + UUID: string; + BatchSize?: number; + Enabled?: boolean; + FunctionName?: string; + } + + export interface UpdateFunctionCodeParams { + FunctionName: string; + Publish?: boolean; + S3Bucket?: string; + S3Key?: string; + S3ObjectVersion?: string; + ZipFile?: any; /* new Buffer('...') || string; */ + + } + + export interface UpdateFunctionConfigurationParams { + FunctionName: string; + Description?: string; + Handler?: string; + MemorySize?: number; + Role?: string; + Timeout?: number; + VpcConfig?: { + SecurityGroupIds?: string[]; + SubnetIds?: string[]; + } + } + } + + export module SQS { + + export interface SqsOptions { + params?: any; + endpoint?: string; + accessKeyId?: string; + secretAccessKey?: string; + sessionToken?: Credentials; + credentials?: Credentials; + credentialProvider?: any; + region?: string; + maxRetries?: number; + maxRedirects?: number; + sslEnabled?: boolean; + paramValidation?: boolean; + computeChecksums?: boolean; + convertResponseTypes?: boolean; + correctClockSkew?: boolean; + s3ForcePathStyle?: boolean; + s3BucketEndpoint?: boolean; + httpOptions?: HttpOptions; + apiVersion?: string; + apiVersions?: { [serviceName: string]: string }; + logger?: Logger; + systemClockOffset?: number; + signatureVersion?: string; + signatureCache?: boolean; + } + + export interface AddPermissionParams { + QueueUrl: string; + Label: string; + AWSAccountIds: string[]; + Actions: string[]; + } + + export interface ChangeMessageVisibilityParams { + QueueUrl: string, + ReceiptHandle: string, + VisibilityTimeout: number + } + + export interface ChangeMessageVisibilityBatchParams { + QueueUrl: string, + Entries: { Id: string; ReceiptHandle: string; VisibilityTimeout?: number; }[] + } + + export interface ChangeMessageVisibilityBatchResponse { + Successful: { Id: string }[]; + Failed: BatchResultErrorEntry[]; + } + + export interface SendMessageParams { + QueueUrl?: string; + MessageBody: string; + DelaySeconds?: number; + MessageAttributes?: { [name: string]: MessageAttribute; } + } + + export interface ReceiveMessageParams { + QueueUrl: string; + MaxNumberOfMessages?: number; + VisibilityTimeout?: number; + AttributeNames?: string[]; + MessageAttributeNames?: string[]; + WaitTimeSeconds?: number; + } + + export interface DeleteMessageBatchParams { + QueueUrl: string; + Entries: DeleteMessageBatchRequestEntry[]; + } + + export interface DeleteMessageBatchRequestEntry { + Id: string; + ReceiptHandle: string; + } + + export interface DeleteMessageParams { + QueueUrl: string; + ReceiptHandle: string; + } + + export interface SendMessageBatchParams { + QueueUrl: string; + Entries: SendMessageBatchRequestEntry[]; + } + + export interface SendMessageBatchRequestEntry { + Id: string; + MessageBody: string; + DelaySeconds?: number; + MessageAttributes?: { [name: string]: MessageAttribute; } + } + + export interface CreateQueueParams { + QueueName: string; + Attributes: QueueAttributes; + } + + export interface QueueAttributes { + [name: string]: any; + DelaySeconds?: number; + MaximumMessageSize?: number; + MessageRetentionPeriod?: number; + Policy?: any; + ReceiveMessageWaitTimeSeconds?: number; + VisibilityTimeout?: number; + RedrivePolicy?: any; + } + + export interface GetQueueAttributesParams { + QueueUrl: string; + AttributeNames: string[]; + } + + export interface GetQueueAttributesResult { + Attributes: { [name: string]: string }; + } + + export interface GetQueueUrlParams { + QueueName: string; + QueueOwnerAWSAccountId?: string; + } + + export interface SendMessageResult { + MessageId: string; + MD5OfMessageBody: string; + MD5OfMessageAttributes: string; + } + + export interface ReceiveMessageResult { + Messages: Message[]; + } + + export interface Message { + MessageId: string; + ReceiptHandle: string; + MD5OfBody: string; + Body: string; + Attributes: { [name: string]: any }; + MD5OfMessageAttributes: string; + MessageAttributes: { [name: string]: MessageAttribute; } + } + + export interface MessageAttribute { + StringValue?: string; + BinaryValue?: any; //(Buffer, Typed Array, Blob, String) + StringListValues?: string[]; + BinaryListValues?: any[]; + DataType: string; + } + + export interface DeleteMessageBatchResult { + Successful: DeleteMessageBatchResultEntry[]; + Failed: BatchResultErrorEntry[]; + } + + export interface DeleteMessageBatchResultEntry { + Id: string; + } + + export interface BatchResultErrorEntry { + Id: string; + Code: string; + Message?: string; + SenderFault: boolean; + } + + export interface SendMessageBatchResult { + Successful: SendMessageBatchResultEntry[]; + Failed: BatchResultErrorEntry[]; + } + + export interface SendMessageBatchResultEntry { + Id: string; + MessageId: string; + MD5OfMessageBody: string; + MD5OfMessageAttributes: string; + } + + export interface CreateQueueResult { + QueueUrl: string; + } + + export interface SetQueueAttributesParams { + QueueUrl: string; + Attributes: QueueAttributes; + } + + } + + export module SES { + + export interface Client { + config: ClientConfig; + + sendEmail(params: any, callback: (err: any, data: SendEmailResult) => void): void; + } + + export interface SendEmailRequest { + Source: string; + Destination: Destination; + Message: Message; + ReplyToAddresses: string[]; + ReturnPath: string; + } + + export class Destination { + ToAddresses: string[]; + CcAddresses: string[]; + BccAddresses: string[]; + } + + export class Message { + Subject: Content; + Body: Body; + } + + export class Content { + Data: string; + Charset: string; + } + + export class Body { + Text: Content; + Html: Content; + } + + export class SendEmailResult { + MessageId: string; + } + + } + + export module Swf { + + export interface Client { + //constructor(options?: any); + config: ClientConfig; + + countClosedWorkflowExecutions(params: any, callback: (err: any, data: any) => void): void; + countOpenWorkflowExecutions(params: any, callback: (err: any, data: any) => void): void; + countPendingActivityTasks(params: any, callback: (err: any, data: any) => void): void; + countPendingDecisionTasks(params: any, callback: (err: any, data: any) => void): void; + deprecateActivityType(params: any, callback: (err: any, data: any) => void): void; + deprecateDomain(params: any, callback: (err: any, data: any) => void): void; + deprecateWorkflowType(params: any, callback: (err: any, data: any) => void): void; + describeActivityType(params: any, callback: (err: any, data: any) => void): void; + describeDomain(params: any, callback: (err: any, data: any) => void): void; + describeWorkflowExecution(params: any, callback: (err: any, data: any) => void): void; + describeWorkflowType(params: any, callback: (err: any, data: any) => void): void; + getWorkflowExecutionHistory(params: any, callback: (err: any, data: any) => void): void; + listActivityTypes(params: any, callback: (err: any, data: any) => void): void; + listClosedWorkflowExecutions(params: any, callback: (err: any, data: any) => void): void; + listDomains(params: any, callback: (err: any, data: any) => void): void; + listOpenWorkflowExecutions(params: any, callback: (err: any, data: any) => void): void; + listWorkflowTypes(params: any, callback: (err: any, data: any) => void): void; + pollForActivityTask(params: any, callback: (err: any, data: ActivityTask) => void): void; + pollForDecisionTask(params: any, callback: (err: any, data: DecisionTask) => void): void; + recordActivityTaskHeartbeat(params: any, callback: (err: any, data: any) => void): void; + registerActivityType(params: any, callback: (err: any, data: any) => void): void; + registerDomain(params: any, callback: (err: any, data: any) => void): void; + registerWorkflowType(params: any, callback: (err: any, data: any) => void): void; + requestCancelWorkflowExecution(params: any, callback: (err: any, data: any) => void): void; + respondActivityTaskCanceled(params: RespondActivityTaskCanceledRequest, callback: (err: any, data: any) => void): void; + respondActivityTaskCompleted(params: RespondActivityTaskCompletedRequest, callback: (err: any, data: any) => void): void; + respondActivityTaskFailed(params: RespondActivityTaskFailedRequest, callback: (err: any, data: any) => void): void; + respondDecisionTaskCompleted(params: RespondDecisionTaskCompletedRequest, callback: (err: any, data: any) => void): void; + signalWorkflowExecution(params: any, callback: (err: any, data: any) => void): void; + startWorkflowExecution(params: any, callback: (err: any, data: StartWorkflowExecutionResult) => void): void; + terminateWorkflowExecution(params: any, callback: (err: any, data: any) => void): void; + } + + export interface PollForActivityTaskRequest { + domain?: string; + taskList?: TaskList; + identity?: string; + } + + export interface TaskList { + name?: string; + } + + export interface PollForDecisionTaskRequest { + domain?: string; + taskList?: TaskList; + identity?: string; + nextPageToken?: string; + maximumPageSize?: number; + reverseOrder?: Boolean; + } + + export interface StartWorkflowExecutionRequest { + domain?: string; + workflowId?: string; + workflowType?: WorkflowType; + taskList?: TaskList; + input?: string; + executionStartToCloseTimeout?: string; + tagList?: string[]; + taskStartToCloseTimeout?: string; + childPolicy?: string; + } + + export interface WorkflowType { + name?: string; + version?: string; + } + + export interface RespondDecisionTaskCompletedRequest { + taskToken?: string; + decisions?: Decision[]; + executionContext?: string; + } + + export interface Decision { + decisionType?: string; + scheduleActivityTaskDecisionAttributes?: ScheduleActivityTaskDecisionAttributes; + requestCancelActivityTaskDecisionAttributes?: RequestCancelActivityTaskDecisionAttributes; + completeWorkflowExecutionDecisionAttributes?: CompleteWorkflowExecutionDecisionAttributes; + failWorkflowExecutionDecisionAttributes?: FailWorkflowExecutionDecisionAttributes; + cancelWorkflowExecutionDecisionAttributes?: CancelWorkflowExecutionDecisionAttributes; + continueAsNewWorkflowExecutionDecisionAttributes?: ContinueAsNewWorkflowExecutionDecisionAttributes; + recordMarkerDecisionAttributes?: RecordMarkerDecisionAttributes; + startTimerDecisionAttributes?: StartTimerDecisionAttributes; + cancelTimerDecisionAttributes?: CancelTimerDecisionAttributes; + signalExternalWorkflowExecutionDecisionAttributes?: SignalExternalWorkflowExecutionDecisionAttributes; + requestCancelExternalWorkflowExecutionDecisionAttributes?: RequestCancelExternalWorkflowExecutionDecisionAttributes; + startChildWorkflowExecutionDecisionAttributes?: StartChildWorkflowExecutionDecisionAttributes; + } + + export interface ScheduleActivityTaskDecisionAttributes { + activityType?: ActivityType; + activityId?: string; + control?: string; + input?: string; + scheduleToCloseTimeout?: string; + taskList?: TaskList; + scheduleToStartTimeout?: string; + startToCloseTimeout?: string; + heartbeatTimeout?: string; + } + + export interface ActivityType { + name?: string; + version?: string; + } + + export interface RequestCancelActivityTaskDecisionAttributes { + activityId?: string; + } + + export interface CompleteWorkflowExecutionDecisionAttributes { + result?: string; + } + + export interface FailWorkflowExecutionDecisionAttributes { + reason?: string; + details?: string; + } + + export interface CancelWorkflowExecutionDecisionAttributes { + details?: string; + } + + export interface ContinueAsNewWorkflowExecutionDecisionAttributes { + input?: string; + executionStartToCloseTimeout?: string; + taskList?: TaskList; + taskStartToCloseTimeout?: string; + childPolicy?: string; + tagList?: string[]; + workflowTypeVersion?: string; + } + + export interface RecordMarkerDecisionAttributes { + markerName?: string; + details?: string; + } + + export interface StartTimerDecisionAttributes { + timerId?: string; + control?: string; + startToFireTimeout?: string; + } + + export interface CancelTimerDecisionAttributes { + timerId?: string; + } + + export interface SignalExternalWorkflowExecutionDecisionAttributes { + workflowId?: string; + runId?: string; + signalName?: string; + input?: string; + control?: string; + } + + export interface RequestCancelExternalWorkflowExecutionDecisionAttributes { + workflowId?: string; + runId?: string; + control?: string; + } + + export interface StartChildWorkflowExecutionDecisionAttributes { + workflowType?: WorkflowType; + workflowId?: string; + control?: string; + input?: string; + executionStartToCloseTimeout?: string; + taskList?: TaskList; + taskStartToCloseTimeout?: string; + childPolicy?: string; + tagList?: string[]; + } + + export interface RespondActivityTaskCompletedRequest { + taskToken?: string; + result?: string; + } + + export interface RespondActivityTaskFailedRequest { + taskToken?: string; + reason?: string; + details?: string; + } + + export interface RespondActivityTaskCanceledRequest { + taskToken?: string; + details?: string; + } + + export interface DecisionTask { + taskToken?: string; + startedEventId?: number; + workflowExecution?: WorkflowExecution; + workflowType?: WorkflowType; + events?: HistoryEvent[]; + nextPageToken?: string; + previousStartedEventId?: number; + } + + export interface WorkflowExecution { + workflowId?: string; + runId?: string; + } + + export interface HistoryEvent { + eventTimestamp?: any; + eventType?: string; + eventId?: number; + workflowExecutionStartedEventAttributes?: WorkflowExecutionStartedEventAttributes; + workflowExecutionCompletedEventAttributes?: WorkflowExecutionCompletedEventAttributes; + completeWorkflowExecutionFailedEventAttributes?: CompleteWorkflowExecutionFailedEventAttributes; + workflowExecutionFailedEventAttributes?: WorkflowExecutionFailedEventAttributes; + failWorkflowExecutionFailedEventAttributes?: FailWorkflowExecutionFailedEventAttributes; + workflowExecutionTimedOutEventAttributes?: WorkflowExecutionTimedOutEventAttributes; + workflowExecutionCanceledEventAttributes?: WorkflowExecutionCanceledEventAttributes; + cancelWorkflowExecutionFailedEventAttributes?: CancelWorkflowExecutionFailedEventAttributes; + workflowExecutionContinuedAsNewEventAttributes?: WorkflowExecutionContinuedAsNewEventAttributes; + continueAsNewWorkflowExecutionFailedEventAttributes?: ContinueAsNewWorkflowExecutionFailedEventAttributes; + workflowExecutionTerminatedEventAttributes?: WorkflowExecutionTerminatedEventAttributes; + workflowExecutionCancelRequestedEventAttributes?: WorkflowExecutionCancelRequestedEventAttributes; + decisionTaskScheduledEventAttributes?: DecisionTaskScheduledEventAttributes; + decisionTaskStartedEventAttributes?: DecisionTaskStartedEventAttributes; + decisionTaskCompletedEventAttributes?: DecisionTaskCompletedEventAttributes; + decisionTaskTimedOutEventAttributes?: DecisionTaskTimedOutEventAttributes; + activityTaskScheduledEventAttributes?: ActivityTaskScheduledEventAttributes; + activityTaskStartedEventAttributes?: ActivityTaskStartedEventAttributes; + activityTaskCompletedEventAttributes?: ActivityTaskCompletedEventAttributes; + activityTaskFailedEventAttributes?: ActivityTaskFailedEventAttributes; + activityTaskTimedOutEventAttributes?: ActivityTaskTimedOutEventAttributes; + activityTaskCanceledEventAttributes?: ActivityTaskCanceledEventAttributes; + activityTaskCancelRequestedEventAttributes?: ActivityTaskCancelRequestedEventAttributes; + workflowExecutionSignaledEventAttributes?: WorkflowExecutionSignaledEventAttributes; + markerRecordedEventAttributes?: MarkerRecordedEventAttributes; + timerStartedEventAttributes?: TimerStartedEventAttributes; + timerFiredEventAttributes?: TimerFiredEventAttributes; + timerCanceledEventAttributes?: TimerCanceledEventAttributes; + startChildWorkflowExecutionInitiatedEventAttributes?: StartChildWorkflowExecutionInitiatedEventAttributes; + childWorkflowExecutionStartedEventAttributes?: ChildWorkflowExecutionStartedEventAttributes; + childWorkflowExecutionCompletedEventAttributes?: ChildWorkflowExecutionCompletedEventAttributes; + childWorkflowExecutionFailedEventAttributes?: ChildWorkflowExecutionFailedEventAttributes; + childWorkflowExecutionTimedOutEventAttributes?: ChildWorkflowExecutionTimedOutEventAttributes; + childWorkflowExecutionCanceledEventAttributes?: ChildWorkflowExecutionCanceledEventAttributes; + childWorkflowExecutionTerminatedEventAttributes?: ChildWorkflowExecutionTerminatedEventAttributes; + signalExternalWorkflowExecutionInitiatedEventAttributes?: SignalExternalWorkflowExecutionInitiatedEventAttributes; + externalWorkflowExecutionSignaledEventAttributes?: ExternalWorkflowExecutionSignaledEventAttributes; + signalExternalWorkflowExecutionFailedEventAttributes?: SignalExternalWorkflowExecutionFailedEventAttributes; + externalWorkflowExecutionCancelRequestedEventAttributes?: ExternalWorkflowExecutionCancelRequestedEventAttributes; + requestCancelExternalWorkflowExecutionInitiatedEventAttributes?: RequestCancelExternalWorkflowExecutionInitiatedEventAttributes; + requestCancelExternalWorkflowExecutionFailedEventAttributes?: RequestCancelExternalWorkflowExecutionFailedEventAttributes; + scheduleActivityTaskFailedEventAttributes?: ScheduleActivityTaskFailedEventAttributes; + requestCancelActivityTaskFailedEventAttributes?: RequestCancelActivityTaskFailedEventAttributes; + startTimerFailedEventAttributes?: StartTimerFailedEventAttributes; + cancelTimerFailedEventAttributes?: CancelTimerFailedEventAttributes; + startChildWorkflowExecutionFailedEventAttributes?: StartChildWorkflowExecutionFailedEventAttributes; + } + + export interface WorkflowExecutionStartedEventAttributes { + input?: string; + executionStartToCloseTimeout?: string; + taskStartToCloseTimeout?: string; + childPolicy?: string; + taskList?: TaskList; + workflowType?: WorkflowType; + tagList?: string[]; + continuedExecutionRunId?: string; + parentWorkflowExecution?: WorkflowExecution; + parentInitiatedEventId?: number; + } + + export interface WorkflowExecutionCompletedEventAttributes { + result?: string; + decisionTaskCompletedEventId?: number; + } + + export interface CompleteWorkflowExecutionFailedEventAttributes { + cause?: string; + decisionTaskCompletedEventId?: number; + } + + export interface WorkflowExecutionFailedEventAttributes { + reason?: string; + details?: string; + decisionTaskCompletedEventId?: number; + } + + export interface FailWorkflowExecutionFailedEventAttributes { + cause?: string; + decisionTaskCompletedEventId?: number; + } + + export interface WorkflowExecutionTimedOutEventAttributes { + timeoutType?: string; + childPolicy?: string; + } + + export interface WorkflowExecutionCanceledEventAttributes { + details?: string; + decisionTaskCompletedEventId?: number; + } + + export interface CancelWorkflowExecutionFailedEventAttributes { + cause?: string; + decisionTaskCompletedEventId?: number; + } + + export interface WorkflowExecutionContinuedAsNewEventAttributes { + input?: string; + decisionTaskCompletedEventId?: number; + newExecutionRunId?: string; + executionStartToCloseTimeout?: string; + taskList?: TaskList; + taskStartToCloseTimeout?: string; + childPolicy?: string; + tagList?: string[]; + workflowType?: WorkflowType; + } + + export interface ContinueAsNewWorkflowExecutionFailedEventAttributes { + cause?: string; + decisionTaskCompletedEventId?: number; + } + + export interface WorkflowExecutionTerminatedEventAttributes { + reason?: string; + details?: string; + childPolicy?: string; + cause?: string; + } + + export interface WorkflowExecutionCancelRequestedEventAttributes { + externalWorkflowExecution?: WorkflowExecution; + externalInitiatedEventId?: number; + cause?: string; + } + + export interface DecisionTaskScheduledEventAttributes { + taskList?: TaskList; + startToCloseTimeout?: string; + } + + export interface DecisionTaskStartedEventAttributes { + identity?: string; + scheduledEventId?: number; + } + + export interface DecisionTaskCompletedEventAttributes { + executionContext?: string; + scheduledEventId?: number; + startedEventId?: number; + } + + export interface DecisionTaskTimedOutEventAttributes { + timeoutType?: string; + scheduledEventId?: number; + startedEventId?: number; + } + + export interface ActivityTaskScheduledEventAttributes { + activityType?: ActivityType; + activityId?: string; + input?: string; + control?: string; + scheduleToStartTimeout?: string; + scheduleToCloseTimeout?: string; + startToCloseTimeout?: string; + taskList?: TaskList; + decisionTaskCompletedEventId?: number; + heartbeatTimeout?: string; + } + + export interface ActivityTaskStartedEventAttributes { + identity?: string; + scheduledEventId?: number; + } + + export interface ActivityTaskCompletedEventAttributes { + result?: string; + scheduledEventId?: number; + startedEventId?: number; + } + + export interface ActivityTaskFailedEventAttributes { + reason?: string; + details?: string; + scheduledEventId?: number; + startedEventId?: number; + } + + export interface ActivityTaskTimedOutEventAttributes { + timeoutType?: string; + scheduledEventId?: number; + startedEventId?: number; + details?: string; + } + + export interface ActivityTaskCanceledEventAttributes { + details?: string; + scheduledEventId?: number; + startedEventId?: number; + latestCancelRequestedEventId?: number; + } + + export interface ActivityTaskCancelRequestedEventAttributes { + decisionTaskCompletedEventId?: number; + activityId?: string; + } + + export interface WorkflowExecutionSignaledEventAttributes { + signalName?: string; + input?: string; + externalWorkflowExecution?: WorkflowExecution; + externalInitiatedEventId?: number; + } + + export interface MarkerRecordedEventAttributes { + markerName?: string; + details?: string; + decisionTaskCompletedEventId?: number; + } + + export interface TimerStartedEventAttributes { + timerId?: string; + control?: string; + startToFireTimeout?: string; + decisionTaskCompletedEventId?: number; + } + + export interface TimerFiredEventAttributes { + timerId?: string; + startedEventId?: number; + } + + export interface TimerCanceledEventAttributes { + timerId?: string; + startedEventId?: number; + decisionTaskCompletedEventId?: number; + } + + export interface StartChildWorkflowExecutionInitiatedEventAttributes { + workflowId?: string; + workflowType?: WorkflowType; + control?: string; + input?: string; + executionStartToCloseTimeout?: string; + taskList?: TaskList; + decisionTaskCompletedEventId?: number; + childPolicy?: string; + taskStartToCloseTimeout?: string; + tagList?: string[]; + } + + export interface ChildWorkflowExecutionStartedEventAttributes { + workflowExecution?: WorkflowExecution; + workflowType?: WorkflowType; + initiatedEventId?: number; + } + + export interface ChildWorkflowExecutionCompletedEventAttributes { + workflowExecution?: WorkflowExecution; + workflowType?: WorkflowType; + result?: string; + initiatedEventId?: number; + startedEventId?: number; + } + + export interface ChildWorkflowExecutionFailedEventAttributes { + workflowExecution?: WorkflowExecution; + workflowType?: WorkflowType; + reason?: string; + details?: string; + initiatedEventId?: number; + startedEventId?: number; + } + + export interface ChildWorkflowExecutionTimedOutEventAttributes { + workflowExecution?: WorkflowExecution; + workflowType?: WorkflowType; + timeoutType?: string; + initiatedEventId?: number; + startedEventId?: number; + } + + export interface ChildWorkflowExecutionCanceledEventAttributes { + workflowExecution?: WorkflowExecution; + workflowType?: WorkflowType; + details?: string; + initiatedEventId?: number; + startedEventId?: number; + } + + export interface ChildWorkflowExecutionTerminatedEventAttributes { + workflowExecution?: WorkflowExecution; + workflowType?: WorkflowType; + initiatedEventId?: number; + startedEventId?: number; + } + + export interface SignalExternalWorkflowExecutionInitiatedEventAttributes { + workflowId?: string; + runId?: string; + signalName?: string; + input?: string; + decisionTaskCompletedEventId?: number; + control?: string; + } + + export interface ExternalWorkflowExecutionSignaledEventAttributes { + workflowExecution?: WorkflowExecution; + initiatedEventId?: number; + } + + export interface SignalExternalWorkflowExecutionFailedEventAttributes { + workflowId?: string; + runId?: string; + cause?: string; + initiatedEventId?: number; + decisionTaskCompletedEventId?: number; + control?: string; + } + + export interface ExternalWorkflowExecutionCancelRequestedEventAttributes { + workflowExecution?: WorkflowExecution; + initiatedEventId?: number; + } + + export interface RequestCancelExternalWorkflowExecutionInitiatedEventAttributes { + workflowId?: string; + runId?: string; + decisionTaskCompletedEventId?: number; + control?: string; + } + + export interface RequestCancelExternalWorkflowExecutionFailedEventAttributes { + workflowId?: string; + runId?: string; + cause?: string; + initiatedEventId?: number; + decisionTaskCompletedEventId?: number; + control?: string; + } + + export interface ScheduleActivityTaskFailedEventAttributes { + activityType?: ActivityType; + activityId?: string; + cause?: string; + decisionTaskCompletedEventId?: number; + } + + export interface RequestCancelActivityTaskFailedEventAttributes { + activityId?: string; + cause?: string; + decisionTaskCompletedEventId?: number; + } + + export interface StartTimerFailedEventAttributes { + timerId?: string; + cause?: string; + decisionTaskCompletedEventId?: number; + } + + export interface CancelTimerFailedEventAttributes { + timerId?: string; + cause?: string; + decisionTaskCompletedEventId?: number; + } + + export interface StartChildWorkflowExecutionFailedEventAttributes { + workflowType?: WorkflowType; + cause?: string; + workflowId?: string; + initiatedEventId?: number; + decisionTaskCompletedEventId?: number; + control?: string; + } + + export interface ActivityTask { + taskToken?: string; + activityId?: string; + startedEventId?: number; + workflowExecution?: WorkflowExecution; + activityType?: ActivityType; + input?: string; + } + + export interface PollForActivityTaskResult { + activityTask?: ActivityTask; + } + + export interface PollForDecisionTaskResult { + decisionTask?: DecisionTask; + } + + export interface StartWorkflowExecutionResult { + run?: Run; + } + + export interface Run { + runId?: string; + } + + } + + export module Sns { + + export interface Client { + config: ClientConfig; + + publish(params: PublishRequest, callback: (err: any, data: PublishResult) => void): void; + createTopic(params: CreateTopicRequest, callback: (err: any, data: CreateTopicResult) => void): void; + deleteTopic(params: DeleteTopicRequest, callback: (err: any, data: any) => void): void; + } + + export interface PublishRequest { + TopicArn?: string; + TargetArn?: string; + MessageAttributes?: { [name: string]: MessageAttribute; }; + Message?: string; + MessageStructure?: string; + Subject?: string; + } + + export interface MessageAttribute { + DataType: string; + StringValue?: string; + BinaryValue: any; // (Buffer, Typed Array, Blob, String) + } + + export interface PublishResult { + MessageId?: string; + } + + export interface CreateTopicRequest { + Name?: string; + } + + export interface CreateTopicResult { + TopicArn?: string; + } + + export interface DeleteTopicRequest { + TopicArn?: string; + } + + } + + export module s3 { + interface Owner { + DisplayName: string; + ID: string; + } + + interface ObjectKeyPrefix { + Prefix: string; + } + + export interface ListObjectContent { + Key: string; + LastModified: Date; + ETag: string; + Size: number; + StorageClass: "STANDARD" | "REDUCED_REDUNDANCY" | "GLACIER"; + Owner?: Owner + } + + // This private interface contains the common parts between v1 and v2 of the API Request and is exposed via V1 and V2 subclasses + interface ListObjectRequestBase { + Bucket: string; + Delimiter?: string; + EncodingType?: 'url'; + MaxKeys?: number; + Prefix?: string; + } + + // This private interface contains the common parts between v1 and v2 of the API Response and is exposed via V1 and V2 subclasses + interface ListObjectResponseBase { + IsTruncated: boolean; + Contents: ListObjectContent[]; + Name: string; + Prefix?: string; + Delimiter?: string; + MaxKeys: number; + CommonPrefixes?: ObjectKeyPrefix[]; + EncodingType?: "url"; + } + + export interface PutObjectRequest { + ACL?: string; + Body?: any; + Bucket: string; + CacheControl?: string; + ContentDisposition?: string; + ContentEncoding?: string; + ContentLanguage?: string; + ContentLength?: string; + ContentMD5?: string; + ContentType?: string; + Expires?: any; + GrantFullControl?: string; + GrantRead?: string; + GrantReadACP?: string; + GrantWriteACP?: string; + Key: string; + Metadata?: { [key: string]: string; }; + ServerSideEncryption?: string; + StorageClass?: string; + WebsiteRedirectLocation?: string; + } + + export interface GetObjectRequest { + Bucket: string; + IfMatch?: string; + IfModifiedSince?: any; + IfNoneMatch?: string; + IfUnmodifiedSince?: any; + Key: string; + Range?: string; + ResponseCacheControl?: string; + ResponseContentDisposition?: string; + ResponseContentEncoding?: string; + ResponseContentLanguage?: string; + ResponseContentType?: string; + ResponseExpires?: any; + VersionId?: string; + } + + export interface DeleteObjectRequest { + Bucket: string; + Key: string; + MFA?: string; + RequestPayer?: string; + VersionId?: string; + } + + export interface HeadObjectRequest { + Bucket: string; + Key: string; + IfMatch?: string; + IfModifiedSince?: Date; + IfNoneMatch?: string; + IfUnmodifiedSince?: Date; + Range?: string; + RequestPayer?: string; + SSECustomerAlgorithm?: string; + SSECustomerKey?: Buffer | string; + SSECustomerKeyMD5?: string; + VersionId?: string; + } + + export interface UploadOptions { + partSize?: number; + queueSize?: number; + } + + export interface ListObjectRequest extends ListObjectRequestBase { + Marker?: string; + } + + export interface ListObjectV2Request extends ListObjectRequestBase { + ContinuationToken?: string; + FetchOwner?: boolean; + StartAfter?: string; + } + + export interface ListObjectResponse extends ListObjectResponseBase { + Marker?: string; + NextMarker?: string; + } + + export interface ListObjectV2Response extends ListObjectResponseBase { + KeyCount: number; + ContinuationToken?: string; + NextContinuationToken?: string; + StartAfter?: string; + } + } + + export module ecs { + export interface CreateServicesParams { + desiredCount: number; + serviceName: string; + taskDefinition: string; + clientToken?: string; + cluster?: string; + deploymentConfiguration?: { + maximumPercent?: number; + minimumHealthyPercent?: number; + }; + loadBalancers?: { + containerName?: string; + containerPort?: number; + loadBalancerName?: string; + }[]; + role?: string; + } + + export interface DescribeServicesParams { + /** + * A list of services to describe. + */ + services: string[]; + /** + * The name of the cluster that hosts the service to describe. If you do not specify a cluster, the default cluster is assumed. + */ + cluster?: string; + } + + export interface DescribeClustersParams { + /** + * A space-separated list of cluster names or full cluster Amazon Resource Name (ARN) entries. If you do not specify a cluster, the default cluster is assumed. + */ + clusters?: string[]; + } + + export interface DescribeTasksParams { + /** + * A space-separated list of task IDs or full Amazon Resource Name (ARN) entries. + */ + tasks: string[]; + /** + * The short name or full Amazon Resource Name (ARN) of the cluster that hosts the task to describe. If you do not specify a cluster, the default cluster is assumed. + */ + cluster?: string; + } + + export interface DescribeTaskDefinitionParams { + /** + * The `family` for the latest `ACTIVE` revision, `family` and `revision` (`family:revision`) for a specific revision in the family, or full Amazon Resource Name (ARN) of the task definition to describe. + */ + taskDefinition: string; + } + + export interface RegisterTaskDefinitionParams { + containerDefinitions: { + command?: string[], + cpu?: number, + disableNetworking?: boolean, + dnsSearchDomains?: string[], + dnsServers?: string[], + dockerLabels?: any, + dockerSecurityOptions?: string[], + entryPoint?: string[], + environment?: any[], + essential?: boolean, + extraHosts?: { + hostName: string, + ipAddress: string + }[]; + hostname?: string, + image?: string, + links?: string[], + logConfiguration?: { + logDriver: string, + options: any + }[], + memory?: number, + mountPoints?: { + containerPath: string, + readOnly: boolean, + sourceVolume: string + }[]; + name?: string, + portMappings?: { + containerPort?: number, + hostPort?: number, + protocol: string + }[]; + privileged?: boolean, + readonlyRootFilesystem?: boolean, + ulimits?: { + hardLimit: number, + name: string, + softLimit: number + }[]; + user?: string, + volumesFrom?: { + readOnly?: boolean, + sourceContainer?: string + }[], + workingDirectory?: string + }[]; + family: string; + volumes?: { + host: { + sourcePath: string + }, + name: string + }[]; + } + + export interface UpdateServiceParams { + service: string; + cluster?: string; + deploymentConfiguration?: { + maximumPercent: number; + minimumHealthyPercent: number; + }; + desiredCount?: number; + taskDefinition: string; + } + } + + export module sts { + export interface AssumeRoleParams { + RoleArn: string; + RoleSessionName: string; + DurationSeconds?: number; + ExternalId?: string; + Policy?: string; + SerialNumber?: string; + TokenCode?: string; + } + + export interface AssumeRoleCallbackData { + Credentials: TemporaryCredentials; + AssumedRoleUser: AssumedRoleUser; + PackedPolicySize: number; + } + + export interface TemporaryCredentials { + AccessKeyId: string; + SecretAccessKey: string; + SessionToken: string; + Expiration: Date; + } + + export interface AssumedRoleUser { + AssumedRoleId: string; + Arn: string; + } + + export interface AssumeRoleWithSAMLParams { + PrincipalArn: string; + RoleArn: string; + SAMLAssertion: string; + DurationSeconds?: number; + Policy?: string; + } + + export interface AssumeRoleWithWebIdentityParams { + RoleArn: string; + RoleSessionName: string; + WebIdentityToken: string; + DurationSeconds?: number; + Policy?: string; + ProviderId?: string; + } + + export interface CredentialsFromParams { + /** + * Data retrieved from a call to AWS.STS.getFederatedToken, getSessionToken(), assumeRole(), or assumeRoleWithWebIdentity(). + */ + Data: any; + /** + * An optional credentials object to fill instead of creating a new object. Useful when modifying an existing credentials object from a refresh call. + */ + Credentials?: Credentials + } + + export interface DecodeAuthorizationMessageParams { + EncodedMessage: string; + } + + export interface GetFederationTokenParams { + Name: string; + DurationSeconds?: number, + Policy?: string + } + + export interface GetSessionTokenParams { + DurationSeconds: number, + SerialNumber: string; + TokenCode: string; + } + } } diff --git a/axios/axios-tests.ts b/axios/axios-tests.ts index 040994531b..50e2388624 100644 --- a/axios/axios-tests.ts +++ b/axios/axios-tests.ts @@ -91,3 +91,9 @@ var repoSum = (repo1: Axios.AxiosXHR, repo2: Axios.AxiosXHR([getRepoDetails, getRepoDetails]).then(axios.spread(repoSum)); + +axios.defaults.baseURL = 'https://api.example.com'; +axios.defaults.headers.common['Authorization'] = "AUTH_TOKEN"; +axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'; + +axiosInstance.defaults.headers.common['Authorization'] = "AUTH_TOKEN"; \ No newline at end of file diff --git a/axios/axios.d.ts b/axios/axios.d.ts index 44083f7960..9c4705d093 100644 --- a/axios/axios.d.ts +++ b/axios/axios.d.ts @@ -124,6 +124,18 @@ declare namespace Axios { data?: T; } + interface AxiosXHRConfigDefaults extends AxiosXHRConfigBase { + /** + * custom headers to be sent + */ + headers: { + common: {[index: string]: string}; + patch: {[index: string]: string}; + post: {[index: string]: string}; + put: {[index: string]: string}; + }; + } + /** * - expected response type, * - request body data type @@ -223,6 +235,11 @@ declare namespace Axios { */ interceptors: Interceptor; + /** + * Config defaults + */ + defaults: AxiosXHRConfigDefaults; + /** * equivalent to `Promise.all` */ diff --git a/azure-mobile-services-client/AzureMobileServicesClient.d.ts b/azure-mobile-services-client/AzureMobileServicesClient.d.ts index b9749002c9..afd6014598 100644 --- a/azure-mobile-services-client/AzureMobileServicesClient.d.ts +++ b/azure-mobile-services-client/AzureMobileServicesClient.d.ts @@ -7,10 +7,11 @@ declare namespace Microsoft.WindowsAzure { // MobileServiceClient object based on Microsoft Azure documentation: http://msdn.microsoft.com/en-us/library/windowsazure/jj554219.aspx interface MobileServiceClient { - new (applicationUrl: string, applicationKey: string): MobileServiceClient; + new (applicationUrl: string, applicationKey?: string): MobileServiceClient; applicationUrl: string; applicationKey: string; currentUser: User; + push: Push; //for provider:string use one of ProviderEnum: 'microsoftaccount', 'facebook', 'twitter', 'google' login(provider: string, token: string, callback: (error: any, user: User) => void ): void; login(provider: string, token: string): asyncPromise; @@ -18,8 +19,40 @@ declare namespace Microsoft.WindowsAzure { login(provider: string): asyncPromise; logout(): void; getTable(tableName: string): MobileServiceTable; - withFilter(serviceFilter: (request: any, next: (request: any, callback: (error:any, response: any) => void ) => void, callback: (error: any, response: any) => void ) => void ) : MobileServiceClient; - invokeApi(apiName: string, options?:InvokeApiOptions): asyncPromise; + withFilter(serviceFilter: (request: any, next: (request: any, callback: (error: any, response: any) => void) => void, callback: (error: any, response: any) => void) => void): MobileServiceClient; + /** + * Invokes the specified custom api and returns a response object. + * + * @param apiName The custom api to invoke. + * @param options Contains additional parameter information, valid values are: + * body: The body of the HTTP request. + * method: The HTTP method to use in the request, with the default being POST, + * parameters: Any additional query string parameters, + * headers: HTTP request headers, specified as an object. + * @param callback Optional callback accepting (error, results) parameters. + */ + invokeApi(apiName: string, options?: InvokeApiOptions, callback?: (error: any, results: any) => void): asyncPromise; + } + + interface Push + { + /** + * Register a push channel with the Mobile Apps backend to start receiving notifications. + * + * @param platform The device platform being used - wns, gcm or apns. + * @param pushChannel The push channel identifier or URI. + * @param templates An object containing template definitions. Template objects should contain body, headers and tags properties. + * @param secondaryTiles An object containing template definitions to be used with secondary tiles when using WNS. + * @param callback Optional callback accepting (error, results) parameters. + */ + register(platform: string, pushChannel: string, templates?: any, secondaryTiles?: any, callback?: (error: any, results: any) => void): void; + /** + * Invokes the specified custom api and returns a response object. + * + * @param pushChannel The push channel identifier or URI. + * @param callback Optional callback accepting (error, results) parameters. + */ + unregister(pushChannel: string, callback?: (error: any, results: any) => void): void; } interface InvokeApiOptions @@ -36,6 +69,7 @@ declare namespace Microsoft.WindowsAzure { accessTokens: any; // { [providerName: string]: string; } level: string; //for level:string use one of LevelEnum: 'admin','anonymous','authenticated' userId: string; + mobileServiceAuthenticationToken: string; } diff --git a/babelify/babelify-tests.ts b/babelify/babelify-tests.ts new file mode 100644 index 0000000000..6ace8462a9 --- /dev/null +++ b/babelify/babelify-tests.ts @@ -0,0 +1,23 @@ +/// + +import babelify = require("babelify"); + +module BabelifyTest { + + export function whatDidTheEs6Say(srcPath: string, opts?: babelify.BabelifyOptions) { + opts.extensions = opts.extensions || undefined; + opts.sourceMapsAbsolute = opts.sourceMapsAbsolute || false; + var dst: NodeJS.ReadWriteStream; + + babelify(""); // 'opts' are optional + + babelify(srcPath, opts).on("error", function (err: any) { + console.error("babelify error: ", err); + }); + + babelify.configure(opts)(srcPath).pipe(dst); + } + +} + +export = BabelifyTest; \ No newline at end of file diff --git a/babelify/babelify.d.ts b/babelify/babelify.d.ts new file mode 100644 index 0000000000..2637814a64 --- /dev/null +++ b/babelify/babelify.d.ts @@ -0,0 +1,46 @@ +// Type definitions for babelify v7.3.0 +// Project: https://github.com/babel/babelify +// Definitions by: TeamworkGuy2 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// + +/** Browserify transform for Babel + */ +declare module 'babelify' { + import stream = require("stream"); + import babel = require("babel-core"); + + + function Babelify(filename: string, opts?: Babelify.BabelifyOptions): Babelify.BabelifyObject; + + module Babelify { + + export interface BabelifyConstructor { + (filename: string, opts: Babelify.BabelifyOptions): Babelify.BabelifyObject; + } + + /** In addition to the various purposes documented here, all of the babelify options are passed to babel which passes them on to babel.transform() when each file is transformed */ + export interface BabelifyOptions extends babel.TransformOptions { + /** These are passed to babel.util.canCompile() for each filename + * default: null + */ + extensions?: string | string[]; + + /** if true, a 'sourceFileName' property with a value equal to the current file being transformed is included with the options passed to babel.transform() + * default: false + */ + sourceMapsAbsolute?: boolean; + } + + export class BabelifyObject extends stream.Transform { + _transform(buf: string | Buffer, encoding: string, callback: () => void): void; + _flush(callback: () => void): void; + } + + export function configure(opts: Babelify.BabelifyOptions): (filename: string) => Babelify.BabelifyObject; + } + + export = Babelify; +} diff --git a/backbone-fetch-cache/backbone-fetch-cache-tests.ts b/backbone-fetch-cache/backbone-fetch-cache-tests.ts new file mode 100644 index 0000000000..e2eb532690 --- /dev/null +++ b/backbone-fetch-cache/backbone-fetch-cache-tests.ts @@ -0,0 +1,81 @@ +/// + +import * as Backbone from "backbone-fetch-cache"; + +// static methods / properties + +const fc: BackboneFetchCache.Static = Backbone.fetchCache; + +fc.enabled = true; +fc.localStorage = true; + +const opts: BackboneFetchCache.GetCacheOptions = {url: "string url", data: {}}; +const strKey: string = "string key"; +const getCacheKeyOpts = {getCacheKey: () => "string key"}; + +let cache: BackboneFetchCache.Cache +cache = fc.getCache(strKey); +cache = fc.getCache(() => strKey); +cache = fc.getCache(getCacheKeyOpts); +cache = fc.getCache({url: strKey}); +cache = fc.getCache({url: () => strKey}); +cache = fc.getCache(strKey, opts); + +const cacheExpires: number = cache.expires; +const cacheLastSync: number = cache.lastSync; +const cachePrefillExpires: number = cache.prefillExpires; +const cacheValue: any = cache.value; + +let key: string; +key = fc.getCacheKey(strKey); +key = fc.getCacheKey(strKey, opts); +key = fc.getCacheKey(getCacheKeyOpts); + +let lastSync: number; +lastSync = fc.getLastSync(strKey, opts); +lastSync = fc.getLastSync(getCacheKeyOpts, opts); + +fc.getLocalStorage(); +const localStorageKey: string = fc.getLocalStorageKey(); + +fc.priorityFn = (a: BackboneFetchCache.Cache, b: BackboneFetchCache.Cache) => 12345; + +fc.reset(); + +const setOpts: BackboneFetchCache.SetCacheOptions = { + data: {}, + url: strKey, + cache: true, + expires: 12345, + prefill: true, + prefillExpires: 12345, +}; +fc.setCache(strKey, setOpts, {}); + +fc.setLocalStorage(); + +// instance methods + +const modelOpts: Backbone.ModelFetchWithCacheOptions = { + cache: true, + expires: new Date().getTime(), + prefill: true, + prefillExpires: new Date().getTime(), + prefillSuccess: (self: any, attributes: any, opts: Backbone.ModelFetchWithCacheOptions) => { }, + context: {}, +}; + +const hoge = new Backbone.Model; +hoge.fetch(modelOpts); + +const collectionOpts: Backbone.CollectionFetchWithCacheOptions = { + cache: true, + context: {}, + expires: new Date().getTime(), + prefill: true, + prefillExpires: new Date().getTime(), + prefillSuccess: (self: any) => { }, +}; + +const fuga = new Backbone.Collection; +fuga.fetch(collectionOpts); diff --git a/backbone-fetch-cache/backbone-fetch-cache.d.ts b/backbone-fetch-cache/backbone-fetch-cache.d.ts new file mode 100644 index 0000000000..449db1c667 --- /dev/null +++ b/backbone-fetch-cache/backbone-fetch-cache.d.ts @@ -0,0 +1,189 @@ +// Type definitions for backbone-fetch-cache 1.4.0 +// Project: https://github.com/madglory/backbone-fetch-cache +// Definitions by: delphinus +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare namespace BackboneFetchCache { + + interface SuperMethods { + + modelFetch(options?: Backbone.ModelFetchOptions): JQueryXHR; + modelSync(...arg: any[]): JQueryXHR; + collectionFetch(options?: Backbone.CollectionFetchOptions): JQueryXHR; + } + + interface GetCacheOptions { + + data?: any; + url?: string; + } + + interface SetCacheOptions extends GetCacheOptions { + + cache: boolean; + expires: boolean | number; + prefill: boolean; + prefillExpires: boolean | number; + } + + interface Cache { + + expires: number; + lastSync: number; + prefillExpires: number; + value: any; + } + + interface GetCacheKeyObject { + + getCacheKey?: (opts?: GetCacheOptions) => string; + url?: () => string; + } + + type GetCacheKeyOptions = string | {url: string} | GetCacheKeyObject; + + interface Static { + + /** + * Global flag to enable/disable caching + */ + enabled: boolean; + + /** + * By default the cache is persisted in localStorage (if available). + * Set Backbone.fetchCache.localStorage = false to disable this. + */ + localStorage: boolean; + + /** + * Sometimes you just need to clear a cached item manually. + * Backbone.fetchCache.clearItem() can be called safely from anywhere + * in your application. It will take your backbone Model or Collection, + * a function that returns the key String, or the key String itself. If + * you pass in a Model or Collection, the .getCacheKey() method will be + * checked before the url property. + */ + clearItem(...args: any[]): any; + + /** + * You can explicitly fetch a cached item, without having to call the + * models/collection fetch. This might be useful for debugging and + * testing. + */ + getCache(key: () => string, opts?: GetCacheOptions): Cache; + getCache(key: GetCacheKeyOptions, opts?: GetCacheOptions): Cache; + + getCacheKey(key: () => string, opts?: GetCacheOptions): string; + getCacheKey(key: GetCacheKeyOptions, opts?: GetCacheOptions): string; + + /** + * If you want to know when was the last (server) sync of a given key, you can use. + */ + getLastSync(key: () => string, opts?: GetCacheOptions): number; + getLastSync(key: GetCacheKeyOptions, opts?: GetCacheOptions): number; + + getLocalStorage(): void; + getLocalStorageKey(): string; + + /** + * When setting items in localStorage, the browser may throw a + * QUOTA_EXCEEDED_ERR, meaning the store is full. Backbone.fetchCache + * tries to work around this problem by deleting what it considers the + * most stale item to make space for the new data. The staleness of + * data is determined by the sorting function priorityFn, which by + * default returns the oldest item. + */ + priorityFn(a: Cache, b: Cache): number; + + reset(): void; + + setCache(instance: () => string, opts?: SetCacheOptions, attrs?: any): void; + setCache(instance: GetCacheKeyOptions, opts?: SetCacheOptions, attrs?: any): void; + + setLocalStorage(...args: any[]): any; + + _superMethods: SuperMethods; + } +} + +declare module Backbone { + + var fetchCache: BackboneFetchCache.Static; + + /** + * The most used API hook for Backbone Fetch Cache is the Model and + * Collection #.fetch() method. Here are the options you can pass into that + * method to get behaviour particular to Backbone Fetch Cache. + */ + interface ModelFetchWithCacheOptions extends ModelFetchOptions { + + /** + * Calls to modelInstance.fetch or collectionInstance.fetch will be + * fulfilled from the cache (if possible) when cache: true is set in + * the options hash. + */ + cache?: boolean; + + context?: any; + + /** + * Cache values expire after 5 minutes by default. You can adjust this + * by passing expires: to the fetch call. Set to false to + * never expire. + */ + expires?: number; + + /** + * This option allows the model/collection to be populated from the + * cache immediately and then be updated once the call to fetch has + * completed. The initial cache hit calls the prefillSuccess callback + * and then the AJAX success/error callbacks are called as normal when + * the request is complete. This allows the page to render something + * immediately and then update it after the request completes. (Note: + * the prefillSuccess callback will not fire if the data is not found + * in the cache.) + * + * prefill and prefillExpires options can be used with the promises + * interface like so (note: the progress event will not fire if the + * data is not found in the cache.). + * + * prefillExpires affects prefill in the following ways: + * + * 1. If the cache doesn't hold the requested data, just fetch it + * (usual behaviour) + * 2. If the cache holds an expired version of the requested data, just + * fetch it (usual behaviour) + * 3. If the cache holds requested data that is neither expired nor + * prefill expired, just return it and don't do a fetch / prefill + * callback (usual cache behavior, unusual prefill behaviour) + * 4. If the cache holds requested data that isn't expired but is + * prefill expired, use the prefill callback and do a fetch (usual + * prefill behaviour) + */ + prefill?: boolean; + prefillExpires?: number; + prefillSuccess?: (self: any, attributes: any, opts: ModelFetchWithCacheOptions) => void; + } + + interface CollectionFetchWithCacheOptions extends ModelFetchWithCacheOptions { + + prefillSuccess?: (self: any) => void; + } + + interface ModelWithCache extends Model { + + fetch(options?: ModelFetchWithCacheOptions): JQueryXHR; + } + + interface CollectionWithCache extends Collection { + + fetch(options?: CollectionFetchWithCacheOptions): JQueryXHR; + } +} + +declare module "backbone-fetch-cache" { + + export = Backbone; +} diff --git a/backbone.radio/backbone.radio-tests.ts b/backbone.radio/backbone.radio-tests.ts index 295c552af2..764fb65943 100644 --- a/backbone.radio/backbone.radio-tests.ts +++ b/backbone.radio/backbone.radio-tests.ts @@ -101,4 +101,10 @@ function TestGlobalApiAndChannels() { Backbone.Radio.reply('auth', 'authenticate', onStart); Backbone.Radio.request('auth', 'authenticate', 'pelle', 42); -} \ No newline at end of file +} + +import Radio = require('backbone.radio'); +function TestImport() { + var channel: Backbone.Radio.Channel = Radio.channel('channel-name'); + channel.command('show:view'); +} diff --git a/backbone.radio/backbone.radio.d.ts b/backbone.radio/backbone.radio.d.ts index 50895b0275..dd049ec1fe 100644 --- a/backbone.radio/backbone.radio.d.ts +++ b/backbone.radio/backbone.radio.d.ts @@ -90,3 +90,9 @@ declare namespace Backbone { } } } + +declare module 'backbone.radio' { + import Backbone = require('backbone'); + + export = Backbone.Radio; +} diff --git a/backbone/backbone-global.d.ts b/backbone/backbone-global.d.ts index b42b6208ad..3dca269eb0 100644 --- a/backbone/backbone-global.d.ts +++ b/backbone/backbone-global.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Backbone 1.0.0 +// Type definitions for Backbone 1.3.3 // Project: http://backbonejs.org/ // Definitions by: Boris Yankov , Natan Vivo // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -9,6 +9,7 @@ declare namespace Backbone { interface AddOptions extends Silenceable { at?: number; + merge?: boolean; } interface HistoryOptions extends Silenceable { @@ -108,9 +109,15 @@ declare namespace Backbone { attributes: any; changed: any[]; + cidPrefix: string; cid: string; collection: Collection; + private _changing: boolean; + private _previousAttributes : any; + private _pending: boolean; + + /** * Default attributes for the model. It can be an object hash or a method returning an object hash. * For assigning an object hash, do it like this: this.defaults = { attribute: value, ... }; @@ -146,8 +153,14 @@ declare namespace Backbone { /*private*/ set(attributeName: string, value: any, options?: ModelSetOptions): Model; set(obj: any, options?: ModelSetOptions): Model; - change(): any; - changedAttributes(attributes?: any): any[]; + /** + * Return an object containing all the attributes that have changed, or + * false if there are no changed attributes. Useful for determining what + * parts of a view need to be updated and/or what attributes need to be + * persisted to the server. Unset attributes will be set to undefined. + * You can also pass an attributes object to diff against the model, + * determining if there *would be* a change. */ + changedAttributes(attributes?: any): any; clear(options?: Silenceable): any; clone(): Model; destroy(options?: ModelDestroyOptions): any; @@ -172,8 +185,13 @@ declare namespace Backbone { invert(): any; pick(keys: string[]): any; pick(...keys: string[]): any; + pick(fn: (value: any, key: any, object: any) => any): any; omit(keys: string[]): any; omit(...keys: string[]): any; + omit(fn: (value: any, key: any, object: any) => any): any; + chain(): any; + isEmpty(): boolean; + matches(attrs: any): boolean; } class Collection extends ModelBase { @@ -204,12 +222,13 @@ declare namespace Backbone { * Get a model from a collection, specified by an id, a cid, or by passing in a model. **/ get(id: number|string|Model): TModel; + has(key: number|string|Model): boolean; create(attributes: any, options?: ModelSaveOptions): TModel; pluck(attribute: string): any[]; push(model: TModel, options?: AddOptions): TModel; pop(options?: Silenceable): TModel; - remove(model: TModel, options?: Silenceable): TModel; - remove(models: TModel[], options?: Silenceable): TModel[]; + remove(model: {}|TModel, options?: Silenceable): TModel; + remove(models: ({}|TModel)[], options?: Silenceable): TModel[]; reset(models?: TModel[], options?: Silenceable): TModel[]; set(models?: TModel[], options?: Silenceable): TModel[]; shift(options?: Silenceable): TModel; @@ -217,63 +236,79 @@ declare namespace Backbone { unshift(model: TModel, options?: AddOptions): TModel; where(properties: any): TModel[]; findWhere(properties: any): TModel; + modelId(attrs: any) : any private _prepareModel(attributes?: any, options?: any): any; private _removeReference(model: TModel): void; private _onModelEvent(event: string, model: TModel, collection: Collection, options: any): void; + private _isModel(obj: any) : obj is Model; + + /** + * Return a shallow copy of this collection's models, using the same options as native Array#slice. + */ + slice(min: number, max?: number): TModel[]; // mixins from underscore - all(iterator: (element: TModel, index: number) => boolean, context?: any): boolean; - any(iterator: (element: TModel, index: number) => boolean, context?: any): boolean; - collect(iterator: (element: TModel, index: number, context?: any) => any[], context?: any): any[]; + all(iterator?: _.ListIterator, context?: any): boolean; + any(iterator?: _.ListIterator, context?: any): boolean; chain(): any; - contains(value: any): boolean; - countBy(iterator: (element: TModel, index: number) => any): _.Dictionary; - countBy(attribute: string): _.Dictionary; - detect(iterator: (item: any) => boolean, context?: any): any; // ??? - drop(): TModel; - drop(n: number): TModel[]; - each(iterator: (element: TModel, index: number, list?: any) => void, context?: any): any; - every(iterator: (element: TModel, index: number) => boolean, context?: any): boolean; - filter(iterator: (element: TModel, index: number) => boolean, context?: any): TModel[]; - find(iterator: (element: TModel, index: number) => boolean, context?: any): TModel; + collect(iterator: _.ListIterator, context?: any): TResult[]; + contains(value: TModel): boolean; + countBy(iterator?: _.ListIterator): _.Dictionary; + countBy(iterator: string): _.Dictionary; + detect(iterator: _.ListIterator, context?: any): TModel; + difference(others: TModel[]): TModel[]; + drop(n?: number): TModel[]; + each(iterator: _.ListIterator, context?: any): TModel[]; + every(iterator: _.ListIterator, context?: any): boolean; + filter(iterator: _.ListIterator, context?: any): TModel[]; + find(iterator: _.ListIterator, context?: any): TModel; + findIndex(predicate: _.ListIterator, context?: any): number; + findLastIndex(predicate: _.ListIterator, context?: any): number; first(): TModel; first(n: number): TModel[]; - foldl(iterator: (memo: any, element: TModel, index: number) => any, initialMemo: any, context?: any): any; - forEach(iterator: (element: TModel, index: number, list?: any) => void, context?: any): any; - groupBy(iterator: (element: TModel, index: number) => string, context?: any): _.Dictionary; - groupBy(attribute: string, context?: any): _.Dictionary; - include(value: any): boolean; - indexOf(element: TModel, isSorted?: boolean): number; + foldl(iterator: _.MemoIterator, memo?: TResult, context?: any): TResult; + foldr(iterator: _.MemoIterator, memo?: TResult, context?: any): TResult; + forEach(iterator: _.ListIterator, context?: any): TModel[]; + groupBy(iterator: _.ListIterator, context?: any): _.Dictionary; + groupBy(iterator: string, context?: any): _.Dictionary; + head(): TModel; + head(n: number): TModel[]; + include(value: TModel): boolean; + includes(value: TModel): boolean; + indexBy(iterator: _.ListIterator, context?: any): _.Dictionary; + indexBy(iterator: string, context?: any): _.Dictionary; + indexOf(value: TModel, isSorted?: boolean): number; initial(): TModel; initial(n: number): TModel[]; - inject(iterator: (memo: any, element: TModel, index: number) => any, initialMemo: any, context?: any): any; - isEmpty(object: any): boolean; - invoke(methodName: string, args?: any[]): any; + inject(iterator: _.MemoIterator, memo?: TResult, context?: any): TResult; + invoke(methodName: string, ...args: any[]): any; + isEmpty(): boolean; last(): TModel; last(n: number): TModel[]; - lastIndexOf(element: TModel, fromIndex?: number): number; - map(iterator: (element: TModel, index: number, context?: any) => any, context?: any): any[]; - max(iterator?: (element: TModel, index: number) => any, context?: any): TModel; - min(iterator?: (element: TModel, index: number) => any, context?: any): TModel; - reduce(iterator: (memo: any, element: TModel, index: number) => any, initialMemo: any, context?: any): any; - select(iterator: any, context?: any): any[]; + lastIndexOf(value: TModel, from?: number): number; + map(iterator: _.ListIterator, context?: any): TResult[]; + max(iterator?: _.ListIterator, context?: any): TModel; + min(iterator?: _.ListIterator, context?: any): TModel; + partition(iterator: _.ListIterator): TModel[][]; + reduce(iterator: _.MemoIterator, memo?: TResult, context?: any): TResult; + reduceRight(iterator: _.MemoIterator, memo?: TResult, context?: any): TResult; + reject(iterator: _.ListIterator, context?: any): TModel[]; + rest(n?: number): TModel[]; + sample(): TModel; + sample(n: number): TModel[]; + select(iterator: _.ListIterator, context?: any): TModel[]; + shuffle(): TModel[]; size(): number; - shuffle(): any[]; - slice(min: number, max?: number): TModel[]; - some(iterator: (element: TModel, index: number) => boolean, context?: any): boolean; - sortBy(iterator: (element: TModel, index: number) => number, context?: any): TModel[]; - sortBy(attribute: string, context?: any): TModel[]; - sortedIndex(element: TModel, iterator?: (element: TModel, index: number) => number): number; - reduceRight(iterator: (memo: any, element: TModel, index: number) => any, initialMemo: any, context?: any): any[]; - reject(iterator: (element: TModel, index: number) => boolean, context?: any): TModel[]; - rest(): TModel; - rest(n: number): TModel[]; - tail(): TModel; - tail(n: number): TModel[]; - toArray(): any[]; - without(...values: any[]): TModel[]; + some(iterator?: _.ListIterator, context?: any): boolean; + sortBy(iterator?: _.ListIterator, context?: any): TModel[]; + sortBy(iterator: string, context?: any): TModel[]; + tail(n?: number): TModel[]; + take(): TModel; + take(n: number): TModel[]; + toArray(): TModel[]; + without(...values: TModel[]): TModel[]; } class Router extends Events { @@ -296,6 +331,8 @@ declare namespace Backbone { navigate(fragment: string, options?: NavigateOptions): Router; navigate(fragment: string, trigger?: boolean): Router; + execute(callback: Function, args: any[], name: string) : void; + private _bindRoutes(): void; private _routeToRegExp(route: string): RegExp; private _extractParameters(route: RegExp, fragment: string): string[]; @@ -312,10 +349,15 @@ declare namespace Backbone { getHash(window?: Window): string; getFragment(fragment?: string): string; + decodeFragment(fragment: string): string; + getSearch(): string; stop(): void; route(route: string, callback: Function): number; checkUrl(e?: any): void; - loadUrl(fragmentOverride: string): boolean; + getPath(): string; + matchRoot(): boolean; + atRoot(): boolean; + loadUrl(fragmentOverride?: string): boolean; navigate(fragment: string, options?: any): boolean; static started: boolean; options: any; @@ -369,7 +411,6 @@ declare namespace Backbone { $(selector: any): JQuery; render(): View; remove(): View; - make(tagName: any, attributes?: any, content?: any): any; delegateEvents(events?: EventsHash): any; delegate(eventName: string, selector: string, listener: Function): View; undelegateEvents(): any; diff --git a/backbone/backbone-tests.ts b/backbone/backbone-tests.ts index 3669a6c4e1..bd961c1c89 100644 --- a/backbone/backbone-tests.ts +++ b/backbone/backbone-tests.ts @@ -90,6 +90,25 @@ function test_models() { note.set({ title: "March 20", content: "In his eyes she eclipses..." }); note.set("title", "A Scandal in Bohemia"); + + let strings: string[] + let value: any; + let values: any[]; + let bool: boolean; + + // underscore methods + strings = note.keys(); + values = note.values(); + values = note.pairs(); + values = note.invert(); + value = note.pick("foo"); + value = note.pick("foo", "bar"); + value = note.pick((value: any, key: any, object: any) => true); + value = note.omit("foo"); + value = note.omit("foo", "bar"); + value = note.omit((value: any, key: any, object: any) => true); + value = note.chain().pick().omit().value(); + bool = note.isEmpty(); } class Employee extends Backbone.Model { @@ -161,11 +180,86 @@ function test_collection() { book.get("published") === true); var alphabetical = books.sortBy((book: Book): number => null); + + let one: Book; + let models: Book[]; + let bool: boolean; + let numDict: _.Dictionary; + let modelDict: _.Dictionary; + let modelsDict: _.Dictionary; + let num: number; + + models = books.slice(1); + models = books.slice(1, 3); + + // underscore methods + bool = books.all((value: Book, index: number, list: Book[]) => true); + bool = books.any((value: Book, index: number, list: Book[]) => true); + bool = books.chain().any((value: Book, index: number, list: Book[]) => true).value(); + models = books.collect((value: Book, index: number, list: Book[]) => value); + bool = books.contains(book1); + numDict = books.countBy((value: Book, index: number, list: Book[]) => true); + numDict = books.countBy("foo"); + one = books.detect((value: Book, index: number, list: Book[]) => true); + models = books.difference([book1]); + models = books.drop(); + models = books.each((value: Book, index: number, list: Book[]) => true); + bool = books.every((value: Book, index: number, list: Book[]) => true); + models = books.filter((value: Book, index: number, list: Book[]) => true); + one = books.find((value: Book, index: number, list: Book[]) => true); + num = books.findIndex((value: Book, index: number, list: Book[]) => true); + num = books.findLastIndex((value: Book, index: number, list: Book[]) => true); + one = books.first(); + models = books.first(3); + models = books.foldl((prev: Book[], curr: Book, index: number, list: Book[]) => prev, []); + models = books.foldr((prev: Book[], curr: Book, index: number, list: Book[]) => prev, []); + models = books.forEach((value: Book, index: number, list: Book[]) => true); + modelsDict = books.groupBy((value: Book, index: number, list: Book[]) => true); + modelsDict = books.groupBy("foo"); + one = books.head(); + models = books.head(3); + bool = books.include(book1); + bool = books.includes(book1); + modelDict = books.indexBy((value: Book, index: number, list: Book[]) => true); + modelDict = books.indexBy("foo"); + num = books.indexOf(book1, true); + one = books.initial(); + models = books.initial(3); + models = books.inject((prev: Book[], curr: Book, index: number, list: Book[]) => prev, []); + one = books.invoke("at", 3); + bool = books.isEmpty(); + one = books.last(); + models = books.last(3); + num = books.lastIndexOf(book1, 3); + models = books.map((value: Book, index: number, list: Book[]) => value); + one = books.max((value: Book, index: number, list: Book[]) => value); + one = books.min((value: Book, index: number, list: Book[]) => value); + [models] = books.partition((value: Book, index: number, list: Book[]) => true); + models = books.reduce((prev: Book[], curr: Book, index: number, list: Book[]) => prev, []); + models = books.reduceRight((prev: Book[], curr: Book, index: number, list: Book[]) => prev, []); + models = books.reject((value: Book, index: number, list: Book[]) => true); + models = books.rest(3); + one = books.sample(); + models = books.sample(3); + models = books.select((value: Book, index: number, list: Book[]) => true); + models = books.shuffle(); + num = books.size(); + bool = books.some((value: Book, index: number, list: Book[]) => true); + models = books.sortBy((value: Book, index: number, list: Book[]) => value); + models = books.sortBy("foo"); + models = books.tail(3); + one = books.take(); + models = books.take(3); + models = books.toArray(); + models = books.without(book1, book1); } ////////// Backbone.history.start(); +Backbone.History.started; +Backbone.history.loadUrl(); +Backbone.history.loadUrl('12345'); namespace v1Changes { namespace events { diff --git a/backbone/backbone-with-lodash-tests.ts b/backbone/backbone-with-lodash-tests.ts index e0b04880bf..0ac4efe375 100644 --- a/backbone/backbone-with-lodash-tests.ts +++ b/backbone/backbone-with-lodash-tests.ts @@ -91,6 +91,25 @@ function test_models() { note.set({ title: "March 20", content: "In his eyes she eclipses..." }); note.set("title", "A Scandal in Bohemia"); + + let strings: string[] + let value: any; + let values: any[]; + let bool: boolean; + + // underscore methods + strings = note.keys(); + values = note.values(); + values = note.pairs(); + values = note.invert(); + value = note.pick("foo"); + value = note.pick("foo", "bar"); + value = note.pick((value: any, key: any, object: any) => true); + value = note.omit("foo"); + value = note.omit("foo", "bar"); + value = note.omit((value: any, key: any, object: any) => true); + value = note.chain().pick().omit().value(); + bool = note.isEmpty(); } class Employee extends Backbone.Model { @@ -152,6 +171,78 @@ function test_collection() { book.get("published") === true); var alphabetical = books.sortBy((book: Book): number => null); + + let one: Book; + let models: Book[]; + let bool: boolean; + let numDict: _.Dictionary; + let modelDict: _.Dictionary; + let modelsDict: _.Dictionary; + let num: number; + + models = books.slice(1); + models = books.slice(1, 3); + + // underscore methods + bool = books.all((value: Book, index: number, list: Book[]) => true); + bool = books.any((value: Book, index: number, list: Book[]) => true); + bool = books.chain().any((value: Book, index: number, list: Book[]) => true).value(); + models = books.collect((value: Book, index: number, list: Book[]) => value); + bool = books.contains(book1); + numDict = books.countBy((value: Book, index: number, list: Book[]) => true); + numDict = books.countBy("foo"); + one = books.detect((value: Book, index: number, list: Book[]) => true); + models = books.difference([book1]); + models = books.drop(); + models = books.each((value: Book, index: number, list: Book[]) => true); + bool = books.every((value: Book, index: number, list: Book[]) => true); + models = books.filter((value: Book, index: number, list: Book[]) => true); + one = books.find((value: Book, index: number, list: Book[]) => true); + num = books.findIndex((value: Book, index: number, list: Book[]) => true); + num = books.findLastIndex((value: Book, index: number, list: Book[]) => true); + one = books.first(); + models = books.first(3); + models = books.foldl((prev: Book[], curr: Book, index: number, list: Book[]) => prev, []); + models = books.foldr((prev: Book[], curr: Book, index: number, list: Book[]) => prev, []); + models = books.forEach((value: Book, index: number, list: Book[]) => true); + modelsDict = books.groupBy((value: Book, index: number, list: Book[]) => true); + modelsDict = books.groupBy("foo"); + one = books.head(); + models = books.head(3); + bool = books.include(book1); + bool = books.includes(book1); + modelDict = books.indexBy((value: Book, index: number, list: Book[]) => true); + modelDict = books.indexBy("foo"); + num = books.indexOf(book1, true); + one = books.initial(); + models = books.initial(3); + models = books.inject((prev: Book[], curr: Book, index: number, list: Book[]) => prev, []); + one = books.invoke("at", 3); + bool = books.isEmpty(); + one = books.last(); + models = books.last(3); + num = books.lastIndexOf(book1, 3); + models = books.map((value: Book, index: number, list: Book[]) => value); + one = books.max((value: Book, index: number, list: Book[]) => value); + one = books.min((value: Book, index: number, list: Book[]) => value); + [models] = books.partition((value: Book, index: number, list: Book[]) => true); + models = books.reduce((prev: Book[], curr: Book, index: number, list: Book[]) => prev, []); + models = books.reduceRight((prev: Book[], curr: Book, index: number, list: Book[]) => prev, []); + models = books.reject((value: Book, index: number, list: Book[]) => true); + models = books.rest(3); + one = books.sample(); + models = books.sample(3); + models = books.select((value: Book, index: number, list: Book[]) => true); + models = books.shuffle(); + num = books.size(); + bool = books.some((value: Book, index: number, list: Book[]) => true); + models = books.sortBy((value: Book, index: number, list: Book[]) => value); + models = books.sortBy("foo"); + models = books.tail(3); + one = books.take(); + models = books.take(3); + models = books.toArray(); + models = books.without(book1, book1); } ////////// diff --git a/backbone/backbone.d.ts b/backbone/backbone.d.ts index 65e273a61f..d3887b4176 100644 --- a/backbone/backbone.d.ts +++ b/backbone/backbone.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Backbone 1.0.0 +// Type definitions for Backbone 1.3.3 // Project: http://backbonejs.org/ // Definitions by: Boris Yankov , Natan Vivo // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/base64-js/base64-js-tests.ts b/base64-js/base64-js-tests.ts new file mode 100644 index 0000000000..6852ddb626 --- /dev/null +++ b/base64-js/base64-js-tests.ts @@ -0,0 +1,6 @@ +/// + +import * as base64js from 'base64-js'; + +const bytes: Uint8Array = base64js.toByteArray('shemp'); +const decoded: string = base64js.fromByteArray(new Uint8Array(0)); diff --git a/base64-js/base64-js.d.ts b/base64-js/base64-js.d.ts new file mode 100644 index 0000000000..cc7d2165c8 --- /dev/null +++ b/base64-js/base64-js.d.ts @@ -0,0 +1,10 @@ +// Type definitions for base64-js v1.1.2 +// Project: https://github.com/beatgammit/base64-js +// Definitions by: Peter Safranek +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module 'base64-js' { + + export function toByteArray(encoded: string): Uint8Array; + export function fromByteArray(bytes: Uint8Array): string; +} diff --git a/bazinga-translator/bazinga-translator-tests.ts b/bazinga-translator/bazinga-translator-tests.ts new file mode 100644 index 0000000000..2401641815 --- /dev/null +++ b/bazinga-translator/bazinga-translator-tests.ts @@ -0,0 +1,12 @@ +/// + +Translator.fallback = 'en'; +Translator.defaultDomain = 'messages'; + +Translator.add("test", "it work", "frontend", "en"); + +Translator.trans('key', {}, 'frontend'); +Translator.trans('key', {"foo": "bar"}, 'DOMAIN_NAME'); + +Translator.transChoice('key', 1, {}, 'frontend'); +Translator.transChoice('key', 123, {"foo": "bar"}, 'DOMAIN_NAME'); \ No newline at end of file diff --git a/bazinga-translator/bazinga-translator.d.ts b/bazinga-translator/bazinga-translator.d.ts new file mode 100644 index 0000000000..5467fbfd85 --- /dev/null +++ b/bazinga-translator/bazinga-translator.d.ts @@ -0,0 +1,99 @@ +// Type definitions for Translator +// Project: https://github.com/willdurand/BazingaJsTranslationBundle +// Definitions by: Alex +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface BazingaTranslator { + /** + * The current locale. + * + * @type {String} + */ + locale: string; + + /** + * Fallback locale. + * + * @type {String} + */ + fallback: string; + + /** + * Placeholder prefix. + * + * @type {String} + */ + placeHolderPrefix: string; + + /** + * Placeholder suffix. + * + * @type {String} + */ + placeHolderSuffix: string; + + /** + * Default domain. + * + * @type {String} + */ + defaultDomain: string; + + /** + * Plural separator. + * + * @type {String} + */ + pluralSeparator: string; + + /** + * Adds a translation entry. + * + * @param {String} id The message id + * @param {String} message The message to register for the given id + * @param {String} [domain] The domain for the message or null to use the default + * @param {String} [locale] The locale or null to use the default + * + * @return {Object} Translator + */ + add(id: string, message: string, domain: string, locale: string): BazingaTranslator; + + + /** + * Translates the given message. + * + * @param {String} id The message id + * @param {Object} [parameters] An array of parameters for the message + * @param {String} [domain] The domain for the message or null to guess it + * @param {String} [locale] The locale or null to use the default + * + * @return {String} The translated string + */ + trans(id: string, parameters: any, domain: string, locale?: string): string; + + /** + * Translates the given choice message by choosing a translation according to a number. + * + * @param {String} id The message id + * @param {Number} number The number to use to find the indice of the message + * @param {Object} [parameters] An array of parameters for the message + * @param {String} [domain] The domain for the message or null to guess it + * @param {String} [locale] The locale or null to use the default + * + * @return {String} The translated string + */ + transChoice(id: string, number: number, parameters: any, domain: string, locale?: string): string, + + /** + * Loads translations from JSON. + * + * @param {String} data A JSON string or object literal + * + * @return {Object} Translator + */ + fromJSON(data: string): BazingaTranslator; + + reset(): void; +} + +declare var Translator: BazingaTranslator; \ No newline at end of file diff --git a/bezier-js/bezier-js-tests.ts b/bezier-js/bezier-js-tests.ts new file mode 100644 index 0000000000..2f9f2685a2 --- /dev/null +++ b/bezier-js/bezier-js-tests.ts @@ -0,0 +1,98 @@ +/// + +function test() { + + var bezierjs: typeof BezierJs; + + var bezier = new bezierjs.Bezier([1, 2, 3, 4]); + var cap = new bezierjs.BezierCap([]); + var point: BezierJs.Point = { x: 0, y: 0 }; + var utils = bezier.getUtils(); + var line: BezierJs.Line = { p1: { x: 0, y: 0 }, p2: { x: 1, y: 1 } }; + var abc: BezierJs.ABC = { A: null, B: null, C: null }; + var arc: BezierJs.Arc = { e: 0, s: 0, x: 0, y: 0, r: 1 }; + var bbox: BezierJs.BBox = bezier.bbox(); + var closest: BezierJs.Closest = { mdist: 1, mpos: 0 }; + var inflection: BezierJs.Inflection = { values: null, x: [0], y: [0], z: [0] }; + var minmax: BezierJs.MinMax = { min: 0, max: 0 }; + var offset: BezierJs.Offset = { x: 0, y: 0, c: point, n: point }; + var pair: BezierJs.Pair = { left: bezier, right: bezier }; + var poly: BezierJs.PolyBezier = bezier.outline(1); + var projection: BezierJs.Projection = { x: 0, y: 0, t: 9, d: 4 }; + var shape: BezierJs.Shape = { + startcap: cap, endcap: cap, forward: bezier, back: bezier, bbox: bbox, intersections: function (shape) { return [[0]]; } + }; + var split: BezierJs.Split = { left: bezier, right: bezier, span: [point] }; + + bezier.arcs(); + bezier.clockwise; + bezier.compute(.5); + bezier.computedirection(); + bezier.curveintersects([bezier], [bezier]); + bezier.derivative(0); + bezier.get(1); + bezier.getLUT()[0].x; + bezier.hull(0); + bezier.extrema(); + bezier.intersects(bezier); + bezier.length(); + bezier.lineIntersects(line); + bezier.normal(0); + bezier.offset(1, 2); + bezier.on(point, 0); + bezier.order = 5; + bezier.outlineshapes(1, 3); + bezier.overlaps(bezier); + bezier.point(9); + bezier.project(point); + bezier.raise(); + bezier.reduce(); + bezier.scale(4); + bezier.selfintersects(); + bezier.simple(); + bezier.split(0, 1).clockwise; + bezier.split(0.5).left; + bezier.toSVG(); + bezier.update(); + + cap.virtual = true; + + poly.addCurve(bezier); + poly.bbox(); + poly.curve(7); + poly.curves[0]._3d; + poly.length(); + poly.offset(9).points[0].y; + poly.points[0]; + + utils.abcratio(0, 1); + utils.align([point], line); + utils.angle(point, point, point); + utils.approximately(5, 7, .001); + utils.arcfn(1, function () { }); + utils.bboxoverlap(bbox, bbox); + utils.between(0, 0, 1); + utils.closest([point], point); + utils.copy({}); + utils.dist(point, point); + utils.droots([9]); + utils.expandbox(bbox, bbox); + utils.findbbox([bezier]); + utils.getccenter(point, point, point); + utils.getminmax(bezier, 'x', [0]); + utils.length(function () { }); + utils.lerp(1, point, point); + utils.lli(offset, offset); + utils.lli4(point, point, point, point); + utils.lli8(0, 0, 0, 0, 0, 0, 0, 0); + utils.makeline(point, point); + utils.makeshape(bezier, bezier); + utils.map(0, 0, 0, 0, 0); + utils.pairiteration(bezier, bezier); + utils.pointsToString([point]); + utils.projectionratio(0, 0); + utils.roots([point], line); + utils.round(.999, .001); + utils.shapeintersections(shape, bbox, shape, bbox); + +} \ No newline at end of file diff --git a/bezier-js/bezier-js.d.ts b/bezier-js/bezier-js.d.ts new file mode 100644 index 0000000000..8ee85790b1 --- /dev/null +++ b/bezier-js/bezier-js.d.ts @@ -0,0 +1,199 @@ +// Type definitions for Bezier.js +// Project: https://github.com/Pomax/bezierjs +// Definitions by: Dan Marshall +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +declare module BezierJs { + interface Point { + x: number; + y: number; + z?: number; + } + interface Projection extends Point { + t?: number; + d?: number; + } + interface Inflection { + x: number[]; + y: number[]; + z?: number[]; + values: number[]; + } + interface Offset extends Point { + c: Point; + n: Point; + } + interface Pair { + left: Bezier; + right: Bezier; + } + interface Split extends Pair { + span: Point[]; + _t1?: number; + _t2?: number; + } + interface MinMax { + min: number; + mid?: number; + max: number; + size?: number; + } + interface BBox { + x: MinMax; + y: MinMax; + z?: MinMax; + } + interface Line { + p1: Point; + p2: Point; + } + interface Arc extends Point { + e: number; + r: number; + s: number; + } + interface Shape { + startcap: BezierCap; + forward: Bezier; + back: Bezier; + endcap: BezierCap; + bbox: BBox; + intersections: (shape: Shape) => string[][] | number[][]; + } + interface ABC { + A: Point; + B: Point; + C: Point; + } + interface Closest { + mdist: number; + mpos: number; + } + /** + * Bezier curve constructor. The constructor argument can be one of three things: + * + * 1. array/4 of {x:..., y:..., z:...}, z optional + * 2. numerical array/8 ordered x1,y1,x2,y2,x3,y3,x4,y4 + * 3. numerical array/12 ordered x1,y1,z1,x2,y2,z2,x3,y3,z3,x4,y4,z4 + * + */ + class Bezier { + private _linear; + clockwise: boolean; + _3d: boolean; + _t1: number; + _t2: number; + _lut: Point[]; + dpoints: Point[][]; + order: number; + points: Point[]; + dims: string[]; + dimlen: number; + constructor(points: Point[]); + constructor(coords: number[]); + constructor(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, x4?: number, y4?: number); + constructor(p1: Point, p2: Point, p3: Point, p4?: Point); + static fromSVG(svgString: string): Bezier; + static getABC(n: number, S: Point, B: Point, E: Point, t: number): ABC; + static quadraticFromPoints(p1: Point, p2: Point, p3: Point, t: number): Bezier; + static cubicFromPoints(S: Point, B: Point, E: Point, t: number, d1: number): Bezier; + static getUtils(): typeof utils; + getUtils(): typeof utils; + valueOf(): string; + toString(): string; + toSVG(): string; + update(): void; + computedirection(): void; + length(): number; + getLUT(steps?: number): Point[]; + on(point: Point, error: number): number; + project(point: Point): Projection; + get(t: number): Point; + point(idx: number): Point; + compute(t: number): Point; + raise(): Bezier; + derivative(t: number): Point; + inflections(): number[]; + normal(t: number): Point; + private __normal2(t); + private __normal3(t); + private __normal(t); + hull(t: number): Point[]; + split(t1: number): Split; + split(t1: number, t2: number): Bezier; + extrema(): Inflection; + bbox(): BBox; + overlaps(curve: Bezier): boolean; + offset(t: number, d?: number): Offset | Bezier[]; + simple(): boolean; + reduce(): Bezier[]; + scale(d: Function): Bezier; + scale(d: number): Bezier; + outline(d1: number, d2?: number, d3?: number, d4?: number): PolyBezier; + outlineshapes(d1: number, d2: number, curveIntersectionThreshold?: number): Shape[]; + intersects(curve: Bezier, curveIntersectionThreshold?: number): string[] | number[]; + intersects(curve: Line): string[] | number[]; + lineIntersects(line: Line): number[]; + selfintersects(curveIntersectionThreshold?: number): string[]; + curveintersects(c1: Bezier[], c2: Bezier[], curveIntersectionThreshold?: number): string[]; + arcs(errorThreshold?: number): Arc[]; + private _error(pc, np1, s, e); + private _iterate(errorThreshold, circles); + } + class BezierCap extends Bezier { + virtual: boolean; + } +} +declare module BezierJs.utils { + var Tvalues: number[]; + var Cvalues: number[]; + function arcfn(t: number, derivativeFn: Function): number; + function between(v: number, m: number, M: number): boolean; + function approximately(a: number, b: number, precision?: number): boolean; + function length(derivativeFn: Function): number; + function map(v: number, ds: number, de: number, ts: number, te: number): number; + function lerp(r: number, v1: Point, v2: Point): Point; + function pointToString(p: Point): string; + function pointsToString(points: Point[]): string; + function copy(obj: Object): any; + function angle(o: Point, v1: Point, v2: Point): number; + function round(v: number, d: number): number; + function dist(p1: Point, p2: Point): number; + function closest(LUT: Point[], point: Point): Closest; + function abcratio(t: number, n: number): number; + function projectionratio(t: number, n: number): number; + function lli8(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, x4: number, y4: number): Point; + function lli4(p1: Point, p2: Point, p3: Point, p4: Point): Point; + function lli(v1: Offset, v2: Offset): Point; + function makeline(p1: Point, p2: Point): Bezier; + function findbbox(sections: Bezier[]): BBox; + function shapeintersections(s1: Shape, bbox1: BBox, s2: Shape, bbox2: BBox, curveIntersectionThreshold?: number): string[][] | number[][]; + function makeshape(forward: Bezier, back: Bezier, curveIntersectionThreshold?: number): Shape; + function getminmax(curve: Bezier, d: string, list: number[]): MinMax; + function align(points: Point[], line: Line): Point[]; + function roots(points: Point[], line: Line): number[]; + function droots(p: number[]): number[]; + function inflections(points: Point[]): number[]; + function bboxoverlap(b1: BBox, b2: BBox): boolean; + function expandbox(bbox: BBox, _bbox: BBox): void; + function pairiteration(c1: Bezier, c2: Bezier, curveIntersectionThreshold?: number): string[]; + function getccenter(p1: Point, p2: Point, p3: Point): Arc; +} +declare module BezierJs { + /** + * Poly Bezier + * @param {[type]} curves [description] + */ + class PolyBezier { + curves: Bezier[]; + private _3d; + points: Point[]; + constructor(curves: Bezier[]); + valueOf(): string; + toString(): string; + addCurve(curve: Bezier): void; + length(): number; + curve(idx: number): Bezier; + bbox(): BBox; + offset(d: number): PolyBezier; + } +} diff --git a/big.js/big.js-tests.ts b/big.js/big.js-tests.ts index 0067a0b4f5..5a12cab011 100644 --- a/big.js/big.js-tests.ts +++ b/big.js/big.js-tests.ts @@ -12,6 +12,7 @@ */ +import BigJS = BigJsLibrary.BigJS; function constructorTests() { var x = new Big(9) // '9' var y = new Big(x) // '9' @@ -247,4 +248,19 @@ function testMultipleConstructors() { x.div(3) // 1.667 y.div(3) // 1.6666666667 -} \ No newline at end of file +} + +function multipleTypesAccepted(n: number | BigJS | string) { + var y = Big(n) + .minus(n) + .mod(n) + .plus(n) + .times(n); + y.cmp(n); + y.eq(n); + y.gt(n); + y.gte(n); + y.lt(n); + y.lte(n); + y.div(n) +} diff --git a/big.js/big.js.d.ts b/big.js/big.js.d.ts index 52a653ba83..e08ee7bc57 100644 --- a/big.js/big.js.d.ts +++ b/big.js/big.js.d.ts @@ -25,23 +25,11 @@ declare namespace BigJsLibrary { RM: RoundingMode; } + type BigNumberInputType = number | string | BigJS; + interface BigJS_Constructors { - /** A decimal value. */ - new (value: number): BigJS; - /** A decimal value. - String values may be in exponential, as well as normal (non-exponential) notation. There is no limit to the number of digits of a string value (other than that of Javascript's maximum array size), but the largest recommended exponent magnitude is 1e+6. Infinity, NaN and hexadecimal literal strings, e.g. '0xff', are not valid. - String values in octal literal form will be interpreted as decimals, e.g. '011' is 11, not 9. */ - new (value: string): BigJS; - /** A decimal value. */ - new (value: BigJS): BigJS; - /** A decimal value. */ - (value: number): BigJS; - /** A decimal value. - String values may be in exponential, as well as normal (non-exponential) notation. There is no limit to the number of digits of a string value (other than that of Javascript's maximum array size), but the largest recommended exponent magnitude is 1e+6. Infinity, NaN and hexadecimal literal strings, e.g. '0xff', are not valid. - String values in octal literal form will be interpreted as decimals, e.g. '011' is 11, not 9. */ - (value: string): BigJS; - /** A decimal value. */ - (value: BigJS): BigJS; + new (value: BigNumberInputType): BigJS; + (value: BigNumberInputType): BigJS; /** A decimal value. */ (): BigJS; @@ -57,85 +45,35 @@ declare namespace BigJsLibrary { 1 = If the value of this Big number is greater than the value of n -1 = If the value of this Big number is less than the value of n 0 = If this Big number and n have the same value */ - cmp(n: number): number; - /** Compare - @returns {Number} - 1 = If the value of this Big number is greater than the value of n - -1 = If the value of this Big number is less than the value of n - 0 = If this Big number and n have the same value */ - cmp(n: string): number; - /** Compare - @returns {Number} - 1 = If the value of this Big number is greater than the value of n - -1 = If the value of this Big number is less than the value of n - 0 = If this Big number and n have the same value */ - cmp(n: BigJS): number; + cmp(n: BigNumberInputType): number; /** Returns a Big number whose value is the value of this Big number divided by n. */ - div(n: number): BigJS; - /** Returns a Big number whose value is the value of this Big number divided by n. */ - div(n: string): BigJS; - /** Returns a Big number whose value is the value of this Big number divided by n. */ - div(n: BigJS): BigJS; + div(n: BigNumberInputType): BigJS; /** Returns true if the value of this Big equals the value of n, otherwise returns false. */ - eq(n: number): boolean; - /** Returns true if the value of this Big equals the value of n, otherwise returns false. */ - eq(n: string): boolean; - /** Returns true if the value of this Big equals the value of n, otherwise returns false. */ - eq(n: BigJS): boolean; + eq(n: BigNumberInputType): boolean; /** Returns true if the value of this Big is greater than the value of n, otherwise returns false. */ - gt(n: number): boolean; - /** Returns true if the value of this Big is greater than the value of n, otherwise returns false. */ - gt(n: string): boolean; - /** Returns true if the value of this Big is greater than the value of n, otherwise returns false. */ - gt(n: BigJS): boolean; + gt(n: BigNumberInputType): boolean; /** Returns true if the value of this Big is greater than or equal to the value of n, otherwise returns false. */ - gte(n: number): boolean; - /** Returns true if the value of this Big is greater than or equal to the value of n, otherwise returns false. */ - gte(n: string): boolean; - /** Returns true if the value of this Big is greater than or equal to the value of n, otherwise returns false. */ - gte(n: BigJS): boolean; + gte(n: BigNumberInputType): boolean; /** Returns true if the value of this Big is less than the value of n, otherwise returns false. */ - lt(n: number): boolean; - /** Returns true if the value of this Big is less than the value of n, otherwise returns false. */ - lt(n: string): boolean; - /** Returns true if the value of this Big is less than the value of n, otherwise returns false. */ - lt(n: BigJS): boolean; + lt(n: BigNumberInputType): boolean; /** Returns true if the value of this Big is less than or equal to the value of n, otherwise returns false. */ - lte(n: number): boolean; - /** Returns true if the value of this Big is less than or equal to the value of n, otherwise returns false. */ - lte(n: string): boolean; - /** Returns true if the value of this Big is less than or equal to the value of n, otherwise returns false. */ - lte(n: BigJS): boolean; + lte(n: BigNumberInputType): boolean; /** Returns a Big number whose value is the value of this Big number minus n. */ - minus(n: number): BigJS; - /** Returns a Big number whose value is the value of this Big number minus n. */ - minus(n: string): BigJS; - /** Returns a Big number whose value is the value of this Big number minus n. */ - minus(n: BigJS): BigJS; + minus(n: BigNumberInputType): BigJS; /** Returns a Big number whose value is the value of this Big number modulo n, i.e. the integer remainder of dividing this Big number by n. - The result will have the same sign as this Big number, and it will match that of Javascript's % operator (within the limits of its precision) and BigDecimal's remainder method. */ - mod(n: number): BigJS; - /** Returns a Big number whose value is the value of this Big number modulo n, i.e. the integer remainder of dividing this Big number by n. - The result will have the same sign as this Big number, and it will match that of Javascript's % operator (within the limits of its precision) and BigDecimal's remainder method. */ - mod(n: string): BigJS; - /** Returns a Big number whose value is the value of this Big number modulo n, i.e. the integer remainder of dividing this Big number by n. - The result will have the same sign as this Big number, and it will match that of Javascript's % operator (within the limits of its precision) and BigDecimal's remainder method. */ - mod(n: BigJS): BigJS; + The result will have the same sign as this Big number, and it will match that of Javascript's % operator (within the limits of its precision) and BigDecimal's remainder method. */ + mod(n: BigNumberInputType): BigJS; /** Returns a Big number whose value is the value of this Big number plus n. */ - plus(n: number): BigJS; - /** Returns a Big number whose value is the value of this Big number plus n. */ - plus(n: string): BigJS; - /** Returns a Big number whose value is the value of this Big number plus n. */ - plus(n: BigJS): BigJS; + plus(n: BigNumberInputType): BigJS; /** Returns a Big number whose value is the value of this Big number raised to the power exp. If exp is negative and the result has more fraction digits than is specified by Big.DP, it will be rounded to Big.DP decimal places using rounding mode Big.RM. @@ -156,11 +94,7 @@ declare namespace BigJsLibrary { sqrt(): BigJS; /** Returns a Big number whose value is the value of this Big number times n. */ - times(n: number): BigJS; - /** Returns a Big number whose value is the value of this Big number times n. */ - times(n: string): BigJS; - /** Returns a Big number whose value is the value of this Big number times n. */ - times(n: BigJS): BigJS; + times(n: BigNumberInputType): BigJS; /** Returns a string representing the value of this Big number in exponential notation to a fixed number of decimal places dp. */ toExponential(): string; diff --git a/bingmaps/Microsoft.Maps.d.ts b/bingmaps/Microsoft.Maps.d.ts index c558c7a64b..1e7e464930 100644 --- a/bingmaps/Microsoft.Maps.d.ts +++ b/bingmaps/Microsoft.Maps.d.ts @@ -174,6 +174,7 @@ declare namespace Microsoft.Maps { fixedMapPosition?: boolean; height?: number; inertiaIntensity?: number; + navigationBarMode?: number; showBreadcrumb?: boolean; showCopyright?: boolean; showDashboard?: boolean; @@ -216,6 +217,12 @@ declare namespace Microsoft.Maps { getY(): number; } + export enum NavigationBarMode { + default, + compact, + minified + } + export enum PixelReference { control, page, @@ -301,12 +308,13 @@ declare namespace Microsoft.Maps { getShowPointer(): boolean; getTitle(): string; getTitleAction(): any; - getTitleClickHandler(): () => void; + getTitleClickHandler(): (mouseEvent?: MouseEvent) => void; getVisible(): boolean; getWidth(): number; getZIndex(): number; setHtmlContent(content: string): void; setLocation(location: Location): void; + setMap(map: Map): void; setOptions(options: InfoboxOptions): void; toString(): string; } @@ -329,8 +337,8 @@ declare namespace Microsoft.Maps { showPointer?: boolean; pushpin?: Pushpin; title?: string; - titleAction?: { label?: string; eventHandler: () => void; }; - titleClickHandler?: () => void; + titleAction?: { label?: string; eventHandler: (mouseEvent?: MouseEvent) => void; }; + titleClickHandler?: (mouseEvent?: MouseEvent) => void; typeName?: InfoboxType; visible?: boolean; width?: number; diff --git a/blessed/blessed.d.ts b/blessed/blessed.d.ts new file mode 100644 index 0000000000..6746afe5f5 --- /dev/null +++ b/blessed/blessed.d.ts @@ -0,0 +1,1269 @@ +// Type definitions for blessed 0.1.5 +// Project: https://github.com/chjj/blessed +// Definitions by: bryn austin bellomy +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module "blessed" +{ + import events = require('events'); + import buffer = require('buffer'); + import child_process = require('child_process'); + + module Blessed + { + export var colors: Colors; + + export interface GenericCallback { + (...args:any[]): void; + } + + export interface ColorPair { + /** background, must be number (-1 for default). */ + bg?: number; + /** foreground, must be number (-1 for default). */ + fg?: number; + } + + export interface Style extends ColorPair { + bold?: boolean; + underline?: boolean; + border: Border; + hover: ColorPair; + } + + export interface Border extends ColorPair { + /** type of border ('line' or 'bg'). */ + type?: string; //'line'|'bg'; + /** character to use if bg type, default is space. */ + ch?: string; + } + + export interface Padding { + top?:number; + right?:number; + bottom?:number; + left?:number; + } + + export interface Position { + /** offsets of the element relative to its parent. can be a number, percentage (0-100%), or keyword (center). right and bottom do not accept keywords. */ + top?:number|string; + /** offsets of the element relative to its parent. can be a number, percentage (0-100%), or keyword (center). right and bottom do not accept keywords. */ + right?:number|string; + /** offsets of the element relative to its parent. can be a number, percentage (0-100%), or keyword (center). right and bottom do not accept keywords. */ + bottom?:number|string; + /** offsets of the element relative to its parent. can be a number, percentage (0-100%), or keyword (center). right and bottom do not accept keywords. */ + left?:number|string; + /** width of the element, can be a number, percentage (0-100%), or keyword (half or shrink). */ + width?:number|string; + /** height of the element, can be a number, percentage (0-100%), or keyword (half or shrink). */ + height?:number|string; + } + + export interface KeyCode { + name: string; + ctrl: boolean; + meta: boolean; + shift: boolean; + sequence: string; + full: string; + } + + export class Program + { + /** + Wrap the given text in terminal formatting codes corresponding to the given attribute + name. The `attr` string can be of the form `red fg` or `52 bg` where `52` is a 0-255 + integer color number. + */ + text (text:string, attr:string): string; + } + + export interface Colors { + /** Either pass a hex string, an array of 3 numbers, or three separate numbers representing an RGB value. This returns the 0-255 color number for that color. */ + match (r:string|number[]|number, g?:number, b?:number): number; + + /** An array of the 255 colors as hex strings. */ + colors: string[]; + } + + export interface NodeOptions + { + screen?: Screen; + parent?: Node; + children?: Node[]; + } + + export class Node extends events.EventEmitter + { + constructor(options?:NodeOptions); + + type : string; + options : NodeOptions; + parent : Node; + screen : Screen; + children : Node[]; + data : any; + _ : any; + $ : any; + index : number; + + // on(event:string, callback:() => void); + // on(event:'adopt', callback:() => void); + // on(event:'remove', callback:() => void); + // on(event:'reparent', callback:() => void); + // on(event:'attach', callback:() => void); + // on(event:'detach', callback:() => void); + + prepend(node:Node): void; + append(node:Node): void; + remove(node:Node): void; + insert(node:Node, index:number): void; + insertBefore(node:Node, refNode:Node): void; + insertAfter(node:Node, refNode:Node): void; + detach(): void; + // emitDescendants(): void; + // get(key:string): any; + // get(key:string, default:any): any; + // set(key:string, value:any): void; + } + + export interface ScreenOptions extends NodeOptions + { + /** the blessed Program to be associated with. will be automatically instantiated if none is provided. */ + program?: any; + /** attempt to perform CSR optimization on all possible elements (not just full-width ones, elements with uniform cells to their sides). this is known to cause flickering with elements that are not full-width, however, it is more optimal for terminal rendering. */ + smartCSR?: boolean; + /** do CSR on any element within 20 cols of the screen edge on either side. faster than smartCSR, but may cause flickering depending on what is on each side of the element. */ + fastCSR?: boolean; + /** attempt to perform back_color_erase optimizations for terminals that support it. it will also work with terminals that don't support it, but only on lines with the default background color. as it stands with the current implementation, it's uncertain how much terminal performance this adds at the cost of overhead within node. */ + useBCE?: boolean; + /** amount of time (in ms) to redraw the screen after the terminal is resized (default: 300). */ + resizeTimeout?: number; + /** the width of tabs within an element's content. */ + tabSize?: number; + /** automatically position child elements with border and padding in mind. */ + autoPadding?: boolean; + /** the name of the logfile to use. if specified but the file does not exist, it will be created. see log method. */ + log?: string; + /** dump all output and input to desired file. can be used together with log option if set as a boolean. */ + dump?: any; + /** debug mode. enables usage of the `debug` method. also creates a debug console which will display when pressing F12. it will display all log and debug messages. */ + debug?: boolean; + /** Array of keys in their full format (e.g. C-c) to ignore when keys are locked. Useful for creating a key that will always exit no matter whether the keys are locked. */ + ignoreLocked?: string[]; + + /** Do not clear the screen, only scroll down enough to make room for the elements on the screen. do not use the alternate screenbuffer. useful for writing a CLI tool or some kind of prompt (experimental - see test/widget-noalt.js) */ + noAlt?: boolean; + + /** Options for the cursor. */ + cursor?: CursorOptions; + } + + export interface CursorOptions { + /** have blessed draw a custom cursor and hide the terminal cursor (experimental). */ + artificial?: boolean; + /** shape of the artificial cursor. can be: block, underline, or line. */ + shape?: string; //'block'|'underline'|'line'; + /** whether the artificial cursor blinks. */ + blink?: boolean; + /** color of the artificial cursor. accepts any valid color value (null is default). */ + color?: string; + } + + export interface ScreenEventCallback { + (character:string, keyCode:KeyCode): void; + } + + export class Screen extends Node + { + constructor(options?:ScreenOptions); + + /** the blessed Program object. */ + program: any; + /** the blessed Tput object (only available if you passed tput: true to the Program constructor.) */ + tput: any; + /** top of the focus history stack. */ + focused: any; + /** width of the screen (same as program.cols). */ + width: number; + /** height of the screen (same as program.rows). */ + height: number; + /** same as screen.width. */ + cols: number; + /** same as screen.height. */ + rows: number; + + /** calculated relative left offset. */ + left: number; + /** calculated relative right offset. */ + right: number; + /** calculated relative top offset. */ + top: number; + /** calculated relative bottom offset. */ + bottom: number; + /** calculated absolute left offset. */ + aleft: number; + /** calculated absolute right offset. */ + aright: number; + /** calculated absolute top offset. */ + atop: number; + /** calculated absolute bottom offset. */ + abottom: number; + + + /** whether the focused element grabs all keypresses. */ + grabKeys: boolean; + /** prevent keypresses from being received by any element. */ + lockKeys: boolean; + /** the currently hovered element. only set if mouse events are bound. */ + hover: Element; + /** set or get window title. */ + title: string; + + /** write string to the log file if one was created. */ + log(...msg:any[]): void; + /** same as the log method, but only gets called if the debug option was set. */ + debug(...msg:string[]): void; + /** allocate a new pending screen buffer and a new output screen buffer. */ + alloc(): void; + /** draw the screen based on the contents of the screen buffer. */ + draw(start:number, end:number): void; + /** render all child elements, writing all data to the screen buffer and drawing the screen. */ + render(): void; + /** clear any region on the screen. */ + clearRegion(x1:number, x2:number, y1:number, y2:number): void; + /** fill any region with a character of a certain attribute. */ + fillRegion(attr:number, ch:string, x1:number, x2:number, y1:number, y2:number): void; + /** focus element by offset of focusable elements. */ + focusOffset(offset:number): void; + /** focus previous element in the index. */ + focusPrevious(): void; + /** focus next element in the index. */ + focusNext(): void; + /** push element on the focus stack (equivalent to screen.focused = el). */ + focusPush(element:Element): void; + /** pop element off the focus stack. */ + focusPop(): void; + /** save the focused element. */ + saveFocus(): void; + /** restore the saved focused element. */ + restoreFocus(): void; + /** "rewind" focus to the last visible and attached element. */ + rewindFocus(): void; + /** bind a keypress listener for a specific key. */ + key(keyEvents:string|string[], callback:ScreenEventCallback): void; + /** bind a keypress listener for a specific key once. */ + onceKey(keyEvents:string|string[], callback:ScreenEventCallback): void; + /** remove a keypress listener for a specific key. */ + unkey(name:string, listener:ScreenEventCallback): void; + /** spawn a process in the foreground, return to blessed app after exit. */ + spawn(file:string, args:string[], options:NodeChildProcessExecOptions): child_process.ChildProcess; + /** spawn a process in the foreground, return to blessed app after exit. executes callback on error or exit. */ + exec(file:string, args:string[], options:NodeChildProcessExecOptions, callback:GenericCallback): child_process.ChildProcess; + /** read data from text editor. */ + readEditor(options:{}, callback:GenericCallback): void; + /** set effects based on two events and attributes. */ + setEffects(el:Element, fel:Element, over:string, out:string, effects:Style, temp?:string): void; + /** insert a line into the screen (using csr: this bypasses the output buffer). */ + insertLine(n:number, y:number, top:number, bottom:number): void; + /** delete a line from the screen (using csr: this bypasses the output buffer). */ + deleteLine(n:number, y:number, top:number, bottom:number): void; + /** insert a line at the bottom of the screen. */ + insertBottom(top:number, bottom:number): void; + /** insert a line at the top of the screen. */ + insertTop(top:number, bottom:number): void; + /** delete a line at the bottom of the screen. */ + deleteBottom(top:number, bottom:number): void; + /** delete a line at the top of the screen. */ + deleteTop(top:number, bottom:number): void; + + /** enable mouse events for the screen and optionally an element (automatically called when a form of on('mouse') is bound). */ + enableMouse(el?:Element): void; + /** enable keypress events for the screen and optionally an element (automatically called when a form of on('keypress') is bound). */ + enableKeys(el?:Element): void; + /** enable key and mouse events. calls bot enableMouse and enableKeys. */ + enableInput(el?:Element): void; + + /** attempt to copy text to clipboard using iTerm2's propriety sequence. returns true if successful. */ + copyToClipboard(text:string): boolean; + /** attempt to change cursor shape. will not work in all terminals (see artificial cursors for a solution to this). returns true if successful. */ + cursorShape(shape:string, blink:boolean): boolean; + /** attempt to change cursor color. returns true if successful. */ + cursorColor(color: string): boolean; + /** attempt to reset cursor. returns true if successful. */ + cursorReset(): boolean; + + } + + export interface ElementOptions extends NodeOptions + { + fg?: string; + bg?: string; + scrollbar?: ColorPair; + focus?: Style; + hover?: Style; + + /** border object, see below. */ + border?: Border; + /** positioning options. */ + position?: Position; + /** amount of padding on the inside of the element. can be a number or an object containing the properties: left, right, top, and bottom. */ + padding?: number|Padding; + /** element's text content. */ + content?: string; + /** element is clickable. */ + clickable?: boolean; + /** element is focusable and can receive key input. */ + input?: boolean; + /** element is focused. */ + focused?: boolean; + /** whether the element is hidden. */ + hidden?: boolean; + /** a simple text label for the element. */ + label?: string; + /** a floating text label for the element which appears on mouseover. */ + hoverText?: string; + /** text alignment: left, center, or right. */ + align?: string; + /** vertical text alignment: top, middle, or bottom. */ + valign?: string; + /** shrink/flex/grow to content and child elements. width/height during render. */ + shrink?: any; + /** width of the element, can be a number, percentage (0-100%), or keyword (half or shrink). */ + width?: number|string; + /** height of the element, can be a number, percentage (0-100%), or keyword (half or shrink). */ + height?: number|string; + /** whether the element is scrollable or not. */ + scrollable?: boolean; + /** background character (default is whitespace ). */ + ch?: string; + /** allow the element to be dragged with the mouse. */ + draggable?: boolean; + } + + export class Element extends Node + { + constructor(options?:ElementOptions); + + /** name of the element. useful for form submission. */ + name: string; + /** border object. */ + border: Border; + /** contains attributes (e.g. fg/bg/underline). see above. */ + style: Style; + /** raw width, height, and offsets. */ + position: Position; + /** type of border (line or bg). bg by default. */ + type: string; //'line'|'bg'; + /** character to use if bg type, default is space. */ + ch: string; + /** raw text content. */ + content: string; + /** whether the element is hidden or not. */ + hidden: boolean; + /** whether the element is visible or not. */ + visible: boolean; + /** whether the element is attached to a screen in its ancestry somewhere. */ + detached: boolean; + /** calculated width. */ + width: number; + /** calculated height. */ + height: number; + /** whether the element is draggable. set to true to allow dragging. */ + draggable: boolean; + + + + /** calculated relative left offset. */ + left: number; + /** calculated relative right offset. */ + right: number; + /** calculated relative top offset. */ + top: number; + /** calculated relative bottom offset. */ + bottom: number; + /** calculated absolute left offset. */ + aleft: number; + /** calculated absolute right offset. */ + aright: number; + /** calculated absolute top offset. */ + atop: number; + /** calculated absolute bottom offset. */ + abottom: number; + + + /** write content and children to the screen buffer. */ + render(): void; + /** hide element. */ + hide(): void; + /** show element. */ + show(): void; + /** toggle hidden/shown. */ + toggle(): void; + /** focus element. */ + focus(): void; + /** bind a keypress listener for a specific key. */ + key(name:string|string[], listener:(character?:any, keyCode?:any) => void): void; + /** bind a keypress listener for a specific key once. */ + onceKey(name:string, listener:() => void): void; + /** remove a keypress listener for a specific key. */ + unkey(name:string, listener:() => void): void; + /** same as el.on('screen', ...) except this will automatically cleanup listeners after the element is detached. */ + onScreenEvent(event:string, listener:(...args:any[]) => void): void; + /** set the z-index of the element (changes rendering order). */ + setIndex(z:number): void; + /** put the element in front of its siblings. */ + setFront(): void; + /** put the element in back of its siblings. */ + setBack(): void; + /** set the label text for the top-left corner. example options: {text:'foo',side:'left'} */ + setLabel(textOrOptions:string|{}): void; + /** remove the label completely. */ + removeLabel(): void; + /** set the hover text for the bottom-right corner. example options: {text:'foo'} */ + setHover(textOrOptions:string|{}): void; + /** remove the hover label completely. */ + removeHover(): void; + /** set the content. note: when text is input, it will be stripped of all non-SGR escape codes, tabs will be replaced with 8 spaces, and tags will be replaced with SGR codes (if enabled). */ + setContent(text:string): void; + /** return content, slightly different from el.content. assume the above formatting. */ + getContent(): void; + /** similar to setContent, but ignore tags and remove escape codes. */ + setText(text:string): void; + /** similar to getContent, but return content with tags and escape codes removed. */ + getText(): void; + /** insert a line into the box's content. */ + insertLine(index:number, lines:string|string[]): void; + /** delete a line from the box's content. */ + deleteLine(index:number, numLines:number): void; + /** get a line from the box's content. */ + getLine(index:number): void; + /** get a line from the box's content from the visible top. */ + getBaseLine(index:number): void; + /** set a line in the box's content. */ + setLine(index:number, line:string): void; + /** set a line in the box's content from the visible top. */ + setBaseLine(index:number, line:string): void; + /** clear a line from the box's content. */ + clearLine(index:number): void; + /** clear a line from the box's content from the visible top. */ + clearBaseLine(index:number): void; + /** insert a line at the top of the box. */ + insertTop(lines:string|string[]): void; + /** insert a line at the bottom of the box. */ + insertBottom(lines:string|string[]): void; + /** delete a line at the top of the box. */ + deleteTop(): void; + /** delete a line at the bottom of the box. */ + deleteBottom(): void; + /** unshift a line onto the top of the content. */ + unshiftLine(lines:string|string[]): void; + /** shift a line off the top of the content. */ + shiftLine(index:number): void; + /** push a line onto the bottom of the content. */ + pushLine(lines:string|string[]): void; + /** pop a line off the bottom of the content. */ + popLine(index:number): void; + /** an array containing the content lines. */ + getLines(): void; + /** an array containing the lines as they are displayed on the screen. */ + getScreenLines(): void; + /** get a string's real length, taking into account tags. */ + textLength(text:string): number; + + /** enable dragging of the element. */ + enableDrag(): void; + /** disable dragging of the element. */ + disableDrag(): void; + } + + + // + // Box + // + + export interface BoxOptions extends ElementOptions { + // intentionally empty + } + + export class Box extends Element { + constructor(options?:BoxOptions); + // intentionally empty + } + + + // + // ScrollableBox + // + + export interface ScrollableBoxOptions extends BoxOptions { + /** a limit to the childBase. default is `Infinity`. */ + baseLimit: number; + /** a option which causes the ignoring of `childOffset`. this in turn causes the childBase to change every time the element is scrolled. */ + alwaysScroll: boolean; + /** object enabling a scrollbar. */ + scrollbar: ScrollBar; + } + + /** A box with scrollable content. */ + export class ScrollableBox extends Box { + constructor(options?:ScrollableBoxOptions); + + /** the offset of the top of the scroll content. */ + childBase: number; + /** the offset of the chosen item/line. */ + childOffset: number; + /** scroll the content by a relative offset. */ + scroll(offset:number): void; + /** scroll the content to an absolute index. */ + scrollTo(index:number): void; + /** same as `scrollTo`. */ + setScroll(index:number): void; + /** set the current scroll index in percentage (0-100). */ + setScrollPerc(perc:number): void; + /** get the current scroll index in lines. */ + getScroll(): number; + /** get the actual height of the scrolling area. */ + getScrollHeight(): number; + /** get the current scroll index in percentage. */ + getScrollPerc(): number; + /** reset the scroll index to its initial state. */ + resetScroll(): void; + + } + + export interface ScrollBar { + /** style of the scrollbar. */ + style: Style; + /** style of the scrollbar track if present (takes regular style options). */ + track: Style; + } + + + // + // ScrollableText + // + + export interface ScrollableTextOptions extends ScrollableBoxOptions { + /** whether to enable automatic mouse support for this element. */ + mouse: boolean; + /** use predefined keys for navigating the text. */ + keys: boolean; + /** use vi keys with the `keys` option. */ + vi: boolean; + } + + /** __DEPRECATED__ - Use Box with the `scrollable` and `alwaysScroll` options instead. A scrollable text box which can display and scroll text, as well as handle pre-existing newlines and escape codes. */ + export class ScrollableText extends ScrollableBox { + constructor(options?:ScrollableTextOptions); + } + + + + // + // Text + // + + export interface TextOptions extends ElementOptions { + align?: string; //'left'|'center'|'right'; + } + + export class Text extends Element { + constructor(options?:TextOptions); + // intentionally empty + } + + + // + // Line + // + + export interface LineOptions extends BoxOptions { + orientation?: string; //'vertical'|'horizontal'; + style?: Style; + } + + export class Line extends Box { + constructor(options?:LineOptions); + // intentionally empty + } + + + // + // List + // + + export interface ListStyle extends Style { + selected?: Style; + item?: Style; + } + + export interface ListOptions extends BoxOptions + { + style?: ListStyle; + + /** whether to automatically enable mouse support for this list (allows clicking items). */ + mouse?: boolean; + /** use predefined keys for navigating the list. */ + keys?: any; + /** use vi keys with the keys option. */ + vi?: boolean; + /** an array of strings which become the list's items. */ + items?: string[]; + /** a function that is called when vi mode is enabled and the key / is pressed. This function accepts a callback function which should be called with the search string. The search string is then used to jump to an item that is found in items. */ + search?: (callback:(searchString:string) => void) => void; + /** whether the list is interactive and can have items selected (default: true). */ + interactive?: boolean; + } + + export class List extends Box + { + constructor(options?:ListOptions); + + /** The text of the currently selected item. */ + value:string; + /** The items in the list. */ + items:string[]; + /** The items in the list. */ + ritems:string[]; + /** The index of the current selection. */ + selected:number; + + /** add an item based on a string. */ + addItem(text:string): void; + /** returns the item index from the list. child can be an element, index, or string. */ + getItemIndex(child:Element|number|string): void; + /** returns the item element. child can be an element, index, or string. */ + getItem(child:Element|number|string): void; + /** removes an item from the list. child can be an element, index, or string. */ + removeItem(child:Element|number|string): void; + /** clears all items from the list. */ + clearItems(): void; + /** sets the list items to multiple strings. */ + setItems(items:string[]): void; + /** Sets the current selection by absolute index. */ + select(index:number): void; + /** Changes the current selection based on current offset. */ + move(offset:number): void; + /** select item above selected. */ + up(amount:number): void; + /** select item below selected. */ + down(amount:number): void; + /** show/focus list and pick an item. the callback is executed with the result. */ + pick(cwd:string, callback:(err:any, file:string) => void): void; + + /** show/focus list and pick an item. the callback is executed with the result. */ + pick(callback:(err:any, file:string) => void): void; + } + + // + // Input + // + + export interface InputOptions extends BoxOptions { + // intentionally empty + } + + export class Input extends Box { + constructor(options?:InputOptions); + // intentionally empty + } + + export interface InputOptions extends BoxOptions { + // intentionally empty + } + + // + // Textarea + // + + export interface TextareaOptions extends InputOptions + { + /** use pre-defined keys (`i` or `enter` for insert, `e` for editor, `C-e` for editor while inserting). */ + keys?: boolean; + /** use pre-defined mouse events (right-click for editor). */ + mouse?: boolean; + /** call `readInput()` when the element is focused. automatically unfocus. */ + inputOnFocus?: boolean; + } + + /** A box which allows multiline text input. */ + export class Textarea extends Input + { + constructor(options?:TextareaOptions); + + /** the input text. __read-only__. */ + value: string; + + /** submit the textarea (emits `submit`). */ + submit(): void; + /** cancel the textarea (emits `cancel`). */ + cancel(): void; + /** grab key events and start reading text from the keyboard. takes a callback which receives the final value. */ + readInput(callback:GenericCallback): void; + /** open text editor in `$EDITOR`, read the output from the resulting file. takes a callback which receives the final value. */ + readEditor(callback:GenericCallback): void; + /** the same as `this.value`, for now. */ + getValue(): string; + /** clear input. */ + clearValue(): void; + /** set value. */ + setValue(text:string): void; + } + + + // + // Textbox + // + + export interface TextboxOptions extends TextareaOptions { + /** completely hide text. */ + secret?: boolean; + /** replace text with asterisks (`*`). */ + censor?: boolean; + } + + /** A box which allows text input. */ + export class Textbox extends Textarea { + constructor(options?:TextboxOptions); + + /** completely hide text. */ + secret: boolean; + /** replace text with asterisks (`*`). */ + censor: boolean; + } + + + // + // Button + // + + export interface ButtonOptions extends InputOptions { + } + + /** A button which can be focused and allows key and mouse input. */ + export class Button extends Input { + constructor(options?:ButtonOptions); + + // on(event:string, callback:() => void): void; + // on(event:'press', callback:() => void); + + /** press button. emits 'press'. */ + press(): void; + } + + + // + // ProgressBar + // + + export interface ProgressBarOptions extends InputOptions { + /** can be `horizontal` or `vertical`. */ + orientation: string; + /** the character to fill the bar with (default is space). */ + pch: string; + /** the amount filled (0 - 100). */ + filled: number; + /** same as `filled`. */ + value: number; + /** enable key support. */ + keys: boolean; + /** enable mouse support. */ + mouse: boolean; + + /** contains the extra key 'bar', which defines the style of the bar contents itself. */ + style: ProgressBarStyle; + } + + export interface ProgressBarStyle extends Style { + /** style of the bar contents itself. */ + bar: Style; + } + + + export class ProgressBar extends Input { + constructor(options?:ProgressBarOptions); + + /** progress the bar by a fill amount. */ + progress(amount:number): void; + /** set progress to specific amount. */ + setProgress(amount:number): void; + /** reset the bar. */ + reset(): void; + } + + // + // Checkbox + // + + export interface CheckboxOptions extends InputOptions { + /** whether the element is checked or not. */ + checked: boolean; + /** enable mouse support. */ + mouse: boolean; + } + + + /** A checkbox which can be used in a form element. */ + export class Checkbox extends Input + { + constructor(options?:CheckboxOptions); + + /** the text next to the checkbox (do not use setcontent, use `check.text = ''`). */ + text: string; + /** whether the element is checked or not. */ + checked: boolean; + /** same as `checked`. */ + value: boolean; + + /** check the element. */ + check(): void; + /** uncheck the element. */ + uncheck(): void; + /** toggle checked state. */ + toggle(): void; + } + + + // + // RadioSet + // + + export interface RadioSetOptions extends BoxOptions { + } + + + export class RadioSet extends Box { + constructor(options?:RadioSetOptions); + } + + + // + // RadioButton + // + + export interface RadioButtonOptions extends CheckboxOptions { + } + + + /** A radio button which can be used in a form element. */ + export class RadioButton extends Checkbox { + constructor(options?:RadioButtonOptions); + } + + + + // + // Prompt + // + + export interface PromptOptions extends BoxOptions { + } + + + /** A prompt box containing a text input, okay, and cancel buttons (automatically hidden). */ + export class Prompt extends Box + { + constructor(options?:PromptOptions); + + /** show the prompt and wait for the result of the textbox. set text and initial value */ + input(text:string, value:any, callback:(val:any) => void): void; + /** show the prompt and wait for the result of the textbox. set text and initial value */ + setInput(text:string, value:any, callback:(val:any) => void): void; + /** show the prompt and wait for the result of the textbox. set text and initial value */ + readInput(text:string, value:any, callback:(val:any) => void): void; + } + + + // + // Question + // + + export interface QuestionOptions extends BoxOptions { + } + + + /** A question box containing okay and cancel buttons (automatically hidden). */ + export class Question extends Box + { + constructor(options?:QuestionOptions); + + /** ask a `question`. `callback` will yield the result. */ + ask(question:string, callback:(result:any) => void): void; + } + + + // + // Message + // + + export interface MessageOptions extends BoxOptions { + } + + + /** A box containing a message to be displayed (automatically hidden). */ + export class Message extends Box + { + constructor(options?:MessageOptions); + + /** display a message for a time (default is 3 seconds). set time to 0 for a perpetual message that is dismissed on keypress. */ + log(text:string, timeOrCallback:number|MessageCallback, callback?:MessageCallback): void; + /** display a message for a time (default is 3 seconds). set time to 0 for a perpetual message that is dismissed on keypress. */ + display(text:string, timeOrCallback:number|MessageCallback, callback?:MessageCallback): void; + /** display an error in the same way. */ + error(text:string, timeOrCallback:number|MessageCallback, callback?:MessageCallback): void; + } + + export interface MessageCallback { + (): void; + } + + + // + // Loading + // + + export interface LoadingOptions extends BoxOptions { + } + + /** A box with a spinning line to denote loading (automatically hidden). */ + export class Loading extends Box + { + constructor(options?:LoadingOptions); + + /** display the loading box with a message. will lock keys until `stop` is called. */ + load(text:string): void; + /** hide loading box. unlock keys. */ + stop(): void; + } + + + // + // Listbar + // + + export interface ListbarOptions extends BoxOptions + { + /** Listbar's `style` object includes sub-styles for `selected` and `item`. */ + style?: ListbarStyle; + + /** set buttons using an object with keys as titles of buttons, containing of objects containing keys of `keys` and `callback`. */ + items?: ListbarItemSet; + /** set buttons using an object with keys as titles of buttons, containing of objects containing keys of `keys` and `callback`. */ + commands?: ListbarItemSet; + /** automatically bind list buttons to keys 0-9. */ + autoCommandKeys?: boolean; + } + + export interface ListbarItemSet { + [name: string]: ListbarItem; + } + + export interface ListbarItem { + keys: string[]; + callback: GenericCallback; + } + + export interface ListbarStyle extends Style + { + /** style for a selected item. */ + selected: Style; + /** style for an unselected item. */ + item: Style; + } + + /** A horizontal list. Useful for a main menu bar. */ + export class Listbar extends Box + { + constructor(options?:ListbarOptions); + + /** append an item to the bar. */ + add(item:ListbarItem, callback:GenericCallback): void; + /** append an item to the bar. */ + addItem(item:ListbarItem, callback:GenericCallback): void; + /** append an item to the bar. */ + appendItem(item:ListbarItem, callback:GenericCallback): void; + + /** select button and execute its callback. */ + selectTab(index: number): void; + + /** set commands (see `commands` option above). */ + setItems(commands: ListbarItemSet): void; + /** select an item on the bar. */ + select(offset: number): void; + /** remove item from the bar. */ + removeItem(child:ListbarItem): void; + /** move focus relatively across the bar. */ + move(offset: number): void; + /** move focus left relatively across the bar. */ + moveLeft(offset: number): void; + /** move focus right relatively across the bar. */ + moveRight(offset: number): void; + } + + + // + // Log + // + + export interface LogOptions extends ScrollableTextOptions { + /** amount of scrollback allowed. default: Infinity. */ + scrollback?: number; + /** scroll to bottom on input even if the user has scrolled up. default: false. */ + scrollOnInput?: boolean; + } + + + /** A log permanently scrolled to the bottom. */ + export class Log extends ScrollableText + { + constructor(options?:LogOptions); + + /** amount of scrollback allowed. default: Infinity. */ + scrollback: number; + /** scroll to bottom on input even if the user has scrolled up. default: false. */ + scrollOnInput: boolean; + + /** add a log line. */ + log(text:string): void; + /** add a log line. */ + add(text:string): void; + } + + + // + // Table + // + + export interface TableOptions extends BoxOptions + { + /** array of array of strings representing rows (same as `data`). */ + rows?: string[][]; + /** array of array of strings representing rows (same as `rows`). */ + data?: string[][]; + /** spaces to attempt to pad on the sides of each cell. `2` by default: one space on each side (only useful if the width is shrunken). */ + pad?: number; + /** do not draw inner cells. */ + noCellBorders?: boolean; + /** fill cell borders with the adjacent background color. */ + fillCellBorders?: boolean; + + /** includes `header` and `cell` substyles. */ + style?: TableStyle; + } + + export interface TableStyle extends Style { + /** header style. */ + header: Style; + /** cell style. */ + cell: Style; + } + + /** A stylized table of text elements. */ + export class Table extends Box + { + /** includes `header` and `cell` substyles. */ + style: TableStyle; + + /** set rows in table. array of arrays of strings. */ + setData(rows: string[][]): void; + /** set rows in table. array of arrays of strings. */ + setRows(rows: string[][]): void; + } + + + // + // ListTable + // + + export interface ListTableOptions extends ListOptions + { + /** array of array of strings representing rows (same as `data`). */ + rows?: string[][]; + /** array of array of strings representing rows (same as `rows`). */ + data?: string[][]; + /** spaces to attempt to pad on the sides of each cell. `2` by default: one space on each side (only useful if the width is shrunken). */ + pad?: number; + + /** do not draw inner cells. */ + noCellBorders?: boolean; + + /** includes `header` and `cell` substyles. */ + style?: TableStyle; + } + + export interface ListTableStyle extends TableStyle { + } + + + /** A stylized table of text elements with a list. */ + export class ListTable extends List + { + constructor(options?:ListTableOptions); + + /** set rows in table. array of arrays of strings. */ + setData(rows: string[][]): void; + /** set rows in table. array of arrays of strings. */ + setRows(rows: string[][]): void; + } + + // + // Image + // + + export interface ImageOptions extends BoxOptions { + /** path to image. */ + file: string; + /** path to w3mimgdisplay. if a proper w3mimgdisplay path is not given, blessed will search the entire disk for the binary. */ + w3m: string; + } + + + /** Display an image in the terminal (jpeg, png, gif) using w3mimgdisplay. Requires w3m to be installed. X11 required: works in xterm, urxvt, and possibly other terminals. */ + export class Image extends Box + { + constructor(options?:ImageOptions); + + /** set the image in the box to a new path. */ + setImage (img:string, callback:GenericCallback): void; + /** clear the current image. */ + clearImage (callback:GenericCallback): void; + /** get the size of an image file in pixels. */ + imageSize (img:string, callback:GenericCallback): void; + /** get the size of the terminal in pixels. */ + termSize (callback:GenericCallback): void; + /** get the pixel to cell ratio for the terminal. */ + getPixelRatio (callback:GenericCallback): void; + } + + + // + // Form + // + + export interface FormOptions extends BoxOptions { + /** allow default keys (tab, vi keys, enter). */ + keys?:boolean; + /** allow vi keys. */ + vi?:boolean; + } + + export class Form extends Box + { + constructor(options?:FormOptions); + + /** last submitted data. */ + submission: any; + + // on(event:string, callback:() => void): void; + // on(event:'submit', callback:(data) => void): void; + // on(event:'cancel', callback:() => void): void; + // on(event:'reset', callback:() => void): void; + + next(): void; + previous(): void; + + resetSelected(): void; + /** focus first form element. */ + focusFirst(): void; + /** focus last form element. */ + focusLast(): void; + /** focus next form element. */ + focusNext(): void; + /** focus previous form element. */ + focusPrevious(): void; + /** submit the form. */ + submit(): void; + /** discard the form. */ + cancel(): void; + /** clear the form. */ + reset(): void; + } + + + // + // FileManager + // + + export interface FileManagerOptions extends ListOptions { + cwd?: string; + } + + export interface DirectoryEntry { + name: string; + text: string; + dir: boolean; + symlink: boolean; + } + + export class FileManager extends List + { + constructor(options?:FileManagerOptions); + + cwd: string; + + useFormatter (formatterFn:(entry:DirectoryEntry) => DirectoryEntry): void; + + /** refresh the file list (perform a readdir on cwd and update the list items). */ + refresh (cwd?:string, callback?:() => void): void; + + /** refresh the file list. */ + refresh (callback?:() => void): void; + + /** reset back to original cwd. */ + reset (cwd?:string, callback?:() => void): void; + } + + + // + // Terminal + // + + export interface TerminalOptions extends BoxOptions + { + /** handler for input data. */ + handler?: (userInput:Buffer) => void; + /** name of shell. $SHELL by default. */ + shell?:string; + /** args for shell. */ + args?:any; + /** can be line, underline, and block. */ + cursor?:string; //'line'|'underline'|'block'; + } + + export class Terminal extends Box + { + /** reference to the headless term.js terminal. */ + term: any; + /** reference to the pty.js pseudo terminal. */ + pty: any; + + /** write data to the terminal. */ + write(data:string): void; + + /** nearly identical to `element.screenshot`, however, the specified region includes the terminal's _entire_ scrollback, rather than just what is visible on the screen. */ + screenshot(xi?:number, xl?:number, yi?:number, yl?:number): string; + } + + + export interface NodeChildProcessExecOptions + { + cwd?: string; + stdio?: any; + customFds?: any; + env?: any; + encoding?: string; + timeout?: number; + maxBuffer?: number; + killSignal?: string; + } + } + + export = Blessed; +} + + + diff --git a/bluebird/bluebird.d.ts b/bluebird/bluebird.d.ts index 4d70205a03..34659859cb 100644 --- a/bluebird/bluebird.d.ts +++ b/bluebird/bluebird.d.ts @@ -18,11 +18,24 @@ declare var Promise: PromiseConstructor; +interface PromiseCancelHandlerSetter { + (handler: () => void): void; +} + interface PromiseConstructor { /** - * Create a new promise. The passed in function will receive functions `resolve` and `reject` as its arguments which can be called to seal the fate of the created promise. + * Create a new promise. The passed in function will receive functions + * `resolve` and `reject` as its arguments which can be called to seal the + * fate of the created promise. + * + * If configured appropriately, it will also receive an `onCancel` + * function that can be used to configure a promise cancellation handler. */ - new (callback: (resolve: (thenableOrResult?: T | PromiseLike) => void, reject: (error: any) => void) => void): Promise; + new (callback: ( + resolve: (thenableOrResult?: T | PromiseLike) => void, + reject: (error: any) => void, + onCancel?: PromiseCancelHandlerSetter + ) => void): Promise; config(options: { warnings?: boolean | {wForgottenReturn?: boolean}; diff --git a/body-parser/body-parser.d.ts b/body-parser/body-parser.d.ts index 16f639dfaf..f7e691a365 100644 --- a/body-parser/body-parser.d.ts +++ b/body-parser/body-parser.d.ts @@ -33,7 +33,7 @@ declare module "body-parser" { /** * passed to JSON.parse(). */ - receiver?: (key: string, value: any) => any; + reviver?: (key: string, value: any) => any; /** * parse extended syntax with the qs module. (default: true) */ @@ -65,7 +65,7 @@ declare module "body-parser" { /** * passed to JSON.parse(). */ - receiver?: (key: string, value: any) => any; + reviver?: (key: string, value: any) => any; }): express.RequestHandler; export function raw(options?: { diff --git a/bookshelf/bookshelf-tests.ts b/bookshelf/bookshelf-tests.ts index 92758e143a..5d6080b99a 100644 --- a/bookshelf/bookshelf-tests.ts +++ b/bookshelf/bookshelf-tests.ts @@ -1,17 +1,52 @@ /// /// +/// +/// import * as Knex from 'knex'; import * as Bookshelf from 'bookshelf'; +import * as assert from 'assert'; +import * as express from 'express'; + + +/** + * The examples/tests below follow Bookshelf documentation chapter after chapter: http://bookshelfjs.org/ + */ + + +/* Installation, see http://bookshelfjs.org/#installation */ var knex = Knex({ - client: 'sqlite3', + client: 'mysql', connection: { - filename: ':memory:', - }, + host : '127.0.0.1', + user : 'your_database_user', + password : 'your_database_password', + database : 'myapp_test', + charset : 'utf8' + } }); -// Examples +var bookshelf = Bookshelf(knex); + +{ + class User extends bookshelf.Model { + get tableName() { return 'users'; } + } + + // In a file named something like bookshelf.js + const dbConfig: Knex.Config = {}; + var knex = Knex(dbConfig); + + // elsewhere, to use the bookshelf client: + var bookshelf = Bookshelf(knex); + + class Post extends bookshelf.Model { + // ... + } +} + +/* Examples, see http://bookshelfjs.org/#examples */ var bookshelf = Bookshelf(knex); @@ -20,14 +55,14 @@ bookshelf.plugin(['virtuals']); class User extends bookshelf.Model { get tableName() { return 'users'; } - messages() : Bookshelf.Collection { - return this.hasMany(Posts); + messages(): Bookshelf.Collection { + return this.hasMany(Post); } } -class Posts extends bookshelf.Model { +class Post extends bookshelf.Model { get tableName() { return 'messages'; } - tags() : Bookshelf.Collection { + tags(): Bookshelf.Collection { return this.belongsToMany(Tag); } } @@ -36,67 +71,1256 @@ class Tag extends bookshelf.Model { get tableName() { return 'tags'; } } -new User({}).where('id', 1).fetch({withRelated: ['posts.tags']}) +new User().where('id', 1).fetch({withRelated: ['posts.tags']}) .then(user => { - console.log(user.related('posts').toJSON()); + const posts = user.related('posts'); + console.log(posts.toJSON()); }).catch(err => { console.error(err); }); +/* Plugins, see http://bookshelfjs.org/#plugins */ -// Associations +/* Support, see http://bookshelfjs.org/#support */ + +/* F.A.Q., see http://bookshelfjs.org/#faq*/ + +/* Associations, see http://bookshelfjs.org/#associations */ + +/* One-to-one, see http://bookshelfjs.org/#one-to-one */ class Book extends bookshelf.Model { get tableName() { return 'books'; } - summary() { + summary(): Summary { return this.hasOne(Summary); } - pages() { - return this.hasMany(Pages); + pages(): Bookshelf.Collection { + return this.hasMany(Page); } - authors() { + authors(): Bookshelf.Collection { return this.belongsToMany(Author); } } class Summary extends bookshelf.Model { get tableName() { return 'summaries'; } - book() : Book { + book(): Book { return this.belongsTo(Book); } } -class Pages extends bookshelf.Model { +exports.up = (knex: Knex) => { + return knex.schema.createTable('books', table => { + table.increments('id').primary(); + table.string('name'); + }).createTable('summaries', table => { + table.increments('id').primary(); + table.string('details'); + table.integer('book_id').unique().references('books.id'); + }); +}; + +exports.down = (knex: Knex) => { + return knex.schema.dropTable('books') + .dropTable('summaries'); +}; + +/* One-to-many, see http://bookshelfjs.org/#one-to-many */ + +class Page extends bookshelf.Model { get tableName() { return 'pages'; } - book() { + book(): Book { return this.belongsTo(Book); } } +exports.up = (knex: Knex) => { + return knex.schema.createTable('books', table => { + table.increments('id').primary(); + table.string('name'); + }).createTable('pages', table => { + table.increments('id').primary(); + table.string('content'); + table.integer('book_id').references('books.id') + }); +}; + +exports.down = (knex: Knex) => { + return knex.schema.dropTable('books') + .dropTable('pages'); +}; + +/* Many-to-many, see http://bookshelfjs.org/#many-to-many */ + class Author extends bookshelf.Model { - get tableName() { return 'author'; } + get tableName() { return 'authors'; } books() { return this.belongsToMany(Book); } } -class Site extends bookshelf.Model { - get tableName() { return 'sites'; } - photo() { - return this.morphOne(Photo, 'imageable'); +exports.up = (knex: Knex) => { + return knex.schema.createTable('books', table => { + table.increments('id').primary(); + table.string('name'); + }).createTable('authors', table => { + table.increments('id').primary(); + table.string('name'); + }).createTable('authors_books', table => { + table.integer('author_id').references('authors.id'); + table.integer('book_id').references('books.id'); + }); +}; + +exports.down = (knex: Knex) => { + return knex.schema.dropTable('books') + .dropTable('authors') + .dropTable('authors_books'); +}; + +/* Polymorphic, see http://bookshelfjs.org/#polymorphic */ + +{ + class Site extends bookshelf.Model { + get tableName() { return 'sites'; } + photo(): Photo { + return this.morphOne(Photo, 'imageable'); + } + } + + class Post extends bookshelf.Model { + get tableName() { return 'posts'; } + photos(): Bookshelf.Collection { + return this.morphMany(Photo, 'imageable'); + } + } + + class Photo extends bookshelf.Model { + get tableName() { return 'photos'; } + imageable(): Photo { + return this.morphTo('imageable', Site, Post); + } } } -class Post extends bookshelf.Model { - get tableName() { return 'posts'; } - photos() { - return this.morphMany(Photo, 'imageable'); +/* Bookshelf, see http://bookshelfjs.org/#section-Bookshelf */ + +/* Construction, see http://bookshelfjs.org/#Bookshelf-subsection-construction */ + +/* new Bookshelf(), see http://bookshelfjs.org/#Bookshelf */ + +/* Members, see http://bookshelfjs.org/#Bookshelf-subsection-members */ + +/* bookshelf.knex, see http://bookshelfjs.org/#Bookshelf-instance-knex */ + +/* Methods, see http://bookshelfjs.org/#Bookshelf-subsection-methods */ + +/* bookshelf.transaction(), see http://bookshelfjs.org/#Bookshelf-instance-transaction */ + +class Library extends bookshelf.Model { + get tableName() { return 'libraries'; } + + relatedBooks(): Bookshelf.Collection { + return > this.related('books'); } } -class Photo extends bookshelf.Model { - get tableName() { return 'photos'; } - imageable() { - return this.morphTo('imageable', Site, Post); +bookshelf.transaction(t => { + return new Library({name: 'Old Books'}) + .save(null, {transacting: t}) + .tap(model => { + return Promise.map([ + {title: 'Canterbury Tales'}, + {title: 'Moby Dick'}, + {title: 'Hamlet'} + ], info => { + // Some validation could take place here. + return new Book(info).save({'shelf_id': model.id}, {transacting: t}); + }); + }); +}).then(library => { + console.log(library.relatedBooks().pluck('title')); +}).catch(err => { + console.error(err); +}); + +/* Type definitions */ + +/* transactionCallback(), see http://bookshelfjs.org/#Bookshelf~transactionCallback */ + +/* Model, see http://bookshelfjs.org/#section-Model */ + +/* Construction, see http://bookshelfjs.org/#Model-subsection-construction */ + +/* new Model(), see http://bookshelfjs.org/#Model */ + +{ + new Book({ + title: "One Thousand and One Nights", + author: "Scheherazade" + }); + + class Book extends bookshelf.Model { + get tableName() { return 'documents'; } + + constructor(json: Object) { + super(json); + + this.on('saving', (model, attrs, options) => { + options.query.where('type', '=', 'book'); + }); + } } } + +/* model.initialize(), see http://bookshelfjs.org/#Model-instance-initialize */ + +/* Static, see http://bookshelfjs.org/#Model-subsection-static */ + +/* Model.collection(), see http://bookshelfjs.org/#Model-static-collection */ + +class Customer extends bookshelf.Model { + get tableName() { return 'customers'; } +} +Customer.collection().fetch().then(collection => { + // ... +}); + +/* Model.count(), see http://bookshelfjs.org/#Model-static-count */ + +/* Model.extend(), see http://bookshelfjs.org/#Model-static-extend */ + +class Account extends bookshelf.Model { + get tableName() { return 'accounts'; } +} +{ + var checkit = require('checkit'); + var bcrypt = Promise.promisifyAll(require('bcrypt')); + + class Customer extends bookshelf.Model { + get tableName() { return 'customers'; } + + initialize() { + this.on('saving', this.validateSave); + } + + validateSave() { + let rules: any; + return checkit(rules).run(this.attributes); + } + + account() { + return this.belongsTo(Account); + } + + static login(email: string, password: string): Promise { + if (!email || !password) throw new Error('Email and password are both required'); + return new this({email: email.toLowerCase().trim()}).fetch({require: true}).tap(customer => { + return bcrypt.compareAsync(password, customer.get('password')) + .then((res: boolean) => { + if (!res) throw new Error('Invalid password'); + }); + }); + } + } + + const email = 'email'; + const password = 'password'; + Customer.login(email, password) + .then(customer => { + console.log(customer.omit('password')); + }).catch(Customer.NotFoundError, () => { + console.log({error: email + ' not found'}); + }).catch(err => { + console.error(err); + }); +} + +/* Model.fetchAll(), see http://bookshelfjs.org/#Model-static-fetchAll */ + +/* Model.forge(), see http://bookshelfjs.org/#Model-static-forge */ + +/* Members, see http://bookshelfjs.org/#Model-subsection-members */ + +/* model.hasTimestamps, see http://bookshelfjs.org/#Model-instance-hasTimestamps */ + +/* model.idAttribute, see http://bookshelfjs.org/#Model-instance-idAttribute */ + +/* model.tableName, see http://bookshelfjs.org/#Model-instance-tableName */ + +class Television extends bookshelf.Model { + get tableName() { return 'televisions'; } +} + +/* Methods, see http://bookshelfjs.org/#Model-subsection-methods */ + +/* model.belongsTo(), see http://bookshelfjs.org/#Model-instance-belongsTo */ + +{ + class Book extends bookshelf.Model { + get tableName() { return 'books'; } + author(): Author { + return this.belongsTo(Author); + } + } + + // select * from `books` where id = 1 + // select * from `authors` where id = book.author_id + new Book().where({id: 1}).fetch({withRelated: ['author']}).then(book => { + console.log(JSON.stringify(book.related('author'))); + }); +} + +/* model.belongsToMany(), see http://bookshelfjs.org/#Model-instance-belongsToMany */ + +{ + class Account extends bookshelf.Model { + get tableName() { return 'accounts'; } + } + + class User extends bookshelf.Model { + get tableName() { return 'users'; } + allAccounts() { + return this.belongsToMany(Account); + } + adminAccounts() { + return this.belongsToMany(Account).query({where: {access: 'admin'}}); + } + viewAccounts() { + return this.belongsToMany(Account).query({where: {access: 'readonly'}}); + } + } + + class Doctor extends bookshelf.Model { + patients(): Bookshelf.Collection { + return this.belongsToMany(Patient).through(Appointment); + } + } + + class Appointment extends bookshelf.Model { + patient(): Patient { + return this.belongsTo(Patient); + } + doctor(): Doctor { + return this.belongsTo(Doctor); + } + } + + class Patient extends bookshelf.Model { + doctors(): Bookshelf.Collection { + return this.belongsToMany(Doctor).through(Appointment); + } + } +} + +/* model.clear(), see http://bookshelfjs.org/#Model-instance-clear */ + +/* model.clone(), see http://bookshelfjs.org/#Model-instance-clone */ + +/* model.count(), see http://bookshelfjs.org/#Model-instance-count */ + +class Duck extends bookshelf.Model { +} +new Duck().where('color', 'blue').count('name') + .then(count => { + //... + }); + +/* model.destroy(), see http://bookshelfjs.org/#Model-instance-destroy */ +new User({id: 1}) + .destroy() + .then(model => { + // ... + }); + +/* model.escape(), see http://bookshelfjs.org/#Model-instance-escape */ + +/* model.fetch(), see http://bookshelfjs.org/#Model-instance-fetch */ + +// select * from `books` where `ISBN-13` = '9780440180296' +new Book({'ISBN-13': '9780440180296'}) + .fetch() + .then(model => { + // outputs 'Slaughterhouse Five' + console.log(model.get('title')); + }); +{ + class Edition extends bookshelf.Model {} + class Chapter extends bookshelf.Model {} + class Genre extends bookshelf.Model {} + + class Book extends bookshelf.Model { + get tableName() { return 'books'; } + editions() { + return this.hasMany(Edition); + } + chapters() { + return this.hasMany(Chapter); + } + genre() { + return this.belongsTo(Genre); + } + } + + new Book({'ISBN-13': '9780440180296'}).fetch({ + withRelated: [ + 'genre', 'editions', + { chapters: query => query.orderBy('chapter_number') } + ] + }).then(book => { + console.log(book.related('genre').toJSON()); + console.log(book.related('editions').toJSON()); + console.log(book.toJSON()); + }); +} + +/* model.fetchAll(), see http://bookshelfjs.org/#Model-instance-fetchAll */ + +/* model.format(), see http://bookshelfjs.org/#Model-instance-format */ + +/* model.get(), see http://bookshelfjs.org/#Model-instance-get */ +const note = new bookshelf.Model(); +note.get("title"); + +/* model.has(), see http://bookshelfjs.org/#Model-instance-has */ + +/* model.hasChanged(), see http://bookshelfjs.org/#Model-instance-hasChanged */ + +/* model.hasMany(), see http://bookshelfjs.org/#Model-instance-hasMany */ + +{ + class Author extends bookshelf.Model { + get tableName() { return 'authors'; } + + books() { + return this.hasMany(Book); + } + } + + // select * from `authors` where id = 1 + // select * from `books` where author_id = 1 + new Author().where({id: 1}).fetch({withRelated: ['books']}).then(author => { + console.log(JSON.stringify(author.related('books'))); + }); +} + +/* model.hasOne(), see http://bookshelfjs.org/#Model-instance-hasOne */ + +{ + class Record extends bookshelf.Model { + get tableName() { return 'health_records'; } + } + + class Patient extends bookshelf.Model { + get tableName() { return 'patients'; } + record(): Record { + return this.hasOne(Record); + } + } + + // select * from `health_records` where `patient_id` = 1; + const record = new Patient({id: 1}).related('record'); + record.fetch().then(model => { + // ... + }); + + // alternatively, if you don't need the relation loaded on the patient's relations hash: + new Patient({id: 1}).record().fetch().then(model => { + // ... + }); +} + +/* model.isNew(), see http://bookshelfjs.org/#Model-instance-isNew */ + +var modelA = new bookshelf.Model(); +modelA.isNew(); // true + +var modelB = new bookshelf.Model({id: 1}); +modelB.isNew(); // false + +/* model.load(), see http://bookshelfjs.org/#Model-instance-load */ +class Posts extends bookshelf.Collection {} +new Posts().fetch().then(collection => { + collection.at(0) + .load(['author', 'content', 'comments.tags']) + .then(model => { + JSON.stringify(model); + }); +}); +/* +{ + title: 'post title', + author: {...}, + content: {...}, + comments: [ + {tags: [...]}, {tags: [...]} + ] +} +*/ + +/* model.morphMany(), see http://bookshelfjs.org/#Model-instance-morphMany */ + +class Photo extends bookshelf.Model {} +{ + class Post extends bookshelf.Model { + get tableName() { return 'posts'; } + photos() { + return this.morphMany(Photo, 'imageable'); + } + } +} +{ + class Post extends bookshelf.Model { + get tableName() { return 'posts'; } + photos() { + return this.morphMany(Photo, 'imageable', ["ImageableType", "ImageableId"]); + } + } +} + +/* model.morphOne(), see http://bookshelfjs.org/#Model-instance-morphOne */ + +{ + class Site extends bookshelf.Model { + get tableName() { return 'sites'; } + photo() { + return this.morphOne(Photo, 'imageable'); + } + } +} +{ + class Site extends bookshelf.Model { + get tableName() { return 'sites'; } + photo() { + return this.morphOne(Photo, 'imageable', ["ImageableType", "ImageableId"]); + } + } +} + +/* model.morphTo(), see http://bookshelfjs.org/#Model-instance-morphTo */ + +class Site extends bookshelf.Model {} +{ + class Photo extends bookshelf.Model { + get tableName() { return 'photos'; } + imageable() { + return this.morphTo('imageable', Site, Post); + } + } +} +{ + class Photo extends bookshelf.Model { + get tableName() { return 'photos'; } + imageable() { + return this.morphTo('imageable', ["ImageableType", "ImageableId"], Site, Post); + } + } +} + +/* model.off(), see http://bookshelfjs.org/#Model-instance-off */ + +const customer = new Customer(); +const ship = new bookshelf.Model(); +customer.off('fetched fetching'); +ship.off(); // This will remove all event listeners + +/* model.on(), see http://bookshelfjs.org/#Model-instance-on */ + +customer.on('fetching', (model, columns) => { + // Do something before the data is fetched from the database +}); + +/* model.once(), see http://bookshelfjs.org/#Model-instance-once */ + +/* model.parse(), see http://bookshelfjs.org/#Model-instance-parse */ + +// Example of a "parse" to convert snake_case to camelCase, using `underscore.string` +customer.parse = attrs => { + return _.reduce(<_.Dictionary> attrs, (memo, val, key) => { + (<_.Dictionary> memo)[_.camelCase(key)] = val; + return memo; + }, {}); +}; + +/* model.previous(), see http://bookshelfjs.org/#Model-instance-previous */ + +/* model.previousAttributes(), see http://bookshelfjs.org/#Model-instance-previousAttributes */ + +/* model.query(), see http://bookshelfjs.org/#Model-instance-query */ + +const model = new bookshelf.Model(); +model + .query('where', 'other_id', '=', '5') + .fetch() + .then(model => { + // ... + }); + +model + .query({where: {other_id: '5'}, orWhere: {key: 'value'}}) + .fetch() + .then(model => { + // ... + }); + +model.query(qb => { + qb.where('other_person', 'LIKE', '%Demo').orWhere('other_id', '>', 10); +}).fetch() + .then(model => { + // ... + }); + +let qb = model.query(); +qb.where({id: 1}).select().then(resp => { + // ... +}); + +/* model.refresh(), see http://bookshelfjs.org/#Model-instance-refresh */ + +/* model.related(), see http://bookshelfjs.org/#Model-instance-related */ +class Trip extends bookshelf.Model {} +class Trips extends bookshelf.Collection {} +new Photo({id: 1}).fetch({ + withRelated: ['account'] +}).then(photo => { + if (photo) { + var account = photo.related('account'); + if (account.id) { + return ( account.related('trips')).fetch(); + } + } +}); + +/* model.resetQuery(), see http://bookshelfjs.org/#Model-instance-resetQuery */ + +/* model.save(), see http://bookshelfjs.org/#Model-instance-save */ + +new Post({name: 'New Article'}).save().then(model => { + // ... +}); +// update authors set "bio" = 'Short user bio' where "id" = 1 +new Author({id: 1, first_name: 'User'}) + .save({bio: 'Short user bio'}, {patch: true}) + .then(model => { + // ... + }); + +// Save with no arguments +bookshelf.Model.forge({id: 5, firstName: "John", lastName: "Smith"}).save().then(() => { + //... +}); + +// Or add attributes during save +bookshelf.Model.forge({id: 5}).save({firstName: "John", lastName: "Smith"}).then(() => { + //... +}); + +// Or, if you prefer, for a single attribute +bookshelf.Model.forge({id: 5}).save('name', 'John Smith').then(() => { + //... +}); + +/* model.serialize(), see http://bookshelfjs.org/#Model-instance-serialize */ + +var artist = new bookshelf.Model({ + firstName: "Wassily", + lastName: "Kandinsky" +}); + +artist.set({birthday: "December 16, 1866"}); + +console.log(JSON.stringify(artist)); +// {firstName: "Wassily", lastName: "Kandinsky", birthday: "December 16, 1866"} + +/* model.set(), see http://bookshelfjs.org/#Model-instance-set */ + +customer.set({first_name: "Joe", last_name: "Customer"}); +customer.set("telephone", "555-555-1212"); + +/* model.through(), see http://bookshelfjs.org/#Model-instance-through */ + +{ + class Book extends bookshelf.Model { + get tableName() { return 'books'; } + + // Find all paragraphs associated with this book, by + // passing through the "Chapter" model. + paragraphs(): Paragraphs { + return this.hasMany(Paragraph).through(Chapter); + } + + chapters(): Chapters { + return this.hasMany(Chapter); + } + } + + class Chapter extends bookshelf.Model { + get tableName() { return 'chapters'; } + + paragraphs(): Bookshelf.Collection { + return this.hasMany(Paragraph); + } + } + + class Chapters extends bookshelf.Collection { + } + + class Paragraph extends bookshelf.Model { + get tableName() { return 'paragraphs'; } + + chapter(): Chapter { + return this.belongsTo(Chapter); + } + + // A reverse relation, where we can get the book from the chapter. + book(): Book { + return this.belongsTo(Book).through(Chapter); + } + } + + class Paragraphs extends bookshelf.Collection { + } +} + +/* model.timestamp(), see http://bookshelfjs.org/#Model-instance-timestamp */ + +/* model.toJSON(), see http://bookshelfjs.org/#Model-instance-toJSON */ + +// TODO No example provided on Bookshelf website + +{ + interface UserJson { + name: string; + } + + class User extends bookshelf.Model { + get tableName() { return 'users'; } + + toJSON(): UserJson { + return super.toJSON(); + } + + fetchAll(): Promise { + return super.fetchAll(); + } + } + + class Users extends bookshelf.Collection { + toJSON(): UserJson[] { + return super.toJSON(); + } + } + + new User({id: 1}).fetch().then(user => { + const userJson = user.toJSON(); + console.log('User name:', userJson.name); + }); + + new User({name: 'John'}).fetchAll().then(users => { + const usersJson = users.toJSON(); + console.log('First user name:', usersJson[0].name); + }); +} + +/* model.trigger(), see http://bookshelfjs.org/#Model-instance-trigger */ + +ship.trigger('fetched'); + +/* model.triggerThen(), see http://bookshelfjs.org/#Model-instance-triggerThen */ + +/* model.unset(), see http://bookshelfjs.org/#Model-instance-unset */ + +/* model.where(), see http://bookshelfjs.org/#Model-instance-where */ + +model.where('favorite_color', '<>', 'green').fetch().then(() => { + //... +}); +// or +model.where('favorite_color', 'red').fetch().then(() => { + //... +}); +// or +model.where({favorite_color: 'red', shoe_size: 12}).fetch().then(() => { + //... +}); + +/* Lodash methods, see http://bookshelfjs.org/#Model-subsection-lodash-methods */ + +/* invert(), see http://lodash.com/docs/#invert */ + +/* keys(), see http://lodash.com/docs/#keys */ + +/* omit(), see http://lodash.com/docs/#omit */ + +/* pairs(), see http://lodash.com/docs/#pairs */ + +/* pick(), see http://lodash.com/docs/#pick */ + +/* values(), see http://lodash.com/docs/#values */ + +/* Events, see http://bookshelfjs.org/#Model-subsection-events */ + +/* model.on("created"), see http://bookshelfjs.org/#Model-event-created */ + +/* model.on("creating"), see http://bookshelfjs.org/#Model-event-creating */ + +/* model.on("destroyed"), see http://bookshelfjs.org/#Model-event-destroyed */ + +/* model.on("destroying"), see http://bookshelfjs.org/#Model-event-destroying */ + +/* model.on("fetched"), see http://bookshelfjs.org/#Model-event-fetched */ + +/* model.on("fetching"), see http://bookshelfjs.org/#Model-event-fetching */ + +/* model.on("saved"), see http://bookshelfjs.org/#Model-event-saved */ + +/* model.on("saving"), see http://bookshelfjs.org/#Model-event-saving */ + +/* model.on("updated"), see http://bookshelfjs.org/#Model-event-updated */ + +/* model.on("updating"), see http://bookshelfjs.org/#Model-event-updating */ + +/* new Model.NoRowsDeletedError(), see http://bookshelfjs.org/#Model-static-NoRowsDeletedError */ + +// TODO No example provided on Bookshelf website + +new User({id: 1}).destroy({require: true}) +.then(user => { + console.log(user.toJSON()); +}) +.catch(User.NoRowsDeletedError, () => { + console.log('User not found'); +}) +.catch(error => { + console.log('Internal error:', error); +}); + +/* new Model.NoRowsUpdatedError(), see http://bookshelfjs.org/#Model-static-NoRowsUpdatedError */ + +// TODO No example provided on Bookshelf website + +new User({id: 1}).save({}, {patch: true, require: true}) +.then(user => { + console.log(user.toJSON()); +}) +.catch(User.NoRowsUpdatedError, () => { + console.log('User not updated'); +}) +.catch(error => { + console.log('Internal error:', error); +}); + +/* new Model.NotFoundError(), see http://bookshelfjs.org/#Model-static-NotFoundError */ + +// TODO No example provided on Bookshelf website + +new User({id: 1}).fetch({require: true}) +.then(user => { + console.log(user.toJSON()); +}) +.catch(User.NotFoundError, () => { + console.log('User not found'); +}) +.catch(error => { + console.log('Internal error:', error); +}); + +/* Collection, see http://bookshelfjs.org/#section-Collection */ + +/* Construction, see http://bookshelfjs.org/#Collection-subsection-construction */ + +/* new Collection(), see http://bookshelfjs.org/#Collection */ + +class Tab extends bookshelf.Model { +} +const tab1 = new Tab(); +const tab2 = new Tab(); +const tab3 = new Tab(); +class TabSet extends bookshelf.Collection { +} +let tabs = new TabSet([tab1, tab2, tab3]); + +/* collection.initialize(), see http://bookshelfjs.org/#Collection-instance-initialize */ + +/* Static, see http://bookshelfjs.org/#Collection-subsection-static */ + +/* Collection.extend(), see http://bookshelfjs.org/#Collection-static-extend */ + +/* Collection.forge(), see http://bookshelfjs.org/#Collection-static-forge */ + +class Accounts extends bookshelf.Collection { + model: Account +} + +var accounts = Accounts.forge([ + {name: 'Person1'}, + {name: 'Person2'} +]); + +Promise.all(accounts.invoke('save')).then(() => { + // collection models should now be saved... +}); + +/* Methods, see http://bookshelfjs.org/#Collection-subsection-methods */ + +/* collection.add(), see http://bookshelfjs.org/#Collection-instance-add */ + +const ships = new bookshelf.Collection; + +ships.add([ + {name: "Flying Dutchman"}, + {name: "Black Pearl"} +]); + +/* collection.at(), see http://bookshelfjs.org/#Collection-instance-at */ + +/* collection.attach(), see http://bookshelfjs.org/#Collection-instance-attach */ + +{ + class Admin extends bookshelf.Model { + } + class Site extends bookshelf.Model { + admins() { + return this.hasMany(Admin); + } + } + var admin1 = new Admin({username: 'user1', password: 'test'}); + var admin2 = new Admin({username: 'user2', password: 'test'}); + + Promise.all([admin1.save(), admin2.save()]) + .then(() => { + return Promise.all([ + new Site({id: 1}).admins().attach([admin1, admin2]), + new Site({id: 2}).admins().attach(admin2) + ]); + }); +} + +/* collection.clone(), see http://bookshelfjs.org/#Collection-instance-clone */ + +/* collection.count(), see http://bookshelfjs.org/#Collection-instance-count */ + +class Shareholder extends bookshelf.Model {} +class Company extends bookshelf.Model { + shareholders() { + return this.hasMany(Shareholder); + } +} + +// select count(*) from shareholders where company_id = 1 and share > 0.1; +Company.forge({id:1}) + .shareholders() + .query('where', 'share', '>', '0.1') + .count() + .then(count => { + assert(count === 3); + }); + +/* collection.create(), see http://bookshelfjs.org/#Collection-instance-create */ + +class Student extends bookshelf.Model {} + +function get(req: express.Request, res: express.Response) { + // FIXME Support proposed ES Rest/Spread properties https://github.com/Microsoft/TypeScript/issues/2103 + //const { courses, ...attributes } = req.body; + const { courses, attributes } = req.body; + + Student.forge(attributes).save().tap(student => + Promise.map(courses, course => (> student.related('courses')).create(course)) + ).then(student => + res.status(200).send(student) + ).catch(error => + res.status(500).send(error.message) + ); +} + +/* collection.detach(), see http://bookshelfjs.org/#Collection-instance-detach */ + +/* collection.fetch(), see http://bookshelfjs.org/#Collection-instance-fetch */ + +/* collection.fetchOne(), see http://bookshelfjs.org/#Collection-instance-fetchOne */ + +{ + class Site extends bookshelf.Model { + authors() { + return this.hasMany(Author); + } + } + + // select * from authors where site_id = 1 and id = 2 limit 1; + new Site({id: 1}) + .authors() + .query({where: {id: 2}}) + .fetchOne() + .then(model => { + // ... + }); +} + +/* collection.findWhere(), see http://bookshelfjs.org/#Collection-instance-findWhere */ + +/* collection.get(), see http://bookshelfjs.org/#Collection-instance-get */ + +const library = new bookshelf.Collection(); +const book = library.get(110); + +/* collection.invokeThen(), see http://bookshelfjs.org/#Collection-instance-invokeThen */ + +const options = {}; +const collection = new bookshelf.Collection(); +collection.invokeThen('save', null, options).then(() => { + // ... all models in the collection have been saved +}); + +collection.invokeThen('destroy', options).then(() => { + // ... all models in the collection have been destroyed +}); + +/* collection.load(), see http://bookshelfjs.org/#Collection-instance-load */ + +/* collection.off(), see http://bookshelfjs.org/#Collection-instance-off */ + +ships.off('fetched') // Remove the 'fetched' event listener + +/* collection.on(), see http://bookshelfjs.org/#Collection-instance-on */ + +ships.on('fetched', (collection, response) => { + // Do something after the data has been fetched from the database +}) + +/* collection.once(), see http://bookshelfjs.org/#Collection-instance-once */ + +/* collection.parse(), see http://bookshelfjs.org/#Collection-instance-parse */ + +/* collection.pluck(), see http://bookshelfjs.org/#Collection-instance-pluck */ + +/* collection.pop(), see http://bookshelfjs.org/#Collection-instance-pop */ + +/* collection.push(), see http://bookshelfjs.org/#Collection-instance-push */ + +/* collection.query(), see http://bookshelfjs.org/#Collection-instance-query */ + +{ + let qb = collection.query(); + qb.where({id: 1}).select().then(resp => { + // ... + }); + + collection.query(qb => { + qb.where('id', '>', 5).andWhere('first_name', '=', 'Test'); + }).fetch() + .then(collection => { + // ... + }); + + collection + .query('where', 'other_id', '=', '5') + .fetch() + .then(collection => { + // ... + }); +} + +/* collection.reduceThen(), see http://bookshelfjs.org/#Collection-instance-reduceThen */ + +/* collection.remove(), see http://bookshelfjs.org/#Collection-instance-remove */ + +/* collection.reset(), see http://bookshelfjs.org/#Collection-instance-reset */ + +/* collection.resetQuery(), see http://bookshelfjs.org/#Collection-instance-resetQuery */ + +/* collection.serialize(), see http://bookshelfjs.org/#Collection-instance-serialize */ + +/* collection.set(), see http://bookshelfjs.org/#Collection-instance-set */ + +class BandMember extends bookshelf.Model {} +const eddie = new BandMember(); +const alex = new BandMember(); +const stone = new BandMember(); +const roth = new BandMember(); +const hagar = new BandMember(); +var vanHalen = new bookshelf.Collection([eddie, alex, stone, roth]); +vanHalen.set([eddie, alex, stone, hagar]); + +/* collection.shift(), see http://bookshelfjs.org/#Collection-instance-shift */ + +/* collection.slice(), see http://bookshelfjs.org/#Collection-instance-slice */ + +/* collection.through(), see http://bookshelfjs.org/#Collection-instance-through */ + +/* collection.toJSON(), see http://bookshelfjs.org/#Collection-instance-toJSON */ + +/* collection.trigger(), see http://bookshelfjs.org/#Collection-instance-trigger */ + +ships.trigger('fetched'); + +/* collection.triggerThen(), see http://bookshelfjs.org/#Collection-instance-triggerThen */ + +/* collection.unshift(), see http://bookshelfjs.org/#Collection-instance-unshift */ + +/* collection.updatePivot(), see http://bookshelfjs.org/#Collection-instance-updatePivot */ + +/* collection.where(), see http://bookshelfjs.org/#Collection-instance-where */ + +/* collection.withPivot(), see http://bookshelfjs.org/#Collection-instance-withPivot */ + +{ + class Comment extends bookshelf.Model {} + class Tag extends bookshelf.Model { + comments() { + return this.belongsToMany(Comment).withPivot(['created_at', 'order']); + } + } +} + +/* Lodash methods, see http://bookshelfjs.org/#Collection-subsection-lodash-methods */ + +/* all(), see http://lodash.com/docs/#all */ + +/* any(), see http://lodash.com/docs/#any */ + +/* chain(), see http://lodash.com/docs/#chain */ + +/* collect(), see http://lodash.com/docs/#collect */ + +/* contains(), see http://lodash.com/docs/#contains */ + +/* countBy(), see http://lodash.com/docs/#countBy */ + +/* detect(), see http://lodash.com/docs/#detect */ + +/* difference(), see http://lodash.com/docs/#difference */ + +/* drop(), see http://lodash.com/docs/#drop */ + +/* each(), see http://lodash.com/docs/#each */ + +/* every(), see http://lodash.com/docs/#every */ + +/* filter(), see http://lodash.com/docs/#filter */ + +/* find(), see http://lodash.com/docs/#find */ + +/* first(), see http://lodash.com/docs/#first */ + +/* foldl(), see http://lodash.com/docs/#foldl */ + +/* foldr(), see http://lodash.com/docs/#foldr */ + +/* forEach(), see http://lodash.com/docs/#forEach */ + +/* groupBy(), see http://lodash.com/docs/#groupBy */ + +/* head(), see http://lodash.com/docs/#head */ + +/* include(), see http://lodash.com/docs/#include */ + +/* indexOf(), see http://lodash.com/docs/#indexOf */ + +/* initial(), see http://lodash.com/docs/#initial */ + +/* inject(), see http://lodash.com/docs/#inject */ + +/* invoke(), see http://lodash.com/docs/#invoke */ + +/* isEmpty(), see http://lodash.com/docs/#isEmpty */ + +/* last(), see http://lodash.com/docs/#last */ + +/* lastIndexOf(), see http://lodash.com/docs/#lastIndexOf */ + +/* map(), see http://lodash.com/docs/#map */ + +// TODO No example provided on Bookshelf website + +{ + class Author extends bookshelf.Model { + get tableName() { return 'author'; } + books() { + return this.belongsToMany(Book); + } + relatedBooks() { + return > this.related('books'); + } + } + new Author({id: 1}).fetch({require: true, withRelated: ['books']}) + .then(author => { + const books = author.relatedBooks(); + const booksJson = books.map(book => book.toJSON()); + }); + + class AuthorOutput { + constructor(bookJson: Object) {} + } + + new Author({id: 1}).fetch({require: true, withRelated: ['books']}) + .then(author => { + const books = author.relatedBooks(); + const booksOutput = books.map(book => new AuthorOutput(book.toJSON())); + }); +} + +/* max(), see http://lodash.com/docs/#max */ + +/* min(), see http://lodash.com/docs/#min */ + +/* reduce(), see http://lodash.com/docs/#reduce */ + +/* reduceRight(), see http://lodash.com/docs/#reduceRight */ + +/* reject(), see http://lodash.com/docs/#reject */ + +/* rest(), see http://lodash.com/docs/#rest */ + +/* select(), see http://lodash.com/docs/#select */ + +/* shuffle(), see http://lodash.com/docs/#shuffle */ + +/* size(), see http://lodash.com/docs/#size */ + +/* some(), see http://lodash.com/docs/#some */ + +/* sortBy(), see http://lodash.com/docs/#sortBy */ + +/* tail(), see http://lodash.com/docs/#tail */ + +/* take(), see http://lodash.com/docs/#take */ + +/* toArray(), see http://lodash.com/docs/#toArray */ + +/* without(), see http://lodash.com/docs/#without */ + +/* Events, see http://bookshelfjs.org/#Collection-subsection-events */ + +/* collection.on("fetched"), see http://bookshelfjs.org/#Collection-event-fetched */ + +/* new Collection.EmptyError(), see http://bookshelfjs.org/#Collection-static-EmptyError */ + +// TODO No example provided on Bookshelf website + +class Users extends bookshelf.Collection { +} +new User({name: 'John'}).fetchAll({require: true}) +.then(users => { + console.log(users.toJSON()); +}) +.catch(Users.EmptyError, () => { + console.log('No user found'); +}) +.catch(error => { + console.log('Internal error:', error); +}); + +/* Events, see http://bookshelfjs.org/#section-Events */ + +/* new Events(), see http://bookshelfjs.org/#Events */ + +/* events.off(), see http://bookshelfjs.org/#Events-instance-off */ + +/* events.on(), see http://bookshelfjs.org/#Events-instance-on */ + +/* events.once(), see http://bookshelfjs.org/#Events-instance-once */ + +/* events.trigger(), see http://bookshelfjs.org/#Events-instance-trigger */ + +/* events.triggerThen(), see http://bookshelfjs.org/#Events-instance-triggerThen */ diff --git a/bookshelf/bookshelf.d.ts b/bookshelf/bookshelf.d.ts index cf70220840..0ca3a1ebcd 100644 --- a/bookshelf/bookshelf.d.ts +++ b/bookshelf/bookshelf.d.ts @@ -6,23 +6,25 @@ /// /// /// +/// declare module 'bookshelf' { - import knex = require('knex'); - import Promise = require('bluebird'); - import Lodash = require('lodash'); + import * as Knex from 'knex'; + import * as Promise from 'bluebird'; + import * as Lodash from 'lodash'; + import * as createError from 'create-error'; interface Bookshelf extends Bookshelf.Events { VERSION : string; - knex : knex; + knex : Knex; Model : typeof Bookshelf.Model; Collection : typeof Bookshelf.Collection; plugin(name: string | string[] | Function, options?: any) : Bookshelf; - transaction(callback : (transaction : knex.Transaction) => T) : Promise; + transaction(callback : (transaction : Knex.Transaction) => T) : T; } - function Bookshelf(knex : knex) : Bookshelf; + function Bookshelf(knex : Knex) : Bookshelf; namespace Bookshelf { abstract class Events { @@ -44,6 +46,13 @@ declare module 'bookshelf' { /** If overriding, must use a getter instead of a plain property. */ idAttribute : string; + // See https://github.com/tgriesser/bookshelf/blob/0.9.4/src/base/model.js#L178 + // See https://github.com/tgriesser/bookshelf/blob/0.9.4/src/base/model.js#L213 + id : any; + + // See https://github.com/tgriesser/bookshelf/blob/0.9.4/src/base/model.js#L28 + attributes : any; + constructor(attributes? : any, options? : ModelOptions); clear() : T; @@ -54,7 +63,7 @@ declare module 'bookshelf' { has(attribute : string) : boolean; hasChanged(attribute? : string) : boolean; isNew() : boolean; - parse(response : any) : any; + parse(response : Object) : Object; previousAttributes() : any; previous(attribute : string) : any; related>(relation : string) : R | Collection; @@ -88,7 +97,7 @@ declare module 'bookshelf' { belongsTo>(target : {new(...args : any[]) : R}, foreignKey? : string) : R; belongsToMany>(target : {new(...args : any[]) : R}, table? : string, foreignKey? : string, otherKey? : string) : Collection; count(column? : string, options? : SyncOptions) : Promise; - destroy(options? : SyncOptions) : Promise; + destroy(options? : DestroyOptions) : Promise; fetch(options? : FetchOptions) : Promise; fetchAll(options? : FetchAllOptions) : Promise>; hasMany>(target : {new(...args : any[]) : R}, foreignKey? : string) : Collection; @@ -98,20 +107,35 @@ declare module 'bookshelf' { morphOne>(target : {new(...args : any[]) : R}, name? : string, columnNames? : string[], morphValue? : string) : R; morphTo(name : string, columnNames? : string[], ...target : typeof Model[]) : T; morphTo(name : string, ...target : typeof Model[]) : T; + + // Declaration order matters otherwise TypeScript gets confused between query() and query(...query: string[]) + query() : Knex.QueryBuilder; + query(callback : (qb : Knex.QueryBuilder) => void) : T; query(...query : string[]) : T; query(query : {[key : string] : any}) : T; - query(callback : (qb : knex.QueryBuilder) => void) : T; - query() : knex.QueryBuilder; + refresh(options? : FetchOptions) : Promise; resetQuery() : T; - save(key? : string, val? : string, options? : SaveOptions) : Promise; + save(key? : string, val? : any, options? : SaveOptions) : Promise; save(attrs? : {[key : string] : any}, options? : SaveOptions) : Promise; - through>(interim : typeof Model, throughForeignKey? : string, otherKey? : string) : R | Collection; + through>(interim : typeof Model, throughForeignKey? : string, otherKey? : string) : R; where(properties : {[key : string] : any}) : T; where(key : string, operatorOrValue : string|number|boolean, valueIfOperator? : string|number|boolean) : T; + + // See https://github.com/tgriesser/bookshelf/blob/0.9.4/src/errors.js + // See https://github.com/tgriesser/bookshelf/blob/0.9.4/src/model.js#L1280 + static NotFoundError: createError.Error; + static NoRowsUpdatedError: createError.Error; + static NoRowsDeletedError: createError.Error; } abstract class CollectionBase> extends Events { + // See https://github.com/tgriesser/bookshelf/blob/0.9.4/src/base/collection.js#L573 + length : number; + + // See https://github.com/tgriesser/bookshelf/blob/0.9.4/src/base/collection.js#L21 + constructor(models? : T[], options? : CollectionOptions); + add(models : T[]|{[key : string] : any}[], options? : CollectionAddOptions) : Collection; at(index : number) : T; clone() : Collection; @@ -127,11 +151,11 @@ declare module 'bookshelf' { remove(model : T, options? : EventOptions) : T; remove(model : T[], options? : EventOptions) : T[]; reset(model : any[], options? : CollectionAddOptions) : T[]; - serialize(options? : SerializeOptions) : any; + serialize(options? : SerializeOptions) : any[]; set(models : T[]|{[key : string] : any}[], options? : CollectionSetOptions) : Collection; shift(options? : EventOptions) : void; slice(begin? : number, end? : number) : void; - toJSON(options? : SerializeOptions) : any; + toJSON(options? : SerializeOptions) : any[]; unshift(model : any, options? : CollectionAddOptions) : void; where(match : {[key : string] : any}, firstOnly : boolean) : T|Collection; @@ -177,8 +201,13 @@ declare module 'bookshelf' { keys() : string[]; last() : T; lastIndexOf(value : any, fromIndex? : number) : number; - map(predicate? : Lodash.ListIterator|Lodash.DictionaryIterator|string, thisArg? : any) : T[]; - map(predicate? : R) : T[]; + + // See https://github.com/DefinitelyTyped/DefinitelyTyped/blob/1ec3d51/lodash/lodash-3.10.d.ts#L7119 + // See https://github.com/Microsoft/TypeScript/blob/v1.8.10/lib/lib.core.es7.d.ts#L1122 + map(predicate? : Lodash.ListIterator|string, thisArg? : any) : U[]; + map(predicate? : Lodash.DictionaryIterator|string, thisArg? : any) : U[]; + map(predicate? : string) : U[]; + max(predicate? : Lodash.ListIterator|string, thisArg? : any) : T; max(predicate? : R) : T; min(predicate? : Lodash.ListIterator|string, thisArg? : any) : T; @@ -208,20 +237,27 @@ declare module 'bookshelf' { /** @deprecated should use `new` objects instead. */ static forge(attributes? : any, options? : ModelOptions) : T; - attach(ids : any[], options? : SyncOptions) : Promise>; + attach(ids : any|any[], options? : SyncOptions) : Promise>; count(column? : string, options? : SyncOptions) : Promise; create(model : {[key : string] : any}, options? : CollectionCreateOptions) : Promise; detach(ids : any[], options? : SyncOptions) : Promise; + detach(options? : SyncOptions) : Promise; fetchOne(options? : CollectionFetchOneOptions) : Promise; load(relations : string|string[], options? : SyncOptions) : Promise>; + + // Declaration order matters otherwise TypeScript gets confused between query() and query(...query: string[]) + query() : Knex.QueryBuilder; + query(callback : (qb : Knex.QueryBuilder) => void) : Collection; query(...query : string[]) : Collection; query(query : {[key : string] : any}) : Collection; - query(callback : (qb : knex.QueryBuilder) => void) : Collection; - query() : knex.QueryBuilder; + resetQuery() : Collection; - through>(interim : typeof Model, throughForeignKey? : string, otherKey? : string) : R | Collection; + through>(interim : typeof Model, throughForeignKey? : string, otherKey? : string) : Collection; updatePivot(attributes : any, options? : PivotOptions) : Promise; withPivot(columns : string[]) : Collection; + + // See https://github.com/tgriesser/bookshelf/blob/0.9.4/src/collection.js#L389 + static EmptyError: createError.Error; } interface ModelOptions { @@ -231,13 +267,17 @@ declare module 'bookshelf' { } interface LoadOptions extends SyncOptions { - withRelated: string|any|any[]; + withRelated : (string|WithRelatedQuery)[]; } interface FetchOptions extends SyncOptions { require? : boolean; columns? : string|string[]; - withRelated? : string|any|any[]; + withRelated? : (string|WithRelatedQuery)[]; + } + + interface WithRelatedQuery { + [index : string] : (query : Knex.QueryBuilder) => Knex.QueryBuilder; } interface FetchAllOptions extends SyncOptions { @@ -251,6 +291,10 @@ declare module 'bookshelf' { require? : boolean; } + interface DestroyOptions extends SyncOptions { + require? : boolean; + } + interface SerializeOptions { shallow? : boolean; omitPivot? : boolean; @@ -265,7 +309,7 @@ declare module 'bookshelf' { } interface SyncOptions { - transacting? : knex.Transaction; + transacting? : Knex.Transaction; debug? : boolean; } diff --git a/boom/boom.d.ts b/boom/boom.d.ts index 85c2e22b35..7495e3ae68 100644 --- a/boom/boom.d.ts +++ b/boom/boom.d.ts @@ -44,14 +44,17 @@ declare namespace Boom { export function rangeNotSatisfiable(message?: string, data?: any): BoomError; export function expectationFailed(message?: string, data?: any): BoomError; export function badData(message?: string, data?: any): BoomError; + export function locked(message?: string, data?: any): BoomError; + export function preconditionRequired(message?: string, data?: any): BoomError; export function tooManyRequests(message?: string, data?: any): BoomError; + export function illegal(message?: string, data?: any): BoomError; // 5xx + export function badImplementation(message?: string, data?: any): BoomError; export function notImplemented(message?: string, data?: any): BoomError; export function badGateway(message?: string, data?: any): BoomError; - export function serverTimeout(message?: string, data?: any): BoomError; + export function serverUnavailable(message?: string, data?: any): BoomError; export function gatewayTimeout(message?: string, data?: any): BoomError; - export function badImplementation(message?: string, data?: any): BoomError; } declare module "boom" { diff --git a/bootstrap.datepicker/bootstrap.datepicker-tests.ts b/bootstrap-datepicker/bootstrap-datepicker-tests.ts similarity index 98% rename from bootstrap.datepicker/bootstrap.datepicker-tests.ts rename to bootstrap-datepicker/bootstrap-datepicker-tests.ts index b275ee25a8..d290a5b8fa 100644 --- a/bootstrap.datepicker/bootstrap.datepicker-tests.ts +++ b/bootstrap-datepicker/bootstrap-datepicker-tests.ts @@ -1,4 +1,4 @@ -/// +/// function tests_simple() { $('#datepicker').datepicker(); diff --git a/bootstrap.datepicker/bootstrap.datepicker.d.ts b/bootstrap-datepicker/bootstrap-datepicker.d.ts similarity index 87% rename from bootstrap.datepicker/bootstrap.datepicker.d.ts rename to bootstrap-datepicker/bootstrap-datepicker.d.ts index 0633db5358..1a2bb2124b 100644 --- a/bootstrap.datepicker/bootstrap.datepicker.d.ts +++ b/bootstrap-datepicker/bootstrap-datepicker.d.ts @@ -1,4 +1,4 @@ -// Type definitions for bootstrap.datepicker +// Type definitions for bootstrap-datepicker // Project: https://github.com/eternicode/bootstrap-datepicker // Definitions by: Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -15,7 +15,7 @@ * http://bootstrap-datepicker.readthedocs.org/en/release/options.html */ interface DatepickerOptions { - format?: string; + format?: string | DatepickerCustomFormatOptions; weekStart?: number; startDate?: any; endDate?: any; @@ -35,6 +35,12 @@ interface DatepickerOptions { multidate?: any; multidateSeparator?: string; orientation?: string; + assumeNearbyYear?: any; +} + +interface DatepickerCustomFormatOptions { + toDisplay?(date: string, format: any, language: any): string; + toValue?(date: string, format: any, language: any): Date; } interface DatepickerEventObject extends JQueryEventObject { diff --git a/bootstrap-fileinput/bootstrap-fileinput.d.ts b/bootstrap-fileinput/bootstrap-fileinput.d.ts new file mode 100644 index 0000000000..fadfadd612 --- /dev/null +++ b/bootstrap-fileinput/bootstrap-fileinput.d.ts @@ -0,0 +1,1039 @@ +// Type definitions for bootstrap-fileinput +// Project: https://github.com/kartik-v/bootstrap-fileinput +// Definitions by: Ché Coxshall +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +interface JQuery { + fileinput: (options?: BootstrapFileInput.FileInputOptions) => JQuery; +} + + +declare module BootstrapFileInput { + interface FileInputOptions { + /** + Language configuration for the plugin to enable the plugin to display messages for your locale (you must set the ISO code for the language). + You can have multiple language widgets on the same page. + The locale JS file for the language code must be defined as mentioned in the translations section: http://plugins.krajee.com/file-input#translations + */ + language?: string; + /** + Whether to display the file caption. + Defaults to true. + */ + showCaption?: boolean; + /** + Whether to display the file preview. + Defaults to true. + */ + showPreview?: boolean; + /** + Whether to display the file remove/clear button. + Defaults to true. + */ + showRemove?: boolean; + /** + Whether to display the file upload button. + Defaults to true. + This will default to a form submit button, unless the uploadUrl is specified. + */ + showUpload?: boolean; + /** + Whether to display the file upload cancel button. + Defaults to true. + This will be only enabled and displayed when an AJAX upload is in process. + */ + showCancel?: boolean; + /** + Whether to display the close icon in the preview. + Defaults to true. + This will be only parsed when showPreview is true or when you are using the {close} tag in your preview templates. + */ + showClose?: boolean; + /** + Whether to persist display of the uploaded file thumbnails in the preview window (for ajax uploads) until the remove/clear button is pressed. + Defaults to true. + When set to false, a next batch of files selected for upload will clear these thumbnails from preview. + */ + showUploadedThumbs?: boolean; + /** + Whether to automatically replace the files in the preview after the maxFileCount limit is reached and a new set of file(s) is/are selected. + This will only work if a valid maxFileCount is set. + Defaults to false. + */ + autoReplace?: boolean; + /** + Any additional CSS class to append to the caption container. + */ + captionClass?: string; + /** + Any additional CSS class to append to the preview container. + */ + previewClass?: string; + /** + Any additional CSS class to append to the main plugin container. + */ + mainClass?: string; + /** + The initial preview content to be displayed. + You can pass the minimal HTML markup for displaying your image, text, or file. + If set as a string, this will display a single file in the initial preview if there is no delimiter. You can set a delimiter (as defined in initialDelimiter) to show multiple files in initial preview. + If set as an array, it will display all files in the array as an initial preview (useful for multiple file upload scenarios). + The following CSS classes will need to be added for displaying each file type as per the plugin style theme: + image files: Include CSS class file-preview-image + text files: Include CSS class file-preview-text + other files: Include CSS class file-preview-other + */ + initialPreview?: string | any[]; + /** + the count of initial preview items that will be added to the count of files selected in preview. This is applicable when displaying the right caption, when overwriteInitial is set to false. + */ + initialPreviewCount?: number; + /** + the delimiter to be used for splitting the initial preview content as individual file thumbnails (applicable only if initialPreview is passed as a string instead of array). Defaults to *$$*. + */ + initialPreviewDelimiter?: string; + /** + the configuration for setting up important properties for each initialPreview item (that is setup as part of initialPreview). + */ + initialPreviewConfig?: PreviewConfig[]; + /** + whether the delete button will be displayed for each thumbnail that has been created with initialPreview. + */ + initialPreviewShowDelete?: boolean; + /** + whether the file thumbnail should be removed from preview on error. Defaults to false. + */ + removeFromPreviewOnError?: boolean; + /** + this will be a list of tags used in thumbnail templates that will be replaced dynamically within the thumbnail markup, when the thumbnail is rendered. + */ + previewThumbTags?: { [key: string]: string; } + /** + this is an extension of previewThumbTags specifically for initial preview content - but will be configured as an array of objects corresponding to each initial preview thumbnail. The initial preview thumbnails set via initialPreview will read this configuration for replacing tags. + */ + initialPreviewThumbTags?: { [key: string]: string; } + /** + the extra data that will be passed as data to the initial preview delete url/AJAX server call via POST. + This will be overridden by the initialPreviewConfig['extra'] property. + This property is only applicable for ajax deletions in initial preview and when you have set a value for initialPreviewConfig['url'] or deleteUrl. + This can be setup either as an object (associative array of keys and values) or as a function callback. + Note + The ajax delete action will send the following data to server via POST: + key: the key setting as setup in initialPreviewConfig['key'] + any other extra data passed as key: value pairs either via initialPreviewConfig['extra'] OR deleteExtraData if former is not set. + */ + deleteExtraData?: {} | { (): {} }; + /** + the URL for deleting the image/content in the initial preview via AJAX post response. This will be overridden by the initialPreviewConfig['url'] property. + Note + The ajax delete action will send the following data to server via POST: + key: the key setting as setup in initialPreviewConfig['key'] + any other extra data passed as key: value pairs either via initialPreviewConfig['extra'] OR deleteExtraData if former is not set. + */ + deleteUrl?: string; + /** + the initial preview caption text to be displayed. + If you do not set a value here and initialPreview is set to true this will default to "{preview-file-count} files selected", where {preview-file-count} is the count of the files passed in initialPreview. + */ + initialCaption?: string; + /** + whether you wish to overwrite the initial preview content and caption setup. + This defaults to true, whereby, any initialPreview content set will be overwritten, when new file is uploaded or when files are cleared. + Setting it to false will help displaying a saved image or file from database always - useful especially when using the multiple file upload feature. + */ + overwriteInitial?: boolean; + /** + the templates configuration for rendering each part of the layout. + */ + layoutTemplates?: LayoutTemplates; + /** + the templates configuration for rendering each preview file type. + */ + previewTemplates?: PreviewTemplates; + /** + the list of allowed file types for upload. + This by default is set to null which means the plugin supports all file types for upload. + If an invalid file type is found, then a validation error message as set in msgInvalidFileType will be raised. + Note: + You need to be careful in case you are setting both allowedFileTypes and allowedFileExtensions. In this case, the allowedFileTypes property is validated first and generally precedes the allowedFileExtensions setting (and the latter validation maybe skipped). + */ + allowedFileTypes?: ("image" | "html" | "text" | "video" | "audio" | "flash" | "object")[]; + /** + the list of allowed file extensions for upload. + This by default is set to null which means the plugin supports all file extensions for upload. + If an invalid file extension is found, then a validation error message as set in msgInvalidFileExtension will be raised. + Note: + You need to be careful in case you are setting both allowedFileTypes and allowedFileExtensions. In this case, the allowedFileTypes property is validated first and generally precedes the allowedFileExtensions setting (and the latter validation maybe skipped). + */ + allowedFileExtensions?: string[]; + /** + the list of allowed preview types for your widget. + This by default supports all file types for preview. + The plugin by default treats each file as an object if it does not match any of the previous types. + To disable this behavior, you can remove object from the list of allowedPreviewTypes OR fine tune it through allowedPreviewMimeTypes. + To disable content preview for all file-types and show the previewIcon instead as a thumbnail, set this to null, empty, or false. + */ + allowedPreviewTypes?: ("image" | "html" | "text" | "video" | "audio" | "flash" | "object")[]; + /** + the list of allowed mime types for preview. + This is set to null by default which means all possible mime types are allowed. + This setting works in combination with allowedPreviewTypes to filter only the needed file types allowed for preview. + */ + allowedPreviewMimeTypes?: string[]; + /** + the default content / markup to show by default in the preview window whenever the files are cleared or the input is cleared. + This can be useful for use cases like showing the default user profile picture or profile image before upload to overwrite. + This is a bit different from initialPreview in the sense, that the initialPreview content will always be displayed unless it is deleted or overwritten based on overwriteInitial. + The defaultPreviewContent on the other hand will only be shown ONLY on initialization OR whenever you clear the preview. + At other times when files have been selected this will be overwritten temporarily until file(s) selected is/are cleared. + This property can be useful to display for example a default user profile picture (or saved picture) in the preview window unless the user selects a picture. + */ + defaultPreviewContent?: string; + /** + the list of additional custom tags that will be replaced in the layout templates. + */ + customLayoutTags?: {}; + /** + the list of additional custom tags that will be replaced in the preview templates. + */ + customPreviewTags?: {}; + /** + the format settings (width and height) for rendering each preview file type. + */ + previewSettings?: PreviewSettings; + /** + the settings to validate and identify each file type when a file is selected for upload. + This is a list of callbacks, which accepts the file mime type and file name as a parameter. + */ + fileTypeSettings?: FileTypeSettings; + /** + the icon to be shown in each preview file thumbnail when an unreadable file type for preview is detected. Defaults to  . + */ + previewFileIcon?: string; + /** + the CSS class to be applied to the preview file icon container. Defaults to file-icon-4x. + */ + previewFileIconClass?: string; + /** + the preview icon markup settings for each file extension (type). + You need to set this as key: value pairs, where the key corresponds to a file extension (e.g. doc, docx, xls etc.), and the value corresponds to the markup of the icon to be rendered. + If this is not set OR a file extension is not set here, the preview will default to previewFileIcon. + Note that displaying the icons instead of file content is controlled via allowedPreviewTypes and allowedPreviewMimeTypes + */ + previewFileIconSettings?: PreviewFileIconSettings; + /** + the extensions to be auto derived for each file extension (type). + This is useful if you want to set the same icon for multiple file extension types. + You need to set this as `key: value` pairs, where the key corresponds to a file extension as set in previewFileIconSettings (e.g. doc, docx, xls etc.). + The value will be a function callback that accepts the following parameter: + ext: string, the file extension (without the . [dot]) of the file currently selected in the preview. + You can configure the callback to match the set of file extensions (via regex or similar) for each `key` and return a boolean output if the file extension matches. + */ + previewFileExtSettings?: PreviewFileExtSettings; + /** + the CSS class for the each of the button labels for browse, remove, upload, and cancel. + Defaults to hidden-xs, which automatically hides the button labels for small screen devices and renders as smaller iconic buttons to fit to the screen. + */ + buttonLabelClass?: string; + /** + the label to display for the file picker/browse button. Defaults to Browse …. + */ + browseLabel?: string; + /** + the icon to display before the label for the file picker/browse button. Defaults to  . + */ + browseIcon?: string; + /** + the CSS class for the file picker/browse button. Defaults to btn btn-primary. + */ + browseClass?: string; + /** + the label to display for the file remove button. Defaults to Remove. + */ + removeLabel?: string; + /** + the icon to display before the label for the file picker/remove button. Defaults to  . + */ + removeIcon?: string; + /** + the CSS class for the file remove button. Defaults to btn btn-default. + */ + removeClass?: string; + /** + the title to display on hover for the file remove button. Defaults to Clear selected files. + */ + removeTitle?: string; + /** + the label to display for the file upload button. Defaults to Upload. + */ + uploadLabel?: string; + /** + the icon to display before the label for the file upload button. Defaults to  . + */ + uploadIcon?: string; + /** + the CSS class for the file upload button. Defaults to btn btn-default. + */ + uploadClass?: string; + /** + the title to display on hover for the file remove button. + Defaults to Upload selected files. + */ + uploadTitle?: string; + /** + the URL for the upload processing action (typically for ajax based processing). + Defaults to null. + If this is not set or null, then the upload button action will default to form submission. + NOTE: + This is MANDATORY if you want to use advanced features like drag & drop, append/remove files, selectively upload files via ajax etc. + The plugin automatically send $_FILES data to the server with the input `name` attribute as the key if provided. + If input name is not set, the key defaults to file-data. + */ + uploadUrl?: string; + /** + whether the batch upload of multiple files will be asynchronous/in parallel. + Defaults to true. + */ + uploadAsync?: boolean; + /** + the extra data that will be passed as data to the url/AJAX server call via POST. + This property is only applicable for ajax uploads and when you have set a value for uploadUrl. + This can be setup either as an object (associative array of keys and values) or as a function callback. + As an object, it can be set for example as: + { id: 100, value: '100 Details' } + Note that for uploading individual file via thumbnail, the function callback can also receive the thumbnail previewId and index as parameters. These are described below: + previewId: the identifier for the preview file container (only available when uploading each thumbnail file) + index: the zero-based sequential index of the loaded file in the preview list (only available when uploading each thumbnail file) + */ + uploadExtraData?: {} | ((previewId?: string, index?: number) => {}); + /** + the minimum allowed image height in px if you are uploading image files. + Defaults to null which means no limit on image height. + */ + minImageHeight?: number; + /** + the maximum allowed image width in px if you are uploading image files. + Defaults to null which means no limit on image width. + Note that if you set resizeImage property to true, then the entire image will be resized within this width (depending on resizePreference). + */ + maxImageWidth?: number; + /** + the maximum allowed image height in px if you are uploading image files. + Defaults to null which means no limit on image height. + Note that if you set resizeImage property to true, then the entire image will be resized within this height (depending on resizePreference). + */ + maxImageHeight?: number; + /** + whether to add ability to resize uploaded images. Defaults to false. + Note that resizing images requires HTML5 canvas support which is supported on most modern browsers. + In addition, you must include the JavaScript-Canvas-to-Blob plugin by blueimp by including canvas-to-blob.js in your application. + This JS file must be loaded before fileinput.js on the page. + The JavaScript-Canvas-to-Blob source files are available in js/plugins folder of bootstrap-fileinput project page. + The canvas-to-blob.js plugin is a polyfill for canvas.toBlob method and is needed for allowing the resized image files via HTML5 canvas to be returned as a blob + */ + resizeImage?: boolean; + /** + preference to resize the image based on width or height. + Defaults to width. + This property is parsed only when resizeImage is true. + If set to width, the maxImageWidth property is first tested and if image size is greater than this, then the image is resized to maxImageWidth. + The image height is resized and adjusted in the same ratio as width. + In case, the image width is already less than maxImageWidth then the maxImageHeight property is used to resize and width is adjusted in same ratio. + This will behave conversely, when resizePreference is set to height - the maxImageHeight will be first tested against image height and then the rest of steps will be similarly parsed with preference given to height instead of width as before. + */ + resizePreference?: "width" | "height"; + /** + the quality of the resized image. This must be a decimal number between 0.00 to 1.00. + Defaults to 0.92. + */ + resizeImageQuality?: number; + /** + the default image mime type of the converted image after resize. + Defaults to image/jpeg. + */ + resizeDefaultImageType?: string; + /** + the maximum file size for upload in KB. + If set to 0, it means size allowed is unlimited. + Defaults to 0. + */ + maxFileSize?: number; + /** + the minimum number of files allowed for each multiple upload. + If set to 0, it means number of files are optional. + Defaults to 0. + */ + minFileCount?: number; + /** + the maximum number of files allowed for each multiple upload. + If set to 0, it means number of files allowed is unlimited. + Defaults to 0. + */ + maxFileCount?: number; + /** + whether to include initial preview file count (server uploaded files) in validating minFileCount and maxFileCount. + Defaults to false. + */ + validateInitialCount?: boolean; + /** + the message that will be displayed when ZERO files are found. + Defaults to No. + */ + msgNo?: string; + /** + the message that will be displayed within the progress bar when file upload is aborted or cancelled. + Defaults to Cancelled. + */ + msgCancelled?: string; + /** + the title displayed (before the file name) on hover of the zoom button for zooming the file content in a modal window. + This is currently applicable only for text file previews. + Defaults to View details. + */ + msgZoomTitle?: string; + /** + the heading of the modal dialog that displays the zoomed file content. + This is currently applicable only for text file previews. + Defaults to Detailed Preview. + */ + msgZoomModalHeading?: string; + /** + the message to be displayed when the file size exceeds maximum size. + Defaults to: + File "{name}" ({size} KB) exceeds maximum allowed upload size of {maxSize} KB. Please retry your upload! + where: + {name}: will be replaced by the file name being uploaded + {size}: will be replaced by the uploaded file size + {maxSize}: will be replaced by the maxFileSize parameter. + */ + msgSizeTooLarge?: string; + /** + message to be displayed when the file count is less than the minimum count as set in minFileCount. + Defaults to: + You must select at least {n} {files} to upload. Please retry your upload! + where: + {n}: will be replaced by the allowed minimum files as set in minFileCount. + {files}: will be replaced with fileSingle or filePlural properties in locale file depending on the minFileCount. + */ + msgFilesTooLess?: string; + /** + the message to be displayed when the file count exceeds maximum count as set in maxFileCount. + Defaults to: + Number of files selected for upload ({n}) exceeds maximum allowed limit of {m}. Please retry your upload! + where: + {n}: will be replaced by number of files selected for upload + {m}: will be replaced by the allowed maximum files as set in maxFileCount + */ + msgFilesTooMany?: string; + /** + the exception message to be displayed when the file selected is not found by the FileReader. + Defaults to: + File "{name}" not found! + where: + {name}: will be replaced by the file name being uploaded + */ + msgFileNotFound?: string; + /** + the exception message to be displayed when the file selected is not allowed to be accessed due to a security exception. + Defaults to: + Security restrictions prevent reading the file "{name}". + where: + {name}: will be replaced by the file name being uploaded + */ + msgFileSecured?: string; + /** + the exception message to be displayed when the file selected is not readable by the FileReader API. + Defaults to: + File "{name}" is not readable. + where: + {name}: will be replaced by the file name being uploaded + */ + msgFileNotReadable?: string; + /** + the exception message to be displayed when the file preview upload is aborted. + Defaults to: + File preview aborted for "{name}". + where: + {name}: will be replaced by the file name being uploaded + */ + msgFilePreviewAborted?: string; + /** + the exception message to be displayed for any other error when previewing the file. + Defaults to: + An error occurred while reading the file "{name}". + where: + {name}: will be replaced by the file name being uploaded + */ + msgFilePreviewError?: string; + /** + the message to be displayed when the file type is not in one of the file types set in allowedFileTypes. + Defaults to: + Invalid type for file "{name}". Only "{types}" files are supported. + where: + {name}: will be replaced by the file name being uploaded + {types}: will be replaced by the comma separated list of types defined in allowedFileTypes. + */ + msgInvalidFileType?: string; + /** + the message to be displayed when the file type is not in one of the file extensions set in allowedFileExtensions. + Defaults to: + Invalid extension for file "{name}". Only "{extensions}" files are supported. + where: + {name}: will be replaced by the file name being uploaded + {extensions}: will be replaced by the comma separated list of extensions defined in allowedFileExtensions. + */ + msgInvalidFileExtension?: string; + /** + the message to be displayed when an ongoing ajax file upload is aborted by pressing the Cancel button. + Defaults to The file upload was aborted. + If this is set to null or empty, the internal ajax error message will be displayed - Defaults to File Upload Error. + */ + msgUploadAborted?: string; + /** + the exception message to be displayed within the caption container (instead of msgFilesSelected), when a validation error is encountered. + Defaults to File Upload Error. + */ + msgValidationError?: string; + /** + the css class for the validation error message displayed in the caption container. + Defaults to text-danger. + */ + msgValidationErrorClass?: string; + /** + the icon to be displayed before the validation error in the caption container. + Defaults to + */ + msgValidationErrorIcon?: string; + /** + the css class for the error message to be displayed in the preview window when the file size exceeds maxSize. + Defaults to file-error-message. + */ + msgErrorClass?: string; + /** + the message displayed when the files are getting read and loaded for preview. + Defaults to + Loading file {index} of {files} … + The following special variables will be replaced: + {index}: the sequence number of the current file being loaded. + {files}: the total number of files selected for upload. + */ + msgLoading?: string; + /** + the progress message displayed as each file is loaded for preview. + Defaults to: + Loading file {index} of {files} - {name} - {percent}% completed. + The following variables will be replaced: + {index}: the sequence number of the current file being loaded. + {files}: the total number of files selected for upload. + {percent}: the percentage of file read and loaded. + {name}: the name of the current file being loaded. + */ + msgProgress?: string; + /** + the progress message displayed in caption window when multiple (more than one) files are selected. + Defaults to: + {n} files selected. + The following variables will be replaced: + {n}: the number of files selected. + */ + msgSelected?: string; + /** + the message displayed when a folder has been dragged to the drop zone. + Defaults to: + Drag & drop files only! {n} folder(s) dropped were skipped. + The following variables will be replaced: + {n}: the number of folders dropped. + */ + msgFoldersNotAllowed?: string; + /** + the exception message to be displayed when the file selected for preview is an image and its width is less than the minImageWidth setting. + Defaults to: + Width of image file "{name}" must be at least {size} px. + where: + {name}: will be replaced by the file name being uploaded. + {size}: will be replaced by the minImageWidth setting. + */ + msgImageWidthSmall?: string; + /** + the exception message to be displayed when the file selected for preview is an image and its height is less than the minImageHeight setting. + Defaults to: + Height of image file "{name}" must be at least {size} px. + where: + {name}: will be replaced by the file name being uploaded. + {size}: will be replaced by the minImageHeight setting. + */ + msgImageHeightSmall?: string; + /** + the exception message to be displayed when the file selected for preview is an image and its width exceeds the maxImageWidth setting. + Defaults to: + Width of image file "{name}" cannot exceed {size} px. + where: + {name}: will be replaced by the file name being uploaded. + {size}: will be replaced by the maxImageWidth setting. + */ + msgImageWidthLarge?: string; + /** + the exception message to be displayed when the file selected for preview is an image and its height exceeds the maxImageHeight setting. + Defaults to: + Height of image file "{name}" cannot exceed {size} px. + where: + {name}: will be replaced by the file name being uploaded. + {size}: will be replaced by the maxImageHeight setting. + */ + msgImageHeightLarge?: string; + /** + the upload progress bar CSS class to be applied when AJAX upload is in process (applicable only for ajax uploads). + Defaults to progress-bar progress-bar-success progress-bar-striped active. + */ + progressClass?: string; + /** + the upload progress bar CSS class to be applied when AJAX upload is in process (applicable only for ajax uploads). + Defaults to progress-bar progress-bar-success progress-bar-striped active. + */ + progressCompleteClass?: string; + /** + the upload progress bar CSS class to be applied when AJAX upload is cancelled or aborted. + Defaults to progress-bar progress-bar-danger. + */ + progressErrorClass?: string; + /** + the type of files that are to be displayed in the preview window. + Defaults to image. + Can be one of the following: + image: Only image type files will be shown in preview. + text: Only text type files will be shown in preview. + any: Both image and text files content will be shown in preview. + Files other than image or text will be displayed as a thumbnail with the filename in the preview window. + */ + previewFileType?: "image" | "text" | "any"; + /** + the icon for zooming the file content in a new modal dialog. + This is currently applicable only for text file previews. + Defaults to + */ + zoomIndicator?: string; + /** + the identifier for the container element displaying the error (e.g. '#id'). + If not set, will default to the container with CSS class kv-fileinput-error inside the preview container (identified by elPreviewContainer). + The msgErrorClass will be automatically appended to this container before displaying the error. + */ + elErrorContainer?: string; + /** + the identifier for the container element containing the caption (e.g. '#id'). + If not set, will default to the container with CSS class file-caption inside the main plugin container. + */ + elCaptionContainer?: string; + /** + the identifier for the container element containing the caption text (e.g. '#id'). + If not set, will default to the container with CSS class file-caption-name inside the main plugin container. + */ + elCaptionText?: string; + /** + the identifier for the container element containing the preview (e.g. '#id'). + If not set, will default to the container with CSS class file-preview inside the main plugin container. + */ + elPreviewContainer?: string; + /** + the identifier for the element containing the preview image thumbnails (e.g. '#id'). + If not set, will default to the container with CSS class file-preview-thumbnails inside the main plugin container. + */ + elPreviewImage?: string; + /** + the identifier for the element containing the preview progress status (e.g. '#id'). + If not set, will default to the container with CSS class file-preview-status inside the main plugin container. + */ + elPreviewStatus?: string; + /** + a callback to convert the filename as a slug string eliminating special characters. + If not set, it will use the plugin's own internal slugDefault method. + This callback function includes the filename as parameter and must return a converted filename string. + */ + slugCallback?: (filename: string) => string; + /** + whether to enable a drag and drop zone for dragging and dropping files to. + This is available only for ajax based uploads. + Defaults to true. + */ + dropZoneEnabled?: boolean; + /** + title to be displayed in the drag and drop zone. + This is available only for ajax based uploads. + Defaults to: + Drag & drop files here …. + */ + dropZoneTitle?: string; + /** + CSS class for the drag & drop zone title. + Defaults to file-drop-zone-title. + */ + dropZoneTitleClass?: string; + /** + configuration for setting up file actions for newly selected file thumbnails in the preview window. + */ + fileActionsettings?: FileActionSettings; + /** + markup for additional action buttons to display within the initial preview thumbnails (for example displaying an image edit button). + The following tag can be used in the markup and will be automatically replaced: + {dataKey}: Will be replaced with the key set within initialPreviewConfig. + */ + otherActionButtons?: string; + /** + the encoding to be used while reading a text file. + Applicable only for previewing text files. + Defaults to UTF-8. + */ + textEncoding?: string; + /** + additional ajax settings to pass to the plugin before submitting the ajax request for upload. + Applicable only for ajax uploads. + This can be useful to pass additional tokens to headers or one can use it for setting other ajax options for advanced cases. + Refer the jQuery ajax documentation for the various settings you can configure. + */ + ajaxSettings?: JQueryAjaxSettings; + /** + additional ajax settings to pass to the plugin before submitting the delete ajax request in each initial preview thumbnail. + Applicable only for ajax uploads. + This can be useful to pass additional tokens to headers or one can use it for setting other ajax options for advanced cases. + Refer the jQuery ajax documentation for the various settings you can configure. + */ + ajaxDeleteSettings?: JQueryAjaxSettings; + /** + whether to show details of the error stack from the server log when an error is encountered via ajax response. + Defaults to true. + */ + showAjaxErrorDetails?: boolean; + } + + interface PreviewConfig { + /** + the caption or filename to display for each initial preview item content. + */ + caption: string; + /** + the CSS width of the image/ content displayed. + */ + width: string; + /** + the URL for deleting the image/ content in the initial preview via AJAX post response.This will default to deleteUrl if not set. + */ + url: string; + /** + the key that will be passed as data to the url via AJAX POST. + */ + key: string | {}; + /** + the additional frame css class to set for the file's thumbnail frame. + */ + frameClass: string; + /** + the HTML attribute settings (set as key:value pairs) for the thumbnail frame. + */ + frameAttr: {}; + /** + the extra data that will be passed as data to the initial preview delete url / AJAX server call via POST.This will default to deleteExtraData if not set. + */ + extra: {} | Function; + } + + interface LayoutTemplates { + /** + the template for rendering the widget with caption. + The following tags will be parsed and replaced automatically: + {class}: the CSS class as set in the mainClass property. + {close}: will be replaced with the close (cross) icon (by default on top right of the preview window). The layout template to control this markup is layoutTemplates.close. + {preview}: the content parsed by the previewTemplate and will be displayed only if showPreview is true. + {caption}: the content parsed by the captionTemplate and will be displayed only if showCaption is true. + {remove}: the file remove/clear button and will be displayed only if showRemove is true. + {upload}: the file upload button and will be displayed only if showUpload is true. + {cancel}: the file upload cancel button that will be displayed when AJAX upload is in process to abort the AJAX upload. + {browse}: the main file browse button to select your files for input. + */ + main1?: string; + /** + the template for rendering the widget without caption. + The following tags will be parsed and replaced automatically: + {class}: the CSS class as set in the mainClass property. + {close}: will be replaced with the close (cross) icon (by default on top right of the preview window). The layout template to control this markup is layoutTemplates.close. + {preview}: the content parsed by the previewTemplate and will be displayed only if showPreview is true. + {caption}: the content parsed by the captionTemplate and will be displayed only if showCaption is true. + {remove}: the file remove/clear button and will be displayed only if showRemove is true. + {upload}: the file upload button and will be displayed only if showUpload is true. + {cancel}: the file upload cancel button that will be displayed when AJAX upload is in process to abort the AJAX upload. + {browse}: the main file browse button to select your files for input. + */ + main2?: string; + /** + the template for rendering the preview. + The following tags will be parsed and replaced automatically: + {class}: the CSS class as set in the previewClass property. + */ + preview?: string; + /** + the icon to render before the caption text. + */ + icon?: string; + /** + the template for rendering the caption. + The following tags will be parsed and replaced automatically: + {class}: the CSS class as set in the captionClass property. + */ + caption?: string; + /** + the template for rendering the modal (for text file preview zooming). + */ + modal?: string; + /** + the template for the progress bar when upload is in progress (for batch/mass uploads and within each preview thumbnail for async/single uploads). + The upload progress bar when displayed within each thumbnail will be wrapped inside a container having a CSS class of `file-thumb-progress`. + The following tags will be parsed and replaced automatically: + {percent}: will be replaced with the upload progress percentage. + */ + progress?: string; + /** + the template for the footer section of each file preview thumbnail. + The following tags will be parsed and replaced automatically: + {actions}: will be replaced with the output of the actions template. + {class}: the CSS class as set in the progressClass or progressCompleteClass property (depending on the progress percentage). + */ + footer?: string; + /** + the template for the file action buttons to be displayed within the thumbnail footer. + The following tags will be parsed and replaced automatically: + {upload}: will be replaced with the output of the actionUpload template. + {delete}: will be replaced with the output of the actionDelete template. + */ + actions?: string; + /** + the template for the file delete action button within the thumbnail footer. + The following tags will be parsed and replaced automatically: + {removeClass}: the css class for the remove button. Will be replaced with the removeClass set within fileActionSettings. + {removeIcon}: the icon for the remove button. Will be replaced with the removeIcon set within fileActionSettings. + {removeTitle}: the title to display on hover for the remove button. Will be replaced with the removeTitle set within fileActionSettings. + {dataUrl}: the URL for deleting the file thumbnail for initialPreview content only. Will be replaced with the url set within initialPreviewConfig. + {dataKey}: the key (additional data) that will be passed to the URL above via POST to the AJAX call. Will be replaced with the key set within initialPreviewConfig. + */ + actionDelete?: string; + /** + the template for the file upload action button within the thumbnail footer. + The following tags will be parsed and replaced automatically: + {uploadClass}: the css class for the upload button. Will be replaced with the uploadClass set within fileActionSettings. + {uploadIcon}: the icon for the upload button. Will be replaced with the uploadIcon set within fileActionSettings. + {uploadTitle}: the title to display on hover for the upload button. Will be replaced with the uploadTitle set within fileActionSettings. + */ + actionUpload?: string; + /** + The template for upload, remove, and cancel buttons. + The following tags will be parsed and replaced automatically: + {type}: the HTML button type, defaults to button for most buttons and submit for form based uploads. + {title}: the title to display on button hover. + {css}: the CSS class for the button. This is derived from settings for uploadClass or removeClass or cancelClass. + {status}: the disabled status for the button if available (else will be blank). + {icon}: the button icon as identified by uploadIcon or removeIcon or cancelIcon. + {label}: the button label as identified by uploadLabel or removeLabel or cancelLabel. + */ + btnDefault?: string; + /** + The template for upload button when used with ajax (i.e. when uploadUrl is set). + The following tags will be parsed and replaced automatically: + {type}: the HTML button type, defaults to button for most buttons and submit for form based uploads. + {title}: the title to display on button hover. + {css}: the CSS class for the button. This is derived from settings for uploadClass. + {status}: the disabled status for the button if available (else will be blank). + {icon}: the button icon as identified by uploadIcon. + {label}: the button label as identified by uploadLabel. + {href}: applicable only for Upload button for ajax uploads and will be replaced with the uploadUrl property. + */ + btnLink?: string; + /** + The template for the browse button. + {type}: the HTML button type, defaults to button for most buttons and submit for form based uploads. + {title}: the title to display on button hover. + {css}: the CSS class for the button. This is derived from settings for browseClass. + {status}: the disabled status for the button if available (else will be blank). + {icon}: the button icon as identified by browseIcon. + {label}: the button label as identified by browseLabel. + */ + btnBrowse?: string; + } + + interface PreviewTemplates { + /** + the preview template for image files. + The following tags will be parsed and replaced automatically: + {previewId}: will be replaced with the generated identifier for the preview frame container. + {data}: will be replaced with the data source for each preview type. + {width}: will be replaced with the width for the file type as set in previewSettings. + {height}: will be replaced with the height for the file type as set in previewSettings. + {caption}: will be replaced with the file name. + {type}: will be replaced with the file type. + */ + image?: string; + /** + the preview template for text files. + The following tags will be parsed and replaced automatically: + {previewId}: will be replaced with the generated identifier for the preview frame container. + {data}: will be replaced with the data source for each preview type. + {width}: will be replaced with the width for the file type as set in previewSettings. + {height}: will be replaced with the height for the file type as set in previewSettings. + {caption}: will be replaced with the file name. + {type}: will be replaced with the file type. + {dialog}: Will be replaced with the JS code to launch the modal dialog. + {zoomTitle}: This will be replaced with the msgZoomTitle property. This is the title that is displayed on hover of the zoom button (which on clicking will display the text file). + {zoomInd}: This will be replaced with the zoomIndicator property. This is the title that is displayed on hover of the zoom button (which on clicking will display the text file). + {heading}: This represents the modal dialog heading title. This will be replaced with the msgZoomModalHeading property. + */ + text?: string; + /** + the preview template for html files. + The following tags will be parsed and replaced automatically: + {previewId}: will be replaced with the generated identifier for the preview frame container. + {data}: will be replaced with the data source for each preview type. + {width}: will be replaced with the width for the file type as set in previewSettings. + {height}: will be replaced with the height for the file type as set in previewSettings. + {caption}: will be replaced with the file name. + {type}: will be replaced with the file type. + */ + html?: string; + /** + the preview template for video files (supported by HTML 5 video tag). + The following tags will be parsed and replaced automatically: + {previewId}: will be replaced with the generated identifier for the preview frame container. + {data}: will be replaced with the data source for each preview type. + {width}: will be replaced with the width for the file type as set in previewSettings. + {height}: will be replaced with the height for the file type as set in previewSettings. + {caption}: will be replaced with the file name. + {type}: will be replaced with the file type. + */ + video?: string; + /** + the preview template for audio files (supported by HTML 5 audio tag). + The following tags will be parsed and replaced automatically: + {previewId}: will be replaced with the generated identifier for the preview frame container. + {data}: will be replaced with the data source for each preview type. + {width}: will be replaced with the width for the file type as set in previewSettings. + {height}: will be replaced with the height for the file type as set in previewSettings. + {caption}: will be replaced with the file name. + {type}: will be replaced with the file type. + */ + audio?: string; + /** + the preview template for flash files (supported currently on webkit browsers). + The following tags will be parsed and replaced automatically: + {previewId}: will be replaced with the generated identifier for the preview frame container. + {data}: will be replaced with the data source for each preview type. + {width}: will be replaced with the width for the file type as set in previewSettings. + {height}: will be replaced with the height for the file type as set in previewSettings. + {caption}: will be replaced with the file name. + {type}: will be replaced with the file type. + */ + flash?: string; + /** + the preview template for all other files - by default treated as object. To disable this behavior, configure the allowedPreviewTypes property. + The following tags will be parsed and replaced automatically: + {previewId}: will be replaced with the generated identifier for the preview frame container. + {data}: will be replaced with the data source for each preview type. + {width}: will be replaced with the width for the file type as set in previewSettings. + {height}: will be replaced with the height for the file type as set in previewSettings. + {caption}: will be replaced with the file name. + {type}: will be replaced with the file type. + */ + object?: string; + /** + this template is used ONLY for rendering the initialPreview markup content passed directly as a raw format. + The following tags will be parsed and replaced automatically: + {content}: will be replaced with the raw HTML markup as set in initialPreview.. + */ + generic?: string; + } + + interface PreviewSettings { + image?: { width?: string; height?: string; }; + html?: { width?: string; height?: string; }; + text?: { width?: string; height?: string; }; + video?: { width?: string; height?: string; }; + audio?: { width?: string; height?: string; }; + flash?: { width?: string; height?: string; }; + object?: { width?: string; height?: string; }; + other?: { width?: string; height?: string; }; + } + + interface FileTypeSettings { + image: (vType: string, vName: string) => boolean; + html: (vType: string, vName: string) => boolean; + text: (vType: string, vName: string) => boolean; + video: (vType: string, vName: string) => boolean; + audio: (vType: string, vName: string) => boolean; + flash: (vType: string, vName: string) => boolean; + object: (vType: string, vName: string) => boolean; + other: (vType: string, vName: string) => boolean; + } + + interface PreviewFileIconSettings { + [key: string]: string; + } + + interface PreviewFileExtSettings { + [key: string]: (ext: string) => boolean; + } + + interface FileActionSettings { + /** + icon for remove button to be displayed in each file thumbnail. + */ + removeIcon: string; + /** + CSS class for the remove button in each file thumbnail. + */ + removeClass: string; + /** + title for remove button in each file thumbnail. + */ + removeTitle: string; + /** + icon for upload button to be displayed in each file thumbnail. + */ + uploadIcon: string; + /** + CSS class for the remove button in each file thumbnail. + */ + uploadClass: string; + /** + title for remove button in each file thumbnail. + */ + uploadTitle: string; + /** + an indicator (HTML markup) for new pending upload displayed in each file thumbnail. + */ + indicatorNew: string; + /** + an indicator (HTML markup) for successful upload displayed in each file thumbnail. + */ + indicatorSuccess: string; + /** + an indicator (HTML markup) for error in upload displayed in each file thumbnail. + */ + indicatorError: string; + /** + an indicator (HTML markup) for ongoing upload displayed in each file thumbnail. + */ + indicatorLoading: string; + /** + title to display on hover of indicator for new pending upload in each file thumbnail. + */ + indicatorNewTitle: string; + /** + title to display on hover of indicator for successful in each file thumbnail. + */ + indicatorSuccessTitle: string; + /** + title to display on hover of indicator for error in upload in each file thumbnail. + */ + indicatorErrorTitle: string; + /** + title to display on hover of indicator for ongoing upload in each file thumbnail. + */ + indicatorLoadingTitle: string; + } +} \ No newline at end of file diff --git a/bootstrap-slider/bootstrap-slider.d.ts b/bootstrap-slider/bootstrap-slider.d.ts index 77a5177fa0..d830e3c45a 100644 --- a/bootstrap-slider/bootstrap-slider.d.ts +++ b/bootstrap-slider/bootstrap-slider.d.ts @@ -35,7 +35,7 @@ interface SliderOptions { * Default: 'horizontal' * set the orientation. Accepts 'vertical' or 'horizontal' */ - orientation?: number; + orientation?: string; /** * Default: 5 * initial value. Use array to have a range slider. diff --git a/bootstrap/bootstrap-tests.ts b/bootstrap/bootstrap-tests.ts index c497e0abcd..f7cfdeab43 100644 --- a/bootstrap/bootstrap-tests.ts +++ b/bootstrap/bootstrap-tests.ts @@ -44,3 +44,8 @@ $('.typeahead').typeahead({ }); $('#navbar').affix(); + +$('.item').emulateTransitionEnd(2000); + +$.support.transition = false; +console.log(($.support.transition as TransitionEventNames).end === "transitionend"); diff --git a/bootstrap/bootstrap.d.ts b/bootstrap/bootstrap.d.ts index b0e8fbf858..ae84454332 100644 --- a/bootstrap/bootstrap.d.ts +++ b/bootstrap/bootstrap.d.ts @@ -53,7 +53,7 @@ interface PopoverOptions { } interface CollapseOptions { - parent?: any; + parent?: any; toggle?: boolean; } @@ -79,6 +79,10 @@ interface AffixOptions { target?: any; } +interface TransitionEventNames { + end: string; +} + interface JQuery { modal(options?: ModalOptions): JQuery; modal(options?: ModalOptionsBackdropString): JQuery; @@ -114,6 +118,12 @@ interface JQuery { typeahead(options?: TypeaheadOptions): JQuery; affix(options?: AffixOptions): JQuery; + + emulateTransitionEnd(duration: number): JQuery; +} + +interface JQuerySupport { + transition: boolean | TransitionEventNames; } declare module "bootstrap" { diff --git a/breeze/breeze-tests.ts b/breeze/breeze-tests.ts index 022f4e3c16..7ddf30f5e9 100644 --- a/breeze/breeze-tests.ts +++ b/breeze/breeze-tests.ts @@ -883,7 +883,7 @@ function test_config() { o = config.getAdapter("myInterfaceName", "myAdapterName"); o = config.getAdapterInstance("myInterfaceName", "myAdapterName"); config.initializeAdapterInstance("myInterfaceName", "myAdapterName", true); - config.initializeAdapterInstances({ x: 3, y: "not" }); + config.initializeAdapterInstances({ ajax: "", dataService: "" }); s = config.interfaceInitialized.type; o = config.interfaceRegistry; o = config.objectRegistry; diff --git a/breeze/breeze.d.ts b/breeze/breeze.d.ts index 28a6be26c9..8cc109d746 100644 --- a/breeze/breeze.d.ts +++ b/breeze/breeze.d.ts @@ -11,21 +11,23 @@ // Updated Jan 16 2015 for Breeze 1.4.17 to add support for noimplicitany - Kevin Wilson ( www.kwilson.me.uk ) // Updated Jan 20 2015 for Breeze 1.5.2 and merging changes from DefinitelyTyped // Updated Feb 28 2015 add any/all clause on Predicate +// Updated Jun 27 2016 - Marcel Good (www.ideablade.com) +// Updated Jul 28 2016 - Serkan "coni2k" Holat declare namespace breeze.core { - interface ErrorCallback { + export interface ErrorCallback { (error: Error): void; } - interface IEnum { + export interface IEnum { contains(object: any): boolean; fromName(name: string): EnumSymbol; getNames(): string[]; getSymbols(): EnumSymbol[]; } - class Enum implements IEnum { + export class Enum implements IEnum { constructor(name: string, methodObj?: any); addSymbol(propertiesObj?: any): EnumSymbol; @@ -37,14 +39,14 @@ declare namespace breeze.core { resolveSymbols(): void; } - class EnumSymbol { + export class EnumSymbol { parentEnum: IEnum; getName(): string; toString(): string; } - class Event { + export class Event { constructor(name: string, publisher: any, defaultErrorCallback?: ErrorCallback); static enable(eventName: string, target: any): void; @@ -91,25 +93,27 @@ declare namespace breeze.core { declare namespace breeze { - interface Entity { + export interface Entity { entityAspect: EntityAspect; entityType: EntityType; } - interface ComplexObject { + export interface ComplexObject { complexAspect: ComplexAspect; complexType: ComplexType; } - interface IProperty { + export interface IProperty { name: string; + nameOnServer: string; + displayName: string; parentType: IStructuralType; validators: Validator[]; isDataProperty: boolean; isNavigationProperty: boolean; } - interface IStructuralType { + export interface IStructuralType { complexProperties: DataProperty[]; dataProperties: DataProperty[]; name: string; @@ -119,13 +123,13 @@ declare namespace breeze { validators: Validator[]; } - class AutoGeneratedKeyType { + export class AutoGeneratedKeyType { static Identity: AutoGeneratedKeyType; static KeyGenerator: AutoGeneratedKeyType; static None: AutoGeneratedKeyType; } - class ComplexAspect { + export class ComplexAspect { complexObject: ComplexObject; getEntityAspect(): EntityAspect; parent: Object; @@ -134,7 +138,7 @@ declare namespace breeze { originalValues: Object; } - class ComplexType implements IStructuralType { + export class ComplexType implements IStructuralType { complexProperties: DataProperty[]; dataProperties: DataProperty[]; name: string; @@ -146,7 +150,7 @@ declare namespace breeze { getProperties(): DataProperty[]; } - class DataProperty implements IProperty { + export class DataProperty implements IProperty { complexTypeName: string; concurrencyMode: string; dataType: DataTypeSymbol; @@ -162,13 +166,14 @@ declare namespace breeze { maxLength: number; name: string; nameOnServer: string; + displayName: string; parentType: IStructuralType; relatedNavigationProperty: NavigationProperty; validators: Validator[]; constructor(config: DataPropertyOptions); } - interface DataPropertyOptions { + export interface DataPropertyOptions { complexTypeName?: string; concurrencyMode?: string; custom?: any; @@ -185,7 +190,7 @@ declare namespace breeze { validators?: Validator[]; } - class DataService { + export class DataService { adapterInstance: DataServiceAdapter; adapterName: string; hasServerMetadata: boolean; @@ -197,7 +202,7 @@ declare namespace breeze { using(config: DataServiceOptions): DataService; } - interface DataServiceOptions { + export interface DataServiceOptions { serviceName?: string; adapterName?: string; uriBuilderName?: string; @@ -206,7 +211,7 @@ declare namespace breeze { useJsonp?: boolean; } - class DataServiceAdapter { + export class DataServiceAdapter { checkForRecomposition(interfaceInitializedArgs: { interfaceName: string; isDefault: boolean }): void; initialize(): void; fetchMetadata(metadataStore: MetadataStore, dataService: DataService): breeze.promises.IPromise; @@ -215,7 +220,7 @@ declare namespace breeze { JsonResultsAdapter: JsonResultsAdapter; } - class JsonResultsAdapter { + export class JsonResultsAdapter { name: string; extractResults: (data: {}) => {}; visitNode: (node: {}, queryContext: QueryContext, nodeContext: NodeContext) => { entityType?: EntityType; nodeId?: any; nodeRefId?: any; ignore?: boolean; }; @@ -226,24 +231,24 @@ declare namespace breeze { }); } - interface QueryContext { + export interface QueryContext { url: string; - query: any; // how to also say it could be an EntityQuery or a string + query: EntityQuery | string; entityManager: EntityManager; dataService: DataService; queryOptions: QueryOptions; } - interface NodeContext { + export interface NodeContext { nodeType: string; } - class DataTypeSymbol extends breeze.core.EnumSymbol { + export class DataTypeSymbol extends breeze.core.EnumSymbol { defaultValue: any; isNumeric: boolean; isDate: boolean; } - interface DataType extends breeze.core.IEnum { + export interface DataType extends breeze.core.IEnum { Binary: DataTypeSymbol; Boolean: DataTypeSymbol; Byte: DataTypeSymbol; @@ -259,16 +264,36 @@ declare namespace breeze { String: DataTypeSymbol; Time: DataTypeSymbol; Undefined: DataTypeSymbol; + toDataType(typeName: string): DataTypeSymbol; parseDateFromServer(date: any): Date; defaultValue: any; isNumeric: boolean; - } - var DataType: DataType; + isInteger: boolean; - class EntityActionSymbol extends breeze.core.EnumSymbol { + /** Function to convert a value from string to this DataType. Note that this will be called each time a property is changed, so make it fast. */ + parse: (val: any, sourceTypeName: string) => any; + + /** Function to format this DataType for OData queries. */ + fmtOData: (val: any) => any; + + /** Optional function to get the next value for key generation, if this datatype is used as a key. Uses an internal table of previous values. */ + getNext?: () => any; + + /** Optional function to normalize a data value for comparison, if its value cannot be used directly. Note that this will be called each time a property is changed, so make it fast. */ + normalize?: (val: any) => any; + + /** Optional function to get the next value when the datatype is used as a concurrency property. */ + getConcurrencyValue?: (val: any) => any; + + /** Optional function to convert a raw (server) value from string to this DataType. */ + parseRawValue?: (val: any) => any; } - interface EntityAction extends breeze.core.IEnum { + export var DataType: DataType; + + export class EntityActionSymbol extends breeze.core.EnumSymbol { + } + export interface EntityAction extends breeze.core.IEnum { AcceptChanges: EntityActionSymbol; Attach: EntityActionSymbol; AttachOnImport: EntityActionSymbol; @@ -282,9 +307,9 @@ declare namespace breeze { PropertyChange: EntityActionSymbol; RejectChanges: EntityActionSymbol; } - var EntityAction: EntityAction; + export var EntityAction: EntityAction; - class EntityAspect { + export class EntityAspect { entity: Entity; entityManager: EntityManager; entityState: EntityStateSymbol; @@ -318,8 +343,6 @@ declare namespace breeze { removeValidationError(validator: Validator, property: NavigationProperty): void; removeValidationError(validationError: ValidationError): void; - /** Sets the entity to an EntityState of 'Added'. This is NOT the equivalent of calling {{#crossLink "EntityManager/addEntity"}}{{/crossLink}} - because no key generation will occur for autogenerated keys as a result of this operation. */ setAdded(): void; setDeleted(): void; setDetached(): void; @@ -333,7 +356,7 @@ declare namespace breeze { validateProperty(property: NavigationProperty, context?: any): boolean; } - class PropertyChangedEventArgs { + export class PropertyChangedEventArgs { entity: Entity; property: IProperty; propertyName: string; @@ -342,21 +365,21 @@ declare namespace breeze { parent: any; } - class PropertyChangedEvent extends breeze.core.Event { + export class PropertyChangedEvent extends breeze.core.Event { subscribe(callback?: (data: PropertyChangedEventArgs) => void): number; } - class ValidationErrorsChangedEventArgs { + export class ValidationErrorsChangedEventArgs { entity: Entity; added: ValidationError[]; removed: ValidationError[]; } - class ValidationErrorsChangedEvent extends breeze.core.Event { + export class ValidationErrorsChangedEvent extends breeze.core.Event { subscribe(callback?: (data: ValidationErrorsChangedEventArgs) => void): number; } - class EntityKey { + export class EntityKey { constructor(entityType: EntityType, keyValue: any); constructor(entityType: EntityType, keyValues: any[]); @@ -366,17 +389,17 @@ declare namespace breeze { values: any[]; } - interface EntityByKeyResult { + export interface EntityByKeyResult { entity: Entity; entityKey: EntityKey; fromCache: boolean; } - interface ExportEntitiesOptions { + export interface ExportEntitiesOptions { asString: boolean; // default true includeMetadata: boolean; // default true } - class EntityManager { + export class EntityManager { dataService: DataService; keyGeneratorCtor: Function; metadataStore: MetadataStore; @@ -392,7 +415,7 @@ declare namespace breeze { constructor(config?: EntityManagerOptions); constructor(config?: string); - acceptChanges(): void; + acceptChanges(): void; addEntity(entity: Entity): Entity; attachEntity(entity: Entity, entityState?: EntityStateSymbol, mergeStrategy?: MergeStrategySymbol): Entity; clear(): void; @@ -447,7 +470,7 @@ declare namespace breeze { setProperties(config: EntityManagerProperties): void; } - interface EntityManagerOptions { + export interface EntityManagerOptions { serviceName?: string; dataService?: DataService; metadataStore?: MetadataStore; @@ -457,7 +480,7 @@ declare namespace breeze { keyGeneratorCtor?: Function; } - interface EntityManagerProperties { + export interface EntityManagerProperties { serviceName?: string; dataService?: DataService; metadataStore?: MetadataStore; @@ -467,19 +490,19 @@ declare namespace breeze { keyGeneratorCtor?: Function; } - interface ExecuteQuerySuccessCallback { + export interface ExecuteQuerySuccessCallback { (data: QueryResult): void; } - interface ExecuteQueryErrorCallback { + export interface ExecuteQueryErrorCallback { (error: { query: EntityQuery; httpResponse: HttpResponse; entityManager: EntityManager; message?: string; stack?:string }): void; } - interface SaveChangesSuccessCallback { + export interface SaveChangesSuccessCallback { (saveResult: SaveResult): void; } - interface EntityError { + export interface EntityError { entity: Entity; errorMessage: string; errorName: string; @@ -487,7 +510,7 @@ declare namespace breeze { propertyName: string; } - interface SaveChangesErrorCallback { + export interface SaveChangesErrorCallback { (error: { entityErrors: EntityError[]; httpResponse: HttpResponse; @@ -497,26 +520,26 @@ declare namespace breeze { }): void; } - class EntityChangedEventArgs { + export class EntityChangedEventArgs { entity: Entity; entityAction: EntityActionSymbol; args: Object; } - class EntityChangedEvent extends breeze.core.Event { + export class EntityChangedEvent extends breeze.core.Event { subscribe(callback?: (data: EntityChangedEventArgs) => void): number; } - class HasChangesChangedEventArgs { + export class HasChangesChangedEventArgs { entityManager: EntityManager; hasChanges: boolean; } - class HasChangesChangedEvent extends breeze.core.Event { + export class HasChangesChangedEvent extends breeze.core.Event { subscribe(callback?: (data: HasChangesChangedEventArgs) => void): number; } - class EntityQuery { + export class EntityQuery { entityManager: EntityManager; orderByClause: OrderByClause; parameters: Object; @@ -573,10 +596,10 @@ declare namespace breeze { toJSON(): string; } - interface OrderByClause { + export interface OrderByClause { } - class EntityStateSymbol extends breeze.core.EnumSymbol { + export class EntityStateSymbol extends breeze.core.EnumSymbol { isAdded(): boolean; isAddedModifiedOrDeleted(): boolean; isDeleted(): boolean; @@ -585,16 +608,16 @@ declare namespace breeze { isUnchanged(): boolean; isUnchangedOrModified(): boolean; } - interface EntityState extends breeze.core.IEnum { + export interface EntityState extends breeze.core.IEnum { Added: EntityStateSymbol; Deleted: EntityStateSymbol; Detached: EntityStateSymbol; Modified: EntityStateSymbol; Unchanged: EntityStateSymbol; } - var EntityState: EntityState; + export var EntityState: EntityState; - class EntityType implements IStructuralType { + export class EntityType implements IStructuralType { autoGeneratedKeyType: AutoGeneratedKeyType; baseEntityType: EntityType; complexProperties: DataProperty[]; @@ -630,7 +653,7 @@ declare namespace breeze { toString(): string; } - interface EntityTypeOptions { + export interface EntityTypeOptions { shortName?: string; namespace?: string; autoGeneratedKeyType?: AutoGeneratedKeyType; @@ -639,24 +662,24 @@ declare namespace breeze { navigationProperties?: NavigationProperty[]; } - interface EntityTypeProperties { + export interface EntityTypeProperties { autoGeneratedKeyType?: AutoGeneratedKeyType; defaultResourceName?: string; serializerFn?: (dataProperty: DataProperty, value: any) => any; } - class FetchStrategySymbol extends breeze.core.EnumSymbol { + export class FetchStrategySymbol extends breeze.core.EnumSymbol { private foo; // to distinguish this class from MergeStrategySymbol } - interface FetchStrategy extends breeze.core.IEnum { + export interface FetchStrategy extends breeze.core.IEnum { FromLocalCache: FetchStrategySymbol; FromServer: FetchStrategySymbol; } - var FetchStrategy: FetchStrategy; + export var FetchStrategy: FetchStrategy; - class FilterQueryOpSymbol extends breeze.core.EnumSymbol { + export class FilterQueryOpSymbol extends breeze.core.EnumSymbol { } - interface FilterQueryOp extends breeze.core.IEnum { + export interface FilterQueryOp extends breeze.core.IEnum { Contains: FilterQueryOpSymbol; EndsWith: FilterQueryOpSymbol; Equals: FilterQueryOpSymbol; @@ -670,9 +693,9 @@ declare namespace breeze { Any: FilterQueryOpSymbol; All: FilterQueryOpSymbol; } - var FilterQueryOp: FilterQueryOp; + export var FilterQueryOp: FilterQueryOp; - class LocalQueryComparisonOptions { + export class LocalQueryComparisonOptions { static caseInsensitiveSQL: LocalQueryComparisonOptions; static defaultInstance: LocalQueryComparisonOptions; @@ -681,17 +704,17 @@ declare namespace breeze { setAsDefault(): void; } - class MergeStrategySymbol extends breeze.core.EnumSymbol { + export class MergeStrategySymbol extends breeze.core.EnumSymbol { } - interface MergeStrategy extends breeze.core.IEnum { + export interface MergeStrategy extends breeze.core.IEnum { OverwriteChanges: MergeStrategySymbol; PreserveChanges: MergeStrategySymbol; SkipMerge: MergeStrategySymbol; Disallowed: MergeStrategySymbol; } - var MergeStrategy: MergeStrategy; + export var MergeStrategy: MergeStrategy; - class MetadataStore { + export class MetadataStore { constructor(); constructor(config?: MetadataStoreOptions); namingConvention: NamingConvention; @@ -707,7 +730,7 @@ declare namespace breeze { static importMetadata(exportedString: string): MetadataStore; importMetadata(exportedString: string, allowMerge?: boolean): MetadataStore; isEmpty(): boolean; - registerEntityTypeCtor(entityTypeName: string, entityCtor: Function, initializationFn?: (entity: Entity) => void, noTrackingFn?: (entity: Entity) => Entity): void; + registerEntityTypeCtor(entityTypeName: string, entityCtor: Function, initializationFn?: (entity: Entity) => void, noTrackingFn?: (node: Object, entityType: EntityType) => Object): void; trackUnmappedType(entityCtor: Function, interceptor?: Function): void; setEntityTypeForResourceName(resourceName: string, entityType: EntityType): void; setEntityTypeForResourceName(resourceName: string, entityTypeName: string): void; @@ -715,12 +738,12 @@ declare namespace breeze { setProperties(config: { name?: string; serializerFn?: Function }): void; } - interface MetadataStoreOptions { + export interface MetadataStoreOptions { namingConvention?: NamingConvention; localQueryComparisonOptions?: LocalQueryComparisonOptions; } - class NamingConvention { + export class NamingConvention { static camelCase: NamingConvention; static defaultInstance: NamingConvention; static none: NamingConvention; @@ -736,12 +759,12 @@ declare namespace breeze { setAsDefault(): NamingConvention; } - interface NamingConventionOptions { + export interface NamingConventionOptions { serverPropertyNameToClient?: (name: string) => string; clientPropertyNameToServer?: (name: string) => string; } - class NavigationProperty implements IProperty { + export class NavigationProperty implements IProperty { associationName: string; entityType: EntityType; foreignKeyNames: string[]; @@ -750,6 +773,8 @@ declare namespace breeze { isNavigationProperty: boolean; isScalar: boolean; name: string; + nameOnServer: string; + displayName: string; parentType: IStructuralType; relatedDataProperties: DataProperty[]; validators: Validator[]; @@ -757,7 +782,7 @@ declare namespace breeze { constructor(config: NavigationPropertyOptions); } - interface NavigationPropertyOptions { + export interface NavigationPropertyOptions { name?: string; nameOnServer?: string; entityTypeName: string; @@ -768,15 +793,21 @@ declare namespace breeze { validators?: Validator[]; } - class Predicate { + export interface IRecursiveArray { + [i: number]: T | IRecursiveArray; + } + + export class Predicate { + constructor(); constructor(property: string, operator: string, value: any); constructor(property: string, operator: FilterQueryOpSymbol, value: any); constructor(property: string, operator: string, value: { value: any; isLiteral?: boolean; dataType?: breeze.DataType }); constructor(property: string, operator: FilterQueryOpSymbol, value: { value: any; isLiteral?: boolean; dataType?: breeze.DataType }); constructor(property: string, filterop: FilterQueryOpSymbol, property2: string, filterop2: FilterQueryOpSymbol, value: any); // for any/all clauses constructor(property: string, filterop: string, property2: string, filterop2: string, value: any); // for any/all clauses - /** Create predicate from an expression tree */ - constructor(tree: Object); + constructor(passthru: string); + constructor(predicate: Predicate); + constructor(anArray: IRecursiveArray); and: PredicateMethod; static and: PredicateMethod; @@ -798,7 +829,7 @@ declare namespace breeze { toJSON(): string; } - interface PredicateMethod { + export interface PredicateMethod { (predicates: Predicate[]): Predicate; (...predicates: Predicate[]): Predicate; (property: string, operator: string, value: any, valueIsLiteral?: boolean): Predicate; @@ -807,7 +838,7 @@ declare namespace breeze { (property: string, filterop: string, property2: string, filterop2: string, value: any): Predicate; // for any/all clauses } - class QueryOptions { + export class QueryOptions { static defaultInstance: QueryOptions; fetchStrategy: FetchStrategySymbol; mergeStrategy: MergeStrategySymbol; @@ -822,12 +853,12 @@ declare namespace breeze { using(config: FetchStrategySymbol): QueryOptions; } - interface QueryOptionsConfiguration { + export interface QueryOptionsConfiguration { fetchStrategy?: FetchStrategySymbol; mergeStrategy?: MergeStrategySymbol; } - interface HttpResponse { + export interface HttpResponse { config: any; data: Entity[]; error?: any; @@ -836,7 +867,7 @@ declare namespace breeze { getHeaders(headerName: string): string } - interface QueryResult { + export interface QueryResult { /** Top level entities returned */ results: Entity[]; /** Query that was executed */ @@ -851,33 +882,33 @@ declare namespace breeze { retrievedEntities?: Entity[] } - class SaveOptions { + export class SaveOptions { allowConcurrentSaves: boolean; resourceName: string; dataService: DataService; tag: Object; static defaultInstance: SaveOptions; - constructor(config?: { allowConcurrentSaves?: boolean; resourceName?: string; dataService?: DataService; tag?: any}); + constructor(config?: { allowConcurrentSaves?: boolean; resourceName?: string; dataService?: DataService; tag?: any }); setAsDefault(): SaveOptions; using(config: SaveOptionsConfiguration): SaveOptions; } - interface SaveOptionsConfiguration { + export interface SaveOptionsConfiguration { allowConcurrentSaves?: boolean; resourceName?: string; dataService?: DataService; tag?: Object; } - interface SaveResult { + export interface SaveResult { entities: Entity[]; keyMappings: any; XHR: XMLHttpRequest; } - class ValidationError { + export class ValidationError { key: string; context: any; errorMessage: string; @@ -889,7 +920,7 @@ declare namespace breeze { constructor(validator: Validator, context: any, errorMessage: string, key: string); } - class ValidationOptions { + export class ValidationOptions { static defaultInstance: ValidationOptions; validateOnAttach: boolean; validateOnPropertyChange: boolean; @@ -902,14 +933,14 @@ declare namespace breeze { using(config: ValidationOptionsConfiguration): ValidationOptions; } - interface ValidationOptionsConfiguration { + export interface ValidationOptionsConfiguration { validateOnAttach?: boolean; validateOnSave?: boolean; validateOnQuery?: boolean; validateOnPropertyChange?: boolean; } - class Validator { + export class Validator { /** Map of standard error message templates keyed by validator name.*/ static messageTemplates: any; context: any; @@ -962,7 +993,7 @@ declare namespace breeze { /** Creates a regular expression validator with a fixed expression. */ static makeRegExpValidator(validatorName: string, expression: RegExp, defaultMessage: string, context?: any): Validator; - /** Run this validator against the specified value. + /** Run this validator against the specified value. @param value {Object} Value to validate @param additionalContext {Object} Any additional contextual information that the Validator can make use of. @return {ValidationError|null} A ValidationError if validation fails, null otherwise */ @@ -972,11 +1003,11 @@ declare namespace breeze { getMessage(): string; } - interface ValidatorFunction { + export interface ValidatorFunction { (value: any, context: ValidatorFunctionContext): void; } - interface ValidatorFunctionContext { + export interface ValidatorFunctionContext { value: any; validatorName: string; displayName: string; @@ -984,84 +1015,93 @@ declare namespace breeze { message?: string; } - var metadataVersion: string; - var remoteAccess_odata: string; - var remoteAccess_webApi: string; - var version: string; + export var metadataVersion: string; + export var remoteAccess_odata: string; + export var remoteAccess_webApi: string; + export var version: string; + } declare namespace breeze.config { - var ajax: string; - var dataService: string; - var functionRegistry: Object; + + export var ajax: string; + export var dataService: string; + export var functionRegistry: Object; /** Returns the ctor function used to implement a specific interface with a specific adapter name. - @method getAdapter @param interfaceName {String} One of the following interface names "ajax", "dataService" or "modelLibrary" - @param [adapterName] {String} The name of any previously registered adapter. If this parameter is omitted then + @param adapterName {String} The name of any previously registered adapter. If this parameter is omitted then this method returns the "default" adapter for this interface. If there is no default adapter, then a null is returned. - @return {Function|null} Returns either a ctor function or null. + @returns {Function|null} Returns either a ctor function or null. **/ export function getAdapter(interfaceName: string, adapterName?: string): Function; /** Returns the adapter instance corresponding to the specified interface and adapter names. - @method getAdapterInstance @param interfaceName {String} The name of the interface. - @param [adapterName] {String} - The name of a previously registered adapter. If this parameter is + @param adapterName {String} - The name of a previously registered adapter. If this parameter is omitted then the default implementation of the specified interface is returned. If there is no defaultInstance of this interface, then the first registered instance of this interface is returned. @return {an instance of the specified adapter} **/ export function getAdapterInstance(interfaceName: string, adapterName?: string): Object; + + export interface Adapter { + getRoutePrefix: Function + } /** - Initializes a single adapter implementation. Initialization means either newing a instance of the + Initializes a single adapter implementation. Initialization means either newing a instance of the specified interface and then calling "initialize" on it or simply calling "initialize" on the instance if it already exists. - @method initializeAdapterInstance @param interfaceName {String} The name of the interface to which the adapter to initialize belongs. @param adapterName {String} - The name of a previously registered adapter to initialize. - @param [isDefault=true] {Boolean} - Whether to make this the default "adapter" for this interface. + @param isDefault=true {Boolean} - Whether to make this the default "adapter" for this interface. @return {an instance of the specified adapter} **/ - export function initializeAdapterInstance(interfaceName: string, adapterName: string, isDefault?: boolean): void; + export function initializeAdapterInstance(interfaceName: string, adapterName: string, isDefault?: boolean): Adapter; + + export interface AdapterInstancesConfig { + /** the name of a previously registered "ajax" adapter */ + ajax?: string; + /** the name of a previously registered "dataService" adapter */ + dataService?: string; + /** the name of a previously registered "modelLibrary" adapter */ + modelLibary?: string; + /** the name of a previously registered "uriBuilder" adapter */ + uriBuilder?: string; + } /** Initializes a collection of adapter implementations and makes each one the default for its corresponding interface. - @method initializeAdapterInstances - @param config {Object} - @param [config.ajax] {String} - the name of a previously registered "ajax" adapter - @param [config.dataService] {String} - the name of a previously registered "dataService" adapter - @param [config.modelLibrary] {String} - the name of a previously registered "modelLibrary" adapter - @param [config.uriBuilder] {String} - the name of a previously registered "uriBuilder" adapter + @param config {AdapterInstancesConfig} @return [array of instances] **/ - export function initializeAdapterInstances(config: Object): Object[]; - var interfaceInitialized: Event; - var interfaceRegistry: Object; - var objectRegistry: Object; + export function initializeAdapterInstances(config: AdapterInstancesConfig): Object[]; + export var interfaceInitialized: Event; + export var interfaceRegistry: Object; + export var objectRegistry: Object; /** Method use to register implementations of standard breeze interfaces. Calls to this method are usually - made as the last step within an adapter implementation. - @method registerAdapter + made as the last step within an adapter implementation. @param interfaceName {String} - one of the following interface names "ajax", "dataService" or "modelLibrary" - @param adapterCtor {Function} - an ctor function that returns an instance of the specified interface. + @param adapterCtor {Function} - an ctor function that returns an instance of the specified interface. **/ export function registerAdapter(interfaceName: string, adapterCtor: Function): void; export function registerFunction(fn: Function, fnName: string): void; export function registerType(ctor: Function, typeName: string): void; //static setProperties(config: Object): void; //deprecated - /** + /** Set the promise implementation, if Q.js is not found. @param q - implementation of promise. @see http://wiki.commonjs.org/wiki/Promises/A */ export function setQ(q: breeze.promises.IPromiseService): void; - var stringifyPad: string; - var typeRegistry: Object; + export var stringifyPad: string; + export var typeRegistry: Object; } /** Promises interface used by Breeze. Usually implemented by Q (https://github.com/kriskowal/q) or angular.$q using breeze.config.setQ(impl) */ declare namespace breeze.promises { - interface IPromise { + + export interface IPromise { then(onFulfill: (value: T) => U, onReject?: (reason: any) => U): IPromise; then(onFulfill: (value: T) => IPromise, onReject?: (reason: any) => U): IPromise; then(onFulfill: (value: T) => U, onReject?: (reason: any) => IPromise): IPromise; @@ -1071,13 +1111,13 @@ declare namespace breeze.promises { finally(finallyCallback: () => any): IPromise; } - interface IDeferred { + export interface IDeferred { promise: IPromise; resolve(value: T): void; reject(reason: any): void; } - interface IPromiseService { + export interface IPromiseService { defer(): IDeferred; reject(reason?: any): IPromise; resolve(object: T): IPromise; @@ -1085,3 +1125,6 @@ declare namespace breeze.promises { } } +declare module "breeze" { + export = breeze; +} diff --git a/browser-pack/browser-pack-tests.ts b/browser-pack/browser-pack-tests.ts new file mode 100644 index 0000000000..4cf20249e8 --- /dev/null +++ b/browser-pack/browser-pack-tests.ts @@ -0,0 +1,33 @@ +/// + +import browserPack = require("browser-pack"); + +module BrowserPackTest { + + export function packIt(opts?: BrowserPack.Options) { + var packOpts: BrowserPack.Options = { + basedir: opts.basedir || "./", + externalRequireName: opts.externalRequireName || "require", + hasExports: opts.hasExports || false, + prelude: opts.prelude || undefined, + preludePath: opts.preludePath || undefined, + raw: opts.raw || false, + sourceMapPrefix: opts.sourceMapPrefix || '//#', + standalone: opts.standalone || undefined, + standaloneModule: opts.standaloneModule || undefined, + }; + + var res = browserPack(); // 'opts' are optional + var res2 = browserPack(packOpts); + + // ensure return value is a stream + var res3 = res.pipe(res2); + + res.on("error", function (err: any) { + console.error("browser-pack error: ", err); + }); + } + +} + +export = BrowserPackTest; \ No newline at end of file diff --git a/browser-pack/browser-pack.d.ts b/browser-pack/browser-pack.d.ts new file mode 100644 index 0000000000..52b96ce134 --- /dev/null +++ b/browser-pack/browser-pack.d.ts @@ -0,0 +1,61 @@ +// Type definitions for browser-pack v6.0.1 +// Project: https://github.com/substack/browser-pack +// Definitions by: TeamworkGuy2 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +/** pack node-style source files from a json stream into a browser bundle + */ +declare module BrowserPack { + + export interface Options { + /** Whether the bundle should include require= (or the opts.externalRequireName) so that + * require() is available outside the bundle + */ + hasExports?: boolean; + + /** A string to use in place of 'require' if opts.hasExports is specified, default is 'require' + */ + externalRequireName?: string; + + /** Specify a custom prelude, but know what you're doing first. See the prelude.js file in + * this repo for the default prelude. If you specify a custom prelude, you must also specify + * a valid opts.preludePath to the prelude source file for sourcemaps to work + */ + prelude?: string; + + /** prelude.js path if a custom opts.prelude is specified + */ + preludePath?: string; + + /** Used if opts.preludePath is undefined, this is used to resolve the prelude.js file location, default: 'process.cwd()' + */ + basedir?: string; + + /** if given, the writable end of the stream will expect objects to be written to + * it instead of expecting a stream of json text it will need to parse, default false + */ + raw?: boolean; + + /** External string name to use for UMD, if not provided, UMD declaration is not wrapped around output + */ + standalone?: string; + + /** Sets the internal module name to export for standalone + */ + standaloneModule?: string; + + /** If given and source maps are computed, the opts.sourceMapPrefix string will be used instead of default: '//#' + */ + sourceMapPrefix?: string; + } + +} + +declare module "browser-pack" { + /** pack node-style source files from a json stream into a browser bundle + */ + function browserPack(opts?: BrowserPack.Options): NodeJS.ReadWriteStream; + export = browserPack; +} \ No newline at end of file diff --git a/browser-resolve/browser-resolve-tests.ts b/browser-resolve/browser-resolve-tests.ts new file mode 100644 index 0000000000..071b17a1d2 --- /dev/null +++ b/browser-resolve/browser-resolve-tests.ts @@ -0,0 +1,39 @@ +/// + +import * as browserResolve from 'browser-resolve'; + +function basic_test_async(callback: (err?: Error, resolved?: string) => void) { + browserResolve('typescript', function(error, resolved) { + if (error) { + return callback(error); + } + callback(null, resolved); + }); +} + +function basic_test_sync() { + var resolved = browserResolve.sync('typescript'); +} + +function options_test_async() { + browserResolve('typescript', { + browser: 'jsnext:main', + filename: './browser-resolve/browser-resolve.js', + modules: { + fs: './fs-shim.js' + } + }, function(error, resolved) { + if (error) { + console.error(error); + return; + } + console.log(resolved); + }); +} + +function options_test_sync() { + var resolved = browserResolve.sync('typescript', { + filename: './browser-resolve/browser-resolve.js', + modules: {} + }); +} diff --git a/browser-resolve/browser-resolve.d.ts b/browser-resolve/browser-resolve.d.ts new file mode 100644 index 0000000000..8c1456c8f0 --- /dev/null +++ b/browser-resolve/browser-resolve.d.ts @@ -0,0 +1,61 @@ +// Type definitions for browser-resolve +// Project: https://github.com/defunctzombie/node-browser-resolve +// Definitions by: Mario Nebl +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module 'browser-resolve' { + import * as resolve from 'resolve'; + + /** + * Callback invoked when resolving asynchronously + * + * @param error + * @param resolved Absolute path to resolved identifier + */ + type resolveCallback = (err?: Error, resolved?: string) => void; + + /** + * Resolve a module path and call cb(err, path [, pkg]) + * + * @param id Identifier to resolve + * @param callback + */ + function browserResolve(id: string, cb: resolveCallback): void; + + /** + * Resolve a module path and call cb(err, path [, pkg]) + * + * @param id Identifier to resolve + * @param options Options to use for resolving, optional. + * @param callback + */ + function browserResolve(id: string, opts: browserResolve.AsyncOpts, cb: resolveCallback): void; + + /** + * Returns a module path + * + * @param id Identifier to resolve + * @param options Options to use for resolving, optional. + */ + function browserResolveSync(id: string, opts?: browserResolve.SyncOpts): string; + + namespace browserResolve { + interface Opts { + // the 'browser' property to use from package.json (defaults to 'browser') + browser?: string; + // the calling filename where the require() call originated (in the source) + filename?: string; + // modules object with id to path mappings to consult before doing manual resolution (use to provide core modules) + modules?: any; + } + + export interface AsyncOpts extends resolve.AsyncOpts, Opts {} + export interface SyncOpts extends resolve.SyncOpts, Opts {} + + export var sync: typeof browserResolveSync; + } + + export = browserResolve +} diff --git a/browser-sync/browser-sync-tests.ts b/browser-sync/browser-sync-tests.ts index 822c941d9f..72bcb6465e 100644 --- a/browser-sync/browser-sync-tests.ts +++ b/browser-sync/browser-sync-tests.ts @@ -1,5 +1,5 @@ /// -import browserSync = require("browser-sync"); +import * as browserSync from "browser-sync"; (() => { //make sure that the interfaces are correctly exposed diff --git a/browser-sync/browser-sync.d.ts b/browser-sync/browser-sync.d.ts index 3bc083d1f1..00d234f958 100644 --- a/browser-sync/browser-sync.d.ts +++ b/browser-sync/browser-sync.d.ts @@ -8,10 +8,10 @@ /// declare module "browser-sync" { - import chokidar = require("chokidar"); - import fs = require("fs"); - import http = require("http"); - import mm = require("micromatch"); + import * as chokidar from "chokidar"; + import * as fs from "fs"; + import * as http from "http"; + import * as mm from "micromatch"; namespace browserSync { interface Options { @@ -23,14 +23,14 @@ declare module "browser-sync" { * weinre.port - Default: 8080 * Note: requires at least version 2.0.0 */ - ui?: UIOptions; + ui?: UIOptions | boolean; /** * Browsersync can watch your files as you work. Changes you make will either be injected into the page (CSS * & images) or will cause all browsers to do a full-page refresh. See anymatch for more information on glob * patterns. * Default: false */ - files?: string | string[]; + files?: string | (string | FileCallback)[]; /** * File watching options that get passed along to Chokidar. Check their docs for available options * Default: undefined @@ -245,7 +245,7 @@ declare module "browser-sync" { * Note: requires at least version 1.6.2 */ socket?: SocketOptions; - middleware?: MiddlewareHandler | MiddlewareHandler[]; + middleware?: MiddlewareHandler | PerRouteMiddleware | (MiddlewareHandler | PerRouteMiddleware)[]; } interface Hash { @@ -261,6 +261,12 @@ declare module "browser-sync" { }; } + interface FileCallback { + match?: string | string[]; + fn: (event: string, file: string) => any; + options?: chokidar.WatchOptions; + } + interface ServerOptions { /** set base directory */ baseDir?: string | string[]; @@ -274,7 +280,7 @@ declare module "browser-sync" { */ routes?: Hash; /** configure custom middleware */ - middleware?: MiddlewareHandler[]; + middleware?: (MiddlewareHandler | PerRouteMiddleware)[]; } interface ProxyOptions { @@ -289,6 +295,11 @@ declare module "browser-sync" { (req: http.ServerRequest, res: http.ServerResponse, next: Function): any; } + interface PerRouteMiddleware { + route: string; + handle: MiddlewareHandler; + } + interface GhostOptions { clicks?: boolean; scroll?: boolean; diff --git a/bytebuffer/bytebuffer.d.ts b/bytebuffer/bytebuffer.d.ts index e5d267787f..a58509e4c6 100644 --- a/bytebuffer/bytebuffer.d.ts +++ b/bytebuffer/bytebuffer.d.ts @@ -23,6 +23,11 @@ declare class ByteBuffer */ static DEFAULT_CAPACITY: number; + /** + * Default endianess of false for big endian. + */ + static DEFAULT_ENDIAN: boolean; + /** * Default no assertions flag of false. */ @@ -91,12 +96,12 @@ declare class ByteBuffer /** * Data view to manipulate the backing buffer. Becomes null if the backing buffer has a capacity of 0. */ - view: DataView; + view: DataView; /** * Allocates a new ByteBuffer backed by a buffer of the specified capacity. */ - static allocate( capacity?: number, littleEndian?: number, noAssert?: boolean ): ByteBuffer; + static allocate( capacity?: number, littleEndian?: boolean, noAssert?: boolean ): ByteBuffer; /** * Decodes a base64 encoded string to binary like window.atob does. @@ -424,7 +429,7 @@ declare class ByteBuffer /** * Resizes this ByteBuffer to be backed by a buffer of at least the given capacity. Will do nothing if already that large or larger. - */ + */ resize( capacity: number ): ByteBuffer; /** @@ -611,6 +616,5 @@ declare class ByteBuffer } declare module 'bytebuffer' { - namespace ByteBuffer {} export = ByteBuffer; } diff --git a/bytes/bytes-tests.ts b/bytes/bytes-tests.ts index 4a981aee47..31f2f78b4e 100644 --- a/bytes/bytes-tests.ts +++ b/bytes/bytes-tests.ts @@ -8,9 +8,11 @@ console.log(bytes(104857, { thousandsSeparator: ' ' })); console.log(bytes.format(104857)); console.log(bytes.format(104857, { thousandsSeparator: ' ' })); - +console.log(bytes.format(104857, { decimalPlaces: 2 })); +console.log(bytes.format(104857, { fixedDecimals: true })); +console.log(bytes.format(104857, { unitSeparator: '-' })); console.log(bytes('1024kb')); console.log(bytes(1024)); console.log(bytes.parse('1024kb')); -console.log(bytes.parse(1024)); \ No newline at end of file +console.log(bytes.parse(1024)); diff --git a/bytes/bytes.d.ts b/bytes/bytes.d.ts index b99ebee7c6..bd3a2f93bd 100644 --- a/bytes/bytes.d.ts +++ b/bytes/bytes.d.ts @@ -1,10 +1,15 @@ -// Type definitions for bytes v2.1.0 +// Type definitions for bytes v2.4.0 // Project: https://github.com/visionmedia/bytes.js // Definitions by: Zhiyuan Wang // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare module 'bytes' { - + interface BytesOptions { + decimalPlaces?: number, + thousandsSeparator?: string, + unitSeparator?: string, + fixedDecimals?: boolean + } /** *Convert the given value in bytes into a string. * @@ -15,7 +20,7 @@ declare module 'bytes' { * * @returns {string} */ - function bytes(value: number, options?: { thousandsSeparator: string }): string; + function bytes(value: number, options?: BytesOptions): string; /** *Parse string to an integer in bytes. @@ -37,7 +42,7 @@ declare module 'bytes' { * @param {BytesFormatOptions} [options] */ - function format(value: number, options?: { thousandsSeparator: string }): string; + function format(value: number, options?: BytesOptions): string; /** * Just return the input number value. diff --git a/c3/c3-tests.ts b/c3/c3-tests.ts index 5413db82d7..cc15e11abe 100644 --- a/c3/c3-tests.ts +++ b/c3/c3-tests.ts @@ -290,7 +290,7 @@ function legend_examples() { }, item: { onclick: function(id) { /* code */ }, - onmoouseover: function(id) { /* code */ }, + onmouseover: function(id) { /* code */ }, onmouseout: function(id) { /* code */ }, } } diff --git a/c3/c3.d.ts b/c3/c3.d.ts index 32dee37dce..2838ba2675 100644 --- a/c3/c3.d.ts +++ b/c3/c3.d.ts @@ -650,7 +650,7 @@ declare namespace c3 { /** * Set mouseover event handler to the legend item. */ - onmoouseover?: (id: any) => void; + onmouseover?: (id: any) => void; /** * Set mouseout event handler to the legend item. */ @@ -747,7 +747,7 @@ declare namespace c3 { /** * The radius size of each point. */ - r?: number; + r?: number | ((d: any) => number); focus?: { expand: { diff --git a/cache-manager/cache-manager-tests.ts b/cache-manager/cache-manager-tests.ts new file mode 100644 index 0000000000..36eeb4c141 --- /dev/null +++ b/cache-manager/cache-manager-tests.ts @@ -0,0 +1,51 @@ +/// + +import * as cacheManager from 'cache-manager' + +const memoryCache = cacheManager.caching({ store: 'memory', max: 100, ttl: 10/*seconds*/ }); +const ttl = 5; + +memoryCache.set('foo', 'bar', { ttl: ttl }, (err) => { + + if (err) { + throw err; + } + + memoryCache.get('foo', (err, result) => { + + // console.log(result); + + memoryCache.del('foo', (err) => { + }); + + }); +}); + +function getUser(id: number, cb: Function) { + + cb(null, { id: id, name: 'Bob' }); +} + +const userId = 123; +const key = 'user_' + userId; + +// Note: ttl is optional in wrap() +memoryCache.wrap<{ id: number, name: string }>(key, (cb) => { + + getUser(userId, cb); + +}, { ttl: ttl }, (err, user) => { + + //console.log(user); + + // Second time fetches user from memoryCache + memoryCache.wrap<{ id: number, name: string }>(key, (cb) => { + + getUser(userId, cb); + + }, (err, user) => { + + //console.log(user); + + }); +}); diff --git a/cache-manager/cache-manager.d.ts b/cache-manager/cache-manager.d.ts new file mode 100644 index 0000000000..9570857f01 --- /dev/null +++ b/cache-manager/cache-manager.d.ts @@ -0,0 +1,36 @@ +// Type definitions for cache-manager v1.2.0 +// Project: https://github.com/BryanDonovan/node-cache-manager +// Definitions by: Simon Gausmann +// Definitions: https://github.com/borisyankov/DefinitelyTyped +declare module 'cache-manager' { + + + interface CachingConfig { + ttl: number; + } + interface StoreConfig extends CachingConfig { + store: string; + max?: number; + isCacheableValue?: (value: any) => boolean; + } + interface Cache { + set(key: string, value: T, options: CachingConfig, callback?: (error: any) => void): void; + set(key: string, value: T, ttl: number, callback?: (error: any) => void): void; + + wrap(key: string, wrapper: (callback: (error: any, result: T) => void) => void, options: CachingConfig, callback: (error: any, result: T) => void): void; + wrap(key: string, wrapper: (callback: (error: any, result: T) => void) => void, callback: (error: any, result: T) => void): void; + + get(key: string, callback: (error: any, result: T) => void): void; + + del(key: string, callback?: (error: any) => void): void; + } + + + + module cacheManager { + function caching(ICongig: StoreConfig): Cache; + function multiCaching(Caches: Cache[]): Cache; + } + + export = cacheManager; +} diff --git a/cachefactory/cachefactory-tests.ts b/cachefactory/cachefactory-tests.ts new file mode 100644 index 0000000000..0c859e749d --- /dev/null +++ b/cachefactory/cachefactory-tests.ts @@ -0,0 +1,34 @@ +/// + +CacheFactory.get('test'); + +CacheFactory.createCache('test', { + deleteOnExpire: 'aggressive', + recycleFreq: 60000 +}); + +let testCache = CacheFactory.get('test'); + +testCache.put('testOne', {title: 'testOne', id: 1}); + +let item = testCache.get('testOne'); + + +let profileCache = CacheFactory('profileCache', { + maxAge: 60 * 60 * 1000, + deleteOnExpire: 'aggressive' +}); + +let localStoragePolyfill = { + getItem: (key: string) => { return ""; }, + setItem: (key: string, value: string) => { }, + removeItem: (key: string) => { } +}; + +let myAwesomeCache = CacheFactory('myAwesomeCache', { + maxAge: 15 * 60 * 1000, + cacheFlushInterval: 60 * 60 * 1000, + deleteOnExpire: 'aggressive', + storageMode: 'localStorage', + storageImpl: localStoragePolyfill +}); \ No newline at end of file diff --git a/cachefactory/cachefactory.d.ts b/cachefactory/cachefactory.d.ts new file mode 100644 index 0000000000..ac416e6837 --- /dev/null +++ b/cachefactory/cachefactory.d.ts @@ -0,0 +1,443 @@ +// Type definitions for CacheFactory 1.4.0 +// Project: https://github.com/jmdobry/CacheFactory +// Definitions by: Vaggelis Mparmpas , Daniel Massa +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module CacheFactory { + export interface IStoreImplementation { + getItem(key: string): string; + + setItem(key: string, value: string): void; + + removeItem(key: string): void; + } + + export interface CacheGetOptions { + /* + * A callback function to be executed whenever an expired item is removed from a cache when the cache is in passive + * or aggressive mode. Will be passed the key and value of the expired item. + * + * Will be passed a third done argument if the cache is in passive mode. This allows you to synchronously access the + * key and value of the expired item when you make the cache#get(key[, options]) call that is the reason the expired + * item is being removed in the first place. Default: null. + */ + onExpire?(key: string, value: any): any; + } + + export interface CachePutOptions { + /* + * The number of milliseconds until a newly inserted item expires. Default: Number.MAX_VALUE. + */ + maxAge?: number; + + /* + * If inserting a promise into a cache, also insert the rejection value if the promise rejects. Default: false. + */ + storeOnReject?: boolean; + + /* + * If inserting a promise into a cache, also insert the resolved value if the promise resolves. Default: false. + */ + storeOnResolve?: boolean; + + created?: Date; + access?: Date; + expires?: Date; + } + + export interface CacheTouchOptions extends CachePutOptions { } + + export interface CacheOptions { + /* + * If set, remove all items from a cache on an interval after the given number of milliseconds. Default: null. + */ + cacheFlushInterval?: number; + + /* + * Maximum number of items a cache can hold. Adding more items than the capacity will cause the cache to operate + * like an LRU cache, removing the least recently used items to stay under capacity. Default: Number.MAX_VALUE. + */ + + capacity?: number; + + /* + * Determines the behavior of a cache when an item expires. Default: none. + * + * Possible values: + * + * none - cache will do nothing when an item expires. + * passive - cache will do nothing when an item expires. Expired items will remain in the cache until requested, + * at which point they are removed, and undefined is returned. + * aggressive - cache will remove expired items as soon as they are discovered. + */ + deleteOnExpire?: string; + + /* + * Determines whether a cache is disabled. Default: false. + */ + disabled?: boolean; + + /* + * The number of milliseconds until a newly inserted item expires. Default: Number.MAX_VALUE. + */ + maxAge?: number; + + /* + * Determines how often a cache will scan for expired items when in aggressive mode. Default: 1000 (milliseconds). + */ + recycleFreq?: number; + + /* + * If inserting a promise into a cache, also insert the rejection value if the promise rejects. Default: false. + */ + storeOnReject?: boolean; + + /* + * If inserting a promise into a cache, also insert the resolved value if the promise resolves. Default: false. + */ + storeOnResolve?: boolean; + + /* + * Provide a custom storage medium, e.g. a polyfill for localStorage. Default: null. + * + * Must implement: + * + * setItem - Same API as localStorage.setItem(key, value) + * getItem - Same API as localStorage.getItem(key) + * removeItem - Same API as localStorage.removeItem(key) + */ + storageImpl?: IStoreImplementation; + + /* + * Determines the storage medium used by a cache. Default: memory. + * + * Possible values: + * + * memory - cache will hold data in memory. Data is cleared when the page is refreshed. + * localStorage - cache will hold data in localStorage if available. Data is not cleared when the page is refreshed. + * sessionStorage - cache will hold data in sessionStorage if available. Data is not cleared when the page is refreshed. + */ + storageMode?: string; + + /* + * Determines the namespace of a cache when storageMode is set to localStorage or sessionStorage. Make it a shorter + * string to save space. Default: angular-cache.caches. + */ + storagePrefix?: string; + + /* + * A callback function to be executed whenever an expired item is removed from a cache when the cache is in passive + * or aggressive mode. Will be passed the key and value of the expired item. + * + * Will be passed a third done argument if the cache is in passive mode. This allows you to synchronously access the + * key and value of the expired item when you make the cache#get(key[, options]) call that is the reason the expired + * item is being removed in the first place. Default: null. + */ + onExpire?(key: string, value: any): any; + } + + export interface ICache { + + $$id: string; + + /** + * Return the item with the given key.options, if provided, must be an object. + * + * If the cache is in passive mode, then options.onExpire can be a function that will be called with the key + * and value of the requested item if the requested item is expired, with the get call itself returning undefined. + * @param key + * @returns {} + */ + get(key: string, options?: CacheGetOptions): T; + + /** + * Insert the item with the given key and value into the cache.options, if provided, must be an object. + * + * If inserting a promise, options.storeOnReject determines whether to insert the rejection value if the promise + * rejects (overriding the default storeOnReject setting for the cache). If inserting a promise, options.storeOnResolve + * determines whether to insert the resolved value if the promise resolves (overriding the default storeOnResolve setting for the cache). + * + * @param key + * @param value + * @param options + */ + put(key: string, value: T, options?: CachePutOptions): void; + + /** + * Remove and return the item with the given key, if it is in the cache. + * @param key + * @returns {} + */ + remove(key: string): T; + + /** + * Remove all items in the cache. + */ + removeAll(): void; + + /** + * Remove and return all expired items in the cache. + * @returns {} + */ + removeExpired(): { [key: string]: any }; + + /** + * Completely destroy this cache and its data. + * @returns {} + */ + destroy(): void; + + /** + * Returns an object containing information about the cache. + * + * @param key + */ + info(): CacheInfo; + + /** + * Returns an object containing information about the item with the given key, if the item is in the cache. + * + * @param key + */ + info(key: string): CacheItemInfo; + + /** + * Return the keys of all items in the cache as an object. + * @returns {} + */ + keySet(): any; + + /** + * Return the keys of all items in the cache as an array. + * @returns [] + */ + keys(): Array; + + /** + * Enable the cache. + */ + enable(): void; + + /** + * Disable the cache. + */ + disable(): void; + + /** + * cache#touch() will "touch" all items in the cache. + * cache#touch(key) will "touch" the item with the given key. + * + * @param key + */ + touch(key?: string, options?: CacheTouchOptions): void; + + /** + * Set the cacheFlushInterval for the cache. + * @param cacheFlushInterval + */ + setCacheFlushInterval(cacheFlushInterval: number): void; + + /** + * Set the capacity for the cache.Setting this lower than the current item count will result in those items being removed. + * @param capacity + */ + setCapacity(capacity: number): void; + + /** + * Set the deleteOnExpire for the cache. + * @param deleteOnExpire + */ + setDeleteOnExpire(deleteOnExpire: string): void; + + /** + * Set the maxAge for the cache. + */ + setMaxAge(maxAge: number): void; + + /** + * Set the onExpire for the cache. + * @param onExpire + */ + setOnExpire(onExpire: Function): void; + + /** + * Set the recycleFreq for the cache. + * @param recycleFreq + */ + setRecycleFreq(recycleFreq: number): void; + + /** + * Set the storageMode for the cache.This will move data from the current storage medium to the new one. + * @param storageMode + */ + setStorageMode(storageMode: string): void; + + /** + * Set multiple options for the cache at a time.Setting strict to true will reset options for the cache + * that are not specifically set in the options hash to CacheFactoryProvider.defaults. + * @param options + */ + setOptions(options: CacheOptions, strict?: boolean): void; + + /** + * Return the values of all items in the cache as an array. + * @returns Array + */ + values(): Array + } + + export interface ICacheFactory { + + BinaryHeap: IBinaryHeap; + utils: IUtils; + defaults: CacheOptions; + + /** + * Create a cache. cache must not already exist. cacheId must be a string. options is an optional argument and must be an object. + * Any options you pass here will override any default options. + * @param cacheId + * @param options + * @returns ICache + */ + (cacheId: string, options?: CacheOptions): ICache; + + /** + * Create a cache. cache must not already exist. cacheId must be a string. options is an optional argument and must be an object. + * Any options you pass here will override any default options. + * @param cacheId + * @param options + * @returns ICache + */ + createCache(cacheId: string, options?: CacheOptions): ICache; + + /** + * Return the cache with the given cacheId. + * @param cacheId The id of the cache storage. + * @returns ICache + */ + get(cacheId: string, options?: CacheOptions): ICache; + + /** + * Return an object of key- value pairs, the keys being cache ids and the values being the result of .info() being called on each cache. + * @returns CacheInfo + */ + info(): CacheInfo; + + /** + * Return the ids of all registered caches as an object. + * @returns {[key: string]: ICache} + */ + keySet(): { [key: string]: ICache }; + + /** + * Return the ids of all registered caches as an array. + * @returns Array + */ + keys(): Array; + + /** + * Destroy the cache with the given cacheId. + * @param cacheId + */ + destroy(cacheId: string): void; + + /** + * Destroy all registered caches. + */ + destroyAll(): void; + + /** + * Remove all data from all registered caches. + */ + clearAll(): void; + + /** + * Enable all registered caches. + */ + enableAll(): void; + + /** + * Disable all registered caches. + */ + disableAll(): void; + + /** + * Call.touch() on all registered caches. + */ + touchAll(): void; + + /** + * Call.removeExpired() on all registered caches.Returns a hash of any expired items, keyed by cache id. + * @returns {} + */ + removeExpiredFromAll(): Array<{ [key: string]: Array<{ [key: string]: any }> }>; + } + + export interface IUtils { + isNumber(value: any): boolean; + isString(value: any): boolean; + isObject(value: any): boolean; + isFunction(value: any): boolean; + equals(a: any, b: any): boolean; + fromJson(value: any): {} + Promise: any; + } + + export interface HeapItem { + key: string; + accessed: Date; + } + + export interface IBinaryHeap { + (w?: IWeightFunc, c?: ICompareFunc): void; + + heap: Array; + weightFunc: IWeightFunc; + compareFunc: ICompareFunc; + + push(node: HeapItem): void; + pop(): HeapItem; + peek(): HeapItem; + remove(node: HeapItem): HeapItem; + removeAll(): void; + size(): Number; + } + + export interface IWeightFunc { + (x: T): T; + } + + export interface ICompareFunc { + (x: T, y: T): boolean; + } + + export interface CacheInfo { + size: Number; + caches: { [key: string]: any }; + capacity: Number; + maxAge: Number; + deleteOnExpire: string; + onExpire: Function; + cacheFlushInterval: Number; + recycleFreq: Number; + storageMode: string; + storageImpl: IStoreImplementation; + disabled: boolean; + storagePrefix: string; + storeOnResolve: boolean; + storeOnReject: boolean; + } + + export interface CacheItemInfo { + created: Date; + accessed: Date; + expires: Date; + isExpired: boolean; + } +} + +declare var CacheFactory: CacheFactory.ICacheFactory; + +declare module "cachefactory" { + export = CacheFactory; +} \ No newline at end of file diff --git a/cassandra-driver/cassandra-driver.d.ts b/cassandra-driver/cassandra-driver.d.ts new file mode 100644 index 0000000000..9a4184b62e --- /dev/null +++ b/cassandra-driver/cassandra-driver.d.ts @@ -0,0 +1,761 @@ +// Type definitions for nodejs-driver v0.8.2 +// Project: https://github.com/datastax/nodejs-driver +// Definitions by: Marc Fisher +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// + +declare module "cassandra-driver" { + type Callback = Function; + type ResultCallback = (err: Error, result: types.ResultSet) => void; + + import * as events from "events"; + import * as stream from "stream"; + import _Long = require("long"); + + namespace policies { + namespace addressResolution { + var EC2MultiRegionTranslator: EC2MultiRegionTranslatorStatic; + + interface AddressTranslator { + translate(address: string, port: number, callback: Callback): void; + } + + interface EC2MultiRegionTranslatorStatic { + new(): EC2MultiRegionTranslator; + } + + interface EC2MultiRegionTranslator extends AddressTranslator { + logError(address: string, err: Error): void; + } + } + + namespace loadBalancing { + var DCAwareRoundRobinPolicy: DCAwareRoundRobinPolicyStatic; + var RoundRobinPolicy: RoundRobinPolicyStatic; + var TokenAwarePolicy: TokenAwarePolicyStatic; + var WhiteListPolicy: WhiteListPolicyStatic; + + interface LoadBalancingPolicy { + init(client: Client, hosts: HostMap, callback: Callback): void; + getDistance(host: Host): types.distance; + newQueryPlan(keyspace: string, queryOptions: any, callback: Callback): void; + } + + interface DCAwareRoundRobinPolicyStatic { + new(localDc?: string, usedHostsPerRemoteDc?: number): DCAwareRoundRobinPolicy; + } + + interface DCAwareRoundRobinPolicy extends LoadBalancingPolicy { + localHostsArray: Array; + remoteHostsArray: Array; + } + + interface RoundRobinPolicyStatic { + new(): RoundRobinPolicy; + } + + interface RoundRobinPolicy extends LoadBalancingPolicy {} + + interface TokenAwarePolicyStatic { + new(childPolicy: LoadBalancingPolicy): TokenAwarePolicy; + } + + interface TokenAwarePolicy extends LoadBalancingPolicy {} + + interface WhiteListPolicyStatic { + new(childPolicy: LoadBalancingPolicy, whiteList: Array): WhiteListPolicy; + } + + interface WhiteListPolicy extends LoadBalancingPolicy {} + } + + namespace reconnection { + var ConstantReconnectionPolicy: ConstantReconnectionPolicyStatic; + var ExponentialReconnectionPolicy: ExponentialReconnectionPolicyStatic; + + interface ReconnectionPolicy { + newSchedule(): {next: Function}; + } + + interface ConstantReconnectionPolicyStatic { + new(delay: number): ConstantReconnectionPolicy; + } + + interface ConstantReconnectionPolicy extends ReconnectionPolicy {} + + interface ExponentialReconnectionPolicyStatic { + new(baseDelay: number, maxDelay: number, startWithNoDelay: boolean): ExponentialReconnectionPolicy; + } + + interface ExponentialReconnectionPolicy extends ReconnectionPolicy {} + } + + namespace retry { + var RetryPolicy: RetryPolicyStatic; + + interface DecisionInfo { + decision: number; + consistency: number; + } + + interface RequestInfo { + request: any, + nbRetry: number + } + + enum retryDecision { + rethrow = 0, + retry, + ignore + } + + interface RetryPolicyStatic { + new (): RetryPolicy; + + retryDecision: any; + } + + interface RetryPolicy { + onReadTimeout(requestInfo: RequestInfo, consistency: types.consistencies, received: number, blockFor: number, isDataPresent: boolean): DecisionInfo; + onUnavailable(requestInfo: RequestInfo, consistency: types.consistencies, required: number, alive: number): DecisionInfo; + onWriteTimeout(requestInfo: RequestInfo, consistency: types.consistencies, received: number, blockFor: number, writeType: string): DecisionInfo; + rethrowResult(): { decision: retryDecision }; + retryResult(): { decision: retryDecision, consistency: types.consistencies, useCurrentHost: boolean }; + } + } + } + + namespace types { + var BigDecimal: BigDecimalStatic; + var InetAddress: InetAddressStatic; + var Integer: IntegerStatic; + var LocalDate: LocalDateStatic; + var LocalTime: LocalTimeStatic; + var Long: _Long; + var ResultSet: ResultSetStatic; + var ResultStream: ResultStreamStatic; + var Row: RowStatic; + var TimeUuid: TimeUuidStatic; + var Tuple: TupleStatic; + var Uuid: UuidStatic; + + enum consistencies { + any = 0, + one, + two, + three, + quorum, + all, + localQuorm, + eachQuorum, + serial, + localSerial, + localOne + } + + enum dataTypes { + custom = 0, + ascii, + bigint, + blob, + boolean, + counter, + decimal, + double, + float, + int, + text, + timestamp, + uuid, + varchar, + varint, + timeuuid, + inet, + date, + time, + smallint, + tinyint, + list, + map, + set, + udt, + tuple + } + + enum distance { + local = 0, + remote, + ignored + } + + interface responseErrorCodes { [key:string]:number; } + interface unset { unset: boolean; } + + function generateTimestamp(date?: Date, microseconds?: number): _Long; + function timeuuid(options?: {msecs: number | Date, node: Buffer, clockseq: number, nsecs: number}, buffer?: Buffer, offset?: number): string; + + interface BigDecimalStatic { + new (unscaledValue: number, scale: number): BigDecimal; + + fromBuffer(buf: Buffer): BigDecimal; + toBuffer(value: BigDecimal): Buffer; + fromString(value: string): BigDecimal; + fromNumber(value: number): BigDecimal; + } + + interface BigDecimal { + equals(other: BigDecimal): boolean; + inspect(): string; + notEquals(other: BigDecimal): boolean; + compare(other: BigDecimal): number; + subtract(other: BigDecimal): BigDecimal; + add(other: BigDecimal): BigDecimal; + greaterThan(other: BigDecimal): boolean; + isNegative(): boolean; + isZero(): boolean; + toString(): string; + toNumber(): number; + toJSON(): string; + } + + interface InetAddressStatic { + new(buffer: Buffer): InetAddress; + + fromString(value: string): InetAddress; + } + + interface InetAddress { + equals(other: InetAddress): boolean; + getBuffer(): Buffer; + inspect(): string; + toString(): string; + toJSON(): string; + + length: number; + version: number; + } + + interface IntegerStatic { + new(bits: Array, sign: number): Integer; + + fromInt(value: number): Integer; + fromNumber(value: number): Integer; + fromBits(bits: Array): Integer; + fromString(str: string, opt_radix?: number): Integer; + fromBuffer(bits: Buffer): Integer; + toBuffer(value: Integer): Buffer; + + ZERO: Integer; + ONE: Integer; + } + + interface Integer { + toInt(): number; + toNumber(): number; + toString(opt_radix?: number): string; + getBits(index: number): number; + getBitsUnsigned(index: number): number; + getSign(): number; + isZero(): boolean; + isNegative(): boolean; + isOdd(): boolean; + equals(other: Integer): boolean; + notEquals(other: Integer): boolean; + greaterThan(other: Integer): boolean; + greaterThanOrEqual(other: Integer): boolean; + lessThan(other: Integer): boolean; + lessThanOrEqual(other: Integer): boolean; + compare(other: Integer): number; + shorten(numBits: number): Integer; + negate(): Integer; + add(other: Integer): Integer; + subtract(other: Integer): Integer; + multiply(other: Integer): Integer; + divide(other: Integer): Integer; + modulo(other: Integer): Integer; + not(): Integer; + and(other: Integer): Integer; + or(other: Integer): Integer; + xor(other: Integer): Integer; + shiftLeft(numBits: number): Integer; + shiftRight(numBits: number): Integer; + inspect(): string; + abs(): Integer; + toJSON(): string; + } + + interface LocalDateStatic { + new(year: number, month: number, day: number): LocalDate; + + now(): LocalDate; + utcNow(): LocalDate; + fromDate(date: Date): LocalDate; + fromString(value: string): LocalDate; + fromBuffer(buffer: Buffer): LocalDate; + } + + interface LocalDate { + _value: number; + year: number; + month: number; + day: number; + + equals(other: LocalDate): boolean; + inspect(): string; + toBuffer(): Buffer; + toString(): string; + toJSON(): string; + } + + interface LocalTimeStatic { + new (totalNanoseconds: _Long): LocalTime; + + fromString(value: string): LocalTime; + now(nanoseconds?: number): LocalTime; + fromDate(date: Date, nanoseconds: number): LocalTime; + fromMilliseconds(milliseconds: number, nanoseconds?: number): LocalTime; + fromBuffer(value: Buffer): LocalTime; + } + + interface LocalTime { + hour: number; + minute: number; + second: number; + nanosecond: number; + + compare(other: LocalTime): boolean; + equals(other: LocalTime): boolean; + getTotalNanoseconds(): _Long; + inspect(): string; + toBuffer(): Buffer; + toString(): string; + toJSON(): string; + } + + interface ResultSetStatic { + new(response: any, host: string, triedHost: { [key:string]: any }, consistency: consistencies): ResultSet; + } + + interface ResultSet { + info: { + queriedHost: Host, + triedHosts: { [key:string]:string; }, + achievedConsistency: consistencies, + traceId: Uuid, + warnings: Array, + customPayload: any + }; + rows: Array; + rowLength: number; + columns: Array<{ [key:string]:string; }>; + pageState: string; + nextPage: any; // function + + first(): Row; + getPageState(): string; + getColumns(): Array<{ [key:string]:string; }>; + } + + interface ResultStreamStatic { + new (opt: any): ResultSet; + } + + interface ResultStream extends stream.Readable { + buffer: Buffer; + paused: boolean; + + _read(): void; + _valve(readNext: Function): void; + add(chunk: Buffer): void; + } + + interface RowStatic { + new(columns: Array<{ [key:string]:string; }>): Row; + } + + interface Row { + get(columnName: string|number): { [key:string]:any; }; + values(): Array<{ [key:string]:any; }>; + keys(): Array; + forEach(callback: Callback): void; + } + + interface TimeUuidStatic { + new (value?: Date, ticks?: number, nodeId?: string|Buffer, clockId?: string|Buffer): TimeUuid; + + fromDate(date: Date, ticks?: number, nodeId?: string|Buffer, clockId?: string|Buffer): TimeUuid; + fromString(value: string): TimeUuid; + min(date: Date, ticks?: number): TimeUuid; + max(date: Date, ticks?: number): TimeUuid; + now(nodeId?: string|Buffer, clockId?: string|Buffer): TimeUuid; + } + + interface TimeUuid extends Uuid { + getDatePrecision(): { date: Date, ticks: number }; + getDate(): Date; + getNodeId(): Buffer; + getNodeIdString(): string; + } + + interface TupleStatic { + new (...arguments: Array): Tuple; + + fromArray(elements: Array): Tuple; + } + + interface Tuple { + elements: Array; + length: number; + + get(index: number): any; + toString(): string; + toJSON(): string; + values(): Array; + } + + interface UuidStatic { + new (buffer: Buffer): Uuid; + + fromString(value: string): Uuid; + random(): Uuid; + } + + interface Uuid { + buffer: Buffer; + + getBuffer(): Buffer; + equals(other: types.Uuid): boolean; + toString(): string; + inspect(): string; + toJSON(): string; + } + } + + var Client: ClientStatic; + var Host: HostStatic; + var HostMap: HostMapStatic; + var Encoder: EncoderStatic; + + interface ClientOptions { + contactPoints: Array, + keyspace: string, + policies?: { + addressResolution?: policies.addressResolution.AddressTranslator, + loadBalancing?: policies.loadBalancing.LoadBalancingPolicy, + reconnection?: policies.reconnection.ReconnectionPolicy, + retry?: policies.retry.RetryPolicy + }, + queryOptions?: QueryOptions, + pooling?: { + heartBeatInterval: number, + coreConnectionsPerHost: { [key:number]:number; }, + warmup: boolean; + }, + protocolOptions?: { + port: number, + maxSchemaAgreementWaitSeconds: number, + maxVersion: number + }, + socketOptions?: { + connectTimeout: number, + defunctReadTimeoutThreshold: number, + keepAlive: boolean, + keepAliveDelay: number, + readTimeout: number, + tcpNoDelay: boolean, + coalescingThreshold: number + }, + authProvider?: auth.AuthProvider, + sslOptions?: any, + encoding?: { + map: Function, + set: Function, + copyBuffer: boolean, + useUndefinedAsUnset: boolean + } + } + + interface QueryOptions { + autoPage?: boolean; + captureStackTrace?: boolean; + consistency?: number; + customPayload?: any; + fetchSize?: number; + hints?: Array | Array>; + logged?: boolean; + pageState?: Buffer|string; + prepare?: boolean; + readTimeout?: number; + retry?: policies.retry.RetryPolicy; + retryOnTimeout?: boolean; + routingIndexes?: Array; + routingKey?: Buffer | Array; + routingNames?: Array; + serialConsistency?: number; + timestamp?: number | _Long; + traceQuery?: boolean; + } + + interface ClientStatic { + new(options?: ClientOptions): Client; + } + + interface Client extends events.EventEmitter { + hosts: HostMap; + keyspace: string; + metadata: metadata.Metadata; + + batch(queries: Array|Array<{query: string, params?: any}>, options: QueryOptions, callback: ResultCallback): void; + connect(callback: Callback): void; + eachRow(query: string, params?: any, options?: QueryOptions, rowCallback?: Callback, callback?: Callback): void; + execute(query: string, params?: any, options?: QueryOptions, callback?: ResultCallback): void; + getReplicas(keyspace: string, token: Buffer): Array; // TODO: Should this be a more explicit return? + shutdown(callback?: Callback): void; + stream(query: string, params?: any, options?: QueryOptions, callback?: Callback): NodeJS.ReadableStream; + } + + interface HostStatic { + new(address: string, protocolVersion: number, options: ClientOptions): Host; + } + + interface Host extends events.EventEmitter { + address: string; + cassandraVersion: string; + dataCenter: string; + rack: string; + tokens: Array; + + canBeConsideredAsUp(): boolean; + getCassandraVersion(): Array; + isUp(): boolean; + } + + interface HostMapStatic { + new (): HostMap; + } + + interface HostMap extends events.EventEmitter { + length: number; + + forEach(callback: Callback): void; + get(key: string): Host; + keys(): Array; + remove(key: string): void; + removeMultiple(keys: Array): void; + set(key: string, value: Host): void; + values(): Array; + } + + interface EncoderStatic { + new(protocolVersion: number, options: ClientOptions) : Encoder; + } + + interface Encoder { + decode(buffer: Buffer, type: {code: number, info?: any}): void; + encode(value: any, typeInfo?: string|number|{code: number, info?: any}): Buffer; + } + + namespace auth { + var Authenticator: AuthenticatorStatic; + var PlainTextAuthProvider: PlainTextAuthProviderStatic; + + interface AuthenticatorStatic { + new (): Authenticator; + } + + interface Authenticator { + evaluateChallenge(challenge: Buffer, callback: Callback): void; + initialResponse(callback: Callback): void; + onAuthenticationSuccess(token?: Buffer): void; + } + + interface AuthProvider { + newAuthenticator(endpoint: string, name: string): void; + } + + interface PlainTextAuthProviderStatic { + new (username: string, password: string): PlainTextAuthProvider; + } + + interface PlainTextAuthProvider extends AuthProvider { + newAuthenticator(endpoint: string, name: string): void; + } + } + + namespace errors { + abstract class DriverError { + constructor(message: string, constructor?: any); + } + + class ArgumentError extends DriverError { + constructor(message: string); + } + + class AuthenticationError extends DriverError { + constructor(message: string); + } + + class DriverInternalError extends DriverError { + constructor(message: string); + } + + class NoHostAvailableError extends DriverError { + constructor(innerErrors: any, message?: string); + } + + class NotSupportedError extends DriverError { + constructor(message: string); + } + + class OperationTimedOutError extends DriverError {} + + class ResponseError extends DriverError { + constructor(code: number, message: string); + } + } + + namespace metadata { + var Aggregate: AggregateStatic; + var Index: IndexStatic; + var MaterializedView: MaterializedViewStatic; + var Metadata: MetadataStatic; + var SchemaFunction: SchemaFunctionStatic; + var TableMetadata: TableMetadataStatic; + + type caching = "all" | "keys_only" | "rows_only" | "none"; + + interface AggregateStatic { + new (): Aggregate; + } + + interface Aggregate { + argumentTypes: Array<{ code: number, info: any}>; + finalFunction: string; + initCondition: string; + keyspaceName: string, + returnType: string; + signature: Array; + stateFunction: string; + stateType: string; + } + + interface DataTypeInfo { + code: number, + info: string | DataTypeInfo | Array, + options: { + frozen: boolean, + reversed: boolean + } + } + + interface ColumnInfo { + name: string, + type: DataTypeInfo + } + + interface DataCollection { + bloomFilterFalsePositiveChance: number; + caching: caching; + clusterKeys: Array<{ c: ColumnInfo, index: number, order: string }>; + clusteringOrder: Array; + columns: Array; + columnsByName: { [key: string]: ColumnInfo }; + comment: string; + compactionClass: string; + compactionOptions: any; + compression: any; + crcCheckChange?: number; + defaultTtl: number; + extensions: any; + gcGraceSeconds: number; + localReadRepairChance: number; + maxIndexInterval?: number; + minIndexInterval?: number; + name: string; + partitionKeys: Array<{ c: ColumnInfo, index: number }> + populateCacheOnFlush: boolean; + readRepairChance: number; + speculateRetry: string; + } + + enum IndexType { + custom = 0, + keys, + composites + } + + interface IndexStatic { + new (name: string, target: string, kind: IndexType, options: Object): Index; + + fromRows(indexRows: Array): Array; + fromColumnRows(columnRows: Array, columnsByName: { [key:string]: ColumnInfo }): Array; + } + + interface Index { + kind: IndexType; + name: string; + options: Object; + target: string; + + isCompositesKind(): boolean; + isCustomKind(): boolean; + isKeysKind(): boolean; + } + + interface MaterializedViewStatic { + new (name: string): MaterializedView; + } + + interface MaterializedView extends DataCollection {} + + interface MetadataStatic { + new (options: ClientOptions, controlConnection: any): Metadata; + } + + interface Metadata { + clearPrepared(): void; + + getAggregate(keyspaceName: string, name: string, signature: Array | Array<{ code: number, info: any }>, callback: Callback): void; + getAggregates(keyspaceName: string, name: string, callback: Callback): void; + getFunction(keyspaceName: string, name: string, signature: Array | Array<{ code: number, info: any }>, callback: Callback): void; + getFunctions(keyspaceName: string, name: string, callback: Callback): void; + getMaterializedView(keyspaceName: string, name: string, callback: Callback): void; + getReplicas(keyspaceName: string, tokenBuffer: Buffer): Array; + getTable(keyspaceName: string, name: string, callback: Callback): void; + getTrace(traceId: types.Uuid, callback: Callback): void; + getUdt(keyspaceName: string, name: string, callback: Callback): void; + refreshKeyspace(name: string, callback?: Callback): void; + refreshKeyspaces(callback?: Callback): void; + } + + interface SchemaFunctionStatic { + new (): SchemaFunction; + } + + interface SchemaFunction { + argumentNames: Array; + argumentTypes: Array<{ code: number, info: any}>; + body: string; + calledOnNullInput: boolean; + keyspaceName: string, + language: string; + name: string; + returnType: string; + signature: Array; + } + + interface TableMetadataStatic { + new (name: string): TableMetadata; + } + + interface TableMetadata extends DataCollection { + indexes: Array; + indexInterval?: number; + isCompact: boolean; + memtableFlushPeriod: number; + replicateOnWrite: boolean; + } + } +} diff --git a/cassandra-driver/cassandra-driver.tests.ts b/cassandra-driver/cassandra-driver.tests.ts new file mode 100644 index 0000000000..3eebf93018 --- /dev/null +++ b/cassandra-driver/cassandra-driver.tests.ts @@ -0,0 +1,11 @@ +/// + +import * as cassandra from 'cassandra-driver'; +import * as util from 'util'; + +var client = new cassandra.Client({ contactPoints: ['h1', 'h2'], keyspace: 'ks1'}); + +var query = 'SELECT email, last_name FROM user_profiles WHERE key=?'; +client.execute(query, ['guy'], function(err, result) { + console.log('got user profile with email ' + result.rows[0].email); +}); \ No newline at end of file diff --git a/chai-dom/chai-dom-tests.ts b/chai-dom/chai-dom-tests.ts new file mode 100644 index 0000000000..2fca54765e --- /dev/null +++ b/chai-dom/chai-dom-tests.ts @@ -0,0 +1,27 @@ +/// + +import * as chai from 'chai'; +import * as chaiDom from 'chai-dom'; + +chai.use(chaiDom); +var expect = chai.expect; + +function test() { + + var testElement = '
      '; + expect(testElement).to.have.attribute('foo', 'bar'); + expect(testElement).to.have.attr('foo').match(/bar/); + expect(testElement).to.have.class('foo'); + expect(testElement).to.have.id('id'); + expect(testElement).to.have.html('foo'); + expect(testElement).to.have.text('foo'); + expect(testElement).to.have.text(['foo', 'bar']); + expect(testElement).to.have.value('foo'); + expect(testElement).to.be.empty; + expect(testElement).to.have.length(2); + expect(testElement).to.exist; + expect(testElement).to.match('foo'); + expect(testElement).to.contain('foo'); + expect(testElement).to.contain(document.body); + +} \ No newline at end of file diff --git a/chai-dom/chai-dom.d.ts b/chai-dom/chai-dom.d.ts new file mode 100644 index 0000000000..64cf97f516 --- /dev/null +++ b/chai-dom/chai-dom.d.ts @@ -0,0 +1,46 @@ +// Type definitions for chai-dom +// Project: https://github.com/nathanboktae/chai-dom +// Definitions by: Matt Lewis +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare namespace Chai { + + interface Assertion { + + attr(name: string, value?: string): Assertion; + + attribute(name: string, value?: string): Assertion; + + class(className: string): Assertion; + + id(id: string): Assertion; + + html(html: string): Assertion; + + text(text: string|string[]): Assertion; + + value(text: string): Assertion; + + } + + interface Include { + + text(text: string|string[]): Assertion; + + html(text: string|string[]): Assertion; + + } + +} + +declare module "chai-dom" { + + function chaiDom(chai: any, utils: any): void; + + namespace chaiDom { + } + + export = chaiDom; +} diff --git a/chai-enzyme/chai-enzyme-tests.tsx b/chai-enzyme/chai-enzyme-tests.tsx new file mode 100644 index 0000000000..f85320cee0 --- /dev/null +++ b/chai-enzyme/chai-enzyme-tests.tsx @@ -0,0 +1,45 @@ +/// +/// +/// +/// + +import * as React from "react"; +import * as chaiEnzyme from "chai-enzyme"; +import { expect } from "chai"; +import { shallow } from "enzyme"; + +const Test = () =>
      ; + +class Test2 extends React.Component<{}, {}> { + render() { + return
      ; + } +} + +chai.use(chaiEnzyme()); + +const wrapper = shallow(); + +expect(wrapper).to.be.checked(); +expect(wrapper).to.have.className("test"); +expect(wrapper).to.have.descendants({ a: "b" }); +expect(wrapper).to.have.descendants(Test); +expect(wrapper).to.have.exactly(1).descendants(Test2); +expect(wrapper).to.have.descendants("div"); +expect(wrapper).to.be.disabled(); +expect(wrapper).to.be.blank(); +expect(wrapper).to.be.present(); +expect(wrapper).to.have.html("
      "); +expect(wrapper).to.have.id("test"); +expect(wrapper).to.have.ref("test"); +expect(wrapper).to.be.selected(); +expect(wrapper).to.have.tagName("div"); +expect(wrapper).to.have.text(""); +expect(wrapper).to.have.value("test"); +expect(wrapper).to.have.attr("test", "test"); +expect(wrapper).to.have.data("test", "Test"); +expect(wrapper).to.have.style("background", "green"); +expect(wrapper).to.have.state("test", "test"); +expect(wrapper).to.have.prop("test", 5); +expect(wrapper).to.contain(); +expect(wrapper).to.match(); diff --git a/chai-enzyme/chai-enzyme.d.ts b/chai-enzyme/chai-enzyme.d.ts new file mode 100644 index 0000000000..21e463dac5 --- /dev/null +++ b/chai-enzyme/chai-enzyme.d.ts @@ -0,0 +1,153 @@ +// Type definitions for chai-enzyme 0.5.0 +// Project: https://github.com/producthunt/chai-enzyme +// Definitions by: Alexey Svetliakov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + + +/// +/// +/// + +declare namespace Chai { + type EnzymeSelector = string | __React.StatelessComponent | __React.ComponentClass | { [key: string]: any }; + + interface Match { + /** + * Assert that the wrapper matches given selector: + * @param selector + */ + (selector: EnzymeSelector): Assertion; + } + interface Include { + /** + * Assert that the wrapper contains a given node: + * @param code + */ + (selector: EnzymeSelector): Assertion; + } + interface Assertion { + /** + * Assert that the given wrapper is checked: + */ + checked(): Assertion; + + /** + * Assert that the wrapper has a given class: + * @param name + */ + className(name: string): Assertion; + + /** + * Assert that the wrapper contains a descendant matching the given selector: + * @param selector + */ + descendants(selector?: EnzymeSelector): Assertion; + + /** + * Assert that the wrapper contains an exact amount of descendants matching the given selector: + */ + exactly(count?: number): Assertion; + + /** + * Assert that the given wrapper is disabled: + */ + disabled(): Assertion; + + /** + * Assert that the given wrapper is empty: + */ + blank(): Assertion; + + /** + * Assert that the given wrapper exists: + */ + present(): Assertion; + + /** + * Assert that the wrapper has given html: + * @param str + */ + html(str?: string): Assertion; + + /** + * Assert that the wrapper has given ID attribute: + * @param str + */ + id(str: string): Assertion; + + /** + * Assert that the wrapper has a given ref + * @param key + */ + ref(key: string): Assertion; + + /** + * Assert that the given wrapper is selected: + */ + selected(): Assertion; + + /** + * Assert that the given wrapper has the tag name: + * @param str + */ + tagName(str: string): Assertion; + + /** + * Assert that the given wrapper has the supplied text: + * @param str + */ + text(str?: string): Assertion; + + /** + * Assert that the given wrapper has given value: + * @param str + */ + value(str: string): Assertion; + + /** + * Assert that the wrapper has given attribute [with value]: + * @param key + * @param val + */ + attr(key: string, val?: string): Assertion; + + /** + * Assert that the wrapper has a given data attribute [with value]: + * @param key + * @param val + */ + data(key: string, val?: string): Assertion; + + /** + * Assert that the wrapper has given style: + * @param key + * @param val + */ + style(key: string, val?: string): Assertion; + + /** + * Assert that the wrapper has given state [with value]: + * @param key + * @param val + */ + state(key: string, val?: any): Assertion; + + /** + * Assert that the wrapper has given prop [with value]: + * @param key + * @param val + */ + prop(key: string, val?: any): Assertion; + } +} + +declare module "chai-enzyme" { + import { ShallowWrapper, ReactWrapper, CheerioWrapper } from "enzyme"; + + type DebugWrapper = ShallowWrapper | CheerioWrapper | ReactWrapper; + function chaiEnzyMe(wrapper?: (debugWrapper: DebugWrapper) => string): (chai: any) => void; + + module chaiEnzyMe { + } + export = chaiEnzyMe; +} diff --git a/chai-jquery/chai-jquery.d.ts b/chai-jquery/chai-jquery.d.ts index 3d287f30fc..e7256bb7ab 100644 --- a/chai-jquery/chai-jquery.d.ts +++ b/chai-jquery/chai-jquery.d.ts @@ -17,7 +17,7 @@ declare namespace Chai { html(html: string): Assertion; text(text: string): Assertion; value(text: string): Assertion; - (selector: string): Assertion; + descendants(selector: string): Assertion; visible: Assertion; hidden: Assertion; selected: Assertion; diff --git a/chai-things/chai-things.d.ts b/chai-things/chai-things.d.ts index 823329808c..2636c9dcea 100644 --- a/chai-things/chai-things.d.ts +++ b/chai-things/chai-things.d.ts @@ -1,7 +1,7 @@ // Type definitions for chai-things // Project: https://github.com/chaijs/chai-things // Definitions by: David Broder-Rodgers -// Definitions: https://github.com/DavidBR-SW/DefinitelyTyped +// Definitions: https://github.com/borisyankov/DefinitelyTyped /// @@ -25,14 +25,14 @@ declare namespace Chai { interface Anything extends Assertion { (): any; - that: Assertion - with: Assertion + that: Assertion; + with: Assertion; } interface Something extends Assertion { (): any; - that: Assertion - with: Assertion + that: Assertion; + with: Assertion; } interface Item { diff --git a/chai/chai-3.2.0-tests.ts b/chai/chai-3.2.0-tests.ts index 9b646b1529..cb1b74b8f1 100644 --- a/chai/chai-3.2.0-tests.ts +++ b/chai/chai-3.2.0-tests.ts @@ -1930,6 +1930,24 @@ suite('assert', () => { }, 'expected 5 to be below 5'); }); + test('isAtLeast', () => { + assert.isAtLeast(5, 3); + assert.isAtLeast(5, 5); + + err(() => { + assert.isAtLeast(3, 5); + }, 'expected 3 to be greater than or equal to 5'); + }); + + test('isAtMost', () => { + assert.isAtMost(3, 5); + assert.isAtMost(5, 5); + + err(() => { + assert.isAtMost(5, 3); + }, 'expected 5 to be less than or equal to 3'); + }); + test('extensible', () => { assert.extensible({}); }); test('isExtensible', () => { assert.isExtensible({}); }); test('notExtensible', () => { assert.notExtensible(Object.preventExtensions({})); }); diff --git a/chai/chai-3.2.0.d.ts b/chai/chai-3.2.0.d.ts index 87b0c08e6f..6dc653b72f 100644 --- a/chai/chai-3.2.0.d.ts +++ b/chai/chai-3.2.0.d.ts @@ -271,6 +271,9 @@ declare namespace Chai { isAbove(val: number, abv: number, msg?: string): void; isBelow(val: number, blw: number, msg?: string): void; + isAtMost(val: number, atmst: number, msg?: string): void; + isAtLeast(val: number, atlst: number, msg?: string): void; + isFunction(val: any, msg?: string): void; isNotFunction(val: any, msg?: string): void; diff --git a/chai/chai.d.ts b/chai/chai.d.ts index 0ebc855022..8eb0995947 100644 --- a/chai/chai.d.ts +++ b/chai/chai.d.ts @@ -378,7 +378,20 @@ declare namespace Chai { } export interface Config { + /** + * Default: false + */ includeStack: boolean; + + /** + * Default: true + */ + showDiff: boolean; + + /** + * Default: 40 + */ + truncateThreshold: number; } export class AssertionError { diff --git a/chart.js/chart.js.d.ts b/chart.js/chart.js.d.ts new file mode 100644 index 0000000000..e05d930d4e --- /dev/null +++ b/chart.js/chart.js.d.ts @@ -0,0 +1,410 @@ +// Type definitions for Chart.js +// Project: https://github.com/nnnick/Chart.js +// Definitions by: Alberto Nuti +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare enum ChartType { + line, bar, radar, doughnut, polarArea, bubble +} +declare enum TimeUnit { + millisecond, second, minute, + hour, day, week, + month, quarter, year +} +interface ChartLegendItem { + text?: string; + fillStyle?: string; + hidden?: boolean; + lineCap?: string; + lineDash?: number[]; + lineDashOffset?: number; + lineJoin?: string; + lineWidth?: number; + strokeStyle?: string; +} +interface ChartTooltipItem { + xLabel?: string; + yLabel?: string; + datasetIndex?: number; + index?: number; +} +interface ChartTooltipCallback { + beforeTitle?: (item?: ChartTooltipItem[], data?: any) => void; + title?: (item?: ChartTooltipItem[], data?: any) => void; + afterTitle?: (item?: ChartTooltipItem[], data?: any) => void; + beforeBody?: (item?: ChartTooltipItem[], data?: any) => void; + beforeLabel?: (tooltipItem?: ChartTooltipItem, data?: any) => void; + label?: (tooltipItem?: ChartTooltipItem, data?: any) => void; + afterLabel?: (tooltipItem?: ChartTooltipItem, data?: any) => void; + afterBody?: (item?: ChartTooltipItem[], data?: any) => void; + beforeFooter?: (item?: ChartTooltipItem[], data?: any) => void; + footer?: (item?: ChartTooltipItem[], data?: any) => void; + afterfooter?: (item?: ChartTooltipItem[], data?: any) => void; +} +interface ChartAnimationParameter { + chartInstance?: any; + animationObject?: any; +} +interface ChartPoint { + x?: number; + y?: number; +} + +interface ChartConfiguration { + type?: string; + data?: ChartData; + options?: ChartOptions; +} + +interface ChartData { + +} + +interface LinearChartData extends ChartData { + labels?: string[]; + datasets?: ChartDataSets[]; +} + +interface ChartOptions { + responsive?: boolean; + responsiveAnimationDuration?: number; + maintainAspectRatio?: boolean; + events?: string[]; + onClick?: (any?: any) => any; + title?: ChartTitleOptions; + legend?: ChartLegendOptions; + tooltip?: ChartTooltipOptions; + hover?: ChartHoverOptions; + animation?: ChartAnimationOptions; + elements?: ChartElementsOptions; + scales?: ChartScales; +} + +interface ChartFontOptions { + defaultFontColor?: ChartColor; + defaultFontFamily?: string; + defaultFontSize?: number; + defaultFontStyle?: string; +} + +interface ChartTitleOptions { + display?: boolean; + position?: string; + fullWdith?: boolean; + fontSize?: number; + fontFamily?: string; + fontColor?: ChartColor; + fontStyle?: string; + padding?: number; + text?: string; +} + +interface ChartLegendOptions { + display?: boolean; + position?: string; + fullWidth?: boolean; + onClick?: (event: any, legendItem: any) => void; + labels?: ChartLegendLabelOptions; +} + +interface ChartLegendLabelOptions { + boxWidth?: number; + fontSize?: number; + fontStyle?: number; + fontColor?: ChartColor; + fontFamily?: string; + padding?: number; + generateLabels?: (chart: any) => any; +} + +interface ChartTooltipOptions { + enabled?: boolean; + custom?: (a: any) => void; + mode?: string; + backgroundColor?: ChartColor; + titleFontFamily?: string; + titleFontSize?: number; + titleFontStyle?: string; + titleFontColor?: ChartColor; + titleSpacing?: number; + titleMarginBottom?: number; + bodyFontFamily?: string; + bodyFontSize?: number; + bodyFontStyle?: string; + bodyFontColor?: ChartColor; + bodySpacing?: number; + footerFontFamily?: string; + footerFontSize?: number; + footerFontStyle?: string; + footerFontColor?: ChartColor; + footerSpacing?: number; + footerMarginTop?: number; + xPadding?: number; + yPadding?: number; + caretSize?: number; + cornerRadius?: number; + multiKeyBackground?: string; + callbacks?: ChartTooltipCallback; +} + +interface ChartHoverOptions { + mode?: string; + animationDuration?: number; + onHover?: (active: any) => void; +} + +interface ChartAnimationObject { + currentStep?: number; + numSteps?: number; + easing?: string; + render?: (arg: any) => void; + onAnimationProgress?: (arg: any) => void; + onAnimationComplete?: (arg: any) => void; +} + +interface ChartAnimationOptions { + duration?: number; + easing?: string; + onProgress?: (chart: any) => void; + onComplete?: (chart: any) => void; +} + +interface ChartElementsOptions { + point?: ChartPointOptions; + line?: ChartLineOptions; + arg?: ChartArcOtpions; + rectangle?: ChartRectangleOptions; +} + +interface ChartArcOtpions { + backgroundColor?: ChartColor; + borderColor?: ChartColor; + borderWidth?: number; +} + +interface ChartLineOptions { + tension?: number; + backgroundColor?: ChartColor; + borderWidth?: number; + borderColor?: ChartColor; + borderCapStyle?: string; + borderDash?: any[]; + borderDashOffset?: number; + borderJoinStyle?: string; +} + +interface ChartPointOptions { + radius?: number; + pointStyle?: string; + backgroundColor?: ChartColor; + borderWidth?: number; + borderColor?: ChartColor; + hitRadius?: number; + hoverRadius?: number; + hoverBorderWidth?: number; +} + +interface ChartRectangleOptions { + backgroundColor?: ChartColor; + borderWidth?: number; + borderColor?: ChartColor; + borderSkipped?: string; +} +interface GridLineOptions { + display?: boolean; + color?: ChartColor; + lineWidth?: number; + drawBorder?: boolean; + drawOnChartArea?: boolean; + drawticks?: boolean; + tickMarkLength?: number; + zeroLineWidth?: number; + zeroLineColor?: ChartColor; + offsetGridLines?: boolean; +} + +interface ScaleTitleOptions { + display?: boolean; + labelString?: string; + fontColor?: ChartColor; + fontFamily?: string; + fontSize?: number; + fontStyle?: string; +} + +interface TickOptions { + autoSkip?: boolean; + callback?: (value: any, index: any, values: any) => string; + display?: boolean; + fontColor?: ChartColor; + fontFamily?: string; + fontSize?: number; + fontStyle?: string; + labelOffset?: number; + maxRotation?: number; + minRotation?: number; + mirror?: boolean; + padding?: number; + reverse?: boolean; + min?: any; + max?: any; +} +interface AngleLineOptions { + display?: boolean; + color?: ChartColor; + lineWidth?: number; +} + +interface PointLabelOptions { + callback?: (arg: any) => any; + fontColor?: ChartColor; + fontFamily?: string; + fontSize?: number; + fontStyle?: string; +} + +interface TickOptions { + backdropColor?: ChartColor; + backdropPaddingX?: number; + backdropPaddingY?: number; + maxTicksLimit?: number; + showLabelBackdrop?: boolean; +} +interface LinearTickOptions extends TickOptions { + beginAtZero?: boolean; + min?: number; + max?: number; + maxTicksLimit?: number; + stepSize?: number; + suggestedMin?: number; + suggestedMax?: number; +} + +interface LogarithmicTickOptions extends TickOptions { + min?: number; + max?: number; +} + +type ChartColor = string | CanvasGradient | CanvasPattern; + +interface ChartDataSets { + backgroundColor?: ChartColor; + borderWidth?: number; + borderColor?: ChartColor; + borderCapStyle?: string; + borderDash?: number[]; + borderDashOffset?: number; + borderJoinStyle?: string; + data?: number[] | ChartPoint[]; + fill?: boolean; + label?: string; + lineTension?: number; + pointBorderColor?: ChartColor | ChartColor[]; + pointBackgroundColor?: ChartColor | ChartColor[]; + pointBorderWidth?: number | number[]; + pointRadius?: number | number[]; + pointHoverRadius?: number | number[]; + pointHitRadius?: number | number[]; + pointHoverBackgroundColor?: ChartColor | ChartColor[]; + pointHoverBorderColor?: ChartColor | ChartColor[]; + pointHoverBorderWidth?: number | number[]; + pointStyle?: string | string[] | HTMLImageElement | HTMLImageElement[]; + xAxisID?: string; + yAxisID?: string; +} + +interface ChartScales { + type?: string; + display?: boolean; + position?: string; + beforeUpdate?: (scale?: any) => void; + beforeSetDimension?: (scale?: any) => void; + beforeDataLimits?: (scale?: any) => void; + beforeBuildTicks?: (scale?: any) => void; + beforeTickToLabelConversion?: (scale?: any) => void; + beforeCalculateTickRotation?: (scale?: any) => void; + beforeFit?: (scale?: any) => void; + afterUpdate?: (scale?: any) => void; + afterSetDimension?: (scale?: any) => void; + afterDataLimits?: (scale?: any) => void; + afterBuildTicks?: (scale?: any) => void; + afterTickToLabelConversion?: (scale?: any) => void; + afterCalculateTickRotation?: (scale?: any) => void; + afterFit?: (scale?: any) => void; + gridLines?: GridLineOptions; + scaleLabel?: ScaleTitleOptions; + ticks?: TickOptions; + xAxes?: ChartXAxe[]; + yAxes?: ChartYAxe[]; +} + +interface ChartXAxe { + type?: string; + display?: boolean; + id?: string; + stacked?: boolean; + categoryPercentage?: number; + barPercentage?: number; + gridLines?: GridLineOptions; + position?: string; + ticks?: TickOptions; + time?: TimeScale; + scaleLabel?: ScaleTitleOptions; +} + +interface ChartYAxe { + type?: string; + display?: boolean; + id?: string; + stacked?: boolean; + position?: string; + ticks?: TickOptions; + scaleLabel?: ScaleTitleOptions; +} + +interface LinearScale extends ChartScales { + ticks?: LinearTickOptions; +} + +interface LogarithmicScale extends ChartScales { + ticks?: LogarithmicTickOptions; +} + +interface TimeScale extends ChartScales { + format?: string; + displayFormats?: string; + isoWeekday?: boolean; + max?: string; + min?: string; + parser?: string | ((arg: any) => any); + round?: string; + tooltipFormat?: string; + unit?: TimeUnit; + unitStepSize?: number; +} + +interface RadialLinearScale { + lineArc?: boolean; + angleLines?: AngleLineOptions; + pointLabels?: PointLabelOptions; + ticks?: TickOptions; +} + +declare var Chart: { + new (context: CanvasRenderingContext2D, options: ChartConfiguration): {}; + destroy: () => {}; + update: (duration: any, lazy: any) => {}; + render: (duration: any, lazy: any) => {}; + stop: () => {}; + resize: () => {}; + clear: () => {}; + toBase64: () => string; + generateLegend: () => {}; + getElementAtEvent: (e: any) => {}; + getElementsAtEvent: (e: any) => {}[]; + getDatasetAtEvent: (e: any) => {}[]; + + defaults: { + global: ChartOptions; + } +}; diff --git a/chartist/chartist.d.ts b/chartist/chartist.d.ts index 6c679dc1d8..0e92364812 100644 --- a/chartist/chartist.d.ts +++ b/chartist/chartist.d.ts @@ -105,7 +105,7 @@ declare namespace Chartist { plugins?: Array; // all of these plugins seem to be functions with options, but keeping type any for now update(data: Object, options?: T, override?: boolean): void; - detatch(): void; + detach(): void; /** * Use this function to register event handlers. The handler callbacks are synchronous and will run in the main thread rather than the event loop. diff --git a/chosen/chosen-tests.ts b/chosen/chosen-tests.ts index 818b1e1261..764b57fb0e 100644 --- a/chosen/chosen-tests.ts +++ b/chosen/chosen-tests.ts @@ -1,8 +1,26 @@ /// -$(".chzn-select").chosen({ no_results_text: "No results matched" }); -$("#form_field").chosen().change(); -$("#form_field").trigger("liszt:updated"); +// Options +$(".my_select_box").chosen(); -$(".chzn-select").chosen(); -$(".chzn-select-deselect").chosen({ allow_single_deselect: true }); \ No newline at end of file +$(".my_select_box").chosen({}); + +$(".my_select_box").chosen({ + disable_search_threshold: 10, + max_selected_options: 5, + no_results_text: "Oops, nothing found!", + width: "95%" +}); + +// Destroy +$(".my_select_box").chosen("destroy"); + +// Triggered Events +$(".my_select_box").on("change", function(evt, params) { + evt.preventDefault(); + let s = params.selected; + console.log(s); +}); + +// Triggerable Events +$(".my_select_box").trigger("chosen:updated"); diff --git a/chosen/chosen.jquery.d.ts b/chosen/chosen.jquery.d.ts index 0033bfdd1d..c7f7c6b7ee 100644 --- a/chosen/chosen.jquery.d.ts +++ b/chosen/chosen.jquery.d.ts @@ -1,30 +1,98 @@ -// Type definitions for Chosen.JQuery 1.4.2 +// Type definitions for Chosen.JQuery 1.6.1 // Project: http://harvesthq.github.com/chosen/ -// Definitions by: Boris Yankov +// Definitions by: Boris Yankov , denis // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - /// -interface ChosenOptions { - allow_single_deselect?: boolean; - disable_search?: boolean; - disable_search_threshold?: number; - enable_split_word_search?: boolean; - inherit_select_classes?: boolean; - max_selected_options?: number; - no_results_text?: string; - placeholder_text_multiple?: string; - placeholder_text_single?: string; - search_contains?: boolean; - single_backstroke_delete?: boolean; - width?: number|string; - display_disabled_options?: boolean; - display_selected_options?: boolean; - include_group_label_in_selected?: boolean; +declare namespace Chosen { + type OnEvent = "chosen:ready" | "chosen:maxselected" | "chosen:showing_dropdown" | "chosen:hiding_dropdown" | "chosen:no_results"; + type TriggerEvent = "chosen:updated" | "chosen:activate" | "chosen:open" | "chosen:close"; + + interface Options { + /**When set to true on a single select, Chosen adds a UI element which selects the first element (if it is blank). + * @default: false + */ + allow_single_deselect?: boolean; + /**By default Chosen's search is case-insensitive. Setting this option to true makes the search case-sensitive. + * @default: false + */ + case_sensitive_search?: boolean; + /**When set to true, Chosen will not display the search field (single selects only). + * @default: false + */ + disable_search?: boolean; + /**Hide the search input on single selects if there are n or fewer options. + * @default: 0 + */ + disable_search_threshold?: number; + /**By default, searching will match on any word within an option tag. Set this option to false if you want to only match on the entire text of an option tag. + * @default: true + */ + enable_split_word_search?: boolean; + /**When set to true, Chosen will grab any classes on the original select field and add them to Chosen’s container div. + * @default: false + */ + inherit_select_classes?: boolean; + /**Limits how many options the user can select. When the limit is reached, the chosen:maxselected event is triggered. + * @default: Infinity + */ + max_selected_options?: number; + /**The text to be displayed when no matching results are found. The current search is shown at the end of the text (e.g., No results match "Bad Search"). + * @default: "No results match" + */ + no_results_text?: string; + /**The text to be displayed as a placeholder when no options are selected for a multiple select. + * @default: "Select Some Options" + */ + placeholder_text_multiple?: string; + /**The text to be displayed as a placeholder when no options are selected for a single select. + * @default: "Select an Option" + */ + placeholder_text_single?: string; + /**By default, Chosen’s search matches starting at the beginning of a word. Setting this option to true allows matches starting from anywhere within a word. This is especially useful for options that include a lot of special characters or phrases in ()s and []s. + * @default: false + */ + search_contains?: boolean; + /**By default, pressing delete/backspace on multiple selects will remove a selected choice. When false, pressing delete/backspace will highlight the last choice, and a second press deselects it. + * @default: true + */ + single_backstroke_delete?: boolean; + /**The width of the Chosen select box. By default, Chosen attempts to match the width of the select box you are replacing. If your select is hidden when Chosen is instantiated, you must specify a width or the select will show up with a width of 0. */ + width?: string; + /**By default, Chosen includes disabled options in search results with a special styling. Setting this option to false will hide disabled results and exclude them from searches. + * @default: true + */ + display_disabled_options?: boolean; + /**By default, Chosen includes selected options in search results with a special styling. Setting this option to false will hide selected results and exclude them from searches. + * Note: this is for multiple selects only. In single selects, the selected result will always be displayed. + * @default: true + */ + display_selected_options?: boolean; + /**By default, Chosen only shows the text of a selected option. Setting this option to true will show the text and group (if any) of the selected option. + * @default: false + */ + include_group_label_in_selected?: boolean; + /**Only show the first (n) matching options in the results. This can be used to increase performance for selects with very many options. + * @default: Infinity + */ + max_shown_results?: number; + } + + interface SelectedData { + selected: string; + deselected: string; + } } interface JQuery { chosen(): JQuery; - chosen(options: ChosenOptions): JQuery; + chosen(options: Chosen.Options | "destroy"): JQuery; + + /**Chosen triggers the standard DOM event whenever a selection is made (it also sends a selected or deselected parameter that tells you which option was changed). */ + on(events: "change", handler: (eventObject: JQueryEventObject, args: Chosen.SelectedData) => any): JQuery; + + on(events: Chosen.OnEvent, handler: (eventObject: JQueryEventObject) => any): JQuery; + + trigger(eventType: Chosen.TriggerEvent): JQuery; } diff --git a/chroma-js/chroma-js-0.5.6-tests.ts b/chroma-js/chroma-js-0.5.6-tests.ts new file mode 100644 index 0000000000..cb8b593d26 --- /dev/null +++ b/chroma-js/chroma-js-0.5.6-tests.ts @@ -0,0 +1,120 @@ +/// + +function test_chroma() { + chroma("red"); + chroma("#ff0000"); + chroma("#f00"); + chroma("FF0000"); + chroma(255, 0, 0); + chroma([255, 0, 0]); + chroma(0, 1, 0.5, 'hsl'); + chroma([0, 1, 0.5], 'hsl'); + chroma(0, 1, 1, 'hsv'); + chroma("rgb(255,0,0)"); + chroma("rgb(100%,0%,0%)"); + chroma("hsl(0,100%,50%)"); + chroma(53.24, 80.09, 67.20, 'lab'); + chroma(53.24, 104.55, 40, 'lch'); + chroma(1, 0, 0, 'gl'); + + chroma.hex("#ff0000"); + chroma.hex("red"); + chroma.hex("rgb(255, 0, 0)"); + + chroma.rgb(255, 0, 0); + chroma.hsl(0, 1, 0.5); + chroma.hsv(120, 0.5, 0.5); + chroma.lab(53.24, 80.09, 67.20); + chroma.lch(53.24, 104.55, 40); + chroma.gl(1, 0, 0); + + chroma.interpolate('white', 'black', 0) // #ffffff + chroma.interpolate('white', 'black', 1) // #000000 + chroma.interpolate('white', 'black', 0.5) // #7f7f7f + chroma.interpolate('white', 'black', 0.5, 'hsv') // #808080 + chroma.interpolate('white', 'black', 0.5, 'lab') // #777777 + + chroma.interpolate('rgba(0,0,0,0)', 'rgba(255,0,0,1)', 0.5).css() //"rgba(127.5,0,0,0.5)" + + var bezInterpolator = chroma.interpolate.bezier(['white', 'yellow', 'red', 'black']); + bezInterpolator(0).hex() // #ffffff + bezInterpolator(0.33).hex() // #ffcc67 + bezInterpolator(0.66).hex() // #b65f1a + bezInterpolator(1).hex() // #000000 + + chroma.luminance('black') // 0 + chroma.luminance('white') // 1 + chroma.luminance('#ff0000') // 0.2126 + + chroma.contrast('white', 'navy') // 16.00 – ok + chroma.contrast('white', 'yellow') // 1.07 – not ok! +} + +function test_color() { + chroma('red').hex() // "#FF0000"" + chroma('red').rgb() // [255, 0, 0] + chroma('red').hsv() // [0, 1, 1] + chroma('red').hsl() // [0, 1, 0.5] + chroma('red').lab() // [53.2407, 80.0924, 67.2031] + chroma('red').lch() // [53.2407, 104.5517, 39.9990] + chroma('red').rgba() // [255, 0, 0, 1] + chroma('red').css() // "rgb(255,0,0)" + chroma('red').alpha(0.7).css() // "rgba(255,0,0,0.7)" + chroma('red').css('hsl') // "hsl(0,100%,50%)" + chroma('red').alpha(0.7).css('hsl') // "hsla(0,100%,50%,0.7)" + chroma('blue').css('hsla') // "hsla(240,100%,50%,1)" + + var red = chroma('red'); + red.alpha(0.5); + red.css(); // rgba(255,0,0,0.5); + + chroma('red').darken().hex() // #BC0000 + chroma('red').brighten().hex() // #FF603B + chroma('#eecc99').saturate().hex() // #fcc973 + chroma('red').desaturate().hex() // #ec3d23 + + chroma('black').luminance() // 0 + chroma('white').luminance() // 1 + chroma('red').luminance() // 0.2126 +} + +function test_scale() { + var scale = chroma.scale(['lightyellow', 'navy']); + scale(0.5); // #7F7FB0 + + chroma.scale('RdYlBu'); + + var col = scale(0.5); + col.hex(); // #7F7FB0 + col.rgb(); // [127.5, 127.5, 176] + + scale = chroma.scale(['lightyellow', 'navy']).out('hex'); + scale(0.5); // "#7F7FB0" + + var scale = chroma.scale(['lightyellow', 'navy']); + scale.mode('hsv')(0.5); // #54C08A + scale.mode('hsl')(0.5); // #31FF98 + scale.mode('lab')(0.5); // #967CB2 + scale.mode('lch')(0.5); // #D26662 + + var scale = chroma.scale(['lightyellow', 'navy']).domain([0, 400]); + scale(200); // #7F7FB0 + + var scale = chroma.scale(['lightyellow', 'navy']).domain([0, 100, 200, 300, 400]); + scale(98); // #7F7FB0 + scale(99); // #7F7FB0 + scale(100); // #AAAAC0 + scale(101); // #AAAAC0 + + chroma.scale(['#eee', '#900']).domain([0, 400], 7); + chroma.scale(['#eee', '#900']).domain([1, 1000000], 7, 'log'); + chroma.scale(['#eee', '#900']).domain([1, 1000000], 5, 'quantiles'); + chroma.scale(['#eee', '#900']).domain([1, 1000000], 5, 'k-means'); + chroma.scale(['white', 'red']).domain([0, 100], 4).domain() // [0, 25, 50, 75, 100] + + chroma.scale().range(['lightyellow', 'navy']); + + chroma.scale(['lightyellow', 'navy']).correctLightness(true); + + chroma.scale('RdYlGn').domain([0,1], 5).colors() +} diff --git a/chroma-js/chroma-js-0.5.6.d.ts b/chroma-js/chroma-js-0.5.6.d.ts new file mode 100644 index 0000000000..5d785eda27 --- /dev/null +++ b/chroma-js/chroma-js-0.5.6.d.ts @@ -0,0 +1,317 @@ +// Type definitions for Chroma.js v0.5.6 +// Project: https://github.com/gka/chroma.js +// Definitions by: Sebastian Brückner +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * Chroma.js is a tiny library for all kinds of color conversions and color scales. + */ +declare namespace Chroma { + + export interface ChromaStatic { + /** + * Creates a color from a string representation (as supported in CSS). + * + * @param color The string to convert to a color. + * @return the color object. + */ + (color: string): Color; + + /** + * Create a color in the specified color space using a, b and c as values. + * + * @param a + * @param b + * @param c + * @param colorSpace The color space to use (one of "rgb", "hsl", "hsv", "lab", "lch", "gl"). Defaults to "rgb". + * @return the color object. + */ + (a: number, b: number, c: number, colorSpace?: string): Color; + + /** + * Create a color in the specified color space using values. + * + * @param values An array of values (e.g. [r, g, b, a?]). + * @param colorSpace The color space to use (one of "rgb", "hsl", "hsv", "lab", "lch", "gl"). Defaults to "rgb". + * @return the color object. + */ + (values: number[], colorSpace?: string): Color; + + /** + * Create a color in the specified color space using a, b and c as values. + * + * @param a + * @param b + * @param c + * @param colorSpace The color space to use (one of "rgb", "hsl", "hsv", "lab", "lch", "gl"). Defaults to "rgb". + * @return the color object. + */ + color(a: number, b: number, c: number, colorSpace?: string): Color; + + /** + * Calculate the contrast ratio of two colors. + * + * @param color1 The first color. + * @param color2 The second color. + * @return the contrast ratio. + */ + contrast(color1: Color, color2: Color): number; + /** + * Calculate the contrast ratio of two colors. + * + * @param color1 The first color. + * @param color2 The second color. + * @return the contrast ratio. + */ + contrast(color1: Color, color2: string): number; + /** + * Calculate the contrast ratio of two colors. + * + * @param color1 The first color. + * @param color2 The second color. + * @return the contrast ratio. + */ + contrast(color1: string, color2: Color): number; + /** + * Calculate the contrast ratio of two colors. + * + * @param color1 The first color. + * @param color2 The second color. + * @return the contrast ratio. + */ + contrast(color1: string, color2: string): number; + + /** + * Create a color from a hex or string representation (as supported in CSS). + * + * This is an alias of chroma.hex(). + * + * @param color The string to convert to a color. + * @return the color object. + */ + css(color: string): Color; + + /** + * Create a color from a hex or string representation (as supported in CSS). + * + * This is an alias of chroma.css(). + * + * @param color The string to convert to a color. + * @return the color object. + */ + hex(color: string): Color; + + rgb(red: number, green: number, blue: number, alpha?: number): Color; + hsl(hue: number, saturation: number, lightness: number, alpha?: number): Color; + hsv(hue: number, saturation: number, value: number, alpha?: number): Color; + lab(lightness: number, a: number, b: number, alpha?: number): Color; + lch(lightness: number, chroma: number, hue: number, alpha?: number): Color; + gl(red: number, green: number, blue: number, alpha?: number): Color; + + interpolate: InterpolateFunction; + mix: InterpolateFunction; + + luminance(color: Color): number; + luminance(color: string): number; + + /** + * Creates a color scale using a pre-defined color scale. + * + * @param name The name of the color scale. + * @return the resulting color scale. + */ + scale(name: string): Scale; + + /** + * Creates a color scale function from the given set of colors. + * + * @param colors An Array of at least two color names or hex values. + * @return the resulting color scale. + */ + scale(colors?: string[]): Scale; + + scales: PredefinedScales; + } + + interface InterpolateFunction { + (color1: Color, color2: Color, f: number, mode?: string): Color; + (color1: Color, color2: string, f: number, mode?: string): Color; + (color1: string, color2: Color, f: number, mode?: string): Color; + (color1: string, color2: string, f: number, mode?: string): Color; + + bezier(colors: any[]): (t: number) => Color; + } + + interface PredefinedScales { + [key: string]: Scale; + + cool: Scale; + hot: Scale; + } + + export interface Color { + /** + * Creates a color from a string representation (as supported in CSS). + * + * @param color The string to convert to a color. + */ + new(color: string): Color; + + /** + * Create a color in the specified color space using a, b and c as values. + * + * @param a + * @param b + * @param c + * @param colorSpace The color space to use (one of "rgb", "hsl", "hsv", "lab", "lch", "gl"). Defaults to "rgb". + */ + new(a: number, b: number, c: number, colorSpace?: string): Color; + + /** + * Create a color in the specified color space using a, b and c as color values and alpha as the alpha value. + * + * @param a + * @param b + * @param c + * @param alpha The alpha value of the color. + * @param colorSpace The color space to use (one of "rgb", "hsl", "hsv", "lab", "lch", "gl"). Defaults to "rgb". + */ + new(a: number, b: number, c: number, alpha: number, colorSpace?: string): Color; + + /** + * Create a color in the specified color space using values. + * + * @param values An array of values (e.g. [r, g, b, a?]). + * @param colorSpace The color space to use (one of "rgb", "hsl", "hsv", "lab", "lch", "gl"). Defaults to "rgb". + */ + new(values: number[], colorSpace: string): Color; + + /** + * Convert this color to CSS hex representation. + * + * @return this color's hex representation. + */ + hex(): string; + + /** + * @return the relative luminance of the color, which is a value between 0 (black) and 1 (white). + */ + luminance(): number; + + /** + * @return the X11 name of this color or its hex value if it does not have a name. + */ + name(): string; + + /** + * @return the alpha value of the color. + */ + alpha(): number; + + /** + * Set the alpha value. + * + * @param alpha The alpha value. + * @return this + */ + alpha(alpha: number): Color; + + css(mode?: string): string; + + interpolate(color: Color, f: number, mode?: string): Color; + interpolate(color: string, f: number, mode?: string): Color; + + premultiply(): Color; + + rgb(): number[]; + rgba(): number[]; + hsl(): number[]; + hsv(): number[]; + lab(): number[]; + lch(): number[]; + hsi(): number[]; + gl(): number[]; + + darken(amount?: number): Color; + darker(amount: number): Color; + brighten(amount?: number): Color; + brighter(amount: number): Color; + saturate(amount?: number): Color; + desaturate(amount?: number): Color; + + toString(): string; + } + + export interface Scale { + /** + * Interpolate a color using the currently set range and domain. + * + * @param value The value to use for interpolation. + * @return the interpolated hex color OR a Color object (depending on the mode set on this Scale). + */ + (value: number): any; + + /** + * Retreive all possible colors generated by this scale if it has distinct classes. + * + * @param mode The output mode to use. Must be one of Color's getters. Defaults to "hex". + * @return an array of colors in the type specified by mode. + */ + colors(mode?: string): any[]; + + correctLightness(): boolean; + + /** + * Enable or disable automatic lightness correction of this scale. + * + * @param Whether to enable or disable automatic lightness correction. + * @return this + */ + correctLightness(enable: boolean): Scale; + + /** + * Get the current domain. + * + * @return The current domain. + */ + domain(): number[]; + + /** + * Set the domain. + * + * @param domain An Array of at least two numbers (min and max). + * @param classes The number of fixed classes to create between min and max. + * @param mode The scale to use. Examples: log, quantiles, k-means. + * @return this + */ + domain(domain: number[], classes?: number, mode?: string): Scale; + + /** + * Specify in which color space the colors should be interpolated. Defaults to "rgb". + * You can use any of the following spaces: rgb, hsv, hsl, lab, lch + * + * @param colorSpace The color space to use for interpolation. + * @return this + */ + mode(colorSpace: string): Scale; + + /** + * Set the output mode of this Scale. + * + * @param mode The output mode to use. Must be one of Color's getters. + * @return this + */ + out(mode: string): Scale; + + /** + * Set the color range after initialization. + * + * @param colors An Array of at least two color names or hex values. + * @return this + */ + range(colors: string[]): Scale; + } + +} + +declare var chroma: Chroma.ChromaStatic; diff --git a/chroma-js/chroma-js-tests.ts b/chroma-js/chroma-js-tests.ts index 3240ac11f8..ccc9d5a1a7 100644 --- a/chroma-js/chroma-js-tests.ts +++ b/chroma-js/chroma-js-tests.ts @@ -1,120 +1,166 @@ /// function test_chroma() { - chroma("red"); - chroma("#ff0000"); - chroma("#f00"); - chroma("FF0000"); - chroma(255, 0, 0); - chroma([255, 0, 0]); - chroma(0, 1, 0.5, 'hsl'); - chroma([0, 1, 0.5], 'hsl'); - chroma(0, 1, 1, 'hsv'); - chroma("rgb(255,0,0)"); - chroma("rgb(100%,0%,0%)"); - chroma("hsl(0,100%,50%)"); - chroma(53.24, 80.09, 67.20, 'lab'); - chroma(53.24, 104.55, 40, 'lch'); - chroma(1, 0, 0, 'gl'); - - chroma.hex("#ff0000"); - chroma.hex("red"); - chroma.hex("rgb(255, 0, 0)"); - - chroma.rgb(255, 0, 0); - chroma.hsl(0, 1, 0.5); - chroma.hsv(120, 0.5, 0.5); - chroma.lab(53.24, 80.09, 67.20); - chroma.lch(53.24, 104.55, 40); - chroma.gl(1, 0, 0); - - chroma.interpolate('white', 'black', 0) // #ffffff - chroma.interpolate('white', 'black', 1) // #000000 - chroma.interpolate('white', 'black', 0.5) // #7f7f7f - chroma.interpolate('white', 'black', 0.5, 'hsv') // #808080 - chroma.interpolate('white', 'black', 0.5, 'lab') // #777777 - - chroma.interpolate('rgba(0,0,0,0)', 'rgba(255,0,0,1)', 0.5).css() //"rgba(127.5,0,0,0.5)" - - var bezInterpolator = chroma.interpolate.bezier(['white', 'yellow', 'red', 'black']); - bezInterpolator(0).hex() // #ffffff - bezInterpolator(0.33).hex() // #ffcc67 - bezInterpolator(0.66).hex() // #b65f1a - bezInterpolator(1).hex() // #000000 - - chroma.luminance('black') // 0 - chroma.luminance('white') // 1 - chroma.luminance('#ff0000') // 0.2126 - - chroma.contrast('white', 'navy') // 16.00 – ok - chroma.contrast('white', 'yellow') // 1.07 – not ok! + chroma('hotpink'); + chroma('#ff3399'); + chroma('F39'); + chroma.hex("#fff"); + + chroma(0xff3399); + chroma(0xff, 0x33, 0x99); + chroma(255, 51, 153); + chroma([255, 51, 153]); + chroma(330, 1, 0.6, 'hsl'); + chroma.hsl(330, 1, 0.6); + chroma.lch(80, 40, 130); + chroma(80, 40, 130, 'lch'); + chroma.cmyk(0.2, 0.8, 0, 0); + chroma(0.2, 0.8, 0, 0, 'cmyk'); + chroma.gl(0.6, 0, 0.8); + chroma.gl(0.6, 0, 0.8, 0.5); + chroma(0.6, 0, 0.8, 'gl'); + chroma.temperature(2000); + chroma.temperature(3500); + chroma.temperature(6000); + chroma.mix('red', 'blue'); + chroma.mix('red', 'blue', 0.25); + chroma.mix('red', 'blue', 0.5, 'rgb'); + chroma.mix('red', 'blue', 0.5, 'hsl'); + chroma.mix('red', 'blue', 0.5, 'lab'); + chroma.mix('red', 'blue', 0.5, 'lch'); + chroma.blend('4CBBFC', 'EEEE22', 'multiply'); + chroma.blend('4CBBFC', 'EEEE22', 'darken'); + chroma.blend('4CBBFC', 'EEEE22', 'lighten'); + chroma.random(); + chroma.contrast('pink', 'hotpink'); + chroma.contrast('pink', 'purple'); + chroma.brewer.OrRd; + var data = [3.0, 3.5, 3.6, 3.8, 3.8, 4.1, 4.3, 4.4, + 4.6, 4.9, 5.2, 5.3, 5.4, 5.7, 5.8, 5.9, + 6.2, 6.5, 6.8, 7.2, 9]; + chroma.limits(data, 'e', 5); + chroma.limits(data, 'q', 5); + chroma.limits(data, 'k', 5); } function test_color() { - chroma('red').hex() // "#FF0000"" - chroma('red').rgb() // [255, 0, 0] - chroma('red').hsv() // [0, 1, 1] - chroma('red').hsl() // [0, 1, 0.5] - chroma('red').lab() // [53.2407, 80.0924, 67.2031] - chroma('red').lch() // [53.2407, 104.5517, 39.9990] - chroma('red').rgba() // [255, 0, 0, 1] - chroma('red').css() // "rgb(255,0,0)" - chroma('red').alpha(0.7).css() // "rgba(255,0,0,0.7)" - chroma('red').css('hsl') // "hsl(0,100%,50%)" - chroma('red').alpha(0.7).css('hsl') // "hsla(0,100%,50%,0.7)" - chroma('blue').css('hsla') // "hsla(240,100%,50%,1)" - - var red = chroma('red'); - red.alpha(0.5); - red.css(); // rgba(255,0,0,0.5); - - chroma('red').darken().hex() // #BC0000 - chroma('red').brighten().hex() // #FF603B - chroma('#eecc99').saturate().hex() // #fcc973 - chroma('red').desaturate().hex() // #ec3d23 - - chroma('black').luminance() // 0 - chroma('white').luminance() // 1 - chroma('red').luminance() // 0.2126 + chroma('red').alpha(0.5); + chroma('rgba(255,0,0,0.35)').alpha(); + chroma('hotpink').darken(); + chroma('hotpink').darken(2); + chroma('hotpink').brighten(); + chroma('slategray').saturate(); + chroma('slategray').saturate(2); + chroma('hotpink').desaturate(); + chroma('hotpink').desaturate(2); + chroma('hotpink').desaturate(3); + // change hue to 0 deg (=red) + chroma('skyblue').set('hsl.h', 0); + // set chromacity to 30 + chroma('hotpink').set('lch.c', 30); + // half Lab lightness + chroma('orangered').set('lab.l', '*0.5'); + // double Lch saturation + chroma('darkseagreen').set('lch.c', '*2'); + chroma('orangered').get('lab.l'); + chroma('orangered').get('hsl.l'); + chroma('orangered').get('rgb.g'); + chroma('white').luminance(); + chroma('aquamarine').luminance(); + chroma('hotpink').luminance(); + chroma('darkslateblue').luminance(); + chroma('black').luminance(); + chroma('white').luminance(0.5); + chroma('aquamarine').luminance(0.5); + chroma('hotpink').luminance(0.5); + chroma('darkslateblue').luminance(0.5); + chroma('aquamarine').luminance(0.5); + chroma('aquamarine').luminance(0.5, 'lab'); + chroma('aquamarine').luminance(0.5, 'hsl'); + chroma('orange').hex(); + chroma('#ffa500').name(); + chroma('#ffa505').name(); + chroma('teal').css(); + chroma('teal').alpha(0.5).css(); + chroma('teal').css('hsl'); + chroma('orange').rgb(); + chroma('orange').hsl(); + chroma('white').hsl(); + chroma('orange').hsv(); + chroma('white').hsv(); + chroma('orange').hsi(); + chroma('white').hsi(); + chroma('orange').lab(); + chroma('skyblue').lch(); + chroma('skyblue').hcl(); + chroma('#ff3300').temperature(); + chroma('#ff8a13').temperature(); + chroma('#ffe3cd').temperature(); + chroma('#cbdbff').temperature(); + chroma('#b3ccff').temperature(); + chroma('33cc00').gl(); } function test_scale() { - var scale = chroma.scale(['lightyellow', 'navy']); - scale(0.5); // #7F7FB0 + var f = chroma.scale(); + f(0.25); + f(0.5); + f(0.75); + chroma.scale(['yellow', '008ae5']); + chroma.scale(['yellow', 'red', 'black']); + // default domain is [0,1] + chroma.scale(['yellow', '008ae5']); + // set domain to [0,100] + chroma.scale(['yellow', '008ae5']).domain([0, 100]); + // default domain is [0,1] + chroma.scale(['yellow', 'lightgreen', '008ae5']) + .domain([0, 0.25, 1]); + chroma.scale(['yellow', '008ae5']); + chroma.scale(['yellow', 'navy']); + chroma.scale(['yellow', 'navy']).mode('lab'); + chroma.scale(['yellow', 'navy']).mode('lab'); + chroma.scale(['yellow', 'navy']).mode('hsl'); + chroma.scale(['yellow', 'navy']).mode('lch'); + chroma.scale('YlGnBu'); + chroma.scale('Spectral'); + chroma.scale('Spectral').domain([1, 0]); + chroma.brewer.OrRd; + chroma.scale(['yellow', '008ae5']).mode('lch'); + + chroma.scale(['yellow', '008ae5']) + .mode('lch') + .correctLightness(); + // linear interpolation + chroma.scale(['yellow', 'red', 'black']); + // bezier interpolation + chroma.bezier(['yellow', 'red', 'black']); + // convert bezier interpolator into chroma.scale + chroma.bezier(['yellow', 'red', 'black']) + .scale().colors(5); + // use the default helix... + chroma.cubehelix(); + // or customize it + chroma.cubehelix() + .start(200) + .rotations(-0.5) + .gamma(0.8) + .lightness([0.3, 0.8]); + + chroma.cubehelix() + .start(200) + .rotations(-0.35) + .gamma(0.7) + .lightness([0.3, 0.8]) + .scale() // convert to chroma.scale + .correctLightness() + .colors(5); chroma.scale('RdYlBu'); + chroma.scale('RdYlBu').padding(0.15); - var col = scale(0.5); - col.hex(); // #7F7FB0 - col.rgb(); // [127.5, 127.5, 176] + chroma.scale('OrRd'); + chroma.scale('OrRd').padding([0.2, 0]); - scale = chroma.scale(['lightyellow', 'navy']).out('hex'); - scale(0.5); // "#7F7FB0" - - var scale = chroma.scale(['lightyellow', 'navy']); - scale.mode('hsv')(0.5); // #54C08A - scale.mode('hsl')(0.5); // #31FF98 - scale.mode('lab')(0.5); // #967CB2 - scale.mode('lch')(0.5); // #D26662 - - var scale = chroma.scale(['lightyellow', 'navy']).domain([0, 400]); - scale(200); // #7F7FB0 - - var scale = chroma.scale(['lightyellow', 'navy']).domain([0, 100, 200, 300, 400]); - scale(98); // #7F7FB0 - scale(99); // #7F7FB0 - scale(100); // #AAAAC0 - scale(101); // #AAAAC0 - - chroma.scale(['#eee', '#900']).domain([0, 400], 7); - chroma.scale(['#eee', '#900']).domain([1, 1000000], 7, 'log'); - chroma.scale(['#eee', '#900']).domain([1, 1000000], 5, 'quantiles'); - chroma.scale(['#eee', '#900']).domain([1, 1000000], 5, 'k-means'); - chroma.scale(['white', 'red']).domain([0, 100], 4).domain() // [0, 25, 50, 75, 100] - - chroma.scale().range(['lightyellow', 'navy']); - - chroma.scale(['lightyellow', 'navy']).correctLightness(true); - - chroma.scale('RdYlGn').domain([0,1], 5).colors() -} + chroma.scale('OrRd').classes(5); + chroma.scale('OrRd').classes(8); +} \ No newline at end of file diff --git a/chroma-js/chroma-js.d.ts b/chroma-js/chroma-js.d.ts index 5d785eda27..654c4d8cef 100644 --- a/chroma-js/chroma-js.d.ts +++ b/chroma-js/chroma-js.d.ts @@ -1,14 +1,14 @@ -// Type definitions for Chroma.js v0.5.6 +// Type definitions for Chroma.js v1.1.1 // Project: https://github.com/gka/chroma.js -// Definitions by: Sebastian Brückner +// Definitions by: Sebastian Brückner , Marcin Pacholec // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /** * Chroma.js is a tiny library for all kinds of color conversions and color scales. */ declare namespace Chroma { - export interface ChromaStatic { + /** * Creates a color from a string representation (as supported in CSS). * @@ -17,6 +17,14 @@ declare namespace Chroma { */ (color: string): Color; + /** + * Creates a color from a number representation [0; 16777215] + * + * @param color The number to convert to a color. + * @return the color object. + */ + (number: number): Color; + /** * Create a color in the specified color space using a, b and c as values. * @@ -25,72 +33,20 @@ declare namespace Chroma { * @param c * @param colorSpace The color space to use (one of "rgb", "hsl", "hsv", "lab", "lch", "gl"). Defaults to "rgb". * @return the color object. - */ + */ (a: number, b: number, c: number, colorSpace?: string): Color; + (a: number, b: number, c: number, d: number, colorSpace?: string): Color; + /** - * Create a color in the specified color space using values. - * - * @param values An array of values (e.g. [r, g, b, a?]). - * @param colorSpace The color space to use (one of "rgb", "hsl", "hsv", "lab", "lch", "gl"). Defaults to "rgb". - * @return the color object. - */ + * Create a color in the specified color space using values. + * + * @param values An array of values (e.g. [r, g, b, a?]). + * @param colorSpace The color space to use (one of "rgb", "hsl", "hsv", "lab", "lch", "gl"). Defaults to "rgb". + * @return the color object. + */ (values: number[], colorSpace?: string): Color; - /** - * Create a color in the specified color space using a, b and c as values. - * - * @param a - * @param b - * @param c - * @param colorSpace The color space to use (one of "rgb", "hsl", "hsv", "lab", "lch", "gl"). Defaults to "rgb". - * @return the color object. - */ - color(a: number, b: number, c: number, colorSpace?: string): Color; - - /** - * Calculate the contrast ratio of two colors. - * - * @param color1 The first color. - * @param color2 The second color. - * @return the contrast ratio. - */ - contrast(color1: Color, color2: Color): number; - /** - * Calculate the contrast ratio of two colors. - * - * @param color1 The first color. - * @param color2 The second color. - * @return the contrast ratio. - */ - contrast(color1: Color, color2: string): number; - /** - * Calculate the contrast ratio of two colors. - * - * @param color1 The first color. - * @param color2 The second color. - * @return the contrast ratio. - */ - contrast(color1: string, color2: Color): number; - /** - * Calculate the contrast ratio of two colors. - * - * @param color1 The first color. - * @param color2 The second color. - * @return the contrast ratio. - */ - contrast(color1: string, color2: string): number; - - /** - * Create a color from a hex or string representation (as supported in CSS). - * - * This is an alias of chroma.hex(). - * - * @param color The string to convert to a color. - * @return the color object. - */ - css(color: string): Color; - /** * Create a color from a hex or string representation (as supported in CSS). * @@ -101,217 +57,209 @@ declare namespace Chroma { */ hex(color: string): Color; - rgb(red: number, green: number, blue: number, alpha?: number): Color; - hsl(hue: number, saturation: number, lightness: number, alpha?: number): Color; - hsv(hue: number, saturation: number, value: number, alpha?: number): Color; + hsl(h: number, s: number, l: number): Color; + + hsv(h: number, s: number, v: number): Color; + lab(lightness: number, a: number, b: number, alpha?: number): Color; - lch(lightness: number, chroma: number, hue: number, alpha?: number): Color; + + lch(l: number, c: number, h: number): Color; + + rgb(r: number, g: number, b: number): Color; + + /** + * GL is a variant of RGB(A), with the only difference that the components are normalized to the range of 0..1. + */ gl(red: number, green: number, blue: number, alpha?: number): Color; - interpolate: InterpolateFunction; - mix: InterpolateFunction; + /** + * light 2000K, bright sunlight 6000K. Based on Neil Bartlett's implementation. + * https://github.com/neilbartlett/color-temperature + */ + temperature(t: number): Color; - luminance(color: Color): number; - luminance(color: string): number; + mix(col1: string | Color, col2: string | Color, f?: number, colorSpace?: string): Color; + + interpolate(col1: string | Color, col2: string | Color, f?: number, colorSpace?: string): Color; /** - * Creates a color scale using a pre-defined color scale. - * - * @param name The name of the color scale. - * @return the resulting color scale. + * Blends two colors using RGB channel-wise blend functions. Valid blend modes are multiply, darken, lighten, screen, overlay, burn, and dogde. */ + blend(col1: string, col2: string, blendMode: string): Color; + + /** + * Returns a random color. + */ + random(): Color; + + /** + * Computes the WCAG contrast ratio between two colors. + * A minimum contrast of 4.5:1 is recommended to ensure that text is still readable against a background color. + * + * @param color1 The first color. + * @param color2 The second color. + * @return the contrast ratio. + */ + contrast(col1: string | Color, col2: string | Color): number; + + bezier(colors: string[]): Scale; + + /** + * chroma.brewer is an map of ColorBrewer scales that are included in chroma.js for convenience. + * chroma.scale uses the colors to construct. + */ + brewer: { + OrRd: string[]; + PuBu: string[]; + BuPu: string[]; + Oranges: string[]; + BuGn: string[]; + YlOrBr: string[]; + YlGn: string[]; + Reds: string[]; + RdPu: string[]; + Greens: string[]; + YlGnBu: string[]; + Purples: string[]; + GnBu: string[]; + Greys: string[]; + YlOrRd: string[]; + PuRd: string[]; + Blues: string[]; + PuBuGn: string[]; + Spectral: string[]; + RdYlGn: string[]; + RdBu: string[]; + PiYG: string[]; + PRGn: string[]; + RdYlBu: string[]; + BrBG: string[]; + RdGy: string[]; + PuOr: string[]; + Set2: string[]; + Accent: string[]; + Set1: string[]; + Set3: string[]; + Dark2: string[]; + Paired: string[]; + Pastel2: string[]; + Pastel1: string[]; + }; + + /** + * Helper function that computes class breaks for you, based on actual data. + * Supports three different modes: equidistant breaks, quantiles breaks and breaks based on k-means clusting. + */ + limits(data: number[], mode: string, c: number): number[]; + scale(name: string): Scale; - /** - * Creates a color scale function from the given set of colors. - * - * @param colors An Array of at least two color names or hex values. - * @return the resulting color scale. - */ scale(colors?: string[]): Scale; - scales: PredefinedScales; - } + cubehelix(): Cubehelix; - interface InterpolateFunction { - (color1: Color, color2: Color, f: number, mode?: string): Color; - (color1: Color, color2: string, f: number, mode?: string): Color; - (color1: string, color2: Color, f: number, mode?: string): Color; - (color1: string, color2: string, f: number, mode?: string): Color; - - bezier(colors: any[]): (t: number) => Color; - } - - interface PredefinedScales { - [key: string]: Scale; - - cool: Scale; - hot: Scale; + cmyk(c: number, m: number, y: number, k: number): Color; + + /** + * Create a color from a hex or string representation (as supported in CSS). + * + * This is an alias of chroma.hex(). + * + * @param color The string to convert to a color. + * @return the color object. + */ + css(col: string, mode?: string): string; } export interface Color { - /** - * Creates a color from a string representation (as supported in CSS). - * - * @param color The string to convert to a color. - */ - new(color: string): Color; + alpha(a?: number): Color; - /** - * Create a color in the specified color space using a, b and c as values. - * - * @param a - * @param b - * @param c - * @param colorSpace The color space to use (one of "rgb", "hsl", "hsv", "lab", "lch", "gl"). Defaults to "rgb". - */ - new(a: number, b: number, c: number, colorSpace?: string): Color; + darken(f?: number): Color; - /** - * Create a color in the specified color space using a, b and c as color values and alpha as the alpha value. - * - * @param a - * @param b - * @param c - * @param alpha The alpha value of the color. - * @param colorSpace The color space to use (one of "rgb", "hsl", "hsv", "lab", "lch", "gl"). Defaults to "rgb". - */ - new(a: number, b: number, c: number, alpha: number, colorSpace?: string): Color; + brighten(f?: number): Color; - /** - * Create a color in the specified color space using values. - * - * @param values An array of values (e.g. [r, g, b, a?]). - * @param colorSpace The color space to use (one of "rgb", "hsl", "hsv", "lab", "lch", "gl"). Defaults to "rgb". - */ - new(values: number[], colorSpace: string): Color; + saturate(s?: number): Color; - /** - * Convert this color to CSS hex representation. - * - * @return this color's hex representation. - */ - hex(): string; + desaturate(s?: number): Color; + + set(modechan: string, v: number | string): Color; + + get(modechan: string): number; - /** - * @return the relative luminance of the color, which is a value between 0 (black) and 1 (white). - */ luminance(): number; - /** - * @return the X11 name of this color or its hex value if it does not have a name. - */ + luminance(l: number, mode?: string): Color; + + hex(): string; + name(): string; /** - * @return the alpha value of the color. - */ - alpha(): number; - - /** - * Set the alpha value. + * Create a color from a hex or string representation (as supported in CSS). * - * @param alpha The alpha value. - * @return this + * This is an alias of chroma.hex(). + * + * @param color The string to convert to a color. + * @return the color object. */ - alpha(alpha: number): Color; - css(mode?: string): string; - interpolate(color: Color, f: number, mode?: string): Color; - interpolate(color: string, f: number, mode?: string): Color; - - premultiply(): Color; - rgb(): number[]; + rgba(): number[]; + hsl(): number[]; + hsv(): number[]; - lab(): number[]; - lch(): number[]; + hsi(): number[]; + + lab(): number[]; + + lch(): number[]; + + hcl(): number[]; + + temperature(): number; + gl(): number[]; - - darken(amount?: number): Color; - darker(amount: number): Color; - brighten(amount?: number): Color; - brighter(amount: number): Color; - saturate(amount?: number): Color; - desaturate(amount?: number): Color; - - toString(): string; } export interface Scale { - /** - * Interpolate a color using the currently set range and domain. - * - * @param value The value to use for interpolation. - * @return the interpolated hex color OR a Color object (depending on the mode set on this Scale). - */ + (c: string[]): Scale; + (value: number): any; - /** - * Retreive all possible colors generated by this scale if it has distinct classes. - * - * @param mode The output mode to use. Must be one of Color's getters. Defaults to "hex". - * @return an array of colors in the type specified by mode. - */ - colors(mode?: string): any[]; + domain(d?: number[], n?: number, mode?: string): Scale; - correctLightness(): boolean; + mode(mode: string): Scale; - /** - * Enable or disable automatic lightness correction of this scale. - * - * @param Whether to enable or disable automatic lightness correction. - * @return this - */ - correctLightness(enable: boolean): Scale; + correctLightness(enable?: boolean): Scale; - /** - * Get the current domain. - * - * @return The current domain. - */ - domain(): number[]; + bezier(colors: string[]): Scale; - /** - * Set the domain. - * - * @param domain An Array of at least two numbers (min and max). - * @param classes The number of fixed classes to create between min and max. - * @param mode The scale to use. Examples: log, quantiles, k-means. - * @return this - */ - domain(domain: number[], classes?: number, mode?: string): Scale; + padding(p: number | number[]): Scale; - /** - * Specify in which color space the colors should be interpolated. Defaults to "rgb". - * You can use any of the following spaces: rgb, hsv, hsl, lab, lch - * - * @param colorSpace The color space to use for interpolation. - * @return this - */ - mode(colorSpace: string): Scale; + colors(c?: number): string[]; + + classes(c: number | number[]): (t: number) => Color; + + range(arg: string[]): Scale; + + scale(): Scale; - /** - * Set the output mode of this Scale. - * - * @param mode The output mode to use. Must be one of Color's getters. - * @return this - */ out(mode: string): Scale; - - /** - * Set the color range after initialization. - * - * @param colors An Array of at least two color names or hex values. - * @return this - */ - range(colors: string[]): Scale; } + export interface Cubehelix extends Scale { + start(s: number): Cubehelix; + + rotations(r: number): Cubehelix; + + gamma(g: number): Cubehelix; + + lightness(l: number[]): Cubehelix; + } } declare var chroma: Chroma.ChromaStatic; diff --git a/chrome/chrome-app.d.ts b/chrome/chrome-app.d.ts index 1891b960e0..1019f4066c 100644 --- a/chrome/chrome-app.d.ts +++ b/chrome/chrome-app.d.ts @@ -6,6 +6,17 @@ /// /// +//////////////////// +// App +//////////////////// +declare namespace chrome.app { + interface AppDetails extends chrome.runtime.Manifest { + id: string; + } + + export function getDetails(): AppDetails; +} + //////////////////// // App Runtime //////////////////// @@ -685,7 +696,7 @@ declare namespace chrome.usb { interface DeviceEvent extends chrome.events.Event<(device: Device) => void> {} export var onDeviceAdded: DeviceEvent; - export var onDeviceAdded: DeviceEvent; + export var onDeviceRemoved: DeviceEvent; export function getDevices(options: { vendorId?: number, productId?: number, filters?: DeviceFilter[] }, callback: (devices: Device[]) => void): void; export function getUserSelectedDevices(options: { multiple?: boolean, filters?: DeviceFilter[] }, callback: (devices: Device[]) => void): void; diff --git a/chrome/chrome.d.ts b/chrome/chrome.d.ts index 9cdf8c3a5d..dbf6a12446 100644 --- a/chrome/chrome.d.ts +++ b/chrome/chrome.d.ts @@ -6210,7 +6210,12 @@ declare namespace chrome.tabs { * The tab's new favicon URL. * @since Chrome 27. */ - faviconUrl?: string; + favIconUrl?: string; + /** + * The tab's new title. + * @since Chrome 48. + */ + title?: string; } interface TabMoveInfo { @@ -7214,7 +7219,7 @@ declare namespace chrome.webRequest { * Optional. * If the request method is POST and the body is a sequence of key-value pairs encoded in UTF8, encoded as either multipart/form-data, or application/x-www-form-urlencoded, this dictionary is present and for each key contains the list of all values for that key. If the data is of another media type, or if it is malformed, the dictionary is not present. An example value of this dictionary is {'key': ['value1', 'value2']}. */ - formData?: Object; + formData?: { [key: string]: string[] }; /** * Optional. * If the request method is PUT or POST, and the body is not already parsed in formData, then the unparsed request body elements are contained in this array. @@ -7228,6 +7233,7 @@ declare namespace chrome.webRequest { } interface ResourceRequest { + url: string; /** The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request. */ requestId: string; /** The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (type is main_frame or sub_frame), frameId indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab. */ @@ -7246,7 +7252,6 @@ declare namespace chrome.webRequest { } interface WebRequestDetails extends ResourceRequest { - url: string; /** Standard HTTP method. */ method: string; } @@ -7299,7 +7304,7 @@ declare namespace chrome.webRequest { interface WebAuthenticationChallengeDetails extends WebResponseHeadersDetails { /** The authentication scheme, e.g. Basic or Digest. */ - schema: string; + scheme: string; /** The authentication realm provided by the server, if there is one. */ realm?: string; /** The server requesting authentication. */ @@ -7331,7 +7336,9 @@ declare namespace chrome.webRequest { interface WebRedirectionResponseEvent extends _WebResponseHeadersEvent {} - interface WebAuthenticationChallengeEvent extends chrome.events.Event<(details: WebAuthenticationChallengeDetails, callback?: (response: BlockingResponse) => void) => void> {} + interface WebAuthenticationChallengeEvent extends chrome.events.Event<(details: WebAuthenticationChallengeDetails, callback?: (response: BlockingResponse) => void) => void> { + addListener(callback: (details: WebAuthenticationChallengeDetails) => void, filter?: RequestFilter, opt_extraInfoSpec?: string[]): void; + } interface WebResponseErrorEvent extends _WebResponseHeadersEvent {} diff --git a/ckeditor/ckeditor.d.ts b/ckeditor/ckeditor.d.ts index bba377090f..60b6491407 100644 --- a/ckeditor/ckeditor.d.ts +++ b/ckeditor/ckeditor.d.ts @@ -57,6 +57,7 @@ declare namespace CKEDITOR { var basePath: string; var currentInstance: editor; var document: dom.document; + var env: environmentConfig; var instances: editor[]; var loadFullCoreTimeout: number; var revision: string; @@ -641,7 +642,7 @@ declare namespace CKEDITOR { filebrowserImageBrowseLinkUrl?: string; filebrowserImageBrowseUrl?: string; filebrowserImageUploadUrl?: string; - filebrowserUploadUr?: string; + filebrowserUploadUrl?: string; filebrowserWindowFeatures?: string; filebrowserWindowHeight?: number | string; filebrowserWindowWidth?: number | string; @@ -1029,6 +1030,12 @@ declare namespace CKEDITOR { } + interface IMenuItemDefinition { + label:string, + command:string, + group:string, + order:number + } class editor extends event { activeEnterMode: number; @@ -1066,13 +1073,14 @@ declare namespace CKEDITOR { addCommand(commandName: string, commandDefinition: commandDefinition): void; addFeature(feature: feature): boolean; addMenuGroup(name: string, order?: number): void; - addMenuItem(name: string, definition?: any): void; - addMenuItems(definitions: any[]): void; + addMenuItem(name: string, definition?: IMenuItemDefinition): void; + addMenuItems(definitions: {[id:string]:IMenuItemDefinition}): void; addMode(mode: string, exec: () => void): void; addRemoveFormatFilter(func: Function): void; applyStyle(style: style): void; attachStyleStateChange(style: style, callback: Function): void; checkDirty(): boolean; + commands:any; createFakeElement(realElement: Object, className: Object, realElementType: Object, isResizable: Object): void; createFakeParserElement(realElement: Object, className: Object, realElementType: Object, isResizable: Object): void; createRange(): dom.range; @@ -1235,6 +1243,11 @@ declare namespace CKEDITOR { } + interface buttonDefinition { + label : string; + command : string; + toolbar : string; + } interface template { @@ -1284,10 +1297,31 @@ declare namespace CKEDITOR { class ui extends event { constructor(editor: editor); add(name: string, type: Object, definition: Object): void; - addButton(name: string, definition: dialog.definition.button): void; + addButton(name: string, definition: buttonDefinition): void; addHandler(type: Object, handler: Object): void; } + class environmentConfig { + air : boolean; + chrome : boolean; + cssClass : string; + edge : boolean; + gecko : boolean; + hc : boolean; + hidpi : boolean; + iOS : boolean; + ie : boolean; + isCompatible : boolean; + mac : boolean; + needsBrFiller : boolean; + needsNbspFiller : boolean; + quirks : boolean; + safari : boolean; + version : number; + webkit : boolean; + secure( ) : boolean; + } + namespace ui { namespace dialog { class uiElement { @@ -1761,6 +1795,7 @@ declare namespace CKEDITOR { namespace tools { var callFunction: Function; + function enableHtml5Elements(doc: Object, withAppend? : Boolean) : void; } @@ -1772,3 +1807,4 @@ declare namespace CKEDITOR { function detect(defaultLanguage: string, probeLanguage: string): string; } } + diff --git a/cliff/cliff.d.ts b/cliff/cliff.d.ts new file mode 100644 index 0000000000..e0db79c986 --- /dev/null +++ b/cliff/cliff.d.ts @@ -0,0 +1,14 @@ +// Type definitions for cliff 0.1.10 +// Project: https://github.com/flatiron/cliff +// Definitions by: bryn austin bellomy +// Definitions: https://github.com/borisyankov/DefinitelyTyped + + +declare module "cliff" { + export function inspect(obj:any): string; + export function stringifyRows(rows:string[][], colors?:string[]): string; + export function stringifyObjectRows(rows:Array<{}>, keys:string[], colors?:string[]): string; + export function putRows(level:string, rows:string[][], colors?:string[]): void; + export function putObjectRows(level:string, rows:Array<{}>, keys:string[], colors?:string[]): void; + export function putObject(level:string, object:any, rewriters?:any, padding?:any): void; +} diff --git a/co-views/co-views-tests.ts b/co-views/co-views-tests.ts new file mode 100644 index 0000000000..7c05cecde6 --- /dev/null +++ b/co-views/co-views-tests.ts @@ -0,0 +1,26 @@ +/// +/// + +import views = require('co-views'); + +const render = views('views', { + map: { + html: 'swig' + }, + default: 'jade' +}); + +const fileName = 'xxx'; // template file name +const locals = {}; // template locals data + +async function test() { + const html = await render(fileName, locals); + console.log(html); +} + +// or use generator + +// function* test() { +// const html = yield render(fileName, locals); +// console.log(html); +// } diff --git a/co-views/co-views.d.ts b/co-views/co-views.d.ts new file mode 100644 index 0000000000..66de5fbf79 --- /dev/null +++ b/co-views/co-views.d.ts @@ -0,0 +1,68 @@ +// Type definitions for co-views v2.1 +// Project: https://github.com/tj/co-views/ +// Definitions by: devlee +// Definitions: https://github.com/devlee/DefinitelyTyped + +/* =================== USAGE =================== + + import views = require('co-views'); + const render = views('views', { + map: { + html: 'swig' + }, + default: 'jade' + }); + + =============================================== */ + +declare module "co-views" { + + interface EngineMap { + /** + * use for .html files + */ + html: string + } + + interface CoViewsOptions { + + /** + * default extname + */ + ext?: string, + + /** + * default extname + */ + default?: string, + + /** + * engine map + */ + map?: EngineMap, + + /** + * proxy partials + */ + partials?: Object, + + /** + * cache compiled templates + */ + cache?: boolean, + + /** + * common locals data + */ + locals?: Object + } + + /** + * Pass views `dir` and `opts` to return a render function. + */ + function views(dir?: string, opts?: CoViewsOptions): { + (view: string, locals?: Object): any + }; + + export = views; +} diff --git a/codemirror/codemirror.d.ts b/codemirror/codemirror.d.ts index bade422821..b1bf33e2d2 100644 --- a/codemirror/codemirror.d.ts +++ b/codemirror/codemirror.d.ts @@ -181,7 +181,7 @@ declare namespace CodeMirror { handle: any; text: string; /** Object mapping gutter IDs to marker elements. */ - gutterMarks: any; + gutterMarkers: any; textClass: string; bgClass: string; wrapClass: string; @@ -220,14 +220,7 @@ declare namespace CodeMirror { /** Get an { left , top , width , height , clientWidth , clientHeight } object that represents the current scroll position, the size of the scrollable area, and the size of the visible area(minus scrollbars). */ - getScrollInfo(): { - left: any; - top: any; - width: any; - height: any; - clientWidth: any; - clientHeight: any; - } + getScrollInfo(): CodeMirror.ScrollInfo; /** Scrolls the given element into view. pos is a { line , ch } position, referring to a given character, null, to refer to the cursor. The margin parameter is optional. When given, it indicates the amount of pixels around the given area that should be made visible as well. */ @@ -609,6 +602,15 @@ declare namespace CodeMirror { text: string; } + interface ScrollInfo { + left: any; + top: any; + width: any; + height: any; + clientWidth: any; + clientHeight: any; + } + interface TextMarker { /** Remove the mark. */ clear(): void; @@ -1125,6 +1127,115 @@ declare namespace CodeMirror { severity?: string; to?: Position; } + + /** + * A function that calculates either a two-way or three-way merge between different sets of content. + */ + function MergeView(element: HTMLElement, options?: MergeView.MergeViewEditorConfiguration): MergeView.MergeViewEditor; + + namespace MergeView { + /** + * Options available to MergeView. + */ + interface MergeViewEditorConfiguration extends EditorConfiguration { + /** + * Determines whether the original editor allows editing. Defaults to false. + */ + allowEditingOriginals?: boolean; + + /** + * When true stretches of unchanged text will be collapsed. When a number is given, this indicates the amount + * of lines to leave visible around such stretches (which defaults to 2). Defaults to false. + */ + collapseIdentical?: boolean | number; + + /** + * Sets the style used to connect changed chunks of code. By default, connectors are drawn. When this is set to "align", + * the smaller chunk is padded to align with the bigger chunk instead. + */ + connect?: string; + + /** + * Callback for when stretches of unchanged text are collapsed. + */ + onCollapse?(mergeView: MergeViewEditor, line: number, size: number, mark: TextMarker): void; + + /** + * Provides original version of the document to be shown on the right of the editor. + */ + orig: any; + + /** + * Provides original version of the document to be shown on the left of the editor. + * To create a 2-way (as opposed to 3-way) merge view, provide only one of origLeft and origRight. + */ + origLeft?: any; + + /** + * Provides original version of document to be shown on the right of the editor. + * To create a 2-way (as opposed to 3-way) merge view, provide only one of origLeft and origRight. + */ + origRight?: any; + + /** + * Determines whether buttons that allow the user to revert changes are shown. Defaults to true. + */ + revertButtons?: boolean; + + /** + * When true, changed pieces of text are highlighted. Defaults to true. + */ + showDifferences?: boolean; + } + + interface MergeViewEditor extends Editor { + /** + * Returns the editor instance. + */ + editor(): Editor; + + /** + * Left side of the merge view. + */ + left: DiffView; + leftChunks(): MergeViewDiffChunk; + leftOriginal(): Editor; + + /** + * Right side of the merge view. + */ + right: DiffView; + rightChunks(): MergeViewDiffChunk; + rightOriginal(): Editor; + + /** + * Sets whether or not the merge view should show the differences between the editor views. + */ + setShowDifferences(showDifferences: boolean): void; + } + + /** + * Tracks changes in chunks from oroginal to new. + */ + interface MergeViewDiffChunk { + editFrom: number; + editTo: number; + origFrom: number; + origTo: number; + } + + interface DiffView { + /** + * Forces the view to reload. + */ + forceUpdate(): (mode: string) => void; + + /** + * Sets whether or not the merge view should show the differences between the editor views. + */ + setShowDifferences(showDifferences: boolean): void; + } + } } declare module "codemirror" { diff --git a/colors/colors.d.ts b/colors/colors.d.ts index 07c4c19e06..7a78240287 100644 --- a/colors/colors.d.ts +++ b/colors/colors.d.ts @@ -81,6 +81,7 @@ declare module "colors" { export var america: Color; export var trap: Color; export var random: Color; + export var zalgo: Color; } export = e; @@ -121,4 +122,5 @@ interface String { america: string; trap: string; random: string; + zalgo: string; } diff --git a/combokeys/combokeys-tests.ts b/combokeys/combokeys-tests.ts new file mode 100644 index 0000000000..1a065861ff --- /dev/null +++ b/combokeys/combokeys-tests.ts @@ -0,0 +1,33 @@ + +/// + +import Combokeys = require("combokeys"); + +const combokeys1: Combokeys.Combokeys = new Combokeys(document.createElement('div')); +const combokeys2: Combokeys.Combokeys = new Combokeys(document.createElement('div')); + +combokeys1.bind('ctrl+a', () => {}); +combokeys1.bind('ctrl+z', () => {}, 'keydown'); +combokeys1.bind(['ctrl+a', 'ctrl+shift+a'], () => {}); +combokeys1.bind(['ctrl+a', 'ctrl+shift+a'], () => {}, 'keyup'); + +combokeys1.bindMultiple(['ctrl+a', 'ctrl+shift+a'], () => {}); +combokeys1.bindMultiple(['ctrl+a', 'ctrl+shift+a'], () => {}, 'keyup'); + +const result: boolean = combokeys1.stopCallback(new Event(null), document.createElement('div')); + +combokeys1.unbind('ctrl+a'); +combokeys1.unbind('ctrl+a', 'keydown'); +combokeys1.unbind(['ctrl+a', 'ctrl+shift+a']); +combokeys1.unbind(['ctrl+a', 'ctrl+shift+a'], 'keydown'); + +combokeys1.trigger('ctrl+a'); +combokeys1.trigger('ctrl+a', 'keypress'); + +combokeys1.reset(); + +combokeys1.detach(); + +Combokeys.reset(); + +Combokeys.instances.forEach((combokeys: Combokeys.Combokeys) => combokeys.reset() ); diff --git a/combokeys/combokeys.d.ts b/combokeys/combokeys.d.ts new file mode 100644 index 0000000000..f7e1e5b035 --- /dev/null +++ b/combokeys/combokeys.d.ts @@ -0,0 +1,107 @@ +// Type definitions for Combokeys v2.4.6 +// Project: https://github.com/PolicyStat/combokeys +// Definitions by: Ian Clanton-Thuon +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace Combokeys { + interface CombokeysStatic { + new (element: Element): Combokeys; + + /** + * all instances of Combokeys + */ + instances: Combokeys[]; + + /** + * reset all instances + */ + reset(): void; + } + + interface Combokeys { + element: Element; + + /** + * binds an event to Combokeys + * + * can be a single key, a combination of keys separated with +, + * an array of keys, or a sequence of keys separated by spaces + * + * be sure to list the modifier keys first to make sure that the + * correct key ends up getting bound (the last key in the pattern) + * + * @param {keys} key combination or combinations + * @param {callback} callback function + * @param {handler} optional - one of "keypress", "keydown", or "keyup" + * @returns void + */ + bind(keys: string | string[], callback: () => void, action?: string): void; + + + /** + * binds multiple combinations to the same callback + * + * @param {keys} key combinations + * @param {callback} callback function + * @param {handler} optional - one of "keypress", "keydown", or "keyup" + * @returns void + */ + bindMultiple(keys: string[], callback: () => void, action?: string): void; + + /** + * unbinds an event to Combokeys + * + * the unbinding sets the callback function of the specified key combo + * to an empty function and deletes the corresponding key in the + * directMap dict. + * + * the keycombo+action has to be exactly the same as + * it was defined in the bind method + * + * @param {keys} key combination or combinations + * @param {action} optional - one of "keypress", "keydown", or "keyup" + * @returns void + */ + unbind(keys: string | string[], action?: string): void; + + /** + * triggers an event that has already been bound + * + * @param {keys} key combination + * @param {action} optional - one of "keypress", "keydown", or "keyup" + * @returns void + */ + trigger(keys: string, action?: string): void; + + /** + * resets the library back to its initial state. This is useful + * if you want to clear out the current keyboard shortcuts and bind + * new ones - for example if you switch to another page + * + * @returns void + */ + reset(): void; + + /** + * should we stop this event before firing off callbacks + * + * @param {e} event + * @param {element} bound element + * @return {boolean} + */ + stopCallback(e: Event, element: Element): boolean; + + /** + * detach all listners from the bound element + * + * @return {void} + */ + detach(): void; + } +} + +declare var combokeys: Combokeys.CombokeysStatic; + +declare module "combokeys" { + export = combokeys; +} diff --git a/commangular/commangular-mock.d.ts b/commangular/commangular-mock.d.ts new file mode 100644 index 0000000000..134e4d0d1e --- /dev/null +++ b/commangular/commangular-mock.d.ts @@ -0,0 +1,73 @@ +// Type definitions for Commangular Mock 0.9.0 +// Project: http://commangular.org +// Definitions by: Hiraash Thawfeek +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module commangular { + + /////////////////////////////////////////////////////////////////////////// + // Commangular Static + // see http://commangular.org/docs/#commangular-namespace + /////////////////////////////////////////////////////////////////////////// + interface ICommAngularStatic { + + /** + * Mock dispatch function for testing commands. + */ + dispatch( ec: ICommandCall, callback: Function ): void; + } + + interface ICommandCall { + /** + * Name of the command that needs to + * execute + */ + command: string; + + /** + * Data that needs to be passed to the command + */ + data?: any; + } + + + /** + * Object type expected to be passed into the callback function + * of the dispatch() function + */ + interface ICommandInfo { + /** + * The data that was passed into the command + * @param key The property name that is in the object that was passed + */ + dataPassed( key : string ) : any; + + /** + * The data that was returned by the command + * @param key The result key that was defined in the command. If no result + * was defined use 'lastResult' as the key + */ + resultKey( key: string ): any; + + /** + * Indicates if the command execution was cancelled. + */ + canceled( ): boolean; + + /** + * Indicates if the command was executed???? + */ + commandExecuted( ): boolean; + } + +} + + +/** +* Mock dispatch function for testing commands. +* @param ec an ICommandCall object +* @param callback The function that will be called upon the completion of the command +* function should expecte an ICommandInfo paramter. +*/ +declare function dispatch( ec: commangular.ICommandCall, callback: Function ): void; + diff --git a/commangular/commangular.d.ts b/commangular/commangular.d.ts new file mode 100644 index 0000000000..b03a22574e --- /dev/null +++ b/commangular/commangular.d.ts @@ -0,0 +1,273 @@ +// Type definitions for Commangular 0.9.0 +// Project: http://commangular.org +// Definitions by: Hiraash Thawfeek +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare var commangular: commangular.ICommAngularStatic; + +declare module commangular { + + /////////////////////////////////////////////////////////////////////////// + // Commangular Static + // see http://commangular.org/docs/#commangular-namespace + /////////////////////////////////////////////////////////////////////////// + interface ICommAngularStatic { + + /** + * Use this function to create and register a command with Commangular + * + * @param commandName It's the name of the command you are creating. It's useful to reference the command from the command provider. + * @param commandFunction It's the command class that will be executed when commangular runs this command. + * It has to be something that implements ICommand. Same as angular syntax + * @param commandConfig It's and object with paramaters to configure the command execution. + */ + create (commandName: string, commandFunction: Function, commandConfig?:ICommandConfig) : void; + command (commandName: string, commandFunction: Function, commandConfig?:ICommandConfig) : void; + + /** + * This function allows you to hijack the execution before or after and + * execute some cross cutting functionality. + * see http://commangular.org/docs/#command-aspects + * @param aspectDescriptor The interceptor descriptor has two parts 'Where' and 'What'. + * Where do you want to intercept? you've 5 options : + * - @Before : The interceptor will be executed before the command. You will be able to + * cancel the command or modify the data that will be injected in the command or do + * some other operation you need before the command execution. + * - @After : The interceptor will be executed just after the command and before any other next + * command. You can get the lastResult from the command, cancel execution etc etc. + * - @AfterExecution : This intercetor is executed just after the command execute method and + * it can get the result from the command and update it before the onResult method is executed. + * - @AfterThrowing : This interceptor will be executed if the command or any interceptor of + * the command throws an exception. You can get the error throwed injected to do what you need. + * - @Around : The interceptor is executed around a command.That means that a especial + * object 'processor' will be injected in the interceptor and you can invoke the command + * or the next interceptor. It will be better explained below. + * @param aspectFunction It's the command class execute function that will be run for the given aspect. + * @param order You can chain any number of interceptors to the same command, so if you need to executed + * the interceptor in a specific order you can indicate it here. An order of 0 is assigned by default. + */ + aspect ( aspectDescriptor: string, aspectFunction: ICommand, order: number ) : void; + + /** + * Event aspects work the same way command aspects do, but they intercept all the command groups instead, + * so you can run some function before the command group starts it's execution , after or when any + * command or interceptor in the group throw an exception. + * see http://commangular.org/docs/#event-aspects + * @param aspectDescriptor The interceptor descriptor has two parts 'Where' and 'What'. + * Where do you want to intercept? you've 3 options : + * - @Before : The interceptor will be executed before the command. You will be able to + * cancel the command or modify the data that will be injected in the command or do + * some other operation you need before the command execution. + * - @After : The interceptor will be executed just after the command and before any other next + * command. You can get the lastResult from the command, cancel execution etc etc. + * - @AfterThrowing : This interceptor will be executed if the command or any interceptor of + * the command throws an exception. You can get the error throwed injected to do what you need. + * @param aspectFunction It's the command class execute function that will be run for the given aspect. + * @param order You can chain any number of interceptors to the same command, so if you need to executed + * the interceptor in a specific order you can indicate it here. An order of 0 is assigned by default. + */ + eventAspect( aspectDescriptor: string, aspectFunction: ICommand, order: number ) : void; + + /** + * TBD + */ + resolver( commandName: string, resolverFunction : Function ) : void; + + /** + * Clears all commands and aspects registered with commangular. + */ + reset() : void; + + /** + * Can be used to enable/disable debug + */ + debug( enableDebug : boolean ) : void; + + /** + * TBD + */ + build() : void; + } + + /** + * The command function/object + * see http://commangular.org/docs/#commangular-namespace + */ + interface ICommand { + /** + * This function is what gets called when the command executes. + * It can take parameters in as injected by angular + */ + execute() : any; + + } + + interface IResultCommand extends ICommand{ + /** + * Is executed after the execute method and the interception chain and can receive + * the result from the execute method of the same command. + * + * @param result Value/object returned by the execution. + */ + onResult ( result: any ) : void; + + /** + * Is executed when the executed method ends with an error. Can receive the error throw by the execute method. + * @param error The error that occured during execution + */ + onError ( error: Error ) : void; + } + + /** + * The result object expected in the promise returned by the dispatch function + * This must be extended to add custom result keys + * see http://commangular.org/docs/#returning-result-from-commands + */ + interface ICommandResult { + /** + * By defualt the result of the command will be found in this property + */ + lastResult : any; + } + + /** + * Command creation configuration + * see http://commangular.org/docs/#the-command-config-object + */ + interface ICommandConfig { + /** + * This property instruct commangular to keep the value returned by the command in the value + * key passed in 'resultKey'. It has to be a string. It means that after the execution of this + * commands you will be able to inject on the next command using that key and the result of the command will be injected. + */ + resultKey : string; + } + + /** + * All the command configuration of your application is done in an angular config block and + * with the $commangularProvider. The provider is responsible to build the command strutures and + * map them to the desired event names. You can create multiple configs blocks in angular, so you + * can have multiple command config blocks to separate functional parts of your application. + * see http://commangular.org/docs/#using-the-provider + */ + interface ICommAngularProvider { + + /** + * This function lets you map a even name to a command sequence + * @param eventName An event that will be watched by commangular + */ + mapTo( eventName: string ) : ICommAngularDescriptor; + + /** + * Used along with mapTo function. Creates a sequence of commands that + * execute after one and other + * see http://commangular.org/docs/#building-command-sequences + */ + asSequence(): ICommAngularDescriptor; + + /** + * Used along with mapTo function. Maps commands to be executed parallel + * see http://commangular.org/docs/#building-parallel-commands + */ + asParallel(): ICommAngularDescriptor; + + /** + * A command flow is a decision point inside the command group.You can have any number + * of flows inside a command group and nesting them how you perfer. + * see http://commangular.org/docs/#building-command-flows + */ + asFlow(): ICommAngularDescriptor; + + findCommand( eventName: string ): ICommAngularDescriptor; + + } + + /** + * The service that enables the execution of commands + * see http://commangular.org/docs/#dispatching-events + */ + interface ICommAngularService { + + /** + * This function executes the given command sequence. + * see http://commangular.org/docs/#dispatching-events + * @param eventName Name of the even that will trigger a command sequence + * @param data Data of any type that will be passed to the command. + */ + dispatch( eventName: string, data?: any ) : ng.IPromise; + } + + interface ICommAngularDescriptor { + + /** + * Used along with mapTo function. Creates a sequence of commands that + * execute after one and other + * see http://commangular.org/docs/#building-command-sequences + */ + asSequence (): ICommAngularDescriptor; + + /** + * Used along with mapTo function. Maps commands to be executed parallel + * see http://commangular.org/docs/#building-parallel-commands + */ + asParallel(): ICommAngularDescriptor; + + /** + * A command flow is a decision point inside the command group.You can have any number + * of flows inside a command group and nesting them how you perfer. + * see http://commangular.org/docs/#building-command-flows + */ + asFlow(): ICommAngularDescriptor; + + /** + * Add commands to a descriptor. + * @param command The name that was used to create the command. + */ + add ( command: string ): ICommAngularDescriptor; + + /** + * Add descriptor to a descriptor. + * @param descriptor Another descriptor attached to a sequnce of commands. + */ + add ( descriptor: ICommAngularDescriptor ): ICommAngularDescriptor; + + /** + * This is to be used with flowing commands to attach an expression that + * evaluates using Angular $parse. + * see http://commangular.org/docs/#building-command-flows + * @param expression A string form expression that can make use of services to validate conditions. + * @param services A comma seperated list of services that are used in the above expression + */ + link ( expression: string, services?: string ): ICommAngularDescriptor; + + /** + * Works with the link function to attach a command to the flow if the + * expression becomes truthy. + * see http://commangular.org/docs/#building-command-flows + * @param command The name that was used to create the command. + */ + to ( command: string ): ICommAngularDescriptor; + + } + +} + +/** + * Extending the angular rootScope to include the dispatch function in all scopes. + */ +declare module angular { + + interface IRootScopeService { + + /** + * Commangular method to execute a command. + * @param eventName Name of the even that will trigger a command sequence + * @param data Data of any type that will be passed to the command. + */ + dispatch( eventName: string, data?: any ) : ng.IPromise; + + } + +} \ No newline at end of file diff --git a/common-tags/common-tags-tests.ts b/common-tags/common-tags-tests.ts new file mode 100644 index 0000000000..9114f4414c --- /dev/null +++ b/common-tags/common-tags-tests.ts @@ -0,0 +1,156 @@ +/// + +import * as commonTags from 'common-tags'; + +/* Test Built-in Tags */ + +commonTags.commaLists ` + I like ${['apples', 'bananas', 'watermelons']} + They're good! +`; + +commonTags.commaListsAnd` + I like ${['apples', 'bananas', 'watermelons']} + They're good! +`; + +commonTags.commaListsOr` + I like ${['apples', 'bananas', 'watermelons']} + They're good! +`; + +let fruits = ['apple', 'orange', 'watermelon']; + +commonTags.html` +
      +
        + ${fruits.map(fruit => `
      • ${fruit}
      • `)} + ${'
      • kiwi
      • \n
      • guava
      • '} +
      +
      +`; + +commonTags.codeBlock` +
      +
        + ${fruits.map(fruit => `
      • ${fruit}
      • `)} + ${'
      • kiwi
      • \n
      • guava
      • '} +
      +
      +`; + +commonTags.source` +
      +
        + ${fruits.map(fruit => `
      • ${fruit}
      • `)} + ${'
      • kiwi
      • \n
      • guava
      • '} +
      +
      +`; + +commonTags.oneLine` + foo + bar + baz +`; + +commonTags.oneLineTrim` + https://news.com/article + ?utm_source=designernews.co +`; + +commonTags.oneLineCommaLists` + I like ${['apples', 'bananas', 'watermelons']} + They're good! +`; + +commonTags.oneLineCommaListsOr` + I like ${['apples', 'bananas', 'watermelons']} + They're good! +`; + +commonTags.oneLineCommaListsAnd` + I like ${['apples', 'bananas', 'watermelons']} + They're good! +`; + +commonTags.inlineLists` + I like ${['apples', 'bananas', 'watermelons']} + They're good! +`; + +commonTags.oneLineInlineLists` + I like ${['apples', 'bananas', 'watermelons']} + They're good! +`; + +let verb = 'notice'; + +commonTags.stripIndent` + This is a multi-line string. + You'll ${verb} that it is indented. + We don't want to output this indentation. + But we do want to keep this line indented. +`; + +commonTags.stripIndents` + This is a multi-line string. + You'll ${verb} that it is indented. + We don't want to output this indentation. + We don't want to keep this line indented either. +`; + +/* Test Tag Constructor */ + +new commonTags.TemplateTag(); + +const substitutionReplacer = (oldValue : string, newValue : string) => ({ + onSubstitution(substitution : string, resultSoFar : string) { + if (substitution === oldValue) { + return newValue; + } + return substitution; + } +}); + +new commonTags.TemplateTag(substitutionReplacer('fizz', 'buzz')); + +new commonTags.TemplateTag( + substitutionReplacer('fizz', 'buzz'), + substitutionReplacer('foo', 'bar') +); + +new commonTags.TemplateTag([ + substitutionReplacer('fizz', 'buzz'), + substitutionReplacer('foo', 'bar') +]); + +new commonTags.TemplateTag({}); + +new commonTags.TemplateTag({ + onEndResult: endResult => `${endResult}!` +}); + +new commonTags.TemplateTag({ + onSubstitution: substitution => `${substitution}!`, + onEndResult: endResult => `${endResult}!` +}); + +/* Tests Built-in Transformers */ + +new commonTags.TemplateTag(commonTags.trimResultTransformer()); +new commonTags.TemplateTag(commonTags.trimResultTransformer('left')); +new commonTags.TemplateTag(commonTags.trimResultTransformer('right')); + +new commonTags.TemplateTag(commonTags.stripIndentTransformer()); +new commonTags.TemplateTag(commonTags.stripIndentTransformer('initial')); +new commonTags.TemplateTag(commonTags.stripIndentTransformer('all')); + +new commonTags.TemplateTag(commonTags.replaceResultTransformer('foo', 'bar')); + +new commonTags.TemplateTag(commonTags.inlineArrayTransformer()); +new commonTags.TemplateTag(commonTags.inlineArrayTransformer({})); +new commonTags.TemplateTag(commonTags.inlineArrayTransformer({separator: 'foo'})); +new commonTags.TemplateTag(commonTags.inlineArrayTransformer({conjunction: 'bar'})); + +new commonTags.TemplateTag(commonTags.splitStringTransformer('foo')); diff --git a/common-tags/common-tags.d.ts b/common-tags/common-tags.d.ts new file mode 100644 index 0000000000..aa443ac33d --- /dev/null +++ b/common-tags/common-tags.d.ts @@ -0,0 +1,62 @@ +// Type definitions for common-tags v1.2.1 +// Project: https://github.com/declandewet/common-tags +// Definitions by: Viktor Zozuliak +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module 'common-tags' { + type TemplateTag = (literals: string[], ...placeholders: any[]) => string; + + type TemplateTransformer = { + onSubstitution?: (substitution: string, resultSoFar: string) => string; + onEndResult?: (endResult : string) => string; + } + + /* Built-in Tags */ + export var commaLists: TemplateTag; + + export var commaListsAnd: TemplateTag; + + export var commaListsOr: TemplateTag; + + export var html: TemplateTag; + + export var codeBlock: TemplateTag; + + export var source: TemplateTag; + + export var oneLine: TemplateTag; + + export var oneLineTrim: TemplateTag; + + export var oneLineCommaLists: TemplateTag; + + export var oneLineCommaListsOr: TemplateTag; + + export var oneLineCommaListsAnd: TemplateTag; + + export var inlineLists: TemplateTag; + + export var oneLineInlineLists: TemplateTag; + + export var stripIndent: TemplateTag; + + export var stripIndents: TemplateTag; + + /* New Tag Constructor */ + export var TemplateTag: { + new(): TemplateTag; + new(...transformers: TemplateTransformer[]): TemplateTag; + new(transformers: TemplateTransformer[]): TemplateTag; + }; + + /* Built-in Transformers */ + export var trimResultTransformer: (side?: 'left'|'right') => TemplateTransformer; + + export var stripIndentTransformer: (type?: 'initial'|'all') => TemplateTransformer; + + export var replaceResultTransformer: (replaceWhat: string, replaceWith: string) => TemplateTransformer; + + export var inlineArrayTransformer: (opts?: {separator?: string, conjunction?: string}) => TemplateTransformer; + + export var splitStringTransformer: (splitBy: string) => TemplateTransformer; +} diff --git a/component-emitter/component-emitter-tests.ts b/component-emitter/component-emitter-tests.ts new file mode 100644 index 0000000000..e6c6a5b1ab --- /dev/null +++ b/component-emitter/component-emitter-tests.ts @@ -0,0 +1,52 @@ +/// // only for require +/// +// These are all of the examples from https://www.npmjs.com/package/component-emitter as of June 18, 2016 + + +// These are all of the examples from https://www.npmjs.com/package/component-emitter as of June 18, 2016 + +var Emitter = require('component-emitter'); +var emitter = new Emitter; +emitter.emit('something'); + + + + +var user = { name: 'tobi' }; +Emitter(user); + +(user).emit('im a user'); + + + +// this example modified from the one on https://www.npmjs.com/package/component-emitter +var User = Object.create({ + someUserFunction: () => {console.log('someUserFunction called!')} +}) +var another_user = Emitter(User); +another_user.someUserFunction() +another_user.on('hi', () => {console.log('Hi called')}) +another_user.emit('hi') + + +// Additional sample code for this test +function handleSomeRecurringEvent(event_data: any) { + console.log('handle some-recurring-event') +} +emitter.on('some-recurring-event', handleSomeRecurringEvent) + + +emitter.once('some-single-shot-event', (event_data: any) => {console.log('handle some-single-shot-event')}) + + +emitter.off() +emitter.off('some-recurring-event') +emitter.off('some-recurring-event', handleSomeRecurringEvent) + +var event_data = {some: 'data'} +emitter.emit('some-recurring-event') +emitter.emit('some-recurring-event', event_data) + +emitter.listeners('some-recurring-event') + +emitter.hasListeners('some-recurring-event') diff --git a/component-emitter/component-emitter.d.ts b/component-emitter/component-emitter.d.ts new file mode 100644 index 0000000000..28ce4f4bc9 --- /dev/null +++ b/component-emitter/component-emitter.d.ts @@ -0,0 +1,19 @@ +// Type definitions for component-emitter v1.2.1 +// Project: https://www.npmjs.com/package/component-emitter +// Definitions by: Peter Snider +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped/emitter-component + + +interface Emitter { + (obj?: Object): Emitter; + on(event: string, listener: Function): Emitter; + once(event: string, listener: Function): Emitter; + off(event?: string, listener?: Function): Emitter; + emit(event: string, ...args: any[]): boolean; + listeners(event: string): Function[]; + hasListeners(event: string): boolean; +} + +declare module 'component-emitter' { + var Emitter: Emitter; +} diff --git a/compression/compression.d.ts b/compression/compression.d.ts index 6a444e3f49..84fa211bd0 100644 --- a/compression/compression.d.ts +++ b/compression/compression.d.ts @@ -10,8 +10,50 @@ declare module "compression" { namespace e { interface CompressionOptions { - threshold?: number; + /** + * See https://github.com/expressjs/compression#chunksize regarding the usage. + */ + chunkSize?: number; + + /** + * See https://github.com/expressjs/compression#level regarding the usage. + */ + level?: number; + + /** + * See https://github.com/expressjs/compression#memlevel regarding the usage. + */ + memLevel?: number; + + /** + * See https://github.com/expressjs/compression#strategy regarding the usage. + */ + strategy?: number; + + /** + * See https://github.com/expressjs/compression#threshold regarding the usage. + */ + threshold?: number|string; + + /** + * See https://github.com/expressjs/compression#windowbits regarding the usage. + */ + windowBits?: number; + + /** + * See https://github.com/expressjs/compression#filter regarding the usage. + */ filter?: Function; + + /** + * See https://nodejs.org/api/zlib.html#zlib_class_options regarding the usage. + */ + flush?: number; + + /** + * See https://nodejs.org/api/zlib.html#zlib_class_options regarding the usage. + */ + finishFlush?: number; } } diff --git a/connect-redis/connect-redis-tests.ts b/connect-redis/connect-redis-tests.ts new file mode 100644 index 0000000000..abc14977ee --- /dev/null +++ b/connect-redis/connect-redis-tests.ts @@ -0,0 +1,7 @@ +/// +/// + +import * as connectRedis from "connect-redis"; +import * as session from "express-session"; + +let RedisStore = connectRedis(session); diff --git a/connect-redis/connect-redis.d.ts b/connect-redis/connect-redis.d.ts new file mode 100644 index 0000000000..b3a1529569 --- /dev/null +++ b/connect-redis/connect-redis.d.ts @@ -0,0 +1,43 @@ +// Type definitions for connect-redis +// Project: https://npmjs.com/package/connect-redis +// Definitions by: Xavier Stouder +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// +/// + +declare module "connect-redis" { + import * as express from "express"; + import * as session from "express-session"; + import * as redis from "redis"; + + + function s(options: (options?: session.SessionOptions) => express.RequestHandler): s.RedisStore; + + namespace s { + interface RedisStore extends session.Store { + new (options: RedisStoreOptions): session.Store; + } + interface RedisStoreOptions { + client?: redis.RedisClient; + host?: string; + port?: number; + socket?: string; + url?: string; + ttl?: number; + disableTTL?: boolean; + db?: number; + pass?: string; + prefix?: string; + unref?: boolean; + serializer?: Serializer | JSON; + } + interface Serializer { + stringify: Function; + parse: Function; + } + } + + export = s; +} diff --git a/content-type/content-type-tests.ts b/content-type/content-type-tests.ts index 872b3cded0..b9181fb3fd 100644 --- a/content-type/content-type-tests.ts +++ b/content-type/content-type-tests.ts @@ -1,47 +1,21 @@ /// +/// -import MediaType = require('content-type'); +import contentType = require('content-type'); +import express = require('express'); -// https://github.com/deoxxa/content-type/blob/master/README.md -function new_test(): void { - var p = new MediaType('text/html;level=1;q=0.5'); - p.q === 0.5; - p.params.level === "1"; - var q = new MediaType('application/json', { profile: 'http://example.com/schema.json' }); - q.type === "application/json"; - q.params.profile === "http://example.com/schema.json"; +var obj = contentType.parse('image/svg+xml; charset=utf-8'); - q.q = 1; - q.toString() === 'application/json;q=1;profile="http://example.com/schema.json"'; -} +console.log(obj.type); // => 'image/svg+xml' +console.log(obj.parameters.charset); // => 'utf-8' -function mediaCmp_test(): void { - MediaType.mediaCmp(MediaType.parseMedia('text/html'), MediaType.parseMedia('text/html')) === 0; - MediaType.mediaCmp(MediaType.parseMedia('*/*'), MediaType.parseMedia('text/html')) === 1; - MediaType.mediaCmp(MediaType.parseMedia('text/html;level=1'), MediaType.parseMedia('text/html')) === -1; - MediaType.mediaCmp(MediaType.parseMedia('application/json;profile="v1.json"'), MediaType.parseMedia('application/json;profile="v2.json"')) === null; -} -// https://github.com/deoxxa/content-type/blob/master/example.js -function example(): void { - var representations = [ - 'application/json', - 'text/html', - 'application/json;profile="schema.json"', - 'application/json;profile="different.json"', - ]; +var req: express.Request; +obj = contentType.parse(req); - var accept = [ - 'text/html;q=0.50', - '*/*;q=0.01', - 'application/json;profile=different.json', - 'application/json;profile="a,b;c.json?d=1;f=2";q=0.2', - ]; +var res: express.Response; +obj = contentType.parse(res); - console.log('Formats:\n\t' + representations.map(MediaType.parseMedia).join('\n\t')); +var str: string = contentType.format({type: 'image/svg+xml'}); - console.log('Accept:\n\t' + accept.map(MediaType.parseMedia).join('\n\t')); - - console.log('Selected:', (MediaType.select(representations.map(MediaType.parseMedia), accept.map(MediaType.parseMedia)) || 'None').toString()); -} \ No newline at end of file diff --git a/content-type/content-type.d.ts b/content-type/content-type.d.ts index 6e901e7f86..d8254fd8ed 100644 --- a/content-type/content-type.d.ts +++ b/content-type/content-type.d.ts @@ -1,32 +1,24 @@ -// Type definitions for content-type v0.0.1 -// Project: https://github.com/deoxxa/content-type -// Definitions by: Pine Mizune -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// Type definitions for content-type v1.0.1 +// Project: https://www.npmjs.com/package/content-type +// Definitions by: Hiroki Horiuchi +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module ContentType { + interface StaticFunctions { + parse(string: string): MediaType; + parse(req: { headers: any; }): MediaType; + parse(res: { getHeader(key: string): string; }): MediaType; + format(obj: MediaType): string; + } -declare namespace ContentType { interface MediaType { type: string; - q?: number; - params: any; - toString(): string; - } - - interface SelectOptions { - sortAvailable?: boolean; - sortAccepted?: boolean; - } - - interface MediaTypeStatic { - new (s: string, p?: any): MediaType; - parseMedia(type: string): MediaType; - splitQuotedString(str: string, delimiter?: string, quote?: string): string[]; - splitContentTypes(str: string): string[]; - select(availableTypes: MediaType[], acceptedTypes: MediaType[], options?: SelectOptions): string; - mediaCmp(a: MediaType, b: MediaType): number; + parameters?: any; } } declare module "content-type" { - var x: ContentType.MediaTypeStatic; + var x: ContentType.StaticFunctions; export = x; } + diff --git a/convict/convict-tests.ts b/convict/convict-tests.ts index 3bd64c5929..56326c00b3 100644 --- a/convict/convict-tests.ts +++ b/convict/convict-tests.ts @@ -104,7 +104,7 @@ conf.loadFile(['./configs/always.json', './configs/sometimes.json']); // perform validation -conf.validate(); +conf.validate({ strict: true }); var port: number = conf.default('port'); diff --git a/convict/convict.d.ts b/convict/convict.d.ts index 05323de269..07bf5940ff 100644 --- a/convict/convict.d.ts +++ b/convict/convict.d.ts @@ -41,7 +41,7 @@ declare module "convict" { load(conf: Object): void; loadFile(file: string): void; loadFile(files: string[]): void; - validate(): void; + validate(options?: { strict?: boolean }): void; /** * Exports all the properties (that is the keys and their current values) as a {JSON} {Object} * @returns {Object} A {JSON} compliant {Object} diff --git a/cordova-plugin-ibeacon/cordova-plugin-ibeacon.d.ts b/cordova-plugin-ibeacon/cordova-plugin-ibeacon.d.ts index 537ae00071..1aedefb676 100644 --- a/cordova-plugin-ibeacon/cordova-plugin-ibeacon.d.ts +++ b/cordova-plugin-ibeacon/cordova-plugin-ibeacon.d.ts @@ -16,7 +16,8 @@ declare namespace BeaconPlugin { export interface LocationManager { delegate: Delegate; BeaconRegion: BeaconRegion; - onDomDelegateReady(): void; + Region: Region; + onDomDelegateReady(): Q.Promise; startMonitoringForRegion(region: Region): Q.Promise; stopMonitoringForRegion(region: Region): Q.Promise; requestStateForRegion(region: Region): Q.Promise; @@ -49,6 +50,7 @@ declare namespace BeaconPlugin { beacons: Beacon[]; authorizationStatus: string; state: string; + error: string; } export interface Delegate { diff --git a/cordova-plugin-x-socialsharing/cordova-plugin-x-socialsharing.d.ts b/cordova-plugin-x-socialsharing/cordova-plugin-x-socialsharing.d.ts index a8dd93c586..d498a981be 100755 --- a/cordova-plugin-x-socialsharing/cordova-plugin-x-socialsharing.d.ts +++ b/cordova-plugin-x-socialsharing/cordova-plugin-x-socialsharing.d.ts @@ -9,6 +9,18 @@ interface Plugins { declare module SocialSharingPlugin { + interface ShareOptions { + message: string; + subject?: string; + files?: string | string[]; + url?: string; + } + + interface ShareResult { + completed: boolean; + app: any; + } + export interface SocialSharing { /** @@ -23,6 +35,8 @@ declare module SocialSharingPlugin { share(message: string, subject?: string, fileOrFileArray?: string | string[], url?: string, successCallback?: (succeeded: boolean) => void, errorCallback?: (errormsg: string) => void): void; + shareWithOptions(options: ShareOptions, successCallback?: (result: ShareResult) => void, errorCallback?: (errormsg: string) => void): void; + shareViaTwitter(message: string, file?: string, url?: string, successCallback?: (succeeded: boolean) => void, errorCallback?: (errormsg: string) => void): void; shareViaFacebook(message: string, fileOrFileArray?: string | string[], url?: string, successCallback?: (succeeded: boolean) => void, errorCallback?: (errormsg: string) => void): void; @@ -47,4 +61,4 @@ declare module SocialSharingPlugin { saveToPhotoAlbum(fileOrFileArray: string | string[], successCallback?: (succeeded: boolean) => void, errorCallback?: (errormsg: string) => void): void; } -} \ No newline at end of file +} diff --git a/cordova/cordova.d.ts b/cordova/cordova.d.ts index 299e2da4d9..a830fa4881 100644 --- a/cordova/cordova.d.ts +++ b/cordova/cordova.d.ts @@ -35,7 +35,7 @@ interface Cordova { * @param action The action name to call on the native side (generally corresponds to the native class method). * @param args An array of arguments to pass into the native environment. */ - exec(success: () => any, fail: () => any, service: string, action: string, args?: string[]): void; + exec(success: (data: any) => any, fail: (err: any) => any, service: string, action: string, args?: any[]): void; /** Gets the operating system name. */ platformId: string; /** Gets Cordova framework version */ diff --git a/cordova/plugins/NetworkInformation.d.ts b/cordova/plugins/NetworkInformation.d.ts index 4f80fdbb7e..0d49597e3a 100644 --- a/cordova/plugins/NetworkInformation.d.ts +++ b/cordova/plugins/NetworkInformation.d.ts @@ -47,6 +47,7 @@ interface Connection { */ type: string; addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } declare var Connection: { diff --git a/core-js/core-js-tests.ts b/core-js/core-js-tests.ts index bc690d434c..965acc6855 100644 --- a/core-js/core-js-tests.ts +++ b/core-js/core-js-tests.ts @@ -500,3 +500,5 @@ s = s.unescapeHTML(); // ############################################################################################# promiseOfVoid = delay(i); + +console.log('core-js version number:', core.version); diff --git a/core-js/core-js.d.ts b/core-js/core-js.d.ts index 16441df233..c633dc4ef6 100644 --- a/core-js/core-js.d.ts +++ b/core-js/core-js.d.ts @@ -31,7 +31,34 @@ interface ObjectConstructor { * Copy the values of all of the enumerable own properties from one or more source objects to a * target object. Returns the target object. * @param target The target object to copy to. - * @param sources One or more source objects to copy properties from. + * @param source The source object from which to copy properties. + */ + assign(target: T, source: U): T & U; + + /** + * Copy the values of all of the enumerable own properties from one or more source objects to a + * target object. Returns the target object. + * @param target The target object to copy to. + * @param source1 The first source object from which to copy properties. + * @param source2 The second source object from which to copy properties. + */ + assign(target: T, source1: U, source2: V): T & U & V; + + /** + * Copy the values of all of the enumerable own properties from one or more source objects to a + * target object. Returns the target object. + * @param target The target object to copy to. + * @param source1 The first source object from which to copy properties. + * @param source2 The second source object from which to copy properties. + * @param source3 The third source object from which to copy properties. + */ + assign(target: T, source1: U, source2: V, source3: W): T & U & V & W; + + /** + * Copy the values of all of the enumerable own properties from one or more source objects to a + * target object. Returns the target object. + * @param target The target object to copy to. + * @param sources One or more source objects from which to copy properties */ assign(target: any, ...sources: any[]): any; @@ -790,8 +817,17 @@ interface PromiseConstructor { * @param values An array of Promises. * @returns A new Promise. */ - all(values: Iterable>): Promise; - + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike]): Promise<[T1, T2, T3, T4, T5]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike ]): Promise<[T1, T2, T3, T4]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise<[T1, T2, T3]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike]): Promise<[T1, T2]>; + all(values: Iterable>): Promise; + /** * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved * or rejected. @@ -1266,6 +1302,8 @@ interface String { declare function delay(msec: number): Promise; declare namespace core { + var version: string; + namespace Reflect { function apply(target: Function, thisArgument: any, argumentsList: ArrayLike): any; function construct(target: Function, argumentsList: ArrayLike): any; diff --git a/cors/cors.d.ts b/cors/cors.d.ts index eaf917fb1f..97ef574138 100644 --- a/cors/cors.d.ts +++ b/cors/cors.d.ts @@ -16,6 +16,7 @@ declare module "cors" { exposedHeaders?: any; credentials?: boolean; maxAge?: number; + preflightContinue?: boolean; } } diff --git a/countdown/countdown-tests.ts b/countdown/countdown-tests.ts new file mode 100644 index 0000000000..c803f1acc2 --- /dev/null +++ b/countdown/countdown-tests.ts @@ -0,0 +1,42 @@ +/// + +import { countdown, Timespan, CountdownStatic, Format } from 'countdown'; + +let ts: Timespan; +let interval: number; + +ts = countdown(new Date()); +ts = countdown(150); + +interval = countdown(new Date(), + function (ts: Timespan) { + document.getElementById('pageTimer').innerHTML = ts.toHTML('strong'); + }, + countdown.HOURS | countdown.MINUTES | countdown.SECONDS, + 2, + 2 +); + +clearInterval(interval); + +ts.toString('foo'); +ts.toHTML('em', 'foo'); + +countdown.resetFormat(); +countdown.setLabels('a', 'b', 'c', 'd', 'e'); + +countdown.setLabels('a', 'b', 'c', 'd', 'e', function (value: number): string { + return 'ok'; +}, function (value: number, unit: number): string { + return 'ok'; +}); + +countdown.setLabels(null, null, null, null, 'Now.'); + +countdown.setLabels( + ' millisecond| second| minute| hour| day| week| month| year| decade| century| millennium', + ' milliseconds| seconds| minutes| hours| days| weeks| months| years| decades| centuries| millennia', + ' and ', + ', ', + '', + n => n.toString()); diff --git a/countdown/countdown.d.ts b/countdown/countdown.d.ts new file mode 100644 index 0000000000..5b40541dd0 --- /dev/null +++ b/countdown/countdown.d.ts @@ -0,0 +1,69 @@ +// Type definitions for countdown.js +// Project: http://countdownjs.org/ +// Definitions by: Gabriel Juchault +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module 'countdown' { + export type DateFunction = (timespan: Timespan) => void; + export type DateTime = number | Date | DateFunction; + + export interface Timespan { + start?: Date; + end?: Date; + units?: number; + value?: number; + millennia?: number; + centuries?: number; + decades?: number; + years?: number; + months?: number; + days?: number; + hours?: number; + minutes?: number; + seconds?: number; + milliseconds?: number; + toString(label?: string): string; + toHTML(tagName?: string, label?: string): string; + } + + export interface Format { + singular?: string | Array; + plural?: string | Array; + last?: string; + delim?: string; + empty?: string; + formatNumber?(value: number): string; + formatter?(value: number, unit: number): string; + } + + export interface CountdownStatic { + (start: DateTime, end?: DateTime, units?: number, max?: number, digits?: number): Timespan | number; + MILLENNIA: number; + CENTURIES: number; + DECADES: number; + YEARS: number; + MONTHS: number; + WEEKS: number; + DAYS: number; + HOURS: number; + MINUTES: number; + SECONDS: number; + MILLISECONDS: number; + ALL: number; + DEFAULTS: number; + resetLabels(): void; + setLabels( + singular?: string, + plural?: string, + last?: string, + delim?: string, + empty?: string, + formatNumber?: (value: number) => string, + formatter?: (value: number, unit: number) => string + ): void; + resetFormat(): void; + setFormat(format: Format): void; + } + + export let countdown: CountdownStatic; +} diff --git a/credential/credential-tests.ts b/credential/credential-tests.ts index 6013436b05..307201c76e 100644 --- a/credential/credential-tests.ts +++ b/credential/credential-tests.ts @@ -1,16 +1,29 @@ /// +// all from current main repo examples + import * as credential from 'credential'; -credential.hash('password', function(err: Error, hash: string) { - if (err) console.error(err); - else console.log(hash); +var pw = credential(); +var newPassword = 'I have a really great password.'; + +pw.hash(newPassword, function (err, hash) { + if (err) { throw err; } + console.log('Store the password hash.', hash); }); -const hash = '{}'; -const password = 'test'; +var storedHash = { + "hash": "gNofnhlBl36AdRyktwATxKoqWKa6hsIEzwCmW/YXN//7PtiJwCRbepV9fUKu0L9TJELCKoDiBy6rGM8ov7lg2yLY", + "salt": "yyN3KUzlr4KrKWMM2K3d2Ddxf8OTq+vkKG+mtnmQVIibxSJz8drfzkYzqcH0EM+PVKR/1nClRr/CPDuJsq+FOcIw", + "keyLength": 66, + "hashMethod": "pbkdf2", + "iterations": 181019 +}; +var userInput = 'I have a really great password.'; -credential.verify(hash, password, function(err: Error, isValid: boolean) { - if (err) console.error(err); - else console.log(isValid ? 'Password match' : 'Incorrect password'); +pw.verify(storedHash, userInput, function (err, isValid) { + var msg: string; + if (err) { throw err; } + msg = isValid ? 'Passwords match!' : 'Wrong password.'; + console.log(msg); }); diff --git a/credential/credential.d.ts b/credential/credential.d.ts index 2934a090d4..af16e0e412 100644 --- a/credential/credential.d.ts +++ b/credential/credential.d.ts @@ -4,15 +4,33 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare module 'credential' { + interface defaultOptions { + keyLength: number; + work: number; + hashMethod: string; + } - type HashCallback = (err: Error, hash: string) => void; - type VerifyCallback = (err: Error, isValid: boolean) => void; + interface hashObject { + hash: string; + salt: string; + keyLength: number; + hashMethod: string; + iterations: number; + } - namespace credential { - function hash(password: string, callback: HashCallback): void; - function verify(hash: string, password: string, callback: VerifyCallback): void; - } + type HashCallback = (err: Error, hash: hashObject) => void; + type VerifyCallback = (err: Error, isValid: boolean) => void; - export = credential; + function credential(defaultOptions?: defaultOptions): { + hash(password: string, callback: HashCallback): void; + hash(password: string): Promise; + // iterations(work: number, base): number; + verify(hash: hashObject | string, password: string, callback: VerifyCallback): void; + verify(hash: hashObject | string, password: string): Promise; + expired(hash: string, days: number): boolean; + } + namespace credential { } + + export = credential; } diff --git a/cropperjs/cropperjs-tests.ts b/cropperjs/cropperjs-tests.ts index d328a12b4a..82232c268a 100644 --- a/cropperjs/cropperjs-tests.ts +++ b/cropperjs/cropperjs-tests.ts @@ -1,2 +1,16 @@ /// import * as Cropper from 'cropperjs'; + +var image = document.getElementById('image'); +var cropper = new Cropper(image, { + aspectRatio: 16 / 9, + crop: function(e) { + console.log(e.detail.x); + console.log(e.detail.y); + console.log(e.detail.width); + console.log(e.detail.height); + console.log(e.detail.rotate); + console.log(e.detail.scaleX); + console.log(e.detail.scaleY); + } +}); diff --git a/cropperjs/cropperjs.d.ts b/cropperjs/cropperjs.d.ts index f2f8e861e5..c76b4c7766 100644 --- a/cropperjs/cropperjs.d.ts +++ b/cropperjs/cropperjs.d.ts @@ -11,7 +11,26 @@ declare module cropperjs { CanvasShouldNotBeWithInTheContainer = 2, ContainerSshouldBeWithInTheCanvas = 3 } + export interface CropperCustomEvent extends CustomEvent { + detail: Data; + } export interface CropperOptions { + /** + * Function called when crop box is moved or resized + */ + crop?: (event: CropperCustomEvent) => void; + /** + * Function called at start of crop box being moved or resized + */ + cropstart?: (event: CropperCustomEvent) => void; + /** + * Function called when crop box is moved + */ + cropmove?: (event: CropperCustomEvent) => void; + /** + * Function called when crop box is finished being moved or resized + */ + cropend?: (event: CropperCustomEvent) => void; /** * Define the view mode of the cropper. * @default 0 diff --git a/crypto-js/crypto-js-tests.ts b/crypto-js/crypto-js-tests.ts index 199c32ef2f..3a06346ed4 100644 --- a/crypto-js/crypto-js-tests.ts +++ b/crypto-js/crypto-js-tests.ts @@ -2,8 +2,8 @@ import CryptoJS = require('crypto-js'); +// Hashers var str: string; - str = CryptoJS.MD5('some message'); str = CryptoJS.MD5('some message', 'some key'); @@ -13,11 +13,123 @@ str = CryptoJS.SHA1('some message', 'some key', { any: true }); str = CryptoJS.format.OpenSSL('some message'); str = CryptoJS.format.OpenSSL('some message', 'some key'); -str = CryptoJS.enc.Utf8('some message'); -str = CryptoJS.enc.Utf8('some message', 'some key'); -str = CryptoJS.mode.OFB('some message'); -str = CryptoJS.mode.OFB('some message', 'some key'); +// Ciphers +var encrypted: CryptoJS.WordArray; +var decrypted: CryptoJS.DecryptedMessage; -str = CryptoJS.pad.Ansix923('some message'); -str = CryptoJS.pad.Ansix923('some message', 'some key'); +encrypted = CryptoJS.AES.encrypt("Message", "Secret Passphrase"); +decrypted = CryptoJS.AES.decrypt(encrypted, "Secret Passphrase"); + +encrypted = CryptoJS.DES.encrypt("Message", "Secret Passphrase"); +decrypted = CryptoJS.DES.decrypt(encrypted, "Secret Passphrase"); + +encrypted = CryptoJS.TripleDES.encrypt("Message", "Secret Passphrase"); +decrypted = CryptoJS.TripleDES.decrypt(encrypted, "Secret Passphrase"); + + +encrypted = CryptoJS.Rabbit.encrypt("Message", "Secret Passphrase"); +decrypted = CryptoJS.Rabbit.decrypt(encrypted, "Secret Passphrase"); + +encrypted = CryptoJS.RC4.encrypt("Message", "Secret Passphrase"); +decrypted = CryptoJS.RC4.decrypt(encrypted, "Secret Passphrase"); + +encrypted = CryptoJS.RC4Drop.encrypt("Message", "Secret Passphrase"); +encrypted = CryptoJS.RC4Drop.encrypt("Message", "Secret Passphrase", { drop: 3072 / 4 }); +decrypted = CryptoJS.RC4Drop.decrypt(encrypted, "Secret Passphrase", { drop: 3072 / 4 }); + +var key = CryptoJS.enc.Hex.parse('000102030405060708090a0b0c0d0e0f'); +var iv = CryptoJS.enc.Hex.parse('101112131415161718191a1b1c1d1e1f'); +encrypted = CryptoJS.AES.encrypt("Message", key, { iv: iv }); + +encrypted = CryptoJS.AES.encrypt("Message", "Secret Passphrase", { + mode: CryptoJS.mode.CFB, + padding: CryptoJS.pad.AnsiX923 +}); + + +// The Cipher Output +encrypted = CryptoJS.AES.encrypt("Message", "Secret Passphrase"); +alert(encrypted.key); +// 74eb593087a982e2a6f5dded54ecd96d1fd0f3d44a58728cdcd40c55227522223 +alert(encrypted.iv); +// 7781157e2629b094f0e3dd48c4d786115 +alert(encrypted.salt); +// 7a25f9132ec6a8b34 +alert(encrypted.ciphertext); +// 73e54154a15d1beeb509d9e12f1e462a0 +alert(encrypted); +// U2FsdGVkX1+iX5Ey7GqLND5UFUoV0b7rUJ2eEvHkYqA= + +var JsonFormatter = { + stringify: function(cipherParams: any) { + // create json object with ciphertext + var jsonObj: any = { + ct: cipherParams.ciphertext.toString(CryptoJS.enc.Base64) + }; + // optionally add iv and salt + if (cipherParams.iv) { + jsonObj.iv = cipherParams.iv.toString(); + } + if (cipherParams.salt) { + jsonObj.s = cipherParams.salt.toString(); + } + // stringify json object + return JSON.stringify(jsonObj); + }, + parse: function (jsonStr: any) { + // parse json string + var jsonObj = JSON.parse(jsonStr); + // extract ciphertext from json object, and create cipher params object + var cipherParams = (CryptoJS).lib.CipherParams.create({ + ciphertext: CryptoJS.enc.Base64.parse(jsonObj.ct) + }); + // optionally extract iv and salt + if (jsonObj.iv) { + cipherParams.iv = CryptoJS.enc.Hex.parse(jsonObj.iv); + } + if (jsonObj.s) { + cipherParams.salt = CryptoJS.enc.Hex.parse(jsonObj.s); + } return cipherParams; + } +}; +encrypted = CryptoJS.AES.encrypt("Message", "Secret Passphrase", { + format: JsonFormatter +}); +alert(encrypted); +// {"ct":"tZ4MsEnfbcDOwqau68aOrQ==","iv":"8a8c8fd8fe33743d3638737ea4a00698","s":"ba06373c8f57179c"} +decrypted = CryptoJS.AES.decrypt(encrypted, "Secret Passphrase", { + format: JsonFormatter +}); +alert(decrypted.toString(CryptoJS.enc.Utf8)); // Message + + +// Progressive Ciphering +var key = CryptoJS.enc.Hex.parse('000102030405060708090a0b0c0d0e0f'); +var iv = CryptoJS.enc.Hex.parse('101112131415161718191a1b1c1d1e1f'); +var aesEncryptor = CryptoJS.algo.AES.createEncryptor(key, { iv: iv }); +var ciphertextPart1 = aesEncryptor.process("Message Part 1"); +var ciphertextPart2 = aesEncryptor.process("Message Part 2"); +var ciphertextPart3 = aesEncryptor.process("Message Part 3"); +var ciphertextPart4 = aesEncryptor.finalize(); +var aesDecryptor = CryptoJS.algo.AES.createDecryptor(key, { iv: iv }); +var plaintextPart1 = aesDecryptor.process(ciphertextPart1); +var plaintextPart2 = aesDecryptor.process(ciphertextPart2); +var plaintextPart3 = aesDecryptor.process(ciphertextPart3); +var plaintextPart4 = aesDecryptor.process(ciphertextPart4); +var plaintextPart5 = aesDecryptor.finalize(); + + +// Encoders +var words = CryptoJS.enc.Base64.parse('SGVsbG8sIFdvcmxkIQ=='); +var base64 = CryptoJS.enc.Base64.stringify(words); +var words = CryptoJS.enc.Latin1.parse('Hello, World!'); +var latin1 = CryptoJS.enc.Latin1.stringify(words); +var words = CryptoJS.enc.Hex.parse('48656c6c6f2c20576f726c6421'); +var hex = CryptoJS.enc.Hex.stringify(words); +var words = CryptoJS.enc.Utf8.parse('𤭢'); +var utf8 = CryptoJS.enc.Utf8.stringify(words); +var words = CryptoJS.enc.Utf16.parse('Hello, World!'); +var utf16 = CryptoJS.enc.Utf16.stringify(words); +var words = CryptoJS.enc.Utf16LE.parse('Hello, World!'); +var utf16 = CryptoJS.enc.Utf16LE.stringify(words); diff --git a/crypto-js/crypto-js.d.ts b/crypto-js/crypto-js.d.ts index 19ea3cd196..e58b9c9339 100644 --- a/crypto-js/crypto-js.d.ts +++ b/crypto-js/crypto-js.d.ts @@ -1,10 +1,48 @@ -// Type definitions for crypto-js v3.1.3 +// Type definitions for crypto-js v3.1.4 // Project: https://github.com/evanvosberg/crypto-js // Definitions by: Michael Zabka // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace CryptoJS { type Hash = (message: string, key?: string, ...options: any[]) => string; + interface Cipher { + encrypt(message: string, secretPassphrase: string, option?: CipherOption): WordArray; + decrypt(encryptedMessage: string | WordArray, secretPassphrase: string, option?: CipherOption): DecryptedMessage; + } + interface CipherAlgorythm { + createEncryptor(secretPassphrase: string, option?: CipherOption): Encriptor; + createDecryptor(secretPassphrase: string, option?: CipherOption): Decryptor; + } + interface Encriptor { + process(messagePart: string): string; + finalize(): string; + } + interface Decryptor { + process(messagePart: string): string; + finalize(): string; + } + export interface WordArray { + iv: string; + salt: string; + ciphertext: string; + key?: string; + } + export type DecryptedMessage = { + toString(encoder?: Encoder): string; + }; + interface CipherOption { + iv?: string; + mode?: Mode; + padding?: Padding; + [option: string]: any; + } + interface Encoder { + parse(encodedMessage: string): any; + stringify(words: any): string; + } + + interface Mode {} + interface Padding {} export interface Hashes { MD5: Hash; @@ -24,37 +62,51 @@ declare namespace CryptoJS { HmacSHA3: Hash; HmacRIPEMD160: Hash; PBKDF2: Hash; - AES: Hash; - TripleDES: Hash; - RC4: Hash; - Rabbit: Hash; - RabbitLegacy: Hash; - EvpKDF: Hash; + AES: Cipher; + DES: Cipher; + TripleDES: Cipher; + RC4: Cipher; + RC4Drop: Cipher; + Rabbit: Cipher; + RabbitLegacy: Cipher; + EvpKDF: Cipher; + algo: { + AES: CipherAlgorythm; + DES: CipherAlgorythm; + TrippleDES: CipherAlgorythm; + RC4: CipherAlgorythm; + RC4Drop: CipherAlgorythm; + Rabbit: CipherAlgorythm; + RabbitLegacy: CipherAlgorythm; + EvpKDF: CipherAlgorythm; + }; format: { - OpenSSL: Hash; - Hex: Hash; + OpenSSL: any; + Hex: any; }; enc: { - Latin1: Hash; - Utf8: Hash; - Hex: Hash; - Utf16: Hash; - Base64: Hash; + Latin1: Encoder; + Utf8: Encoder; + Hex: Encoder; + Utf16: Encoder; + Utf16LE: Encoder; + Base64: Encoder; }; mode: { - CFB: Hash; - CTR: Hash; - CTRGladman: Hash; - OFB: Hash; - ECB: Hash; + CBC: Mode; + CFB: Mode; + CTR: Mode; + CTRGladman: Mode; + OFB: Mode; + ECB: Mode; }; pad: { - Pkcs7: Hash; - Ansix923: Hash; - Iso10126: Hash; - Iso97971: Hash; - ZeroPadding: Hash; - NoPadding: Hash; + Pkcs7: Padding; + AnsiX923: Padding; + Iso10126: Padding; + Iso97971: Padding; + ZeroPadding: Padding; + NoPadding: Padding; }; } diff --git a/csurf/csurf.d.ts b/csurf/csurf.d.ts index ed2b2e68ed..3d213c76cd 100644 --- a/csurf/csurf.d.ts +++ b/csurf/csurf.d.ts @@ -1,4 +1,4 @@ -// Type definitions for csurf +// Type definitions for csurf 1.9.0 // Project: https://www.npmjs.org/package/csurf // Definitions by: Hiroki Horiuchi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -17,6 +17,8 @@ declare module "csurf" { function csurf(options?: { value?: (req: express.Request) => string; cookie?: csurf.CookieOptions | boolean; + ignoreMethods?: string[]; + sessionKey?: string; }): express.RequestHandler; namespace csurf { diff --git a/csv-parse/csv-parse-tests.ts b/csv-parse/csv-parse-tests.ts new file mode 100644 index 0000000000..d64c765ed2 --- /dev/null +++ b/csv-parse/csv-parse-tests.ts @@ -0,0 +1,64 @@ +/// + +import parse = require('csv-parse'); + +function callbackAPITest() { + var input = '#Welcome\n"1","2","3","4"\n"a","b","c","d"'; + parse(input, {comment: '#'}, function(err, output){ + output.should.eql([ [ '1', '2', '3', '4' ], [ 'a', 'b', 'c', 'd' ] ]); + }); +} + +function streamAPITest() { + var output:any = []; + // Create the parser + var parser = parse({delimiter: ':'}); + var record: any; + // Use the writable stream api + parser.on('readable', function(){ + while(record = parser.read()){ + output.push(record); + } + }); + // Catch any error + parser.on('error', function(err: any){ + console.log(err.message); + }); + // When we are done, test that the parsed output matched what expected + parser.on('finish', function(){ + output.should.eql([ + [ 'root','x','0','0','root','/root','/bin/bash' ], + [ 'someone','x','1022','1022','a funny cat','/home/someone','/bin/bash' ] + ]); + }); + // Now that setup is done, write data to the stream + parser.write("root:x:0:0:root:/root:/bin/bash\n"); + parser.write("someone:x:1022:1022:a funny cat:/home/someone:/bin/bash\n"); + // Close the readable stream + parser.end(); +} + +import fs = require('fs'); + +function pipeFunctionTest() { + var transform = require('stream-transform'); + + var output:any = []; + var parser = parse({delimiter: ':'}) + var input = fs.createReadStream('/etc/passwd'); + var transformer = transform(function(record: any[], callback: any){ + setTimeout(function(){ + callback(null, record.join(' ')+'\n'); + }, 500); + }, {parallel: 10}); + input.pipe(parser).pipe(transformer).pipe(process.stdout); +} + +import parseSync = require('csv-parse/lib/sync'); + +function syncApiTest() { + var input = '"key_1","key_2"\n"value 1","value 2"'; + var records = parseSync(input, {columns: true}); + records.should.eql([{ key_1: 'value 1', key_2: 'value 2' }]); +} + diff --git a/csv-parse/csv-parse.d.ts b/csv-parse/csv-parse.d.ts new file mode 100644 index 0000000000..74184ca680 --- /dev/null +++ b/csv-parse/csv-parse.d.ts @@ -0,0 +1,132 @@ +// Type definitions for csv-parse 1.1.0 +// Project: https://github.com/wdavidw/node-csv-parse +// Definitions by: David Muller +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module "csv-parse/types" { + interface callbackFn { + (err: any, output: any): void + } + + interface nameCallback { + (line1: any[]): boolean | string[] + } + + interface options { + /*** + * Set the field delimiter. One character only, defaults to comma. + */ + delimiter?: string; + + /*** + * String used to delimit record rows or a special value; special constants are 'auto', 'unix', 'mac', 'windows', 'unicode'; defaults to 'auto' (discovered in source or 'unix' if no source is specified). + */ + rowDelimiter?: string; + /*** + * Optional character surrounding a field, one character only, defaults to double quotes. + */ + quote?: string + + /*** + * Set the escape character, one character only, defaults to double quotes. + */ + escape?: string + + /*** + * List of fields as an array, a user defined callback accepting the first line and returning the column names or true if autodiscovered in the first CSV line, default to null, affect the result data set in the sense that records will be objects instead of arrays. + */ + columns?: any[]|boolean|nameCallback; + + /*** + * Treat all the characters after this one as a comment, default to '' (disabled). + */ + comment?: string + + /*** + * Name of header-record title to name objects by. + */ + objname?: string + + /*** + * Preserve quotes inside unquoted field. + */ + relax?: boolean + + /*** + * Discard inconsistent columns count, default to false. + */ + relax_column_count?: boolean + + /*** + * Dont generate empty values for empty lines. + */ + skip_empty_lines?: boolean + + /*** + * Maximum numer of characters to be contained in the field and line buffers before an exception is raised, used to guard against a wrong delimiter or rowDelimiter, default to 128000 characters. + */ + max_limit_on_data_read?: number + + /*** + * If true, ignore whitespace immediately around the delimiter, defaults to false. Does not remove whitespace in a quoted field. + */ + trim?: boolean + + /*** + * If true, ignore whitespace immediately following the delimiter (i.e. left-trim all fields), defaults to false. Does not remove whitespace in a quoted field. + */ + ltrim?: boolean + + /*** + * If true, ignore whitespace immediately preceding the delimiter (i.e. right-trim all fields), defaults to false. Does not remove whitespace in a quoted field. + */ + rtrim?: boolean + + /*** + * If true, the parser will attempt to convert read data types to native types. + */ + auto_parse?: boolean + + /*** + * If true, the parser will attempt to convert read data types to dates. It requires the "auto_parse" option. + */ + auto_parse_date?: boolean + } + + import * as stream from "stream"; + + interface Parser extends stream.Transform { + __push(line: any): any ; + __write(chars: any, end: any, callback: any): any; + } + + interface ParserConstructor { + new (options: options): Parser; + } + + interface parse { + (input: string, options?: options, callback?: callbackFn): any; + (options: options, callback: callbackFn): any; + (callback: callbackFn): any; + (options?: options): NodeJS.ReadWriteStream; + Parser: ParserConstructor; + } +} + +declare module "csv-parse" { + import { parse as parseIntf } from "csv-parse/types"; + + let parse: parseIntf; + + export = parse; +} + +declare module "csv-parse/lib/sync" { + import { options } from "csv-parse/types"; + + function parse (input: string, options?: options): any; + + export = parse; +} \ No newline at end of file diff --git a/csv-stringify/csv-stringify.d.ts b/csv-stringify/csv-stringify.d.ts index a1cc16a15b..1effe84f61 100644 --- a/csv-stringify/csv-stringify.d.ts +++ b/csv-stringify/csv-stringify.d.ts @@ -58,8 +58,8 @@ declare module "csv-stringify" { interface Stringifier extends NodeJS.ReadWriteStream { - // Stringifier stream takes array of strings - write(line: string[]): boolean; + // Stringifier stream takes array of strings or Object + write(line: string[] | Object): boolean; // repeat declarations from NodeJS.WritableStream to avoid compile error write(buffer: Buffer, cb?: Function): boolean; diff --git a/cucumber/cucumber.d.ts b/cucumber/cucumber.d.ts index d0e742d9c2..6c4273e4e0 100644 --- a/cucumber/cucumber.d.ts +++ b/cucumber/cucumber.d.ts @@ -29,8 +29,20 @@ declare namespace cucumber { } interface HookScenario{ - attach(text: string, mimeType?: string, callback?: (err?:any) => void): void; - isFailed() : boolean; + getKeyword():string; + getName():string; + getDescription():string; + getUri():string; + getLine():number; + getTags():string[]; + getException():Error; + getAttachments():any[]; + attach(data:any, mimeType?:string, callback?:(err?:any) => void):void; + isSuccessful():boolean; + isFailed():boolean; + isPending():boolean; + isUndefined():boolean; + isSkipped():boolean; } interface HookCode { diff --git a/d3/d3-tests.ts b/d3/d3-tests.ts index c9027b0889..7991dcaa03 100644 --- a/d3/d3-tests.ts +++ b/d3/d3-tests.ts @@ -2706,3 +2706,17 @@ function testMultiUtcFormat() { ["%Y", function() { return true; }] ]); } + +function testEnterSizeEmpty() { + + var selectionSize: number, + emptyStatus: boolean; + + var newNodes = d3.selectAll('.test') + .data(['1', '2', '3']) + .enter(); + + emptyStatus = newNodes.empty(); + selectionSize = newNodes.size(); + +} \ No newline at end of file diff --git a/d3/d3.d.ts b/d3/d3.d.ts index c80a922f1f..3ad327ffc3 100644 --- a/d3/d3.d.ts +++ b/d3/d3.d.ts @@ -292,17 +292,17 @@ declare namespace d3 { */ datum(): Datum; - /** - * Set the data item for each node in the selection. - * @param value the constant element to use for each node - */ - datum(value: NewDatum): Update; - /** * Derive the data item for each node in the selection. Useful for situations such as the HTML5 'dataset' attribute. * @param value the function to compute data for each node */ datum(value: (datum: Datum, index: number, outerIndex: number) => NewDatum): Update; + + /** + * Set the data item for each node in the selection. + * @param value the constant element to use for each node + */ + datum(value: NewDatum): Update; /** * Reorders nodes in the selection based on the given comparator. Nodes are re-inserted into the document once sorted. @@ -415,6 +415,9 @@ declare namespace d3 { select(name: (datum: Datum, index: number, outerIndex: number) => EventTarget): Selection; call(func: (selection: Enter, ...args: any[]) => any, ...args: any[]): Enter; + + empty(): boolean; + size(): number; } } @@ -1075,11 +1078,16 @@ declare namespace d3 { * Return the min and max simultaneously. */ export function extent(array: T[], accessor: (datum: T, index: number) => string): [string, string]; + + /** + * Return the min and max simultaneously. + */ + export function extent(array: T[], accessor: (datum: T, index: number) => Date): [Date, Date]; /** * Return the min and max simultaneously. */ - export function extent(array: U[], accessor: (datum: T, index: number) => U): [U | Primitive, U | Primitive]; + export function extent(array: T[], accessor: (datum: T, index: number) => U): [U | Primitive, U | Primitive]; /** * Compute the sum of an array of numbers. @@ -1094,6 +1102,12 @@ declare namespace d3 { export function mean(array: number[]): number; export function mean(array: T[], accessor: (datum: T, index: number) => number): number; + /** + * Compute the median of an array of numbers (the 0.5-quantile). + */ + export function median(array: number[]): number; + export function median(datum: T[], accessor: (datum: T, index: number) => number): number; + export function quantile(array: number[], p: number): number; export function variance(array: number[]): number; @@ -1102,8 +1116,7 @@ declare namespace d3 { export function deviation(array: number[]): number; export function deviation(array: T[], accessor: (datum: T, index: number) => number): number; - export function bisectLeft(array: number[], x: number, lo?: number, hi?: number): number; - export function bisectLeft(array: string[], x: string, lo?: number, hi?: number): number; + export function bisectLeft(array: T[], x: T, lo?: number, hi?: number): number; export var bisect: typeof bisectRight; @@ -2975,6 +2988,7 @@ declare namespace d3 { range(): (values: T[], index: number) => [number, number]; range(range: (values: T[], index: number) => [number, number]): Histogram; + range(range: [number, number]): Histogram; bins(): (range: [number, number], values: T[], index: number) => number[]; bins(count: number): Histogram; @@ -3055,6 +3069,8 @@ declare namespace d3 { } export interface Partition { + (root: T): T[]; + nodes(root: T): T[]; links(nodes: T[]): partition.Link[]; diff --git a/d3kit/d3kit-tests.ts b/d3kit/d3kit-tests.ts new file mode 100644 index 0000000000..1b8d2a24f9 --- /dev/null +++ b/d3kit/d3kit-tests.ts @@ -0,0 +1,1112 @@ +/// +/// +/// +/// + +/* jshint expr: true */ + +var expect = chai.expect; +describe('Skeleton', function(){ + var element: Element, $element: d3.Selection, $svg: d3.Selection, skeleton: d3kit.Skeleton; + + beforeEach(function(done){ + element = document.body.appendChild(document.createElement('div')) as Element; + skeleton = new d3kit.Skeleton(element, null, ['custom1', 'custom2']); + $element = d3.select(element); + $svg = $element.select('svg'); + done(); + }); + + describe('new Skeleton()', function(){ + it('should create inside the element', function(){ + expect($element.select('svg').size()).to.be.equal(1); + }); + it('should create inside inside the element', function(){ + expect($element.select('svg').select('g').size()).to.be.equal(1); + }); + }); + + describe('#getCustomEventNames()', function(){ + it('should return custom event names', function(){ + expect(skeleton.getCustomEventNames()).to.deep.equal(['custom1', 'custom2']); + }); + }); + + describe('#getDispatcher()', function(){ + it('should return event dispatcher', function(){ + expect(skeleton.getDispatcher()).to.be.an('Object'); + expect(skeleton.getDispatcher().data).to.be.a('Function'); + }); + }); + + describe('#getInnerWidth()', function(){ + it('should return width of the skeleton excluding margin', function(){ + skeleton.options({ + margin: {left: 10, right: 10} + }); + skeleton.width(100); + expect(skeleton.getInnerWidth()).to.equal(80); + }); + }); + + describe('#getInnerHeight()', function(){ + it('should return height of the skeleton excluding margin', function(){ + skeleton.options({ + margin: {top: 10, bottom: 20} + }); + skeleton.height(100); + expect(skeleton.getInnerHeight()).to.equal(70); + }); + }); + + describe('#getLayerOrganizer()', function(){ + it('should return the LayerOrganizer', function(){ + expect(skeleton.getLayerOrganizer()).to.be.an('Object'); + }); + }); + + describe('#getRootG()', function(){ + it('should return d3 selection of the root ', function(){ + var g = skeleton.getRootG(); + expect(g.size()).to.equal(1); + expect((g[0][0] as Element).tagName).to.equal('g'); + }); + }); + + describe('#getSvg()', function(){ + it('should return d3 selection of the ', function(){ + var svg = skeleton.getSvg(); + expect(svg.size()).to.equal(1); + expect((svg[0][0] as Element).tagName).to.equal('svg'); + }); + }); + + describe('#data(data, doNotDispatch)', function(){ + it('should return data when called without argument', function(){ + skeleton.data({a: 1}); + expect(skeleton.data()).to.deep.equal({a: 1}); + }); + it('should set data when called with at least one argument', function(){ + skeleton.data('test'); + expect(skeleton.data()).to.equal('test'); + }); + it('after setting, should dispatch "data" event', function(done){ + skeleton.on('data.test', function(){ + // This block should be reached to pass the test. + expect(true).to.be.true; + done(); + }); + skeleton.data({a: 1}); + }); + it('after setting, should not dispatch "data" event if doNotDispatch is true', function(done){ + skeleton.on('data.test', function(){ + // This block should not be reached. + expect(true).to.be.false; + done(); + }); + skeleton.data({a: 1}, true); + setTimeout(done, 100); + }); + }); + + describe('#options(options, doNotDispatch)', function(){ + it('should return options when called without argument', function(){ + skeleton.options({a: 2}); + expect(skeleton.options()).to.include.keys(['a']); + expect(skeleton.options().a).to.equal(2); + }); + it('should set options when called with at least one argument', function(){ + skeleton.options({a: 1}); + expect(skeleton.options()).to.include.keys(['a']); + expect(skeleton.options().a).to.equal(1); + }); + it('should not overwrite but extend existing options when setting', function(){ + skeleton.options({a: 1}); + skeleton.options({b: 2}); + expect(skeleton.options()).to.include.keys(['a', 'b']); + expect(skeleton.options().a).to.equal(1); + expect(skeleton.options().b).to.equal(2); + }); + it('after setting, should dispatch "options" event', function(done){ + skeleton.on('options.test', function(){ + // This block should be reached to pass the test. + expect(true).to.be.true; + done(); + }); + skeleton.options({a: 1}); + }); + it('after setting, should not dispatch "options" event if doNotDispatch is true', function(done){ + skeleton.on('options.test', function(){ + // This block should not be reached. + expect(true).to.be.false; + done(); + }); + skeleton.options({a: 1}, true); + setTimeout(done, 100); + }); + }); + + describe('#margin(margin, doNotDispatch)', function(){ + it('should return margin when called without argument', function(){ + var margin = {left: 10, right: 10, top: 10, bottom: 10}; + skeleton.margin(margin); + expect(skeleton.margin()).to.deep.equal(margin); + }); + it('should set margin when called with at least one argument', function(){ + var margin = {left: 10, right: 10, top: 10, bottom: 10}; + skeleton.margin(margin); + + skeleton.margin({left: 20}); + expect(skeleton.margin().left).to.equal(20); + expect(skeleton.margin().right).to.equal(10); + skeleton.margin({right: 20}); + expect(skeleton.margin().right).to.equal(20); + skeleton.margin({top: 20}); + expect(skeleton.margin().top).to.equal(20); + skeleton.margin({bottom: 20}); + expect(skeleton.margin().bottom).to.equal(20); + }); + it('should update innerWidth after setting margin', function(){ + skeleton.width(100); + skeleton.margin({left: 10, right:10}); + expect(skeleton.getInnerWidth()).to.equal(80); + skeleton.margin({left: 15, right:15}); + expect(skeleton.getInnerWidth()).to.equal(70); + }); + it('should update innerHeight after setting margin', function(){ + skeleton.height(100); + skeleton.margin({top: 10, bottom:10}); + expect(skeleton.getInnerHeight()).to.equal(80); + skeleton.margin({top: 15, bottom:15}); + expect(skeleton.getInnerHeight()).to.equal(70); + }); + it('should update the root transform/translate', function(){ + skeleton.margin({left: 30, top: 30}); + skeleton.offset([0.5, 0.5]); + skeleton.margin({left: 10, top: 10}); + var translate = skeleton.getRootG().attr('transform'); + expect(translate).to.equal('translate(10.5,10.5)'); + }); + it('after setting, should dispatch "resize" event', function(done){ + skeleton.on('resize.test', function(){ + // This block should be reached to pass the test. + expect(true).to.be.true; + done(); + }); + skeleton.margin({left: 33}); + }); + it('after setting, should not dispatch "resize" event if doNotDispatch is true', function(done){ + skeleton.on('resize.test', function(){ + // This block should not be reached. + expect(true).to.be.false; + done(); + }); + skeleton.margin({left: 33}, true); + setTimeout(done, 100); + }); + }); + + describe('#offset(offset)', function(){ + it('should return offset when called without argument', function(){ + var offset = [1,1]; + skeleton.offset(offset); + expect(skeleton.offset()).to.deep.equal(offset); + }); + it('should set offset when called with at least one argument', function(){ + var offset = [1,1]; + skeleton.offset(offset); + skeleton.offset([2,3]); + expect(skeleton.offset()).to.deep.equal([2,3]); + }); + it('should update the root transform/translate', function(){ + skeleton.offset([0.5, 0.5]); + skeleton.margin({left: 10, top: 10}); + skeleton.offset([2,3]); + var translate = skeleton.getRootG().attr('transform'); + expect(translate).to.equal('translate(12,13)'); + }); + }); + + describe('#width(width, doNotDispatch)', function(){ + it('should return width when called without argument', function(){ + var w = $svg.attr('width'); + expect(skeleton.width()).to.equal(+w); + }); + it('should set width when called with Number as the first argument', function(){ + skeleton.width(300); + expect(+$svg.attr('width')).to.equal(300); + }); + it('should set width when called with a Number and "px" such as "100px" as the first argument', function(){ + skeleton.width('299px'); + expect(+$svg.attr('width')).to.equal(299); + }); + it('should set width to container\'s width when called with "auto" as the first argument', function(){ + var w = element.clientWidth; + skeleton.width('auto'); + expect(+$svg.attr('width')).to.equal(w); + }); + it('after setting, should dispatch "resize" event', function(done){ + skeleton.on('resize.test', function(){ + // This block should be reached to pass the test. + expect(true).to.be.true; + done(); + }); + skeleton.width(200); + }); + it('after setting, should not dispatch "resize" event if doNotDispatch is true', function(done){ + skeleton.on('resize.test', function(){ + // This block should not be reached. + expect(true).to.be.false; + done(); + }); + skeleton.width(200, true); + setTimeout(done, 100); + }); + }); + + describe('#height(height, doNotDispatch)', function(){ + it('should return height when called without argument', function(){ + var w = $svg.attr('height'); + expect(skeleton.height()).to.equal(+w); + }); + it('should set height when called with Number as the first argument', function(){ + skeleton.height(300); + expect(+$svg.attr('height')).to.equal(300); + }); + it('should set height when called with a Number and "px" such as "100px" as the first argument', function(){ + skeleton.height('299px'); + expect(+$svg.attr('height')).to.equal(299); + }); + it('should set height to container\'s height when called with "auto" as the first argument', function(){ + var w = element.clientHeight; + skeleton.height('auto'); + expect(+$svg.attr('height')).to.equal(w); + }); + it('after setting, should dispatch "resize" event', function(done){ + skeleton.on('resize.test', function(){ + // This block should be reached to pass the test. + expect(true).to.be.true; + done(); + }); + skeleton.height(200); + }); + it('after setting, should not dispatch "resize" event if doNotDispatch is true', function(done){ + skeleton.on('resize.test', function(){ + // This block should not be reached. + expect(true).to.be.false; + done(); + }); + skeleton.height(200, true); + setTimeout(done, 100); + }); + }); + + describe('#dimension(dimension, doNotDispatch)', function(){ + it('should return an array [width, height] when called without argument', function(){ + var dim = [+$svg.attr('width'), +$svg.attr('height')]; + expect(skeleton.dimension()).to.deep.equal(dim); + }); + it('should set width and height of the when called with an array [width, height] as the first argument', function(){ + skeleton.dimension([118, 118]); + expect([+$svg.attr('width'), +$svg.attr('height')]).to.deep.equal([118, 118]); + }); + it('after setting, should dispatch "resize" event', function(done){ + skeleton.on('resize.test', function(){ + // This block should be reached to pass the test. + expect(true).to.be.true; + done(); + }); + skeleton.dimension([150, 150]); + }); + it('after setting, should not dispatch "resize" event if doNotDispatch is true', function(done){ + skeleton.on('resize.test', function(){ + // This block should not be reached. + expect(true).to.be.false; + done(); + }); + skeleton.dimension([150, 150], true); + setTimeout(done, 100); + }); + }); + + describe('#hasData()', function(){ + it('should return true when data are not null nor undefined', function(){ + skeleton.data({}); + expect(skeleton.hasData()).to.be.true; + skeleton.data({test: 1}); + expect(skeleton.hasData()).to.be.true; + skeleton.data([]); + expect(skeleton.hasData()).to.be.true; + skeleton.data(['test']); + expect(skeleton.hasData()).to.be.true; + }); + it('should return false when data are null or undefined', function(){ + skeleton.data(null); + expect(skeleton.hasData()).to.be.false; + skeleton.data(undefined); + expect(skeleton.hasData()).to.be.false; + }); + }); + + describe('#hasNonZeroArea()', function(){ + it('should return true if \'s width & height excluding margin is more than zero', function(){ + skeleton.options({ + margin: {left: 10, right: 10} + }); + skeleton.width(80); + skeleton.options({ + margin: {top: 10, bottom: 20} + }); + skeleton.height(50); + expect(skeleton.hasNonZeroArea()).to.be.true; + }); + it('should return false otherwise', function(){ + skeleton.options({ + margin: {left: 10, right: 10} + }); + skeleton.width(20); + skeleton.options({ + margin: {top: 10, bottom: 20} + }); + skeleton.height(30); + expect(skeleton.hasNonZeroArea()).to.be.false; + }); + }); + + describe('#mixin({})', function(){ + it('should extend this skeleton with new fields/functions', function(){ + skeleton.mixin({ + a: 1, + b: 2 + }); + expect(skeleton).to.include.keys(['a', 'b']); + expect((skeleton).a).to.equal(1); + expect((skeleton).b).to.equal(2); + }); + it('should overwrite existing fields', function(){ + skeleton.mixin({ + b: 2 + }); + skeleton.mixin({ + b: 3 + }); + expect(skeleton).to.include.keys(['b']); + expect((skeleton).b).to.equal(3); + }); + it('should keep original fields if not overwritten', function(){ + skeleton.mixin({ + a: 1, + b: 2 + }); + skeleton.mixin({ + c: 20, + b: 3 + }); + expect(skeleton).to.include.keys(['a', 'b', 'c']); + expect((skeleton).a).to.equal(1); + expect((skeleton).b).to.equal(3); + expect((skeleton).c).to.equal(20); + }); + }); + + describe('#resizeToFitContainer(mode)', function(){ + it('when mode is "all" should resize to fit both width and height', function(){ + skeleton.dimension([element.clientWidth/2, element.clientHeight/2]); + var w = element.clientWidth; + var h = element.clientHeight; + skeleton.resizeToFitContainer('all'); + expect(skeleton.dimension()).to.deep.equal([w, h]); + }); + it('when mode is "both" should resize to fit both width and height', function(){ + skeleton.dimension([element.clientWidth/2, element.clientHeight/2]); + var w = element.clientWidth; + var h = element.clientHeight; + skeleton.resizeToFitContainer('both'); + expect(skeleton.dimension()).to.deep.equal([w, h]); + }); + it('when mode is "full" should resize to fit both width and height', function(){ + skeleton.dimension([element.clientWidth/2, element.clientHeight/2]); + var w = element.clientWidth; + var h = element.clientHeight; + skeleton.resizeToFitContainer('full'); + expect(skeleton.dimension()).to.deep.equal([w, h]); + }); + it('when mode is "width" should resize width to fit container but keep original height', function(){ + var w1 = element.clientWidth/2; + var h1 = element.clientHeight/2; + + skeleton.dimension([w1, h1]); + + var w2 = element.clientWidth; + var h2 = element.clientHeight; + + skeleton.resizeToFitContainer('width'); + + expect(skeleton.width()).to.equal(Math.floor(w2)); + expect(skeleton.height()).to.equal(Math.floor(h1)); + expect(skeleton.width()).to.not.equal(w1); + expect(skeleton.height()).to.not.equal(h2); + }); + it('when mode is "height" should resize height to fit container but keep original width', function(){ + var w1 = element.clientWidth/2; + var h1 = element.clientHeight*2; + + skeleton.dimension([w1, h1]); + + var w2 = element.clientWidth; + var h2 = element.clientHeight; + + skeleton.resizeToFitContainer('height'); + + expect(skeleton.width()).to.equal(Math.floor(w1)); + expect(skeleton.height()).to.equal(Math.floor(h2)); + expect(skeleton.width()).to.not.equal(w2); + expect(skeleton.height()).to.not.equal(h1); + }); + }); + + describe('#resizeToAspectRatio(ratio)', function(){ + // todo + }); + + describe('#autoResize(mode)', function(){ + it('should return current mode when called without argument', function(){ + skeleton.autoResize(false); + expect(skeleton.autoResize()).to.be.false; + skeleton.autoResize('width'); + expect(skeleton.autoResize()).to.equal('width'); + }); + it('should enable auto resize when set mode to "width/height/both/etc.", similar to parameters of resizeToFitContainer()', function(done){ + // set initial size + skeleton.width(50); + skeleton.autoResize('width'); + setTimeout(function(){ + expect(skeleton.width()).to.equal(element.clientWidth); + done(); + }, 500); + }); + it('should disable auto resize when set mode to false', function(done){ + // set initial size + skeleton.width(50); + skeleton.autoResize('width'); + setTimeout(function(){ + expect(skeleton.width()).to.equal(element.clientWidth); + // disable resize and + skeleton.autoResize(false); + skeleton.width(50); + setTimeout(function(){ + expect(skeleton.width()).to.not.equal(element.clientWidth); + done(); + }, 500); + }, 500); + }); + }); + + describe('#autoResizeDetection(detection)', function(){ + // todo + }); + + describe('#autoResizeToAspectRatio(ratio)', function(){ + // todo + }); + + +}); + +describe.only('LayerOrganizer', function(){ + + describe('new LayerOrganizer(container) will create layers as by default', function(){ + var container: d3.Selection, layers: d3kit.LayerOrganizer; + before(function(done){ + container = d3.select('body').append('svg').append('g'); + layers = new d3kit.LayerOrganizer(container); + done(); + }); + + describe('#create(names)', function(){ + it('should create single layer given a String', function(){ + layers.create('single'); + expect(container.select('g.single-layer').size()).to.be.equal(1); + }); + + it('should create multiple layers given an array', function(){ + layers.create(['a', 'b', 'c']); + expect(container.select('g.a-layer').size()).to.be.equal(1); + expect(container.select('g.b-layer').size()).to.be.equal(1); + expect(container.select('g.c-layer').size()).to.be.equal(1); + }); + + it('should create nested layers given a plain Object with a String inside', function(){ + layers.create({d: 'e'}); + expect(container.select('g.d-layer').size()).to.be.equal(1); + expect(container.select('g.d-layer g.e-layer').size()).to.be.equal(1); + }); + + it('should create nested layers given a plain Object with an Array inside', function(){ + layers.create({f: ['g', 'h']}); + expect(container.select('g.f-layer').size()).to.be.equal(1); + expect(container.select('g.f-layer g.g-layer').size()).to.be.equal(1); + expect(container.select('g.f-layer g.h-layer').size()).to.be.equal(1); + }); + + it('should create multiple nested layers given an array of objects', function(){ + layers.create([{'i': ['x']}, {'j': 'x'}, {'k': ['x','y']}]); + expect(container.select('g.i-layer').size()).to.be.equal(1); + expect(container.select('g.j-layer').size()).to.be.equal(1); + expect(container.select('g.k-layer').size()).to.be.equal(1); + expect(container.select('g.i-layer g.x-layer').size()).to.be.equal(1); + expect(container.select('g.i-layer g.x-layer').size()).to.be.equal(1); + expect(container.select('g.k-layer g.x-layer').size()).to.be.equal(1); + expect(container.select('g.k-layer g.y-layer').size()).to.be.equal(1); + }); + + it('should create multi-level nested layers given a nested plain Object', function(){ + layers.create({ + l: [ + 'm', + {'n': [ + {'o': ['p']}, 'q' + ]} + ] + }); + expect(container.select('g.l-layer').size()).to.be.equal(1); + expect(container.select('g.l-layer g.m-layer').size()).to.be.equal(1); + expect(container.select('g.l-layer g.n-layer').size()).to.be.equal(1); + expect(container.select('g.l-layer g.n-layer g.o-layer').size()).to.be.equal(1); + expect(container.select('g.l-layer g.n-layer g.o-layer g.p-layer').size()).to.be.equal(1); + expect(container.select('g.l-layer g.n-layer g.q-layer').size()).to.be.equal(1); + }); + + }); + + describe('#has(name)', function(){ + it('should be able to check first-level layer', function(){ + expect(layers.has('single')).to.be.true; + expect(layers.has('test')).to.be.false; + }); + it('should be able to check second-level layer', function(){ + expect(layers.has('l.m')).to.be.true; + expect(layers.has('l.x')).to.be.false; + }); + it('should be able to check third-level layer', function(){ + expect(layers.has('l.n.q')).to.be.true; + expect(layers.has('l.n.x')).to.be.false; + }); + }); + + describe('#get(name)', function(){ + it('should be able to get first-level layer', function(){ + expect(layers.get('single')).to.exist; + expect(layers.get('test')).to.be.not.exist; + }); + it('should be able to get second-level layer', function(){ + expect(layers.get('l.m')).to.exist; + expect(layers.get('l.x')).to.not.exist; + }); + it('should be able to get third-level layer', function(){ + expect(layers.get('l.n.o')).to.exist; + expect(layers.get('l.n.x')).to.not.exist; + }); + }); + }); + + describe('new LayerOrganizer(container, tag) will create layers with the given tag instead of ', function(){ + var container: d3.Selection, layers: d3kit.LayerOrganizer; + before(function(done){ + container = d3.select('body').append('div'); + layers = new d3kit.LayerOrganizer(container, 'div'); + done(); + }); + + describe('#create(names)', function(){ + it('should create single layer given a String', function(){ + layers.create('single'); + expect(container.select('div.single-layer').size()).to.be.equal(1); + }); + + it('should create multiple layers given an array', function(){ + layers.create(['a', 'b', 'c']); + expect(container.select('div.a-layer').size()).to.be.equal(1); + expect(container.select('div.b-layer').size()).to.be.equal(1); + expect(container.select('div.c-layer').size()).to.be.equal(1); + }); + + it('should create nested layers given a plain Object with a String inside', function(){ + layers.create({d: 'e'}); + expect(container.select('div.d-layer').size()).to.be.equal(1); + expect(container.select('div.d-layer div.e-layer').size()).to.be.equal(1); + }); + + it('should create nested layers given a plain Object with an Array inside', function(){ + layers.create({f: ['g', 'h']}); + expect(container.select('div.f-layer').size()).to.be.equal(1); + expect(container.select('div.f-layer div.g-layer').size()).to.be.equal(1); + expect(container.select('div.f-layer div.h-layer').size()).to.be.equal(1); + }); + + it('should create multiple nested layers given an array of objects', function(){ + layers.create([{'i': ['x']}, {'j': 'x'}, {'k': ['x','y']}]); + expect(container.select('div.i-layer').size()).to.be.equal(1); + expect(container.select('div.j-layer').size()).to.be.equal(1); + expect(container.select('div.k-layer').size()).to.be.equal(1); + expect(container.select('div.i-layer div.x-layer').size()).to.be.equal(1); + expect(container.select('div.i-layer div.x-layer').size()).to.be.equal(1); + expect(container.select('div.k-layer div.x-layer').size()).to.be.equal(1); + expect(container.select('div.k-layer div.y-layer').size()).to.be.equal(1); + }); + + it('should create multi-level nested layers given a nested plain Object', function(){ + layers.create({ + l: [ + 'm', + {'n': [ + {'o': ['p']}, 'q' + ]} + ] + }); + expect(container.select('div.l-layer').size()).to.be.equal(1); + expect(container.select('div.l-layer div.m-layer').size()).to.be.equal(1); + expect(container.select('div.l-layer div.n-layer').size()).to.be.equal(1); + expect(container.select('div.l-layer div.n-layer div.o-layer').size()).to.be.equal(1); + expect(container.select('div.l-layer div.n-layer div.o-layer div.p-layer').size()).to.be.equal(1); + expect(container.select('div.l-layer div.n-layer div.q-layer').size()).to.be.equal(1); + }); + + }); + + describe('#has(name)', function(){ + it('should be able to check first-level layer', function(){ + expect(layers.has('single')).to.be.true; + expect(layers.has('test')).to.be.false; + }); + it('should be able to check second-level layer', function(){ + expect(layers.has('l.m')).to.be.true; + expect(layers.has('l.x')).to.be.false; + }); + it('should be able to check third-level layer', function(){ + expect(layers.has('l.n.q')).to.be.true; + expect(layers.has('l.n.x')).to.be.false; + }); + }); + + describe('#get(name)', function(){ + it('should be able to get first-level layer', function(){ + expect(layers.get('single')).to.exist; + expect(layers.get('test')).to.be.not.exist; + }); + it('should be able to get second-level layer', function(){ + expect(layers.get('l.m')).to.exist; + expect(layers.get('l.x')).to.not.exist; + }); + it('should be able to get third-level layer', function(){ + expect(layers.get('l.n.o')).to.exist; + expect(layers.get('l.n.x')).to.not.exist; + }); + }); + }); + +}); + +describe('Chartlet', function(){ + interface ConfigureFunction { + (parent: d3kit.Chartlet, child: d3kit.Chartlet): void; + } + var enter: d3kit.ChartletEventFunction, update: d3kit.ChartletEventFunction, exit: d3kit.ChartletEventFunction, chartlet: d3kit.Chartlet; + var customEvents: Array = ['fooEvent']; + var ChildChartlet: () => d3kit.Chartlet; + var ParentChartlet: (configureFunction: ConfigureFunction) => d3kit.Chartlet; + + var callback = function(selection?: d3.Selection, done?: any) { return (sel: d3.Selection) => {done();};}; + beforeEach(function(done){ + ChildChartlet = function() { + var chartlet = new d3kit.Chartlet(callback, callback, callback); + (chartlet).runTest = function (testFunction: any) { + testFunction(chartlet); + }; + return chartlet; + }; + + ParentChartlet = function(configureFunction: ConfigureFunction) { + var chartlet = new d3kit.Chartlet(callback, callback, callback); + var child = ChildChartlet(); + configureFunction(chartlet, child); + (chartlet).runTest = (child).runTest; + return chartlet; + }; + + enter = callback; + update = callback; + exit = callback; + chartlet = new d3kit.Chartlet(enter, update, exit, customEvents); + done(); + }); + + describe('new Chartlet(enter, update, exit, customEvents)', function(){ + it('should create a chartlet', function(){ + expect(chartlet).to.be.an('Object'); + expect(chartlet).to.include.keys(['property', 'on']); + expect(chartlet.enter).to.be.a('Function'); + expect(chartlet.update).to.be.a('Function'); + expect(chartlet.exit).to.be.a('Function'); + expect(function(){ chartlet.enter(); }).to.not.throw(Error); + expect(function(){ chartlet.update(); }).to.not.throw(Error); + expect(function(){ chartlet.exit(); }).to.not.throw(Error); + expect(chartlet.getCustomEventNames()).to.deep.equal(customEvents); + }); + it('arguments "update", "exit" and "customEvents" are optional', function(){ + var comp = new d3kit.Chartlet(enter); + expect(comp).to.be.an('Object'); + expect(comp).to.include.keys(['property', 'on']); + expect(comp.enter).to.be.a('Function'); + expect(comp.update).to.be.a('Function'); + expect(comp.exit).to.be.a('Function'); + expect(function(){ comp.enter(); }).to.not.throw(Error); + expect(function(){ comp.update(); }).to.not.throw(Error); + expect(function(){ comp.exit(); }).to.not.throw(Error); + }); + }); + + describe('#getDispatcher()', function(){ + it('should return a dispatcher', function(){ + var dispatcher = chartlet.getDispatcher(); + expect(dispatcher).to.exist; + }); + it('returned dispatcher should handle enter/update/exit events', function(){ + var dispatcher = chartlet.getDispatcher(); + expect(dispatcher).to.include.keys(['enterDone', 'updateDone', 'exitDone'].concat(customEvents)); + }); + }); + + describe('#getPropertyValue(name, d, i)', function(){ + it('should return computed value for specified property name, d and i', function(){ + var d = {a: 99}; + var i = 2; + + chartlet.property('foo', 1); + chartlet.property('bar', 'two'); + chartlet.property('baz', function(d:{a:number}, i: number) {return 3;}); + chartlet.property('qux', function(d:{a:number}, i: number) {return 'four';}); + chartlet.property('nux', function(d:{a:number}, i: number) {return d.a * i;}); + + expect(chartlet.getPropertyValue('foo', d, i)).to.equal(1); + expect(chartlet.getPropertyValue('bar', d, i)).to.equal('two'); + expect(chartlet.getPropertyValue('baz', d, i)).to.equal(3); + expect(chartlet.getPropertyValue('qux', d, i)).to.equal('four'); + expect(chartlet.getPropertyValue('nux', d, i)).to.equal(198); + }); + }); + + describe('#property(name, valueOrFn)', function(){ + describe('should act as a getter when called with one argument', function(){ + it('should always return a function', function(){ + chartlet.property('foo', 1); + expect(chartlet.property('foo')).to.be.a('Function'); + chartlet.property('bar', function(){ return 100; }); + expect(chartlet.property('bar')).to.be.a('Function'); + }); + it('should return a function that return undefined for unknown property name', function(){ + expect(chartlet.property('unknown name')).to.be.a('Function'); + expect(chartlet.property('unknown name')()).to.equal(undefined); + }); + }); + + describe('should act as a setter when called with two arguments', function(){ + it('should set specified property to a functor of given value', function(){ + chartlet.property('foo', 1); + expect(chartlet.property('foo')).to.be.a('Function'); + expect(chartlet.property('foo')()).to.equal(1); + chartlet.property('bar', function(){ return 100; }); + expect(chartlet.property('bar')).to.be.a('Function'); + expect(chartlet.property('bar')()).to.equal(100); + }); + it('should overwrite previous value when set property with the same name', function(){ + chartlet.property('foo', 1); + expect(chartlet.property('foo')()).to.equal(1); + chartlet.property('foo', 100); + expect(chartlet.property('foo')()).to.equal(100); + }); + }); + }); + + describe('#on(eventName, listener)', function(){ + it('event "enterDone" should be triggered after chartlet.enter() is completed.', function(done){ + chartlet.on('enterDone', function(){ return (sel: d3.Selection) => {done();} }); + chartlet.enter(); + }); + it('event "updateDone" should be triggered after chartlet.update() is completed.', function(done){ + chartlet.on('updateDone', function(){ return (sel: d3.Selection) => {done();} }); + chartlet.update(); + }); + it('event "exitDone" should be triggered after chartlet.exit() is completed.', function(done){ + chartlet.on('exitDone', function(){ return (sel: d3.Selection) => {done();} }); + chartlet.exit(); + }); + }); + + describe('#inheritPropertyFrom(parentChartlet, parentPropertyName, childPropertyName)', function(){ + it('it should cause a child to inherit a parent property', function() { + var parent = ParentChartlet(function(parent: d3kit.Chartlet, child: d3kit.Chartlet) { + child.inheritPropertyFrom(parent, 'foo', 'bar'); + }) + .property('foo', function(d:number) {return 2 * d;}); + + (parent).runTest(function(child: d3kit.Chartlet) { + expect(child.getPropertyValue('bar', 4, 0)).to.be.equal(8); + }); + }); + + it('it should default to the parent property name', function() { + var parent = ParentChartlet( + function(parent: d3kit.Chartlet, child: d3kit.Chartlet) { + child.inheritPropertyFrom(parent, 'foo'); + }) + .property('foo', function(d:number) {return 2 * d;}); + + (parent).runTest(function(child: d3kit.Chartlet) { + expect(child.getPropertyValue('foo', 4, 0)).to.be.equal(8); + }); + }); + }); + + describe('#inheritProperties(parentChartlet, parentPropertyNames, childPropertyNames)', function(){ + it('it should cause a child to inherit many parent properties', function() { + var parent = ParentChartlet( + function(parent: d3kit.Chartlet, child: d3kit.Chartlet) { + child.inheritPropertiesFrom(parent, ['foo', 'bar', 'baz'], ['foo-x', 'bar-x', 'baz-x']); + }) + .property('foo', function(d:number) {return 2 * d;}) + .property('bar', function(d:number) {return 3 * d;}) + .property('baz', function(d:number) {return 4 * d;}); + + (parent).runTest(function(child: d3kit.Chartlet) { + expect(child.getPropertyValue('foo-x', 1, 0)).to.be.equal(2); + expect(child.getPropertyValue('bar-x', 1, 0)).to.be.equal(3); + expect(child.getPropertyValue('baz-x', 1, 0)).to.be.equal(4); + }); + }); + + it('it should default to the parent property names', function() { + var parent = ParentChartlet( + function(parent: d3kit.Chartlet, child: d3kit.Chartlet) { + child.inheritPropertiesFrom(parent, ['foo', 'bar', 'baz']); + }) + .property('foo', function(d:number) {return 2 * d;}) + .property('bar', function(d:number) {return 3 * d;}) + .property('baz', function(d:number) {return 4 * d;}); + + (parent).runTest(function(child: d3kit.Chartlet) { + expect(child.getPropertyValue('foo', 1, 0)).to.be.equal(2); + expect(child.getPropertyValue('bar', 1, 0)).to.be.equal(3); + expect(child.getPropertyValue('baz', 1, 0)).to.be.equal(4); + }); + }); + }); + + describe('#publishEventsTo(foreignDispatcher)', function(){ + it('should map events to a foreignDispatcher', function(done) { + + var parent = new d3kit.Chartlet(callback, callback, callback, ['foo']); + parent.getDispatcher().on('foo', function(value:number) { + expect(value).to.be.equal(99); + done(); + }); + + var child = new d3kit.Chartlet(callback, callback, callback, ['foo']) + .publishEventsTo(parent.getDispatcher()); + + (child.getDispatcher()).foo(99); + }); + }); +}); + +describe('#createChart', function(){ + var Chart = d3kit.factory.createChart({}, ['test'], function(skeleton: d3kit.Skeleton){ + return skeleton; + }); + + it('should return a function to create a chart', function(){ + expect(Chart).to.be.a('Function'); + }); + + // // Don't think it's possible to define these in a d.ts file; skipping + // it('results should have function getCustomEvents()', function(){ + // expect(Chart.getCustomEvents).to.exist; + // expect(Chart.getCustomEvents()).to.deep.equal(['test']); + // }); +}); + +describe('d3kit.helper', function(){ + + describe('#dasherize(str)', function(){ + it('should convert input to dash-case', function(){ + expect(d3kit.helper.dasherize('camelCase')).to.equal('camel-case'); + }); + }); + + describe('#deepExtend(target, src1, src2, ...)', function(){ + it('should copy fields from sources into target', function(){ + expect(d3kit.helper.deepExtend({}, { + a: 1, + b: 2 + },{ + b: 3, + c: 4 + })).to.deep.equal({ + a: 1, + b: 3, + c: 4 + }); + + expect(d3kit.helper.deepExtend({}, { + a: 1, + b: 2 + },{ + b: 3, + c: 4 + }, null)).to.deep.equal({ + a: 1, + b: 3, + c: 4 + }); + }); + + it('should copy arrays and functions correctly from sources into target', function(){ + var fn1 = function(d:number){return d + 1;}; + var fn2 = function(d:number){return d + 2;}; + expect(d3kit.helper.deepExtend({}, { + a: fn1, + b: [1,2] + },{ + b: [3,4], + c: fn2 + })).to.deep.equal({ + a: fn1, + b: [3,4], + c: fn2 + }); + }); + + it('should perform "deep" copy', function(){ + var fn1 = function(d:number){return d + 1;}; + var fn2 = function(d:number){return d + 2;}; + expect(d3kit.helper.deepExtend({}, { + a: { d: fn1 }, + b: [1,2], + c: { f: 3 }, + h: { i: [1,2,3], j: [3,4,5] } + },{ + a: { e: 2 }, + b: [3,4], + c: { f: 4, g: fn2 }, + h: { i: [2,3,4], k: [3,4,5], l: {m: 2} } + })).to.deep.equal({ + a: { d: fn1, e: 2 }, + b: [3,4], + c: { f: 4, g: fn2 }, + h: { i: [2,3,4], j: [3,4,5], k: [3,4,5], l: {m: 2} } + }); + }); + }); + + describe('#extend(target, src1, src2, ...)', function(){ + it('should copy fields from sources into target', function(){ + expect(d3kit.helper.extend({}, { + a: 1, + b: 2 + },{ + b: 3, + c: 4 + })).to.deep.equal({ + a: 1, + b: 3, + c: 4 + }); + + expect(d3kit.helper.extend({}, { + a: 1, + b: 2 + },{ + b: 3, + c: 4 + }, null)).to.deep.equal({ + a: 1, + b: 3, + c: 4 + }); + }); + + it('should copy arrays and functions correctly from sources into target', function(){ + var fn1 = function(d:number){return d + 1;}; + var fn2 = function(d:number){return d + 2;}; + expect(d3kit.helper.extend({}, { + a: fn1, + b: [1,2] + },{ + b: [3,4], + c: fn2 + })).to.deep.equal({ + a: fn1, + b: [3,4], + c: fn2 + }); + }); + + it('should NOT perform "deep" copy', function(){ + var fn1 = function(d:number){return d + 1;}; + var fn2 = function(d:number){return d + 2;}; + expect(d3kit.helper.extend({}, { + a: { d: fn1 }, + b: [1,2], + c: { f: 3 }, + h: { i: [1,2,3], j: [3,4,5] } + },{ + a: { e: 2 }, + b: [3,4], + c: { f: 4, g: fn2 }, + h: { i: [2,3,4], k: [3,4,5], l: {m: 2} } + })).to.deep.equal({ + a: { e: 2 }, + b: [3,4], + c: { f: 4, g: fn2 }, + h: { i: [2,3,4], k: [3,4,5], l: {m: 2} } + }); + }); + }); + + describe('#isFunction(function)', function(){ + it('should return true if the value is a function', function(){ + var fn1 = function(d:number){return d + 1;}; + function fn2(d:number){return d + 2;} + + expect(d3kit.helper.isFunction(fn1)).to.be.true; + expect(d3kit.helper.isFunction(fn2)).to.be.true; + }); + it('should return false if the value is not a function', function(){ + expect(d3kit.helper.isFunction(0)).to.be.false; + expect(d3kit.helper.isFunction(1)).to.be.false; + expect(d3kit.helper.isFunction(true)).to.be.false; + expect(d3kit.helper.isFunction('what')).to.be.false; + expect(d3kit.helper.isFunction(null)).to.be.false; + expect(d3kit.helper.isFunction(undefined)).to.be.false; + }); + }); + + describe('#isNumber(value)', function(){ + it('should return true for number', function(){ + expect(d3kit.helper.isNumber(1)).to.be.true; + expect(d3kit.helper.isNumber(0)).to.be.true; + expect(d3kit.helper.isNumber(-1)).to.be.true; + }); + it('should return false for string even if it is a number', function(){ + expect(d3kit.helper.isNumber('')).to.be.false; + expect(d3kit.helper.isNumber('1')).to.be.false; + expect(d3kit.helper.isNumber('0')).to.be.false; + expect(d3kit.helper.isNumber('what')).to.be.false; + }); + it('should return false for null and undefined', function(){ + expect(d3kit.helper.isNumber(null)).to.be.false; + expect(d3kit.helper.isNumber(undefined)).to.be.false; + }); + }); +}); + diff --git a/d3kit/d3kit.d.ts b/d3kit/d3kit.d.ts new file mode 100644 index 0000000000..4e53472b7b --- /dev/null +++ b/d3kit/d3kit.d.ts @@ -0,0 +1,155 @@ +// Type definitions for d3Kit v1.1.0 +// Project: https://www.npmjs.com/package/d3kit +// Definitions by: Morgan Benton +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare namespace d3kit { + + export interface ChartMargin { + top?: number; + right?: number; + bottom?: number; + left?: number; + } + + export interface ChartOptions { + margin?: ChartMargin; + offset?: [number,number]; + initialWidth?: number; + initialHeight?: number; + [name: string]: any; + } + + export interface ChartMixin { + [name: string]: any; + } + + export class Skeleton { + + constructor(selector: string|Element, options?: ChartOptions, customEvents?: Array); + + // Getters + getCustomEventNames(): Array; + getDispatcher(): any; // should be d3.Dispatch but this throws error for user-created events + getInnerWidth(): number; + getInnerHeight(): number; + getLayerOrganizer(): LayerOrganizer; + getRootG(): d3.Selection; + getSvg(): d3.Selection; + + // Getter/Setters + data(): any; + data(data?: any, doNotDispatch?: boolean): Skeleton; + options(): any; // wish this could be ChartOptions + options(options: ChartOptions, doNotDispatch?: boolean): Skeleton; + margin(): ChartMargin; + margin(margin: ChartMargin, doNotDispatch?: boolean): Skeleton; + offset(): [number, number]; + offset(offset: Array, doNotDispatch?: boolean): Skeleton; + width(): number; + width(value: number|string, doNotDispatch?: boolean): Skeleton; + height(): number; + height(value: number|string, doNotDispatch?: boolean): Skeleton; + dimension(): [number, number]; + dimension(dimension: [number|string, number|string], doNotDispatch?: boolean): Skeleton; + autoResize(mode?: string|boolean): string|boolean|void; + autoResizeDetection(method?:string): string|void; + autoResizeToAspectRatio(ratio?: number|boolean): number|boolean|void; + + // Other functions + on(eventName: string, listener: (...args: Array) => void): void; + hasData(): boolean; + hasNonZeroArea(): boolean; + mixin(fn: ChartMixin): void; + resizeToFitContainer(mode: string|boolean, doNotDispatch?: boolean): void; + resizeToAspectRatio(ratio: number, doNotDispatch?: boolean): void; + } + + interface ChartletPropertyCallback { + (datum?: any, datum_index?: number): any; + } + + export interface ChartletEventFunction { + (sel?: d3.Selection, done?: string): (sel: d3.Selection) => void; + } + + export class Chartlet { + + constructor( + enterFunction?: ChartletEventFunction, + updateFunction?: ChartletEventFunction, + exitFunction?: ChartletEventFunction, + customEventName?: Array); + + // Getter functions + getDispatcher(): d3.Dispatch; + getCustomEventNames(): Array; + getPropertyValue(name: string, datum: any, datum_index: number): any; + + // Getter/Setter functions + property(name: string): ChartletPropertyCallback; + property(name: string, value: any): Chartlet; + + // Enter/Update/Exit functions + enter( sel?: d3.Selection, done?: string): (sel: d3.Selection) => void; + update(sel?: d3.Selection, done?: string): (sel: d3.Selection) => void; + exit( sel?: d3.Selection, done?: string): (sel: d3.Selection) => void; + + // Inheritance functions + inheritPropertyFrom(parent_chartlet: Chartlet, parent_property_name: string, child_property_name?: string): void; + inheritPropertiesFrom(parent_chartlet: Chartlet, parent_property_names: Array, child_property_names?: Array): void; + publishEventsTo(dispatcher: d3.Dispatch): Chartlet; + + // Events + on(eventName: string, handlerFunction: ChartletEventFunction): void; + } + + interface LayerConfig { + name?: string, + names?: Array, + sublayers?: LayerConfig + } + + export class LayerOrganizer { + + constructor(container: d3.Selection, tag?: string); + + create(config: string|Array|LayerConfig|Array): d3.Selection|Array>; + get(name: string): d3.Selection; + has(name: string): boolean; + } + + export namespace factory { + export function createChart( + defaultOptions: ChartOptions, + customEvents: Array, + constructor: (skeleton: Skeleton) => void + ): (selector: string|Element, options?: ChartOptions, customEvents?: Array) => Skeleton; + } + + export namespace helper { + export function debounce(fn: (...args: Array) => void, wait: number, immediate: boolean): (...args: Array) => void; + export function extend(target: Object, ...args: Object[]): Object; + export function deepExtend(target: Object, ...args: Object[]): Object; + export function bindMouseEventsToDispatcher(selection: d3.Selection, dispatch: d3.Dispatch, prefix: string): void; + export function removeAllChildren(selection: d3.Selection, noTransition: boolean): d3.Selection; + export function on(element: Element, type: string, listener: (...args: Array) => void): void; + export function off(element: Element, type: string, listener: (...args: Array) => void): void; + export function trim(str: string, characters: string): string; + export function dasherize(str: string): string; + export function $(s: Element|string): Element; + export function $$(s: Array|NodeList): Array; + export function isArray(value: any): boolean; + export function isNumber(value: any): boolean; + export function isObject(value: any): boolean; + export function isElement(o: any): boolean; + export function isFunction(functionToCheck: any): boolean; + } + +} + +declare module 'd3kit' { + export = d3kit; +} \ No newline at end of file diff --git a/d3pie/d3pie-tests.ts b/d3pie/d3pie-tests.ts new file mode 100644 index 0000000000..4d8a38280f --- /dev/null +++ b/d3pie/d3pie-tests.ts @@ -0,0 +1,146 @@ +/// + +let chart = new d3pie('test', + { + header: { + title: { + text: '', + color: '#333333', + fontSize: 18, + font: 'arial' + }, + subtitle: { + color: '#666666', + fontSize: 14, + font: 'arial' + }, + location: 'top-center', + titleSubtitlePadding: 8 + }, + footer: { + text: '', + color: '#666666', + fontSize: 14, + font: 'arial', + location: 'left' + }, + size: { + canvasHeight: 500, + canvasWidth: 500, + pieInnerRadius: 0, + pieOuterRadius: null + }, + data: { + sortOrder: 'none', + smallSegmentGrouping: { + enabled: false, + value: 1, + valueType: 'percentage', + label: 'Other', + color: '#cccccc' + }, + content: [] + }, + labels: { + outer: { + format: 'label', + hideWhenLessThanPercentage: null, + pieDistance: 30 + }, + inner: { + format: 'percentage', + hideWhenLessThanPercentage: null + }, + mainLabel: { + color: '#333333', + font: 'arial', + fontSize: 10 + }, + percentage: { + color: '#dddddd', + font: 'arial', + fontSize: 10, + decimalPlaces: 0 + }, + value: { + color: '#cccc44', + font: 'arial', + fontSize: 10 + }, + lines: { + enabled: true, + style: 'curved', + color: 'segment' // 'segment' or a hex color + } + }, + effects: { + load: { + effect: 'default', // none / default + speed: 1000 + }, + pullOutSegmentOnClick: { + effect: 'bounce', // none / linear / bounce / elastic / back + speed: 300, + size: 10 + }, + highlightSegmentOnMouseover: true, + highlightLuminosity: -0.2 + }, + tooltips: { + enabled: false, + type: 'placeholder', // caption|placeholder + string: '', + placeholderParser: null, + styles: { + fadeInSpeed: 250, + backgroundColor: '#000000', + backgroundOpacity: 0.5, + color: '#efefef', + borderRadius: 2, + font: 'arial', + fontSize: 10, + padding: 4 + } + }, + + misc: { + colors: { + background: null, // transparent + segments: [ + '#2484c1', '#65a620', '#7b6888', '#a05d56', '#961a1a', + '#d8d23a', '#e98125', '#d0743c', '#635222', '#6ada6a', + '#0c6197', '#7d9058', '#207f33', '#44b9b0', '#bca44a', + '#e4a14b', '#a3acb2', '#8cc3e9', '#69a6f9', '#5b388f', + '#546e91', '#8bde95', '#d2ab58', '#273c71', '#98bf6e', + '#4daa4b', '#98abc5', '#cc1010', '#31383b', '#006391', + '#c2643f', '#b0a474', '#a5a39c', '#a9c2bc', '#22af8c', + '#7fcecf', '#987ac6', '#3d3b87', '#b77b1c', '#c9c2b6', + '#807ece', '#8db27c', '#be66a2', '#9ed3c6', '#00644b', + '#005064', '#77979f', '#77e079', '#9c73ab', '#1f79a7' + ], + segmentStroke: '#ffffff' + }, + gradient: { + enabled: false, + percentage: 95, + color: '#000000' + }, + canvasPadding: { + top: 5, + right: 5, + bottom: 5, + left: 5 + }, + pieCenterOffset: { + x: 0, + y: 0 + }, + cssPrefix: null + }, + callbacks: { + onload: null, + onMouseoverSegment: null, + onMouseoutSegment: null, + onClickSegment: null + } + }) \ No newline at end of file diff --git a/d3pie/d3pie.d.ts b/d3pie/d3pie.d.ts new file mode 100644 index 0000000000..2bfe5d6525 --- /dev/null +++ b/d3pie/d3pie.d.ts @@ -0,0 +1,146 @@ +// Type definitions for d3pie 0.1.9 +// Project: https://github.com/benkeen/d3pie +// Definitions by: Petryshyn Sergii +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace d3pie { + interface ID3PieChart { + redraw(): void + openSegment(index: number): void + closeSegment(index: void): void + getOpenSegment(): any + updateProp(propKey: string, value: any): void + destroy(): void + } + + interface ID3PieStyleOptions { + color?: string + fontSize?: number + font?: string + } + + interface ID3PieTextOptions extends ID3PieStyleOptions { + text?: string + } + + interface ID3PieLabelsOptions { + format?: 'label' | 'value' | 'percentage' | 'label-value1' | 'label-value2' | 'label-percentage1' | 'label-percentage2' + hideWhenLessThanPercentage?: number + } + + interface ID3PieOptions { + header?: { + title?: ID3PieTextOptions + subtitle?: ID3PieTextOptions + location?: 'top-center' | 'top-left' | 'pie-center' + titleSubtitlePadding?: number + } + footer?: { location?: 'left' } & ID3PieTextOptions + size?: { + canvasHeight?: number + canvasWidth?: number + pieOuterRadius?: string | number + pieInnerRadius?: string | number + } + data: { + sortOrder?: 'none' | 'random' | 'value-asc' | 'value-desc' | 'label-asc' | 'label-desc' + smallSegmentGrouping?: { + enabled?: boolean + value?: number + valueType?: 'percentage' | 'value' + label?: string + color?: string + } + content: { + label: string + value: number + color?: string + }[] + } + labels?: { + outer?: { pieDistance?: number } & ID3PieLabelsOptions + inner?: ID3PieLabelsOptions + mainLabel?: ID3PieStyleOptions + percentage?: { decimalPlaces?: number } & ID3PieStyleOptions + value?: ID3PieStyleOptions + lines?: { + enabled?: boolean + style?: 'curved' | 'straight' + color?: string + } + truncation?: { + enabled?: boolean + truncateLength?: number + } + formatter?: (context: { + section: 'outer' | 'inner' + value: number + label: string + }) => string + } + effects?: { + load?: { + effect?: 'none' | 'default' + speed?: number + } + pullOutSegmentOnClick?: { + effect?: 'none' | 'linear' | 'bounce' | 'elastic' | 'back' + speed?: number + size?: number + } + highlightSegmentOnMouseover?: boolean + highlightLuminosity?: number + } + tooltips?: { + enabled?: boolean + type?: 'placeholder' | 'caption' + string?: string + placeholderParser?: (index: number, data: { label?: string, percentage?: number, value?: number }) => void + styles?: { + fadeInSpeed?: number + backgroundColor?: string + backgroundOpacity?: number + color?: string + borderRadius?: number + font?: string + fontSize?: number + padding?: number + } + } + misc?: { + colors?: { + background?: string + segments?: string[] + segmentStroke?: string + } + gradient?: { + enabled?: boolean + percentage?: number + color?: string + } + canvasPadding?: { + top?: number + right?: number + bottom?: number + left?: number + } + pieCenterOffset?: { + x?: number + y?: number + } + cssPrefix?: string + } + callbacks?: { + onload?: Function + onMouseoverSegment?: Function + onMouseoutSegment?: Function + onClickSegment?: Function + } + } + + interface ID3PieClass { + new (id: string | HTMLElement, options: ID3PieOptions): ID3PieChart + } +} + +declare const d3pie: d3pie.ID3PieClass \ No newline at end of file diff --git a/dagre-d3/dagre-d3-tests.ts b/dagre-d3/dagre-d3-tests.ts index f73389015f..d5e712a66c 100644 --- a/dagre-d3/dagre-d3-tests.ts +++ b/dagre-d3/dagre-d3-tests.ts @@ -1,19 +1,22 @@ /// namespace DagreD3Tests { - var gDagre = new dagreD3.graphlib.Graph(); - var graph = gDagre.graph(); + const gDagre = new dagreD3.graphlib.Graph(); + const graph = gDagre.graph(); // has graph methods from dagre.d.ts graph.setNode("a", {}); - var num: number = 251 + graph.height + graph.width; - var predecessors: { [vertex:string]: string[] } = {}; - var successors: { [vertex:string]: string[] } = {}; + const num: number = 251 + graph.height + graph.width; + const predecessors: { [vertex: string]: string[] } = {}; + const successors: { [vertex: string]: string[] } = {}; predecessors["a"] = graph.predecessors("a"); successors["a"] = graph.successors("a"); + graph.transition = (selection: d3.Selection) => { + return d3.transition(); + }; - var render = new dagreD3.render(); - var svg = d3.select("svg"); + const render = new dagreD3.render(); + const svg = d3.select("svg"); + render.arrows()["arrowType"] = (parent: d3.Selection, id: string, edge: Dagre.Edge, type: string) => {}; render(svg, graph); } - diff --git a/dagre-d3/dagre-d3.d.ts b/dagre-d3/dagre-d3.d.ts index c8484995e3..9248222e98 100644 --- a/dagre-d3/dagre-d3.d.ts +++ b/dagre-d3/dagre-d3.d.ts @@ -19,13 +19,21 @@ declare namespace Dagre { height: number; predecessors(id: string): string[]; successors(id: string): string[]; + // see source of http://cpettitt.github.io/project/dagre-d3/latest/demo/interactive-demo.html + transition?(selection: d3.Selection): d3.Transition; width: number; } interface Render { + // see http://cpettitt.github.io/project/dagre-d3/latest/demo/user-defined.html for example usage + arrows (): { [arrowStyleName: string]: (parent: d3.Selection, id: string, edge: Dagre.Edge, type: string) => void }; new (): Render; (selection: d3.Selection, g: Dagre.Graph): void; } } declare var dagreD3: Dagre.DagreD3Factory; + +declare module "dagre-d3" { + export = dagreD3; +} diff --git a/dagre/dagre-tests.ts b/dagre/dagre-tests.ts index a4eaad32f3..0a33a7750d 100644 --- a/dagre/dagre-tests.ts +++ b/dagre/dagre-tests.ts @@ -1,10 +1,11 @@ /// namespace DagreTests { - var gDagre = new dagre.graphlib.Graph(); + const gDagre = new dagre.graphlib.Graph(); gDagre.setGraph({}) .setDefaultEdgeLabel(function(){ return ; }) .setNode("a", {}) - .setEdge("b", "c"); + .setEdge("b", "c") + .setEdge("c", "d", {class: "class"}); dagre.layout(gDagre); } diff --git a/dagre/dagre.d.ts b/dagre/dagre.d.ts index 2b99bf4d5a..7caa1b5590 100644 --- a/dagre/dagre.d.ts +++ b/dagre/dagre.d.ts @@ -3,7 +3,7 @@ // Definitions by: Qinfeng Chen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare namespace Dagre{ +declare namespace Dagre { interface DagreFactory { graphlib: GraphLib; layout(graph: Graph): void; @@ -16,7 +16,7 @@ declare namespace Dagre{ nodes(): string[]; node(id: any): any; setDefaultEdgeLabel(callback: () => void): Graph; - setEdge(sourceId: string, targetId: string): Graph; + setEdge(sourceId: string, targetId: string, options?: { [key: string]: any }): Graph; setGraph(options: { [key: string]: any }): Graph; setNode(id: string, node: { [key: string]: any }): Graph; } diff --git a/DataStream.js/DataStream.js-tests.ts b/datastream.js/datastream.js-tests.ts similarity index 98% rename from DataStream.js/DataStream.js-tests.ts rename to datastream.js/datastream.js-tests.ts index 71bb08537e..94fb86f367 100644 --- a/DataStream.js/DataStream.js-tests.ts +++ b/datastream.js/datastream.js-tests.ts @@ -1,4 +1,4 @@ -/// +/// var buf = new ArrayBuffer(100); var ds = new DataStream(buf); diff --git a/DataStream.js/DataStream.js.d.ts b/datastream.js/datastream.js.d.ts similarity index 100% rename from DataStream.js/DataStream.js.d.ts rename to datastream.js/datastream.js.d.ts diff --git a/daterangepicker/daterangepicker-tests.ts b/daterangepicker/daterangepicker-tests.ts new file mode 100644 index 0000000000..ca1f99961c --- /dev/null +++ b/daterangepicker/daterangepicker-tests.ts @@ -0,0 +1,59 @@ +/// + +function tests_simple() { + $('#daterange').daterangepicker(); + $('input[name="daterange"]').daterangepicker({ + timePicker: true, + timePickerIncrement: 30, + locale: { + format: 'MM/DD/YYYY h:mm A' + } + }); + + $('#reportrange').daterangepicker({ + ranges: { + 'Today': [moment(), moment()], + 'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')], + 'Last 7 Days': [moment().subtract(6, 'days'), moment()], + 'Last 30 Days': [moment().subtract(29, 'days'), moment()], + 'This Month': [moment().startOf('month'), moment().endOf('month')], + 'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')] + } + }); + + $('input[name="datefilter"]').on('apply.daterangepicker', function (ev, picker) { + $(this).val(picker.startDate.format('MM/DD/YYYY') + ' - ' + picker.endDate.format('MM/DD/YYYY')); + }); + + + $('input[name="datefilter"]').on('cancel.daterangepicker', function (ev, picker) { + $(this).val(''); + }); + + $('#demo').daterangepicker({ + "startDate": "05/06/2016", + "endDate": "05/12/2016" + }, function (start: string, end: string, label: string) { + console.log("New date range selected: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD') + ' (predefined range: ' + label + ')"); + }); + + $(function() { + + function cb(start: moment.Moment, end: moment.Moment) { + $('#reportrange span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY')); + } + cb(moment().subtract(29, 'days'), moment()); + + $('#reportrange').daterangepicker({ + ranges: { + 'Today': [moment(), moment()], + 'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')], + 'Last 7 Days': [moment().subtract(6, 'days'), moment()], + 'Last 30 Days': [moment().subtract(29, 'days'), moment()], + 'This Month': [moment().startOf('month'), moment().endOf('month')], + 'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')] + } + }, cb); + +}); +} diff --git a/daterangepicker/daterangepicker.d.ts b/daterangepicker/daterangepicker.d.ts new file mode 100644 index 0000000000..f3534a197e --- /dev/null +++ b/daterangepicker/daterangepicker.d.ts @@ -0,0 +1,166 @@ +// Type definitions for Date Range Picker v2.1.19 +// Project: http://www.daterangepicker.com/ +// Definitions by: SirMartin +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// + +interface JQuery { + daterangepicker(settings?: daterangepicker.Settings): JQuery; + daterangepicker(settings?: daterangepicker.Settings, callback?: (start?: string | Date | moment.Moment, end?: string | Date | moment.Moment, label?: string) => any): JQuery; +} + +declare module daterangepicker { + + interface DatepickerEventObject extends JQueryEventObject { + date: Date; + format(format?: string): string; + } + + interface Settings { + /** + * The start of the initially selected date range + */ + startDate?: string | moment.Moment | Date; + /** + * The end of the initially selected date range + */ + endDate?: string | moment.Moment | Date; + /** + * The earliest date a user may select + */ + minDate?: string | moment.Moment | Date; + /** + * The latest date a user may select + */ + maxDate?: string | moment.Moment | Date; + /** + * The maximum span between the selected start and end dates. Can have any property you can add to a moment object (i.e. days, months) + */ + dateLimit?: any; + /** + * Show year and month select boxes above calendars to jump to a specific month and year + */ + showDropdowns?: boolean; + /** + * Show localized week numbers at the start of each week on the calendars + */ + showWeekNumbers?: boolean; + /** + * Show ISO week numbers at the start of each week on the calendars + */ + showISOWeekNumbers?: boolean; + /** + * Allow selection of dates with times, not just dates + */ + timePicker?: boolean; + /** + * Increment of the minutes selection list for times (i.e. 30 to allow only selection of times ending in 0 or 30) + */ + timePickerIncrement?: number; + /** + * Use 24- hour instead of 12- hour times, removing the AM/ PM selection. + */ + timePicker24Hour?: boolean; + /** + * Show seconds in the timePicker. + */ + timePickerSeconds?: boolean; + /** + * Set predefined date ranges the user can select from.Each key is the label for the range, and its value an array with two dates representing the bounds of the range. + */ + ranges?: any; + /** + * (string: 'left'/'right'/'center') Whether the picker appears aligned to the left, to the right, or centered under the HTML element it's attached to + */ + opens?: string; + /** + * (string: 'down' or 'up') Whether the picker appears below (default) or above the HTML element it's attached to + */ + drops?: string; + /** + * CSS class names that will be added to all buttons in the picker + */ + buttonClasses?: string[]; + /** + * CSS class string that will be added to the apply button + */ + applyClass?: string; + /** + * CSS class string that will be added to the cancel button + */ + cancelClass?: string; + /** + * Allows you to provide localized strings for buttons and labels, customize the date display format, and change the first day of week for the calendars. + */ + locale?: Locale; + /** + * Show only a single calendar to choose one date, instead of a range picker with two calendars; the start and end dates provided to your callback will be the same single date chosen. + */ + singleDatePicker?: boolean; + /** + * Hide the apply and cancel buttons, and automatically apply a new date range as soon as two dates or a predefined range is selected. + */ + autoApply?: boolean; + /** + * When enabled, the two calendars displayed will always be for two sequential months (i.e.January and February), and both will be advanced when clicking the left or right arrows above the calendars.When disabled, the two calendars can be individually advanced and display any month/ year. + */ + linkedCalendars?: boolean; + /** + * jQuery selector of the parent element that the date range picker will be added to, if not provided this will be 'body' + */ + parentEl?: string; + /** + * A function that is passed each date in the two calendars before they are displayed, and may return true or false to indicate whether that date should be available for selection or not. + */ + isInvalidDate?(startDate: string | moment.Moment | Date, endDate?: string | moment.Moment | Date): boolean; + /** + * Indicates whether the date range picker should automatically update the value of an < input > element it's attached to at initialization and when the selected dates change. + */ + autoUpdateInput?: boolean; + /** + * Normally, if you use the ranges option to specify pre- defined date ranges, calendars for choosing a custom date range are not shown until the user clicks "Custom Range".When this option is set to true, the calendars for choosing a custom date range are always shown instead. + */ + alwaysShowCalendars?: boolean; + } + + interface Locale { + /** + * Text for cancel label. + */ + cancelLabel?: string; + /** + * Text for apply label. + */ + applyLabel?: string; + /** + * Format of the date string. example: 'YYYY-MM-DD' + */ + format?: string; + /** + * Separator between the startDate and endDate in the attached input element. Example: ' - ' + */ + separator?: string; + /** + * Text for the week label. + */ + weekLabel?: string; + /** + * Text for the custom range label. + */ + customRangeLabel?: string; + /** + * The first day of the week (0-6, Sunday to Saturday). + */ + firstDay?: number; + /** + * Weekday names displayed in the header of calendar. + */ + daysOfWeek?: string[]; + /** + * Month names used in the month select boxes. + */ + monthNames?: string[]; + } +} diff --git a/db.js/db.js-tests.ts b/db.js/db.js-tests.ts new file mode 100644 index 0000000000..e2aacb27f0 --- /dev/null +++ b/db.js/db.js-tests.ts @@ -0,0 +1,259 @@ +// Test file for db.js Definition file +/// + +/* Type for use in tests */ + +interface Person { + firstName: string; + lastName: string; + answer: number; + group?: string; +} + +/* Opening/creating a database and connection */ + +var server: DbJs.Server; + +db.open({ + server: 'my-app', + version: 1, + schema: { + people: { + key: { keyPath: 'id', autoIncrement: true }, + indexes: { + firstName: {}, + answer: { unique: true } + } + } + } +}).then(function (s: DbJs.Server) { + server = s; +}); + +var typedStore: DbJs.TypedObjectStoreServer = server['people']; + +/* Basic server operations */ + +var idb = server.getIndexedDB(); +server.close(); + +/* General server/store methods */ + +// Adding items +server.add('people', { + firstName: 'Aaron', + lastName: 'Powell', + answer: 42 +}).then(function (item) { }); + +typedStore.add({ + firstName: 'Aaron', + lastName: 'Powell', + answer: 42 +}).then(function (item) { }); + +// Updating +server.update('people', { + firstName: 'Aaron', + lastName: 'Powell', + answer: 42 +}).then(function (item) { }); + +typedStore.update({ + firstName: 'Aaron', + lastName: 'Powell', + answer: 42 +}).then(function (item) { }); + +// Removing +server.remove('people', 1).then(function (key) { }); +typedStore.remove(1).then(function (key) { }); + +// Clearing +server.clear('people').then(function() { }); +typedStore.clear().then(function() { }); + +// Fetching + +// Getting a single object by key +server.get('people', 5).then(function (results) { }); +typedStore.get(5).then(function (results) { }); + +// Getting a single object by key range + +// With a MongoDB-style range: + +server.get('people', {gte: 1, lt: 3}) + .then(function (results) { }); +typedStore.get({gte: 1, lt: 3}) + .then(function (results) { }); + +// With an IDBKeyRange : + +server.get('people', IDBKeyRange.bound(1, 3, false, true)) + .then(function (results) { }); +typedStore.get(IDBKeyRange.bound(1, 3, false, true)) + .then(function (results) { }); + +// Querying + +// Querying all objects +server.query('people') + .all() + .execute() + .then(function (results) { }); + +typedStore.query() + .all() + .execute() + .then(function (results) { }); + +// Querying using indexes +server.query('people', 'specialProperty') + .all() + .execute() + .then(function (results) { }); + + typedStore.query('specialProperty') + .all() + .execute() + .then(function (results) { }); + +// Filter with property and value +server.query('people') + .filter('firstName', 'Aaron') + .execute() + .then(function (results) { }); + +// Filter with function +server.query('people') + .filter(function(person: any) { return person.group === 'hipster'; }) + .execute() + .then(function (results) { }); + +typedStore.query('people') + .filter(function(person) { return person.group === 'hipster'; }) + .execute() + .then(function (results) { }); + +// Querying with ranges +server.query('people', 'firstName') + .only('Aaron') + .then(function (results) { }); + +server.query('people', 'answer') + .bound(30, 50) + .then(function (results) { }); + +server.query('people', 'firstName') + .range({ eq: 'Aaron' }) + .then(function (results) { }); + +server.query('people', 'answer') + .range({ gte: 30, lte: 50 }) + .then(function (results) { }); + +// Querying for distinct values + server.query('people', 'firstName') + .only('Aaron') + .distinct() + .execute() + .then(function (data) { }); + +// Limiting cursor range +server.query('people', 'firstName') + .all() + .limit(1, 3) + .execute() + .then(function (data) { }); + +// Cursor direction (desc) +server.query('people') + .all() + .desc() + .execute() + .then(function (results) { }); + +// Keys +server.query('people', 'firstName') + .only('Aaron') + .keys() + .execute() + .then(function (results) { }); + +// Mapping +server.query('people', 'age') + .lowerBound(30) + .map(function (value) { + return { + fullName: value.firstName + ' ' + value.lastName, + raw: value + }; + }) + .execute() + .then(function (data) { }); + +// Counting +server.query('people', 'firstName') + .only('Aaron') + .count() + .execute() + .then(function (results) { }); + +// With no arguments (count all items) +server.count().then(function (ct) { }); + +// With a key +server.count('myKey').then(function (ct) { }); + +// With a MongoDB-style range +server.count({gte: 1, lt: 3}).then(function (ct) { }); + +// With an IDBKeyRange range +server.count(IDBKeyRange.bound(1, 3, false, true)).then(function (ct) { }); + +// Atomic updates +server.query('users', 'last_mod') + .lowerBound(new Date().getTime() - 10000) + .modify({ last_mod: new Date().getTime() }) + .execute() + .then(function(results) { }); + +server.query('users', 'changed') + .only(true) + .modify({ changed: false }) + .execute() + .then(function () { }); + +server.query('users', 'name') + .lowerBound('marcy') + .modify({ views: function(profile: any) { return profile.views + 1; } }) + .execute() + .then(function () { }); + +/* Other server methods */ + +// Closing connection +server.close(); + +// Retrieving the indexedDB.open result object in use +var storeNames = server.getIndexedDB().objectStoreNames; + +// Server event handlers + +server.addEventListener('abort', function (e: Event) { }); +server.addEventListener('error', function (err: Event) { }); +server.addEventListener('versionchange', function (e: Event) { }); + +server + .abort(function (e) { }) + .error(function (err) { }) + .versionchange(function (e) { }); + +// Deleting a database +db.delete('dbName').then(function () { }, function (err: Error) { }); +db.delete('dbName').catch(function (err) { }).then(function (ev) { }); + +// Comparing two keys + +db.cmp('key1', 'key2'); diff --git a/db.js/db.js.d.ts b/db.js/db.js.d.ts new file mode 100644 index 0000000000..83e21fa529 --- /dev/null +++ b/db.js/db.js.d.ts @@ -0,0 +1,154 @@ +// Type definitions for db.js v0.14.0 +// Project: https://github.com/aaronpowell/db.js/ +// Definitions by: Chris Wrench +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module DbJs { + interface ErrorListener { + (err: Error): void; + } + + interface OpenOptions { + server: string; + version: number; + schema?: any; + } + + interface DbJsStatic { + open(options: OpenOptions): Promise; + delete(dbName: string): Promise; + cmp(key1: any, key2: any): number; + } + + // Query API + + interface ExecutableQuery { + execute(): Promise; + } + + interface CountableQuery { + count(): ExecutableQuery; + } + + interface KeysQuery extends DescableQuery, ExecutableQuery, FilterableQuery, DistinctableQuery, MappableQuery { + } + + interface KeyableQuery { + keys(): KeysQuery; + } + + interface FilterQuery extends KeyableQuery, ExecutableQuery, FilterableQuery, DescableQuery, DistinctableQuery, ModifiableQuery, LimitableQuery, MappableQuery { + } + + interface FilterableQuery { + filter(index: string, value: TValue): FilterQuery; + filter(filter: (value: T) => boolean): FilterQuery; + } + + interface DescQuery extends KeyableQuery, CountableQuery, ExecutableQuery, FilterableQuery, DescableQuery, ModifiableQuery, MappableQuery { + } + + interface DescableQuery { + desc(): DescQuery; + } + + interface DistinctQuery extends KeyableQuery, ExecutableQuery, FilterableQuery, DescableQuery, ModifiableQuery, MappableQuery, CountableQuery { + } + + interface DistinctableQuery { + distinct(filter?: (value: T) => boolean): DistinctQuery; + } + + interface ModifiableQuery { + modify(filter: (value: T) => boolean): ExecutableQuery; + modify(modifyObj: any): ExecutableQuery; + } + + interface LimitableQuery { + limit(n: any, m: any): ExecutableQuery; + } + + interface MappableQuery { + map(fn: (value: T) => TMap): Query; + } + + interface Query extends Promise, KeyableQuery, ExecutableQuery, FilterableQuery, DescableQuery, DistinctableQuery, ModifiableQuery, LimitableQuery, MappableQuery, CountableQuery { + } + + interface IndexQuery extends Query { + only(...args: any[]): Query; + bound(lowerBound: any, upperBound: any): Query; + upperBound(upperBound: any): Query; + lowerBound(lowerBound: any): Query; + range(opts: any): Query; + all(): Query; + } + + interface KeyValuePair { + key: TKey; + item: TValue; + } + + interface BaseServer { + getIndexedDB(): IDBDatabase; + close(): void; + } + + interface IndexAccessibleServer { + [store: string]: TypedObjectStoreServer; + } + + interface ObjectStoreServer { + add(table: string, entity: T): Promise; + add(table: string, ...entities: T[]): Promise; + add(table: string, entity: KeyValuePair): Promise>; + add(table: string, ...entities: KeyValuePair[]): Promise[]>; + update(table: string, entity: T): Promise; + update(table: string, ...entities: T[]): Promise; + update(table: string, entity: KeyValuePair): Promise>; + update(table: string, ...entities: KeyValuePair[]): Promise[]>; + remove(table: string, key: TKey): Promise; + remove(table: string, ...keys: TKey[]): Promise; + clear(table: string): Promise; + get(table: string, key: any): Promise; + query(table: string): IndexQuery; + query(table: string, index: string): IndexQuery; + count(): Promise; + count(keyOrRange: any): Promise; + count(table: string, key: any): Promise; + addEventListener(type: 'abort', listener: (ev: Event) => any): void; + addEventListener(type: 'versionchange', listener: (ev: Event) => any): void; + addEventListener(type: 'error', listener: (err: Error) => any): void; + addEventListener(type: string, listener: EventListener | ErrorListener): void; + abort(listener: (ev: Event) => any): ObjectStoreServer; + versionchange(listener: (ev: Event) => any): ObjectStoreServer; + error(listener: (ev: Error) => any): ObjectStoreServer; + } + + interface TypedObjectStoreServer { + add(entity: T): Promise; + add(...entities: T[]): Promise; + add(entity: KeyValuePair): Promise>; + add(...entities: KeyValuePair[]): Promise[]>; + update(entity: T): Promise; + update(...entities: T[]): Promise; + update(entity: KeyValuePair): Promise>; + update(...entities: KeyValuePair[]): Promise[]>; + remove(key: TKey): Promise; + remove(...keys: TKey[]): Promise; + clear(): Promise; + get(key: any): Promise; + query(): IndexQuery; + query(index: string): IndexQuery; + count(key: any): Promise; + } + + type Server = DbJs.IndexAccessibleServer & DbJs.ObjectStoreServer & DbJs.BaseServer; +} + +declare module "db" { + var db: DbJs.DbJsStatic; + export = db; +} + +declare var db: DbJs.DbJsStatic; diff --git a/deoxxa-content-type/content-type-test.ts b/deoxxa-content-type/content-type-test.ts new file mode 100644 index 0000000000..3e419933ef --- /dev/null +++ b/deoxxa-content-type/content-type-test.ts @@ -0,0 +1,47 @@ +/// + +import MediaType = require('content-type'); + +// https://github.com/deoxxa/content-type/blob/master/README.md +function new_test(): void { + var p = new MediaType('text/html;level=1;q=0.5'); + p.q === 0.5; + p.params.level === "1"; + + var q = new MediaType('application/json', { profile: 'http://example.com/schema.json' }); + q.type === "application/json"; + q.params.profile === "http://example.com/schema.json"; + + q.q = 1; + q.toString() === 'application/json;q=1;profile="http://example.com/schema.json"'; +} + +function mediaCmp_test(): void { + MediaType.mediaCmp(MediaType.parseMedia('text/html'), MediaType.parseMedia('text/html')) === 0; + MediaType.mediaCmp(MediaType.parseMedia('*/*'), MediaType.parseMedia('text/html')) === 1; + MediaType.mediaCmp(MediaType.parseMedia('text/html;level=1'), MediaType.parseMedia('text/html')) === -1; + MediaType.mediaCmp(MediaType.parseMedia('application/json;profile="v1.json"'), MediaType.parseMedia('application/json;profile="v2.json"')) === null; +} + +// https://github.com/deoxxa/content-type/blob/master/example.js +function example(): void { + var representations = [ + 'application/json', + 'text/html', + 'application/json;profile="schema.json"', + 'application/json;profile="different.json"', + ]; + + var accept = [ + 'text/html;q=0.50', + '*/*;q=0.01', + 'application/json;profile=different.json', + 'application/json;profile="a,b;c.json?d=1;f=2";q=0.2', + ]; + + console.log('Formats:\n\t' + representations.map(MediaType.parseMedia).join('\n\t')); + + console.log('Accept:\n\t' + accept.map(MediaType.parseMedia).join('\n\t')); + + console.log('Selected:', (MediaType.select(representations.map(MediaType.parseMedia), accept.map(MediaType.parseMedia)) || 'None').toString()); +} diff --git a/deoxxa-content-type/content-type.d.ts b/deoxxa-content-type/content-type.d.ts new file mode 100644 index 0000000000..6e901e7f86 --- /dev/null +++ b/deoxxa-content-type/content-type.d.ts @@ -0,0 +1,32 @@ +// Type definitions for content-type v0.0.1 +// Project: https://github.com/deoxxa/content-type +// Definitions by: Pine Mizune +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace ContentType { + interface MediaType { + type: string; + q?: number; + params: any; + toString(): string; + } + + interface SelectOptions { + sortAvailable?: boolean; + sortAccepted?: boolean; + } + + interface MediaTypeStatic { + new (s: string, p?: any): MediaType; + parseMedia(type: string): MediaType; + splitQuotedString(str: string, delimiter?: string, quote?: string): string[]; + splitContentTypes(str: string): string[]; + select(availableTypes: MediaType[], acceptedTypes: MediaType[], options?: SelectOptions): string; + mediaCmp(a: MediaType, b: MediaType): number; + } +} + +declare module "content-type" { + var x: ContentType.MediaTypeStatic; + export = x; +} diff --git a/devexpress-web/README.md b/devexpress-web/README.md new file mode 100644 index 0000000000..341304e192 --- /dev/null +++ b/devexpress-web/README.md @@ -0,0 +1,15 @@ +DevExpress ASP.NET/MVC TypeScript definitions +============================================= + +You can use these TypeScript definitions for your web projects, which contain +DevExpress ASP.NET or MVC controls. For this, simply add at the top of your +code ``. + +The API enclosed into the DevExpress ASP.NET/MVC TypeScript definition file +fully corresponds to the API described in the DevExpress ASP.NET/MVC +Documentation: +[Reference](https://documentation.devexpress.com/#AspNet/DevExpressWebScripts). + +If you have any issues while using the DevExpress ASP.NET/MVC TypeScript +definitions, please refer to our [Support +Center](https://www.devexpress.com/Support/Center/Question/List/1). diff --git a/devexpress-web/devexpress-web-tests.ts b/devexpress-web/devexpress-web-tests.ts index 38c653921f..d30bf48035 100644 --- a/devexpress-web/devexpress-web-tests.ts +++ b/devexpress-web/devexpress-web-tests.ts @@ -1,75 +1,430 @@ +/// /// -namespace Tests.Globals { - function ASPxTest(): void { - ASPx.RunStartupScripts(); - } +declare var hiddenField: ASPxClientHiddenField; +declare var mainCallbackPanel: ASPxClientCallbackPanel; +declare var loginPopup: ASPxClientPopupControl; +declare var searchButton: ASPxClientButton; +declare var searchComboBox: ASPxClientComboBox; +declare var roomsNumberSpinEdit: ASPxClientSpinEdit; +declare var adultsNumberSpinEdit: ASPxClientSpinEdit; +declare var childrenNumberSpinEdit: ASPxClientSpinEdit; +declare var checkInDateEdit: ASPxClientDateEdit; +declare var checkOutDateEdit: ASPxClientDateEdit; +declare var backSlider: ASPxClientImageSlider; +declare var locationComboBox: ASPxClientComboBox; +declare var nightyRateTrackBar: ASPxClientTrackBar; +declare var customerRatingTrackBar: ASPxClientTrackBar; +declare var ourRatingCheckBoxList: ASPxClientCheckBoxList; +declare var startFilterPopupControl: ASPxClientPopupControl; +declare var imagePopupControl: ASPxClientPopupControl; +declare var emailTextBox: ASPxClientTextBox; +declare var creditCardEmailTextBox: ASPxClientTextBox; +declare var accountEmailTextBox: ASPxClientTextBox; +declare var bookingPageControl: ASPxClientPageControl; +declare var paymentTypePageControl: ASPxClientPageControl; +declare var offerFormPopup: ASPxClientPopupControl; +declare var roomsSpinEdit: ASPxClientSpinEdit; +declare var adultsSpinEdit: ASPxClientSpinEdit; +declare var childrenSpinEdit: ASPxClientSpinEdit; +declare var hotelDetailsCallbackPanel: ASPxClientCallbackPanel; +declare var leftPanel: ASPxClientPanel; +declare var menuButton: ASPxClientButton; +declare var aboutWindow: ASPxClientPopupControl; +declare var offersZone: ASPxClientDockZone; - function ASPxClientControlTest(): void { - ASPxClientControl.AdjustControls(); - let controls: DevExpress.Web.Scripts.ASPxClientControlCollection = ASPxClientControl.GetControlCollection(); - controls.GetByName("myControl"); +module DXDemo { + function showPage(page: string, params: { [key: string]: any }, skipHistory?: boolean): void { + var queryString = getQueryString(params || {}); + hiddenField.Set("page", page); + hiddenField.Set("parameters", queryString); + hideMenu(); + var uri = queryString.length ? (page + "?" + queryString) : page; + try { + if (!skipHistory && window.history && window.history.pushState) + window.history.pushState(uri, "", uri || "Default.aspx"); + } catch (e) { } + mainCallbackPanel.PerformCallback(uri); + }; - let elements: DevExpress.Web.Scripts.ASPxClientControl[] = controls.elements; - for (let element of elements) { - let name: string = element.name; - element.AdjustControl(); - let mainElement = element.GetMainElement(); - if (mainElement) { - mainElement.focus(); - } - - let isVisible: boolean = element.GetVisible(); - let inCallback: boolean = element.InCallback(); - element.SetWidth(600); - element.SetHeight(400); - - let initEventHandler: (s: DevExpress.Web.Scripts.ASPxClientControl, e: DevExpress.Web.Scripts.ASPxClientEventArgs) => void = (s: DevExpress.Web.Scripts.ASPxClientControl, e: DevExpress.Web.Scripts.ASPxClientEventArgs) => { }; - element.Init.AddHandler(initEventHandler); - element.Init.RemoveHandler(initEventHandler); - element.Init.ClearHandlers(); + export function onMainMenuItemClick(s: ASPxClientMenu, e: ASPxClientMenuItemClickEventArgs): void { + switch (e.item.name) { + case "login": + hideMenu(); + setTimeout(function () { loginPopup.ShowAtElementByID("MainCallbackPanel_ContentPane"); }, 300); + break; + case "offers": + showPage("SpecialOffers", {}); + break; + default: + hideMenu(); + setTimeout(function () { showAboutWindow(); }, 300); + break; } - } + }; - function ASPxClientUtilsTest(): void { - ASPxClientUtils.AttachEventToElement(document.getElementById("btnSubmit"), "click", () => { }); + export function onLoginButtonClick(s: ASPxClientButton, e: ASPxClientButtonClickEventArgs): void { + loginPopup.Hide(); + showAboutWindow(); + }; - let htmlEvent: Event; - let x: number = ASPxClientUtils.GetEventX(htmlEvent); - let y: number = ASPxClientUtils.GetEventY(htmlEvent); + export function onSearchButtonClick(): void { + if (ASPxClientEdit.ValidateGroup("DateEditors")) { + showPage("ShowHotels", { + location: searchComboBox.GetValue(), + checkin: getFormattedDate(checkInDateEdit.GetValue()), + checkout: getFormattedDate(checkOutDateEdit.GetValue()), + rooms: roomsNumberSpinEdit.GetValue() || 1, + adults: adultsNumberSpinEdit.GetValue() || 1, + children: childrenNumberSpinEdit.GetValue() || 0 + }); + } + }; - let control: DevExpress.Web.Scripts.ASPxClientControl; - let controlExists: boolean = ASPxClientUtils.IsExists(control); - } + export function onSearchComboBoxIndexChanged(s: ASPxClientComboBox, e: ASPxClientProcessingModeEventArgs): void { + hideMenu(); + $("#IndexContent").addClass("search-extend"); + searchButton.AdjustControl(); + }; - function MVCxClientGlobalEventsTest(): void { - ASPxClientGlobalEvents.AddControlsInitializedEventHandler((s: any, e: DevExpress.Web.Scripts.ASPxClientControlsInitializedEventArgs) => {}); - } + export function onIndexOfferCloseClick(index: number): void { + var panel = ASPxClientControl.GetControlCollection().GetByName("OfferDockPanel" + index); + var sibPanel = ASPxClientControl.GetControlCollection().GetByName("OfferDockPanel" + (index == 1 ? 2 : 1)); + panel.Hide(); + sibPanel.MakeFloat(); + sibPanel.SetWidth(offersZone.GetWidth()); + sibPanel.Dock(offersZone); + }; - function ASPxClientEditTest(): void { - let editorsValid: boolean = ASPxClientEdit.AreEditorsValid(); + export function onLogoClick(): void { + showPage("", null, false); + }; - let container: HTMLElement = document.getElementById("form1"); - let editorsInContainerGroupValid: boolean = ASPxClientEdit.AreEditorsValid(container, "group1", false); + export function onMenuNavButtonCheckedChanged(s: ASPxClientCheckBox, e: ASPxClientProcessingModeEventArgs): void { + var mainContainer = mainCallbackPanel.GetMainElement(); + if (s.GetChecked()) { + backSlider.Pause(); + showMenu(); + } + else { + hideMenu(); + backSlider.Play(); + } + }; - ASPxClientEdit.ClearEditorsInContainer(container, "group1", false); - ASPxClientEdit.ClearGroup("group1", false); + export function onBackNavButtonClick(s: ASPxClientButton, e: ASPxClientButtonClickEventArgs): void { + var params = getCurrentQueryParams(); + switch (getCurrentPage()) { + case "PrintInvoice": + showPage("Booking", params, false); + break; + case "Booking": + if (bookingPageControl.GetActiveTabIndex() > 0) + bookingPageControl.SetActiveTabIndex(bookingPageControl.GetActiveTabIndex() - 1); + else + showPage("ShowRooms", params, false); + break; + case "ShowRooms": + showPage("ShowHotels", params, false); + break; + case "ShowDetails": + showPage("ShowHotels", params, false); + break; + case "ShowHotels": + case "SpecialOffers": + showPage("", null, false); + break; + } + }; - let editorsInContainerValid: boolean = ASPxClientEdit.ValidateEditorsInContainer(container, "group1", false); - let editorsInGroupValid: boolean =ASPxClientEdit.ValidateGroup("group1", false); - } -} + export function updateSearchResults(): void { + var params = getCurrentQueryParams(); + params["location"] = locationComboBox.GetValue(); + params["minprice"] = nightyRateTrackBar.GetPositionStart(); + params["maxprice"] = nightyRateTrackBar.GetPositionEnd(); + params["custrating"] = customerRatingTrackBar.GetPosition(); + params["ourrating"] = ourRatingCheckBoxList.GetSelectedValues().join(","); + showPage("ShowHotels", params); + }; -namespace Tests.Controls { - declare var comboBox: DevExpress.Web.Scripts.ASPxClientComboBox; + export function onBookHotelButtonClick(hotelID: string): void { + var queryParams = getCurrentQueryParams(); + queryParams["hotelID"] = hotelID; + showPage("ShowRooms", queryParams); + }; - function ASPxClientComboBoxTest() { - let selectedIndex: number = comboBox.GetSelectedIndex(); - comboBox.SetSelectedIndex(1); + export function onDetailsHotelButtonClick(hotelID: string): void { + var queryParams = getCurrentQueryParams(); + queryParams["hotelID"] = hotelID; + showPage("ShowDetails", queryParams); + }; - let selectedIndexChangedEventHandler: (s: DevExpress.Web.Scripts.ASPxClientControl, e: DevExpress.Web.Scripts.ASPxClientEventArgs) => void = (s: DevExpress.Web.Scripts.ASPxClientControl, e: DevExpress.Web.Scripts.ASPxClientEventArgs) => { }; - comboBox.SelectedIndexChanged.AddHandler(selectedIndexChangedEventHandler); - comboBox.SelectedIndexChanged.RemoveHandler(selectedIndexChangedEventHandler); - comboBox.SelectedIndexChanged.ClearHandlers(); - } -} + export function onShowStartFilterButtonClick(s: ASPxClientButton, e: ASPxClientButtonClickEventArgs): void { + startFilterPopupControl.ShowAtElementByID("MainCallbackPanel_ContentPane"); + }; + + export function onChangeStartFilterButtonClick(s: ASPxClientButton, e: ASPxClientButtonClickEventArgs): void { + if (ASPxClientEdit.ValidateGroup("DateEditors")) { + var params = getCurrentQueryParams(); + params["checkin"] = getFormattedDate(checkInDateEdit.GetValue()); + params["checkout"] = getFormattedDate(checkOutDateEdit.GetValue()); + params["rooms"] = roomsNumberSpinEdit.GetValue() || 1; + params["adults"] = adultsNumberSpinEdit.GetValue() || 1; + params["children"] = childrenNumberSpinEdit.GetValue() || 0; + startFilterPopupControl.Hide(); + showPage(hiddenField.Get("page").toString(), params); + } + }; + + export function onBookRoomButtonClick(roomID: string): void { + var params = getCurrentQueryParams(); + params["roomID"] = roomID; + showPage("Booking", params); + }; + + export function onShowRoomsButtonClick(): void { + var queryParams = getCurrentQueryParams(); + showPage("ShowRooms", queryParams); + }; + + export function onShowDetailsButtonClick(): void { + var queryParams = getCurrentQueryParams(); + showPage("ShowDetails", queryParams); + }; + + export function onRoomImageNavItemClick(roomID: string, pictureName: string): void { + setTimeout(function () { + imagePopupControl.PerformCallback(roomID + "|" + pictureName); + imagePopupControl.ShowAtElementByID("MainCallbackPanel_ContentPane"); + }, 500); + }; + + export function onRoomsNavBarExpandedChanged(s: ASPxClientNavBar, e: ASPxClientNavBarGroupEventArgs): void { + ASPxClientControl.AdjustControls(s.GetMainElement()); + }; + + export function onNextBookingStepButtonClick(step: number): void { + var valid = true; + var validationGroup = ""; + if (step == 1) + validationGroup = "Account"; + if (step == 2) + validationGroup = "RoomDetails"; + if (step == 3) + validationGroup = "PaymentDetails"; + + switch (step) { + case 1: + valid = ASPxClientEdit.ValidateEditorsInContainer(bookingPageControl.GetMainElement(), "Account"); + if (valid) { + emailTextBox.SetValue(accountEmailTextBox.GetValue()); + creditCardEmailTextBox.SetValue(accountEmailTextBox.GetValue()); + showPage("Booking", getCurrentQueryParams()); + return; + } + break; + case 2: + valid = ASPxClientEdit.ValidateEditorsInContainer(bookingPageControl.GetMainElement(), "RoomDetails"); + emailTextBox.SetValue(accountEmailTextBox.GetValue()); + break; + case 3: + var paymentType = paymentTypePageControl.GetActiveTabIndex(); + if (paymentType == 0) + valid = ASPxClientEdit.ValidateEditorsInContainer(bookingPageControl.GetMainElement(), "CreditCard"); + else if (paymentType == 1) + valid = ASPxClientEdit.ValidateEditorsInContainer(bookingPageControl.GetMainElement(), "Cash"); + else if (paymentType == 2) + valid = ASPxClientEdit.ValidateEditorsInContainer(bookingPageControl.GetMainElement(), "PayPal"); + break; + } + if (valid) { + bookingPageControl.GetTab(step).SetEnabled(true); + bookingPageControl.SetActiveTabIndex(step); + } + }; + + export function onAccountCaptchaHiddenFieldInit(s: ASPxClientHiddenField, e: ASPxClientEventArgs): void { + if (s.Get("IsCaptchaValid")) { + bookingPageControl.GetTab(1).SetEnabled(true); + bookingPageControl.SetActiveTabIndex(1); + } + }; + + export function onFinishBookingStepButtonClick(): void { + showAboutWindow(); + }; + + export function OnPrintInvoiceButtonClick(): void { + showPage("PrintInvoice", getCurrentQueryParams()); + }; + + export function onOfferClick(offerID: string): void { + offerFormPopup.SetContentHtml(""); + offerFormPopup.PerformCallback(offerID); + var panel = ASPxClientControl.GetControlCollection().GetByName("DockPanel" + offerID); + var panelElement = panel.GetMainElement(); + if (panelElement.offsetWidth < 330 || panelElement.offsetHeight < 250) { + offerFormPopup.SetWidth(400); + offerFormPopup.SetHeight(280); + offerFormPopup.ShowAtElementByID("SpecialOffersContainer"); + } + else { + offerFormPopup.SetWidth(panelElement.offsetWidth); + offerFormPopup.SetHeight(panelElement.offsetHeight); + offerFormPopup.ShowAtElement(panelElement); + } + }; + + export function onSpecialOfferCheckButtonClick(hotelID: string, locationID: string): void { + if (ASPxClientEdit.ValidateGroup("DateEditors")) { + var queryParams: { [key: string]: any } = { + location: locationID, + hotelID: hotelID, + checkin: getFormattedDate(checkInDateEdit.GetValue()), + checkout: getFormattedDate(checkOutDateEdit.GetValue()), + rooms: roomsSpinEdit.GetValue() || 1, + adults: adultsSpinEdit.GetValue() || 1, + children: childrenSpinEdit.GetValue() || 0 + }; + showPage("ShowRooms", queryParams); + } + }; + + export function onIndexOfferClick(): void { + showPage("SpecialOffers", {}); + }; + + export function onControlsInit(): void { + ASPxClientUtils.AttachEventToElement(window, 'popstate', onHistoryPopState); + var pathParts = document.location.href.split("/"); + var url = pathParts[pathParts.length - 1]; + try { + if (window.history) + window.history.replaceState(url, ""); + } catch (e) { } + ASPxClientUtils.AttachEventToElement(window, "resize", onWindowResize); + if (ASPxClientUtils.iOSPlatform) { + $("form :input").blur(function () { + $('html, body').animate({ scrollTop: 0 }, 0); + }); + } + }; + + export function updateRatingLabels(ratingControl: ASPxClientTrackBar) { + $("#cpLeftLabelID").html(ratingControl.GetPositionStart().toString()); + $("#cpRightLabelID").html(ratingControl.GetPositionEnd().toString()); + }; + + export function onAboutWindowCloseUp(): void { + $(mainCallbackPanel.GetMainElement()).removeClass("show-about"); + }; + + export function onRatingControlItemClick(s: ASPxClientRatingControl, e: ASPxClientRatingControlItemClickEventArgs): void { + hotelDetailsCallbackPanel.PerformCallback(s.GetValue().toString()); + }; + + export function onInputKeyDown(s: ASPxClientTextBox, e: ASPxClientEditKeyEventArgs): void { + var keyCode = ASPxClientUtils.GetKeyCode(e.htmlEvent); + if (keyCode == 13) { + (jQuery).event.fix(e.htmlEvent).preventDefault(); + (s.GetInputElement()).blur(); + } + }; + + function getCurrentPage(): string { + var hfPage = hiddenField.Get("page"); + if (hfPage) + return hfPage; + var pathParts = document.location.pathname.split("/"); + return pathParts[pathParts.length - 1]; + }; + + function showAboutWindow(): void { + $(mainCallbackPanel.GetMainElement()).addClass("show-about"); + aboutWindow.ShowAtElementByID("MainCallbackPanel_ContentPane"); + }; + + function hideMenu(): void { + leftPanel.Collapse(); + if (menuButton.GetMainElement() && menuButton.GetChecked()) + menuButton.SetChecked(false); + }; + + function showMenu(): void { + leftPanel.Expand(); + }; + + var _resizeSpecialOffersTimeoutID = -1; + function onWindowResize(): void { + switch (hiddenField.Get("page")) { + case "SpecialOffers": + if (_resizeSpecialOffersTimeoutID == -1) + _resizeSpecialOffersTimeoutID = setTimeout(resizeSpecialOffers, 200); + break; + } + hidePopups("AboutWindow", "StartFilterPopupControl", "LoginPopup", "OfferFormPopup", "ImagePopupControl"); + }; + + function hidePopups(...names: string[]): void { + for (var i = 0; i < names.length; i++) { + var popupControl = ASPxClientControl.GetControlCollection().GetByName(names[i]); + popupControl.Hide(); + } + }; + + function resizeSpecialOffers(): void { + for (var i = 1; i <= 4; i++) { + var panel = ASPxClientControl.GetControlCollection().GetByName("DockPanel" + i); + if (panel && panel.IsVisible()) { + var zone = panel.GetOwnerZone(); + zone.SetWidth(((zone.GetMainElement()).parentNode).offsetWidth) + } + } + _resizeSpecialOffersTimeoutID = -1; + }; + + function getFormattedDate(date: Date): string { + return (date.getMonth() + 1) + "-" + date.getDate() + "-" + date.getFullYear(); + }; + + function getCurrentQueryParams(): { [key:string]: any } { + var hfParams = hiddenField.Get("parameters"); + if (hfParams) + return getParamsByQueryString(hfParams); + var query = document.location.search; + if (query[0] === "?") + query = query.substr(1); + return getParamsByQueryString(query); + }; + + function getQueryString(params: { [key:string]: any }): string { + var queryItems: any[] = []; + for (var key in params) { + if (!params.hasOwnProperty(key)) continue; + queryItems.push(key + "=" + params[key]); + } + if (queryItems.length > 0) + return queryItems.join("&"); + return ""; + }; + + function getParamsByQueryString(queryString: string): { [key: string]: string } { + var result: { [key: string]: any } = {}; + if (queryString) { + var queryStringArray = queryString.split("&"); + for (var i = 0; i < queryStringArray.length; i++) { + var part = queryStringArray[i].split('='); + if (part.length != 2) continue; + result[part[0]] = decodeURIComponent(part[1].replace(/\+/g, " ")); + } + } + return result; + }; + + function onHistoryPopState(evt: any): void { + if (evt.state !== null && evt.state !== undefined) { + var uriParts = evt.state.split("?"); + showPage(uriParts[0], getParamsByQueryString(uriParts[1]), true); + } + }; +} \ No newline at end of file diff --git a/devexpress-web/devexpress-web.d.ts b/devexpress-web/devexpress-web.d.ts index eb2dd7d678..c2e0014f85 100644 --- a/devexpress-web/devexpress-web.d.ts +++ b/devexpress-web/devexpress-web.d.ts @@ -1,555 +1,27224 @@ -// Type definitions for DevExpress ASP.NET web controls (Classic and MVC) -// Project: https://www.devexpress.com/Products/NET/Controls/ASP/MVC/ -// Definitions by: Sheron Benedict +// Type definitions for DevExpress ASP.NET 16.1 +// Project: http://devexpress.com/ +// Definitions by: DevExpress Inc. // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// DX Globals -declare var ASPx: DevExpress.Web.Scripts.ASPxStatic; -declare var ASPxClientControl: DevExpress.Web.Scripts.ASPxClientControlStatic; -declare var ASPxClientUtils: DevExpress.Web.Scripts.ASPxClientUtils; -declare var ASPxClientGlobalEvents: DevExpress.Web.Scripts.ASPxClientGlobalEvents; -declare var ASPxClientEdit: DevExpress.Web.Scripts.ASPxClientEditStatic; - -declare namespace DevExpress.Web.Scripts { - export interface ASPxStatic { - RunStartupScripts(): void; - } - - export interface ASPxClientControlStatic { - GetControlCollection(): ASPxClientControlCollection; - AdjustControls(): void; - } - - export interface ASPxClientUtils { - AttachEventToElement(element: HTMLElement, eventName: string, method: Function): void; - IsExists(element: ASPxClientControl): boolean; - GetEventX(htmlEvent: Event): number; - GetEventY(htmlEvent: Event): number; - } - - export interface ASPxClientGlobalEvents { - AddControlsInitializedEventHandler(handler: (sender?: any, e?: ASPxClientControlsInitializedEventArgs) => void): void; - } - - export interface ASPxClientEditStatic { - AreEditorsValid(): boolean; - AreEditorsValid(container: HTMLElement, validationGroup?: string, checkInvisibleEditors?: boolean): boolean; - - ClearEditorsInContainer(container: HTMLElement, validationGroup?: string, clearInvisibleEditors?: boolean): void; - ClearGroup(validationGroup: string, clearInvisibleEditors?: boolean): void; - - ValidateEditorsInContainer(container: HTMLElement, validationGroup?: string, validateInvisibleEditors?: boolean): boolean; - ValidateGroup(validationGroup: string, validateInvisibleEditors?: boolean): boolean; - } - - export interface ASPxClientControlsInitializedEventArgs { - isCallback: boolean; - } - - export interface ASPxClientGridViewBatchEditApi { - StartEdit(visibleIndex: number, columnIndex: number): void; - SetCellValue(visibleIndex: number, columnFieldNameOrId: string, value: any, displayText?: string): void; - EndEdit(): void; - HasChanges(visibleIndex?: number, columnFieldNameOrId?: string): boolean; - ValidateRow(visibleIndex: number): boolean; - ValidateRows(): boolean; - } - - export interface ASPxClientControlCollection { - GetByName(name: string): ASPxClientControl; - elements: ASPxClientControl[]; - Remove(control: ASPxClientControl): void; - ForEachControl(processFunc: (control: ASPxClientControl) => void, context?: any): void; - } - - export interface ASPxClientControl { - // Properties - name: string; - - // Methods - AdjustControl(): void; - GetMainElement(): HTMLElement; - GetVisible(): boolean; - SetVisible(visibility: boolean): void; - InCallback(): boolean; - SetWidth(height: number): void; - SetHeight(height: number): void; - - // Events - Init: ASPxClientEvent; - } - - export interface ASPxClientEditBase extends ASPxClientControl { - GetCaption(): string; - SetCaption(caption: string): void; - - GetEnabled(): boolean; - SetEnabled(enabled: boolean): any; - - GetValue(): any; - SetValue(value: any): any; - } - - export interface ASPxClientEdit extends ASPxClientEditBase { - // Methods - GetInputElement(): any; - - ValidateGroup(groupName: string): any; - Validate(): void; - SetErrorText(errorText: string): any; - - GetIsValid(): boolean; - SetIsValid(isValid: boolean): any; - - // Events - Validation: ASPxClientEvent; - ValueChanged: ASPxClientEvent; - } - - export interface ASPxClientTextEdit extends ASPxClientEdit { - } - - export interface ASPxClientTextBoxBase extends ASPxClientTextEdit { - } - - export interface ASPxClientButtonEditBase extends ASPxClientTextBoxBase { - } - - export interface ASPxClientDropDownEditBase extends ASPxClientButtonEditBase { - } - - export interface ASPxClientComboBox extends ASPxClientDropDownEditBase { - GetSelectedIndex(): number; - SetSelectedIndex(index: number): void; - - SelectedIndexChanged: ASPxClientEvent; - } - - export interface ASPxClientListEdit extends ASPxClientEdit { - GetSelectedIndex(): number; - SetSelectedIndex(index: number): void; - } - - export interface ASPxClientCheckListBase extends ASPxClientListEdit { - GetItem(index: number): any; - GetItemCount(): number; - } - - export interface ASPxClientDockZone extends ASPxClientControl { - // Methods - IsVertical(): boolean; - } - - export interface ASPxDockManager { - // Events - AfterDock: ASPxClientEvent; - AfterFloat: ASPxClientEvent; - PanelClosing: ASPxClientEvent; - EndPanelDragging: ASPxClientEvent; - - // Methods - GetPanels(): ASPxClientDockPanel[]; - GetPanels(filterPredicate: Function): ASPxClientDockPanel[]; - GetPanelByUID(uniqueId: string): ASPxClientDockPanel; - } - - export interface ASPxClientGenericEvent { - AddHandler(handler: (s: S, e: E) => void): void; - RemoveHandler(handler: (s: S, e: E) => void): void; - ClearHandlers(): void; - } - - export interface ASPxClientEvent extends ASPxClientGenericEvent { - } - - export interface ASPxClientEventArgs { - } - - export interface ASPxClientCancelEventArgs { - cancel: boolean; - } - - export interface ASPxClientGridViewBatchEditStartEditingEventArgs extends ASPxClientCancelEventArgs { - focusedColumn: ASPxClientGridViewColumn; - rowValues: ASPxClientGridViewRowValues; - visibleIndex: number; - } - - export interface ASPxClientGridViewRowValues { - [columnIndex: string]: ASPxClientGridViewRowValue; - } - - export interface ASPxClientGridViewRowValue { - value: string; - text: string; - } - - export interface ASPxClientBeginCallbackEventArgs extends ASPxClientEventArgs { - // Properties - command: any; - customArgs: any; - } - - export interface ASPxClientEndCallbackEventArgs extends ASPxClientEventArgs { - } - - export interface ASPxClientPopupControlBase extends ASPxClientControl { - // Properties - IsVisible: boolean; - - // Methods - - Show(): void; - Hide(): void; - PerformCallback(): void; - - // Events - BeginCallback: ASPxClientEvent; - EndCallback: ASPxClientEvent; - Closing: ASPxClientEvent; - } - - export interface ASPxClientDockPanel extends ASPxClientPopupControlBase { - // Properties - panelUID: string; - - // Methods - MakeFloat(): any; - MakeFloat(x: number, y: number): any; - - ShowAtPos(x: number, y: number): any; - } - - export interface ASPxPopupControl extends ASPxClientPopupControlBase { - CallbackRouteValues: any; - } - - export interface ASPxClientLoadingPanel extends ASPxClientControl { - // Methods - Show(): void; - ShowInElement(htmlElement: HTMLElement): any; - Hide(): void; - } - - export interface ASPxClientCheckBox extends ASPxClientControl { - // Methods - GetChecked(): boolean; - GetCheckState(): string; - - SetChecked(isChecked: boolean): any; - SetCheckState(checkState: string): any; - - // Events - CheckedChanged: ASPxClientGenericEvent; - } - - export interface ASPxClientRadioButton extends ASPxClientCheckBox { - } - - export interface ASPxClientLabel { - // Methods - SetText(text: String): void; - } - - export enum CheckState { - Checked, - - Indeterminate, - - Unchecked - } - - export interface ASPxClientTab extends ASPxClientControl { - name: string; - index: number; - tabControl: ASPxClientPageControl; - } - - export interface ASPxClientPageControl extends ASPxClientControl { - // Methods - AdjustSize(): void; - GetActiveTab(): ASPxClientTab; - GetActiveTabIndex(): number; - SetActiveTabIndex(index: number): any; - - GetTabByName(name: string): ASPxClientTab; - GetTab(index: number): ASPxClientTab; - - SetTabContentHTML(tab: ASPxClientTab, html: string): any; - - // Events - ActiveTabChanging: ASPxClientEvent; - ActiveTabChanged: ASPxClientEvent; - } - - export interface ASPxClientTabControlTabCancelEventArgs extends ASPxClientEventArgs { - cancel: boolean; - processOnServer: boolean; - reloadContentOnCallback: boolean; - tab: ASPxClientTab; - } - - export interface ASPxClientTabControlTabEventArgs extends ASPxClientEventArgs { - tab: ASPxClientTab; - } - - export interface ASPxClientCallbackPanel extends ASPxClientControl { - // Methods - PerformCallback(): any; - - // Events - BeginCallback: ASPxClientEvent; - CallbackError: ASPxClientEvent; - EndCallback: ASPxClientEvent; - } - - export interface ASPxClientCallbackErrorEventArgs extends ASPxClientEventArgs { - handled: boolean; - message: string; - } - - export interface ASPxClientProcessingModeEventArgs extends ASPxClientEventArgs { - processOnServer: boolean; - } - - export interface ASPxClientDateEdit extends ASPxClientEdit { - GetDate(): Date; - SetDate(date: Date): any; - } - - export interface ASPxClientEditValidationEventArgs { - errorText: string; - isValid: boolean; - value: any; - } - - export interface ASPxClientGridViewColumn { - fieldName: string; - index: number; - name: string; - visible: boolean; - } - - export interface ASPxClientGridView extends ASPxClientControl { - // Properties - batchEditApi: ASPxClientGridViewBatchEditApi; - VisibleRowCount: number; - - // Methods - visibleStartIndex: number; - GetVisibleRowsOnPage(): number; - - SetFocusedRowIndex(visibleIndex: number): void; - GetFocusedRowIndex(): number; - - GetRowKey(visibleIndex: number): string; - GetRowValues(visibleIndex: number, fieldNames: string, onCallback: Function): void; - - StartEditRowByKey(key: any): void; - UpdateEdit(): void; - CancelEdit(): void; - - SelectRowOnPage(visibleIndex: number): void; - SelectRows(visibleIndices: Int32Array): void; - SelectRowsByKey(keys: Object[]): void; - GetColumn(columnIndex: number): ASPxClientGridViewColumn; - GetColumnByField(columnFieldName: string): ASPxClientGridViewColumn; - - GetSelectedRowCount(): number; - GetSelectedKeysOnPage(): Object[]; - IsRowSelectedOnPage(visibleIndex: number): boolean; - UnselectRows(): void; - - AddNewRow(): void; - DeleteRow(visibleIndex: number): void; - DeleteRowByKey(key: any): void; - - PerformCallback(args?: string): void; - GetValuesOnCustomCallback(args: any, onCompleteCallback: Function): any; - GetSelectedFieldValues(fieldNames: string, onCallback: (result: Object[]) => void): any; - - Refresh(): void; - - // Events - BeginCallback: ASPxClientEvent; - EndCallback: ASPxClientGenericEvent; - CallbackError: ASPxClientGenericEvent; - RowClick: ASPxClientGenericEvent; - RowDblClick: ASPxClientGenericEvent; - ContextMenu: ASPxClientGenericEvent; - RowDeleting: ASPxClientEvent; - SelectionChanged: ASPxClientGenericEvent; - CustomButtonClick: ASPxClientEvent; - ColumnResized: ASPxClientEvent; - BatchEditStartEditing: ASPxClientGenericEvent; - BatchEditEndEditing: ASPxClientEvent; - BatchEditRowValidating: ASPxClientEvent; - ColumnResizing: ASPxClientGenericEvent; - BatchEditConfirmShowing: ASPxClientGenericEvent; - } - - export interface ASPxClientGridViewColumnCancelEventArgs extends ASPxClientCancelEventArgs { - column: ASPxClientGridViewColumn; - } - - export interface ASPxClientGridViewRowClickEventArgs { - cancel: boolean; - htmlEvent: Event; - visibleIndex: number; - } - - export interface ASPxClientGridViewSelectionEventArgs { - isAllRecordsOnPage: boolean; - isChangedOnServer: boolean; - isSelected: boolean; - processOnServer: boolean; - visibleIndex: number; - } - - export interface ASPxClientGridViewCustomButtonEventArgs { - buttonID: string; - processOnServer: boolean; - visibleIndex: number; - } - - export interface ASPxClientGridViewContextMenuEventArgs { - htmlEvent: Event; - index: number; - objectType: string; - } - - export interface ASPxClientMenuItemClickEventArgs extends ASPxClientProcessingModeEventArgs { - htmlElement: HTMLElement; - htmlEvent: Event; - item: ASPxClientMenuItem; - } - - export interface ASPxClientPopupMenu extends ASPxClientMenuBase { - // Methods - ShowAtElement(htmlElement: HTMLElement): any; - ShowAtElementByID(id: string): any; - ShowAtPos(x: number, y: number): any; - } - - export interface ASPxClientMenuItem { - index: number; - menu: ASPxClientMenuBase; - name: string; - parent: ASPxClientMenuItem; - - GetEnabled(): boolean; - SetEnabled(enable: boolean): any; - } - - export interface ASPxClientMenuBase extends ASPxClientControl { - // Methods - GetItemByName(name: string): ASPxClientMenuItem; - - // Events - ItemClick: ASPxClientGenericEvent; - PopUp: ASPxClientEvent; - } - - export interface ASPxClientRadioButtonList extends ASPxClientCheckListBase { - } +/** + * A client-side counterpart of the DashboardViewer extension. + */ +interface MVCxClientDashboardViewer extends ASPxClientDashboardViewer { +} +/** + * Represents a list of records from the dashboard data source. + */ +interface ASPxClientDashboardItemUnderlyingData { + /** + * Gets the number of rows in the underlying data set. + */ + GetRowCount(): number; + /** + * Returns the value of the specified cell within the underlying data set. + * @param rowIndex An integer value that specifies the zero-based index of the required row. + * @param dataMember A String that specifies the required data member. + */ + GetRowValue(rowIndex: number, dataMember: string): Object; + /** + * Returns an array of data members available in a data source. + */ + GetDataMembers(): string[]; + /** + * Returns whether or not a request for underlying data was successful. + */ + IsDataReceived(): boolean; + /** + * Returns a callstack containing the error caused by an unsuccessful request for underlying data. + */ + GetRequestDataError(): string; +} +/** + * Contains parameters used to obtain the underlying data for the dashboard item. + */ +interface ASPxClientDashboardItemRequestUnderlyingDataParameters { + /** + * Gets or sets an array of data member identifiers used to obtain underlying data. + * Value: An array of String objects that specify data member identifiers. + */ + DataMembers: string[]; + /** + * Gets or sets axis points used to obtain the underlying data. + * Value: An array of ASPxClientDashboardItemDataAxisPoint objects that represent axis points. + */ + AxisPoints: ASPxClientDashboardItemDataAxisPoint[]; + /** + * Gets or sets the dimension value used to obtain the underlying data. + * Value: The dimension value. + */ + ValuesByAxisName: Object; + /** + * Gets or sets the unique dimension value used to obtain the underlying data. + * Value: The unique dimension value. + */ + UniqueValuesByAxisName: Object; +} +/** + * References a method executed after an asynchronous request is complete. + */ +interface ASPxClientDashboardItemRequestUnderlyingDataCompleted { + /** + * References a method executed after an asynchronous request is completed. + * @param data An ASPxClientDashboardItemUnderlyingData object that represents a list of records from the dashboard data source. + */ + (data: ASPxClientDashboardItemUnderlyingData): void; +} +/** + * References a method that will handle the ItemClick event. + */ +interface ASPxClientDashboardItemClickEventHandler { + /** + * References a method that will handle the ItemClick event. + * @param source The event source. + * @param e A ASPxClientDashboardItemClickEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardItemClickEventArgs): void; +} +/** + * Provides data for the ItemClick event. + */ +interface ASPxClientDashboardItemClickEventArgs extends ASPxClientEventArgs { + /** + * Gets the name of the dashboard item for which the event has been raised. + * Value: A String that is the dashboard item name. + */ + ItemName: string; + /** + * Gets the dashboard item's client data. + */ + GetData(): ASPxClientDashboardItemData; + /** + * Returns the axis point corresponding to the clicked visual element. + * @param axisName A string value returned by the DashboardDataAxisNames class that specifies the name of the data axis. + */ + GetAxisPoint(axisName: string): ASPxClientDashboardItemDataAxisPoint; + /** + * Gets measures corresponding to the clicked visual element. + */ + GetMeasures(): ASPxClientDashboardItemDataMeasure[]; + /** + * Gets deltas corresponding to the clicked visual element. + */ + GetDeltas(): ASPxClientDashboardItemDataDelta[]; + /** + * Gets the dimensions used to create a hierarchy of axis points for the specified axis. + * @param axisName A string value returned by the DashboardDataAxisNames class that specifies the name of the data axis. + */ + GetDimensions(axisName: string): ASPxClientDashboardItemDataDimension[]; + /** + * Requests underlying data corresponding to the clicked visual element. + * @param onCompleted A ASPxClientDashboardItemRequestUnderlyingDataCompleted object that references a method executed after the request is completed. + * @param dataMembers An array of String values that specify data members used to obtain underlying data. + */ + RequestUnderlyingData(onCompleted: ASPxClientDashboardItemRequestUnderlyingDataCompleted, dataMembers: string[]): void; +} +/** + * References a method that will handle the ItemVisualInteractivity event. + */ +interface ASPxClientDashboardItemVisualInteractivityEventHandler { + /** + * References a method that will handle the ItemVisualInteractivity event. + * @param source The event source. + * @param e A ASPxClientDashboardItemVisualInteractivityEventArgs object containing event data. + */ + (source: S, e: ASPxClientDashboardItemVisualInteractivityEventArgs): void; +} +/** + * Provides data for the ItemVisualInteractivity event. + */ +interface ASPxClientDashboardItemVisualInteractivityEventArgs extends ASPxClientEventArgs { + /** + * Gets the component name of the dashboard item for which the event was raised. + * Value: A String that is the component name of the dashboard item. + */ + ItemName: string; + /** + * Gets the selection mode for dashboard item elements. + */ + GetSelectionMode(): string; + /** + * Sets the selection mode for dashboard item elements. + * @param selectionMode A String that specifies the selection mode. + */ + SetSelectionMode(selectionMode: string): void; + /** + * Returns whether or not highlighting is enabled for the current dashboard item. + */ + IsHighlightingEnabled(): boolean; + /** + * Enables highlighting for the current dashboard item. + * @param enableHighlighting true, to enable highlighting; otherwise, false. + */ + EnableHighlighting(enableHighlighting: boolean): void; + /** + * Gets data axes used to perform custom interactivity actions. + */ + GetTargetAxes(): string[]; + /** + * Sets data axes used to perform custom interactivity actions. + * @param targetAxes An array of String objects that specify names of data axes. + */ + SetTargetAxes(targetAxes: string[]): void; + /** + * Gets the default selection for the current dashboard item. + */ + GetDefaultSelection(): ASPxClientDashboardItemDataAxisPointTuple[]; + /** + * Sets the default selection for the current dashboard item. + * @param values An array of ASPxClientDashboardItemDataAxisPointTuple objects specifying axis point tuples used to select default elements. + */ + SetDefaultSelection(values: ASPxClientDashboardItemDataAxisPointTuple[]): void; +} +/** + * References a method that will handle the ItemSelectionChanged event. + */ +interface ASPxClientDashboardItemSelectionChangedEventHandler { + /** + * References a method that will handle the ItemSelectionChanged event. + * @param source The event source. + * @param e A ASPxClientDashboardItemSelectionChangedEventArgs object containing event data. + */ + (source: S, e: ASPxClientDashboardItemSelectionChangedEventArgs): void; +} +/** + * Provides data for the ItemSelectionChanged event. + */ +interface ASPxClientDashboardItemSelectionChangedEventArgs extends ASPxClientEventArgs { + /** + * Gets the component name of the dashboard item for which the event was raised. + * Value: A String that is the component name of the dashboard item. + */ + ItemName: string; + /** + * Gets currently selected elements. + */ + GetCurrentSelection(): ASPxClientDashboardItemDataAxisPointTuple[]; +} +/** + * References a method that will handle the ItemElementCustomColor event. + */ +interface ASPxClientDashboardItemElementCustomColorEventHandler { + /** + * References a method that will handle the ItemElementCustomColor event. + * @param source The event source. + * @param e An ASPxClientDashboardItemElementCustomColorEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardItemElementCustomColorEventArgs): void; +} +/** + * Provides data for the ItemElementCustomColor event. + */ +interface ASPxClientDashboardItemElementCustomColorEventArgs extends ASPxClientEventArgs { + /** + * Gets the component name of the dashboard item for which the event was raised. + * Value: A String that is the component name of the dashboard item for which the event was raised. + */ + ItemName: string; + /** + * Gets the axis point tuple that corresponds to the current dashboard item element. + */ + GetTargetElement(): ASPxClientDashboardItemDataAxisPointTuple; + /** + * Gets the color of the current dashboard item element. + */ + GetColor(): string; + /** + * Sets the color of the current dashboard item element. + * @param color A String that specifies the color of the current dashboard item element. + */ + SetColor(color: string): void; + /** + * Gets measures corresponding to the current dashboard item element. + */ + GetMeasures(): ASPxClientDashboardItemDataMeasure[]; +} +/** + * References a method that will handle the ItemWidgetCreated event. + */ +interface ASPxClientDashboardItemWidgetCreatedEventHandler { + /** + * References a method that will handle the ItemWidgetCreated event. + * @param source The event source. + * @param e A ASPxClientDashboardItemWidgetEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardItemWidgetEventArgs): void; +} +/** + * References a method that will handle the ItemWidgetUpdating event. + */ +interface ASPxClientDashboardItemWidgetUpdatingEventHandler { + /** + * References a method that will handle the ItemWidgetUpdating event. + * @param source The event source. + * @param e A ASPxClientDashboardItemWidgetEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardItemWidgetEventArgs): void; +} +/** + * References a method that will handle the ItemWidgetUpdated event. + */ +interface ASPxClientDashboardItemWidgetUpdatedEventHandler { + /** + * References a method that will handle the ItemWidgetUpdated event. + * @param source The event source. + * @param e A ASPxClientDashboardItemWidgetEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardItemWidgetEventArgs): void; +} +/** + * References a method that will handle the ItemBeforeWidgetDisposed event. + */ +interface ASPxClientDashboardItemBeforeWidgetDisposedEventHandler { + /** + * References a method that will handle the ItemBeforeWidgetDisposed event. + * @param source The event source. + * @param e A ASPxClientDashboardItemWidgetEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardItemWidgetEventArgs): void; +} +/** + * Provides data for events related to client widgets used to visualize data in dashboard items. + */ +interface ASPxClientDashboardItemWidgetEventArgs extends ASPxClientEventArgs { + /** + * Gets the component name of the dashboard item for which the event was raised. + * Value: A String that is the component name of the dashboard item. + */ + ItemName: string; + /** + * Returns an underlying widget corresponding to the current dashboard item. + */ + GetWidget(): Object; +} +/** + * Represents multidimensional data visualized in the dashboard item. + */ +interface ASPxClientDashboardItemData { + /** + * Gets the names of the axes that constitute the current ASPxClientDashboardItemData. + */ + GetAxisNames(): string[]; + /** + * Returns the specified data axis. + * @param axisName A string value returned by the DashboardDataAxisNames class that specifies the name of the data axis. + */ + GetAxis(axisName: string): ASPxClientDashboardItemDataAxis; + /** + * Gets the dimensions used to create a hierarchy of axis points for the specified axis. + * @param axisName A string value returned by the DashboardDataAxisNames class that specifies the name of the data axis. + */ + GetDimensions(axisName: string): ASPxClientDashboardItemDataDimension[]; + /** + * Gets the measures for the current ASPxClientDashboardItemData object. + */ + GetMeasures(): ASPxClientDashboardItemDataMeasure[]; + /** + * Gets the deltas for the current ASPxClientDashboardItemData object. + */ + GetDeltas(): ASPxClientDashboardItemDataDelta[]; + /** + * Gets the slice of the current ASPxClientDashboardItemData object by the specified axis point tuple. + * @param tuple A ASPxClientDashboardItemDataAxisPointTuple object that is a tuple of axis points. + */ + GetSlice(tuple: ASPxClientDashboardItemDataAxisPointTuple): ASPxClientDashboardItemData; + /** + * Gets the slice of the current ASPxClientDashboardItemData object by the specified axis point. + * @param axisPoint An ASPxClientDashboardItemDataAxisPoint object that is the data point in a multidimensional space. + */ + GetSlice(axisPoint: ASPxClientDashboardItemDataAxisPoint): ASPxClientDashboardItemData; + /** + * Returns a total summary value for the specified measure. + * @param measureId A String that is the measure identifier. + */ + GetMeasureValue(measureId: string): ASPxClientDashboardItemDataMeasureValue; + /** + * Gets the summary value for the specified delta. + * @param deltaId A String that is the data item identifier. + */ + GetDeltaValue(deltaId: string): ASPxClientDashboardItemDataDeltaValue; + /** + * Returns an array of data members available in a data source. + */ + GetDataMembers(): string[]; + /** + * Creates a tuple based on the specified axes names and corresponding values. + * @param values An array of name-value pairs containing the axis name and corresponding values. + */ + CreateTuple(values: Object[]): ASPxClientDashboardItemDataAxisPointTuple; + /** + * Creates a tuple based on the specified axis points. + * @param axisPoints An array of ASPxClientDashboardItemDataAxisPoint objects that specify axis points belonging to different data axes. + */ + CreateTuple(axisPoints: ASPxClientDashboardItemDataAxisPoint[]): ASPxClientDashboardItemDataAxisPointTuple; +} +/** + * An axis that contains data points corresponding to the specified value hierarchy. + */ +interface ASPxClientDashboardItemDataAxis { + /** + * Gets the dimensions used to create a hierarchy of axis points belonging to the current axis. + */ + GetDimensions(): ASPxClientDashboardItemDataDimension[]; + /** + * Gets the root axis point belonging to the current ASPxClientDashboardItemDataAxis. + */ + GetRootPoint(): ASPxClientDashboardItemDataAxisPoint; + /** + * Returns axis points corresponding to values of the last-level dimension. + */ + GetPoints(): ASPxClientDashboardItemDataAxisPoint[]; + /** + * Returns axis points corresponding to the specified dimension. + * @param dimensionId A String that is the dimension identifier. + */ + GetPointsByDimension(dimensionId: string): ASPxClientDashboardItemDataAxisPoint[]; + /** + * Returns the data point for the specified axis by unique values. + * @param uniqueValues A hierarchy of unique values identifying the required data point. + */ + GetPointByUniqueValues(uniqueValues: Object[]): ASPxClientDashboardItemDataAxisPoint; +} +/** + * Contains the dimension metadata. + */ +interface ASPxClientDashboardItemDataDimension { + /** + * Gets the dimension identifier. + * Value: A String that is the dimension identifier. + */ + Id: string; + /** + * Gets or sets the name of the dimension. + * Value: A String that is the name of the dimension. + */ + Name: string; + /** + * Gets the data member identifier for the current dimension. + * Value: A String value that identifies a data member. + */ + DataMember: string; + /** + * Gets the group interval for date-time values for the current dimension. + * Value: A String value that represents how date-time values are grouped. + */ + DateTimeGroupInterval: string; + /** + * Gets the group interval for string values. + * Value: A String value that specifies the group interval for string values. + */ + TextGroupInterval: string; + /** + * Formats the specified value using format settings of the current dimension. + * @param value A value to be formatted. + */ + Format(value: Object): string; +} +/** + * Contains the measure metadata. + */ +interface ASPxClientDashboardItemDataMeasure { + /** + * Gets the measure identifier. + * Value: A String that is the measure identifier. + */ + Id: string; + /** + * Gets the name of the measure. + * Value: A String that is the name of the measure. + */ + Name: string; + /** + * Gets the data member that identifies the data source list used to provide data for the current measure. + * Value: A String value that identifies the data source list used to provide data for the current measure. + */ + DataMember: string; + /** + * Gets the type of summary function calculated against the current measure. + * Value: A String value that identifies the type of summary function calculated against the current measure. + */ + SummaryType: string; + /** + * Formats the specified value using format settings of the current measure. + * @param value A value to be formatted. + */ + Format(value: Object): string; +} +/** + * Contains the delta metadata. + */ +interface ASPxClientDashboardItemDataDelta { + /** + * Gets the data item identifier. + * Value: A String that is the data item identifier. + */ + Id: string; + /** + * Gets the name of the data item container. + * Value: A String value that is the name of the data item container. + */ + Name: string; + /** + * Gets the identifier for the measure that provides actual values. + * Value: A String value that is the measure identifier. + */ + ActualMeasureId: string; + /** + * Gets the identifier for the measure that provides target values. + * Value: A String value that is the measure identifier. + */ + TargetMeasureId: string; +} +/** + * Provides dimension values at the specified axis point. + */ +interface ASPxClientDashboardItemDataDimensionValue { + /** + * Gets the current dimension value. + */ + GetValue(): Object; + /** + * Gets the unique value for the current dimension value. + */ + GetUniqueValue(): Object; + /** + * Gets the display text for the current dimension value. + */ + GetDisplayText(): string; +} +/** + * Provides the measure value and display text. + */ +interface ASPxClientDashboardItemDataMeasureValue { + /** + * Gets the measure value. + */ + GetValue(): Object; + /** + * Gets the measure display text. + */ + GetDisplayText(): string; +} +/** + * Provides delta element values. + */ +interface ASPxClientDashboardItemDataDeltaValue { + /** + * Provides access to the actual value displayed within the delta element. + */ + GetActualValue(): ASPxClientDashboardItemDataMeasureValue; + /** + * Provides access to the target value. + */ + GetTargetValue(): ASPxClientDashboardItemDataMeasureValue; + /** + * Provides access to the absolute difference between the actual and target values. + */ + GetAbsoluteVariation(): ASPxClientDashboardItemDataMeasureValue; + /** + * Provides access to the percent of variation between the actual and target values. + */ + GetPercentVariation(): ASPxClientDashboardItemDataMeasureValue; + /** + * Provides access to the percentage of the actual value in the target value. + */ + GetPercentOfTarget(): ASPxClientDashboardItemDataMeasureValue; + /** + * Provides access to the main delta value. + */ + GetDisplayValue(): ASPxClientDashboardItemDataMeasureValue; + /** + * Provides access to the first additional delta value. + */ + GetDisplaySubValue1(): ASPxClientDashboardItemDataMeasureValue; + /** + * Provides access to the second additional delta value. + */ + GetDisplaySubValue2(): ASPxClientDashboardItemDataMeasureValue; + /** + * Gets the value specifying the condition for displaying the delta indication. + */ + GetIsGood(): ASPxClientDashboardItemDataMeasureValue; + /** + * Gets the type of delta indicator. + */ + GetIndicatorType(): ASPxClientDashboardItemDataMeasureValue; +} +/** + * A point on the data axis. + */ +interface ASPxClientDashboardItemDataAxisPoint { + /** + * Gets the name of the axis to which the current axis point belongs. + */ + GetAxisName(): string; + /** + * Gets the last level dimension corresponding to the current axis point. + */ + GetDimension(): ASPxClientDashboardItemDataDimension; + /** + * Gets the collection of dimensions used to create a hierarchy of axis points from the root point to the current axis point. + */ + GetDimensions(): ASPxClientDashboardItemDataDimension[]; + /** + * Gets the value corresponding to the current axis point. + */ + GetValue(): Object; + /** + * Gets the display text corresponding to the current axis point. + */ + GetDisplayText(): string; + /** + * Gets the unique value corresponding to the current axis point. + */ + GetUniqueValue(): Object; + /** + * Gets the dimension values at the specified axis point. + */ + GetDimensionValue(): ASPxClientDashboardItemDataDimensionValue; + /** + * Gets the dimension value at the current axis point. + * @param dimensionId A String value that specifies the dimension identifier. + */ + GetDimensionValue(dimensionId: string): ASPxClientDashboardItemDataDimensionValue; + /** + * Gets the child axis points for the current axis point. + */ + GetChildren(): ASPxClientDashboardItemDataAxisPoint[]; + /** + * Gets the parent axis point for the current axis point. + */ + GetParent(): ASPxClientDashboardItemDataAxisPoint; +} +/** + * Represents a tuple of axis points. + */ +interface ASPxClientDashboardItemDataAxisPointTuple { + /** + * Returns the axis point belonging to the default data axis. + */ + GetAxisPoint(): ASPxClientDashboardItemDataAxisPoint; + /** + * Returns the axis point belonging to the specified data axis. + * @param axisName A string value returned by the DashboardDataAxisNames class that specifies the name of the data axis. + */ + GetAxisPoint(axisName: string): ASPxClientDashboardItemDataAxisPoint; +} +/** + * A client-side equivalent of the ASPxDashboardDesigner control. + */ +interface ASPxClientDashboardDesigner extends ASPxClientControl { + /** + * Occurs after the state of the dashboard displayed in the ASPxClientDashboardDesigner is changed. + */ + DashboardStateChanged: ASPxClientEvent>; + /** + * Occurs after a dashboard displayed in the ASPxClientDashboardDesigner is changed. + */ + DashboardChanged: ASPxClientEvent>; + /** + * For internal use. + */ + CustomizeMenuItems: ASPxClientEvent>; + BeforeRender: ASPxClientEvent>; + /** + * Switches the ASPxClientDashboardDesigner to the viewer mode. + */ + SwitchToViewer(): void; + /** + * Switches the ASPxClientDashboardDesigner to the designer mode. + */ + SwitchToDesigner(): void; + /** + * Gets the current working mode of the Web Designer. + */ + GetWorkingMode(): string; + /** + * Gets the identifier of the dashboard that is displayed in the ASPxClientDashboardDesigner. + */ + GetDashboardId(): string; + /** + * Gets the name of the dashboard that is displayed in the ASPxClientDashboardDesigner. + */ + GetDashboardName(): string; + /** + * Gets the state of the dashboard (for instance, the master filtering state) displayed in the ASPxClientDashboardDesigner. + */ + GetDashboardState(): string; + /** + * Loads a dashboard with the specified identifier. + * @param dashboardId A String value that specifies the dashboard identifier. + */ + LoadDashboard(dashboardId: string): void; + /** + * Saves a dashboard to the dashboard storage. + */ + SaveDashboard(): void; +} +/** + * References a method that will handle the DashboardStateChanged event. + */ +interface ASPxClientDashboardStateChangedEventHandler { + /** + * References a method that will handle the DashboardStateChanged event. + * @param source The event source. + * @param e A ASPxClientDashboardStateChangedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardStateChangedEventArgs): void; +} +/** + * Provides data for the DashboardStateChanged event. + */ +interface ASPxClientDashboardStateChangedEventArgs extends ASPxClientEventArgs { + /** + * Gets the current state of the dashboard. + * Value: A String that is the current state of the dashboard. + */ + DashboardState: string; +} +/** + * References a method that will handle the DashboardChanged event. + */ +interface ASPxClientDashboardChangedEventHandler { + /** + * References a method that will handle the DashboardChanged event. + * @param source The event source. + * @param e A ASPxClientDashboardChangedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardChangedEventArgs): void; +} +/** + * Provides data for the DashboardChanged event. + */ +interface ASPxClientDashboardChangedEventArgs extends ASPxClientEventArgs { + /** + * Gets the identifier of a newly opened dashboard. + * Value: A String values that is an identifier of newly opened dashboard. + */ + DashboardId: string; + /** + * Gets the name of a newly opened dashboard. + * Value: A String values that is the name of newly opened dashboard. + */ + DashboardName: string; +} +interface ASPxClientDashboardDesignerCustomizeMenuItemsEventHandler { + (source: S, e: ASPxClientDashboardDesignerCustomizeMenuItemsEventArgs): void; +} +interface ASPxClientDashboardDesignerMenuItem { + id: string; + title: string; + template: string; + selected: boolean; + disabled: boolean; + hasSeparator: boolean; + click: Function; + hotKey: number; +} +interface ASPxClientDashboardDesignerCustomizeMenuItemsEventArgs extends ASPxClientEventArgs { + Items: ASPxClientDashboardDesignerMenuItem[]; + FindById(itemId: string): ASPxClientDashboardDesignerMenuItem; +} +interface ASPxClientDashboardDesignerBeforeRenderEventHandler { + (source: S, e: ASPxClientEventArgs): void; +} +/** + * A client-side equivalent of the ASPxDashboardViewer control. + */ +interface ASPxClientDashboardViewer extends ASPxClientControl { + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs after the available interactivity actions have changed. + */ + ActionAvailabilityChanged: ASPxClientEvent>; + /** + * Occurs when an end-user changes the state of the master filter. + */ + MasterFilterSet: ASPxClientEvent>; + /** + * Occurs when an end-user clears the selection in the master filter item. + */ + MasterFilterCleared: ASPxClientEvent>; + /** + * Provides the capability to handle data loading errors in the ASPxClientDashboardViewer. + */ + DataLoadingError: ASPxClientEvent>; + /** + * Occurs after a drill-down is performed. + */ + DrillDownPerformed: ASPxClientEvent>; + /** + * Occurs after a drill-up is performed. + */ + DrillUpPerformed: ASPxClientEvent>; + /** + * Occurs after the ASPxClientDashboardViewer is loaded. + */ + Loaded: ASPxClientEvent>; + /** + * Occurs when an end-user clicks a dashboard item. + */ + ItemClick: ASPxClientEvent>; + /** + * Allows you to provide custom visual interactivity for data-bound dashboard items that support element selection and highlighting + */ + ItemVisualInteractivity: ASPxClientEvent>; + /** + * Allows you to access underlying UI/Data Visualization widgets. + */ + ItemWidgetCreated: ASPxClientEvent>; + /** + * Allows you to access underlying UI/Data Visualization widgets. + */ + ItemWidgetUpdating: ASPxClientEvent>; + /** + * Allows you to access underlying UI/Data Visualization widgets. + */ + ItemWidgetUpdated: ASPxClientEvent>; + /** + * Allows you to access underlying UI/Data Visualization widgets. + */ + ItemBeforeWidgetDisposed: ASPxClientEvent>; + /** + * Occurs after the selection within the dashboard item is changed. + */ + ItemSelectionChanged: ASPxClientEvent>; + /** + * Allows you to color the required dashboard item elements using the specified colors. + */ + ItemElementCustomColor: ASPxClientEvent>; + /** + * Reloads data in the data sources. + */ + ReloadData(): void; + /** + * Reloads data in the data sources. + * @param parameters An array of ASPxClientDashboardParameter objects that specify dashboard parameters on the client side. + */ + ReloadData(parameters: ASPxClientDashboardParameter[]): void; + /** + * Returns dashboard parameter settings and metadata. + */ + GetParameters(): ASPxClientDashboardParameters; + /** + * Locks the EndUpdateParameters method call. + */ + BeginUpdateParameters(): void; + /** + * Unlocks the BeginUpdateParameters method and applies changes made to the parameter settings. + */ + EndUpdateParameters(): void; + /** + * Returns the currently selected range in the specified Range Filter dashboard item. + * @param itemName A String value that specifies the component name of the Range Filter dashboard item. + */ + GetCurrentRange(itemName: string): ASPxClientDashboardRangeFilterSelection; + /** + * Returns the visible range for the specified Range Filter dashboard item. + * @param itemName A String value that specifies the component name of the Range Filter dashboard item. + */ + GetEntireRange(itemName: string): ASPxClientDashboardRangeFilterSelection; + /** + * Selects the required range in the specified Range Filter dashboard item. + * @param itemName A String that specifies the component name of the Range Filter dashboard item. + * @param range A String value that specifies the component name of the Range Filter dashboard item. + */ + SetRange(itemName: string, range: ASPxClientDashboardRangeFilterSelection): void; + /** + * Selects the specified range in the specified Range Filter dashboard item. + * @param itemName A String that specifies the component name of the Range Filter dashboard item. + * @param dateTimePeriodName A String that specifies the name of the predefined range used to perform a selection. + */ + SetRange(itemName: string, dateTimePeriodName: string): void; + /** + * Returns axis point tuples identifying elements that can be used to perform drill-down in the specified dashboard item. + * @param itemName A String that is the component name of the dashboard item. + */ + GetAvailableDrillDownValues(itemName: string): ASPxClientDashboardItemDataAxisPointTuple[]; + /** + * Returns the axis point tuple identifying the current drill-down state. + * @param itemName A String that is the component name of the dashboard item. + */ + GetCurrentDrillDownValues(itemName: string): ASPxClientDashboardItemDataAxisPointTuple; + /** + * Returns axis point tuples identifying elements that can be selected in the current state of the master filter item. + * @param itemName A String that is the component name of the master filter item. + */ + GetAvailableFilterValues(itemName: string): ASPxClientDashboardItemDataAxisPointTuple[]; + /** + * Returns axis point tuples identifying currently selected elements in the master filter item. + * @param itemName A String that is the component name of the master filter item. + */ + GetCurrentFilterValues(itemName: string): ASPxClientDashboardItemDataAxisPointTuple[]; + /** + * Returns currently selected elements in the master filter item. + * @param itemName A String that specifies a component name of the master filter item. + */ + GetCurrentSelection(itemName: string): ASPxClientDashboardItemDataAxisPointTuple[]; + /** + * Requests underlying data for the specified dashboard item. + * @param itemName A String that specifies the component name of the dashboard item. + * @param args A ASPxClientDashboardItemRequestUnderlyingDataParameters object containing parameters used to obtain the underlying data. + * @param onCompleted A ASPxClientDashboardItemRequestUnderlyingDataCompleted object that references a method executed after the request is completed. + */ + RequestUnderlyingData(itemName: string, args: ASPxClientDashboardItemRequestUnderlyingDataParameters, onCompleted: ASPxClientDashboardItemRequestUnderlyingDataCompleted): void; + /** + * Invokes the Dashboard Parameters dialog. + */ + ShowParametersDialog(): void; + /** + * Closes the Dashboard Parameters dialog. + */ + HideParametersDialog(): void; + /** + * Returns settings that specify parameters affecting how the dashboard is exported. + */ + GetExportOptions(): ASPxClientDashboardExportOptions; + /** + * Specifies settings that specify parameters affecting how the dashboard is exported. + * @param options A ASPxClientDashboardExportOptions object containing settings that specify parameters affecting how the dashboard is exported. + */ + SetExportOptions(options: ASPxClientDashboardExportOptions): void; + /** + * Exports a dashboard to a PDF file and writes it to the Response. + */ + ExportToPdf(): void; + /** + * Exports a dashboard to a PDF file with the specified export options and writes it to the Response. + * @param options A ASPxClientDashboardExportOptions object containing settings that specify parameters affecting how the dashboard is exported. + */ + ExportToPdf(options: ASPxClientDashboardExportOptions): void; + /** + * Exports a dashboard to an Image file and writes it to the Response. + */ + ExportToImage(): void; + /** + * Exports a dashboard to an Image file with the specified export options and writes it to the Response. + * @param options A ASPxClientDashboardExportOptions object containing settings that specify parameters affecting how the dashboard is exported. + */ + ExportToImage(options: ASPxClientDashboardExportOptions): void; + /** + * Exports a dashboard item to a PDF file and writes it to the Response. + * @param itemName A String that is the component name of the dashboard item to be exported. + */ + ExportDashboardItemToPdf(itemName: string): void; + /** + * Exports a dashboard item to a PDF file with the specified export options and writes it to the Response. + * @param itemName A String that is the component name of the dashboard item to be exported. + * @param options An ASPxClientDashboardExportOptions object containing export options to be applied to the exported dashboard item. + */ + ExportDashboardItemToPdf(itemName: string, options: ASPxClientDashboardExportOptions): void; + /** + * Exports a dashboard item to an Image file and writes it to the Response. + * @param itemName A String that is the component name of the dashboard item to be exported. + */ + ExportDashboardItemToImage(itemName: string): void; + /** + * Exports a dashboard item to an Image file with the specified export options and writes it to the Response. + * @param itemName A String that is the component name of the dashboard item to be exported. + * @param options An ASPxClientDashboardExportOptions object containing export options to be applied to the exported dashboard item. + */ + ExportDashboardItemToImage(itemName: string, options: ASPxClientDashboardExportOptions): void; + /** + * Exports a dashboard item to an Excel file and writes it to the Response. + * @param itemName A String that is the component name of the dashboard item to be exported. + */ + ExportDashboardItemToExcel(itemName: string): void; + /** + * Exports a dashboard item to an Excel file with the specified export options and writes it to the Response. + * @param itemName A String that is the component name of the dashboard item to be exported. + * @param options An ASPxClientDashboardExportOptions object containing export options to be applied to the exported dashboard item. + */ + ExportDashboardItemToExcel(itemName: string, options: ASPxClientDashboardExportOptions): void; + /** + * Returns the dashboard width. + */ + GetWidth(): number; + /** + * Returns the dashboard height. + */ + GetHeight(): number; + /** + * Specifies the dashboard width. + * @param width An integer value that specifies the dashboard width. + */ + SetWidth(width: number): void; + /** + * Specifies the dashboard height. + * @param height An integer value that specifies the dashboard height. + */ + SetHeight(height: number): void; + /** + * Specifies the dashboard size. + * @param width An integer value that specifies the dashboard width. + * @param height An integer value that specifies the dashboard height. + */ + SetSize(width: number, height: number): void; + /** + * Selects required elements by their values in the specified master filter item. + * @param itemName A String that species the component name of the master filter item. + * @param values Values that will be used to select elements in the master filter item. + */ + SetMasterFilter(itemName: string, values: Object[][]): void; + /** + * Selects the required elements in the specified master filter item. + * @param itemName A String that specifies the component name of the master filter item. + * @param axisPointTuples An array of ASPxClientDashboardItemDataAxisPointTuple objects used to identify master filter elements. + */ + SetMasterFilter(itemName: string, axisPointTuples: ASPxClientDashboardItemDataAxisPointTuple[]): void; + /** + * Performs a drill-down for the required element by its value. + * @param itemName A String that species the component name of the dashboard item. + * @param value A value that will be used to perform a drill-down for the required element. + */ + PerformDrillDown(itemName: string, value: Object): void; + /** + * Performs a drill-down for the required element. + * @param itemName A String that specifies the component name of the dashboard item. + * @param axisPointTuple A ASPxClientDashboardItemDataAxisPointTuple object representing a set of axis points. + */ + PerformDrillDown(itemName: string, axisPointTuple: ASPxClientDashboardItemDataAxisPointTuple): void; + /** + * Clears the specified master filter item. + * @param itemName A String that specifies the component name of the master filter item. + */ + ClearMasterFilter(itemName: string): void; + /** + * Performs a drill-up for the specified dashboard item. + * @param itemName A String that specifies the component name of the dashboard item. + */ + PerformDrillUp(itemName: string): void; + /** + * Returns whether or not the specified master filter item allows selecting one or more elements. + * @param itemName A String that specifies the component name of the master filter item. + */ + CanSetMasterFilter(itemName: string): boolean; + /** + * Returns whether or not the specified master filter can be cleared in the current state. + * @param itemName A String that specifies the component name of the master filter item. + */ + CanClearMasterFilter(itemName: string): boolean; + /** + * Returns whether or not drill down is possible in the current state of the specified dashboard item. + * @param itemName A String that specifies the component name of the dashboard item. + */ + CanPerformDrillDown(itemName: string): boolean; + /** + * Returns whether or not drill up is possible in the current state of the specified dashboard item. + * @param itemName A String that specifies the component name of the dashboard item. + */ + CanPerformDrillUp(itemName: string): boolean; + /** + * Returns the client data for the specified dashboard item. + * @param itemName A String that specifies the component name of the dashboard item. + */ + GetItemData(itemName: string): ASPxClientDashboardItemData; +} +/** + * A range in the Range Filter dashboard item. + */ +interface ASPxClientDashboardRangeFilterSelection { + /** + * Gets or sets a maximum value in the range of the Range Filter dashboard item. + * Value: A maximum value in the range of the Range Filter dashboard item. + */ + Maximum: Object; + /** + * Gets or sets a minimum value in the range of the Range Filter dashboard item. + * Value: A minimum value in the range of the Range Filter dashboard item. + */ + Minimum: Object; +} +/** + * A collection of ASPxClientDashboardParameter objects. + */ +interface ASPxClientDashboardParameters { + /** + * Returns an array of dashboard parameters from the ASPxClientDashboardParameters collection. + */ + GetParameterList(): ASPxClientDashboardParameter[]; + /** + * Returns a dashboard parameter by its name. + * @param name A String object that specifies the parameter name. + */ + GetParameterByName(name: string): ASPxClientDashboardParameter; + /** + * Returns a dashboard parameter by its index in the ASPxClientDashboardParameters collection. + * @param index An integer value that specifies the parameter index. + */ + GetParameterByIndex(index: number): ASPxClientDashboardParameter; +} +/** + * A client-side dashboard parameter. + */ +interface ASPxClientDashboardParameter { + /** + * Gets the dashboard parameter name on the client side. + * Value: A String that is the dashboard parameter name on the client side. + */ + Name: string; + /** + * Gets the dashboard parameter value on the client side. + * Value: A String that specifies the dashboard parameter value on the client side. + */ + Value: Object; + /** + * Returns a parameter name. + */ + GetName(): string; + /** + * Returns a current parameter value. + */ + GetValue(): Object; + /** + * Specifies the current parameter value. + * @param value The current parameter value. + */ + SetValue(value: Object): void; + /** + * Returns a default parameter value. + */ + GetDefaultValue(): Object; + /** + * Returns the parameter's description displayed to an end-user. + */ + GetDescription(): string; + /** + * Returns a parameter type. + */ + GetType(): string; + /** + * Returns possible parameter values. + */ + GetValues(): ASPxClientDashboardParameterValue[]; +} +/** + * Provides access to the parameter value and display text. + */ +interface ASPxClientDashboardParameterValue { + /** + * Returns the parameter display text. + */ + GetDisplayText(): string; + /** + * Returns a parameter value. + */ + GetValue(): Object; +} +/** + * Contains settings that specify parameters affecting how the dashboard or dashboard item is exported in Image format. + */ +interface ImageFormatOptions { + /** + * Gets or sets an image format in which the dashboard (dashboard item) is exported. + * Value: A value returned by the DashboardExportImageFormat class that specifies an image format in which the dashboard (dashboard item) is exported. + */ + Format: string; + /** + * Gets or sets the resolution (in dpi) used to export a dashboard (dashboard item) in Image format. + * Value: An integer value that specifies the resolution (in dpi) used to export a dashboard (dashboard item) in Image format. + */ + Resolution: number; +} +/** + * Contains options which define how the dashboard item is exported to Excel format. + */ +interface ExcelFormatOptions { + /** + * Gets or sets the Excel format in which the dashboard item is exported. + * Value: A value returned by the DashboardExportExcelFormat class that specifies the Excel format in which the dashboard item is exported. + */ + Format: string; + /** + * Gets or sets a character used to separate values in a CSV document. + * Value: A String value that specifies the character used to separate values in a CSV document. + */ + CsvValueSeparator: string; +} +/** + * Contains settings that specify parameters affecting how the Grid dashboard item is exported. + */ +interface GridExportOptions { + /** + * Gets or sets whether the size of the Grid dashboard item is changed according to the width of the exported page. + * Value: true, to change the size of the Grid dashboard item according to the width of the exported page; otherwise, false. + */ + FitToPageWidth: boolean; + /** + * Gets or sets whether to print column headers of the Grid dashboard item on every page. + * Value: true, to print column headers on every page; otherwise, false. + */ + PrintHeadersOnEveryPage: boolean; +} +/** + * Contains settings that specify parameters affecting how the Pivot dashboard item is exported. + */ +interface PivotExportOptions { + /** + * Gets or sets whether to print the column headers of the pivot dashboard item on every page. + * Value: true, to print column headers on every page; otherwise, false. + */ + PrintHeadersOnEveryPage: boolean; +} +/** + * Contains settings that specify parameters affecting how the Pie dashboard item is exported. + */ +interface PieExportOptions { + /** + * Gets or sets whether dashboard item elements are arranged automatically on the exported page. + * Value: true, to arrange dashboard item elements automatically on the exported page; otherwise, false. + */ + AutoArrangeContent: boolean; +} +/** + * Contains settings that specify parameters affecting how the Gauge dashboard item is exported. + */ +interface GaugeExportOptions { + /** + * Gets or sets whether dashboard item elements are arranged automatically on the exported page. + * Value: true, to arrange dashboard item elements automatically on the exported page; otherwise, false. + */ + AutoArrangeContent: boolean; +} +/** + * Contains settings that specify parameters affecting how the Card dashboard item is exported. + */ +interface CardExportOptions { + /** + * Gets or sets whether dashboard item elements are arranged automatically on the exported page. + * Value: true, to arrange dashboard item elements automatically on the exported page; otherwise, false. + */ + AutoArrangeContent: boolean; +} +/** + * Contains settings that specify parameters affecting how the Range Filter dashboard item is exported. + */ +interface RangeFilterExportOptions { + /** + * Gets or sets whether the page orientation used to export a Range Filter dashboard item is selected automatically. + * Value: true, to automatically select the page orientation used to export a Range Filter dashboard item; otherwise, false. + */ + AutomaticPageLayout: boolean; + /** + * Gets or sets the export size mode for the Range Filter dashboard item. + * Value: A value returned by the RangeFilterExportSizeMode class that specifies the export size mode for the Range Filter dashboard item. + */ + SizeMode: string; +} +/** + * Contains settings that specify parameters affecting how Chart dashboard items are exported. + */ +interface ChartExportOptions { + /** + * Gets or sets whether the page orientation used to export a Chart dashboard item is selected automatically. + * Value: true, to automatically select the page orientation used to export a Chart dashboard item; otherwise, false. + */ + AutomaticPageLayout: boolean; + /** + * Gets or sets the export size mode for the Chart dashboard item. + * Value: A value returned by the ChartExportSizeMode class that specifies the export size mode for the Chart dashboard item. + */ + SizeMode: string; +} +/** + * Contains settings that specify parameters affecting how map dashboard items are exported. + */ +interface MapExportOptions { + /** + * Gets or sets whether the page orientation used to export a map dashboard item is selected automatically. + * Value: true, to automatically select the page orientation used to export a map dashboard item; otherwise, false. + */ + AutomaticPageLayout: boolean; + /** + * Gets or sets the export size mode for the map dashboard item. + * Value: A value returned by the MapExportSizeMode class that specifies specifies the export size mode for the map dashboard item. + */ + SizeMode: string; +} +/** + * Contains settings that specify parameters affecting how the dashboard (dashboard item) is exported. + */ +interface ASPxClientDashboardExportOptions { + /** + * Gets or sets the standard paper size. + * Value: A string value returned by the DashboardExportPaperKind class that specifies the standard paper size. + */ + PaperKind: string; + /** + * Gets or sets the page orientation used to export a dashboard (dashboard item). + * Value: A string value returned by the DashboardExportPageLayout class that specifies the page orientation used to export a dashboard (dashboard item). + */ + PageLayout: string; + /** + * Gets or sets the mode for scaling when exporting a dashboard (dashboard item). + * Value: A string value returned by the DashboardExportScaleMode class that specifies the mode for scaling when exporting a dashboard (dashboard item). + */ + ScaleMode: string; + /** + * Gets or sets the scale factor (in fractions of 1) by which a dashboard (dashboard item) is scaled. + * Value: A Single value that specifies the scale factor by which a dashboard (dashboard item) is scaled. + */ + ScaleFactor: number; + /** + * Gets or sets the number of horizontal/vertical pages spanning the total width/height of a dashboard (dashboard item). + * Value: An integer value that specifies the number of horizontal/vertical pages spanning the total width/height of a dashboard (dashboard item). + */ + AutoFitPageCount: number; + /** + * Gets or sets the title of the exported document. + * Value: A String value that specifies the title of the exported document. + */ + Title: string; + /** + * Gets or sets whether a dashboard title (or dashboard item's caption) is included as the exported document title. + * Value: A DefaultBoolean value that specifies whether a dashboard title (or dashboard item's caption) is included as the exported document title. + */ + ShowTitle: boolean; + /** + * Gets or sets the filter state's location on the exported document. + * Value: A string value returned by the DashboardExportFilterState class that specifies the filter state's location on the exported document. + */ + FilterState: string; + /** + * Provides access to options for exporting a dashboard or individual items in Image format. + * Value: An ImageFormatOptions object containing settings that specify parameters affecting how the dashboard or dashboard item is exported in Image format. + */ + ImageOptions: ImageFormatOptions; + /** + * Provides access to options for exporting individual dashboard items in Excel format. + * Value: An ExcelFormatOptions object containing settings that specify parameters affecting how the dashboard item is exported in Excel format. + */ + ExcelOptions: ExcelFormatOptions; + /** + * Provides access to options for exporting a Grid dashboard item. + * Value: A GridExportOptions object containing settings that specify parameters that affect how Grid dashboard items are exported. + */ + GridOptions: GridExportOptions; + /** + * Provides access to options for exporting a Pivot dashboard item. + * Value: A PivotExportOptions object containing settings that specify parameters that affect how Pivot dashboard items are exported. + */ + PivotOptions: PivotExportOptions; + /** + * Provides access to options for exporting a Pie dashboard item. + * Value: A PieExportOptions object containing settings that specify parameters that affect how Pie dashboard items are exported. + */ + PieOptions: PieExportOptions; + /** + * Provides access to options for exporting a Gauge dashboard item. + * Value: A GaugeExportOptions object containing settings that specify parameters that affect how Gauge dashboard items are exported. + */ + GaugeOptions: GaugeExportOptions; + /** + * Provides access to options for exporting a Card dashboard item. + * Value: A CardExportOptions object containing settings that specify parameters that affect how Card dashboard items are exported. + */ + CardOptions: CardExportOptions; + /** + * Provides access to options for exporting a Range Filter dashboard item. + * Value: A RangeFilterExportOptions object containing settings that specify parameters affecting how the Range Filter dashboard item is exported. + */ + RangeFilterOptions: RangeFilterExportOptions; + /** + * Provides access to options for exporting a Chart dashboard item. + * Value: A ChartExportOptions object containing settings that specify parameters that affect how Chart dashboard items are exported. + */ + ChartOptions: ChartExportOptions; + /** + * Provides access to options for exporting map dashboard items. + * Value: A MapExportOptions object containing settings that specify parameters that affect how map dashboard items are exported. + */ + MapOptions: MapExportOptions; +} +/** + * References a method that will handle the ActionAvailabilityChanged event. + */ +interface ASPxClientDashboardActionAvailabilityChangedEventHandler { + /** + * References a method that will handle the ActionAvailabilityChanged event. + * @param source The event source. + * @param e A ASPxClientDashboardActionAvailabilityChangedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardActionAvailabilityChangedEventArgs): void; +} +/** + * Provides data for the ActionAvailabilityChanged event. + */ +interface ASPxClientDashboardActionAvailabilityChangedEventArgs extends ASPxClientEventArgs { + /** + * Gets whether or not data reloading is available in the current state of dashboard item. + * Value: true, if data reloading is available in the current state of dashboard item; otherwise, false. + */ + IsReloadDataAvailable: boolean; + /** + * Gets interactivity actions currently available for the dashboard item. + * Value: An array of ASPxClientDashboardItemAction objects that represent interactivity actions currently available for the dashboard item. + */ + ItemActions: ASPxClientDashboardItemAction[]; +} +/** + * References a method that will handle the DataLoadingError event. + */ +interface ASPxClientDashboardDataLoadingErrorEventHandler { + /** + * References a method that will handle the DataLoadingError event. + * @param source The event source. + * @param e A ASPxClientDashboardDataLoadingErrorEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardDataLoadingErrorEventArgs): void; +} +/** + * Provides data for the DataLoadingError event. + */ +interface ASPxClientDashboardDataLoadingErrorEventArgs extends ASPxClientEventArgs { + /** + * Allows you to determine whether or not the error message will be shown. + */ + IsErrorMessageShown(): boolean; + /** + * Allows you to specify whether to show the error message. + * @param value true, to show the error message; otherwise, false. + */ + ShowErrorMessage(value: boolean): void; + /** + * Allows you to obtain the displayed error message. + */ + GetError(): string; + /** + * Allows you to specify the displayed error message. + * @param value A string value that specifies the displayed error message. + */ + SetError(value: string): void; +} +/** + * Represents an interactivity action in the dashboard item. + */ +interface ASPxClientDashboardItemAction { + /** + * Gets the name of the dashboard item. + * Value: A String that specifies the name of the dashboard item. + */ + ItemName: string; + /** + * Gets interactivity actions performed on a dashboard item. + * Value: An array of ASPxClientDashboardAction values that specify interactivity actions performed on a dashboard item. + */ + Actions: any[]; +} +declare enum ASPxClientDashboardAction { + SetMasterFilter=0, + ClearMasterFilter=1, + DrillDown=2, + DrillUp=3 +} +/** + * References a method that will handle the MasterFilterSet event. + */ +interface ASPxClientDashboardMasterFilterSetEventHandler { + /** + * References a method that will handle the MasterFilterSet event. + * @param source The event source. + * @param e A ASPxClientDashboardMasterFilterSetEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardMasterFilterSetEventArgs): void; +} +/** + * Provides data for the MasterFilterSet event. + */ +interface ASPxClientDashboardMasterFilterSetEventArgs extends ASPxClientEventArgs { + /** + * Gets the name of the dashboard item. + * Value: A String that specifies the name of the dashboard item. + */ + ItemName: string; + /** + * Gets values of currently selected elements in the master filter item. + * Value: Values of currently selected elements in the master filter item. + */ + Values: Object[][]; + /** + * Returns whether or not the specified value is NullValue. + * @param value The specified value. + */ + IsNullValue(value: Object): boolean; + /** + * Returns whether or not the specified value is OthersValue. + * @param value The specified value. + */ + IsOthersValue(value: Object): boolean; +} +/** + * References a method that will handle the MasterFilterCleared event. + */ +interface ASPxClientDashboardMasterFilterClearedEventHandler { + /** + * References a method that will handle the MasterFilterCleared event. + * @param source The event source. + * @param e A ASPxClientDashboardMasterFilterClearedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardMasterFilterClearedEventArgs): void; +} +/** + * Provides data for the MasterFilterCleared event. + */ +interface ASPxClientDashboardMasterFilterClearedEventArgs extends ASPxClientEventArgs { + /** + * Gets the name of the dashboard item. + * Value: A String that is the name of the dashboard item. + */ + ItemName: string; +} +/** + * References a method that will handle the DrillDownPerformed event. + */ +interface ASPxClientDashboardDrillDownPerformedEventHandler { + /** + * References a method that will handle the DrillDownPerformed event. + * @param source The event source. + * @param e A ASPxClientDashboardDrillDownPerformedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardDrillDownPerformedEventArgs): void; +} +/** + * Provides data for the DrillDownPerformed event. + */ +interface ASPxClientDashboardDrillDownPerformedEventArgs extends ASPxClientEventArgs { + /** + * Gets the name of the dashboard item. + * Value: A String that specifies the name of the dashboard item. + */ + ItemName: string; + /** + * Gets the bottommost value from the current drill-down hierarchy. + * Value: The bottommost value from the current drill-down hierarchy. + */ + Value: Object[]; + /** + * Returns whether or not the specified value is NullValue. + * @param value The specified value. + */ + IsNullValue(value: Object): boolean; + /** + * Returns whether or not the specified value is OthersValue. + * @param value The specified value. + */ + IsOthersValue(value: Object): boolean; +} +/** + * References a method that will handle the DrillUpPerformed event. + */ +interface ASPxClientDashboardDrillUpPerformedEventHandler { + /** + * References a method that will handle the DrillUpPerformed event. + * @param source The event source. + * @param e A ASPxClientDashboardDrillUpPerformedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardDrillUpPerformedEventArgs): void; +} +/** + * Provides data for the DrillUpPerformed event. + */ +interface ASPxClientDashboardDrillUpPerformedEventArgs extends ASPxClientEventArgs { + /** + * Gets the name of the dashboard item. + * Value: A String that is the name of the dashboard item. + */ + ItemName: string; +} +/** + * Serves as the base object for all the editors included in the client-side object model. + */ +interface ASPxClientEditBase extends ASPxClientControl { + /** + * Returns the editor's value. + */ + GetValue(): Object; + /** + * Changes the editor's value. + * @param value An object representing the data to be assigned to the editor's edit value. + */ + SetValue(value: Object): void; + /** + * Returns a value indicating whether an editor is enabled. + */ + GetEnabled(): boolean; + /** + * Specifies whether an editor is enabled. + * @param value true to enable the editor; otherwise, false. + */ + SetEnabled(value: boolean): void; + /** + * Returns the text displayed in the editor caption. + */ + GetCaption(): string; + /** + * Specifies the text displayed in the editor caption. + * @param caption A string value specifying the editor caption. + */ + SetCaption(caption: string): void; +} +/** + * Serves as the base object for all the editors that support validation. + */ +interface ASPxClientEdit extends ASPxClientEditBase { + /** + * Fires on the client side when the editor receives input focus. + */ + GotFocus: ASPxClientEvent>; + /** + * Fires on the client side when the editor loses input focus. + */ + LostFocus: ASPxClientEvent>; + /** + * Allows you to specify whether the value entered into the editor is valid, and whether the editor is allowed to lose focus. + */ + Validation: ASPxClientEvent>; + /** + * Fires after the editor's value has been changed by end-user interactions. + */ + ValueChanged: ASPxClientEvent>; + /** + * Returns an HTML element that represents the control's input element. + */ + GetInputElement(): Object; + /** + * Sets input focus to the editor. + */ + Focus(): void; + /** + * Gets a value that indicates whether the editor's value passes validation. + */ + GetIsValid(): boolean; + /** + * Gets the error text to be displayed within the editor's error frame if the editor's validation fails. + */ + GetErrorText(): string; + /** + * Sets a value that specifies whether the editor's value is valid. + * @param isValid True if the editor's value is valid; otherwise, False. + */ + SetIsValid(isValid: boolean): void; + /** + * Sets the error text to be displayed within the editor's error frame if the editor's validation fails. + * @param errorText A string value representing the error text. + */ + SetErrorText(errorText: string): void; + /** + * Performs the editor's validation. + */ + Validate(): void; +} +/** + * Represents the client-side equivalent of the ASPxBinaryImage control. + */ +interface ASPxClientBinaryImage extends ASPxClientEdit { + /** + * Occurs on the client side after an image is clicked. + */ + Click: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client side if any server error occurs during server-side processing of a callback sent by the ASPxClientBinaryImage. + */ + CallbackError: ASPxClientEvent>; + /** + * Sets the size of the image editor. + * @param width An integer value that specifies the control's width. + * @param height An integer value that specifies the control's height. + */ + SetSize(width: number, height: number): void; + /** + * For internal use only. + */ + GetValue(): Object; + /** + * For internal use only. + * @param value + */ + SetValue(value: Object): void; + /** + * Removes an image from the editor content. + */ + Clear(): void; + /** + * Returns a name of the last uploaded file. + */ + GetUploadedFileName(): string; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param parameter A string value that contains any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(parameter: string): void; + /** + * + * @param parameter + * @param onSuccess + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; +} +/** + * Represents the client-side equivalent of the ASPxButton control. + */ +interface ASPxClientButton extends ASPxClientControl { + /** + * Occurs on the client side when the button's checked state is changed. + */ + CheckedChanged: ASPxClientEvent>; + /** + * Fires on the client side when the button receives input focus. + */ + GotFocus: ASPxClientEvent>; + /** + * Fires on the client side when the button loses input focus. + */ + LostFocus: ASPxClientEvent>; + /** + * Occurs on the client side after a button is clicked. + */ + Click: ASPxClientEvent>; + /** + * Simulates a mouse click action on the button control. + */ + DoClick(): void; + /** + * Returns a value indicating whether the button is checked. + */ + GetChecked(): boolean; + /** + * Sets a value that specifies the button's checked status. + * @param value true if the button is checked; otherwise, false. + */ + SetChecked(value: boolean): void; + /** + * Returns the text displayed within the button. + */ + GetText(): string; + /** + * Sets the text to be displayed within the button. + * @param value A string value specifying the text to be displayed within the button. + */ + SetText(value: string): void; + /** + * Returns the URL pointing to the image displayed within the button. + */ + GetImageUrl(): string; + /** + * Sets the URL pointing to the image displayed within the button. + * @param value A string value that is the URL to the image displayed within the button. + */ + SetImageUrl(value: string): void; + /** + * Sets a value specifying whether the button is enabled. + * @param value true to enable the button; false to disable it. + */ + SetEnabled(value: boolean): void; + /** + * Returns a value indicating whether the button is enabled. + */ + GetEnabled(): boolean; + /** + * Sets input focus to the button. + */ + Focus(): void; +} +/** + * A method that will handle the client Click event. + */ +interface ASPxClientButtonClickEventHandler { + /** + * A method that will handle the client Click event. + * @param source An object that is the event's source. + * @param e An ASPxClientButtonClickEventArgs object that contains event data. + */ + (source: S, e: ASPxClientButtonClickEventArgs): void; +} +/** + * Provides data for the Click event. + */ +interface ASPxClientButtonClickEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Specifies whether both the event's default action and the event's bubbling upon the hierarchy of event handlers should be canceled. + * Value: true to cancel the event's default action and the event's bubbling upon the hierarchy of event handlers; otherwise, false. + */ + cancelEventAndBubble: boolean; +} +/** + * Represents the client-side equivalent of the ASPxCalendar control. + */ +interface ASPxClientCalendar extends ASPxClientEdit { + /** + * Fires on the client side after the selected date has been changed within the calendar. + */ + SelectionChanged: ASPxClientEvent>; + /** + * Occurs on the client side when the month displayed within the calendar is changed. + */ + VisibleMonthChanged: ASPxClientEvent>; + /** + * Allows you to disable the calendar's days. + */ + CustomDisabledDate: ASPxClientEvent>; + /** + * Occurs on the client-side when an end-user presses a key while the editor has focus. + */ + KeyDown: ASPxClientEvent>; + /** + * Occurs on the client-side when an end-user presses and releases a key while the editor has focus. + */ + KeyPress: ASPxClientEvent>; + /** + * Occurs on the client-side when an end-user releases a pressed key while the editor has focus. + */ + KeyUp: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after the callback server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientCalendar. + */ + CallbackError: ASPxClientEvent>; + /** + * Tests whether the specified date is selected. + * @param date A date-time value that specifies the date to test. + */ + IsDateSelected(date: Date): boolean; + /** + * Sets the date that specifies the month and year to be displayed in the calendar. + * @param date The date that specifies calendar's visible month and year. + */ + SetVisibleDate(date: Date): void; + /** + * Sets the calendar's selected date. + * @param date A date object that specifies the calendar's selected date. + */ + SetSelectedDate(date: Date): void; + /** + * Returns the calendar's selected date. + */ + GetSelectedDate(): Date; + /** + * Gets the date that determines the month and year that are currently displayed in the calendar. + */ + GetVisibleDate(): Date; + /** + * Selects the specified date within the calendar. + * @param date A date-time value that specifies the selected date. + */ + SelectDate(date: Date): void; + /** + * Selects the specified range of dates within the calendar. + * @param start A date-time value that specifies the range's first date. + * @param end A date-time value that specifies the range's last date. + */ + SelectRange(start: Date, end: Date): void; + /** + * Deselects the specified date within the calendar. + * @param date A date-time value that specifies the date to deselect. + */ + DeselectDate(date: Date): void; + /** + * Deselects the specified range of dates within the calendar. + * @param start A date-time value that specifies the range's first date. + * @param end A date-time value that specifies the range's last date. + */ + DeselectRange(start: Date, end: Date): void; + /** + * Deselects all the selected dates within the calendar. + */ + ClearSelection(): void; + /** + * Returns a list of dates which are selected within the calendar. + */ + GetSelectedDates(): Date[]; + /** + * Gets the minimum date on the calendar. + */ + GetMinDate(): Date; + /** + * Sets the minimum date of the calendar. + * @param date A DateTime object representing the minimum date. + */ + SetMinDate(date: Date): void; + /** + * Gets the maximum date on the calendar. + */ + GetMaxDate(): Date; + /** + * Sets the maximum date of the calendar. + * @param date A DateTime object representing the maximum date. + */ + SetMaxDate(date: Date): void; +} +/** + * Provides data for the CustomDisabledDate event. + */ +interface ASPxClientCalendarCustomDisabledDateEventArgs extends ASPxClientEventArgs { + /** + * Gets the date processed in the calendar. + * Value: A DateTime value containing processed data. + */ + date: Date; + /** + * Gets or sets a value specifying whether selection of the processed calendar date is disabled. + * Value: true, if the date is disabled; otherwise, false. + */ + isDisabled: boolean; +} +/** + * A method that will handle the client CustomDisabledDate event. + */ +interface ASPxClientCalendarCustomDisabledDateEventHandler { + /** + * A method that will handle the client CustomDisabledDate event. + * @param source The event source. + * @param e An ASPxClientCalendarCustomDisabledDateEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCalendarCustomDisabledDateEventArgs): void; +} +/** + * Represents the client-side equivalent of the ASPxCaptcha control. + */ +interface ASPxClientCaptcha extends ASPxClientControl { + /** + * Sets input focus to the control's text box. + */ + Focus(): void; + /** + * Refreshes the code displayed within the editor's challenge image. + */ + Refresh(): void; +} +/** + * Represents the client-side equivalent of the ASPxCheckBox control. + */ +interface ASPxClientCheckBox extends ASPxClientEdit { + /** + * Occurs on the client side when the editor's checked state is changed. + */ + CheckedChanged: ASPxClientEvent>; + /** + * Returns a value indicating whether the check box editor is checked. + */ + GetChecked(): boolean; + /** + * Sets a value which specifies the checked status of the check box editor. + * @param isChecked true if the check box editor is checked; otherwise, false. + */ + SetChecked(isChecked: boolean): void; + /** + * Returns the text displayed within the editor. + */ + GetText(): string; + /** + * Returns a value which specifies a check box checked state. + */ + GetCheckState(): string; + /** + * Sets a value specifying the state of a check box. + * @param checkState A string value matches one of the CheckState enumeration values. + */ + SetCheckState(checkState: string): void; + /** + * Sets the text to be displayed within the editor. + * @param text A string value specifying the text to be displayed within the editor. + */ + SetText(text: string): void; +} +/** + * Represents the client-side equivalent of the ASPxRadioButton control. + */ +interface ASPxClientRadioButton extends ASPxClientCheckBox { + /** + * Returns a value indicating whether the radio button is checked. + */ + GetChecked(): boolean; + /** + * Sets a value which specifies the radio button's checked status. + * @param isChecked true if the radio button is checked; otherwise, false. + */ + SetChecked(isChecked: boolean): void; +} +/** + * Represents a base for client-side objects which allow single-line text input. + */ +interface ASPxClientTextEdit extends ASPxClientEdit { + /** + * Occurs on the client-side when an end-user presses a key while the editor has focus. + */ + KeyDown: ASPxClientEvent>; + /** + * Occurs on the client-side when an end-user presses and releases a key while the editor has focus. + */ + KeyPress: ASPxClientEvent>; + /** + * Occurs on the client-side when an end-user releases a pressed key while the editor has focus. + */ + KeyUp: ASPxClientEvent>; + /** + * Fires on the client side when the editor's text is changed and focus moves out of the editor by end-user interactions. + */ + TextChanged: ASPxClientEvent>; + /** + * Returns the text displayed within the editor. + */ + GetText(): string; + /** + * Sets the text to be displayed within the editor. + * @param text A string value specifying the text to be displayed within the editor. + */ + SetText(text: string): void; + /** + * Selects all text in the text editor. + */ + SelectAll(): void; + /** + * Sets the caret position within the edited text. + * @param position An integer value that specifies the zero-based index of a text character that shall precede the caret. + */ + SetCaretPosition(position: number): void; + /** + * Selects the specified portion of the editor's text. + * @param startPos A zero-based integer value specifying the selection's starting position. + * @param endPos A zero-based integer value specifying the selection's ending position. + * @param scrollToSelection true to scroll the editor's contents to make the selection visible; otherwise, false. + */ + SetSelection(startPos: number, endPos: number, scrollToSelection: boolean): void; +} +/** + * Represents a base for client-side editors which are capable of displaying and editing text data in their edit regions. + */ +interface ASPxClientTextBoxBase extends ASPxClientTextEdit { +} +/** + * Represents a base for client button editor objects. + */ +interface ASPxClientButtonEditBase extends ASPxClientTextBoxBase { + /** + * Occurs on the client side after an editor button is clicked. + */ + ButtonClick: ASPxClientEvent>; + /** + * Specifies whether the button is visible. + * @param number An integer value specifying the button's index within the Buttons collection. + * @param value true, to make the button visible; otherwise, false. + */ + SetButtonVisible(number: number, value: boolean): void; + /** + * Returns a value specifying whether a button is displayed. + * @param number An integer value specifying the button's index within the Buttons collection. + */ + GetButtonVisible(number: number): boolean; +} +/** + * Represents a base class for the editors that contain a drop down window. + */ +interface ASPxClientDropDownEditBase extends ASPxClientButtonEditBase { + /** + * Occurs on the client-side when the drop down window is opened. + */ + DropDown: ASPxClientEvent>; + /** + * Occurs on the client side when the drop down window is closed. + */ + CloseUp: ASPxClientEvent>; + /** + * Occurs on the client side before the drop down window is closed and allows you to cancel the operation. + */ + QueryCloseUp: ASPxClientEvent>; + /** + * Modifies the size of the drop down window in accordance with its content. + */ + AdjustDropDownWindow(): void; + /** + * Invokes the editor's drop down window. + */ + ShowDropDown(): void; + /** + * Closes the opened drop down window of the editor. + */ + HideDropDown(): void; +} +/** + * Represents the client-side equivalent of the ASPxColorEdit control. + */ +interface ASPxClientColorEdit extends ASPxClientDropDownEditBase { + /** + * Fires after the selected color has been changed within the color editor via end-user interaction. + */ + ColorChanged: ASPxClientEvent>; + /** + * This event is not in effect for the ASPxClientColorEdit. Use the ColorChanged event instead. + */ + TextChanged: ASPxClientEvent>; + /** + * Returns the color editor's value. + */ + GetColor(): string; + /** + * Specifies the color value for the color editor. + * @param value A string value specifying the editor color. + */ + SetColor(value: string): void; + /** + * Indicates whether the automatic color item is selected. + */ + IsAutomaticColorSelected(): boolean; +} +/** + * Represent the client-side equivalent of the ASPxComboBox control. + */ +interface ASPxClientComboBox extends ASPxClientDropDownEditBase { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientComboBox. + */ + CallbackError: ASPxClientEvent>; + /** + * Occurs on the client side after a different item in the list has been selected (focus has been moved from one item to another). + */ + SelectedIndexChanged: ASPxClientEvent>; + /** + * Specifies the text displayed within the editor's edit box. + * @param text A string value specifying the editor's text. + */ + SetText(text: string): void; + /** + * Adds a new item to the editor specifying the item's display text and returns the index of the added item. + * @param text A string value specifying the item's display text. + */ + AddItem(text: string): number; + /** + * Adds a new item to the editor specifying the item's display text and associated value, and returns the index of the added item. + * @param text A string value specifying the item's display text. + * @param value An object specifying the value associated with the item. + */ + AddItem(text: string, value: Object): number; + /** + * Adds a new item to the editor specifying the item's display text, associated value and displayed image, and returns the index of the added item. + * @param text A string value specifying the item's display text. + * @param value An object specifying the value associated with the item. + * @param imageUrl A string value specifying the path to the image displayed by the item. + */ + AddItem(text: string, value: Object, imageUrl: string): number; + /** + * Inserts a new item specified by its display text, associated value and displayed image into the editor's item collection, at the position specified. + * @param index An integer value representing the zero-based index of the position where the item should be inserted. + * @param text A string value specifying the item's display text. + * @param value An object specifying the value associated with the item. + * @param imageUrl A string value specifying the path to the image displayed by the item. + */ + InsertItem(index: number, text: string, value: Object, imageUrl: string): void; + /** + * Inserts a new item specified by its display text and associated value into the editor's item collection, at the position specified. + * @param index An integer value representing the zero-based index of the position where the item should be inserted. + * @param text A string value specifying the item's display text. + * @param value An object specifying the value associated with the item. + */ + InsertItem(index: number, text: string, value: Object): void; + /** + * Inserts a new item specified by its display text into the editor's item collection, at the position specified. + * @param index An integer value representing the zero-based index of the position where the item should be inserted. + * @param text A string value specifying the item's display text. + */ + InsertItem(index: number, text: string): void; + /** + * Removes an item specified by its index from the client list editor. + * @param index An integer value representing the index of the list item to be removed. + */ + RemoveItem(index: number): void; + /** + * Removes all items from the client combo box editor. + */ + ClearItems(): void; + /** + * Prevents the client combobox editor from being rendered until the EndUpdate method is called. + */ + BeginUpdate(): void; + /** + * Re-enables editor render operations after a call to the BeginUpdate method and forces an immediate re-rendering. + */ + EndUpdate(): void; + /** + * Scrolls the editor's item list, so that the specified item becomes visible. + * @param index An integer value that specifies the item's index within the editor's client item list. + */ + MakeItemVisible(index: number): void; + /** + * Returns an item specified by its index within the combo box editor's item collection. + * @param index An integer value specifying the zero-based index of the item to search for. + */ + GetItem(index: number): ASPxClientListEditItem; + /** + * Returns a combo box item by its text. + * @param text A string that specifies the item's text. + */ + FindItemByText(text: string): ASPxClientListEditItem; + /** + * Returns a combo box item by its value. + * @param value An object that specifies the item's value. + */ + FindItemByValue(value: Object): ASPxClientListEditItem; + /** + * Gets the number of items contained in the editor's item collection. + */ + GetItemCount(): number; + /** + * Returns the index of the selected item within the combo box editor. + */ + GetSelectedIndex(): number; + /** + * Sets the combobox editor's selected item specified by its index. + * @param index An integer value specifying the zero-based index of the item to select. + */ + SetSelectedIndex(index: number): void; + /** + * Returns the combo box editor's selected item. + */ + GetSelectedItem(): ASPxClientListEditItem; + /** + * Sets the list editor's selected item. + * @param item An ASPxClientListEditItem object that specifies the item to select. + */ + SetSelectedItem(item: ASPxClientListEditItem): void; + /** + * Gets the text displayed in the editor's edit box. + */ + GetText(): string; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side Callback event. + */ + PerformCallback(parameter: string): void; + /** + * Adds a new item to the editor, specifying the item's display text, and returns the index of the added item. + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding columns within the editor's Columns collection. + */ + AddItem(texts: string[]): number; + /** + * Adds a new item to the end of the control's items collection. + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding columns within the editor's Columns collection. + * @param value An object that represents the item's associated value. + */ + AddItem(texts: string[], value: Object): number; + /** + * Adds a new item to the end of the control's items collection. + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding columns within the editor's Columns collection. + * @param value An object that represents the item's associated value. + * @param imageUrl A string value specifying the path to the image displayed by the item. + */ + AddItem(texts: string[], value: Object, imageUrl: string): number; + /** + * Adds a new item to the control's items collection at the specified index. + * @param index An integer value that represents the index position. + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding columns within the editor's Columns collection. + * @param value An object that represents the item's associated value. + * @param imageUrl A String value specifying the path to the image displayed by the item. + */ + InsertItem(index: number, texts: string[], value: Object, imageUrl: string): void; + /** + * Adds a new item to the control's items collection at the specified index. + * @param index An integer value that represents the index position. + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding columns within the editor's Columns collection. + * @param value An object that represents the item's associated value. + */ + InsertItem(index: number, texts: string[], value: Object): void; + /** + * Adds a new item to the control's items collection at the specified index. + * @param index An integer value that represents the index position. + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding columns within the editor's Columns collection. + */ + InsertItem(index: number, texts: string[]): void; + /** + * Determines whether the drop-down content is loaded; if not - loads the content. + * @param callbackFunction An object that is the JavaScript function that receives the callback data as a parameter. The function is performed after the combo box content is loaded. + */ + EnsureDropDownLoaded(callbackFunction: Object): void; +} +/** + * Represents the client-side equivalent of the ASPxDateEdit control. + */ +interface ASPxClientDateEdit extends ASPxClientDropDownEditBase { + /** + * Fires after the selected date has been changed within the date editor. + */ + DateChanged: ASPxClientEvent>; + /** + * Enables you to convert the value entered by an end user into the value that will be stored by the date editor. + */ + ParseDate: ASPxClientEvent>; + /** + * Allows you to disable the calendar's days. + */ + CalendarCustomDisabledDate: ASPxClientEvent>; + /** + * This event is not in effect for the ASPxClientDateEdit. Use the DateChanged event instead. + */ + TextChanged: ASPxClientEvent>; + /** + * Returns the calendar of the date editor. + */ + GetCalendar(): ASPxClientCalendar; + /** + * Returns the built-in time edit control. + */ + GetTimeEdit(): ASPxClientTimeEdit; + /** + * Sets the date editor's value. + * @param date A date object specifying the value to assign to the date editor. + */ + SetDate(date: Object): void; + /** + * Returns a date that is the date editor's value. + */ + GetDate(): Object; + /** + * Returns the number of days in a range selected within a date edit. + */ + GetRangeDayCount(): number; + /** + * Gets the minimum date of the editor. + */ + GetMinDate(): Date; + /** + * Sets the minimum date of the editor. + * @param date A DateTime object representing the minimum date. + */ + SetMinDate(date: Date): void; + /** + * Gets the maximum date of the editor. + */ + GetMaxDate(): Date; + /** + * Sets the maximum date of the editor. + * @param date A DateTime object representing the maximum date. + */ + SetMaxDate(date: Date): void; +} +/** + * Provides data for the ParseDate client-side event that parses a string entered into a date editor. + */ +interface ASPxClientParseDateEventArgs extends ASPxClientEventArgs { + /** + * Gets the value entered into the date editor by an end user. + * Value: The string value entered into the date editor by an end user. + */ + value: string; + /** + * Gets or sets the edit value of the date editor. + * Value: A date/time value representing the edit value of the date editor. + */ + date: Date; + /** + * Gets or sets a value specifying whether the event was handled. + * Value: true if the event was handled and default processing should not occur; false if the event should be handled using default processing. + */ + handled: boolean; +} +/** + * A method that will handle the client ParseDate event, that parses a date editor's value when entered. + */ +interface ASPxClientParseDateEventHandler { + /** + * A method that will handle the ParseDate event. + * @param source An object representing the event source. Identifies the button editor that raised the event. + * @param e An ASPxClientParseDateEventArgs object that contains event data. + */ + (source: S, e: ASPxClientParseDateEventArgs): void; +} +/** + * Represents a base for client editor objects realizing the dropdown editor functionality. + */ +interface ASPxClientDropDownEdit extends ASPxClientDropDownEditBase { + /** + * Obtains the key value associated with the text displayed within the editor's edit box. + */ + GetKeyValue(): string; + /** + * Specifies the key value associated with the text displayed within the editor's edit box. + * @param keyValue A string specifying the key value associated with the editor's value (displayed text). + */ + SetKeyValue(keyValue: string): void; +} +/** + * A method that will handle the client events involving a keyboard key being pressed or released. + */ +interface ASPxClientEditKeyEventHandler { + /** + * A method that will handle the client events concerning a keyboard key being pressed. + * @param source The event source. This parameter identifies the editor which raised the event. + * @param e An ASPxClientEditKeyEventArgs object that contains event data. + */ + (source: S, e: ASPxClientEditKeyEventArgs): void; +} +/** + * Provides data for the client events involved with a key being pressed or released. + */ +interface ASPxClientEditKeyEventArgs extends ASPxClientEventArgs { + /** + * Gets a DHTML event object that relates to the processed event. + * Value: An object that maintains DHTML event-specific information. + */ + htmlEvent: Object; +} +/** + * A method that will handle client validation events. + */ +interface ASPxClientEditValidationEventHandler { + /** + * A method that will handle client validation events. + * @param source An object representing the event source. Identifies the button editor that raised the event. + * @param e An ASPxClientEditValidationEventArgs object that contains event data. + */ + (source: S, e: ASPxClientEditValidationEventArgs): void; +} +/** + * Provides data for the client events that are related to data validation (see Validate). + */ +interface ASPxClientEditValidationEventArgs extends ASPxClientEventArgs { + /** + * Gets or sets the error description. + * Value: A string representing the error description. + */ + errorText: string; + /** + * Gets or sets a value specifying whether the validated value is valid. + * Value: true if the value is valid; otherwise, false. + */ + isValid: boolean; + /** + * Gets or sets the editor's value being validated. + * Value: An object that represents the validated value. + */ + value: string; +} +/** + * Represents the client ASPxFilterControl. + */ +interface ASPxClientFilterControl extends ASPxClientControl { + /** + * Occurs after a new filter expression has been applied. + */ + Applied: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientFilterControl. + */ + CallbackError: ASPxClientEvent>; + /** + * Returns the filter expression. + */ + GetFilterExpression(): string; + /** + * Returns the applied filter expression. + */ + GetAppliedFilterExpression(): string; + /** + * Returns the editor used to edit operand values for the specified filter column. + * @param editorIndex An integer value that identifies the filter column by its index within the collection. + */ + GetEditor(editorIndex: number): ASPxClientEditBase; + /** + * Returns a value indicating whether the filter expression being currently composed on the client side is valid - all expression conditions are filled. + */ + IsFilterExpressionValid(): boolean; + /** + * Applies a filter constructed by an end-user. + */ + Apply(): void; + /** + * Resets the current filter expression to a previously applied filter expression. + */ + Reset(): void; +} +/** + * A method that will handle the Applied event. + */ +interface ASPxClientFilterAppliedEventHandler { + /** + * A method that will handle the Applied event. + * @param source The event source. + * @param e An ASPxClientFilterAppliedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFilterAppliedEventArgs): void; +} +/** + * Provides data for the Applied event. + */ +interface ASPxClientFilterAppliedEventArgs extends ASPxClientEventArgs { + /** + * Gets the filter expression currently being applied. + * Value: A string value that specifies the filter expression currently being applied. + */ + filterExpression: string; +} +/** + * Represents a base for client editor objects that display a list of items. + */ +interface ASPxClientListEdit extends ASPxClientEdit { + /** + * Occurs on the client side after a different item in the list has been selected (focus has been moved from one item to another). + */ + SelectedIndexChanged: ASPxClientEvent>; + /** + * Returns the list editor's selected item. + */ + GetSelectedItem(): ASPxClientListEditItem; + /** + * Returns the index of the selected item within the list editor. + */ + GetSelectedIndex(): number; + /** + * Sets the list editor's selected item. + * @param item An ASPxClientListEditItem object that specifies the item to select. + */ + SetSelectedItem(item: ASPxClientListEditItem): void; + /** + * Sets the list editor's selected item specified by its index. + * @param index An integer value specifying the zero-based index of the item to select. + */ + SetSelectedIndex(index: number): void; +} +/** + * Represents the client-side equivalent of the ListEditItem object. + */ +interface ASPxClientListEditItem { + /** + * Gets a value that indicates whether a list edit item is selected. + * Value: true if a list edit item is selected; otherwise, false. + */ + selected: boolean; + /** + * Gets an editor to which the current item belongs. + * Value: An ASPxClientListEdit object that represents the item's owner editor. + */ + listEditBase: ASPxClientListEdit; + /** + * Gets the item's index. + * Value: An integer value that represents the item's index within the corresponding editor's item collection. + */ + index: number; + /** + * Gets the item's associated image. + * Value: A string value that represents the path to the image displayed by the item. + */ + imageUrl: string; + /** + * Gets the item's display text. + * Value: A string value that represents the item's display text. + */ + text: string; + /** + * Gets the item's associated value. + * Value: An object that represents the value associated with the item. + */ + value: Object; + /** + * Returns the list item's value that corresponds to a column specified by its index. + * @param columnIndex An integer value that specifies the column's index within the editor's Columns collection. + */ + GetColumnText(columnIndex: number): string; + /** + * Returns the list item's value that corresponds to a column specified by its field name. + * @param columnName A string value that specifies the column's field name defined via the FieldName property. + */ + GetColumnText(columnName: string): string; +} +/** + * Represents the client-side equivalent of the ASPxListBox control. + */ +interface ASPxClientListBox extends ASPxClientListEdit { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientListBox. + */ + CallbackError: ASPxClientEvent>; + /** + * Occurs on the client side when an end-user presses a key while the editor has focus. + */ + KeyDown: ASPxClientEvent>; + /** + * Occurs on the client side when an end-user presses and releases a key while the editor has focus. + */ + KeyPress: ASPxClientEvent>; + /** + * Occurs on the client side when an end-user releases a pressed key while the editor has focus. + */ + KeyUp: ASPxClientEvent>; + /** + * Occurs on the client side after a different item in the list box has been selected (focus has been moved from one item to another). + */ + SelectedIndexChanged: ASPxClientEvent>; + /** + * Occurs on the client when the editor's item is double clicked. + */ + ItemDoubleClick: ASPxClientEvent>; + /** + * Gets the number of items contained in the editor's item collection. + */ + GetItemCount(): number; + /** + * Returns an item specified by its index within the list box editor's item collection. + * @param index An integer value specifying the zero-based index of the item to search for. + */ + GetItem(index: number): ASPxClientListEditItem; + /** + * Returns an array of the list editor's selected items indices. + */ + GetSelectedIndices(): number[]; + /** + * Returns an array of the list editor's selected items values. + */ + GetSelectedValues(): Object[]; + /** + * Returns an array of the list editor's selected items. + */ + GetSelectedItems(): ASPxClientListEditItem[]; + /** + * Selects all list box items. + */ + SelectAll(): void; + /** + * Unselects all list box items. + */ + UnselectAll(): void; + /** + * Selects the items with the specified indices within a list box. + * @param indices An array of integer values that represent the items indices. + */ + SelectIndices(indices: number[]): void; + /** + * Unselects an array of the list box items with the specified indices. + * @param indices An array of integer values that represent the indices. + */ + UnselectIndices(indices: number[]): void; + /** + * Selects the specified items within a list box. + * @param items An array of ASPxClientListEditItem objects that represent the items. + */ + SelectItems(items: ASPxClientListEditItem[]): void; + /** + * Unselects an array of the specified list box items. + * @param items An array of ASPxClientListEditItem objects that represent the items. + */ + UnselectItems(items: ASPxClientListEditItem[]): void; + /** + * Select the items with the specified values within a list box. + * @param values An array of Object[] objects that represent the item's values. + */ + SelectValues(values: Object[]): void; + /** + * Unselects an array of the list box items with the specified values. + * @param values An array of Object[] objects that represent the values. + */ + UnselectValues(values: Object[]): void; + /** + * Scrolls the editor's item list, so that the specified item becomes visible. + * @param index An integer value that specifies the item's index within the editor's client item list. + */ + MakeItemVisible(index: number): void; + /** + * Initializes the ASPxClientListBox client object when its parent container becomes visible dynamically, on the client side. + */ + InitOnContainerMadeVisible(): void; + /** + * Adds a new item to the editor, specifying the item's display text, and returns the index of the added item. + * @param text A string value specifying the item's display text. + */ + AddItem(text: string): number; + /** + * Adds a new item to the editor, specifying the item's display text and associated value, and returns the index of the added item. + * @param text A string value specifying the item's display text. + * @param value An object specifying the value associated with the item. + */ + AddItem(text: string, value: Object): number; + /** + * Adds a new item to the editor, specifying the item's display text, associated value and displayed image, and returns the index of the added item. + * @param text A string value specifying the item's display text. + * @param value An object specifying the value associated with the item. + * @param imageUrl A string value specifying the path to the image displayed by the item. + */ + AddItem(text: string, value: Object, imageUrl: string): number; + /** + * Inserts a new item specified by its display text, associated value and displayed image into the editor's item collection, at the position specified. + * @param index An integer value representing the zero-based index of the position where the item should be inserted. + * @param text A string value specifying the item's display text. + * @param value An object specifying the value associated with the item. + * @param imageUrl A string value specifying the path to the image displayed by the item. + */ + InsertItem(index: number, text: string, value: Object, imageUrl: string): void; + /** + * Inserts a new item specified by its display text and associated value into the editor's item collection, at the position specified. + * @param index An integer value representing the zero-based index of the position where the item should be inserted. + * @param text A string value specifying the item's display text. + * @param value An object specifying the value associated with the item. + */ + InsertItem(index: number, text: string, value: Object): void; + /** + * Inserts a new item specified by its display text into the editor's item collection, at the position specified. + * @param index An integer value representing the zero-based index of the position where the item should be inserted. + * @param text A string value specifying the item's display text. + */ + InsertItem(index: number, text: string): void; + /** + * Prevents the client list box editor from being rendered until the EndUpdate method is called. + */ + BeginUpdate(): void; + /** + * Re-enables editor render operations after a call to the BeginUpdate method, and forces an immediate re-rendering. + */ + EndUpdate(): void; + /** + * Removes all items from the client list box editor. + */ + ClearItems(): void; + /** + * Removes an item specified by its index from the client list editor. + * @param index An integer value representing the index of the list item to be removed. + */ + RemoveItem(index: number): void; + /** + * Returns a list box item by its text. + * @param text A string that specifies the item's text. + */ + FindItemByText(text: string): ASPxClientListEditItem; + /** + * Returns a list box item by its value. + * @param value An object that specifies the item's value. + */ + FindItemByValue(value: Object): ASPxClientListEditItem; + /** + * Sends a callback to the server, and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side Callback event. + */ + PerformCallback(parameter: string): void; + /** + * Adds a new item to the end of the editor's items collection, specifying the item's display text, and returns the index of the added item. + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding columns within the editor's Columns collection. + */ + AddItem(texts: string[]): number; + /** + * Adds a new item to the end of the control's items collection. + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of corresponding columns within the editor's Columns collection. + * @param value An object that represents the item's associated value. + */ + AddItem(texts: string[], value: Object): number; + /** + * Adds a new item to the end of the editor's items collection, specifying the item's display text, associated value and displayed image, and returns the index of the added item. + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding columns within the editor's Columns collection. + * @param value An object that represents the item's associated value. + * @param imageUrl A String value specifying the path to the image displayed by the item. + */ + AddItem(texts: string[], value: Object, imageUrl: string): number; + /** + * Adds a new item to the control's items collection at the specified index. + * @param index An integer value that represents the index position. + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding columns within the editor's Columns collection. + * @param value An object that represents the item's associated value. + * @param imageUrl A String value specifying the path to the image displayed by the item. + */ + InsertItem(index: number, texts: string[], value: Object, imageUrl: string): void; + /** + * Adds a new item to the control's items collection at the specified index. + * @param index An integer value that represents the index position. + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding columns within the editor's Columns collection. + * @param value An object that represents the item's associated value. + */ + InsertItem(index: number, texts: string[], value: Object): void; + /** + * Adds a new item to the control's items collection at the specified index. + * @param index An integer value that represents the index position. + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding columns within the editor's Columns collection. + */ + InsertItem(index: number, texts: string[]): void; +} +/** + * Serves as the base type for the ASPxClientRadioButtonList objects. + */ +interface ASPxClientCheckListBase extends ASPxClientListEdit { + /** + * Gets the number of items contained in the editor's item collection. + */ + GetItemCount(): number; + /** + * Returns the editor's item specified by its index. + * @param index An integer value specifying the zero-based index of the item to be retrieved. + */ + GetItem(index: number): ASPxClientListEditItem; +} +/** + * Represents the client-side equivalent of the ASPxRadioButtonList control. + */ +interface ASPxClientRadioButtonList extends ASPxClientCheckListBase { +} +/** + * A client-side equivalent of the ASPxCheckBoxList object. + */ +interface ASPxClientCheckBoxList extends ASPxClientCheckListBase { + /** + * Occurs on the client side after a different item in the check box list has been selected (focus has been moved from one item to another). + */ + SelectedIndexChanged: ASPxClientEvent>; + /** + * Returns an array of the check box list editor's selected items indices. + */ + GetSelectedIndices(): number[]; + /** + * Returns an array of the check box list editor's selected items values. + */ + GetSelectedValues(): Object[]; + /** + * Returns an array of the check box list editor's selected items. + */ + GetSelectedItems(): ASPxClientListEditItem[]; + /** + * Selects all check box list items. + */ + SelectAll(): void; + /** + * Unselects all check box list items. + */ + UnselectAll(): void; + /** + * Selects items with the specified indices within a check box list. + * @param indices An array of integer values that are the item indices. + */ + SelectIndices(indices: number[]): void; + /** + * Selects the specified items within a check box list. + * @param items An array of ASPxClientListEditItem objects that are the items. + */ + SelectItems(items: ASPxClientListEditItem[]): void; + /** + * Selects items with the specified values within a check box list. + * @param values An array of Object[] objects that are the item values. + */ + SelectValues(values: Object[]): void; + /** + * Unselects items with the specified indices within a check box list. + * @param indices An array of integer values that are the item indices. + */ + UnselectIndices(indices: number[]): void; + /** + * Unselects the specified items within a check box list. + * @param items An array of ASPxClientListEditItem objects that are the items. + */ + UnselectItems(items: ASPxClientListEditItem[]): void; + /** + * Unselects items with the specified values within a check box list. + * @param values An array of Object[] objects that are the item values. + */ + UnselectValues(values: Object[]): void; +} +/** + * A method that will handle the SelectedIndexChanged event. + */ +interface ASPxClientListEditItemSelectedChangedEventHandler { + /** + * A method that will handle the SelectedIndexChanged event. + * @param source The event source. + * @param e An ASPxClientListEditItemSelectedChangedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientListEditItemSelectedChangedEventArgs): void; +} +/** + * Provides data for the SelectedIndexChanged event. + */ +interface ASPxClientListEditItemSelectedChangedEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the index of the item related to the event. + * Value: An integer value that represents the item's index within the corresponding editor's item collection. + */ + index: number; + /** + * Gets whether the item has been selected. + * Value: true if the item is selected; otherwise, false. + */ + isSelected: boolean; +} +/** + * Represents a client-side equivalent of the ASPxProgressBar control. + */ +interface ASPxClientProgressBar extends ASPxClientEditBase { + /** + * Sets the position of the operation's progress. + * @param position An integer value specifying the progress position. + */ + SetPosition(position: number): void; + /** + * Gets the position of the operation's progress. + */ + GetPosition(): number; + /** + * Sets the pattern used to format the displayed text for the progress bar. + * @param text A value that is the format pattern. + */ + SetCustomDisplayFormat(text: string): void; + /** + * Returns the text displayed within the progress bar. + */ + GetDisplayText(): string; + /** + * Sets the percentage representation of the progress position. + */ + GetPercent(): number; + /** + * Sets the minimum range value of the progress bar. + * @param min An integer value specifying the minimum value of the progress bar range. + */ + SetMinimum(min: number): void; + /** + * Sets the maximum range value of the progress bar. + * @param max An integer value specifying the maximum value of the progress bar range. + */ + SetMaximum(max: number): void; + /** + * Gets the minimum range value of the progress bar. + */ + GetMinimum(): number; + /** + * Gets the maximum range value of the progress bar. + */ + GetMaximum(): number; + /** + * Sets the minimum and maximum range values of the progress bar. + * @param minValue An integer value specifying the minimum value of the progress bar range. + * @param maxValue An integer value specifying the maximum value of the progress bar range. + */ + SetMinMaxValues(minValue: number, maxValue: number): void; +} +/** + * Represents a base class for the ASPxClientSpinEdit object. + */ +interface ASPxClientSpinEditBase extends ASPxClientButtonEditBase { + /** + * This event is not in effect for the ASPxClientSpinEditBase. Use the ASPxClientTimeEdit. + */ + TextChanged: ASPxClientEvent>; +} +/** + * Represents the client-side equivalent of the ASPxSpinEdit control. + */ +interface ASPxClientSpinEdit extends ASPxClientSpinEditBase { + /** + * Occurs on the client side when the editor's value is altered in any way. + */ + NumberChanged: ASPxClientEvent>; + /** + * Specifies the value of the spin edit control on the client side. + * @param number A Decimal value specifying the control value. + */ + SetValue(number: number): void; + /** + * Sets the spin editor's value. + * @param number A decimal number specifying the value to assign to the spin editor. + */ + SetNumber(number: number): void; + /** + * Gets a number which represents the spin editor's value. + */ + GetNumber(): number; + /** + * Returns the text displayed within the editor. + */ + GetText(): string; + /** + * Sets the minimum value of the editor. + * @param value A decimal value specifying the minimum value of the editor. + */ + SetMinValue(value: number): void; + /** + * Gets the minimum value of the editor. + */ + GetMinValue(): number; + /** + * Sets the maximum value of the editor. + * @param value A decimal value specifying the maximum value of the editor. + */ + SetMaxValue(value: number): void; + /** + * Gets the maximum value of the editor. + */ + GetMaxValue(): number; + /** + * Changes the editor's value. + * @param value An object representing the data to be assigned to the editor's edit value. + */ + SetValue(value: Object): void; +} +/** + * Represents the client-side equivalent of the ASPxTimeEdit control. + */ +interface ASPxClientTimeEdit extends ASPxClientSpinEditBase { + /** + * Fires after the selected date has been changed within the time editor. + */ + DateChanged: ASPxClientEvent>; + /** + * Sets the time editor's value. + * @param date A date-time object specifying the value to assign to the time editor. + */ + SetDate(date: Object): void; + /** + * Returns a date that is the time editor's value. + */ + GetDate(): Object; +} +/** + * Represents a base for client-side static editors whose values cannot be visually changed by end users. + */ +interface ASPxClientStaticEdit extends ASPxClientEditBase { + /** + * Occurs on the client side after an end-user clicks within a static editor. + */ + Click: ASPxClientEvent>; +} +/** + * A method that will handle client-side events which concern clicking within editors. + */ +interface ASPxClientEditEventHandler { + /** + * A method that will handle client-side events which concern clicking within editors. + * @param source An object representing the event source. Identifies the editor that raised the event. + * @param e An ASPxClientEditClickEventArgs object that contains event data. + */ + (source: S, e: ASPxClientEditClickEventArgs): void; +} +/** + * Provides data for the client-side events which concern clicking within editors. + */ +interface ASPxClientEditClickEventArgs extends ASPxClientEventArgs { + /** + * Gets the HTML element related to the event. + * Value: An object that represents the clicked HTML element. + */ + htmlElement: Object; + /** + * Gets a DHTML event object that relates to the processed event. + * Value: An object that maintains DHTML event-specific information. + */ + htmlEvent: Object; +} +/** + * Represents the client-side equivalent of the ASPxHyperLink control. + */ +interface ASPxClientHyperLink extends ASPxClientStaticEdit { + /** + * Gets an URL which defines the navigation location for the editor's hyperlink. + */ + GetNavigateUrl(): string; + /** + * Specifies an URL which defines the navigation location for the editor's hyperlink. + * @param url A string value which specifies an URL to where the client web browser will navigate when a hyperlink in the editor is clicked. + */ + SetNavigateUrl(url: string): void; + /** + * Gets the text caption displayed for the hyperlink in the hyperlink editor. + */ + GetText(): string; + /** + * Specifies the text caption displayed for the hyperlink in the hyperlink editor. + * @param text A string value specifying the text caption for the hyperlink in the editor. + */ + SetText(text: string): void; +} +/** + * Represents a base for client-side editors which are capable of displaying images. + */ +interface ASPxClientImageBase extends ASPxClientStaticEdit { + /** + * Sets the size of the image displayed within the image editor. + * @param width An integer value that specifies the image's width. + * @param height An integer value that specifies the image's height. + */ + SetSize(width: number, height: number): void; +} +/** + * Represents the client-side equivalent of the ASPxImage control. + */ +interface ASPxClientImage extends ASPxClientImageBase { + /** + * Returns the URL pointing to the image displayed within the image editor. + */ + GetImageUrl(): string; + /** + * Sets the URL which points to the image displayed within the image editor. + * @param url A string value specifying the URL to the image displayed within the editor. + */ + SetImageUrl(url: string): void; +} +/** + * Represents the client-side equivalent of the ASPxLabel control. + */ +interface ASPxClientLabel extends ASPxClientStaticEdit { + /** + * Returns the text displayed within the editor. + */ + GetText(): string; + /** + * Sets the text to be displayed within the editor. + * @param text A string value specifying the text to be displayed within the editor. + */ + SetText(text: string): void; +} +/** + * Represents the client-side equivalent of the ASPxTextBox control. + */ +interface ASPxClientTextBox extends ASPxClientTextBoxBase { +} +/** + * Represents the client-side equivalent of the ASPxMemo control. + */ +interface ASPxClientMemo extends ASPxClientTextEdit { +} +/** + * Represents the client-side equivalent of the ASPxButtonEdit control. + */ +interface ASPxClientButtonEdit extends ASPxClientButtonEditBase { +} +/** + * A method that will handle the ButtonClick event. + */ +interface ASPxClientButtonEditClickEventHandler { + /** + * A method that will handle the ButtonClick event. + * @param source An object representing the event source. Identifies the button editor that raised the event. + * @param e An ASPxClientButtonEditClickEventArgs object that contains event data. + */ + (source: S, e: ASPxClientButtonEditClickEventArgs): void; +} +/** + * Provides data for the ButtonClick event. + */ +interface ASPxClientButtonEditClickEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the index of the clicked button. + * Value: An integer value representing the index of the clicked button within the editor's Buttons collection. + */ + buttonIndex: number; +} +/** + * A client-side equivalent of the ASPxTokenBox object. + */ +interface ASPxClientTokenBox extends ASPxClientComboBox { + /** + * Fires on the client side after the token collection has been changed. + */ + TokensChanged: ASPxClientEvent>; + /** + * Adds a new token with the specified text to the end of the control's token collection. + * @param text A string value specifying the token's text. + */ + AddToken(text: string): void; + /** + * Removes a token specified by its text from the client token box. + * @param text A string value that is the text of the token to be removed. + */ + RemoveTokenByText(text: string): void; + /** + * Removes a token specified by its index from the client token box. + * @param index An integer value that is the index of the token to be removed. + */ + RemoveToken(index: number): void; + /** + * Returns an HTML span element that corresponds to the specified token. + * @param index An integer value that is the token index. + */ + GetTokenHtmlElement(index: number): Object; + /** + * Returns an HTML span element that corresponds to the specified token's text. + * @param index An integer value that is the token index. + */ + GetTokenTextHtmlElement(index: number): Object; + /** + * Returns an HTML span element that corresponds to the specified token's remove button. + * @param index An integer value that is the token index. + */ + GetTokenRemoveButtonHtmlElement(index: number): Object; + /** + * Returns a collection of tokens. + */ + GetTokenCollection(): string[]; + /** + * Sets a collection of tokens. + * @param collection A object that is the collection of tokens. + */ + SetTokenCollection(collection: string[]): void; + /** + * Removes all tokens contained in the token box. + */ + ClearTokenCollection(): void; + /** + * Returns the index of a token specified by its text. + * @param text A string value that specifies the text of the token. + */ + GetTokenIndexByText(text: string): number; + /** + * Gets the token texts, separated with a sign, specified by the TextSeparator property. + */ + GetText(): string; + /** + * Sets the token texts, separated with a sign, specified by the TextSeparator property. + * @param text A string value that is the token texts separated with a text separator. + */ + SetText(text: string): void; + /** + * Gets the editor value. + */ + GetValue(): string; + /** + * Sets the editor value. + * @param value A string that is the editor value. + */ + SetValue(value: string): void; + /** + * Returns a value that indicates if the specified token (string) is a custom token. + * @param text A string value that is a token. + * @param caseSensitive true, if tokens are case sensitive; otherwise, false. + */ + IsCustomToken(text: string, caseSensitive: boolean): boolean; + /** + * Changes the editor's value. + * @param value An object representing the data to be assigned to the editor's edit value. + */ + SetValue(value: Object): void; +} +/** + * The client-side equivalent of the ASPxTrackBar control. + */ +interface ASPxClientTrackBar extends ASPxClientEdit { + /** + * Fires on the client side before a track bar position is changed and allows you to cancel the action. + */ + PositionChanging: ASPxClientEvent>; + /** + * Fires after the editor's position has been changed. + */ + PositionChanged: ASPxClientEvent>; + /** + * Occurs on the client-side when an end-user moves a cursor while the drag handle is held down. + */ + Track: ASPxClientEvent>; + /** + * Occurs on the client-side when an end-user presses a drag handle and moves it. + */ + TrackStart: ASPxClientEvent>; + /** + * Occurs on the client-side when an end-user releases a drag handle after moving it. + */ + TrackEnd: ASPxClientEvent>; + /** + * Returns a track bar item index by the item's value. + * @param value An object that specifies the item's value. + */ + GetItemIndexByValue(value: Object): number; + /** + * Returns a track bar item's associated value. + * @param index An integer value that specifies the required item's index. + */ + GetItemValue(index: number): Object; + /** + * Returns a track bar item text. + * @param index An integer value that specifies the required item's index. + */ + GetItemText(index: number): string; + /** + * Returns a track bar item's tooltip text. + * @param index An integer value that specifies the required item's index. + */ + GetItemToolTip(index: number): string; + /** + * Returns the number of the track bar items that are maintained by the item collection. + */ + GetItemCount(): number; + /** + * Specifies the secondary drag handle position. + * @param position A value that specifies the position. + */ + SetPositionEnd(position: number): void; + /** + * Specifies the main drag handle position. + * @param position A value that specifies the position. + */ + SetPositionStart(position: number): void; + /** + * Returns the secondary drag handle position. + */ + GetPositionEnd(): number; + /** + * Returns the main drag handle position. + */ + GetPositionStart(): number; + /** + * Gets a drag handle position. + */ + GetPosition(): number; + /** + * Specifies a drag handle position. + * @param position A value that specifies the position. + */ + SetPosition(position: number): void; +} +/** + * A method that will handle the client PositionChanging event. + */ +interface ASPxClientTrackBarPositionChangingEventHandler { + /** + * A method that will handle the PositionChanging event. + * @param source The event source. Identifies the ASPxTrackBar control that raised the event. + * @param e A ASPxClientTrackBarPositionChangingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientTrackBarPositionChangingEventArgs): void; +} +/** + * Provides data for the PositionChanging event. + */ +interface ASPxClientTrackBarPositionChangingEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets or sets a value indicating whether the action which raised the event should be canceled. + * Value: true if the action that raised the event should be canceled; otherwise, false. + */ + cancel: boolean; + /** + * Gets the current drag handle position. + * Value: A value that is the drag handle position. + */ + currentPosition: number; + /** + * Gets the current secondary drag handle position. + * Value: A value that is the drag handle position. + */ + currentPositionEnd: number; + /** + * Gets the current main drag handle position. + * Value: A value that is the drag handle position. + */ + currentPositionStart: number; + /** + * Gets a position where the drag handle is being moved. + * Value: A value that is the drag handle position. + */ + newPosition: number; + /** + * Gets a position where the secondary drag handle is being moved. + * Value: A value that is the drag handle position. + */ + newPositionEnd: number; + /** + * Gets a position where the main drag handle is being moved. + * Value: A value that is the drag handle position. + */ + newPositionStart: number; +} +/** + * Represents the client-side equivalent of the ASPxValidationSummary control. + */ +interface ASPxClientValidationSummary extends ASPxClientControl { + /** + * Occurs on the client side when the validation summary's visibility is changed. + */ + VisibilityChanged: ASPxClientEvent>; +} +/** + * A method that will handle the VisibilityChanged event. + */ +interface ASPxClientValidationSummaryVisibilityChangedEventHandler { + /** + * A method that will handle the VisibilityChanged client event. + * @param source An object representing the event source. + * @param e A ASPxClientValidationSummaryVisibilityChangedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientValidationSummaryVisibilityChangedEventArgs): void; +} +/** + * Provides data for the VisibilityChanged event. + */ +interface ASPxClientValidationSummaryVisibilityChangedEventArgs extends ASPxClientEventArgs { + /** + * Gets or sets whether the editor is visible on the client. + * Value: true if the editor is visible; otherwise, false. + */ + visible: boolean; +} +/** + * Represents the client ASPxGaugeControl. + */ +interface ASPxClientGaugeControl extends ASPxClientControl { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires when errors have occurred during callback processing. + */ + CallbackError: ASPxClientEvent>; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(parameter: string): void; + /** + * + * @param parameter + * @param onSuccess + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; +} +/** + * Represents the client ASPxGridView. + */ +interface ASPxClientGridBase extends ASPxClientControl { +} +/** + * Serves as a base object implementing the client column functionality. + */ +interface ASPxClientGridColumnBase { +} +/** + * The client-side equivalent of the ASPxGridLookup control. + */ +interface ASPxClientGridLookup extends ASPxClientDropDownEditBase { + /** + * Fires on the client when a data row is clicked within the built-in dropdown grid. + */ + RowClick: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Returns a client object representing the built-in dropdown grid. + */ + GetGridView(): ASPxClientGridView; + /** + * Confirms the current selection made by an end-user within the editor's dropdown grid. + */ + ConfirmCurrentSelection(): void; + /** + * Cancels the current selection made by an end-user within the editor's dropdown grid and rolls back to the last confirmed selection. The selection can be confirmed by either pressing the Enter key or calling the ConfirmCurrentSelection method. + */ + RollbackToLastConfirmedSelection(): void; +} +/** + * Represents the client ASPxCardView. + */ +interface ASPxClientCardView extends ASPxClientGridBase { + /** + * Provides access to the batch editing client API. + * Value: A object that exposes the batch editing client API methods. + */ + batchEditApi: ASPxClientCardViewBatchEditApi; + /** + * Occurs when a custom command button has been clicked. + */ + CustomButtonClick: ASPxClientEvent>; + /** + * Fires after the selection has been changed. + */ + SelectionChanged: ASPxClientEvent>; + /** + * Enables you to prevent columns from being sorted. + */ + ColumnSorting: ASPxClientEvent>; + /** + * Occurs when a grid switches to batch edit mode. + */ + BatchEditStartEditing: ASPxClientEvent>; + /** + * Occurs when a grid leaves batch edit mode. + */ + BatchEditEndEditing: ASPxClientEvent>; + /** + * Enables you to prevent a batch edit confirmation message from being displayed. + */ + BatchEditConfirmShowing: ASPxClientEvent>; + /** + * Enables you to provide navigation for editors contained in a templated cell in Batch Edit mode. + */ + BatchEditTemplateCellFocused: ASPxClientEvent>; + /** + * Enables you to specify whether card data is valid and provide an error text. + */ + BatchEditCardValidating: ASPxClientEvent>; + /** + * Occurs on the client side before data changes are saved in batch edit mode. + */ + BatchEditChangesSaving: ASPxClientEvent>; + /** + * Occurs on the client side before data changes are canceled in batch edit mode. + */ + BatchEditChangesCanceling: ASPxClientEvent>; + /** + * Occurs on the client side before a card is inserted in batch edit mode. + */ + BatchEditCardInserting: ASPxClientEvent>; + /** + * Occurs on the client side before a card is deleted in batch edit mode. + */ + BatchEditCardDeleting: ASPxClientEvent>; + /** + * Fires on the client when a card is clicked. + */ + CardClick: ASPxClientEvent>; + /** + * Fires on the client when a card is double clicked. + */ + CardDblClick: ASPxClientEvent>; + /** + * Fires in response to changing card focus. + */ + FocusedCardChanged: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any unhandled server error occurs during server-side processing of a callback sent by the ASPxClientCardView. + */ + CallbackError: ASPxClientEvent>; + /** + * Fires after the customization window has been closed. + */ + CustomizationWindowCloseUp: ASPxClientEvent>; + /** + * Moves focus to the specified edit cell within the edited card. + * @param column An ASPxClientCardViewColumn object that represents the data column within the client grid. + */ + FocusEditor(column: ASPxClientCardViewColumn): void; + /** + * Moves focus to the specified edit cell within the edited card. + * @param columnIndex An integer value that specifies the column's position within the columns collection. + */ + FocusEditor(columnIndex: number): void; + /** + * Moves focus to the specified edit cell within the edited card. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + */ + FocusEditor(columnFieldNameOrId: string): void; + /** + * Sets the value of the specified edit cell. + * @param column An ASPxClientCardViewColumn object that represents the data column within the client grid. + * @param value A string value that specifies the edit cell's new value. + */ + SetEditValue(column: ASPxClientCardViewColumn, value: string): void; + /** + * Sets the value of the specified edit cell. + * @param columnIndex An integer value that identifies the data column within the grid's column collection. + * @param value A string value that specifies the edit cell's new value. + */ + SetEditValue(columnIndex: number, value: string): void; + /** + * Sets the value of the specified edit cell. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + * @param value A string value that specifies the edit cell's new value. + */ + SetEditValue(columnFieldNameOrId: string, value: string): void; + /** + * Displays the Filter Control. + */ + ShowFilterControl(): void; + /** + * Hides the Filter Control. + */ + CloseFilterControl(): void; + /** + * Enables or disables the current filter. + * @param isFilterEnabled true to enable the current filter; otherwise, false. + */ + SetFilterEnabled(isFilterEnabled: boolean): void; + /** + * Returns the current vertical scroll position of the grid's content. + */ + GetVerticalScrollPosition(): number; + /** + * Specifies the vertical scroll position for the grid's content. + * @param position An integer value specifying the vertical scroll position. + */ + SetVerticalScrollPosition(position: number): void; + /** + * Gets information about a focused cell. + */ + GetFocusedCell(): ASPxClientCardViewCellInfo; + /** + * Focuses the specified cell. + * @param cardVisibleIndex An value that specifies the visible index of the card. + * @param columnIndex A zero-based index that identifies the column in the column collection (the column's Index property value). + */ + SetFocusedCell(cardVisibleIndex: number, columnIndex: number): void; + /** + * Sorts data by the specified data column's values. + * @param column An ASPxClientCardViewColumn object that represents the data column. + */ + SortBy(column: ASPxClientCardViewColumn): void; + /** + * Sorts data by the specified data column's values. + * @param columnIndex An integer value that specifies the column's position within the column collection. + */ + SortBy(columnIndex: number): void; + /** + * Sorts data by the specified data column's values. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + */ + SortBy(columnFieldNameOrId: string): void; + /** + * Sorts data by the specified data column's values. + * @param column An ASPxClientCardViewColumn object that represents the data column. + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DSC' or 'NONE'). + */ + SortBy(column: ASPxClientCardViewColumn, sortOrder: string): void; + /** + * Sorts data by the specified data column's values. + * @param columnIndex An integer value that specifies the column's position within the column collection. + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DSC' or 'NONE'). + */ + SortBy(columnIndex: number, sortOrder: string): void; + /** + * Sorts data by the specified data column's values. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DSC' or 'NONE'). + */ + SortBy(columnFieldNameOrId: string, sortOrder: string): void; + /** + * Sorts data by the specified data column's values. + * @param column An ASPxClientCardViewColumn object that represents the data column. + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DSC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + */ + SortBy(column: ASPxClientCardViewColumn, sortOrder: string, reset: boolean): void; + /** + * Sorts data by the specified data column's values. + * @param columnIndex An integer value that specifies the column's position within the column collection. + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DSC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + */ + SortBy(columnIndex: number, sortOrder: string, reset: boolean): void; + /** + * Sorts data by the specified data column's values. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DSC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + */ + SortBy(columnFieldNameOrId: string, sortOrder: string, reset: boolean): void; + /** + * Sorts data by the specified data column's values, and places the column to the specified position among the sorted columns. + * @param column An ASPxClientCardViewColumn object that represents the data column. + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DSC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + * @param sortIndex + */ + SortBy(column: ASPxClientCardViewColumn, sortOrder: string, reset: boolean, sortIndex: number): void; + /** + * Sorts data by the specified data column's values, and places the column to the specified position among the sorted columns. + * @param columnIndex An integer value that specifies the column's position within the column collection. + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DSC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + * @param sortIndex An integer value that specifies the zero-based column's index among the sorted columns. -1 if data is not sorted by this column. + */ + SortBy(columnIndex: number, sortOrder: string, reset: boolean, sortIndex: number): void; + /** + * Sorts data by the specified data column's values, and places the column to the specified position among the sorted columns. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DSC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + * @param sortIndex An integer value that specifies the zero-based column's index among the sorted columns. -1 if data is not sorted by this column. + */ + SortBy(columnFieldNameOrId: string, sortOrder: string, reset: boolean, sortIndex: number): void; + /** + * Hides the specified column. + * @param column An ASPxClientCardViewColumn object that represents the column to hide. + */ + MoveColumn(column: ASPxClientCardViewColumn): void; + /** + * Hides the specified column. + * @param columnIndex An integer value that specifies the absolute index of the column to hide. + */ + MoveColumn(columnIndex: number): void; + /** + * Hides the specified column. + * @param columnFieldNameOrId A string value that identifies the column to be hidden by the name of the data source field to which the column is bound, or by the column's name. + */ + MoveColumn(columnFieldNameOrId: string): void; + /** + * Moves the specified column to the specified visual position within the ASPxCardView. + * @param column An ASPxClientCardViewColumn object that represents the column to move. + * @param moveToColumnVisibleIndex An integer value that specifies the column's position among the visible columns within the ASPxCardView. + */ + MoveColumn(column: ASPxClientCardViewColumn, moveToColumnVisibleIndex: number): void; + /** + * Moves the specified column to the specified visual position within the ASPxCardView. + * @param columnIndex An integer value that specifies the absolute index of the column to move. + * @param moveToColumnVisibleIndex An integer value that specifies the column's position among the visible columns within the grid. + */ + MoveColumn(columnIndex: number, moveToColumnVisibleIndex: number): void; + /** + * Moves the specified column to the specified visual position within the ASPxCardView. + * @param columnFieldNameOrId A string value that identifies the column to be moved by the name of the data source field to which the column is bound or by the column's name. + * @param moveToColumnVisibleIndex An integer value that specifies the column's position among the visible columns within the ASPxCardView. + */ + MoveColumn(columnFieldNameOrId: string, moveToColumnVisibleIndex: number): void; + /** + * Moves the specified column to the specified visual position within the ASPxCardView. + * @param column An ASPxClientCardViewColumn object that represents the column to move. + * @param moveToColumnVisibleIndex An integer value that identifies the target column displayed within the CardView. + * @param moveBefore true, to move the column before the target column; otherwise, false. + */ + MoveColumn(column: ASPxClientCardViewColumn, moveToColumnVisibleIndex: number, moveBefore: boolean): void; + /** + * Moves the specified column to the specified visual position within the ASPxCardView. + * @param columnIndex An integer value that specifies the absolute index of the column to move. + * @param moveToColumnVisibleIndex An integer value that identifies the target column displayed within the grid. + * @param moveBefore true to move the column before the target column; otherwise, false. + */ + MoveColumn(columnIndex: number, moveToColumnVisibleIndex: number, moveBefore: boolean): void; + /** + * Moves the specified column to the specified visual position within the ASPxCardView. + * @param columnFieldNameOrId A string value that identifies the column to be moved by the name of the data source field to which the column is bound or by the column's name. + * @param moveToColumnVisibleIndex An integer value that identifies the target column displayed within the grid. + * @param moveBefore true to move the column before the target column; otherwise, false. + */ + MoveColumn(columnFieldNameOrId: string, moveToColumnVisibleIndex: number, moveBefore: boolean): void; + /** + * Returns the key value of the specified card. + * @param visibleIndex An integer value that specifies the card's visible index. + */ + GetCardKey(visibleIndex: number): string; + /** + * Switches the CardView to edit mode. + * @param visibleIndex A zero-based integer that identifies a card to be edited. + */ + StartEditCard(visibleIndex: number): void; + /** + * Switches the ASPxCardView to edit mode. + * @param key An object that uniquely identifies a card to be edited. + */ + StartEditCardByKey(key: Object): void; + /** + * Indicates whether or not a new card is being edited. + */ + IsNewCardEditing(): boolean; + /** + * Adds a new record. + */ + AddNewCard(): void; + /** + * Deletes the specified card. + * @param visibleIndex An integer value that identifies the card. + */ + DeleteCard(visibleIndex: number): void; + /** + * Deletes a card with the specified key value. + * @param key An object that uniquely identifies the card. + */ + DeleteCardByKey(key: Object): void; + /** + * Returns the focused card's index. + */ + GetFocusedCardIndex(): number; + /** + * Moves focus to the specified card. + * @param visibleIndex An integer value that specifies the focused card's index. + */ + SetFocusedCardIndex(visibleIndex: number): void; + /** + * Selects all the unselected cards within the CardView. + */ + SelectCards(): void; + /** + * Selects the specified card displayed within the CardView. + * @param visibleIndex A zero-based integer value that specifies the card's visible index. + */ + SelectCards(visibleIndex: number): void; + /** + * Selects the specified cards within the CardView. + * @param visibleIndices An array of zero-based indices that identify data cards within the grid. + */ + SelectCards(visibleIndices: number[]): void; + /** + * Selects or deselects the specified cards within the CardView. + * @param visibleIndices An array of zero-based indices that identify data cards within the grid. + * @param selected true to select the specified cards; false to deselect the cards. + */ + SelectCards(visibleIndices: number[], selected: boolean): void; + /** + * Selects or deselects the specified card within the GridView. + * @param visibleIndex An integer zero-based index that identifies the data card within the grid. + * @param selected true to select the specified card; false to deselect the card. + */ + SelectCards(visibleIndex: number, selected?: boolean): void; + /** + * Selects or deselects the specified cards displayed within the CardView. + * @param keys An array of objects that uniquely identify the cards. + * @param selected true to select the specified cards; false to deselect the cards. + */ + SelectCardsByKey(keys: Object[], selected?: boolean): void; + /** + * Selects or deselects the specified card displayed within the CardView. + * @param key An object that uniquely identifies the card. + * @param selected true to select the specified card; false to deselect the card. + */ + SelectCardsByKey(key: Object, selected?: boolean): void; + /** + * Selects the specified cards displayed within the CardView. + * @param keys An array of objects that uniquely identify the cards. + */ + SelectCardsByKey(keys: Object[]): void; + /** + * Selects a card displayed within the CardView by its key. + * @param key An object that uniquely identifies the card. + */ + SelectCardsByKey(key: Object): void; + /** + * Deselects the specified cards displayed within the ASPxCardView. + * @param keys An array of objects that uniquely identify the cards. + */ + UnselectCardsByKey(keys: Object[]): void; + /** + * Deselects the specified card displayed within the ASPxCardView. + * @param key An object that uniquely identifies the card. + */ + UnselectCardsByKey(key: Object): void; + /** + * Deselects all the selected cards within the ASPxCardView. + */ + UnselectCards(): void; + /** + * Deselects the specified cards (if selected) within the ASPxCardView. + * @param visibleIndices An array of zero-based indices that identify data cards within the grid. + */ + UnselectCards(visibleIndices: number[]): void; + /** + * Deselects the specified cards (if selected) within the ASPxCardView. + * @param visibleIndex A zero-based integer value that specifies the card's visible index. + */ + UnselectCards(visibleIndex: number): void; + /** + * Deselects all grid cards that match the filter criteria currently applied to the CardView. + */ + UnselectFilteredCards(): void; + /** + * Selects the specified card displayed on the current page. + * @param visibleIndex A zero-based integer value that specifies the card's visible index. + */ + SelectCardOnPage(visibleIndex: number): void; + /** + * Selects or deselects the specified card displayed on the current page. + * @param visibleIndex A zero-based integer value that specifies the card's visible index. + * @param selected true to select the specified card; false to deselect the card. + */ + SelectCardOnPage(visibleIndex: number, selected?: boolean): void; + /** + * Deselects the specified cards (if selected) displayed on the current page. + * @param visibleIndex A zero-based integer value that specifies the card's visible index. + */ + UnselectCardOnPage(visibleIndex: number): void; + /** + * Selects all unselected cards displayed on the current page. + */ + SelectAllCardsOnPage(): void; + /** + * Allows you to select or deselect all cards displayed on the current page based on the parameter passed. + * @param selected true to select all unselected cards displayed on the current page; false to deselect all selected cards on the page. + */ + SelectAllCardsOnPage(selected: boolean): void; + /** + * Deselects all selected cards displayed on the current page. + */ + UnselectAllCardsOnPage(): void; + /** + * Returns the number of selected cards. + */ + GetSelectedCardCount(): number; + /** + * Indicates whether or not the specified card is selected within the current page. + * @param visibleIndex An integer value that identifies the card by its visible index. + */ + IsCardSelectedOnPage(visibleIndex: number): boolean; + /** + * Applies the specified search panel filter criterion to grid data. + * @param value A string value that specifies the filter criterion. + */ + ApplySearchPanelFilter(value: string): void; + /** + * Applies the specified filter expression to the grid. + * @param filterExpression A string value that specifies the filter expression. + */ + ApplyFilter(filterExpression: string): void; + /** + * Clears the filter expression applied to a client CardView. + */ + ClearFilter(): void; + /** + * Gets the Popup Edit Form. + */ + GetPopupEditForm(): ASPxClientPopupControl; + /** + * Sets input focus to the grid. + */ + Focus(): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param args A string value that represents any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(args: string): void; + /** + * Selects the specified page. + * @param pageIndex An integer value that specifies the active page's index. + */ + GotoPage(pageIndex: number): void; + /** + * Gets the index of the page currently being selected. + */ + GetPageIndex(): number; + /** + * Gets the number of pages to which the grid's data is divided. + */ + GetPageCount(): number; + /** + * Activates the next page. + */ + NextPage(): void; + /** + * Activates the previous page. + */ + PrevPage(): void; + /** + * Returns the index of the first card displayed within the grid's active page. + */ + GetTopVisibleIndex(): number; + /** + * Indicates whether the grid is in edit mode. + */ + IsEditing(): boolean; + /** + * Saves all the changes made and switches the grid to browse mode. + */ + UpdateEdit(): void; + /** + * Cancels all the changes made and switches the CardView to browse mode. + */ + CancelEdit(): void; + /** + * Updates data displayed within the grid. + */ + Refresh(): void; + /** + * Indicates whether the customization window is displayed. + */ + IsCustomizationWindowVisible(): boolean; + /** + * Invokes the customization window. + */ + ShowCustomizationWindow(): void; + /** + * Invokes the customization window and displays it over the specified HTML element. + * @param showAtElement An object that specifies the HTML element relative to whose position the customization window is invoked. + */ + ShowCustomizationWindow(showAtElement?: Object): void; + /** + * Closes the customization window. + */ + HideCustomizationWindow(): void; + /** + * Returns the number of columns within the client grid. + */ + GetColumnCount(): number; + /** + * Returns the card values displayed within all selected cards. + * @param fieldNames The names of data source fields separated via a semicolon, whose values within the selected cards are returned. + * @param onCallback An ASPxClientCardViewValuesCallback object that represents the JavaScript function which receives the list of card values as a parameter. + */ + GetSelectedFieldValues(fieldNames: string, onCallback: ASPxClientCardViewValuesCallback): void; + /** + * Returns key values of selected cards displayed within the current page. + */ + GetSelectedKeysOnPage(): Object[]; + /** + * Sends a callback to the server and generates the server-side CustomDataCallback event. + * @param args A string value that is any information that needs to be sent to the server-side CustomDataCallback event. + * @param onCallback An ASPxClientCardViewValuesCallback object that is the JavaScript function which receives the information on the client side. + */ + GetValuesOnCustomCallback(args: string, onCallback: ASPxClientCardViewValuesCallback): void; + /** + * Returns the values of the specified data source fields within the specified card. + * @param visibleIndex An integer value that identifies the data card. + * @param fieldNames The names of data source fields separated via a semicolon, whose values within the specified card are returned. + * @param onCallback An ASPxClientCardViewValuesCallback object that represents the JavaScript function which receives the list of card values as a parameter. + */ + GetCardValues(visibleIndex: number, fieldNames: string, onCallback: ASPxClientCardViewValuesCallback): void; + /** + * Returns the card values displayed within the current page. + * @param fieldNames The names of data source fields whose values are returned. + * @param onCallback An ASPxClientCardViewValuesCallback object that represents the JavaScript function which receives the list of card values as a parameter. + */ + GetPageCardValues(fieldNames: string, onCallback: ASPxClientCardViewValuesCallback): void; + /** + * Returns the number of cards actually displayed within the active page. + */ + GetVisibleCardsOnPage(): number; + /** + * Returns the client column that resides at the specified position within the column collection. + * @param columnIndex A zero-based index that identifies the column within the column collection (the column's Index property value). + */ + GetColumn(columnIndex: number): ASPxClientCardViewColumn; + /** + * Returns the column with the specified unique identifier. + * @param columnId A string value that specifies the column's unique identifier (the column's Name property value). + */ + GetColumnById(columnId: string): ASPxClientCardViewColumn; + /** + * Returns the client column which is bound to the specified data source field. + * @param columnFieldName A string value that specifies the name of the data source field to which the column is bound (the column's FieldName property value). + */ + GetColumnByField(columnFieldName: string): ASPxClientCardViewColumn; + /** + * Returns the editor used to edit the specified column's values. + * @param column An ASPxClientCardViewColumn object that specifies the required column within the client grid. + */ + GetEditor(column: ASPxClientCardViewColumn): ASPxClientEdit; + /** + * Returns the editor used to edit the specified column's values. + * @param columnIndex An integer value that specifies the column's position within the column collection. + */ + GetEditor(columnIndex: number): ASPxClientEdit; + /** + * Returns the editor used to edit the specified column's values. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + */ + GetEditor(columnFieldNameOrId: string): ASPxClientEdit; + /** + * Returns the value of the specified edit cell. + * @param column An ASPxClientCardViewColumn object that represents the data column within the client grid. + */ + GetEditValue(column: ASPxClientCardViewColumn): string; + /** + * Returns the value of the specified edit cell. + * @param columnIndex An integer value that identifies the data column within the grid's column collection. + */ + GetEditValue(columnIndex: number): string; + /** + * Returns the value of the specified edit cell. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + */ + GetEditValue(columnFieldNameOrId: string): string; +} +/** + * Represents a client column. + */ +interface ASPxClientCardViewColumn extends ASPxClientGridColumnBase { + /** + * Gets the name that uniquely identifies the column. + * Value: A string value assigned to the column's Name property. + */ + name: string; + /** + * Gets the column's position within the collection. + * Value: An integer zero-bazed index that specifies the column's position within the collection. + */ + index: number; + /** + * Gets the name of the database field assigned to the current column. + * Value: A string value that specifies the name of a data field. + */ + fieldName: string; + /** + * Gets whether the column is visible. + * Value: true to display the column; otherwise, false. + */ + visible: boolean; +} +/** + * Represents a JavaScript function which receives the list of card values when the client GetSelectedFieldValues method is called. + */ +interface ASPxClientCardViewValuesCallback { + /** + * Represents a JavaScript function which receives the list of card values when the client GetSelectedFieldValues method is called. + * @param result An object that represents the list of card values received from the server. + */ + (result: Object): void; +} +/** + * A method that will handle the cancelable events of a client ASPxCardView column. + */ +interface ASPxClientCardViewColumnCancelEventHandler { + /** + * A method that will handle the cancelable events of a client ASPxCardView column. + * @param source The event source. This parameter identifies the ASPxClientCardView object that raised the event. + * @param e An ASPxClientCardViewColumnCancelEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCardViewColumnCancelEventArgs): void; +} +/** + * Provides data for the cancelable events of a client ASPxCardView column. + */ +interface ASPxClientCardViewColumnCancelEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the processed client column. + * Value: An ASPxClientCardViewColumn object that represents the processed column. + */ + column: ASPxClientCardViewColumn; +} +/** + * A method that will handle the CardClick event. + */ +interface ASPxClientCardViewCardClickEventHandler { + /** + * A method that will handle the CardClick event. + * @param source The event source. This parameter identifies the ASPxClientCardView object that raised the event. + * @param e An ASPxClientCardViewCardClickEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCardViewCardClickEventArgs): void; +} +/** + * Provides data for the CardClick event. + */ +interface ASPxClientCardViewCardClickEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the processed card's visible index. + * Value: An integer zero-based index that identifies the processed record. + */ + visibleIndex: number; + /** + * Provides access to the parameters associated with the CardClick event. + * Value: An object that contains parameters associated with the event. + */ + htmlEvent: Object; +} +/** + * A method that will handle the CustomButtonClick event. + */ +interface ASPxClientCardViewCustomButtonEventHandler { + /** + * A method that will handle the CustomButtonClick event. + * @param source The event source. This parameter identifies the ASPxClientCardView object that raised the event. + * @param e An ASPxClientCardViewCustomButtonEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCardViewCustomButtonEventArgs): void; +} +/** + * Provides data for the CustomButtonClick event. + */ +interface ASPxClientCardViewCustomButtonEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the value which identifies the card whose custom button has been clicked. + * Value: An integer value that identifies the card whose custom button has been clicked. + */ + visibleIndex: number; + /** + * Gets the value which identifies the custom button. + * Value: A string value that identifies the clicked custom button. + */ + buttonID: string; +} +/** + * A method that will handle the SelectionChanged event. + */ +interface ASPxClientCardViewSelectionEventHandler { + /** + * A method that will handle the SelectionChanged event. + * @param source The event source. + * @param e An ASPxClientCardViewSelectionEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCardViewSelectionEventArgs): void; +} +/** + * Provides data for the SelectionChanged event. + */ +interface ASPxClientCardViewSelectionEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the visible index of the card whose selected state has been changed. + * Value: An value that specifies the visible index of the card. + */ + visibleIndex: number; + /** + * Gets whether the card has been selected. + * Value: true if the card has been selected; otherwise, false. + */ + isSelected: boolean; + /** + * Gets whether all cards displayed within a page have been selected or unselected. + * Value: true if all cards displayed within a page have been selected or unselected; otherwise, false. + */ + isAllRecordsOnPage: boolean; + /** + * Gets whether a selection has been changed on the server. + * Value: true if a selection has been changed on the server; otherwise, false. + */ + isChangedOnServer: boolean; +} +/** + * A method that will handle the client BatchEditStartEditing event. + */ +interface ASPxClientCardViewBatchEditStartEditingEventHandler { + /** + * A method that will handle the BatchEditStartEditing event. + * @param source The event source. + * @param e An ASPxClientCardViewBatchEditStartEditingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCardViewBatchEditStartEditingEventArgs): void; +} +/** + * Provides data for the BatchEditStartEditing event. + */ +interface ASPxClientCardViewBatchEditStartEditingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the visible index of the card whose cells are about to be edited. + * Value: An value that specifies the visible index of the card. + */ + visibleIndex: number; + /** + * Gets the CardView column that owns a cell that is about to be edited. + * Value: An object that is the focused CardView column. + */ + focusedColumn: ASPxClientCardViewColumn; + /** + * Gets a hashtable that maintains information about editable cells. + * Value: A hashtable that stores information about editable cells. + */ + cardValues: Object; +} +/** + * A method that will handle the client BatchEditEndEditing event. + */ +interface ASPxClientCardViewBatchEditEndEditingEventHandler { + /** + * A method that will handle the BatchEditEndEditing event. + * @param source The event source. + * @param e An ASPxClientCardViewBatchEditEndEditingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCardViewBatchEditEndEditingEventArgs): void; +} +/** + * Provides data for the BatchEditEndEditing event. + */ +interface ASPxClientCardViewBatchEditEndEditingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the visible index of the card whose cells have been edited. + * Value: An value that specifies the visible index of the card. + */ + visibleIndex: number; + /** + * Gets a hashtable that maintains information about editable cells. + * Value: A hashtable that stores information about editable cells. + */ + cardValues: Object; +} +/** + * A method that will handle the client BatchEditCardValidating event. + */ +interface ASPxClientCardViewBatchEditCardValidatingEventHandler { + /** + * A method that will handle the BatchEditCardValidating event. + * @param source The event source. + * @param e An ASPxClientCardViewBatchEditCardValidatingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCardViewBatchEditCardValidatingEventArgs): void; +} +/** + * Provides data for the BatchEditCardValidating event. + */ +interface ASPxClientCardViewBatchEditCardValidatingEventArgs extends ASPxClientEventArgs { + /** + * Gets the processed card's visible index. + * Value: An integer value that specifies the processed card's visible index. + */ + visibleIndex: number; + /** + * Provides validation information of a card currently being validated. + * Value: An object that is a hashtable containing validation information. + */ + validationInfo: Object; +} +/** + * Represents an object that will handle the client-side BatchEditConfirmShowing event. + */ +interface ASPxClientCardViewBatchEditConfirmShowingEventHandler { + /** + * A method that will handle the BatchEditConfirmShowing client event. + * @param source The event source. + * @param e An ASPxClientCardViewBatchEditConfirmShowingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCardViewBatchEditConfirmShowingEventArgs): void; +} +/** + * Provides data for the BatchEditConfirmShowing event. + */ +interface ASPxClientCardViewBatchEditConfirmShowingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the client identifier of an object that initiates a send request. + * Value: A string value that specifies the object client identifier. + */ + requestTriggerID: string; +} +/** + * A method that will handle the client BatchEditTemplateCellFocused event. + */ +interface ASPxClientCardViewBatchEditTemplateCellFocusedEventHandler { + /** + * A method that will handle the BatchEditTemplateCellFocused event. + * @param source An object representing the event source. Identifies the button editor that raised the event. + * @param e An ASPxClientCardViewBatchEditTemplateCellFocusedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCardViewBatchEditTemplateCellFocusedEventArgs): void; +} +/** + * Provides data for the BatchEditTemplateCellFocused event. + */ +interface ASPxClientCardViewBatchEditTemplateCellFocusedEventArgs extends ASPxClientEventArgs { + /** + * Gets the currently processed column. + * Value: An object that is the client-side column object. + */ + column: ASPxClientCardViewColumn; + /** + * Gets or sets a value specifying whether the event was handled. + * Value: true if the event was handled and default processing should not occur; false if the event should be handled using default processing. + */ + handled: boolean; +} +/** + * A method that will handle the BatchEditChangesSaving event. + */ +interface ASPxClientCardViewBatchEditChangesSavingEventHandler { + /** + * A method that will handle the BatchEditChangesSaving event. + * @param source The event source. This parameter identifies the card view object which raised the event. + * @param e An ASPxClientCardViewBatchEditChangesSavingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCardViewBatchEditChangesSavingEventArgs): void; +} +/** + * Provides data for the BatchEditChangesSaving event. + */ +interface ASPxClientCardViewBatchEditChangesSavingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets a hashtable that maintains information about inserted cells. + * Value: A hashtable that stores information about inserted cells. + */ + insertedValues: Object; + /** + * Gets a hashtable that maintains information about deleted cells. + * Value: A hashtable that stores information about deleted cells. + */ + deletedValues: Object; + /** + * Gets a hashtable that maintains information about updated cells. + * Value: A hashtable that stores information about updated cells. + */ + updatedValues: Object; +} +/** + * A method that will handle the BatchEditChangesCanceling event. + */ +interface ASPxClientCardViewBatchEditChangesCancelingEventHandler { + /** + * A method that will handle the BatchEditChangesCanceling event. + * @param source The event source. This parameter identifies the card view object which raised the event. + * @param e An ASPxClientCardViewBatchEditChangesCancelingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCardViewBatchEditChangesCancelingEventArgs): void; +} +/** + * Provides data for the BatchEditChangesCanceling event. + */ +interface ASPxClientCardViewBatchEditChangesCancelingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets a hashtable that maintains information about inserted cells. + * Value: A hashtable that stores information about inserted cells. + */ + insertedValues: Object; + /** + * Gets a hashtable that maintains information about deleted cells. + * Value: A hashtable that stores information about deleted cells. + */ + deletedValues: Object; + /** + * Gets a hashtable that maintains information about updated cells. + * Value: A hashtable that stores information about updated cells. + */ + updatedValues: Object; +} +/** + * A method that will handle the BatchEditCardInserting event. + */ +interface ASPxClientCardViewBatchEditCardInsertingEventHandler { + /** + * A method that will handle the BatchEditCardInserting event. + * @param source The event source. This parameter identifies the card view object which raised the event. + * @param e An ASPxClientCardViewBatchEditCardInsertingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCardViewBatchEditCardInsertingEventArgs): void; +} +/** + * Provides data for the BatchEditCardInserting event. + */ +interface ASPxClientCardViewBatchEditCardInsertingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the processed card visible index. + * Value: An integer value that specifies the processed card visible index. + */ + visibleIndex: number; +} +/** + * A method that will handle the BatchEditCardDeleting event. + */ +interface ASPxClientCardViewBatchEditCardDeletingEventHandler { + /** + * A method that will handle the BatchEditCardDeleting event. + * @param source The event source. This parameter identifies the card view object which raised the event. + * @param e An ASPxClientCardViewBatchEditCardDeletingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCardViewBatchEditCardDeletingEventArgs): void; +} +/** + * Provides data for the BatchEditCardDeleting event. + */ +interface ASPxClientCardViewBatchEditCardDeletingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the processed card visible index. + * Value: An integer value that specifies the processed card visible index. + */ + visibleIndex: number; + /** + * Gets a hashtable that maintains information about deleted cells. + * Value: A hashtable that stores information about deleted cells. + */ + cardValues: Object; +} +/** + * Provides members related to Batch Edit Mode + */ +interface ASPxClientCardViewBatchEditApi { + /** + * Performs validation of CardView data when the CardView operates in Batch Edit mode. + */ + ValidateCards(): boolean; + /** + * Performs validation of CardView data contained in the specified card when the CardView operates in Batch Edit mode. + * @param visibleIndex An integer value specifying the visible index of the validated card. + */ + ValidateCard(visibleIndex: number): boolean; + /** + * Returns an array of card visible indices. + * @param includeDeleted true, to include visible indices of deleted cards to the returned array; otherwise, false. + */ + GetCardVisibleIndices(includeDeleted: boolean): number[]; + /** + * Returns an array of the deleted card visible indices. + */ + GetDeletedCardIndices(): number[]; + /** + * Returns an array of the inserted card visible indices. + */ + GetInsertedCardIndices(): number[]; + /** + * Indicates if the card with the specified visible index is deleted. + * @param visibleIndex An integer value that identifies the card by its visible index. + */ + IsDeletedCard(visibleIndex: number): boolean; + /** + * Indicates if the card with the specified visible index is newly created. + * @param visibleIndex An integer value that identifies the card by its visible index. + */ + IsNewCard(visibleIndex: number): boolean; + /** + * Programmatically moves the focus to the previous cell in the card + */ + MoveFocusBackward(): boolean; + /** + * Programmatically moves the focus to the next cell in the card. + */ + MoveFocusForward(): boolean; + /** + * Sets the value of the specified cell. + * @param visibleIndex An integer zero-based index that identifies the card containing the processed cell. + * @param columnFieldNameOrId A string value that specifies the field name or unique identifier (the column's Name property value) of a column containing the processed cell. + * @param value An object that contains the new cell value. + */ + SetCellValue(visibleIndex: number, columnFieldNameOrId: string, value: Object): void; + /** + * Sets the value of the specified cell. + * @param visibleIndex An integer zero-based index that identifies the card containing the processed cell. + * @param columnFieldNameOrId A string value that specifies the field name or unique identifier (the column's Name property value) of a column containing the processed cell. + * @param value An object that contains the new cell value. + * @param displayText A string value that specifies the cell display text. + * @param cancelCellHighlighting true to cancel highlighting of the modified cell, false to highlight the modified cell. + */ + SetCellValue(visibleIndex: number, columnFieldNameOrId: string, value: Object, displayText: string, cancelCellHighlighting?: boolean): void; + /** + * Gets the value of the specified cell. + * @param visibleIndex A zero-based integer value that specifies the visible index of a card containing the processed cell. + * @param columnFieldNameOrId A string value that specifies the field name or unique identifier (the column's Name property value) of a column containing the processed cell. + * @param initial true, to return the initial (server) value; false, to return a value currently contained on the client side (modified value). + */ + GetCellValue(visibleIndex: number, columnFieldNameOrId: string, initial?: boolean): Object; + /** + * Gets information about the cell currently being edited. + */ + GetEditCellInfo(): ASPxClientCardViewCellInfo; + /** + * Returns a value that indicates whether the card view has changed data. + */ + HasChanges(): boolean; + /** + * Returns a value that indicates whether the specified card has changed data. + * @param visibleIndex An integer value that specifies the visible index of a card. + */ + HasChanges(visibleIndex: number): boolean; + /** + * Returns a value that indicates whether the specified cell's data has been changed. + * @param visibleIndex An integer value that specifies the visible index of a card. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + */ + HasChanges(visibleIndex: number, columnFieldNameOrId: string): boolean; + /** + * Resets changes in the specified card. + * @param visibleIndex An integer value that specifies the visible index of a card. + */ + ResetChanges(visibleIndex: number): void; + /** + * Resets changes in the specified cell. + * @param visibleIndex An integer value that specifies the visible index of a card containing the processed cell. + * @param columnIndex A string value that specifies the field name or unique identifier (the column's Name property value) of a column containing the processed cell. + */ + ResetChanges(visibleIndex: number, columnIndex: number): void; + /** + * Switches the specified cell to edit mode. + * @param visibleIndex A zero-based integer value that specifies the visible index of a card containing the processed cell. + * @param columnIndex A zero-based integer value that identifies the column which contains the processed cell in the column collection. + */ + StartEdit(visibleIndex: number, columnIndex: number): void; + /** + * Ends cell or card editing. + */ + EndEdit(): void; +} +/** + * Contains information on a grid cell. + */ +interface ASPxClientCardViewCellInfo { + /** + * Gets the visible index of the card that contains the cell currently being processed. + * Value: An value that specifies the visible index of the card. + */ + cardVisibleIndex: number; + /** + * Gets the data column that contains the cell currently being processed. + * Value: An object that is the data column which contains the processed cell. + */ + column: ASPxClientCardViewColumn; +} +/** + * A client-side equivalent of the ASPxGridView object. + */ +interface ASPxClientGridView extends ASPxClientGridBase { + /** + * Provides access to the batch editing client API. + * Value: A object that exposes the batch editing client API methods. + */ + batchEditApi: ASPxClientGridViewBatchEditApi; + /** + * Occurs when a custom command button has been clicked. + */ + CustomButtonClick: ASPxClientEvent>; + /** + * Fires after the selection has been changed. + */ + SelectionChanged: ASPxClientEvent>; + /** + * Enables you to prevent columns from being sorted. + */ + ColumnSorting: ASPxClientEvent>; + /** + * Fires in response to changing row focus. + */ + FocusedRowChanged: ASPxClientEvent>; + /** + * Enables you to cancel data grouping. + */ + ColumnGrouping: ASPxClientEvent>; + /** + * Fires when an end-user starts dragging the column's header and enables you to cancel this operation. + */ + ColumnStartDragging: ASPxClientEvent>; + /** + * Enables you to prevent columns from being resized. + */ + ColumnResizing: ASPxClientEvent>; + /** + * Occurs after a column's width has been changed by an end-user. + */ + ColumnResized: ASPxClientEvent>; + /** + * Enables you to control column movement. + */ + ColumnMoving: ASPxClientEvent>; + /** + * Fires before a group row is expanded. + */ + RowExpanding: ASPxClientEvent>; + /** + * Fires before a group row is collapsed. + */ + RowCollapsing: ASPxClientEvent>; + /** + * Fires before a detail row is expanded. + */ + DetailRowExpanding: ASPxClientEvent>; + /** + * Fires before a detail row is collapsed. + */ + DetailRowCollapsing: ASPxClientEvent>; + /** + * Fires on the client when a data row is clicked. + */ + RowClick: ASPxClientEvent>; + /** + * Fires on the client when a data row is double clicked. + */ + RowDblClick: ASPxClientEvent>; + /** + * Occurs after an end-user right clicks in the GridView, and enables you to provide a custom context menu. + */ + ContextMenu: ASPxClientEvent>; + /** + * Fires on the client side when a context menu item has been clicked. + */ + ContextMenuItemClick: ASPxClientEvent>; + /** + * Enables you to specify whether row data is valid and provide an error text. + */ + BatchEditRowValidating: ASPxClientEvent>; + /** + * Enables you to prevent a batch edit confirmation message from being displayed. + */ + BatchEditConfirmShowing: ASPxClientEvent>; + /** + * Occurs when a grid switches to batch edit mode. + */ + BatchEditStartEditing: ASPxClientEvent>; + /** + * Occurs when a grid leaves the batch edit mode. + */ + BatchEditEndEditing: ASPxClientEvent>; + /** + * Enables you to provide navigation for editors contained in a templated cell in Batch Edit mode. + */ + BatchEditTemplateCellFocused: ASPxClientEvent>; + /** + * Occurs on the client side before data changes are saved in batch edit mode. + */ + BatchEditChangesSaving: ASPxClientEvent>; + /** + * Occurs on the client side before data changes are canceled in batch edit mode. + */ + BatchEditChangesCanceling: ASPxClientEvent>; + /** + * Occurs on the client side before a data row is inserted in batch edit mode. + */ + BatchEditRowInserting: ASPxClientEvent>; + /** + * Occurs on the client side before a data row is deleted in batch edit mode. + */ + BatchEditRowDeleting: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any unhandled server error occurs during server-side processing of a callback sent by the ASPxClientGridView. + */ + CallbackError: ASPxClientEvent>; + /** + * Fires after the Customization Window has been closed. + */ + CustomizationWindowCloseUp: ASPxClientEvent>; + /** + * Selects or deselects the specified row displayed on the current page. + * @param visibleIndex A zero-based integer value that specifies the row's visible index. + * @param selected true to select the specified row; false to deselect the row. + */ + SelectRowOnPage(visibleIndex: number, selected?: boolean): void; + /** + * Deselects the specified row (if selected) displayed on the current page. + * @param visibleIndex A zero-based integer value that specifies the row's visible index. + */ + UnselectRowOnPage(visibleIndex: number): void; + /** + * Selects all unselected rows displayed on the current page. + */ + SelectAllRowsOnPage(): void; + /** + * Allows you to select or deselect all rows displayed on the current page based on the parameter passed. + * @param selected true to select all unselected rows displayed on the current page; false to deselect all selected rows on the page. + */ + SelectAllRowsOnPage(selected: boolean): void; + /** + * Deselects all selected rows displayed on the current page. + */ + UnselectAllRowsOnPage(): void; + /** + * Returns the number of selected rows. + */ + GetSelectedRowCount(): number; + /** + * Indicates whether or not the specified row is selected within the current page. + * @param visibleIndex An integer value that identifies the row by its visible index. + */ + IsRowSelectedOnPage(visibleIndex: number): boolean; + /** + * Indicates whether the specified row is a group row. + * @param visibleIndex An integer value that identifies the row by its visible index. + */ + IsGroupRow(visibleIndex: number): boolean; + /** + * Indicates whether the specified row is a data row. + * @param visibleIndex An integer value that identifies the row by its visible index. + */ + IsDataRow(visibleIndex: number): boolean; + /** + * Indicates whether the specified group row is expanded. + * @param visibleIndex An integer value that identifies the group row by its visible index. + */ + IsGroupRowExpanded(visibleIndex: number): boolean; + /** + * Returns the current vertical scroll position of the grid's content. + */ + GetVertScrollPos(): number; + /** + * Returns the current horizontal scroll position of the grid's content. + */ + GetHorzScrollPos(): number; + /** + * Returns the current horizontal scroll position of the grid's content. + */ + GetHorizontalScrollPosition(): number; + /** + * Specifies the vertical scroll position for the grid's content. + * @param position An integer value specifying the vertical scroll position. + */ + SetVertScrollPos(position: number): void; + /** + * Specifies the horizontal scroll position for the grid's content. + * @param position An integer value specifying the horizontal scroll position. + */ + SetHorzScrollPos(position: number): void; + /** + * Specifies the horizontal scroll position for the grid's content. + * @param position An integer value specifying the horizontal scroll position. + */ + SetHorizontalScrollPosition(position: number): void; + /** + * Applies a filter specified in the filter row to the GridView. + */ + ApplyOnClickRowFilter(): void; + /** + * Returns the editor used to edit the value in the auto filter row for the specified data column. + * @param column An ASPxClientGridViewColumn object that represents the data colum within the ASPxGridView. + */ + GetAutoFilterEditor(column: ASPxClientGridViewColumn): Object; + /** + * Returns the editor used to edit the value in the auto filter row for the specified data column. + * @param columnIndex An integer value that identifies the data column by its index. + */ + GetAutoFilterEditor(columnIndex: number): Object; + /** + * Returns the editor used to edit the value in the auto filter row for the specified data column. + * @param columnFieldNameOrId A string value that specifies the column's name or its data base field name. + */ + GetAutoFilterEditor(columnFieldNameOrId: string): Object; + /** + * Applies a filter to the specified data column. + * @param column An ASPxClientGridViewColumn object that represents the data column within the client GridView. + * @param val A string value that specifies the filter expression. + */ + AutoFilterByColumn(column: ASPxClientGridViewColumn, val: string): void; + /** + * Applies a filter to the specified data column. + * @param columnIndex An integer value that specifies the column's position within the column collection. + * @param val A string value that specifies the filter expression. + */ + AutoFilterByColumn(columnIndex: number, val: string): void; + /** + * Applies a filter to the specified data column. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + * @param val A string value that specifies the filter expression. + */ + AutoFilterByColumn(columnFieldNameOrId: string, val: string): void; + /** + * Applies the specified search panel filter criterion to grid data. + * @param value A string value that specifies the filter criterion. + */ + ApplySearchPanelFilter(value: string): void; + /** + * Applies the specified filter expression to the GridView. + * @param filterExpression A string value that specifies the filter expression. + */ + ApplyFilter(filterExpression: string): void; + /** + * Clears the filter expression applied to a client GridView. + */ + ClearFilter(): void; + /** + * Gets the Popup Edit Form. + */ + GetPopupEditForm(): ASPxClientPopupControl; + /** + * Sets input focus to the grid. + */ + Focus(): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param args A string value that represents any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(args: string): void; + /** + * Selects the specified page. + * @param pageIndex An integer value that specifies the active page's index. + */ + GotoPage(pageIndex: number): void; + /** + * Gets the index of the page currently being selected. + */ + GetPageIndex(): number; + /** + * Gets the number of pages to which the grid's data is divided. + */ + GetPageCount(): number; + /** + * Activates the next page. + */ + NextPage(): void; + /** + * Activates the previous page. + */ + PrevPage(): void; + /** + * Returns the index of the first data row displayed within the GridView's active page. + */ + GetTopVisibleIndex(): number; + /** + * Indicates whether the grid is in edit mode. + */ + IsEditing(): boolean; + /** + * Saves all the changes made and switches the grid to browse mode. + */ + UpdateEdit(): void; + /** + * Cancels all the changes made and switches the GridView to browse mode. + */ + CancelEdit(): void; + /** + * Updates data displayed within the grid. + */ + Refresh(): void; + /** + * Indicates whether the Customization Window is displayed. + */ + IsCustomizationWindowVisible(): boolean; + /** + * Invokes the Customization Window. + */ + ShowCustomizationWindow(): void; + /** + * Invokes the Customization Window and displays it over the specified HTML element. + * @param showAtElement An object that specifies the HTML element relative to whose position the customization window is invoked. + */ + ShowCustomizationWindow(showAtElement?: Object): void; + /** + * Closes the Customization Window. + */ + HideCustomizationWindow(): void; + /** + * Returns the number of columns within the client GridView. + */ + GetColumnsCount(): number; + /** + * Returns the number of columns within the client GridView. + */ + GetColumnCount(): number; + /** + * Returns the row values displayed within all selected rows. + * @param fieldNames The names of data source fields separated via a semicolon, whose values within the selected rows are returned. + * @param onCallback A ASPxClientGridViewValuesCallback object that represents the JavaScript function which receives the list of row values as a parameter. + */ + GetSelectedFieldValues(fieldNames: string, onCallback: ASPxClientGridViewValuesCallback): void; + /** + * Returns key values of selected rows displayed within the current page. + */ + GetSelectedKeysOnPage(): Object[]; + /** + * Sends a callback to the server and generates the server-side CustomDataCallback event. + * @param args A string value that is any information that needs to be sent to the server-side CustomDataCallback event. + * @param onCallback A ASPxClientGridViewValuesCallback object that is the JavaScript function which receives the information on the client side. + */ + GetValuesOnCustomCallback(args: string, onCallback: ASPxClientGridViewValuesCallback): void; + /** + * Returns the values of the specified data source fields within the specified row. + * @param visibleIndex An integer value that identifies the data row. + * @param fieldNames The names of data source fields separated via a semicolon, whose values within the specified row are returned. + * @param onCallback An ASPxClientGridViewValuesCallback object that represents the JavaScript function which receives the list of row values as a parameter. + */ + GetRowValues(visibleIndex: number, fieldNames: string, onCallback: ASPxClientGridViewValuesCallback): void; + /** + * Returns the row values displayed within the current page. + * @param fieldNames The names of data source fields whose values are returned. + * @param onCallback A ASPxClientGridViewValuesCallback object that represents the JavaScript function which receives the list of row values as a parameter. + */ + GetPageRowValues(fieldNames: string, onCallback: ASPxClientGridViewValuesCallback): void; + /** + * Returns the number of rows actually displayed within the active page. + */ + GetVisibleRowsOnPage(): number; + /** + * Returns the client column that resides at the specified position within the column collection. + * @param columnIndex A zero-based index that identifies the column within the column collection (the column's Index property value). + */ + GetColumn(columnIndex: number): ASPxClientGridViewColumn; + /** + * Returns the column with the specified unique identifier. + * @param columnId A string value that specifies the column's unique identifier (the column's Name property value). + */ + GetColumnById(columnId: string): ASPxClientGridViewColumn; + /** + * Returns the client column which is bound to the specified data source field. + * @param columnFieldName A string value that specifies the name of the data source field to which the column is bound (the column's FieldName property value). + */ + GetColumnByField(columnFieldName: string): ASPxClientGridViewColumn; + /** + * Returns the editor used to edit the specified column's values. + * @param column An ASPxClientGridViewColumn object that specifies the required column within the client grid. + */ + GetEditor(column: ASPxClientGridViewColumn): ASPxClientEdit; + /** + * Returns the editor used to edit the specified column's values. + * @param columnIndex An integer value that specifies the column's position within the column collection. + */ + GetEditor(columnIndex: number): ASPxClientEdit; + /** + * Returns the editor used to edit the specified column's values. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + */ + GetEditor(columnFieldNameOrId: string): ASPxClientEdit; + /** + * Returns the value of the specified edit cell. + * @param column An ASPxClientGridViewColumn object that represents the data column within the client grid. + */ + GetEditValue(column: ASPxClientGridViewColumn): string; + /** + * Returns the value of the specified edit cell. + * @param columnIndex An integer value that identifies the data column within the grid's column collection. + */ + GetEditValue(columnIndex: number): string; + /** + * Returns the value of the specified edit cell. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + */ + GetEditValue(columnFieldNameOrId: string): string; + /** + * Moves focus to the specified edit cell within the edited row. + * @param column An ASPxClientGridViewColumn object that represents the data column within the client grid. + */ + FocusEditor(column: ASPxClientGridViewColumn): void; + /** + * Moves focus to the specified edit cell within the edited row. + * @param columnIndex An integer value that specifies the column's position within the columns collection. + */ + FocusEditor(columnIndex: number): void; + /** + * Moves focus to the specified edit cell within the edited row. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + */ + FocusEditor(columnFieldNameOrId: string): void; + /** + * Sets the value of the specified edit cell. + * @param column An ASPxClientGridViewColumn object that represents the data column within the client grid. + * @param value A string value that specifies the edit cell's new value. + */ + SetEditValue(column: ASPxClientGridViewColumn, value: string): void; + /** + * Sets the value of the specified edit cell. + * @param columnIndex An integer value that identifies the data column within the grid's column collection. + * @param value A string value that specifies the edit cell's new value. + */ + SetEditValue(columnIndex: number, value: string): void; + /** + * Sets the value of the specified edit cell. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + * @param value A string value that specifies the edit cell's new value. + */ + SetEditValue(columnFieldNameOrId: string, value: string): void; + /** + * Displays the Filter Control. + */ + ShowFilterControl(): void; + /** + * Hides the Filter Control. + */ + CloseFilterControl(): void; + /** + * Enables or disables the current filter. + * @param isFilterEnabled true to enable the current filter; otherwise, false. + */ + SetFilterEnabled(isFilterEnabled: boolean): void; + /** + * Returns the current vertical scroll position of the grid's content. + */ + GetVerticalScrollPosition(): number; + /** + * Specifies the vertical scroll position for the grid's content. + * @param position An integer value specifying the vertical scroll position. + */ + SetVerticalScrollPosition(position: number): void; + /** + * Gets information about a focused cell. + */ + GetFocusedCell(): ASPxClientGridViewCellInfo; + /** + * Focuses the specified cell. + * @param rowVisibleIndex An integer value that specifies the visible index of the row. + * @param columnIndex A zero-based index that identifies the column in the column collection (the column's Index property value). + */ + SetFocusedCell(rowVisibleIndex: number, columnIndex: number): void; + /** + * Sorts data by the specified data column's values. + * @param column An ASPxClientGridViewColumn object that represents the data column. + */ + SortBy(column: ASPxClientGridViewColumn): void; + /** + * Sorts data by the specified data column's values. + * @param columnIndex An integer value that specifies the column's position within the column collection. + */ + SortBy(columnIndex: number): void; + /** + * Sorts data by the specified data column's values. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + */ + SortBy(columnFieldNameOrId: string): void; + /** + * Sorts data by the specified data column's values. + * @param column An ASPxClientGridViewColumn object that represents the data column. + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DSC' or 'NONE'). + */ + SortBy(column: ASPxClientGridViewColumn, sortOrder: string): void; + /** + * Sorts data by the specified data column's values. + * @param columnIndex An integer value that specifies the column's position within the column collection. + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DSC' or 'NONE'). + */ + SortBy(columnIndex: number, sortOrder: string): void; + /** + * Sorts data by the specified data column's values. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DSC' or 'NONE'). + */ + SortBy(columnFieldNameOrId: string, sortOrder: string): void; + /** + * Sorts data by the specified data column's values. + * @param column An ASPxClientGridViewColumn object that represents the data column. + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DSC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + */ + SortBy(column: ASPxClientGridViewColumn, sortOrder: string, reset: boolean): void; + /** + * Sorts data by the specified data column's values. + * @param columnIndex An integer value that specifies the column's position within the column collection. + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DSC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + */ + SortBy(columnIndex: number, sortOrder: string, reset: boolean): void; + /** + * Sorts data by the specified data column's values. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DSC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + */ + SortBy(columnFieldNameOrId: string, sortOrder: string, reset: boolean): void; + /** + * Sorts data by the specified data column's values, and places the column to the specified position among the sorted columns. + * @param column An ASPxClientGridViewColumn object that represents the data column. + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DSC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + * @param sortIndex An integer value that specifies the zero-based column's index among the sorted columns. -1 if data is not sorted by this column. + */ + SortBy(column: ASPxClientGridViewColumn, sortOrder: string, reset: boolean, sortIndex: number): void; + /** + * Sorts data by the specified data column's values, and places the column to the specified position among the sorted columns. + * @param columnIndex An integer value that specifies the column's position within the column collection. + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DSC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + * @param sortIndex An integer value that specifies the zero-based column's index among the sorted columns. -1 if data is not sorted by this column. + */ + SortBy(columnIndex: number, sortOrder: string, reset: boolean, sortIndex: number): void; + /** + * Sorts data by the specified data column's values, and places the column to the specified position among the sorted columns. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DSC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + * @param sortIndex An integer value that specifies the zero-based column's index among the sorted columns. -1 if data is not sorted by this column. + */ + SortBy(columnFieldNameOrId: string, sortOrder: string, reset: boolean, sortIndex: number): void; + /** + * Hides the specified column. + * @param column An ASPxClientGridViewColumn object that represents the column to hide. + */ + MoveColumn(column: ASPxClientGridViewColumn): void; + /** + * Hides the specified column. + * @param columnIndex An integer value that specifies the absolute index of the column to hide. + */ + MoveColumn(columnIndex: number): void; + /** + * Hides the specified column. + * @param columnFieldNameOrId A String value that identifies the column to be hidden by the name of the data source field to which the column is bound, or by the column's name. + */ + MoveColumn(columnFieldNameOrId: string): void; + /** + * Moves the specified column to the specified visual position within the grid. + * @param column An ASPxClientGridViewColumn object that represents the column to move. + * @param moveToColumnVisibleIndex An integer value that specifies the column's position among the visible columns within the grid. + */ + MoveColumn(column: ASPxClientGridViewColumn, moveToColumnVisibleIndex: number): void; + /** + * Moves the specified column to the specified visual position within the grid. + * @param columnIndex An integer value that specifies the absolute index of the column to move. + * @param moveToColumnVisibleIndex An integer value that specifies the column's position among the visible columns within the grid. + */ + MoveColumn(columnIndex: number, moveToColumnVisibleIndex: number): void; + /** + * Moves the specified column to the specified visual position within the grid. + * @param columnFieldNameOrId A String value that identifies the column to be moved by the name of the data source field to which the column is bound or by the column's name. + * @param moveToColumnVisibleIndex An integer value that specifies the column's position among the visible columns within the grid. + */ + MoveColumn(columnFieldNameOrId: string, moveToColumnVisibleIndex: number): void; + /** + * Moves the specified column to the specified visual position within the grid. + * @param column An ASPxClientGridViewColumn object that represents the column to move. + * @param moveToColumnVisibleIndex An integer value that identifies the target column displayed within the grid. + * @param moveBefore true to move the column before the target column; otherwise, false. + */ + MoveColumn(column: ASPxClientGridViewColumn, moveToColumnVisibleIndex: number, moveBefore: boolean): void; + /** + * Moves the specified column to the specified visual position within the grid. + * @param columnIndex An integer value that specifies the absolute index of the column to move. + * @param moveToColumnVisibleIndex An integer value that identifies the target column displayed within the grid. + * @param moveBefore true to move the column before the target column; otherwise, false. + */ + MoveColumn(columnIndex: number, moveToColumnVisibleIndex: number, moveBefore: boolean): void; + /** + * Moves the specified column to the specified visual position within the grid. + * @param columnFieldNameOrId A string value that identifies the column to be moved by the name of the data source field to which the column is bound or by the column's name. + * @param moveToColumnVisibleIndex An integer value that identifies the target column displayed within the grid. + * @param moveBefore true to move the column before the target column; otherwise, false. + */ + MoveColumn(columnFieldNameOrId: string, moveToColumnVisibleIndex: number, moveBefore: boolean): void; + /** + * Moves the specified column to the specified visual position within the grid and optionally groups the grid's data by this column. + * @param column An ASPxClientGridViewColumn object that represents the column to move. + * @param moveToColumnVisibleIndex An integer value that identifies the target column displayed within the grid. + * @param moveBefore true to move the column before the target column; otherwise, false. + * @param moveToGroup true to group the grid's data by the column; otherwise, false. + */ + MoveColumn(column: ASPxClientGridViewColumn, moveToColumnVisibleIndex: number, moveBefore: boolean, moveToGroup: boolean): void; + /** + * Moves the specified column to the specified visual position within the grid and optionally groups the grid's data by this column. + * @param columnIndex An integer value that specifies the absolute index of the column to move. + * @param moveToColumnVisibleIndex An integer value that identifies the target column displayed within the grid. + * @param moveBefore true to move the column before the target column; otherwise, false. + * @param moveToGroup true to group the ASPxGridView's data by the column; otherwise, false. + */ + MoveColumn(columnIndex: number, moveToColumnVisibleIndex: number, moveBefore: boolean, moveToGroup: boolean): void; + /** + * Moves the specified column to the specified visual position within the grid and optionally groups the grid's data by this column. + * @param columnFieldNameOrId A string value that identifies the column to be moved by the name of the data source field to which the column is bound or by the column's name. + * @param moveToColumnVisibleIndex An integer value that identifies the target column displayed within the grid. + * @param moveBefore true to move the column before the target column; otherwise, false. + * @param moveToGroup true to group the grid's data by the column; otherwise, false. + */ + MoveColumn(columnFieldNameOrId: string, moveToColumnVisibleIndex: number, moveBefore: boolean, moveToGroup: boolean): void; + /** + * Moves the specified column to the specified visual position within the grid and optionally groups or ungroups the grid's data by this column. + * @param column An ASPxClientGridViewColumn object that represents the column to move. + * @param moveToColumnVisibleIndex An integer value that identifies the target column displayed within the grid. + * @param moveBefore true to move the column before the target column; otherwise, false. + * @param moveToGroup true to group the grid's data by the column; otherwise, false. + * @param moveFromGroup true to ungroup the grid's data by the column; otherwise, false. + */ + MoveColumn(column: ASPxClientGridViewColumn, moveToColumnVisibleIndex: number, moveBefore: boolean, moveToGroup: boolean, moveFromGroup: boolean): void; + /** + * Moves the specified column to the specified visual position within the grid and optionally groups or ungroups the grid's data by this column. + * @param columnIndex An integer value that specifies the absolute index of the column to move. + * @param moveToColumnVisibleIndex An integer value that identifies the target column displayed within the grid. + * @param moveBefore true to move the column before the target column; otherwise, false. + * @param moveToGroup true to group the grid's data by the column; otherwise, false. + * @param moveFromGroup true to ungroup the grid's data by the column; otherwise, false. + */ + MoveColumn(columnIndex: number, moveToColumnVisibleIndex: number, moveBefore: boolean, moveToGroup: boolean, moveFromGroup: boolean): void; + /** + * Moves the specified column to the specified visual position within the grid and optionally groups or ungroups the grid's data by this column. + * @param columnFieldNameOrId A string value that identifies the column to be moved by the name of the data source field to which the column is bound or by the column's name. + * @param moveToColumnVisibleIndex An integer value that identifies the target column displayed within the grid. + * @param moveBefore true to move the column before the target column; otherwise, false. + * @param moveToGroup true to group the grid's data by the column; otherwise, false. + * @param moveFromGroup true to ungroup the grid's data by the column; otherwise, false. + */ + MoveColumn(columnFieldNameOrId: string, moveToColumnVisibleIndex: number, moveBefore: boolean, moveToGroup: boolean, moveFromGroup: boolean): void; + /** + * Groups data by the values of the specified column. + * @param column An ASPxClientGridViewColumn object that represents the data column by whose values data is grouped. + */ + GroupBy(column: ASPxClientGridViewColumn): void; + /** + * Groups data by the values of the specified column. + * @param columnIndex An integer value that specifies the column's position within the column collection. + */ + GroupBy(columnIndex: number): void; + /** + * Groups data by the values of the specified column. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + */ + GroupBy(columnFieldNameOrId: string): void; + /** + * Groups data by the values of the specified data column. If several columns are involved in grouping, the specified column will reside at the specified grouping level. + * @param column An ASPxClientGridViewColumn object that represents the data column by whose values data is grouped. + * @param groupIndex An integer value that specifies the grouping level. -1 to cancel grouping by the column's values. + */ + GroupBy(column: ASPxClientGridViewColumn, groupIndex: number): void; + /** + * Groups data by the values of the specified data column. If several columns are involved in grouping, the specified column will reside at the specified grouping level. + * @param columnIndex An integer value that specifies the column's position within the column collection. + * @param groupIndex An integer value that specifies the grouping level. -1 to cancel grouping by the column's values. + */ + GroupBy(columnIndex: number, groupIndex: number): void; + /** + * Groups data by the values of the specified data column. If several columns are involved in grouping, the specified column will reside at the specified grouping level. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + * @param groupIndex An integer value that specifies the grouping level. -1 to cancel grouping by the column's values. + */ + GroupBy(columnFieldNameOrId: string, groupIndex: number): void; + /** + * Groups data by the values of the specified data column with the specified sort order. If several columns are involved in grouping, the specified column will reside at the specified grouping level. + * @param column An ASPxClientGridViewColumn object that represents the data column by whose values data is grouped. + * @param groupIndex An integer value that specifies the grouping level. -1 to cancel grouping by the column's values. + * @param sortOrder A string value that specifies the column's sort order. + */ + GroupBy(column: ASPxClientGridViewColumn, groupIndex: number, sortOrder: string): void; + /** + * Groups data by the values of the specified data column with the specified sort order. If several columns are involved in grouping, the specified column will reside at the specified grouping level. + * @param columnIndex An integer value that specifies the column's position within the column collection. + * @param groupIndex An integer value that specifies the grouping level. -1 to cancel grouping by the column's values. + * @param sortOrder A string value that specifies the column's sort order. + */ + GroupBy(columnIndex: number, groupIndex: number, sortOrder: string): void; + /** + * Groups data by the values of the specified data column with the specified sort order. If several columns are involved in grouping, the specified column will reside at the specified grouping level. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + * @param groupIndex An integer value that specifies the grouping level. -1 to cancel grouping by the column's values. + * @param sortOrder A string value that specifies the column's sort order. + */ + GroupBy(columnFieldNameOrId: string, groupIndex: number, sortOrder: string): void; + /** + * Ungroups data by the values of the specified column. + * @param column An ASPxClientGridViewColumn object that represents the data column within the ASPxGridView. + */ + UnGroup(column: ASPxClientGridViewColumn): void; + /** + * Ungroups data by the values of the specified column. + * @param columnIndex An integer value that specifies the column's position within the column collection. + */ + UnGroup(columnIndex: number): void; + /** + * Ungroups data by the values of the specified column. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + */ + UnGroup(columnFieldNameOrId: string): void; + /** + * Expands all group rows. + */ + ExpandAll(): void; + /** + * Collapses all group rows. + */ + CollapseAll(): void; + /** + * Expands all detail rows. + */ + ExpandAllDetailRows(): void; + /** + * Collapses all detail rows. + */ + CollapseAllDetailRows(): void; + /** + * Expands the specified group row preserving the collapsed state of any child group row. + * @param visibleIndex An integer value that identifies the group row. + */ + ExpandRow(visibleIndex: number): void; + /** + * Expands the specified group row and optionally child group rows at all nesting levels. + * @param visibleIndex An integer value that identifies the group row. + * @param recursive true to expand any child group rows at all nesting levels; false to preserve the collapsed state of any child group rows. + */ + ExpandRow(visibleIndex: number, recursive?: boolean): void; + /** + * Collapses the specified group row preserving the expanded state of child group rows. + * @param visibleIndex An integer value that identifies the group row by its visible index. + */ + CollapseRow(visibleIndex: number): void; + /** + * Collapses the specified group row and optionally child group rows at all nesting levels. + * @param visibleIndex An integer value that identifies the group row by its visible index. + * @param recursive true to collapse child group rows at all nesting levels; false to preserve the expanded state of any child group row. + */ + CollapseRow(visibleIndex: number, recursive?: boolean): void; + /** + * Scrolls the view to the specified row. + * @param visibleIndex An integer value that identifies a row by its visible index. + */ + MakeRowVisible(visibleIndex: number): void; + /** + * Expands the specified detail row. + * @param visibleIndex A zero-based integer index that identifies the detail row. + */ + ExpandDetailRow(visibleIndex: number): void; + /** + * Collapses the specified detail row. + * @param visibleIndex A zero-based integer index that identifies the detail row. + */ + CollapseDetailRow(visibleIndex: number): void; + /** + * Returns the key value of the specified data row. + * @param visibleIndex An integer value that specifies the row's visible index. + */ + GetRowKey(visibleIndex: number): string; + /** + * Switches the grid to edit mode. + * @param visibleIndex A zero-based integer that identifies a data row to be edited. + */ + StartEditRow(visibleIndex: number): void; + /** + * Switches the grid to edit mode. + * @param key An object that uniquely identifies a data row to be edited. + */ + StartEditRowByKey(key: Object): void; + /** + * Indicates whether or not a new row is being edited. + */ + IsNewRowEditing(): boolean; + /** + * Adds a new record. + */ + AddNewRow(): void; + /** + * Deletes the specified row. + * @param visibleIndex An integer value that identifies the row. + */ + DeleteRow(visibleIndex: number): void; + /** + * Deletes a row with the specified key value. + * @param key An object that uniquely identifies the row. + */ + DeleteRowByKey(key: Object): void; + /** + * Returns the focused row's index. + */ + GetFocusedRowIndex(): number; + /** + * Moves focus to the specified row. + * @param visibleIndex An integer value that specifies the focused row's index. + */ + SetFocusedRowIndex(visibleIndex: number): void; + /** + * Selects all the unselected rows within the grid. + */ + SelectRows(): void; + /** + * Selects the specified row displayed within the grid. + * @param visibleIndex A zero-based integer value that specifies the row's visible index. + */ + SelectRows(visibleIndex: number): void; + /** + * Selects the specified rows within the grid. + * @param visibleIndices An array of zero-based indices that identify data rows within the grid. + */ + SelectRows(visibleIndices: number[]): void; + /** + * Selects or deselects the specified rows within the grid. + * @param visibleIndices An array of zero-based indices that identify data rows within the grid. + * @param selected true to select the specified rows; false to deselect the rows. + */ + SelectRows(visibleIndices: number[], selected: boolean): void; + /** + * Selects or deselects the specified row within the grid. + * @param visibleIndex An integer zero-based index that identifies the data row within the grid. + * @param selected true to select the specified row; false to deselect the row. + */ + SelectRows(visibleIndex: number, selected?: boolean): void; + /** + * Selects or deselects the specified rows displayed within the grid. + * @param keys An array of objects that uniquely identify the rows. + * @param selected true to select the specified rows; false to deselect the rows. + */ + SelectRowsByKey(keys: Object[], selected?: boolean): void; + /** + * Selects or deselects the specified row displayed within the grid. + * @param key An object that uniquely identifies the row. + * @param selected true to select the specified row; false to deselect the row. + */ + SelectRowsByKey(key: Object, selected?: boolean): void; + /** + * Selects the specified rows displayed within the grid. + * @param keys An array of objects that uniquely identify the rows. + */ + SelectRowsByKey(keys: Object[]): void; + /** + * Selects a grid row by its key. + * @param key An object that uniquely identifies the row. + */ + SelectRowsByKey(key: Object): void; + /** + * Deselects the specified rows displayed within the grid. + * @param keys An array of objects that uniquely identify the rows. + */ + UnselectRowsByKey(keys: Object[]): void; + /** + * Deselects the specified row displayed within the grid. + * @param key An object that uniquely identifies the row. + */ + UnselectRowsByKey(key: Object): void; + /** + * Deselects all the selected rows within the grid. + */ + UnselectRows(): void; + /** + * Deselects the specified rows (if selected) within the grid. + * @param visibleIndices An array of zero-based indices that identify data rows within the grid. + */ + UnselectRows(visibleIndices: number[]): void; + /** + * Deselects the specified row (if selected) within the grid. + * @param visibleIndex A zero-based integer value that specifies the row's visible index. + */ + UnselectRows(visibleIndex: number): void; + /** + * Deselects all grid rows that match the filter criteria currently applied to the grid. + */ + UnselectFilteredRows(): void; + /** + * Selects the specified row displayed on the current page. + * @param visibleIndex A zero-based integer value that specifies the row's visible index. + */ + SelectRowOnPage(visibleIndex: number): void; +} +/** + * A client grid column. + */ +interface ASPxClientGridViewColumn extends ASPxClientGridColumnBase { + /** + * Gets the column's unique identifier. + * Value: A string value that specifies the column's unique identifier. + */ + id: string; + /** + * Gets the name that uniquely identifies the column. + * Value: A string value assigned to the column's Name property. + */ + name: string; + /** + * Gets the column's position within the collection. + * Value: An integer zero-bazed index that specifies the column's position within the collection. + */ + index: number; + /** + * Gets the name of the database field assigned to the current column. + * Value: A string value that specifies the name of a data field. + */ + fieldName: string; + /** + * Gets whether the column is visible. + * Value: true to display the column; otherwise, false. + */ + visible: boolean; +} +/** + * Represents a JavaScript function which receives the list of row values when the client GetSelectedFieldValues method is called. + */ +interface ASPxClientGridViewValuesCallback { + /** + * Represents a JavaScript function which receives the list of row values when the client GetSelectedFieldValues method is called. + * @param result An object that represents the list of row values received from the server. + */ + (result: Object): void; +} +/** + * A method that will handle the cancelable events of a client ASPxGridView column. + */ +interface ASPxClientGridViewColumnCancelEventHandler { + /** + * A method that will handle the cancelable events of a client ASPxGridView column. + * @param source The event source. + * @param e An ASPxClientGridViewColumnCancelEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewColumnCancelEventArgs): void; +} +/** + * Provides data for the cancelable events of a client ASPxGridView column. + */ +interface ASPxClientGridViewColumnCancelEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the processed client column. + * Value: An ASPxClientGridViewColumn object that represents the processed column. + */ + column: ASPxClientGridViewColumn; +} +/** + * A method that will handle the client events concerned with column processing. + */ +interface ASPxClientGridViewColumnProcessingModeEventHandler { + /** + * A method that will handle the client events concerned with column processing. + * @param source The event source. + * @param e A ASPxClientGridViewColumnProcessingModeEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewColumnProcessingModeEventArgs): void; +} +/** + * Provides data for the client events concerned with column processing, and that allow the event's processing to be passed to the server side. + */ +interface ASPxClientGridViewColumnProcessingModeEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets a grid column related to the event. + * Value: An ASPxClientGridViewColumn object representing the column related to the event. + */ + column: ASPxClientGridViewColumn; +} +/** + * A method that will handle the RowExpanding events. + */ +interface ASPxClientGridViewRowCancelEventHandler { + /** + * A method that will handle the RowExpanding events. + * @param source The event source. + * @param e An ASPxClientGridViewRowCancelEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewRowCancelEventArgs): void; +} +/** + * Provides data for the RowExpanding events. + */ +interface ASPxClientGridViewRowCancelEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the processed row's visible index. + * Value: An integer zero-based index that identifies the processed row. + */ + visibleIndex: number; +} +/** + * A method that will handle the SelectionChanged event. + */ +interface ASPxClientGridViewSelectionEventHandler { + /** + * A method that will handle the SelectionChanged event. + * @param source The event source. + * @param e An ASPxClientGridViewSelectionEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewSelectionEventArgs): void; +} +/** + * Provides data for the SelectionChanged event. + */ +interface ASPxClientGridViewSelectionEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the visible index of the row whose selected state has been changed. + * Value: An value that specifies the visible index of the row. + */ + visibleIndex: number; + /** + * Gets whether the row has been selected. + * Value: true if the row has been selected; otherwise, false. + */ + isSelected: boolean; + /** + * Gets whether all rows displayed within a page have been selected or unselected. + * Value: true if all rows displayed within a page have been selected or unselected; otherwise, false. + */ + isAllRecordsOnPage: boolean; + /** + * Gets whether a selection has been changed on the server. + * Value: true if a selection has been changed on the server; otherwise, false. + */ + isChangedOnServer: boolean; +} +/** + * A method that will handle the RowClick events. + */ +interface ASPxClientGridViewRowClickEventHandler { + /** + * A method that will handle the RowClick event. + * @param source The event source. This parameter identifies the ASPxClientGridView object that raised the event. + * @param e An ASPxClientGridViewRowClickEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewRowClickEventArgs): void; +} +/** + * Provides data for the RowClick event. + */ +interface ASPxClientGridViewRowClickEventArgs extends ASPxClientGridViewRowCancelEventArgs { + /** + * Provides access to the parameters associated with the RowClick event. + * Value: An object that contains parameters associated with the event. + */ + htmlEvent: Object; +} +/** + * A method that will handle the ContextMenu event. + */ +interface ASPxClientGridViewContextMenuEventHandler { + /** + * A method that will handle the ContextMenu event. + * @param source The event source. + * @param e An ASPxClientGridViewContextMenuEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewContextMenuEventArgs): void; +} +/** + * Provides data for the ContextMenu event. + */ +interface ASPxClientGridViewContextMenuEventArgs extends ASPxClientEventArgs { + /** + * Gets which grid element has been right clicked by the user. + * Value: A String value that specifies grid element. + */ + objectType: string; + /** + * Identifies the grid element being right clicked by the user. + * Value: A zero-based integer index that identifies the grid element being clicked by the user. + */ + index: number; + /** + * Provides access to the parameters associated with the ContextMenu event. + * Value: An object that contains parameters associated with the event. + */ + htmlEvent: Object; + /** + * Gets the currently processed menu object. + * Value: An object that is the currently processed menu. + */ + menu: Object; + /** + * Specifies whether a browser context menu should be displayed. + * Value: true, to display a browser context menu; otherwise, false. The default is false. + */ + showBrowserMenu: boolean; +} +/** + * A method that will handle the client ContextMenuItemClick event. + */ +interface ASPxClientGridViewContextMenuItemClickEventHandler { + /** + * A method that will handle the ContextMenuItemClick event. + * @param source The event source. + * @param e An ASPxClientGridViewContextMenuItemClickEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewContextMenuItemClickEventArgs): void; +} +/** + * Provides data for the ContextMenuItemClick event. + */ +interface ASPxClientGridViewContextMenuItemClickEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the clicked context menu item. + * Value: An object, manipulations on which forced the event to be raised. + */ + item: ASPxClientMenuItem; + /** + * Gets which grid element has been right clicked by the user. + * Value: A String value that specifies the grid element. + */ + objectType: string; + /** + * Returns the processed element index. + * Value: An integer value that specifies the processed element index. + */ + elementIndex: number; + /** + * Specifies whether a postback or a callback is used to finally process the event on the server side. + * Value: true to perform the round trip to the server side via postback; false to perform the round trip to the server side via callback. + */ + usePostBack: boolean; + /** + * Specifies whether default context menu item click is handled manually, so no default processing is required. + * Value: true if no default processing is required; otherwise false. + */ + handled: boolean; +} +/** + * A method that will handle the CustomButtonClick event. + */ +interface ASPxClientGridViewCustomButtonEventHandler { + /** + * A method that will handle the CustomButtonClick event. + * @param source The event source. This parameter identifies the ASPxClientGridView object that raised the event. + * @param e An ASPxClientGridViewCustomButtonEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewCustomButtonEventArgs): void; +} +/** + * Provides data for the CustomButtonClick event. + */ +interface ASPxClientGridViewCustomButtonEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the value which identifies the row whose custom button has been clicked. + * Value: An integer value that identifies the row whose custom button has been clicked. + */ + visibleIndex: number; + /** + * Gets the value which identifies the custom button. + * Value: A string value that identifies the clicked custom button. + */ + buttonID: string; +} +/** + * A method that will handle the ColumnMoving event. + */ +interface ASPxClientGridViewColumnMovingEventHandler { + /** + * A method that will handle the ColumnMoving event. + * @param source The event source. + * @param e An ASPxClientGridViewColumnMovingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewColumnMovingEventArgs): void; +} +/** + * Provides data for the ColumnMoving event. + */ +interface ASPxClientGridViewColumnMovingEventArgs extends ASPxClientEventArgs { + /** + * Gets or sets whether a column is allowed to be moved. + * Value: true to allow column moving; otherwise, false. + */ + allow: boolean; + /** + * Gets the column currently being dragged by an end-user. + * Value: An ASPxClientGridViewColumn object that represents the column currently being dragged by an end-user. + */ + sourceColumn: ASPxClientGridViewColumn; + /** + * Gets the target column, before or after which the source column will be inserted (if dropped). + * Value: An ASPxClientGridViewColumn object that represents the target column. null (Nothing in Visual Basic) if the source column isn't over the column header panel. + */ + destinationColumn: ASPxClientGridViewColumn; + /** + * Gets whether the source column will be inserted before the target column (if dropped). + * Value: true if the source column will be inserted before the target column (if dropped); otherwise, false. + */ + isDropBefore: boolean; + /** + * Gets whether the source column is currently over the Group Panel. + * Value: true if the source column is currently over the Group Panel; otherwise, false. + */ + isGroupPanel: boolean; +} +/** + * Represents an object that will handle the client-side BatchEditConfirmShowing event. + */ +interface ASPxClientGridViewBatchEditConfirmShowingEventHandler { + /** + * A method that will handle the BatchEditConfirmShowing client event. + * @param source The event source. + * @param e An ASPxClientGridViewBatchEditConfirmShowingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewBatchEditConfirmShowingEventArgs): void; +} +/** + * Provides data for the BatchEditConfirmShowing event. + */ +interface ASPxClientGridViewBatchEditConfirmShowingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the client identifier of an object that initiates a send request. + * Value: A string value that specifies the object client identifier. + */ + requestTriggerID: string; +} +/** + * A method that will handle the client BatchEditStartEditing event. + */ +interface ASPxClientGridViewBatchEditStartEditingEventHandler { + /** + * A method that will handle the BatchEditStartEditing event. + * @param source The event source. + * @param e An ASPxClientGridViewBatchEditStartEditingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewBatchEditStartEditingEventArgs): void; +} +/** + * Provides data for the BatchEditStartEditing event. + */ +interface ASPxClientGridViewBatchEditStartEditingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the visible index of the row whose cells are about to be edited. + * Value: An value that specifies the visible index of the row. + */ + visibleIndex: number; + /** + * Gets the grid column that owns a cell that is about to be edited. + * Value: An object that is the focused grid column. + */ + focusedColumn: ASPxClientGridViewColumn; + /** + * Gets a hashtable that maintains information about editable cells. + * Value: A hashtable that stores information about editable cells. + */ + rowValues: Object; +} +/** + * A method that will handle the client BatchEditEndEditing event. + */ +interface ASPxClientGridViewBatchEditEndEditingEventHandler { + /** + * A method that will handle the BatchEditEndEditing event. + * @param source The event source. + * @param e An ASPxClientGridViewBatchEditEndEditingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewBatchEditEndEditingEventArgs): void; +} +/** + * Provides data for the BatchEditEndEditing event. + */ +interface ASPxClientGridViewBatchEditEndEditingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the visible index of the row whose cells has been edited. + * Value: An value that specifies the visible index of the row. + */ + visibleIndex: number; + /** + * Gets a hashtable that maintains information about editable cells. + * Value: A hashtable that stores information about editable cells. + */ + rowValues: Object; +} +/** + * A method that will handle the client BatchEditRowValidating event. + */ +interface ASPxClientGridViewBatchEditRowValidatingEventHandler { + /** + * A method that will handle the BatchEditRowValidating event. + * @param source The event source. + * @param e An ASPxClientGridViewBatchEditRowValidatingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewBatchEditRowValidatingEventArgs): void; +} +/** + * Provides data for the BatchEditRowValidating event. + */ +interface ASPxClientGridViewBatchEditRowValidatingEventArgs extends ASPxClientEventArgs { + /** + * Gets the processed row's visible index. + * Value: An integer value that specifies the processed row's visible index. + */ + visibleIndex: number; + /** + * Provides validation information of a row currently being validated. + * Value: An object that is a hashtable containing validation information. + */ + validationInfo: Object; +} +/** + * A method that will handle the client BatchEditTemplateCellFocused event. + */ +interface ASPxClientGridViewBatchEditTemplateCellFocusedEventHandler { + /** + * A method that will handle the BatchEditTemplateCellFocused event. + * @param source An object representing the event source. Identifies the button editor that raised the event. + * @param e An ASPxClientGridViewBatchEditTemplateCellFocusedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewBatchEditTemplateCellFocusedEventArgs): void; +} +/** + * Provides data for the BatchEditTemplateCellFocused event. + */ +interface ASPxClientGridViewBatchEditTemplateCellFocusedEventArgs extends ASPxClientEventArgs { + /** + * Gets the currently processed column. + * Value: A object that is the client-side column object. + */ + column: ASPxClientGridViewColumn; + /** + * Gets or sets a value specifying whether the event was handled. + * Value: true if the event was handled and default processing should not occur; false if the event should be handled using default processing. + */ + handled: boolean; +} +/** + * A method that will handle the BatchEditChangesSaving event. + */ +interface ASPxClientGridViewBatchEditChangesSavingEventHandler { + /** + * A method that will handle the BatchEditChangesSaving event. + * @param source The event source. This parameter identifies the grid view object which raised the event. + * @param e An ASPxClientGridViewBatchEditChangesSavingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewBatchEditChangesSavingEventArgs): void; +} +/** + * Provides data for the BatchEditChangesSaving event. + */ +interface ASPxClientGridViewBatchEditChangesSavingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets a hashtable that maintains information about inserted cells. + * Value: A hashtable that stores information about inserted cells. + */ + insertedValues: Object; + /** + * Gets a hashtable that maintains information about deleted cells. + * Value: A hashtable that stores information about deleted cells. + */ + deletedValues: Object; + /** + * Gets a hashtable that maintains information about updated cells. + * Value: A hashtable that stores information about updated cells. + */ + updatedValues: Object; +} +/** + * A method that will handle the BatchEditChangesCanceling event. + */ +interface ASPxClientGridViewBatchEditChangesCancelingEventHandler { + /** + * A method that will handle the BatchEditChangesCanceling event. + * @param source The event source. This parameter identifies the grid view object which raised the event. + * @param e An ASPxClientGridViewBatchEditChangesCancelingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewBatchEditChangesCancelingEventArgs): void; +} +/** + * Provides data for the BatchEditChangesCanceling event. + */ +interface ASPxClientGridViewBatchEditChangesCancelingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets a hashtable that maintains information about inserted cells. + * Value: A hashtable that stores information about inserted cells. + */ + insertedValues: Object; + /** + * Gets a hashtable that maintains information about deleted cells. + * Value: A hashtable that stores information about deleted cells. + */ + deletedValues: Object; + /** + * Gets a hashtable that maintains information about updated cells. + * Value: A hashtable that stores information about updated cells. + */ + updatedValues: Object; +} +/** + * A method that will handle the BatchEditRowInserting event. + */ +interface ASPxClientGridViewBatchEditRowInsertingEventHandler { + /** + * A method that will handle the BatchEditRowInserting event. + * @param source The event source. This parameter identifies the card view object which raised the event. + * @param e An ASPxClientGridViewBatchEditRowInsertingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewBatchEditRowInsertingEventArgs): void; +} +/** + * Provides data for the BatchEditRowInserting event. + */ +interface ASPxClientGridViewBatchEditRowInsertingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the processed row's visible index. + * Value: An integer value that specifies the processed row's visible index. + */ + visibleIndex: number; +} +/** + * A method that will handle the BatchEditRowDeleting event. + */ +interface ASPxClientGridViewBatchEditRowDeletingEventHandler { + /** + * A method that will handle the BatchEditRowDeleting event. + * @param source The event source. This parameter identifies the grid view object which raised the event. + * @param e An ASPxClientGridViewBatchEditRowDeletingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewBatchEditRowDeletingEventArgs): void; +} +/** + * Provides data for the BatchEditRowDeleting event. + */ +interface ASPxClientGridViewBatchEditRowDeletingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the processed row's visible index. + * Value: An integer value that specifies the processed row's visible index. + */ + visibleIndex: number; + /** + * Gets a hashtable that maintains information about deleted cells. + * Value: A hashtable that stores information about deleted cells. + */ + rowValues: Object; +} +/** + * Contains information on a grid cell. + */ +interface ASPxClientGridViewCellInfo { + /** + * Gets the visible index of the row that contains the cell currently being processed. + * Value: An value that specifies the visible index of the row. + */ + rowVisibleIndex: number; + /** + * Gets the data column that contains the cell currently being processed. + * Value: An object that is the data column which contains the processed cell. + */ + column: ASPxClientGridViewColumn; +} +/** + * Provides members related to Batch Edit Mode + */ +interface ASPxClientGridViewBatchEditApi { + /** + * Performs validation of grid data when the grid operates in Batch Edit mode. + */ + ValidateRows(): boolean; + /** + * Performs validation of grid data contained in the specified row when the grid operates in Batch Edit mode. + * @param visibleIndex An integer value specifying the visible index of the validated row. + */ + ValidateRow(visibleIndex: number): boolean; + /** + * Returns an array of row visible indices. + * @param includeDeleted true, to include visible indices of deleted rows to the returned array; otherwise, false. + */ + GetRowVisibleIndices(includeDeleted: boolean): number[]; + /** + * Returns an array of the deleted row visible indices. + */ + GetDeletedRowIndices(): number[]; + /** + * Returns an array of the inserted row visible indices. + */ + GetInsertedRowIndices(): number[]; + /** + * Indicates if the row with specified visible index is deleted. + * @param visibleIndex An integer value that identifies the row by its visible index. + */ + IsDeletedRow(visibleIndex: number): boolean; + /** + * Indicates if the row with specified visible index is newly created. + * @param visibleIndex An integer value that identifies the row by its visible index. + */ + IsNewRow(visibleIndex: number): boolean; + /** + * Programmatically moves the focus to the previous cell in the row. + */ + MoveFocusBackward(): boolean; + /** + * Programmatically moves the focus to the next cell in the row. + */ + MoveFocusForward(): boolean; + /** + * Sets a value of the specified cell. + * @param visibleIndex An integer zero-based index that identifies the row containing the processed cell. + * @param columnFieldNameOrId A string value that specifies the field name or unique identifier (the column's Name property value) of a column containing the processed cell. + * @param value An object that contains the new cell value. + */ + SetCellValue(visibleIndex: number, columnFieldNameOrId: string, value: Object): void; + /** + * Sets the value of the specified cell. + * @param visibleIndex An integer zero-based index that identifies the row containing the processed cell. + * @param columnFieldNameOrId A string value that specifies the field name or unique identifier (the column's Name property value) of a column containing the processed cell. + * @param value An object that contains the new cell value. + * @param displayText A string value that specifies the cell display text. + * @param cancelCellHighlighting true to cancel highlighting of the modified cell, false to highlight the modified cell. + */ + SetCellValue(visibleIndex: number, columnFieldNameOrId: string, value: Object, displayText: string, cancelCellHighlighting?: boolean): void; + /** + * Gets the value of the specified cell. + * @param visibleIndex A zero-based integer value that specifies a visible index of a row containing the processed cell. + * @param columnFieldNameOrId A string value that specifies the field name or unique identifier (the column's Name property value) of a column containing the processed cell. + * @param initial true, to return the initial (server) value; false, to return a value currently contained on the client side (modified value). + */ + GetCellValue(visibleIndex: number, columnFieldNameOrId: string, initial?: boolean): Object; + /** + * Gets information about the cell currently being edited. + */ + GetEditCellInfo(): ASPxClientGridViewCellInfo; + /** + * Returns a value that indicates whether the grid has changed data. + */ + HasChanges(): boolean; + /** + * Returns a value that indicates whether the specified row has changed data. + * @param visibleIndex An integer value that specifies the visible index of a row. + */ + HasChanges(visibleIndex: number): boolean; + /** + * Returns a value that indicates whether the specified data cell's data has been changed. + * @param visibleIndex An integer value that specifies the visible index of a row. + * @param columnFieldNameOrId A string value that identifies the column by the name of the data source field to which the column is bound, or by the column's name. + */ + HasChanges(visibleIndex: number, columnFieldNameOrId: string): boolean; + /** + * Resets changes in the specified row. + * @param visibleIndex An integer value that specifies the visible index of a row. + */ + ResetChanges(visibleIndex: number): void; + /** + * Resets changes in the specified cell. + * @param visibleIndex An integer value that specifies the visible index of a row containing the processed cell. + * @param columnIndex A string value that specifies the field name or unique identifier (the column's Name property value) of a column containing the processed cell. + */ + ResetChanges(visibleIndex: number, columnIndex: number): void; + /** + * Switches the specified cell to edit mode. + * @param visibleIndex A zero-based integer value that specifies the visible index of a row containing the processed cell. + * @param columnIndex A zero-based integer value that identifies the column which contains the processed cell in the column collection. + */ + StartEdit(visibleIndex: number, columnIndex: number): void; + /** + * Ends cell or row editing. + */ + EndEdit(): void; +} +/** + * A client-side equivalent of the ASPxVerticalGrid object. + */ +interface ASPxClientVerticalGrid extends ASPxClientGridBase { + /** + * Provides access to the batch editing client API. + * Value: A object that exposes the batch editing client API methods. + */ + batchEditApi: ASPxClientVerticalGridBatchEditApi; + /** + * Occurs when a custom command button has been clicked. + */ + CustomButtonClick: ASPxClientEvent>; + /** + * Fires after the selection has been changed. + */ + SelectionChanged: ASPxClientEvent>; + /** + * Occurs when a grid switches to batch edit mode. + */ + BatchEditStartEditing: ASPxClientEvent>; + /** + * Occurs when a grid leaves the batch edit mode. + */ + BatchEditEndEditing: ASPxClientEvent>; + /** + * Enables you to prevent a batch edit confirmation message from being displayed. + */ + BatchEditConfirmShowing: ASPxClientEvent>; + /** + * Enables you to provide navigation for editors contained in a templated cell in Batch Edit mode. + */ + BatchEditTemplateCellFocused: ASPxClientEvent>; + /** + * Occurs on the client side before data changes are saved in batch edit mode. + */ + BatchEditChangesSaving: ASPxClientEvent>; + /** + * Occurs on the client side before data changes are canceled in batch edit mode. + */ + BatchEditChangesCanceling: ASPxClientEvent>; + /** + * Occurs on the client side before a record is inserted in batch edit mode. + */ + BatchEditRecordInserting: ASPxClientEvent>; + /** + * Occurs on the client side before a record is deleted in batch edit mode. + */ + BatchEditRecordDeleting: ASPxClientEvent>; + /** + * Enables you to specify whether record data is valid and provide an error text. + */ + BatchEditRecordValidating: ASPxClientEvent>; + /** + * Enables you to prevent rows from being sorted. + */ + RowSorting: ASPxClientEvent>; + /** + * Fires on the client side before the expansion state of a row is changed by end-user interaction. + */ + RowExpandedChanging: ASPxClientEvent>; + /** + * Fires on the client side after a row's expansion state has been changed by end-user interaction. + */ + RowExpandedChanged: ASPxClientEvent>; + /** + * Fires on the client when a record is clicked. + */ + RecordClick: ASPxClientEvent>; + /** + * Fires on the client when a record is double clicked. + */ + RecordDblClick: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any unhandled server error occurs during server-side processing of a callback sent by the ASPxClientVerticalGrid. + */ + CallbackError: ASPxClientEvent>; + /** + * Sorts data by the specified data row's values. + * @param row An ASPxClientVerticalGridRow object that represents the data row. + */ + SortBy(row: ASPxClientVerticalGridRow): void; + /** + * Sorts data by the specified data row's values. + * @param rowIndex An integer value that specifies the row's position within the row collection. + */ + SortBy(rowIndex: number): void; + /** + * Sorts data by the specified data row's values. + * @param rowFieldNameOrId A string value that specifies the row's field name or unique identifier (the row's Name property value). + */ + SortBy(rowFieldNameOrId: string): void; + /** + * Sorts data by the specified data row's values. + * @param row An ASPxClientVerticalGridRow object that represents the data row. + * @param sortOrder A string value that specifies the row's sort order ('ASC', 'DSC' or 'NONE'). + */ + SortBy(row: ASPxClientVerticalGridRow, sortOrder: string): void; + /** + * Sorts data by the specified data row's values. + * @param rowIndex An integer value that specifies the row's position within the row collection. + * @param sortOrder A string value that specifies the row's sort order ('ASC', 'DSC' or 'NONE'). + */ + SortBy(rowIndex: number, sortOrder: string): void; + /** + * Sorts data by the specified data row's values. + * @param rowFieldNameOrId A string value that specifies the row's field name or unique identifier (the row's Name property value). + * @param sortOrder A string value that specifies the row's sort order ('ASC', 'DSC' or 'NONE'). + */ + SortBy(rowFieldNameOrId: string, sortOrder: string): void; + /** + * Sorts data by the specified data row's values. + * @param row An ASPxClientVerticalGridRow object that represents the data row. + * @param sortOrder A string value that specifies the row's sort order ('ASC', 'DSC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + */ + SortBy(row: ASPxClientVerticalGridRow, sortOrder: string, reset: boolean): void; + /** + * Sorts data by the specified data row's values. + * @param rowIndex An integer value that specifies the row's position within the row collection. + * @param sortOrder A string value that specifies the row's sort order ('ASC', 'DSC' or 'NONE'). + * @param reset true, to clear any previous sorting; otherwise, false. + */ + SortBy(rowIndex: number, sortOrder: string, reset: boolean): void; + /** + * Sorts data by the specified data row's values. + * @param rowFieldNameOrId A string value that specifies the row's field name or unique identifier (the row's Name property value). + * @param sortOrder A string value that specifies the row's sort order ('ASC', 'DSC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + */ + SortBy(rowFieldNameOrId: string, sortOrder: string, reset: boolean): void; + /** + * Sorts data by the specified data row's values, and places the row to the specified position among the sorted rows. + * @param row An ASPxClientGridViewColumn object that represents the data column. + * @param sortOrder A string value that specifies the row's sort order ('ASC', 'DSC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + * @param sortIndex An integer value that specifies the zero-based row's index among the sorted rows. -1 if data is not sorted by this row. + */ + SortBy(row: ASPxClientVerticalGridRow, sortOrder: string, reset: boolean, sortIndex: number): void; + /** + * Sorts data by the specified data row's values, and places the row to the specified position among the sorted rows. + * @param rowIndex An integer value that specifies the row's position within the row collection. + * @param sortOrder A string value that specifies the row's sort order ('ASC', 'DSC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + * @param sortIndex + */ + SortBy(rowIndex: number, sortOrder: string, reset: boolean, sortIndex: number): void; + /** + * Sorts data by the specified data row's values, and places the row to the specified position among the sorted rows. + * @param rowFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + * @param sortOrder A string value that specifies the row's sort order ('ASC', 'DSC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + * @param sortIndex An integer value that specifies the zero-based row's index among the sorted rows. -1 if data is not sorted by this row. + */ + SortBy(rowFieldNameOrId: string, sortOrder: string, reset: boolean, sortIndex: number): void; + /** + * Returns the key value of the specified data row (record in the vertical grid). + * @param visibleIndex An integer value that specifies the record's visible index. + */ + GetRecordKey(visibleIndex: number): string; + /** + * Adds a new record. + */ + AddNewRecord(): void; + /** + * Deletes the specified record. + * @param visibleIndex An integer value that identifies the record. + */ + DeleteRecord(visibleIndex: number): void; + /** + * Deletes a record with the specified key value. + * @param key An object that uniquely identifies the record. + */ + DeleteRecordByKey(key: Object): void; + /** + * Selects all the unselected records within the grid. + */ + SelectRecords(): void; + /** + * Selects the specified record displayed within the grid. + * @param visibleIndex A zero-based integer value that specifies the record's visible index. + */ + SelectRecords(visibleIndex: number): void; + /** + * Selects the specified rercords within the grid. + * @param visibleIndices An array of zero-based indices that identify records within the grid. + */ + SelectRecords(visibleIndices: number[]): void; + /** + * Selects or deselects the specified records within the grid. + * @param visibleIndices An array of zero-based indices that identify records within the grid. + * @param selected true to select the specified records; false to deselect the records. + */ + SelectRecords(visibleIndices: number[], selected: boolean): void; + /** + * Selects or deselects the specified record within the grid. + * @param visibleIndex An integer zero-based index that identifies the record within the grid. + * @param selected true to select the specified record; false to deselect the record. + */ + SelectRecords(visibleIndex: number, selected?: boolean): void; + /** + * Selects or deselects the specified records displayed within the grid. + * @param keys An array of objects that uniquely identify the records. + * @param selected true to select the specified records; false to deselect the records. + */ + SelectRecordsByKey(keys: Object[], selected?: boolean): void; + /** + * Selects or deselects the specified record displayed within the grid. + * @param key An object that uniquely identifies the record. + * @param selected true to select the specified record; false to deselect the record. + */ + SelectRecordsByKey(key: Object, selected?: boolean): void; + /** + * Selects the specified records displayed within the grid. + * @param keys An array of objects that uniquely identify the records. + */ + SelectRecordsByKey(keys: Object[]): void; + /** + * Selects a grid record by its key. + * @param key An object that uniquely identifies the record. + */ + SelectRecordsByKey(key: Object): void; + /** + * Deselects all the selected records within the grid. + */ + UnselectRecords(): void; + /** + * Deselects the specified records (if selected) within the grid. + * @param visibleIndices An array of zero-based indices that identify records within the grid. + */ + UnselectRecords(visibleIndices: number[]): void; + /** + * Deselects the specified record (if selected) within the grid. + * @param visibleIndex A zero-based integer value that specifies the record's visible index. + */ + UnselectRecords(visibleIndex: number): void; + /** + * Deselects the specified records displayed within the grid. + * @param keys An array of objects that uniquely identify the records. + */ + UnselectRecordsByKey(keys: Object[]): void; + /** + * Deselects the specified record displayed within the grid. + * @param key An object that uniquely identifies the record. + */ + UnselectRecordsByKey(key: Object): void; + /** + * Deselects all grid records that match the filter criteria currently applied to the grid. + */ + UnselectFilteredRecords(): void; + /** + * Selects the specified record displayed on the current page. + * @param visibleIndex A zero-based integer value that specifies the record's visible index. + */ + SelectRecordOnPage(visibleIndex: number): void; + /** + * Selects or deselects the specified record displayed on the current page. + * @param visibleIndex A zero-based integer value that specifies the record's visible index. + * @param selected true to select the specified record; false to deselect the record. + */ + SelectRecordOnPage(visibleIndex: number, selected?: boolean): void; + /** + * Deselects the specified record (if selected) displayed on the current page. + * @param visibleIndex A zero-based integer value that specifies the record's visible index. + */ + UnselectRecordOnPage(visibleIndex: number): void; + /** + * Selects all unselected records displayed on the current page. + */ + SelectAllRecordsOnPage(): void; + /** + * Allows you to select or deselect all records displayed on the current page based on the parameter passed. + * @param selected true to select all unselected records displayed on the current page; false to deselect all selected records on the page. + */ + SelectAllRecordsOnPage(selected: boolean): void; + /** + * Deselects all selected records displayed on the current page. + */ + UnselectAllRecordsOnPage(): void; + /** + * Returns the number of selected records. + */ + GetSelectedRecordCount(): number; + /** + * Indicates whether or not the specified record is selected within the current page. + * @param visibleIndex An integer value that identifies the record by its visible index. + */ + IsRecordSelectedOnPage(visibleIndex: number): boolean; + /** + * Returns the values of the specified data source fields within the specified record. + * @param visibleIndex An integer value that identifies the record. + * @param fieldNames The names of data source fields separated using a semicolon, whose values within the specified record are returned. + * @param onCallback An ASPxClientVerticalGridValuesCallback object that represents the JavaScript function which receives the list of record values as a parameter. + */ + GetRecordValues(visibleIndex: number, fieldNames: string, onCallback: ASPxClientVerticalGridValuesCallback): void; + /** + * Returns the record values displayed within the current page. + * @param fieldNames The names of data source fields whose values are returned. + * @param onCallback A ASPxClientVerticalGridValuesCallback object that represents the JavaScript function which receives the list of record values as a parameter. + */ + GetPageRecordValues(fieldNames: string, onCallback: ASPxClientVerticalGridValuesCallback): void; + /** + * Returns the number of records actually displayed within the active page. + */ + GetVisibleRecordsOnPage(): number; + /** + * Returns the number of rows within the client vertical grid. + */ + GetRowCount(): number; + /** + * Applies the specified search panel filter criterion to grid data. + * @param value A string value that specifies the filter criterion. + */ + ApplySearchPanelFilter(value: string): void; + /** + * Applies the specified filter expression to the ASPxVerticalGrid. + * @param filterExpression A string value that specifies the filter expression. + */ + ApplyFilter(filterExpression: string): void; + /** + * Clears the filter expression applied to a client vertical grid. + */ + ClearFilter(): void; + /** + * Sets input focus to the grid. + */ + Focus(): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param args A string value that represents any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(args: string): void; + /** + * Selects the specified page. + * @param pageIndex An integer value that specifies the active page's index. + */ + GotoPage(pageIndex: number): void; + /** + * Gets the index of the page currently being selected. + */ + GetPageIndex(): number; + /** + * Gets the number of pages to which the grid's data is divided. + */ + GetPageCount(): number; + /** + * Activates the next page. + */ + NextPage(): void; + /** + * Activates the previous page. + */ + PrevPage(): void; + /** + * Returns the index of the first record displayed within the vertical grid's active page. + */ + GetTopVisibleIndex(): number; + /** + * Saves all the changes made and switches the grid to browse mode. + */ + UpdateEdit(): void; + /** + * Cancels all the changes made and switches the ASPxVerticalGrid to browse mode. + */ + CancelEdit(): void; + /** + * Updates data displayed within the grid. + */ + Refresh(): void; + /** + * Returns the record values displayed within all selected records. + * @param fieldNames The names of data source fields separated by a semicolon, whose values within the selected records are returned. + * @param onCallback A ASPxClientVerticalGridValuesCallback object that represents the JavaScript function which receives the list of record values as a parameter. + */ + GetSelectedFieldValues(fieldNames: string, onCallback: ASPxClientVerticalGridValuesCallback): void; + /** + * Returns key values of selected records displayed within the current page. + */ + GetSelectedKeysOnPage(): Object[]; + /** + * Sends a callback to the server and generates the server-side CustomDataCallback event. + * @param args A string value that is any information that needs to be sent to the server-side CustomDataCallback event. + * @param onCallback A ASPxClientVerticalGridValuesCallback object that is the JavaScript function which receives the information on the client side. + */ + GetValuesOnCustomCallback(args: string, onCallback: ASPxClientVerticalGridValuesCallback): void; + /** + * Returns the editor used to edit the specified row's values. + * @param row An ASPxClientVerticalGridRowobject that specifies the required row within the client grid. + */ + GetEditor(row: ASPxClientVerticalGridRow): ASPxClientEdit; + /** + * Returns the editor used to edit the specified row's values. + * @param rowIndex An integer value that specifies the row's position within the rows collection. + */ + GetEditor(rowIndex: number): ASPxClientEdit; + /** + * Returns the editor used to edit the specified row's values. + * @param rowFieldNameOrId A string value that specifies the row's field name or unique identifier (the row's Name property value). + */ + GetEditor(rowFieldNameOrId: string): ASPxClientEdit; + /** + * Displays the Filter Control. + */ + ShowFilterControl(): void; + /** + * Hides the Filter Control. + */ + CloseFilterControl(): void; + /** + * Enables or disables the current filter. + * @param isFilterEnabled true to enable the current filter; otherwise, false. + */ + SetFilterEnabled(isFilterEnabled: boolean): void; + /** + * Returns the client row that resides at the specified position within the row collection. + * @param rowIndex A zero-based index that identifies the row within the row collection (the row's Index property value). + */ + GetRow(rowIndex: number): ASPxClientVerticalGridRow; + /** + * Returns the row with the specified unique identifier. + * @param rowId A string value that specifies the row's unique identifier (the row's Name property value). + */ + GetRowById(rowId: string): ASPxClientVerticalGridRow; + /** + * Returns the client row which is bound to the specified data source field. + * @param rowFieldName A string value that specifies the name of the data source field to which the row is bound (the row's fieldName property value). + */ + GetRowByField(rowFieldName: string): ASPxClientVerticalGridRow; + /** + * Returns the current vertical scroll position of the grid's content. + */ + GetVerticalScrollPosition(): number; + /** + * Returns the current horizontal scroll position of the grid's content. + */ + GetHorizontalScrollPosition(): number; + /** + * Specifies the vertical scroll position for the grid's content. + * @param position An integer value specifying the vertical scroll position. + */ + SetVerticalScrollPosition(position: number): void; + /** + * Specifies the horizontal scroll position for the grid's content. + * @param position An integer value specifying the horizontal scroll position. + */ + SetHorizontalScrollPosition(position: number): void; + /** + * Gets the value that specifies whether the required row is expanded. + * @param row An ASPxClientVerticalGridRowobject that specifies the row. + */ + GetRowExpanded(row: ASPxClientVerticalGridRow): boolean; + /** + * Gets the value that specifies whether the row with the specified index is expanded. + * @param rowIndex An integer value specifying the row's index. + */ + GetRowExpanded(rowIndex: number): boolean; + /** + * Gets the value that specifies whether the row with the specified field name or ID is expanded. + * @param rowFieldNameOrId A string value specifying the row's field name or ID. + */ + GetRowExpanded(rowFieldNameOrId: string): boolean; + /** + * Sets a value indicating whether the row is expanded. + * @param row An ASPxClientVerticalGridRowobject that specifies the required row within the client grid. + * @param value true, to expand the row; otherwise, false. + */ + SetRowExpanded(row: ASPxClientVerticalGridRow, value: boolean): void; + /** + * Sets a value indicating whether the row is expanded. + * @param rowIndex An integer value specifying the index of the row. + * @param value true, to expand the row; otherwise, false. + */ + SetRowExpanded(rowIndex: number, value: boolean): void; + /** + * Sets a value indicating whether the row is expanded. + * @param rowFieldNameOrId A string value that specifies the row's field name or unique identifier (the row's Name property value). + * @param value true, to expand the row; otherwise, false. + */ + SetRowExpanded(rowFieldNameOrId: string, value: boolean): void; +} +/** + * A client grid row. + */ +interface ASPxClientVerticalGridRow extends ASPxClientGridColumnBase { + /** + * Gets the name that uniquely identifies the row. + * Value: A string value assigned to the row's Name property. + */ + name: string; + /** + * Gets the row's position within the collection. + * Value: An integer zero-bazed index that specifies the row's position within the collection. + */ + index: number; + /** + * Gets the name of the database field assigned to the current row. + * Value: A string value that specifies the name of a data field. + */ + fieldName: string; + /** + * Gets whether the row is visible. + * Value: true, to display the row; otherwise, false. + */ + visible: boolean; +} +/** + * Represents a JavaScript function which receives the list of record values when the client GetSelectedFieldValues method is called. + */ +interface ASPxClientVerticalGridValuesCallback { + /** + * Represents a JavaScript function which receives the list of record values when the client GetSelectedFieldValues method is called. + * @param result An object that represents the list of record values received from the server. + */ + (result: Object): void; +} +/** + * A method that will handle the CustomButtonClick event. + */ +interface ASPxClientVerticalGridRowCancelEventHandler { + /** + * A method that will handle the cancelable events of a client ASPxVerticalGrid row. + * @param source The event source. + * @param e An ASPxClientVerticalGridRowCancelEventArgs object that contains event data. + */ + (source: S, e: ASPxClientVerticalGridRowCancelEventArgs): void; +} +/** + * Provides data for the cancelable events of a client ASPxVerticalGrid row. + */ +interface ASPxClientVerticalGridRowCancelEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the processed client row. + * Value: An ASPxClientVerticalGridRow object that represents the processed row. + */ + row: ASPxClientVerticalGridRow; +} +/** + * A method that will handle the RecordClick event. + */ +interface ASPxClientVerticalGridRecordClickEventHandler { + /** + * A method that will handle the RecordClick event. + * @param source The event source. This parameter identifies the ASPxClientVerticalGrid object that raised the event. + * @param e An ASPxClientVerticalGridRecordClickEventArgs object that contains event data. + */ + (source: S, e: ASPxClientVerticalGridRecordClickEventArgs): void; +} +/** + * Provides data for the RecordClick event. + */ +interface ASPxClientVerticalGridRecordClickEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the processed record's visible index. + * Value: An integer zero-based index that identifies the processed record. + */ + visibleIndex: number; + /** + * Provides access to the parameters associated with the RecordClick event. + * Value: An object that contains parameters associated with the event. + */ + htmlEvent: Object; +} +/** + * A method that will handle the CustomButtonClick event. + */ +interface ASPxClientVerticalGridCustomButtonEventHandler { + /** + * A method that will handle the CustomButtonClick event. + * @param source The event source. This parameter identifies the ASPxClientVerticalGrid object that raised the event. + * @param e An ASPxClientVerticalGridCustomButtonEventArgs object that contains event data. + */ + (source: S, e: ASPxClientVerticalGridCustomButtonEventArgs): void; +} +/** + * Provides data for the CustomButtonClick event. + */ +interface ASPxClientVerticalGridCustomButtonEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the value which identifies the record whose custom button has been clicked. + * Value: An integer value that identifies the record whose custom button has been clicked. + */ + visibleIndex: number; + /** + * Gets the value which identifies the custom button. + * Value: A string value that identifies the clicked custom button. + */ + buttonID: string; +} +/** + * A method that will handle the SelectionChanged event. + */ +interface ASPxClientVerticalGridSelectionEventHandler { + /** + * A method that will handle the SelectionChanged event. + * @param source The event source. + * @param e An ASPxClientVerticalGridSelectionEventArgs object that contains event data. + */ + (source: S, e: ASPxClientVerticalGridSelectionEventArgs): void; +} +/** + * Provides data for the SelectionChanged event. + */ +interface ASPxClientVerticalGridSelectionEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the visible index of the record whose selected state has been changed. + * Value: An value that specifies the visible index of the record. + */ + visibleIndex: number; + /** + * Gets whether the record has been selected. + * Value: true, if the record has been selected; otherwise, false. + */ + isSelected: boolean; + /** + * Gets whether all records displayed within a page have been selected or unselected. + * Value: true if all records displayed within a page have been selected or unselected; otherwise, false. + */ + isAllRecordsOnPage: boolean; + /** + * Gets whether a selection has been changed on the server. + * Value: true if a selection has been changed on the server; otherwise, false. + */ + isChangedOnServer: boolean; +} +/** + * A method that will handle the RowExpandedChanged event. + */ +interface ASPxClientVerticalGridRowExpandedEventHandler { + /** + * A method that will handle the RowExpandedChanged event. + * @param source The event source. + * @param e An ASPxClientVerticalGridRowExpandedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientVerticalGridRowExpandedEventArgs): void; +} +/** + * Provides data for the RowExpandedChanged event. + */ +interface ASPxClientVerticalGridRowExpandedEventArgs extends ASPxClientEventArgs { + /** + * Gets the expanded row. + * Value: An ASPxClientVerticalGridRow object that represents the expanded row. + */ + row: ASPxClientVerticalGridRow; +} +/** + * A method that will handle the RowExpandedChanging event. + */ +interface ASPxClientVerticalGridRowExpandingEventHandler { + /** + * A method that will handle the RowExpandedChanging event. + * @param source The event source. + * @param e An ASPxClientVerticalGridRowExpandedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientVerticalGridRowExpandingEventArgs): void; +} +/** + * Provides data for the RowExpandedChanging event. + */ +interface ASPxClientVerticalGridRowExpandingEventArgs extends ASPxClientVerticalGridRowExpandedEventArgs { + /** + * Gets or sets a value indicating whether the action which raised the event should be canceled. + * Value: true, if the action that raised the event should be canceled; otherwise, false. + */ + cancel: boolean; +} +/** + * Represents an object that will handle the client-side BatchEditStartEditing event. + */ +interface ASPxClientVerticalGridBatchEditStartEditingEventHandler { + /** + * A method that will handle the BatchEditStartEditing event. + * @param source The event source. + * @param e An ASPxClientVerticalGridBatchEditStartEditingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientVerticalGridBatchEditStartEditingEventArgs): void; +} +/** + * Provides data for the BatchEditStartEditing event. + */ +interface ASPxClientVerticalGridBatchEditStartEditingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the visible index of the record whose cells are about to be edited. + * Value: An value that specifies the visible index of the record. + */ + visibleIndex: number; + /** + * Gets the grid row that owns a cell that is about to be edited. + * Value: An object that is the focused grid row. + */ + focusedRow: ASPxClientVerticalGridRow; + /** + * Gets a hashtable that maintains information about editable cells. + * Value: A hashtable that stores information about editable cells. + */ + recordValues: Object; +} +/** + * Represents an object that will handle the client-side BatchEditEndEditing event. + */ +interface ASPxClientVerticalGridBatchEditEndEditingEventHandler { + /** + * A method that will handle the BatchEditEndEditing event. + * @param source The event source. + * @param e An ASPxClientVerticalGridBatchEditEndEditingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientVerticalGridBatchEditEndEditingEventArgs): void; +} +/** + * Provides data for the BatchEditEndEditing event. + */ +interface ASPxClientVerticalGridBatchEditEndEditingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the visible index of the record whose cells have been edited. + * Value: An value that specifies the visible index of the record. + */ + visibleIndex: number; + /** + * Gets a hashtable that maintains information about editable cells. + * Value: Gets a hashtable that maintains information about editable cells. + */ + recordValues: Object; +} +/** + * Represents an object that will handle the client-side BatchEditRecordValidating event. + */ +interface ASPxClientVerticalGridBatchEditRecordValidatingEventHandler { + /** + * A method that will handle the BatchEditRecordValidating event. + * @param source The event source. + * @param e An ASPxClientVerticalGridBatchEditRecordValidatingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientVerticalGridBatchEditRecordValidatingEventArgs): void; +} +/** + * Provides data for the BatchEditRecordValidating event. + */ +interface ASPxClientVerticalGridBatchEditRecordValidatingEventArgs extends ASPxClientEventArgs { + /** + * Gets the processed record's visible index. + * Value: An integer value that specifies the processed record's visible index. + */ + visibleIndex: number; + /** + * Provides validation information on the record currently being validated. + * Value: An object that is a hashtable containing validation information. + */ + validationInfo: Object; +} +/** + * Represents an object that will handle the client-side BatchEditConfirmShowing event. + */ +interface ASPxClientVerticalGridBatchEditConfirmShowingEventHandler { + /** + * A method that will handle the BatchEditConfirmShowing client event. + * @param source The event source. + * @param e An ASPxClientVerticalGridBatchEditConfirmShowingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientVerticalGridBatchEditConfirmShowingEventArgs): void; +} +/** + * Provides data for the BatchEditConfirmShowing event. + */ +interface ASPxClientVerticalGridBatchEditConfirmShowingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the client identifier of an object that initiates a send request. + * Value: A string value that specifies the object client identifier. + */ + requestTriggerID: string; +} +/** + * Represents an object that will handle the client-side BatchEditTemplateCellFocused event. + */ +interface ASPxClientVerticalGridBatchEditTemplateCellFocusedEventHandler { + /** + * A method that will handle the BatchEditTemplateCellFocused event. + * @param source An object representing the event source. Identifies the button editor that raised the event. + * @param e An ASPxClientVerticalGridBatchEditTemplateCellFocusedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientVerticalGridBatchEditTemplateCellFocusedEventArgs): void; +} +/** + * Provides data for the BatchEditTemplateCellFocused event. + */ +interface ASPxClientVerticalGridBatchEditTemplateCellFocusedEventArgs extends ASPxClientEventArgs { + /** + * Gets the currently processed row. + * Value: A object that is the client-side row object. + */ + row: ASPxClientVerticalGridRow; + /** + * Gets or sets a value specifying whether the event was handled. + * Value: true if the event was handled and default processing should not occur; false if the event should be handled using default processing. + */ + handled: boolean; +} +/** + * Represents an object that will handle the client-side BatchEditChangesSaving event. + */ +interface ASPxClientVerticalGridBatchEditChangesSavingEventHandler { + /** + * A method that will handle the BatchEditChangesSaving event. + * @param source The event source. This parameter identifies the vertical grid object which raised the event. + * @param e An ASPxClientVerticalGridBatchEditChangesSavingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientVerticalGridBatchEditChangesSavingEventArgs): void; +} +/** + * Provides data for the BatchEditChangesSaving event. + */ +interface ASPxClientVerticalGridBatchEditChangesSavingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets a hashtable that maintains information about inserted cells. + * Value: A hashtable that stores information about inserted cells. + */ + insertedValues: Object; + /** + * Gets a hashtable that maintains information about deleted cells. + * Value: A hashtable that stores information about deleted cells. + */ + deletedValues: Object; + /** + * Gets a hashtable that maintains information about updated cells. + * Value: A hashtable that stores information about updated cells. + */ + updatedValues: Object; +} +/** + * Represents an object that will handle the client-side BatchEditChangesCanceling event. + */ +interface ASPxClientVerticalGridBatchEditChangesCancelingEventHandler { + /** + * A method that will handle the BatchEditChangesCanceling event. + * @param source The event source. This parameter identifies the vertical grid object which raised the event. + * @param e An ASPxClientVerticalGridBatchEditChangesCancelingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientVerticalGridBatchEditChangesCancelingEventArgs): void; +} +/** + * Provides data for the BatchEditChangesCanceling event. + */ +interface ASPxClientVerticalGridBatchEditChangesCancelingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets a hashtable that maintains information about inserted cells. + * Value: A hashtable that stores information about inserted cells. + */ + insertedValues: Object; + /** + * Gets a hashtable that maintains information about deleted cells. + * Value: A hashtable that stores information about deleted cells. + */ + deletedValues: Object; + /** + * Gets a hashtable that maintains information about updated cells. + * Value: A hashtable that stores information about updated cells. + */ + updatedValues: Object; +} +/** + * Represents an object that will handle the client-side BatchEditRecordInserting event. + */ +interface ASPxClientVerticalGridBatchEditRecordInsertingEventHandler { + /** + * A method that will handle the BatchEditRecordInserting event. + * @param source The event source. This parameter identifies the vertical grid object which raised the event. + * @param e An ASPxClientVerticalGridBatchEditRecordInsertingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientVerticalGridBatchEditRecordInsertingEventArgs): void; +} +/** + * Provides data for the BatchEditRecordInserting event. + */ +interface ASPxClientVerticalGridBatchEditRecordInsertingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the processed record's visible index. + * Value: An integer value that specifies the processed record's visible index. + */ + visibleIndex: number; +} +/** + * Represents an object that will handle the client-side BatchEditRecordDeleting event. + */ +interface ASPxClientVerticalGridBatchEditRecordDeletingEventHandler { + /** + * A method that will handle the BatchEditRecordDeleting event. + * @param source The event source. This parameter identifies the vertical grid object which raised the event. + * @param e An ASPxClientVerticalGridBatchEditRecordDeletingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientVerticalGridBatchEditRecordDeletingEventArgs): void; +} +/** + * Provides data for the BatchEditRecordDeleting event. + */ +interface ASPxClientVerticalGridBatchEditRecordDeletingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the processed record's visible index. + * Value: An integer value that specifies the processed record's visible index. + */ + visibleIndex: number; + /** + * Gets a hashtable that maintains information about deleted cells. + * Value: A hashtable that stores information about deleted cells. + */ + recordValues: Object; +} +/** + * Contains information on a cell that is being edited. + */ +interface ASPxClientVerticalGridCellInfo { + /** + * Gets the row that contains the cell currently being processed. + * Value: An object that is the row which contains the processed cell. + */ + row: ASPxClientVerticalGridRow; + /** + * Gets the visible index of the record that contains the cell currently being processed. + * Value: An value that specifies the visible index of the record. + */ + recordVisibleIndex: number; +} +/** + * Provides members related to Batch Edit Mode + */ +interface ASPxClientVerticalGridBatchEditApi { + /** + * Performs validation of grid data when the grid operates in Batch Edit mode. + */ + ValidateRecords(): boolean; + /** + * Performs validation of grid data contained in the specified record when the grid operates in batch edit mode. + * @param visibleIndex An integer value specifying the visible index of the validated record. + */ + ValidateRecord(visibleIndex: number): boolean; + /** + * Returns an array of record visible indices. + * @param includeDeleted true, to include visible indices of deleted records to the returned array; otherwise, false. + */ + GetRecordVisibleIndices(includeDeleted: boolean): number[]; + /** + * Returns an array of the deleted record visible indices. + */ + GetDeletedRecordIndices(): number[]; + /** + * Returns an array of the inserted record visible indices. + */ + GetInsertedRecordIndices(): number[]; + /** + * Indicates if the record with the specified visible index is deleted. + * @param visibleIndex An integer value that identifies the record by its visible index. + */ + IsDeletedRecord(visibleIndex: number): boolean; + /** + * Indicates if the record with specified visible index is newly created. + * @param visibleIndex An integer value that identifies the record by its visible index. + */ + IsNewRecord(visibleIndex: number): boolean; + /** + * Programmatically moves the focus to the previous cell in the record. + */ + MoveFocusBackward(): boolean; + /** + * Programmatically moves the focus to the next cell in the record. + */ + MoveFocusForward(): boolean; + /** + * Sets a value of the specified cell. + * @param visibleIndex An integer zero-based index that identifies the record containing the processed cell. + * @param rowFieldNameOrId A string value that specifies the field name or unique identifier (the row's Name property value) of a row containing the processed cell. + * @param value An object that contains the new cell value. + */ + SetCellValue(visibleIndex: number, rowFieldNameOrId: string, value: Object): void; + /** + * Sets the value of the specified cell. + * @param visibleIndex An integer zero-based index that identifies the row containing the processed cell. + * @param rowFieldNameOrId A string value that specifies the field name or unique identifier (the column's Name property value) of a column containing the processed cell. + * @param value An object that contains the new cell value. + * @param displayText A string value that specifies the cell display text. + * @param cancelCellHighlighting true to cancel highlighting of the modified cell, false to highlight the modified cell. + */ + SetCellValue(visibleIndex: number, rowFieldNameOrId: string, value: Object, displayText: string, cancelCellHighlighting?: boolean): void; + /** + * Gets the value of the specified cell. + * @param visibleIndex A zero-based integer value that specifies a visible index of a record containing the processed cell. + * @param rowFieldNameOrId A string value that specifies the field name or unique identifier (the row's Name property value) of a row containing the processed cell. + * @param initial true, to return the initial (server) value; false, to return a value currently contained on the client side (modified value). + */ + GetCellValue(visibleIndex: number, rowFieldNameOrId: string, initial?: boolean): Object; + /** + * Gets information about the cell currently being edited. + */ + GetEditCellInfo(): ASPxClientVerticalGridCellInfo; + /** + * Returns a value that indicates whether the vertical grid has changed data. + */ + HasChanges(): boolean; + /** + * Returns a value that indicates whether the specified record has changed data. + * @param visibleIndex An integer value that specifies the visible index of a record. + */ + HasChanges(visibleIndex: number): boolean; + /** + * Returns a value that indicates whether the specified data cell's data has been changed. + * @param visibleIndex An integer value that specifies the visible index of a record. + * @param rowFieldNameOrId A string value that identifies the row by the name of the data source field to which the row is bound, or by the row's name. + */ + HasChanges(visibleIndex: number, rowFieldNameOrId: string): boolean; + /** + * Resets changes in the specified record. + * @param visibleIndex An integer value that specifies the visible index of a record. + */ + ResetChanges(visibleIndex: number): void; + /** + * Resets changes in the specified cell. + * @param visibleIndex An integer value that specifies the visible index of a record containing the processed cell. + * @param rowIndex A string value that specifies the field name or unique identifier (the row's Name property value) of a row containing the processed cell. + */ + ResetChanges(visibleIndex: number, rowIndex: number): void; + /** + * Switches the specified cell to batch edit mode. + * @param visibleIndex A zero-based integer value that specifies the visible index of a record containing the processed cell. + * @param rowIndex A zero-based integer value that identifies the row which contains the processed cell in the rows collection. + */ + StartEdit(visibleIndex: number, rowIndex: number): void; + /** + * Ends the cell(s) editing. + */ + EndEdit(): void; +} +/** + * Contains style settings related to media elements in ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorCommandStyleSettings { + /** + * Gets or sets a media element's CSS class name. + * Value: A string that specifies a class name. + */ + className: string; + /** + * Gets or sets an element's width. + * Value: A string that specifies an element's width in any correct format. + */ + width: string; + /** + * Gets or sets an element's height. + * Value: A string that specifies an element's height in any correct format. + */ + height: string; + /** + * Gets or sets a media element's border width. + * Value: A string that specifies a border width in any correct format. + */ + borderWidth: string; + /** + * Gets or sets a media element's border color. + * Value: A string that specifies a border color in any correct format. + */ + borderColor: string; + /** + * Gets or sets a media element's border style. + * Value: A string that specifies a border style in any correct format. + */ + borderStyle: string; + /** + * Gets or sets an element's top margin. + * Value: A string that specifies an element's top margin in any correct format. + */ + marginTop: string; + /** + * Gets or sets an element's right margin. + * Value: A string that specifies an element's right margin in any correct format. + */ + marginRight: string; + /** + * Gets or sets an element's bottom margin. + * Value: A string that specifies an element's bottom margin in any correct format. + */ + marginBottom: string; + /** + * Gets or sets an element's left margin. + * Value: A string that specifies an element's left margin in any correct format. + */ + marginLeft: string; +} +/** + * The base class for parameters used in the ASPxHtmlEditor's client-side commands. + */ +interface ASPxClientHtmlEditorCommandArguments { + /** + * Gets the currently selected element in the ASPxHtmlEditor. + * Value: An HTML object which is the currently selected element. + */ + selectedElement: Object; +} +/** + * Contains settings related to the INSERTIMAGE_COMMAND command parameter. + */ +interface ASPxClientHtmlEditorInsertImageCommandArguments extends ASPxClientHtmlEditorCommandArguments { + /** + * Specifies the source of the target image. + * Value: A string specifying the source of the target image. + */ + src: string; + /** + * Creates an alternate text for the target image. + * Value: A string that specifies an alternate text for the target image. + */ + alt: string; + /** + * Determines if the target image is wrapped with text. + * Value: true, if the target image is wrapped with text; otherwise, false. + */ + useFloat: boolean; + /** + * Determines the position of the target image. + * Value: A string value defining the position of the target image. + */ + align: string; + /** + * Contains the style settings specifying the appearance of the target image. + * Value: An object that contains the style settings specifying the appearance of the target image. + */ + styleSettings: ASPxClientHtmlEditorCommandStyleSettings; +} +/** + * Contains settings related to the CHANGEIMAGE_COMMAND command parameter. + */ +interface ASPxClientHtmlEditorChangeImageCommandArguments extends ASPxClientHtmlEditorInsertImageCommandArguments { +} +/** + * Contains settings related to the INSERTLINK_COMMAND command parameter. + */ +interface ASPxClientHtmlEditorInsertLinkCommandArguments extends ASPxClientHtmlEditorCommandArguments { + /** + * Specifies the url of the page the target link goes to. + * Value: A string value specifying the target link url. + */ + url: string; + /** + * Specifiies the text of the target link. + * Value: A string value specifying the text of the target link. + */ + text: string; + /** + * Determines where to open the target link. + * Value: A string that specifies where to open the target link in any correct format. + */ + target: string; + /** + * Defines the title of the target link. + * Value: A string value defining the title of the target link. + */ + title: string; +} +/** + * The base class for parameters related to inserting or changing media elements in the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorChangeMediaElementCommandArguments extends ASPxClientHtmlEditorCommandArguments { + /** + * Defines the HTML "id" attribute of the target media element. + * Value: A string value which is a unique identifier for the element. + */ + id: string; + /** + * Defines the source of the target media element. + * Value: A string defining the source of the target media element. + */ + src: string; + /** + * Determines the position of the target media element. + * Value: A string value indicating the position of the target media element. + */ + align: string; + /** + * Contains the style settings defining the appearance of the target media element. + * Value: An object that contains the style settings defining the appearance of the target media element. + */ + styleSettings: ASPxClientHtmlEditorCommandStyleSettings; + /** + * Returns the name of the client-side command corresponding to the parameter. + */ + GetCommandName(): string; +} +/** + * The base class for parameters related to inserting or changing HTML5 media elements (Audio and Video) in the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorChangeHtml5MediaElementCommandArguments extends ASPxClientHtmlEditorChangeMediaElementCommandArguments { + /** + * Determines if a media file will start playing automatically. + * Value: true, if autoplay is enabled; otherwise, false. + */ + autoPlay: boolean; + /** + * Determines if a media file repeats indefinitely, or stops when it reaches the last frame. + * Value: true, to loop playback; otherwise, false. + */ + loop: boolean; + /** + * Determines if the media player controls should be displayed. + * Value: true, if media player controls are displayed; otherwise, false. + */ + showPlayerControls: boolean; + /** + * Determines how a media file should be loaded when the page loads. + * Value: One of the ASPxClientHtmlEditorMediaPreloadMode enumeration values. + */ + preloadMode: string; +} +/** + * Contains settings related to the INSERTAUDIO_COMMAND command parameter. + */ +interface ASPxClientHtmlEditorInsertAudioCommandArguments extends ASPxClientHtmlEditorChangeHtml5MediaElementCommandArguments { +} +/** + * Contains settings related to the CHANGEAUDIO_COMMAND command parameter. + */ +interface ASPxClientHtmlEditorChangeAudioCommandArguments extends ASPxClientHtmlEditorInsertAudioCommandArguments { +} +/** + * Contains settings related to the INSERTVIDEO_COMMAND command parameter. + */ +interface ASPxClientHtmlEditorInsertVideoCommandArguments extends ASPxClientHtmlEditorChangeHtml5MediaElementCommandArguments { + /** + * Defines the URL of an image that is shown while the video file is downloading, or until an end-user clicks the play button. + * Value: A string value that specifies the poster image URL. + */ + posterUrl: string; +} +/** + * Contains settings related to the CHANGEVIDEO_COMMAND command parameter. + */ +interface ASPxClientHtmlEditorChangeVideoCommandArguments extends ASPxClientHtmlEditorInsertVideoCommandArguments { +} +/** + * Contains settings related to the INSERTFLASH_COMMAND command parameter. + */ +interface ASPxClientHtmlEditorInsertFlashCommandArguments extends ASPxClientHtmlEditorChangeMediaElementCommandArguments { + /** + * Determines if the target flash element will start playing automatically. + * Value: true, if autoplay is enabled; otherwise, false. + */ + autoPlay: boolean; + /** + * Defines if the target flash element repeats indefinitely, or stops when it reaches the last frame. + * Value: true, to loop playback; otherwise, false. + */ + loop: boolean; + /** + * Determines if the flash related items are displayed in the context menu of the target flash element. + * Value: true, if the specific context menu items are displayed; otherwise, false + */ + enableFlashMenu: boolean; + /** + * Determines if the target flash element can be displayed in the fullscreen mode. + * Value: true, if the fullscreen mode is allowed; otherwise, false. + */ + allowFullscreen: boolean; + /** + * Defines the rendering quality level used for the target flash element. + * Value: A string value that specifies the target flash element rendering quality. + */ + quality: string; +} +/** + * Contains settings related to the CHANGEFLASH_COMMAND command parameter. + */ +interface ASPxClientHtmlEditorChangeFlashCommandArguments extends ASPxClientHtmlEditorInsertFlashCommandArguments { +} +/** + * Contains settings related to the INSERTYOUTUBEVIDEO_COMMAND command parameter. + */ +interface ASPxClientHtmlEditorInsertYouTubeVideoCommandArguments extends ASPxClientHtmlEditorChangeMediaElementCommandArguments { + /** + * Determines if suggested videos are shown after the target YouTube video finishes. + * Value: true, to show suggested videos; otherwise, false + */ + showRelatedVideos: boolean; + /** + * Determines if the target YouTube video title and player actions (Watch later, Share) are shown. + * Value: true, to display the title and player actions; otherwise, false. + */ + showVideoInfo: boolean; + /** + * Determines if the privacy-enhanced mode is enabled for the target YouTube video. + * Value: true, if the privace-enhanced mode is enabled; otherwise, false + */ + enablePrivacyEnhancedMode: boolean; + /** + * Determines if the player controls are displayed for the target YouTube video. + * Value: true, if the player controls are displayed; otherwise, false. + */ + showPlayerControls: boolean; +} +/** + * Contains settings related to the CHANGEYOUTUBEVIDEO_COMMAND command parameter. + */ +interface ASPxClientHtmlEditorChangeYouTubeVideoCommandArguments extends ASPxClientHtmlEditorInsertYouTubeVideoCommandArguments { +} +/** + * A method that will handle the DialogInitialized client event. + */ +interface ASPxClientHtmlEditorDialogInitializedEventHandler { + /** + * A method that will handle the client DialogInitialized event. + * @param source An object representing the event's source. + * @param e An ASPxClientHtmlEditorDialogInitializedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientHtmlEditorDialogInitializedEventArgs): void; +} +/** + * Provides data for the DialogInitialized client event. + */ +interface ASPxClientHtmlEditorDialogInitializedEventArgs extends ASPxClientEventArgs { + /** + * Gets the name of the dialog that has been initialized. + * Value: A string value that is the name of the initialized dialog. + */ + dialogName: string; +} +/** + * A method that will handle the CommandExecuting event. + */ +interface ASPxClientHtmlEditorCommandExecutingEventHandler { + /** + * A method that will handle the client CommandExecuted event. + * @param source The event's source. + * @param e An ASPxClientHtmlEditorCommandExecutingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientHtmlEditorCommandExecutingEventArgs): void; +} +/** + * Provides data for the CommandExecuting event. + */ +interface ASPxClientHtmlEditorCommandExecutingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the name of the processed command. + * Value: A string value specifying the processed command's name. + */ + commandName: string; + /** + * Gets an optional parameter that complements the processed command. + * Value: An object containing additional information about the processed command. + */ + parameter: Object; +} +/** + * A method that will handle the client events related to command processing. + */ +interface ASPxClientHtmlEditorCommandEventHandler { + /** + * A method that will handle the corresponding client event. + * @param source The event source. This parameter identifies the editor which raised the event. + * @param e An ASPxClientHtmlEditorCommandEventArgs object that contains event data. + */ + (source: S, e: ASPxClientHtmlEditorCommandEventArgs): void; +} +/** + * Provides data for client events that relate to command processing (CustomCommand). + */ +interface ASPxClientHtmlEditorCommandEventArgs extends ASPxClientEventArgs { + /** + * Gets the name of the processed command. + * Value: A string value representing the processed command's name. + */ + commandName: string; + /** + * Gets an optional parameter that complements the processed command. + * Value: A string value containing additional information about the processed command. + */ + parameter: Object; +} +/** + * A method that will handle the client events that relate to custom dialog operations. + */ +interface ASPxClientHtmlEditorCustomDialogEventHandler { + /** + * A method that will handle the client CustomDialogOpened event. + * @param source An object representing the event's source. + * @param e An ASPxClientHtmlEditorCustomDialogEventArgs object that contains event data. + */ + (source: S, e: ASPxClientHtmlEditorCustomDialogEventArgs): void; +} +/** + * Provides data for client events that relate to custom dialog operations. + */ +interface ASPxClientHtmlEditorCustomDialogEventArgs extends ASPxClientEventArgs { + /** + * Gets the name that uniquely identifies the processed custom dialog. + * Value: A string value that represents the value assigned to the processed custom dialog's Name property. + */ + name: string; +} +/** + * Provides data for client events that relate to closing a custom dialog. + */ +interface ASPxClientHtmlEditorCustomDialogCloseEventArgsBase extends ASPxClientHtmlEditorCustomDialogEventArgs { + /** + * Gets the status of the closed custom dialog. + * Value: An object representing a custom dialog's closing status. By default, it's the "cancel" string if the dialog operation is canceled, or the "ok" string if a dialog is closed by submitting a file. You can also provide your custom status, if your dialog contains additional buttons. + */ + status: Object; +} +/** + * A method that will handle the CustomDialogClosing client event. + */ +interface ASPxClientHtmlEditorCustomDialogClosingEventHandler { + /** + * A method that will handle the client CustomDialogClosing event. + * @param source An object representing the event's source. + * @param e An ASPxClientHtmlEditorCustomDialogClosingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientHtmlEditorCustomDialogClosingEventArgs): void; +} +/** + * Provides data for the CustomDialogClosing client event. + */ +interface ASPxClientHtmlEditorCustomDialogClosingEventArgs extends ASPxClientHtmlEditorCustomDialogCloseEventArgsBase { + /** + * Gets or sets a value specifying whether the event was handled. + * Value: true if the event was handled and default processing should not occur; false if the event should be handled using default processing. + */ + handled: boolean; +} +/** + * A method that will handle the CustomDialogClosed client event. + */ +interface ASPxClientHtmlEditorCustomDialogClosedEventHandler { + /** + * A method that will handle the client CustomDialogClosed event. + * @param source An object representing the event's source. + * @param e An ASPxClientHtmlEditorCustomDialogClosedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientHtmlEditorCustomDialogClosedEventArgs): void; +} +/** + * Provides data for the CustomDialogClosed client event. + */ +interface ASPxClientHtmlEditorCustomDialogClosedEventArgs extends ASPxClientHtmlEditorCustomDialogCloseEventArgsBase { + /** + * Gets an object associated with the closed dialog. + * Value: An object containing custom data associated with dialog closing. + */ + data: Object; +} +/** + * A method that will handle the Validation client event. + */ +interface ASPxClientHtmlEditorValidationEventHandler { + /** + * A method that will handle the client Validation event. + * @param source An object representing the event's source. + * @param e An ASPxClientHtmlEditorValidationEventArgs object that contains event data. + */ + (source: S, e: ASPxClientHtmlEditorValidationEventArgs): void; +} +/** + * Provides data for the Validation client event. + */ +interface ASPxClientHtmlEditorValidationEventArgs extends ASPxClientEventArgs { + /** + * Gets or sets the HTML markup that is the ASPxHtmlEditor's content. + * Value: A string value that specifies the HTML content to validate. + */ + html: string; + /** + * Gets or sets a value specifying whether the validated value is valid. + * Value: true if the validation has been completed successfully; otherwise, false. + */ + isValid: boolean; + /** + * Gets or sets the error text to be displayed within the editor's error frame if the editor's validation fails. + * Value: A string value specifying the error description. + */ + errorText: string; +} +/** + * A method that will handle the ActiveTabChanged event. + */ +interface ASPxClientHtmlEditorTabEventHandler { + /** + * A method that will handle the client ActiveTabChanged event. + * @param source The event's source. + * @param e An ASPxClientHtmlEditorTabEventArgs object that contains event data. + */ + (source: S, e: ASPxClientHtmlEditorTabEventArgs): void; +} +/** + * Provides data for the ActiveTabChanged event that concerns manipulations on tabs. + */ +interface ASPxClientHtmlEditorTabEventArgs extends ASPxClientEventArgs { + /** + * Gets the name that uniquely identifies an editor tab. + * Value: A string value that is the tab name. + */ + name: string; +} +/** + * A method that will handle the ActiveTabChanging event. + */ +interface ASPxClientHtmlEditorTabCancelEventHandler { + /** + * A method that will handle the client ActiveTabChanging event. + * @param source The event's source. + * @param e An ASPxClientHtmlEditorTabCancelEventArgs object that contains event data. + */ + (source: S, e: ASPxClientHtmlEditorTabCancelEventArgs): void; +} +/** + * Provides data for the cancellable ActiveTabChanging event that concerns manipulations on tabs. + */ +interface ASPxClientHtmlEditorTabCancelEventArgs extends ASPxClientHtmlEditorTabEventArgs { + /** + * Gets or sets a value indicating whether the action which raised the event, should be canceled. + * Value: true, if the action that raised the event should be canceled; otherwise, false. + */ + cancel: boolean; +} +/** + * A method that will handle the BeforePaste event. + */ +interface ASPxClientHtmlEditorBeforePasteEventHandler { + /** + * A method that will handle the BeforePaste event. + * @param source The event source. This parameter identifies the HTML editor object that raised the event. + * @param e An ASPxClientHtmlEditorBeforePasteEventArgs object that contains event data. + */ + (source: S, e: ASPxClientHtmlEditorBeforePasteEventArgs): void; +} +/** + * Provides data for the BeforePaste event. + */ +interface ASPxClientHtmlEditorBeforePasteEventArgs extends ASPxClientEventArgs { + /** + * Gets the name of the processed command. + * Value: A string value identifying the command's name. + */ + commandName: string; + /** + * Gets or sets the HTML markup that is about to be pasted to the ASPxHtmlEditor's content. + * Value: A string value that specifies the HTML content to paste. + */ + html: string; +} +/** + * Represents a client-side equivalent of the ASPxHtmlEditor control. + */ +interface ASPxClientHtmlEditor extends ASPxClientControl { + /** + * Occurs on the client side after a dialog has been initialized. + */ + DialogInitialized: ASPxClientEvent>; + /** + * Occurs before a default or custom command has been executed and allows you to cancel the action. + */ + CommandExecuting: ASPxClientEvent>; + /** + * Enables you to implement a custom command's logic. + */ + CustomCommand: ASPxClientEvent>; + /** + * Occurs after a default or custom command has been executed on the client side. + */ + CommandExecuted: ASPxClientEvent>; + /** + * Fires on the client side when the editor's Design View Area receives input focus. + */ + GotFocus: ASPxClientEvent>; + /** + * Fires on the client side when the editor's Design View Area loses input focus. + */ + LostFocus: ASPxClientEvent>; + /** + * Occurs on the client when a selection is changed within the ASPxHtmlEditor. + */ + SelectionChanged: ASPxClientEvent>; + /** + * Occurs on the client side when the content of the editor changes. + */ + HtmlChanged: ASPxClientEvent>; + /** + * Occurs on the client side after a custom dialog is opened. + */ + CustomDialogOpened: ASPxClientEvent>; + /** + * Fires on the client side before a custom dialog is closed. + */ + CustomDialogClosing: ASPxClientEvent>; + /** + * Occurs on the client side after a custom dialog is closed. + */ + CustomDialogClosed: ASPxClientEvent>; + /** + * Allows you to specify whether the value entered into the ASPxHtmlEditor is valid. + */ + Validation: ASPxClientEvent>; + /** + * Occurs on the client side before a context menu is shown. + */ + ContextMenuShowing: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientHtmlEditor. + */ + CallbackError: ASPxClientEvent>; + /** + * Fires after a callback, sent by the CustomDataCallback event handler. + */ + CustomDataCallback: ASPxClientEvent>; + /** + * Occurs on the client side after the editor content is spell checked. + */ + SpellingChecked: ASPxClientEvent>; + /** + * Fires on the client side after the active tab has been changed within a control. + */ + ActiveTabChanged: ASPxClientEvent>; + /** + * Fires on the client side before the active tab is changed within a control. + */ + ActiveTabChanging: ASPxClientEvent>; + /** + * Occurs before an HTML code is pasted to editor content, and allows you to modify it. + */ + BeforePaste: ASPxClientEvent>; + /** + * Returns the document object generated by an iframe element within a design view area. + */ + GetDesignViewDocument(): Object; + /** + * Returns the document object generated by an iframe element within a preview area. + */ + GetPreviewDocument(): Object; + /** + * Returns a collection of client context menu objects. + */ + GetContextMenu(): ASPxClientPopupMenu; + /** + * Returns a value indicating whether an editor is enabled. + */ + GetEnabled(): boolean; + /** + * Specifies whether an editor is enabled. + * @param value true to enable the editor; false to disable it. + */ + SetEnabled(value: boolean): void; + /** + * Sets input focus to the ASPxHtmlEditor's edit region. + */ + Focus(): void; + /** + * Gets the HTML markup that represents the editor's content. + */ + GetHtml(): string; + /** + * Specifies the HTML markup that represents the editor's content. + * @param html A string value that specifies the HTML markup. + */ + SetHtml(html: string): void; + /** + * Sets the HTML markup that represents the editor's content. + * @param html A string value that specifies the HTML markup. + * @param clearUndoHistory true to clear the undo stack; otherwise, false. + */ + SetHtml(html: string, clearUndoHistory: boolean): void; + /** + * Replaces placeholders with the specified values. + * @param html A string value that specifies the HTML code to process. + * @param placeholders An array of objects that specify the placeholders and values to replace them. + */ + ReplacePlaceholders(html: string, placeholders: Object[]): string; + /** + * Creates a parameter for ASPxHtmlEditor's client-side commands related to changing media elements. + * @param element An element that is being changed. + */ + CreateChangeMediaElementCommandArguments(element: Object): ASPxClientHtmlEditorChangeMediaElementCommandArguments; + /** + * Executes the specified command. + * @param commandName A string value that specifies the command to perform. + * @param parameter A string value specifying additional information about the command to perform. + * @param addToUndoHistory true, to add the specified command to the undo stack; otherwise, false. + */ + ExecuteCommand(commandName: string, parameter: Object, addToUndoHistory: boolean): boolean; + /** + * Adds the current editor state to the undo/redo history. + */ + SaveToUndoHistory(): void; + /** + * Returns the selection in the ASPxHtmlEditor. + */ + GetSelection(): ASPxClientHtmlEditorSelection; + /** + * Restores the selection within the ASPxHtmlEditor. + */ + RestoreSelection(): boolean; + /** + * Sets the value of the combo box within the HtmlEditor on the client side. + * @param commandName A string value that identifies the combo box's command name within the HtmlEditor's control collection. + * @param value A string value that specifies the combo box's new value. + */ + SetToolbarComboBoxValue(commandName: string, value: string): void; + /** + * Sets the value of the dropdown item picker in the HtmlEditor on the client side. + * @param commandName A string value that identifies the dropdown item picker by its command name. This value is contained in the CommandName property. + * @param value A string value that specifies the dropdown item picker's new value, i.e., the ToolbarItemPickerItem object. + */ + SetToolbarDropDownItemPickerValue(commandName: string, value: string): void; + /** + * Specifies the visibility of a ribbon context tab category specified by its name. + * @param categoryName A Name property value of the required category. + * @param active true to make a category visible; false to make it hidden. + */ + SetRibbonContextTabCategoryVisible(categoryName: string, active: string): void; + /** + * Provides access to an object implementing the HtmlEditor's ribbon UI. + */ + GetRibbon(): ASPxClientRibbon; + /** + * Gets a value that indicates whether the editor's value passes validation. + */ + GetIsValid(): boolean; + /** + * Gets the error text to be displayed within the editor's error frame if the editor's validation fails. + */ + GetErrorText(): string; + /** + * Sets a value that specifies whether the editor's value passes validation. + * @param isValid true if the editor's value passes validation; otherwise, false. + */ + SetIsValid(isValid: boolean): void; + /** + * Sets the error text to be displayed within the editor's error frame if the editor's validation fails. + * @param errorText A string value representing the error text. + */ + SetErrorText(errorText: string): void; + /** + * Performs validation of the editor's content. + */ + Validate(): void; + /** + * Set an active tab specified by its name. + * @param name A string value that is the name of the tab. + */ + SetActiveTabByName(name: string): void; + /** + * Returns the name of the active HTML editor tab. + */ + GetActiveTabName(): string; + /** + * Reconnect the control to an external ribbon. + */ + ReconnectToExternalRibbon(): void; + /** + * Sends a callback to the server and generates the server-side CustomDataCallback event passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side CustomDataCallback event. + * @param onCallback A ASPxClientDataCallback object that represents the JavaScript function which receives the callback data as a parameter. + */ + PerformDataCallback(parameter: string, onCallback: ASPxClientDataCallback): void; +} +/** + * A selection in the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorSelection { + /** + * Returns a DOM element that relates to the current selection. + */ + GetSelectedElement(): Object; + /** + * Returns the HTML markup specifying the currently selected ASPxHtmlEditor content. + */ + GetHtml(): string; + /** + * Returns the text within the currently selected ASPxHtmlEditor content. + */ + GetText(): string; + /** + * Returns an array of the currently selected elements. + */ + GetElements(): Object[]; + /** + * Sets the new HTML markup in place of the currently selected within ASPxHtmlEditor content. + * @param html A string value specifying the new HTML markup. + * @param addToHistory true to add this operation to the history; otherwise, false. + */ + SetHtml(html: string, addToHistory: boolean): void; +} +/** + * A client-side equivalent of the ASPxPivotGrid control. + */ +interface ASPxClientPivotGrid extends ASPxClientControl { + /** + * Occurs on the client after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientPivotGrid. + */ + CallbackError: ASPxClientEvent>; + /** + * Fires after a callback that has been processed on the server returns back to the client. + */ + AfterCallback: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Fires before a callback is sent to the server for server-side processing. + */ + BeforeCallback: ASPxClientEvent>; + /** + * Fires on the client side after the customization form's visible state has been changed. + */ + CustomizationFieldsVisibleChanged: ASPxClientEvent>; + /** + * Occurs when a cell is clicked. + */ + CellClick: ASPxClientEvent>; + /** + * Occurs when a cell is double clicked. + */ + CellDblClick: ASPxClientEvent>; + /** + * Occurs when a custom menu item has been clicked. + */ + PopupMenuItemClick: ASPxClientEvent>; + /** + * Indicates whether the Defer Layout Update check box is enabled. + */ + IsDeferUpdatesChecked(): boolean; + /** + * Indicates whether the Filter Editor (Prefilter) is visible. + */ + IsPrefilterVisible(): boolean; + /** + * Shows the Filter Editor. + */ + ShowPrefilter(): void; + /** + * Hides the Filter Editor. + */ + HidePrefilter(): void; + /** + * Clears the filter expression applied using the Prefilter (Filter Editor). + */ + ClearPrefilter(): void; + /** + * Enables or disables the current filter applied by the Filter Editor (Prefilter). + */ + ChangePrefilterEnabled(): void; + /** + * Returns a value that specifies whether the customization form is visible. + */ + GetCustomizationFieldsVisibility(): boolean; + /** + * Specifies the visibility of the customization form. + * @param value true to display the customization form; false to hide the customization form. + */ + SetCustomizationFieldsVisibility(value: boolean): void; + /** + * Switches the customization form's visible state. + */ + ChangeCustomizationFieldsVisibility(): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param args A string value that represents any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(args: string): void; + /** + * + * @param args + * @param onSuccess + */ + PerformCallback(args: string, onSuccess: (arg1: string) => void): void; +} +/** + * A method that will handle the CellDblClick event. + */ +interface ASPxClientClickEventHandler { + /** + * A method that will handle the CellDblClick event. + * @param source The event source. + * @param e An ASPxClientClickEventArgs object that contains event data. + */ + (source: S, e: ASPxClientClickEventArgs): void; +} +/** + * Provides data for the CellDblClick client events. + */ +interface ASPxClientClickEventArgs extends ASPxClientEventArgs { + /** + * Provides access to the parameters associated with the CellDblClick events. + * Value: An object that contains parameters associated with the CellDblClick events. + */ + HtmlEvent: Object; + /** + * Gets the processed cell's value. + * Value: An object that represents the processed cell's value. + */ + Value: Object; + /** + * Gets the index of a column that owns the processed cell. + * Value: An integer value that identifies a column. + */ + ColumnIndex: number; + /** + * Gets the index of a row that owns the processed cell. + * Value: An integer value that identifies a row. + */ + RowIndex: number; + /** + * Gets a column field value. + * Value: An object that represents a column field value. + */ + ColumnValue: Object; + /** + * Gets a row field value. + * Value: An object that represents a row field value. + */ + RowValue: Object; + /** + * Gets a column field name. + * Value: A String value that represents a column field name. + */ + ColumnFieldName: string; + /** + * Gets a row field name. + * Value: A String value that represents a row field name. + */ + RowFieldName: string; + /** + * Gets a column value type. + * Value: A String value that represents a column value type. + */ + ColumnValueType: string; + /** + * Gets a row value type. + * Value: A String value that represents a row value type. + */ + RowValueType: string; + /** + * Gets the index of the data field which corresponds to the clicked summary value. + * Value: An integer value that identifies the data field. + */ + DataIndex: number; +} +/** + * A method that will handle the PopupMenuItemClick event. + */ +interface ASPxClientPivotMenuItemClickEventHandler { + /** + * A method that will handle the PopupMenuItemClick event. + * @param source The event source. + * @param e An ASPxClientPivotMenuItemClickEventArgs object that contains event data. + */ + (source: S, e: ASPxClientPivotMenuItemClickEventArgs): void; +} +/** + * Provides data for the PopupMenuItemClick event. + */ +interface ASPxClientPivotMenuItemClickEventArgs extends ASPxClientEventArgs { + /** + * Gets the context menu's type. + * Value: A PivotGridPopupMenuType enumeration value that identifies the context menu. + */ + MenuType: string; + /** + * Gets the name of the menu item currently being clicked. + * Value: A String value that identifies the clicked item by its name. + */ + MenuItemName: string; + /** + * Gets the field's unique indentifier. + * Value: A string which specifies the field's unique indentifier. + */ + FieldID: string; + /** + * Gets the index of the field value for which the popup menu has been invoked. + * Value: An integer value that identifies the field value. + */ + FieldValueIndex: number; +} +/** + * A client-side equivalent of the ASPxPivotCustomizationControl control. + */ +interface ASPxClientPivotCustomization extends ASPxClientControl { + /** + * Returns an HTML element that represents the root of the control's hierarchy. + */ + GetMainContainer(): Object; + /** + * Returns a client-side equivalent of the owner Pivot Grid Control. + */ + GetPivotGrid(): ASPxClientPivotGrid; + /** + * Specifies the Customization Control's height. + * @param value An integer value that specifies the Customization Control's height. + */ + SetHeight(value: number): void; + /** + * Specifies the Customization Control's width. + * @param value An integer value that specifies the Customization Control's width. + */ + SetWidth(value: number): void; + /** + * Recalculates the Customization Control height. + */ + UpdateHeight(): void; + /** + * Specifies the Customization Control's layout. + * @param layout A string that specifies the Customization Control's layout. + */ + SetLayout(layout: string): void; +} +/** + * A method that will handle the CustomCommandExecuted event. + */ +interface ASPxClientRichEditCustomCommandExecutedEventHandler { + /** + * A method that will handle the CustomCommandExecuted event. + * @param source An object representing the event source. Identifies the RichEdit that raised the event. + * @param e A ASPxClientRichEditCustomCommandExecutedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientRichEditCustomCommandExecutedEventArgs): void; +} +/** + * Provides data for the CustomCommandExecuted event. + */ +interface ASPxClientRichEditCustomCommandExecutedEventArgs extends ASPxClientEventArgs { + /** + * Gets the name of the processed command. + * Value: A string value representing the processed command's name. + */ + commandName: string; + /** + * Gets an optional parameter that complements the processed command. + * Value: A string value containing additional information about the processed command. + */ + parameter: Object; +} +/** + * A method that will handle the HyperlinkClick event. + */ +interface ASPxClientRichEditHyperlinkClickEventHandler { + /** + * A method that will handle the HyperlinkClick event. + * @param source The event source. + * @param e An ASPxClientRichEditHyperlinkClickEventArgs object that contains event data. + */ + (source: S, e: ASPxClientRichEditHyperlinkClickEventArgs): void; +} +/** + * Provides data for the HyperlinkClick event. + */ +interface ASPxClientRichEditHyperlinkClickEventArgs extends ASPxClientEventArgs { + /** + * Gets or sets whether the event is handled manually, so no default processing is required. + * Value: true if the event is handled and no default processing is required; otherwise false. + */ + handled: boolean; + /** + * Gets a DHTML event object that relates to the processed event. + * Value: An object that maintains DHTML event-specific information. + */ + htmlEvent: Object; + /** + * Gets a value identifying the clicked hyperlink type. + * Value: One of the values. + */ + hyperlinkType: ASPxClientOfficeDocumentLinkType; + /** + * Gets the clicked link's URI. + * Value: A sting value specifying the link's URI. + */ + targetUri: string; +} +/** + * A client-side equivalent of the ASPxRichEdit object. + */ +interface ASPxClientRichEdit extends ASPxClientControl { + /** + * Provides access to document structural elements. + * Value: A object that lists RichEdit's document structural elements. + */ + document: RichEditDocument; + /** + * Provides access to RichEdit's client-side commands. + * Value: A object that lists RichEdit's client-side commands. + */ + commands: RichEditCommands; + /** + * Provides access to the client methods that changes the selection. + * Value: A object that lists methods to work with the selection. + */ + selection: RichEditSelection; + /** + * Occurs after a custom command has been executed on the client side. + */ + CustomCommandExecuted: ASPxClientEvent>; + /** + * Fires after a client change has been made to the document and the client-server synchronization starts to apply the change on the server. + */ + BeginSynchronization: ASPxClientEvent>; + /** + * Fires after a document change has been applied to the server and server and client document models have been synchronized. + */ + EndSynchronization: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the RichEdit. + */ + CallbackError: ASPxClientEvent>; + /** + * Fires if any change is made to the RichEdit's document on the client. + */ + DocumentChanged: ASPxClientEvent>; + /** + * Occurs when a hyperlink is clicked within the document. + */ + HyperlinkClick: ASPxClientEvent>; + /** + * Occurs when the selection is changed within the document. + */ + SelectionChanged: ASPxClientEvent>; + /** + * Enables you to switch the full-screen mode of the Rich Text Editor. + * @param fullscreen true to activate full-screen mode; false to deactivate full-screen mode. + */ + SetFullscreenMode(fullscreen: boolean): void; + /** + * Provides access to an object implementing the RichEdit's ribbon UI. + */ + GetRibbon(): ASPxClientRibbon; + /** + * Sets input focus to the RichEdit. + */ + Focus(): void; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side event. + */ + PerformCallback(parameter: string): void; + /** + * + * @param parameter + * @param onSuccess + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; + /** + * Indicates whether any unsaved changes are contained in the current document. + */ + HasUnsavedChanges(): boolean; + /** + * Reconnects the RichEdit to an external ribbon. + */ + ReconnectToExternalRibbon(): void; +} +/** + * Contains a set of the available client commands. + */ +interface RichEditCommands { + /** + * Gets a command to create a new empty document. + * Value: A object that provides methods for executing the command and checking its state. + */ + fileNew: FileNewCommand; + /** + * Gets a command to open the file, specifying its path. + * Value: A object that provides methods for executing the command and checking its state. + */ + fileOpen: FileOpenCommand; + /** + * Gets a command to invoke the File Open dialog allowing one to select and load a document file into RichEdit. + * Value: A object that provides methods for executing the command and checking its state. + */ + fileOpenDialog: FileOpenDialogCommand; + /** + * Gets a command to save the document to a file. + * Value: A object that provides methods for executing the command and checking its state. + */ + fileSave: FileSaveCommand; + /** + * Gets a command to download the document file, specifying its extension. + * Value: A object that provides methods for executing the command and checking its state. + */ + fileDownload: FileDownloadCommand; + /** + * Gets a command to invoke the Save As dialog that prompts for a file name and saves the current document in a file with the specified path. + * Value: A object that provides methods for executing the command and checking its state. + */ + fileSaveAs: FileSaveAsCommand; + /** + * Gets a command to invoke a browser-specific Print dialog allowing one to print the current document. + * Value: A object that provides methods for executing the command and checking its state. + */ + filePrint: FilePrintCommand; + /** + * Gets a command to cancel changes caused by the previous command. + * Value: A object that provides methods for executing the command and checking its state. + */ + undo: UndoCommand; + /** + * Gets a command to reverse actions of the previous undo command. + * Value: A object that provides methods for executing the command and checking its state. + */ + redo: RedoCommand; + /** + * Gets a command to copy the selected text and place it to the clipboard. + * Value: A object that provides methods for executing the command and checking its state. + */ + copy: CopyCommand; + /** + * Gets a command to paste the text from the clipboard over the selection. + * Value: A object that provides methods for executing the command and checking its state. + */ + paste: PasteCommand; + /** + * Gets a command to cut the selected text and place it to the clipboard. + * Value: A object that provides methods for executing the command and checking its state. + */ + cut: CutCommand; + /** + * Gets a command to change the font name of characters in a selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFontName: ChangeFontNameCommand; + /** + * Gets a command to change the font size of characters in a selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFontSize: ChangeFontSizeCommand; + /** + * Gets a command to increase the font size of characters in a selected range to the closest larger predefined value. + * Value: A object that provides methods for executing the command and checking its state. + */ + increaseFontSize: IncreaseFontSizeCommand; + /** + * Gets a command to decrease the selected range's font size to the closest smaller predefined value. + * Value: A object that provides methods for executing the command and checking its state. + */ + decreaseFontSize: DecreaseFontSizeCommand; + /** + * Gets a command to convert selected text to upper case. + * Value: A object that provides methods for executing the command and checking its state. + */ + makeTextUpperCase: MakeTextUpperCaseCommand; + /** + * Gets a command to convert selected text to lower case. + * Value: A object that provides methods for executing the command and checking its state. + */ + makeTextLowerCase: MakeTextLowerCaseCommand; + /** + * Gets a command to capitalize each word in the selected sentence. + * Value: A object that provides methods for executing the command and checking its state. + */ + capitalizeEachWordTextCase: CapitalizeEachWordTextCaseCommand; + /** + * Gets a command to toggle case for each character - upper case becomes lower, lower case becomes upper. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTextCase: ToggleTextCaseCommand; + /** + * Gets a command to change the bold formatting of characters in a selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFontBold: ChangeFontBoldCommand; + /** + * Gets a command to change the italic formatting of characters in a selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFontItalic: ChangeFontItalicCommand; + /** + * Gets a command to change the underline formatting of characters in a selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFontUnderline: ChangeFontUnderlineCommand; + /** + * Gets a command to change the strikeout formatting of characters in a selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFontStrikeout: ChangeFontStrikeoutCommand; + /** + * Gets a command to change the superscript formatting of characters in a selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFontSuperscript: ChangeFontSuperscriptCommand; + /** + * Gets a command to change the subscript formatting of characters in the selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFontSubscript: ChangeFontSubscriptCommand; + /** + * Gets a command to change the font color of characters in a selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFontForeColor: ChangeFontForeColorCommand; + /** + * Gets a command to change the background color of characters in a selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFontBackColor: ChangeFontBackColorCommand; + /** + * Gets a command to reset the selected text's formatting to default. + * Value: A object that provides methods for executing the command and checking its state. + */ + clearFormatting: ClearFormattingCommand; + /** + * Gets a command to change the selected range's style. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeStyle: ChangeStyleCommand; + /** + * Gets a command to toggle between the bulleted paragraph and normal text. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleBulletedList: ToggleBulletedListCommand; + /** + * Gets a command to toggle between the numbered paragraph and normal text. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleNumberingList: ToggleNumberingListCommand; + /** + * Gets a command to toggle between the multilevel list style and normal text. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleMultilevelList: ToggleMultilevelListCommand; + /** + * Gets a command to increment the indent level of paragraphs in a selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + increaseIndent: IncreaseIndentCommand; + /** + * Gets a command to decrement the indent level of paragraphs in a selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + decreaseIndent: DecreaseIndentCommand; + /** + * Gets a command to toggle hidden symbol visibility. + * Value: A object that provides methods for executing the command and checking its state. + */ + showHiddenSymbols: ShowHiddenSymbolsCommand; + /** + * Gets a command to toggle left paragraph alignment on and off. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleParagraphAlignmentLeft: ToggleParagraphAlignmentLeftCommand; + /** + * Gets a command to toggle centered paragraph alignment on and off. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleParagraphAlignmentCenter: ToggleParagraphAlignmentCenterCommand; + /** + * Gets a command to toggle right paragraph alignment on and off. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleParagraphAlignmentRight: ToggleParagraphAlignmentRightCommand; + /** + * Gets a command to toggle justified paragraph alignment on and off. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleParagraphAlignmentJustify: ToggleParagraphAlignmentJustifyCommand; + /** + * Gets a command to format a current paragraph with single line spacing. + * Value: A object that provides methods for executing the command and checking its state. + */ + setSingleParagraphSpacing: SetSingleParagraphSpacingCommand; + /** + * Gets a command to format a current paragraph with one and a half line spacing. + * Value: A object that provides methods for executing the command and checking its state. + */ + setSesquialteralParagraphSpacing: SetSesquialteralParagraphSpacingCommand; + /** + * Gets a command to format a selected paragraph with double line spacing. + * Value: A object that provides methods for executing the command and checking its state. + */ + setDoubleParagraphSpacing: SetDoubleParagraphSpacingCommand; + /** + * Gets a command to add spacing before a paragraph. + * Value: A object that provides methods for executing the command and checking its state. + */ + addSpacingBeforeParagraph: AddSpacingBeforeParagraphCommand; + /** + * Gets a command to add spacing after a paragraph. + * Value: A object that provides methods for executing the command and checking its state. + */ + addSpacingAfterParagraph: AddSpacingAfterParagraphCommand; + /** + * Gets a command to remove spacing before the selected paragraph. + * Value: A object that provides methods for executing the command and checking its state. + */ + removeSpacingBeforeParagraph: RemoveSpacingBeforeParagraphCommand; + /** + * Gets a command to remove spacing after the selected paragraph. + * Value: A object that provides methods for executing the command and checking its state. + */ + removeSpacingAfterParagraph: RemoveSpacingAfterParagraphCommand; + /** + * Gets a command to change the background color of paragraphs in a selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeParagraphBackColor: ChangeParagraphBackColorCommand; + /** + * Gets a command to invoke the Font dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + openFontFormattingDialog: OpenFontFormattingDialogCommand; + /** + * Gets a command to change the font formatting of characters in a selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFontFormatting: ChangeFontFormattingCommand; + /** + * Gets a command to invoke the Indents And Spacing tab of the Paragraph dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + openParagraphFormattingDialog: OpenParagraphFormattingDialogCommand; + /** + * Gets a command to change the formatting of paragraphs in a selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeParagraphFormatting: ChangeParagraphFormattingCommand; + /** + * Gets a command to insert a page break at the current position in the document. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertPageBreak: InsertPageBreakCommand; + /** + * Gets a command to invoke the Insert Table dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + openInsertTableDialog: OpenInsertTableDialogCommand; + /** + * Gets a command to invoke the Insert Table dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertTable: InsertTableCommand; + /** + * Gets a command to invoke the Insert Image dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + openInsertPictureDialog: OpenInsertPictureDialogCommand; + /** + * Gets a command to insert a picture from a file. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertPicture: InsertPictureCommand; + /** + * Gets a command to invoke the Bookmark dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + openInsertBookmarkDialog: OpenInsertBookmarkDialogCommand; + /** + * Gets a command to insert a new bookmark that references the current selection. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertBookmark: InsertBookmarkCommand; + /** + * A command to delete a specific bookmark. + * Value: A object that provides methods for executing the command and checking its state. + */ + deleteBookmark: DeleteBookmarkCommand; + /** + * Gets a command to invoke the Hyperlink dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + openInsertHyperlinkDialog: OpenInsertHyperlinkDialogCommand; + /** + * Gets a command to insert a hyperlink at the current position in the document. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertHyperlink: InsertHyperlinkCommand; + /** + * Gets a command to delete the selected hyperlink. + * Value: A object that provides methods for executing the command and checking its state. + */ + deleteHyperlink: DeleteHyperlinkCommand; + /** + * Gets a command to delete all hyperlinks in the selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + deleteHyperlinks: DeleteHyperlinksCommand; + /** + * Gets a command to navigate to the document bookmark or URI (uniform resource identifier) specified for the hyperlink. + * Value: A object that provides methods for executing the command and checking its state. + */ + openHyperlink: OpenHyperlinkCommand; + /** + * Gets a command to invoke the Symbols dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + openInsertSymbolDialog: OpenInsertSymbolDialogCommand; + /** + * Gets a command to insert a character into a document. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertSymbol: InsertSymbolCommand; + /** + * Gets a command to change page margin settings. + * Value: A object that provides methods for executing the command and checking its state. + */ + changePageMargins: ChangePageMarginsCommand; + /** + * Gets a command to invoke the Margins tab of the Page Setup dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + openPageMarginsDialog: OpenPageMarginsDialogCommand; + /** + * Gets a command to change the page orientation. + * Value: A object that provides methods for executing the command and checking its state. + */ + changePageOrientation: ChangePageOrientationCommand; + /** + * Gets a command to invoke the Paper tab of the Page Setup dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + openPagePaperSizeDialog: OpenPagePaperSizeDialogCommand; + /** + * Gets a command to change the page size. + * Value: A object that provides methods for executing the command and checking its state. + */ + changePageSize: ChangePageSizeCommand; + /** + * Gets a command to change the number of section columns having the same width. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeSectionEqualColumnCount: ChangeSectionEqualColumnCountCommand; + /** + * Gets a command to invoke the Columns dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + openSectionColumnsDialog: OpenSectionColumnsDialogCommand; + /** + * Gets a command to change the settings of individual section columns. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeSectionColumns: ChangeSectionColumnsCommand; + /** + * Gets a command to insert a column break at the current position in the document. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertColumnBreak: InsertColumnBreakCommand; + /** + * Gets a command to insert a section break and starts a new section on the next page. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertSectionBreakNextPage: InsertSectionBreakNextPageCommand; + /** + * Gets a command to insert a section break and starts a new section on the next even-numbered page. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertSectionBreakEvenPage: InsertSectionBreakEvenPageCommand; + /** + * Gets a command to insert a section break and starts a new section on the next odd-numbered page. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertSectionBreakOddPage: InsertSectionBreakOddPageCommand; + /** + * Gets a command to set the background color of the page. + * Value: A object that provides methods for executing the command and checking its state. + */ + changePageColor: ChangePageColorCommand; + /** + * Gets a command to toggle the horizontal ruler's visibility. + * Value: A object that provides methods for executing the command and checking its state. + */ + showHorizontalRuler: ShowHorizontalRulerCommand; + /** + * Gets a command to toggle the fullscreen mode. + * Value: A object that provides methods for executing the command and checking its state. + */ + setFullscreen: SetFullscreenCommand; + /** + * Gets a command to invoke the Bulleted and Numbering dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + openNumberingListDialog: OpenNumberingListDialogCommand; + /** + * Gets a command to insert a paragraph break at the current position in the document. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertParagraph: InsertParagraphCommand; + /** + * Gets a command to insert text at the current position in a document. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertText: InsertTextCommand; + /** + * Gets a command to delete the text in a selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + delete: DeleteCommand; + /** + * Gets a command to move the cursor backwards and erase the character in that space. + * Value: A object that provides methods for executing the command and checking its state. + */ + backspace: BackspaceCommand; + /** + * Gets a command to insert the line break at the current position in the document. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertLineBreak: InsertLineBreakCommand; + /** + * Gets a command to scale pictures in a selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + changePictureScale: ChangePictureScaleCommand; + /** + * Gets a command to increment the left indentation of paragraphs in a selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + incrementParagraphLeftIndent: IncrementParagraphLeftIndentCommand; + /** + * Gets a command to decrement the paragraph's left indent position. + * Value: A object that provides methods for executing the command and checking its state. + */ + decrementParagraphLeftIndent: DecrementParagraphLeftIndentCommand; + /** + * Gets a command to move the selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + moveContent: MoveContentCommand; + /** + * Gets a command to copy the selected text and place it to the specified position. + * Value: A object that provides methods for executing the command and checking its state. + */ + copyContent: CopyContentCommand; + /** + * Gets a command to insert a tab character at the current position in the document. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertTab: InsertTabCommand; + /** + * Gets a command to invoke the Tabs dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + openTabsDialog: OpenTabsDialogCommand; + /** + * Gets a command to change paragraph tab stops. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeTabs: ChangeTabsCommand; + /** + * Gets a command to invoke the Customize Numbered List dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + openCustomNumberingListDialog: OpenCustomNumberingListDialogCommand; + /** + * Gets a command to customize the numbered list parameters. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeCustomNumberingList: ChangeCustomNumberingListCommand; + /** + * Gets a command to restart the numbering list. + * Value: A object that provides methods for executing the command and checking its state. + */ + restartNumberingList: RestartNumberingListCommand; + /** + * Gets a command to increment the indent level of paragraphs in a selected numbered list. + * Value: A object that provides methods for executing the command and checking its state. + */ + incrementNumberingIndent: IncrementNumberingIndentCommand; + /** + * Gets a command to decrement the indent level of paragraphs in a selected numbered list. + * Value: A object that provides methods for executing the command and checking its state. + */ + decrementNumberingIndent: DecrementNumberingIndentCommand; + /** + * Gets a command to create an empty field in the document. + * Value: A object that provides methods for executing the command and checking its state. + */ + createField: CreateFieldCommand; + /** + * Gets a command to update the field's result. + * Value: A object that provides methods for executing the command and checking its state. + */ + updateField: UpdateFieldCommand; + /** + * Gets a command to display the selected field's codes. + * Value: A object that provides methods for executing the command and checking its state. + */ + showFieldCodes: ShowFieldCodesCommand; + /** + * Get a command to display all field codes in place of the fields in the document. + * Value: A object that provides methods for executing the command and checking its state. + */ + showAllFieldCodes: ShowAllFieldCodesCommand; + /** + * Gets a command to continue the list's numbering. + * Value: A object that provides methods for executing the command and checking its state. + */ + continueNumberingList: ContinueNumberingListCommand; + /** + * Gets a command to insert numeration to a paragraph making it a numbering list item. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertNumeration: InsertNumerationCommand; + /** + * Gets a command to remove the selected numeration. + * Value: A object that provides methods for executing the command and checking its state. + */ + removeNumeration: RemoveNumerationCommand; + /** + * Gets a command to update all fields in the selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + updateAllFields: UpdateAllFieldsCommand; + /** + * Gets a command to insert a DATE field displaying the current date. + * Value: A object that provides methods for executing the command and checking its state. + */ + createDateField: CreateDateFieldCommand; + /** + * Gets a command to insert a TIME field displaying the current time. + * Value: A object that provides methods for executing the command and checking its state. + */ + createTimeField: CreateTimeFieldCommand; + /** + * A command to insert a PAGE field displaying the current page number. + * Value: A object that provides methods for executing the command and checking its state. + */ + createPageField: CreatePageFieldCommand; + /** + * Gets a command to convert the text of all selected sentences to sentence case. + * Value: A object that provides methods for executing the command and checking its state. + */ + makeTextSentenceCase: MakeTextSentenceCaseCommand; + /** + * Gets a command to switch the text case at the current position in the document. + * Value: A object that provides methods for executing the command and checking its state. + */ + switchTextCase: SwitchTextCaseCommand; + /** + * Gets a command to navigate to the first data record. + * Value: A object that provides methods for executing the command and checking its state. + */ + goToFirstDataRecord: GoToFirstDataRecordCommand; + /** + * Gets a command to navigate to the previous data record of the bound data source. + * Value: A object that provides methods for executing the command and checking its state. + */ + goToPreviousDataRecord: GoToPreviousDataRecordCommand; + /** + * Gets a command to navigate to the next data record of the bound data source. + * Value: A object that provides methods for executing the command and checking its state. + */ + goToNextDataRecord: GoToNextDataRecordCommand; + /** + * Gets a command to navigate to the next data record. + * Value: A object that provides methods for executing the command and checking its state. + */ + goToDataRecord: GoToDataRecordCommand; + /** + * Gets a command to navigate to the last data record of the bound data source. + * Value: A object that provides methods for executing the command and checking its state. + */ + goToLastDataRecord: GoToLastDataRecordCommand; + /** + * Gets a command to display or hide actual data in MERGEFIELD fields. + * Value: A object that provides methods for executing the command and checking its state. + */ + showMergedData: ShowMergedDataCommand; + /** + * Gets a command to invoke the Insert Merge Field dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + mergeFieldDialog: MergeFieldDialogCommand; + /** + * Gets a command to insert a MERGEFIELD field (with a data source column name) at the current position in the document. + * Value: A object that provides methods for executing the command and checking its state. + */ + createMergeField: CreateMergeFieldCommand; + /** + * Gets a command to invoke the Export Range dialog window to start a mail merge. + * Value: A object that provides methods for executing the command and checking its state. + */ + mailMergeDialog: MailMergeDialogCommand; + /** + * Gets a command to perform a mail merge and download the merged document. + * Value: A object that provides methods for executing the command and checking its state. + */ + mailMergeAndDownload: MailMergeAndDownloadCommand; + /** + * Gets a command to perform a mail merge and save the merged document to the server. + * Value: A object that provides methods for executing the command and checking its state. + */ + mailMergeAndSaveAs: MailMergeAndSaveAsCommand; + /** + * Gets a command to activate the page header and begin editing. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertHeader: InsertHeaderCommand; + /** + * Gets a command to activate the page footer and begin editing. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertFooter: InsertFooterCommand; + /** + * Gets a command to link a header/footer to the previous section, so it has the same content. + * Value: A object that provides methods for executing the command and checking its state. + */ + linkHeaderFooterToPrevious: LinkHeaderFooterToPreviousCommand; + /** + * Gets a command to navigate to the page footer from the page header in the header/footer editing mode. + * Value: A object that provides methods for executing the command and checking its state. + */ + goToFooter: GoToFooterCommand; + /** + * Gets a command to navigate to the page header from the page footer in the header/footer editing mode. + * Value: A object that provides methods for executing the command and checking its state. + */ + goToHeader: GoToHeaderCommand; + /** + * Gets a command to navigate to the next page header or footer in the header/footer editing mode. + * Value: A object that provides methods for executing the command and checking its state. + */ + goToNextHeaderFooter: GoToNextHeaderFooterCommand; + /** + * Gets a command to navigate to the previous page header or footer in the header/footer editing mode. + * Value: A object that provides methods for executing the command and checking its state. + */ + goToPreviousHeaderFooter: GoToPreviousHeaderFooterCommand; + /** + * Gets a command to change the header/footer edit mode, so it allows creation of a different header or footer for the first page of a document or section. + * Value: A object that provides methods for executing the command and checking its state. + */ + setDifferentFirstPageHeaderFooter: SetDifferentFirstPageHeaderFooterCommand; + /** + * Gets a command to change the header/footer edit mode so it allows creation of a different header or footer for odd and even pages of a document or section. + * Value: A object that provides methods for executing the command and checking its state. + */ + setDifferentOddAndEvenPagesHeaderFooter: SetDifferentOddAndEvenPagesHeaderFooterCommand; + /** + * Gets a command to finish header/footer editing. + * Value: A object that provides methods for executing the command and checking its state. + */ + closeHeaderFooter: CloseHeaderFooterCommand; + /** + * Gets a command to insert a NUMPAGES field displaying the total number of pages. + * Value: A object that provides methods for executing the command and checking its state. + */ + createPageCountField: CreatePageCountFieldCommand; + /** + * Gets a command to invoke the Table tab of the Table Properties dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + openTableFormattingDialog: OpenTableFormattingDialogCommand; + /** + * Gets a command to change the selected table's formatting. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeTableFormatting: ChangeTableFormattingCommand; + /** + * Gets a command to change the selected table rows' preferred height. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeTableRowPreferredHeight: ChangeTableRowPreferredHeightCommand; + /** + * Gets a command to change the preferred cell width of the selected table rows. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeTableCellPreferredWidth: ChangeTableCellPreferredWidthCommand; + /** + * Gets a command to change the selected table columns' preferred width. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeTableColumnPreferredWidth: ChangeTableColumnPreferredWidthCommand; + /** + * Gets a command to change the cell formatting of the selected table elements. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeTableCellFormatting: ChangeTableCellFormattingCommand; + /** + * Gets a command to insert a table column to the left of the current position in the table. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertTableColumnToTheLeft: InsertTableColumnToTheLeftCommand; + /** + * Gets a command to insert a table column to the right of the current position in the table. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertTableColumnToTheRight: InsertTableColumnToTheRightCommand; + /** + * Gets a command to insert a row in the table below the selected row. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertTableRowBelow: InsertTableRowBelowCommand; + /** + * Gets a command to insert a row in the table above the selected row. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertTableRowAbove: InsertTableRowAboveCommand; + /** + * Gets a command to delete the selected rows in the table. + * Value: A object that provides methods for executing the command and checking its state. + */ + deleteTableRows: DeleteTableRowsCommand; + /** + * Gets a command to delete the selected columns in the table. + * Value: A object that provides methods for executing the command and checking its state. + */ + deleteTableColumns: DeleteTableColumnsCommand; + /** + * Gets a command to insert table cells with a horizontal shift into the selected table. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertTableCellWithShiftToTheLeft: InsertTableCellWithShiftToTheLeftCommand; + /** + * Gets a command to delete the selected table cells with a horizontal shift. + * Value: A object that provides methods for executing the command and checking its state. + */ + deleteTableCellsWithShiftHorizontally: DeleteTableCellsWithShiftHorizontallyCommand; + /** + * Gets a command to delete the selected table cells with a vertical shift. + * Value: A object that provides methods for executing the command and checking its state. + */ + deleteTableCellsWithShiftVertically: DeleteTableCellsWithShiftVerticallyCommand; + /** + * Gets a command to delete the selected table. + * Value: A object that provides methods for executing the command and checking its state. + */ + deleteTable: DeleteTableCommand; + /** + * Gets a command to invoke the Insert Cells dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertTableCellsDialog: InsertTableCellsDialogCommand; + /** + * Gets a command to invoke the Delete Cells dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + deleteTableCellsDialog: DeleteTableCellsDialogCommand; + /** + * Gets a command to merge the selected cells. + * Value: A object that provides methods for executing the command and checking its state. + */ + mergeTableCells: MergeTableCellsCommand; + /** + * Gets a command to invoke the Split Cells dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + splitTableCellsDialog: SplitTableCellsDialogCommand; + /** + * Gets a command to split the selected table cells. + * Value: A object that provides methods for executing the command and checking its state. + */ + splitTableCells: SplitTableCellsCommand; + /** + * Gets a command to insert table cells with a vertical shift into the selected table. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertTableCellsWithShiftToTheVertically: InsertTableCellsWithShiftToTheVerticallyCommand; + /** + * Gets a command to invoke the Borders tab of the Borders and Shading dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + openTableBordersAndShadingDialog: OpenTableBordersAndShadingDialogCommand; + /** + * Gets a command to change the selected table's borders and shading. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeTableBordersAndShading: ChangeTableBordersAndShadingCommand; + /** + * Gets a command to apply top-left alignment for the selected cells. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTableCellAlignTopLeft: ToggleTableCellAlignTopLeftCommand; + /** + * Gets a command to apply top-center alignment for the selected cells. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTableCellAlignTopCenter: ToggleTableCellAlignTopCenterCommand; + /** + * Gets a command to apply top-right alignment for the selected cells. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTableCellAlignTopRight: ToggleTableCellAlignTopRightCommand; + /** + * Gets a command to apply middle-left alignment for the selected cells. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTableCellAlignMiddleLeft: ToggleTableCellAlignMiddleLeftCommand; + /** + * Gets a command to apply middle-center alignment for the selected cells. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTableCellAlignMiddleCenter: ToggleTableCellAlignMiddleCenterCommand; + /** + * Gets a command to apply middle-right alignment for the selected cells. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTableCellAlignMiddleRight: ToggleTableCellAlignMiddleRightCommand; + /** + * Gets a command to apply bottom-left alignment for the selected cells. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTableCellAlignBottomLeft: ToggleTableCellAlignBottomLeftCommand; + /** + * Gets a command to apply bottom-center alignment for the selected cells. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTableCellAlignBottomCenter: ToggleTableCellAlignBottomCenterCommand; + /** + * Gets a command to apply bottom-right alignment for the selected cells. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTableCellAlignBottomRight: ToggleTableCellAlignBottomRightCommand; + /** + * Gets a command to change the selected table's style. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeTableStyle: ChangeTableStyleCommand; + /** + * Gets a command to toggle top borders for selected cells on/off. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTableCellTopBorder: ToggleTableCellTopBorderCommand; + /** + * Gets a command to toggle right borders for selected cells on/off. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTableCellRightBorder: ToggleTableCellRightBorderCommand; + /** + * Gets a command to toggle bottom borders for selected cells on/off. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTableCellBottomBorder: ToggleTableCellBottomBorderCommand; + toggleTableCellLeftBorder: ToggleTableCellLeftBorderCommand; + /** + * Gets a command to remove the borders of the selected table cells. + * Value: A object that provides methods for executing the command and checking its state. + */ + removeTableCellBorders: RemoveTableCellBordersCommand; + /** + * Gets a command to toggle all borders for selected cells on/off. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTableCellAllBorders: ToggleTableCellAllBordersCommand; + /** + * Gets a command to toggle inner horizontal borders for selected cells on/off. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTableCellInsideHorizontalBorders: ToggleTableCellInsideHorizontalBordersCommand; + /** + * Gets a command to toggle inner vertical borders for selected cells on/off. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTableCellInsideVerticalBorders: ToggleTableCellInsideVerticalBordersCommand; + /** + * Gets a command to toggle outer borders for selected cells on/off. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTableCellOutsideBorders: ToggleTableCellOutsideBordersCommand; + /** + * Gets a command to change the selected table's style options. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeTableLook: ChangeTableLookCommand; + /** + * Gets a command to change the repository item's table border style. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeTableBorderRepositoryItem: ChangeTableBorderRepositoryItemCommand; + /** + * Gets a command to change cell shading in the selected table elements. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeTableCellShading: ChangeTableCellShadingCommand; + /** + * Gets a command to toggle the display of grid lines for a table with no borders applied - on/off. + * Value: A object that provides methods for executing the command and checking its state. + */ + showTableGridLines: ShowTableGridLinesCommand; + /** + * Gets a command to invoke the Search Panel allowing end-users to search text and navigate through search results. + * Value: A object that provides methods for executing the command and checking its state. + */ + openFindPanel: OpenFindPanelCommand; + /** + * Gets a command to invoke the Find and Replace dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + openFindAndReplaceDialog: OpenFindAndReplaceDialogCommand; + /** + * Gets a command to find all matches of the specified text in the document. + * Value: A object that provides methods for executing the command and checking its state. + */ + findAll: FindAllCommand; + /** + * Gets a command to hide the results of the search. + * Value: A object that provides methods for executing the command and checking its state. + */ + hideFindResults: HideFindResultsCommand; + /** + * Gets a command to search for a specific text and replace all matches in the document with the specified string. + * Value: A object that provides methods for executing the command and checking its state. + */ + replaceAll: ReplaceAllCommand; + /** + * Gets a command to search for a specific text and replace the next match in the document with the specified string. + * Value: A object that provides methods for executing the command and checking its state. + */ + replaceNext: ReplaceNextCommand; + openSpellingDialog: OpenSpellingDialogCommand; +} +/** + * Serves as a base for objects that implement different client command functionalities. + */ +interface CommandBase { +} +/** + * Serves as a base for commands with a simple common command state. + */ +interface CommandWithSimpleStateBase extends CommandBase { + /** + * Gets information about the command state. + */ + getState(): SimpleCommandState; +} +/** + * Serves as a base for commands with the Boolean state. + */ +interface CommandWithBooleanStateBase extends CommandBase { + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * Defines a simple state common to most of the client commands. + */ +interface SimpleCommandState { + /** + * Gets a value indicating whether the command's UI element is enabled. + * Value: true, if the command's related UI element is enabled; otherwise, false. + */ + enabled: boolean; + /** + * Gets a value indicating whether the command's UI element is visible. + * Value: true, if the command's related UI element is visible; otherwise, false. + */ + visible: boolean; +} +/** + * Defines the state of a command. + */ +interface CommandState extends SimpleCommandState { + /** + * Gets the command state value. + * Value: A T object specifying the command state value. + */ + value: T; +} +/** + * Contains a set properties providing the current information about certain document structural elements. + */ +interface RichEditDocument { + /** + * Provides the information about the active sub-document. + * Value: A object storing information about the essential document functionality. + */ + activeSubDocument: SubDocument; + /** + * Provides information about sections in the current document. + * Value: An array of Section objects storing information about sections. + */ + sectionsInfo: Section[]; + /** + * Provides information about paragraph styles in the current document. + * Value: An array of ParagraphStyle objects storing information about paragraph styles. + */ + paragraphStylesInfo: ParagraphStyle[]; + /** + * Provides information about character styles in the current document. + * Value: An array of CharacterStyle objects storing information about character styles. + */ + characterStylesInfo: CharacterStyle[]; + /** + * Provides information about numbered paragraphs in the document. + * Value: An array of AbstractNumberingList objects storing the information about numbered paragraphs. + */ + abstractNumberingListsInfo: AbstractNumberingList[]; + /** + * Provides information about table styles in the current document. + * Value: An array of TableStyle objects storing information about table styles. + */ + tableStylesInfo: TableStyle[]; +} +/** + * An abstract numbering list definition that defines the appearance and behavior of numbered paragraphs in a document. + */ +interface AbstractNumberingList { + deleted: boolean; +} +/** + * Exposes the settings providing the information about the essential document functionality. + */ +interface SubDocument { + /** + * Provides information about paragraphs contained in the document. + * Value: An array of Paragraph objects storing information about document paragraphs. + */ + paragraphsInfo: Paragraph[]; + /** + * Provides information about fields in the current document. + * Value: An array of Field objects storing information about document fields. + */ + fieldsInfo: Field[]; + /** + * Provides information about tables contained in the document. + * Value: An array of Table objects storing information about document tables. + */ + tablesInfo: Table[]; + /** + * Provides information about document bookmarks. + * Value: An array of Bookmark objects storing information about document bookmarks. + */ + bookmarksInfo: Bookmark[]; + /** + * Gets the document's textual representation. + * Value: A string value specifying the document's text. + */ + text: string; + /** + * Gets the character length of the document. + * Value: An integer that is the number of character positions in the document. + */ + length: number; +} +/** + * Defines a paragraph in the document. + */ +interface Paragraph { + /** + * Gets the paragraph's character length. + * Value: An integer value specifying the element length in characters. + */ + length: number; + /** + * Gets the paragraph's start position in the document. + * Value: An integer value specifying the start position. + */ + start: number; + /** + * Gets the name of the paragraph style applied to the current paragraph (see name). + * Value: A string value specifying the style name. + */ + styleName: string; + /** + * Gets the index of a list applied to the paragraph. + * Value: An integer that is the index of a list to which the paragraph belongs. + */ + listIndex: number; + /** + * Gets or sets the index of the list level applied to the current paragraph in the numbering list. + * Value: An integer that is the index of the list level of the current paragraph. + */ + listLevelIndex: number; +} +/** + * Defines a field in the document. + */ +interface Field { + /** + * Gets the field's start position in a document. + * Value: An integer value specifying the start position. + */ + start: number; + /** + * Gets the field length in a document. + * Value: An integer value specifying the field length. + */ + length: number; + /** + * Gets or sets a URI to navigate to when the hyperlink (represented by the current field) is activated. + * Value: A string representing an URI. + */ + hyperlinkUri: string; + /** + * Gets or sets the text for the tooltip displayed when the mouse hovers over a hyperlink field. + * Value: A string containing the tooltip text. + */ + hyperlinkTip: string; + /** + * Gets or sets the name of a bookmark (or a hyperlink) in the current document which shall be the target of the hyperlink field. + * Value: A string representing the bookmark's name. + */ + hyperlinkAnchor: string; +} +/** + * Defines a table in the document. + */ +interface Table { + /** + * Gets the table's start position in the document. + * Value: An integer value specifying the start position. + */ + start: number; + /** + * Gets the table length in characters. + * Value: A integer value specifying the character length of the table. + */ + length: number; + /** + * Provides access to a collection of table rows. + * Value: An array of TableRow objects storing information about individual table rows. + */ + rows: TableRow[]; + /** + * Gets the name of the style applied to the table (see name). + * Value: A string value specifying the style name. + */ + styleName: string; +} +/** + * Defines a table row in the document. + */ +interface TableRow { + /** + * Gets the table row's start position in the document. + * Value: An integer value specifying the start position. + */ + start: number; + /** + * Gets the table row's character length. + * Value: An integer value specifying the element length in characters. + */ + length: number; + /** + * Provides information about the table row's cells. + * Value: An array of TableCell objects storing information about cells. + */ + cells: TableCell[]; +} +/** + * Defines a table cell in the document. + */ +interface TableCell { + /** + * Gets the table cell's start position in the document. + * Value: An integer value specifying the start position. + */ + start: number; + /** + * Gets the table cell's character length. + * Value: An integer value specifying the element length in characters. + */ + length: number; +} +/** + * Defines a bookmark in the document. + */ +interface Bookmark { + /** + * Gets the bookmark's start position in a document. + * Value: An integer value specifying the start position. + */ + start: number; + /** + * Gets the bookmark's length. + * Value: An integer value specifying the length of the bookmark. + */ + length: number; + /** + * Gets the name of a bookmark in the document. + * Value: A string that is the unique bookmark's name. + */ + name: string; +} +/** + * Defines a section in the document. + */ +interface Section { + /** + * Gets the section's start position in the document. + * Value: An integer value specifying the start position. + */ + start: number; + /** + * Gets the section's character length. + * Value: An integer value specifying the element length in characters. + */ + length: number; + /** + * Provides access to the section's headers. + * Value: An array of HeaderFooter objects storing information about the section's headers. + */ + headers: HeaderFooter[]; + /** + * Provides access to the section's footers. + * Value: An array of HeaderFooter objects storing information about the section's footers. + */ + footers: HeaderFooter[]; +} +/** + * Contains settings defining a header or footer in a document. + */ +interface HeaderFooter { + /** + * Gets the type of the header (footer). + * Value: One of the values. + */ + type: any; + /** + * Provides access to an object implementing the basic document functionality that is common to the header, footer and the main document body. + * Value: A object exposing the basic document functionality. + */ + subDocument: SubDocument; +} +/** + * Serves as a base for objects implementing different element styles. + */ +interface StyleBase { + /** + * Gets or sets the name of the style. + * Value: A string specifying the style name. + */ + name: string; + /** + * Gets whether the specified style is marked as deleted. + * Value: true, if the style is deleted; otherwise, false. + */ + isDeleted: boolean; +} +/** + * Defines the paragraph style settings. + */ +interface ParagraphStyle extends StyleBase { + /** + * Gets or sets the linked style for the current style. + * Value: A object representing a character style linked to a current style. + */ + linkedStyle: CharacterStyle; + /** + * Gets or sets the default style for a paragraph that immediately follows the current paragraph. + * Value: A object specifying the style for the next paragraph. + */ + nextStyle: ParagraphStyle; + /** + * Gets the index of the list item associated with the paragraph formatted with the current style. + * Value: An integer value specifying the list item index. + */ + listIndex: number; + /** + * Gets the index of the list level applied to the paragraph formatted with the current style. + * Value: An integer that is the list level index. + */ + listLevelIndex: number; + /** + * Gets or sets the style from which the current style inherits. + * Value: A object representing the parent style. + */ + parent: ParagraphStyle; +} +/** + * Contains characteristics of a character style in a document. + */ +interface CharacterStyle extends StyleBase { + /** + * Gets or sets the linked style for the current style. + * Value: A object representing a paragraph style linked to a current style. + */ + linkedStyle: ParagraphStyle; + /** + * Gets the style form which the current style inherits. + * Value: A object representing the parent style. + */ + parent: CharacterStyle; +} +/** + * Defines the table style settings. + */ +interface TableStyle extends StyleBase { + /** + * Gets or sets the style from which the current style inherits. + * Value: A object that is the parent style. + */ + parent: TableStyle; +} +declare enum HeaderFooterType { + First=0, + Odd=1, + Primary=1, + Even=2 +} +/** + * Contains a set of methods and properties to work with the document selection. + */ +interface RichEditSelection { + /** + * Gets or sets an array of document interval in the selection. + * Value: An array of Interval objects. + */ + intervals: Interval[]; + collapsed: boolean; + /** + * Moves the cursor to the next line. + */ + goToNextLine(): void; + /** + * Moves the cursor to the next line and allows you to extend the selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + goToNextLine(extendSelection: boolean): void; + /** + * Moves the cursor to the end of the line in which the cursor is located. + */ + goToLineEnd(): void; + /** + * Moves the cursor to the end of the line in which the cursor is located and allows you to extend the selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + goToLineEnd(extendSelection: boolean): void; + /** + * Moves the cursor to the start of the line in which the cursor is located. + */ + goToLineStart(): void; + /** + * Moves the cursor to the start of the line in which the cursor is located and allows you to extend the selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + goToLineStart(extendSelection: boolean): void; + /** + * Moves the cursor to the previous line. + */ + goToPreviousLine(): void; + /** + * Moves the cursor to the previous line and allows you to extend the selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + goToPreviousLine(extendSelection: boolean): void; + /** + * Moves the cursor to the next character. + */ + goToNextCharacter(): void; + /** + * Moves the cursor to the next character and allows you to extend the selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + goToNextCharacter(extendSelection: boolean): void; + /** + * Moves the cursor to the previous character. + */ + goToPreviousCharacter(): void; + /** + * Moves the cursor to the previous character and allows you to extend the selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + goToPreviousCharacter(extendSelection: boolean): void; + /** + * Selects the line in which the cursor is located. + */ + selectLine(): void; + /** + * Selects the line in which the cursor is located and allows you to extend the entire selection with the currently existing selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + selectLine(extendSelection: boolean): void; + /** + * Moves the cursor to the beginning of the next page. + */ + goToNextPage(): void; + /** + * Moves the cursor to the beginning of the next page and allows you to extend the selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + goToNextPage(extendSelection: boolean): void; + /** + * Moves the cursor to the beginning of the previous page. + */ + goToPreviousPage(): void; + /** + * Moves the cursor to the beginning of the previous page and allows you to extend the selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + goToPreviousPage(extendSelection: boolean): void; + /** + * Moves the cursor to the start of the document. + */ + goToDocumentStart(): void; + /** + * Moves the cursor to the start of the document and allows you to extend the selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + goToDocumentStart(extendSelection: boolean): void; + /** + * Moves the cursor to the end of the document. + */ + goToDocumentEnd(): void; + /** + * Moves the cursor to the end of the document and allows you to extend the selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + goToDocumentEnd(extendSelection: boolean): void; + /** + * Moves the cursor to the next word. + */ + goToNextWord(): void; + /** + * Moves the cursor to the next word and allows you to extend the selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + goToNextWord(extendSelection: boolean): void; + /** + * Moves the cursor to the previous word. + */ + goToPrevWord(): void; + /** + * Moves the cursor to the previous word and allows you to extend the selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + goToPrevWord(extendSelection: boolean): void; + /** + * Moves the cursor to the start of the paragraph in which the cursor is located. + */ + goToParagraphStart(): void; + /** + * Moves the cursor to the start of the paragraph in which the cursor is located and allows you to extend the selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + goToParagraphStart(extendSelection: boolean): void; + /** + * Moves the cursor to the end of the paragraph in which the cursor is located. + */ + goToParagraphEnd(): void; + /** + * Moves the cursor to the end of the paragraph in which the cursor is located and allows you to extend the selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + goToParagraphEnd(extendSelection: boolean): void; + /** + * Selects the paragraph in which the cursor is located. + */ + selectParagraph(): void; + /** + * Selects the table cell in which the cursor is located. + */ + selectTableCell(): void; + /** + * Selects the table cell in which the cursor is located and allows you to extend the entire selection with the currently existing selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + selectTableCell(extendSelection: boolean): void; + /** + * Selects the table row in which the cursor is located. + */ + selectTableRow(): void; + /** + * Selects the table row in which the cursor is located and allows you to extend the entire selection with the currently existing selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + selectTableRow(extendSelection: boolean): void; + /** + * Selects the entire table in which the cursor is located. + */ + selectTable(): void; + /** + * Selects the entire table in which the cursor is located and allows you to extend the entire selection with the currently existing selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + selectTable(extendSelection: boolean): void; + /** + * Selects the editor's entire content. + */ + selectAll(): void; +} +/** + * Defines a document's interval. + */ +interface Interval { + /** + * Gets the interval's start position in the document. + * Value: An integer value specifying the start position. + */ + start: number; + /** + * Gets the interval's character length. + * Value: An integer value specifying the element length in characters. + */ + length: number; +} +/** + * A command to invoke the Bookmark dialog. + */ +interface OpenInsertBookmarkDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenInsertBookmarkDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert a new bookmark that references the current selection. + */ +interface InsertBookmarkCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertBookmarkCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param name A string value specifying name of creating bookmark. + * @param start An integer value specifying the start position of bookmark's range. + * @param length An integer value specifying the length of bookmark's range. + */ + execute(name: string, start: number, length: number): boolean; +} +/** + * A command to delete a specific bookmark. + */ +interface DeleteBookmarkCommand extends CommandWithSimpleStateBase { + /** + * Executes the DeleteBookmarkCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param name A string value specifying name of the deleted bookmark. + */ + execute(name: string): boolean; +} +/** + * Gets a command to navigate to the specified bookmark in the document. + */ +interface GoToBookmarkCommand extends CommandWithSimpleStateBase { + /** + * Executes the GoToBookmarkCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param name + */ + execute(name: string): boolean; +} +/** + * A command to paste the text from the clipboard over the selection. + */ +interface PasteCommand extends CommandWithSimpleStateBase { + /** + * Executes the PasteCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to copy the selected text and place it to the clipboard. + */ +interface CopyCommand extends CommandWithSimpleStateBase { + /** + * Executes the CopyCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to cut the selected text and place it to the clipboard. + */ +interface CutCommand extends CommandWithSimpleStateBase { + /** + * Executes the CutCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert an empty document field at the current position in the document. + */ +interface CreateFieldCommand extends CommandWithSimpleStateBase { + /** + * Executes the CreateFieldCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to update the field's result. + */ +interface UpdateFieldCommand extends CommandWithSimpleStateBase { + /** + * Executes the UpdateFieldCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to display the selected field's field codes. + */ +interface ShowFieldCodesCommand extends CommandWithSimpleStateBase { + /** + * Executes the ShowFieldCodesCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param showFieldCodes true to display field codes, false to hide field codes. + */ + execute(showFieldCodes: boolean): boolean; + /** + * Executes the ShowFieldCodesCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to display all field codes in place of the fields in the document. + */ +interface ShowAllFieldCodesCommand extends CommandWithSimpleStateBase { + /** + * Executes the ShowAllFieldCodesCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param showFieldCodes true to display field codes, false to hide field codes. + */ + execute(showFieldCodes: boolean): boolean; + /** + * Executes the ShowAllFieldCodesCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to update all fields in the selected range. + */ +interface UpdateAllFieldsCommand extends CommandWithSimpleStateBase { + /** + * Executes the UpdateAllFieldsCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert a DATE field displaying the current date. + */ +interface CreateDateFieldCommand extends CommandWithSimpleStateBase { + /** + * Executes the CreateDateFieldCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert a TIME field displaying the current time. + */ +interface CreateTimeFieldCommand extends CommandWithSimpleStateBase { + /** + * Executes the CreateTimeFieldCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert a PAGE field displaying the current page number. + */ +interface CreatePageFieldCommand extends CommandWithSimpleStateBase { + /** + * Executes the CreatePageFieldCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to navigate to the next data record of the bound data source. + */ +interface GoToDataRecordCommand extends CommandBase { + /** + * Executes the GoToDataRecordCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param activeRecordIndex An integer value specifying index of the next data record. + */ + execute(activeRecordIndex: number): boolean; +} +/** + * A command to navigate to the first data record of the bound data source. + */ +interface GoToFirstDataRecordCommand extends CommandWithSimpleStateBase { + /** + * Executes the GoToFirstDataRecordCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to navigate to the previous data record of the bound data source. + */ +interface GoToPreviousDataRecordCommand extends CommandWithSimpleStateBase { + /** + * Executes the GoToPreviousDataRecordCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to navigate to the next data record of the bound data source. + */ +interface GoToNextDataRecordCommand extends CommandWithSimpleStateBase { + /** + * Executes the GoToNextDataRecordCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to navigate to the last data record of the bound data source. + */ +interface GoToLastDataRecordCommand extends CommandWithSimpleStateBase { + /** + * Executes the GoToLastDataRecordCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to display or hide actual data in MERGEFIELD fields. + */ +interface ShowMergedDataCommand extends CommandWithBooleanStateBase { + /** + * Executes the ShowMergedDataCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; + /** + * Executes the ShowMergedDataCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param showMergedData true to display merged data, false to hide merged data. + */ + execute(showMergedData: boolean): boolean; +} +/** + * A command to invoke the Insert Merge Field dialog. + */ +interface MergeFieldDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the MergeFieldDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert a MERGEFIELD field (with a data source column name) at the current position in the document. + */ +interface CreateMergeFieldCommand extends CommandWithSimpleStateBase { + /** + * Executes the CreateMergeFieldCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param fieldName A string value specifying the name of the merge field. + */ + execute(fieldName: string): boolean; +} +/** + * Gets a command to invoke the Export Range dialog to start a mail merge. + */ +interface MailMergeDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the MailMergeDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to start the mail merge process and download the resulting document containing the merged information. + */ +interface MailMergeAndDownloadCommand extends CommandBase { + /** + * Executes the MailMergeAndDownloadCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param fileExtension A string value specifying the file extension of the resulting document. + */ + execute(fileExtension: string): boolean; + /** + * Executes the MailMergeAndDownloadCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param fileExtension A string value specifying the file extension of the resulting document. + * @param settings A MailMergeSettings object containing settings to set up mail merge operations. + */ + execute(fileExtension: string, settings: MailMergeSettings): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to start the mail merge process and save the resulting merged document to the server. + */ +interface MailMergeAndSaveAsCommand extends CommandBase { + /** + * Executes the MailMergeAndSaveAsCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param filePath A string value specifying path to the saving file on the server. + */ + execute(filePath: string): boolean; + /** + * Executes the MailMergeAndSaveAsCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param filePath A string value specifying path to the saving file. + * @param settings A MailMergeSettings object specifying hyperlink settings. + */ + execute(filePath: string, settings: MailMergeSettings): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to insert a NUMPAGES field displaying the total number of pages. + */ +interface CreatePageCountFieldCommand extends CommandWithSimpleStateBase { + /** + * Executes the CreatePageCountFieldCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * Contains settings to set up mail merge operations. + */ +interface MailMergeSettings { + /** + * Gets or sets a value specifying which data rows should be exported into a merged document. + * Value: One of the values. + */ + range: any; + /** + * Gets or sets the index of the row from which the exported range starts. + * Value: An integer value specifying the row index. + */ + exportFrom: number; + /** + * Gets or sets the number of data rows in the exported mail-merge range. + * Value: An integer value specifying the row count. + */ + exportRecordsCount: number; + /** + * Gets or sets the merge mode. + * Value: One of the values. + */ + mergeMode: any; +} +declare enum MergeMode { + NewParagraph=0, + NewSection=1, + JoinTables=2 +} +declare enum MailMergeExportRange { + AllRecords=0, + CurrentRecord=1, + Range=2 +} +/** + * A command to create a new empty document. + */ +interface FileNewCommand extends CommandWithSimpleStateBase { + /** + * Executes the FileNewCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to open the file, specifying its path. + */ +interface FileOpenCommand extends CommandWithSimpleStateBase { + /** + * Executes the FileOpenCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param path A string value specifying path to the opening file. + */ + execute(path: string): boolean; +} +/** + * A command to invoke the File Open dialog allowing one to select and load a document file into RichEdit. + */ +interface FileOpenDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the FileOpenDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to save the document to a file. + */ +interface FileSaveCommand extends CommandWithSimpleStateBase { + /** + * Executes the FileSaveCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; + /** + * Executes the FileSaveCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param path A string value specifying path to the saving file. + */ + execute(path: string): boolean; +} +/** + * A command to invoke the Save As dialog that prompts for a file name and saves the current document in a file with the specified path. + */ +interface FileSaveAsCommand extends CommandWithSimpleStateBase { + /** + * Executes the FileSaveAsCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param path A string value specifying path to the saving file. + */ + execute(path: string): boolean; +} +/** + * A command to download the document file, specifying its extension. + */ +interface FileDownloadCommand extends CommandWithSimpleStateBase { + /** + * Executes the FileDownloadCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param fileExtension A string value specifying the extension of the downloading file. + */ + execute(fileExtension: string): boolean; +} +/** + * A command to invoke a browser-specific Print dialog allowing one to print the current document. + */ +interface FilePrintCommand extends CommandWithSimpleStateBase { + /** + * Executes the FilePrintCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to invoke the Search Panel allowing end-users to search text and navigate through search results. + */ +interface OpenFindPanelCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenFindPanelCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to invoke the Find and Replace dialog. + */ +interface OpenFindAndReplaceDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenFindAndReplaceDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to find all matches of the specified text in the document. + */ +interface FindAllCommand extends CommandWithSimpleStateBase { + /** + * Executes the FindAllCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param text A string value specifying finding text. + * @param matchCase true, to perform a case-sensitive search; otherwise, false. + * @param highlightResults true, to highlight result of search; otherwise, false. + */ + execute(text: string, matchCase: boolean, highlightResults: boolean): boolean; + /** + * Executes the FindAllCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param text A string value specifying text to find. + * @param matchCase true, to perform a case-sensitive search; otherwise, false. + * @param highlightResults true, to highlight result of search; otherwise, false. + * @param results An array of Interval objects containing the results of search. + */ + execute(text: string, matchCase: boolean, highlightResults: boolean, results: Interval[]): boolean; +} +/** + * A command to hide the search results. + */ +interface HideFindResultsCommand extends CommandWithSimpleStateBase { + /** + * Executes the HideFindResultsCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to search for a specific text and replace all matches in the document with the specified string. + */ +interface ReplaceAllCommand extends CommandWithSimpleStateBase { + /** + * Executes the ReplaceAllCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param text A string value specifying text to replace. + * @param replaceText A string value specifying replacing text. + * @param matchCase true, to perform a case-sensitive search; otherwise, false. + */ + execute(text: string, replaceText: string, matchCase: boolean): boolean; +} +/** + * A command to search for a specific text and replace the next match in the document with the specified string. + */ +interface ReplaceNextCommand extends CommandWithSimpleStateBase { + /** + * Executes the ReplaceNextCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param text A string value specifying text to replace. + * @param replaceText A string value specifying replacing text. + * @param matchCase true, to perform a case-sensitive search; otherwise, false. + */ + execute(text: string, replaceText: string, matchCase: boolean): boolean; +} +/** + * A command to cancel changes caused by the previous command. + */ +interface UndoCommand extends CommandWithSimpleStateBase { + /** + * Executes the UndoCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to reverse actions of the previous undo command. + */ +interface RedoCommand extends CommandWithSimpleStateBase { + /** + * Executes the RedoCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to invoke the Hyperlink dialog. + */ +interface OpenInsertHyperlinkDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenInsertHyperlinkDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert a hyperlink at the current position in the document. + */ +interface InsertHyperlinkCommand extends CommandBase { + /** + * Executes the InsertHyperlinkCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param settings A HyperLinkSettings object specifying hyperlink settings. + */ + execute(settings: HyperlinkSettings): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to delete the selected hyperlink. + */ +interface DeleteHyperlinkCommand extends CommandWithSimpleStateBase { + /** + * Executes the DeleteHyperlinkCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to delete all hyperlinks in a selected range. + */ +interface DeleteHyperlinksCommand extends CommandWithSimpleStateBase { + /** + * Executes the DeleteHyperlinksCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to navigate to the document bookmark or URI (uniform resource identifier) specified for the hyperlink. + */ +interface OpenHyperlinkCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenHyperlinkCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * Contains settings to define hyperlinks. + */ +interface HyperlinkSettings { + /** + * Gets or sets a text displayed for a hyperlink. + * Value: A string value specifying the hyperlink display text. + */ + text: string; + /** + * Gets or sets a text for the tooltip displayed when the mouse hovers over a hyperlink. + * Value: A string containing the tooltip text. + */ + tooltip: string; + /** + * Gets or sets the hyperlink destination. + * Value: A string value that specifies the destination to which a hyperlink refers. + */ + url: string; + /** + * Gets or sets the associated bookmak. + * Value: A string value specifying the bookmark name. + */ + bookmark: string; +} +/** + * A command to insert a page break at the current position in the document. + */ +interface InsertPageBreakCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertPageBreakCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert a column break at the current position in the document. + */ +interface InsertColumnBreakCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertColumnBreakCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert a section break and start a new section on the next page. + */ +interface InsertSectionBreakNextPageCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertSectionBreakNextPageCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert a section break and start a new section on the next even-numbered page. + */ +interface InsertSectionBreakEvenPageCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertSectionBreakEvenPageCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert a section break and start a new section on the next odd-numbered page. + */ +interface InsertSectionBreakOddPageCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertSectionBreakOddPageCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert the line break at the current position in the document. + */ +interface InsertLineBreakCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertLineBreakCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to toggle between the bulleted paragraph and normal text. + */ +interface ToggleBulletedListCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleBulletedListCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to toggle between the numbered paragraph and normal text. + */ +interface ToggleNumberingListCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleNumberingListCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to toggle between the multilevel list style and normal text. + */ +interface ToggleMultilevelListCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleMultilevelListCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to invoke the Bulleted and Numbering dialog. + */ +interface OpenNumberingListDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenNumberingListDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to invoke the Customize Numbered List dialog. + */ +interface OpenCustomNumberingListDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenCustomNumberingListDialogCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param abstractNumberingListIndex An integer value specifying index of abstract numbering list. + */ + execute(abstractNumberingListIndex: number): boolean; +} +/** + * A command to customize the numbered list parameters. + */ +interface ChangeCustomNumberingListCommand extends CommandBase { + /** + * Executes the ChangeCustomNumberingListCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param abstractNumberingListIndex An integer value specifying the numbering list index. + * @param listLevelSettings An array of ListLevelSettings objects defining settings for list levels. + */ + execute(abstractNumberingListIndex: number, listLevelSettings: ListLevelSettings[]): boolean; + /** + * Gets information about the command state. + * @param abstractNumberingListIndex An integer value specifying the index of the abstract numbering list item whose state to return. + */ + getState(abstractNumberingListIndex: number): any; +} +/** + * A command to restart the numbering list. + */ +interface RestartNumberingListCommand extends CommandWithSimpleStateBase { + /** + * Executes the RestartNumberingListCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to increment the indent level of paragraphs in a selected numbered list. + */ +interface IncrementNumberingIndentCommand extends CommandWithSimpleStateBase { + /** + * Executes the IncrementNumberingIndentCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to decrement the indent level of paragraphs in a selected numbered list. + */ +interface DecrementNumberingIndentCommand extends CommandWithSimpleStateBase { + /** + * Executes the DecrementNumberingIndentCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to continue the list's numbering. + */ +interface ContinueNumberingListCommand extends CommandWithSimpleStateBase { + /** + * Executes the ContinueNumberingListCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert numeration to a paragraph making it a numbering list item. + */ +interface InsertNumerationCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertNumerationCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param abstractNumberingListIndex An integer value specifying index of abstract numbering list. + */ + execute(abstractNumberingListIndex: number): boolean; + /** + * Executes the InsertNumerationCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param numberingListIndex An integer value specifying index of numbering list. + * @param isAbstractNumberingList true, to insert an abstract numbering list; otherwise, false. + */ + execute(numberingListIndex: number, isAbstractNumberingList: boolean): boolean; +} +/** + * A command to remove the selected numeration. + */ +interface RemoveNumerationCommand extends CommandWithSimpleStateBase { + /** + * Executes the RemoveNumerationCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * Contains settings to define individual bulleted or numbered list levels. + */ +interface ListLevelSettings { + /** + * Gets or sets the pattern used to format the list level for display purposes. + * Value: A string value specifying the format pattern. + */ + displayFormatString: string; + /** + * Gets or sets the numbering format used for the current list level's paragraph. + * Value: One of the values. + */ + format: any; + /** + * Gets the list level item's start position in the document. + * Value: An integer value specifying the start position. + */ + start: number; + /** + * Gets or sets the paragraph text alignment within numbered list levels. + * Value: One of the values. + */ + alignment: any; + separator: string; + /** + * Gets or sets the left indent for text within the current list level's paragraph. + * Value: An integer value specifying the left indent. + */ + leftIndent: number; + /** + * Gets or sets a value specifying the indent of the first line of the current list level's paragraph. + * Value: An integer value specifying the indent. + */ + firstLineIndent: number; + /** + * Gets or sets a value specifying whether and how the first line of the current list level's paragraph is indented. + * Value: One of the values. + */ + firstLineIndentType: any; + /** + * Gets or sets the font name of the current list level's paragraph. + * Value: A string value specifying the font name. + */ + fontName: string; + /** + * Gets or sets the font color of the current list level's paragraph. + * Value: A string value specifying the font color. + */ + fontColor: string; + /** + * Gets or sets the font size of the current list level's paragraph. + * Value: An integer value specifying the font size. + */ + fontSize: number; + /** + * Gets or sets whether the font formatting of the current list level's paragraph is bold. + * Value: true, if the font formatting is bold; otherwise, false. + */ + fontBold: boolean; + /** + * Gets or sets whether the font formatting of the current list level's paragraph is italic. + * Value: true, if the font formatting is italic; otherwise, false. + */ + fontItalic: boolean; +} +declare enum ListLevelFormat { + Decimal=0, + AIUEOHiragana=1, + AIUEOFullWidthHiragana=2, + ArabicAbjad=3, + ArabicAlpha=4, + Bullet=5, + CardinalText=6, + Chicago=7, + ChineseCounting=8, + ChineseCountingThousand=9, + ChineseLegalSimplified=10, + Chosung=11, + DecimalEnclosedCircle=12, + DecimalEnclosedCircleChinese=13, + DecimalEnclosedFullstop=14, + DecimalEnclosedParenthses=15, + DecimalFullWidth=16, + DecimalFullWidth2=17, + DecimalHalfWidth=18, + DecimalZero=19, + Ganada=20, + Hebrew1=21, + Hebrew2=22, + Hex=23, + HindiConsonants=24, + HindiDescriptive=25, + HindiNumbers=26, + HindiVowels=27, + IdeographDigital=28, + IdeographEnclosedCircle=29, + IdeographLegalTraditional=30, + IdeographTraditional=31, + IdeographZodiac=32, + IdeographZodiacTraditional=33, + Iroha=34, + IrohaFullWidth=35, + JapaneseCounting=36, + JapaneseDigitalTenThousand=37, + JapaneseLegal=38, + KoreanCounting=39, + KoreanDigital=40, + KoreanDigital2=41, + KoreanLegal=42, + LowerLetter=43, + LowerRoman=44, + None=45, + NumberInDash=46, + Ordinal=47, + OrdinalText=48, + RussianLower=49, + RussianUpper=50, + TaiwaneseCounting=51, + TaiwaneseCountingThousand=52, + TaiwaneseDigital=53, + ThaiDescriptive=54, + ThaiLetters=55, + ThaiNumbers=56, + UpperLetter=57, + UpperRoman=58, + VietnameseDescriptive=59 +} +declare enum ListLevelNumberAlignment { + Left=0, + Center=1, + Right=2 +} +/** + * A command to invoke the Insert Image dialog. + */ +interface OpenInsertPictureDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenInsertPictureDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert a picture from a file. + */ +interface InsertPictureCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertPictureCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param imageUrl A string value specifying picture's Url. + */ + execute(imageUrl: string): boolean; +} +/** + * A command to invoke the Symbols dialog. + */ +interface OpenInsertSymbolDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenInsertSymbolDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert a character into the document. + */ +interface InsertSymbolCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertSymbolCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param symbol A string value specifying symbols to insert. + * @param fontName A string value specifying font of symbols to insert. + */ + execute(symbol: string, fontName: string): boolean; +} +/** + * A command to insert a paragraph break at the current position in the document. + */ +interface InsertParagraphCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertParagraphCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert text at the current position in the document. + */ +interface InsertTextCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertTextCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param text A string value specifying text to insert. + */ + execute(text: string): boolean; +} +/** + * A command to delete the text in a selected range. + */ +interface DeleteCommand extends CommandWithSimpleStateBase { + /** + * Executes the DeleteCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to move the cursor backwards and erase the character in that space. + */ +interface BackspaceCommand extends CommandWithSimpleStateBase { + /** + * Executes the BackspaceCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to scale pictures in a selected range. + */ +interface ChangePictureScaleCommand extends CommandBase { + /** + * Executes the ChangePictureScaleCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param scale A Scale object specifying scaling of the picture. + */ + execute(scale: Scale): boolean; + /** + * Executes the ChangePictureScaleCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param x An interger number specifying width of the picture + * @param y An interger number specifying height of the picture + */ + execute(x: number, y: number): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to move the selected range to a specific position in the document. + */ +interface MoveContentCommand extends CommandWithSimpleStateBase { + /** + * Executes the MoveContentCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param position An integer value specifying position to insert selected text. + */ + execute(position: number): boolean; +} +/** + * A command to copy the selected text and place it to the specified position. + */ +interface CopyContentCommand extends CommandWithSimpleStateBase { + /** + * Executes the CopyContentCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param position An integer number value specifying position for pasting selected text. + */ + execute(position: number): boolean; +} +/** + * A command to insert a tab character at the current position in the document. + */ +interface InsertTabCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertTabCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * Defines the scaling settings. + */ +interface Scale { + x: number; + y: number; +} +/** + * A command to change page margin settings. + */ +interface ChangePageMarginsCommand extends CommandBase { + /** + * Executes the ChangePageMarginsCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param left An integer number specifying left margin of the page. + * @param top An integer number specifying top margin of the page. + * @param right An integer number specifying right margin of the page. + * @param bottom An integer number specifying bottom margin of the page. + */ + execute(left: number, top: number, right: number, bottom: number): boolean; + /** + * Executes the ChangePageMarginsCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param margins A Margins object specifying page margin settings. + */ + execute(margins: Margins): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to invoke the Margins tab of the Page Setup dialog. + */ +interface OpenPageMarginsDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenPageMarginsDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to change the page orientation. + */ +interface ChangePageOrientationCommand extends CommandBase { + /** + * + * @param isPortrait + */ + execute(isPortrait: any): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to invoke the Paper tab of the Page Setup dialog. + */ +interface OpenPagePaperSizeDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenPagePaperSizeDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to set the page size. + */ +interface SetPageSizeDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the SetPageSizeDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to change the page size. + */ +interface ChangePageSizeCommand extends CommandBase { + /** + * Executes the ChangePageSizeCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param width An integer number specifying width of the page. + * @param height An integer number specifying height of the page. + */ + execute(width: number, height: number): boolean; + /** + * Executes the ChangePageSizeCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param size A Size object specifying the page size settings. + */ + execute(size: Size): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to change the number of section columns having the same width. + */ +interface ChangeSectionEqualColumnCountCommand extends CommandBase { + /** + * Executes the ChangeSectionEqualColumnCountCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param columnCount An interger number specifying the number of section columns having the same width. + */ + execute(columnCount: number): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to invoke the Columns dialog. + */ +interface OpenSectionColumnsDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenSectionColumnsDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to change the settings of individual section columns. + */ +interface ChangeSectionColumnsCommand extends CommandBase { + /** + * Executes the ChangeSectionColumnsCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to change the background color of the page. + */ +interface ChangePageColorCommand extends CommandBase { + /** + * Executes the ChangePageColorCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param color A string specifying background color of the page. May be specified as color name or hex color value. + */ + execute(color: string): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to activate the page header and begin editing. + */ +interface InsertHeaderCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertHeaderCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to activate the page footer and begin editing. + */ +interface InsertFooterCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertFooterCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to link a header/footer to the previous section, so it has the same content. + */ +interface LinkHeaderFooterToPreviousCommand extends CommandWithSimpleStateBase { + /** + * Executes the LinkHeaderFooterToPreviousCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to navigate to the page footer from the page header in the header/footer editing mode. + */ +interface GoToFooterCommand extends CommandWithSimpleStateBase { + /** + * Executes the GoToFooterCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to navigate to the page header from the page footer in the header/footer editing mode. + */ +interface GoToHeaderCommand extends CommandWithSimpleStateBase { + /** + * Executes the GoToHeaderCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to navigate to the next page header or footer in the header/footer editing mode. + */ +interface GoToNextHeaderFooterCommand extends CommandWithSimpleStateBase { + /** + * Executes the GoToNextHeaderFooterCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to navigate to the previous page header or footer in the header/footer editing mode. + */ +interface GoToPreviousHeaderFooterCommand extends CommandWithSimpleStateBase { + /** + * Executes the GoToPreviousHeaderFooterCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to change the header/footer edit mode, so it allows creation of a different header or footer for the first page of a document or section. + */ +interface SetDifferentFirstPageHeaderFooterCommand extends CommandWithBooleanStateBase { + /** + * Executes the SetDifferentFirstPageHeaderFooterCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; + /** + * Executes the SetDifferentFirstPageHeaderFooterCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param differentFirstPage true to apply different text for first page's header and footer, false to remove difference. + */ + execute(differentFirstPage: boolean): boolean; +} +/** + * A command to change the header/footer edit mode so it allows creation of a different header or footer for odd and even pages of a document or section. + */ +interface SetDifferentOddAndEvenPagesHeaderFooterCommand extends CommandWithBooleanStateBase { + /** + * Executes the SetDifferentOddAndEvenPagesHeaderFooterCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; + /** + * Executes the SetDifferentOddAndEvenPagesHeaderFooterCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param differentOddAndEvenPages true to apply different text for odd and even pages' header and footer, false to remove difference. + */ + execute(differentOddAndEvenPages: boolean): boolean; +} +/** + * A command to finish header/footer editing. + */ +interface CloseHeaderFooterCommand extends CommandWithSimpleStateBase { + /** + * Executes the CloseHeaderFooterCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * Defines a section column in the document. + */ +interface SectionColumn { + /** + * Gets or sets the width of the section column. + * Value: An integer value specifying the section column width. + */ + width: number; + /** + * Gets or sets the amount of space between adjacent section columns. + * Value: An integer value specifying the spacing between section columns. + */ + spacing: number; +} +/** + * Defines the size settings. + */ +interface Size { + /** + * Gets or sets the width value. + * Value: An integer value specifying the width. + */ + width: number; + /** + * Gets or sets the height value. + * Value: An integer value specifying the height. + */ + height: number; +} +/** + * Defines the margin settings. + */ +interface Margins { + /** + * Gets or sets the left margin. + * Value: An integer value specifying the left margin. + */ + left: number; + /** + * Gets or sets the top margin. + * Value: An integer value specifying the top margin. + */ + top: number; + /** + * Gets or sets the right margin. + * Value: An integer value specifying the right margin. + */ + right: number; + /** + * Gets or sets the bottom margin. + * Value: An integer value specifying the bottom margin. + */ + bottom: number; +} +declare enum Orientation { + Landscape=0, + Portrait=1 +} +/** + * A command to increment the indent level of paragraphs in a selected range. + */ +interface IncreaseIndentCommand extends CommandWithSimpleStateBase { + /** + * Executes the IncreaseIndentCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to decrement the indent level of paragraphs in a selected range. + */ +interface DecreaseIndentCommand extends CommandWithSimpleStateBase { + /** + * Executes the DecreaseIndentCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to toggle the visibility of hidden symbols. + */ +interface ShowHiddenSymbolsCommand extends CommandWithBooleanStateBase { + /** + * Executes the ShowHiddenSymbolsCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; + /** + * Executes the ShowHiddenSymbolsCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param show true to display hidden symbols; otherwise, false. + */ + execute(show: boolean): boolean; +} +/** + * A command to toggle left paragraph alignment on and off. + */ +interface ToggleParagraphAlignmentLeftCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleParagraphAlignmentLeftCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to toggle centered paragraph alignment on and off. + */ +interface ToggleParagraphAlignmentCenterCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleParagraphAlignmentCenterCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to toggle right paragraph alignment on and off. + */ +interface ToggleParagraphAlignmentRightCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleParagraphAlignmentRightCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to toggle justified paragraph alignment on and off. + */ +interface ToggleParagraphAlignmentJustifyCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleParagraphAlignmentJustifyCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to format a current paragraph with single line spacing. + */ +interface SetSingleParagraphSpacingCommand extends CommandWithBooleanStateBase { + /** + * Executes the SetSingleParagraphSpacingCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to format a current paragraph with one and a half line spacing. + */ +interface SetSesquialteralParagraphSpacingCommand extends CommandWithBooleanStateBase { + /** + * Executes the SetSesquialteralParagraphSpacingCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to format a current paragraph with double line spacing. + */ +interface SetDoubleParagraphSpacingCommand extends CommandWithBooleanStateBase { + /** + * Executes the SetDoubleParagraphSpacingCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to add spacing before a paragraph. + */ +interface AddSpacingBeforeParagraphCommand extends CommandWithSimpleStateBase { + /** + * Executes the AddSpacingBeforeParagraphCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to add spacing after a paragraph. + */ +interface AddSpacingAfterParagraphCommand extends CommandWithSimpleStateBase { + /** + * Executes the AddSpacingAfterParagraphCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to remove spacing before the selected paragraph. + */ +interface RemoveSpacingBeforeParagraphCommand extends CommandWithSimpleStateBase { + /** + * Executes the RemoveSpacingBeforeParagraphCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to remove spacing after the selected paragraph. + */ +interface RemoveSpacingAfterParagraphCommand extends CommandWithSimpleStateBase { + /** + * Executes the RemoveSpacingAfterParagraphCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to change the background color of paragraphs in a selected range. + */ +interface ChangeParagraphBackColorCommand extends CommandBase { + /** + * Executes the ChangeParagraphBackColorCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param color A string specifying highlighting color of the paragraphs in a selected range. May be specified as color name or hex color value. + */ + execute(color: string): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to invoke the Paragraph dialog allowing end-users to set paragraph formatting. + */ +interface OpenParagraphFormattingDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenParagraphFormattingDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to change the formatting of paragraphs in a selected range. + */ +interface ChangeParagraphFormattingCommand extends CommandBase { + /** + * Executes the ChangeParagraphFormattingCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param settings A ParagraphFormattingSettings object specifying paragraph formatting settings. + */ + execute(settings: ParagraphFormattingSettings): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to increment the left indentation of paragraphs in a selected range. + */ +interface IncrementParagraphLeftIndentCommand extends CommandWithSimpleStateBase { + /** + * Executes the IncrementParagraphLeftIndentCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to decrement the left indentation of paragraphs in a selected range. + */ +interface DecrementParagraphLeftIndentCommand extends CommandWithSimpleStateBase { + /** + * Executes the DecrementParagraphLeftIndentCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to invoke the Tabs paragraph dialog. + */ +interface OpenTabsDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenTabsDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to change paragraph tab stops. + */ +interface ChangeTabsCommand extends CommandBase { + /** + * Executes the ChangeTabsCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param settings A TabsSettings object maintaining the information about tab stops. + */ + execute(settings: TabsSettings): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * Contains the information about tab stops. + */ +interface TabsSettings { + /** + * Gets or sets the default tab stop value. + * Value: An integer value specifying the default tab stop. + */ + defaultTabStop: number; + /** + * Gets or sets a list of tab stops. + * Value: An array of TabSettings objects containing individual tab stop settings. + */ + tabs: TabSettings[]; +} +/** + * Contains settings of a tab stop. + */ +interface TabSettings { + /** + * Gets or sets the alignment type, specifying how any text after the tab will be lined up. + * Value: One of the values. + */ + alignment: any; + /** + * Gets or sets the tab leader style, i.e., the symbol used as a tab leader. + * Value: One of the values. + */ + leader: any; + /** + * Gets or sets the position of the tab stop. + * Value: A number representing the distance from the left edge of the text area. + */ + position: number; + /** + * Gets or sets whether the individual tab stop is in effect. + * Value: true to switch off this tab stop; otherwise, false. + */ + deleted: boolean; +} +declare enum TabAlign { + Left=0, + Center=1, + Right=2, + Decimal=3 +} +declare enum TabLeaderType { + None=0, + Dots=1, + MiddleDots=2, + Hyphens=3, + Underline=4, + ThickLine=5, + EqualSign=6 +} +/** + * Contains settings to define the paragraph formatting. + */ +interface ParagraphFormattingSettings { + /** + * Gets or sets the paragraph alignment. + * Value: One of the values. + */ + alignment: any; + /** + * Gets or sets the outline level of a paragraph. + * Value: An integer specifying the level number. + */ + outlineLevel: number; + /** + * Gets or sets the right indent value for the specified paragraph. + * Value: An integer value specifying the right indent. + */ + rightIndent: number; + /** + * Gets or sets the spacing before the current paragraph. + * Value: An integer value specifying the spacing before the paragraph. + */ + spacingBefore: number; + /** + * Gets or sets the spacing after the current paragraph. + * Value: An integer value specifying the spacing after the paragraph. + */ + spacingAfter: number; + /** + * Gets or sets a value which determines the spacing between lines in a paragraph. + * Value: One of the values. + */ + lineSpacingType: any; + /** + * Gets or sets a value specifying whether and how the first line of a paragraph is indented. + * Value: One of the values. + */ + firstLineIndentType: any; + /** + * Gets or sets a value specifying the indent of the first line of a paragraph. + * Value: An integer value specifying the indent of the first line. + */ + firstLineIndent: number; + /** + * Gets or sets whether to suppress addition of additional space (contextual spacing) between paragraphs of the same style. + * Value: true to remove extra spacing between paragraphs, false to add extra space. + */ + contextualSpacing: boolean; + /** + * Gets or sets whether to prevent all page breaks that interrupt a paragraph. + * Value: true, to keep paragraph lines together; otherwise, false. + */ + keepLinesTogether: boolean; + /** + * Gets or sets whether a page break is inserted automatically before a specified paragraph(s). + * Value: true, if a page break is inserted automatically before a paragraph(s); otherwise, false. + */ + pageBreakBefore: boolean; + /** + * Gets or sets the left indent for text within a paragraph. + * Value: An integer value specifying the left indent. + */ + leftIndent: number; + /** + * Gets or sets a line spacing value. + * Value: An integer value specifying the line spacing. + */ + lineSpacing: number; + /** + * Gets or sets the paragraph background color. + * Value: A string value specifying the background color. + */ + backColor: string; +} +declare enum ParagraphAlignment { + Left=0, + Right=1, + Center=2, + Justify=3 +} +declare enum ParagraphLineSpacingType { + Single=0, + Sesquialteral=1, + Double=2, + Multiple=3, + Exactly=4, + AtLeast=5 +} +declare enum ParagraphFirstLineIndent { + None=0, + Indented=1, + Hanging=2 +} +interface OpenSpellingDialogCommand extends CommandWithSimpleStateBase { + execute(): boolean; +} +/** + * A command to invoke the Insert Table dialog. + */ +interface OpenInsertTableDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenInsertTableDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to invoke the Insert Table dialog. + */ +interface InsertTableCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertTableCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param columnCount An integer value specifying number of columns in a generated table. + * @param rowCount An integer value specifying number of rows in a generated table. + */ + execute(columnCount: number, rowCount: number): boolean; +} +/** + * A command to invoke the Table Properties dialog. + */ +interface OpenTableFormattingDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenTableFormattingDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to change the selected table's formatting. + */ +interface ChangeTableFormattingCommand extends CommandBase { + /** + * Executes the ChangeTableFormattingCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param settings A TableFormattingSettings object containing the settings to format a table. + */ + execute(settings: TableFormattingSettings): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to change the selected table's preferred row height. + */ +interface ChangeTableRowPreferredHeightCommand extends CommandBase { + /** + * Executes the ChangeTableRowPreferredHeightCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param preferredHeight A TableHeightUnit object specifying preferred height of the selected table rows. + */ + execute(preferredHeight: TableHeightUnit): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to change the preferred cell width of the selected table rows. + */ +interface ChangeTableCellPreferredWidthCommand extends CommandBase { + /** + * Executes the ChangeTableCellPreferredWidthCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param preferredWidth A TableWidthUnit object specifying preferred width of the selected table rows. + */ + execute(preferredWidth: TableWidthUnit): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to change the selected table's preferred column width. + */ +interface ChangeTableColumnPreferredWidthCommand extends CommandBase { + /** + * Executes the ChangeTableColumnPreferredWidthCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param preferredWidth A TableWidthUnit object specifying preferred width of the selected table columns. + */ + execute(preferredWidth: TableWidthUnit): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to change the cell formatting of the selected table elements. + */ +interface ChangeTableCellFormattingCommand extends CommandBase { + /** + * Executes the ChangeTableCellFormattingCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param settings A TableFormattingSettings object specifying cell formatting of the selected table elements. + */ + execute(settings: TableCellFormattingSettings): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to insert a table column to the left of the current position in the table. + */ +interface InsertTableColumnToTheLeftCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertTableColumnToTheLeftCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert a table column to the right of the current position in the table. + */ +interface InsertTableColumnToTheRightCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertTableColumnToTheRightCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert a row in a table below the selected row. + */ +interface InsertTableRowBelowCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertTableRowBelowCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert a row in a table above the selected row. + */ +interface InsertTableRowAboveCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertTableRowAboveCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to delete the selected table rows. + */ +interface DeleteTableRowsCommand extends CommandWithSimpleStateBase { + /** + * Executes the DeleteTableRowsCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to delete the selected table columns. + */ +interface DeleteTableColumnsCommand extends CommandWithSimpleStateBase { + /** + * Executes the DeleteTableColumnsCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert table cells with a horizontal shift into the selected table. + */ +interface InsertTableCellWithShiftToTheLeftCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertTableCellWithShiftToTheLeftCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to delete the selected table cells with a horizontal shift. + */ +interface DeleteTableCellsWithShiftHorizontallyCommand extends CommandWithSimpleStateBase { + /** + * Executes the DeleteTableCellsWithShiftHorizontallyCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to delete the selected table cells with a vertical shift. + */ +interface DeleteTableCellsWithShiftVerticallyCommand extends CommandWithSimpleStateBase { + /** + * Executes the DeleteTableCellsWithShiftVerticallyCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to delete the selected table. + */ +interface DeleteTableCommand extends CommandWithSimpleStateBase { + /** + * Executes the DeleteTableCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to invoke the Insert Cells dialog. + */ +interface InsertTableCellsDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertTableCellsDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to invoke the Delete Cells dialog. + */ +interface DeleteTableCellsDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the DeleteTableCellsDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to merge the selected table cells. + */ +interface MergeTableCellsCommand extends CommandWithSimpleStateBase { + /** + * Executes the MergeTableCellsCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to invoke the Split Cells dialog. + */ +interface SplitTableCellsDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the SplitTableCellsDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to split the selected table cells based on the specified options. + */ +interface SplitTableCellsCommand extends CommandWithSimpleStateBase { + /** + * Executes the SplitTableCellsCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param rowCount An integer value specifying number of rows in the splitted table cells. + * @param columnCount An integer value specifying number of columns in the splitted table cells. + * @param mergeBeforeSplit true to merge the selected cells before splitting; otherwise, false. + */ + execute(rowCount: number, columnCount: number, mergeBeforeSplit: boolean): boolean; +} +/** + * A command to insert table cells with a vertical shift into the selected table. + */ +interface InsertTableCellsWithShiftToTheVerticallyCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertTableCellsWithShiftToTheVerticallyCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to invoke the Borders and Shading table dialog. + */ +interface OpenTableBordersAndShadingDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenTableBordersAndShadingDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to change borders and shading of the selected table elements. + */ +interface ChangeTableBordersAndShadingCommand extends CommandBase { + /** + * Executes the ChangeTableBordersAndShadingCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param settings A TableBorderSettings object with settings specifying table borders. + * @param applyToWholeTable true to apply the border settings to the whole table, false to apply the border settings to the selected cells. + */ + execute(settings: TableBordersSettings, applyToWholeTable: boolean): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to apply top-left alignment for the selected table cells. + */ +interface ToggleTableCellAlignTopLeftCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleTableCellAlignTopLeftCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to apply top-center alignment for the selected table cells. + */ +interface ToggleTableCellAlignTopCenterCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleTableCellAlignTopCenterCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to apply top-right alignment for the selected table cells. + */ +interface ToggleTableCellAlignTopRightCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleTableCellAlignTopRightCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to apply middle-left alignment for the selected table cells. + */ +interface ToggleTableCellAlignMiddleLeftCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleTableCellAlignMiddleLeftCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to apply middle-center alignment for the selected table cells. + */ +interface ToggleTableCellAlignMiddleCenterCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleTableCellAlignMiddleCenterCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to apply middle-right alignment for the selected table cells. + */ +interface ToggleTableCellAlignMiddleRightCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleTableCellAlignMiddleRightCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to apply bottom-left alignment for the selected table cells. + */ +interface ToggleTableCellAlignBottomLeftCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleTableCellAlignBottomLeftCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to apply bottom-center alignment for the selected table cells. + */ +interface ToggleTableCellAlignBottomCenterCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleTableCellAlignBottomCenterCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to apply bottom-right alignment for the selected table cells. + */ +interface ToggleTableCellAlignBottomRightCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleTableCellAlignBottomRightCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to change the selected table's style. + */ +interface ChangeTableStyleCommand extends CommandBase { + /** + * Executes the ChangeTableStyleCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param style A TableStyle object specifying the style applying to the table. + */ + execute(style: TableStyle): boolean; + /** + * Executes the ChangeTableStyleCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param styleName A string specifying the name of style applying to the table. + */ + execute(styleName: string): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to toggle top borders for selected cells on/off. + */ +interface ToggleTableCellTopBorderCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleTableCellTopBorderCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to toggle right borders for selected cells on/off. + */ +interface ToggleTableCellRightBorderCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleTableCellRightBorderCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to toggle bottom borders for selected cells on/off. + */ +interface ToggleTableCellBottomBorderCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleTableCellBottomBorderCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +interface ToggleTableCellLeftBorderCommand extends CommandWithBooleanStateBase { + execute(): boolean; +} +/** + * A command to remove the borders of the selected table cells. + */ +interface RemoveTableCellBordersCommand extends CommandWithSimpleStateBase { + /** + * Executes the RemoveTableCellBordersCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to toggle all borders for selected cells on/off. + */ +interface ToggleTableCellAllBordersCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleTableCellAllBordersCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to toggle inner borders for selected cells on/off. + */ +interface ToggleTableCellInsideBordersCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleTableCellInsideBordersCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to toggle inner horizontal borders for selected cells on/off. + */ +interface ToggleTableCellInsideHorizontalBordersCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleTableCellInsideHorizontalBordersCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to toggle inner vertical borders for selected cells on/off. + */ +interface ToggleTableCellInsideVerticalBordersCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleTableCellInsideVerticalBordersCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to toggle outer borders for selected cells on/off. + */ +interface ToggleTableCellOutsideBordersCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleTableCellOutsideBordersCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to change the selected table's style options. + */ +interface ChangeTableLookCommand extends CommandBase { + /** + * Executes the ChangeTableLookCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param settings A TableLookSettings object containing the settings that modify the table appearance. + */ + execute(settings: TableLookSettings): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to change the repository item's table border style. + */ +interface ChangeTableBorderRepositoryItemCommand extends CommandBase { + /** + * Executes the ChangeTableBorderRepositoryItemCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param settings A TableBorderSettings object specifying the repository item's table border style. + */ + execute(settings: TableBorderSettings): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to change cell shading in the selected table elements. + */ +interface ChangeTableCellShadingCommand extends CommandBase { + /** + * Executes the ChangeTableCellShadingCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param color A string specifying color of the selected cells' shading. May be specified as color name or hex color value. + */ + execute(color: string): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to toggle the display of grid lines for a table with no borders applied - on/off. + */ +interface ShowTableGridLinesCommand extends CommandWithBooleanStateBase { + /** + * Executes the ShowTableGridLinesCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; + /** + * Executes the ShowTableGridLinesCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param showTableGridLines true to display grid lines of the table, false to hide grid lines of the table. + */ + execute(showTableGridLines: boolean): boolean; +} +/** + * Contains the table style settings that modify the table appearance. + */ +interface TableLookSettings { + /** + * Gets or sets a value specifying whether special formatting is applied to the first row of the table. + * Value: true, to apply the formatting; otherwise, false. + */ + applyFirstRow: boolean; + /** + * Gets or sets a value specifying whether special formatting is applied to the last row of the table. + * Value: true, to apply the formatting; otherwise, false. + */ + applyLastRow: boolean; + /** + * Gets or sets a value specifying whether special formatting is applied to the first column of the table. + * Value: true, to apply the formatting; otherwise, false. + */ + applyFirstColumn: boolean; + /** + * Gets or sets a value specifying whether special formatting is applied to the last column of the table. + * Value: true, to apply the formatting; otherwise, false. + */ + applyLastColumn: boolean; + /** + * Gets or sets a value specifying whether row banding formatting is not applied to the table. + * Value: true, to apply the formatting; otherwise, false. + */ + doNotApplyRowBanding: boolean; + /** + * Gets or sets a value specifying whether column banding formatting is not applied to the table. + * Value: true, to apply the formatting; otherwise, false. + */ + doNotApplyColumnBanding: boolean; +} +/** + * Contains settings to define table borders. + */ +interface TableBordersSettings { + /** + * Gets or sets the top border's settings. + * Value: A TableBorderSettings object containing the table border settings. + */ + top: TableBorderSettings; + /** + * Gets or sets the right border's settings. + * Value: A TableBorderSettings object containing the table border settings. + */ + right: TableBorderSettings; + /** + * Gets or sets the bottom border's settings. + * Value: A TableBorderSettings object containing the table border settings. + */ + bottom: TableBorderSettings; + /** + * Gets or sets the left border's settings. + * Value: A TableBorderSettings object containing the table border settings. + */ + left: TableBorderSettings; + /** + * Gets or sets the inside horizontal border's settings. + * Value: A TableBorderSettings object containing the table border settings. + */ + insideHorizontal: TableBorderSettings; + /** + * Gets or sets the inside vertical border's settings. + * Value: A TableBorderSettings object containing the table border settings. + */ + insideVertical: TableBorderSettings; + /** + * Gets or sets the background color of table borders. + * Value: A string value specifying the background color. + */ + backgroundColor: string; +} +/** + * Contains settings to define a table border. + */ +interface TableBorderSettings { + /** + * Gets or sets the border color. + * Value: A string value specifying the border color. + */ + color: string; + /** + * Gets or sets the border line width. + * Value: An integer value defining the border line width. + */ + width: number; + /** + * Gets or sets the border line style. + * Value: A object defining the border line style. + */ + style: any; +} +declare enum BorderLineStyle { + None=0, + Single=1, + Thick=2, + Double=3, + Dotted=4, + Dashed=5, + DotDash=6, + DotDotDash=7, + Triple=8, + ThinThickSmallGap=9, + ThickThinSmallGap=10, + ThinThickThinSmallGap=11, + ThinThickMediumGap=12, + ThickThinMediumGap=13, + ThinThickThinMediumGap=14, + ThinThickLargeGap=15, + ThickThinLargeGap=16, + ThinThickThinLargeGap=17, + Wave=18, + DoubleWave=19, + DashSmallGap=20, + DashDotStroked=21, + ThreeDEmboss=22, + ThreeDEngrave=23, + Outset=24, + Inset=25, + Nil=-1 +} +/** + * Contains the settings to define the table cell formatting. + */ +interface TableCellFormattingSettings { + /** + * Gets or sets a table cell's preferred width. + * Value: A object specifying the preferred cell width. + */ + preferredWidth: TableWidthUnit; + /** + * Gets or sets the vertical alignment of a table cell's content. + * Value: One the values. + */ + verticalAlignment: any; + /** + * Gets or sets a value specifying whether text is wrapped in a table cell. + * Value: true if text is wrapped; false if text is not wrapped. + */ + noWrap: boolean; + /** + * Gets or sets a table cell's left margin. + * Value: An integer value specifying the left margin. + */ + marginLeft: number; + /** + * Gets or sets a table cell's right margin. + * Value: An integer value specifying the right margin. + */ + marginRight: number; + /** + * Gets or sets a table cell's top margin. + * Value: An integer value specifying the top margin. + */ + marginTop: number; + /** + * Gets or sets a table cell's bottom margin. + * Value: An integer value specifying the bottom margin. + */ + marginBottom: number; + /** + * Gets or sets a value specifying whether a table cell's margins are inherited from the table level settings. + * Value: true to inherit table level margins; false to use a table cell's own margin settings. + */ + marginsSameAsTable: boolean; +} +declare enum TableCellVerticalAlignment { + Top=0, + Both=1, + Center=2, + Bottom=3 +} +/** + * Contains the settings to format a table. + */ +interface TableFormattingSettings { + /** + * Gets or sets the preferred width of cells in the table. + * Value: A object specifying the width. + */ + preferredWidth: TableWidthUnit; + /** + * Gets or sets the alignment of table rows. + * Value: One of the values. + */ + alignment: any; + /** + * Gets or sets the table's left indent. + * Value: An integer value specifying the indent. + */ + indent: number; + /** + * Gets or sets the spacing between table cells. + * Value: An integer value specifying the spacing. + */ + spacingBetweenCells: number; + /** + * Gets or sets a value specifying whether spacing is allowed between table cells. + * Value: true, to allow spacing; otherwise, false. + */ + allowSpacingBetweenCells: boolean; + /** + * Gets or sets a value that specifying whether to allow automatic resizing of table cells to fit their contents. + * Value: true, to allow automatic resizing; otherwise, false. + */ + resizeToFitContent: boolean; + /** + * Gets or sets the default left margin for cells in the table. + * Value: An integer value specifying the margin value. + */ + defaultCellMarginLeft: number; + /** + * Gets or sets the default right margin for cells in the table. + * Value: An integer value specifying the margin value. + */ + defaultCellMarginRight: number; + /** + * Gets or sets the default top margin for cells in the table. + * Value: An integer value specifying the margin value. + */ + defaultCellMarginTop: number; + /** + * Gets or sets the default bottom margin for cells in the table. + * Value: An integer value specifying the margin value. + */ + defaultCellMarginBottom: number; +} +/** + * Contains settings defining the table width's measurement units and value. + */ +interface TableWidthUnit { + /** + * Gets or sets the table width value. + * Value: An integer value specifying the table width. + */ + value: number; + /** + * Gets or sets the unit type for the table width. + * Value: One of the values. + */ + type: any; +} +/** + * Contains settings defining the table height's measurement units and value. + */ +interface TableHeightUnit { + /** + * Gets or sets the table height value. + * Value: An integer value specifying the table height. + */ + value: number; + type: any; +} +declare enum TableHeightUnitType { + Minimum=0, + Auto=1, + Exact=2 +} +declare enum TableRowAlignment { + Both=0, + Center=1, + Distribute=2, + Left=3, + NumTab=4, + Right=5 +} +declare enum TableWidthUnitType { + Nil=0, + Auto=1, + FiftiethsOfPercent=2, + ModelUnits=3 +} +/** + * A command to change the font name of characters in a selected range. + */ +interface ChangeFontNameCommand extends CommandBase { + /** + * Executes the ChangeFontNameCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param fontName A string specifying font name. + */ + execute(fontName: string): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to change the font size of characters in a selected range. + */ +interface ChangeFontSizeCommand extends CommandBase { + /** + * Executes the ChangeFontSizeCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param fontSize An integer number specifying font size. + */ + execute(fontSize: number): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to increase the font size of characters in a selected range to the closest larger predefined value. + */ +interface IncreaseFontSizeCommand extends CommandWithSimpleStateBase { + /** + * Executes the IncreaseFontSizeCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to decrease the font size of characters in a selected range to the closest smaller predefined value. + */ +interface DecreaseFontSizeCommand extends CommandWithSimpleStateBase { + /** + * Executes the DecreaseFontSizeCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to convert the selected text to upper case. + */ +interface MakeTextUpperCaseCommand extends CommandWithSimpleStateBase { + /** + * Executes the MakeTextUpperCaseCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to convert the selected text to lower case. + */ +interface MakeTextLowerCaseCommand extends CommandWithSimpleStateBase { + /** + * Executes the MakeTextLowerCaseCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to capitalize each word in the selected sentence. + */ +interface CapitalizeEachWordTextCaseCommand extends CommandWithSimpleStateBase { + /** + * Executes the CapitalizeEachWordTextCaseCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to toggle the case for each character - upper case becomes lower, lower case becomes upper. + */ +interface ToggleTextCaseCommand extends CommandWithSimpleStateBase { + /** + * Executes the ToggleTextCaseCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to change the bold formatting of characters in a selected range. + */ +interface ChangeFontBoldCommand extends CommandWithBooleanStateBase { + /** + * Executes the ChangeFontBoldCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; + /** + * Executes the ChangeFontBoldCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param fontBold true to apply bold formatting to the text, false to remove bold formatting. + */ + execute(fontBold: boolean): boolean; +} +/** + * A command to change the italic formatting of characters in a selected range. + */ +interface ChangeFontItalicCommand extends CommandWithBooleanStateBase { + /** + * Executes the ChangeFontItalicCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; + /** + * Executes the ChangeFontItalicCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param fontItalic true to apply italic formatting to the text, false to remove italic formatting. + */ + execute(fontItalic: boolean): boolean; +} +/** + * A command to change the underline formatting of characters in a selected range. + */ +interface ChangeFontUnderlineCommand extends CommandWithBooleanStateBase { + /** + * Executes the ChangeFontUnderlineCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; + /** + * Executes the ChangeFontUnderlineCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param fontUnderline true to apply underline formatting to the text, false to remove underline formatting. + */ + execute(fontUnderline: boolean): boolean; +} +/** + * A command to change the strikeout formatting of characters in a selected range. + */ +interface ChangeFontStrikeoutCommand extends CommandWithBooleanStateBase { + /** + * Executes the ChangeFontStrikeoutCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; + /** + * Executes the ChangeFontStrikeoutCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param fontStrikeout true to apply strikeout formatting to the text, false to remove strikeout formatting. + */ + execute(fontStrikeout: boolean): boolean; +} +/** + * A command to change the superscript formatting of characters in a selected range. + */ +interface ChangeFontSuperscriptCommand extends CommandWithBooleanStateBase { + /** + * Executes the ChangeFontSuperscriptCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; + /** + * Executes the ChangeFontSuperscriptCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param fontSuperscript true to apply superscript formatting to the text, false to remove superscript formatting. + */ + execute(fontSuperscript: boolean): boolean; +} +/** + * A command to change the subscript formatting of characters in the selected range. + */ +interface ChangeFontSubscriptCommand extends CommandWithBooleanStateBase { + /** + * Executes the ChangeFontSubscriptCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; + /** + * Executes the ChangeFontSubscriptCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param fontSubscript true to apply subscript formatting to the text, false to remove subscript formatting. + */ + execute(fontSubscript: boolean): boolean; +} +/** + * A command to change the font color of characters in a selected range. + */ +interface ChangeFontForeColorCommand extends CommandBase { + /** + * Executes the ChangeFontForeColorCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param color A string specifying font color. May be specified as color name or hex color value. + */ + execute(color: string): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to change the background color of characters in a selected range. + */ +interface ChangeFontBackColorCommand extends CommandBase { + /** + * Executes the ChangeFontBackColorCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param color A string specifying highlighting color. May be specified as color name or hex color value. + */ + execute(color: string): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to reset the selected text's formatting to default. + */ +interface ClearFormattingCommand extends CommandWithSimpleStateBase { + /** + * Executes the ClearFormattingCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to change the selected range's style. + */ +interface ChangeStyleCommand extends CommandBase { + /** + * Executes the ChangeStyleCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param style A StyleBase object specifying the selected range's style. + */ + execute(style: StyleBase): boolean; + /** + * Executes the ChangeStyleCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param styleName A string specifying the name of applying style. + * @param isParagraphStyle true to apply style to paragraph, false to apply style to character. + */ + execute(styleName: string, isParagraphStyle: boolean): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to invoke the Font dialog allowing end-users to change the font, size and style of the selected text. + */ +interface OpenFontFormattingDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenFontFormattingDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to convert the text of all selected sentences to sentence case. + */ +interface MakeTextSentenceCaseCommand extends CommandWithSimpleStateBase { + /** + * Executes the MakeTextSentenceCaseCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to switch the text case at the current position in the document. + */ +interface SwitchTextCaseCommand extends CommandWithSimpleStateBase { + /** + * Executes the SwitchTextCaseCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to change the font formatting of characters in a selected range. + */ +interface ChangeFontFormattingCommand extends CommandBase { + /** + * Executes the ChangeFontFormattingCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param settings A FontFormattingSettings object specifying font formatting settings. + */ + execute(settings: FontFormattingSettings): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * Contains settings to define the font formatting. + */ +interface FontFormattingSettings { + /** + * Gets or sets the character(s) font name. + * Value: A string value specifying the font name. + */ + fontName: string; + /** + * Gets or sets the character(s) font size. + * Value: An integer value specifying the font size. + */ + size: number; + /** + * Gets or sets the foreground color of characters. + * Value: A string value specifying the foreground color. + */ + foreColor: string; + /** + * Gets or sets the character background color. + * Value: A string value specifying the background color. + */ + backColor: string; + /** + * Gets or sets the type of underline applied to the character(s). + * Value: true, if characters are underlined; otherwise, false. + */ + underline: boolean; + /** + * Gets or sets the color of the underline for the specified characters. + * Value: A string value specifying the underline color. + */ + underlineColor: string; + /** + * Gets or sets whether the character formatting is bold. + * Value: true, if characters are bold; otherwise, false. + */ + bold: boolean; + /** + * Gets or sets a value indicating whether a character(s) is italicized. + * Value: true, if characters are italicized; otherwise, false. + */ + italic: boolean; + boolean: boolean; + /** + * Gets or sets whether only word characters are underlined. + * Value: true to underline only characters in words; false to underline all characters. + */ + underlineWordsOnly: boolean; + /** + * Gets or sets a value specifying character script formatting. + * Value: One of the values. + */ + script: any; + /** + * Gets or sets a value indicating whether all characters are capital letters. + * Value: true, if all characters are capitalized; otherwise, false. + */ + allCaps: boolean; + /** + * Gets or sets a value indicating whether a character(s) is hidden. + * Value: true, if characters are hidden; otherwise, false. + */ + hidden: boolean; +} +declare enum CharacterFormattingScript { + Normal=0, + Subscript=1, + Superscript=2 +} +/** + * A command to toggle the horizontal ruler's visibility. + */ +interface ShowHorizontalRulerCommand extends CommandWithBooleanStateBase { + /** + * Executes the ShowHorizontalRulerCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; + /** + * Executes the ShowHorizontalRulerCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param show true to display the horizontal ruler, false to hide the horizontal ruler. + */ + execute(show: boolean): boolean; +} +/** + * A command to toggle the fullscreen mode. + */ +interface SetFullscreenCommand extends CommandWithBooleanStateBase { + /** + * Executes the SetFullscreenCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; + /** + * Executes the SetFullscreenCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param fullscreen true to apply fullscreen mode, false to remove fullscreen mode. + */ + execute(fullscreen: boolean): boolean; +} +/** + * Holds the information that determines what action types can be performed for appointments. + */ +interface ASPxClientAppointmentFlags { + /** + * Gets a value that specifies whether an end-user is allowed to delete appointments. + * Value: true if an end-user can delete appointments; otherwise, false. Default is true. + */ + allowDelete: boolean; + /** + * Gets a value that specifies whether an end-user is allowed to edit appointments. + * Value: true if the end-user can edit appointments; otherwise, false. + */ + allowEdit: boolean; + /** + * Gets a value that specifies whether an end-user is allowed to change the time boundaries of appointments. + * Value: true if appointment resizing is allowed; otherwise, false. Default is true. + */ + allowResize: boolean; + /** + * Gets a value that specifies whether an end-user is allowed to copy appointments. + * Value: true if a user can copy appointments; otherwise, false. Default is true. + */ + allowCopy: boolean; + /** + * Gets a value that specifies whether an end-user is allowed to drag and drop appointments to another time slot or date. + * Value: true if the user can drag and drop appointments; otherwise, false. + */ + allowDrag: boolean; + /** + * Gets a value that specifies whether an end-user is allowed to drag and drop appointments between resources. + * Value: true if the end-user can drag appointment from one resource to another; otherwise, false. + */ + allowDragBetweenResources: boolean; + /** + * Gets a value that specifies whether an inplace editor can be activated for an appointment. + * Value: true if an inplace editor is activated; otherwise, false. Default is true. + */ + allowInplaceEditor: boolean; + /** + * Gets a value that specifies whether an end-user is allowed to share the schedule time between two or more appointments. + * Value: true if appointments with the same schedule time are allowed; otherwise, false. Default is true. + */ + allowConflicts: boolean; +} +/** + * Represents a client-side equivalent of the Appointment class. + */ +interface ASPxClientAppointment { + /** + * Gets the time interval of the appointment for client-side scripting. + * Value: An ASPxClientTimeInterval object, representing the interval assigned to an appointment. + */ + interval: ASPxClientTimeInterval; + /** + * Gets the identifiers of resources associated with the appointment for client-side scripting. + * Value: An array of string representations for resource identifiers. + */ + resources: string[]; + /** + * Gets the ID of an appointment for use in client-side scripts. + * Value: A string representation of the appointment ID. + */ + appointmentId: string; + /** + * Gets the type of appointment for use in client-side scripts. + * Value: An ASPxAppointmentType enumeration member, representing the appointment's type. + */ + appointmentType: ASPxAppointmentType; + /** + * Gets the index of the availability status object associated with the appointment. + * Value: An integer value that specifies the index of the corresponding Statuses collection. + */ + statusIndex: number; + /** + * Gets the index of the label object associated with the appointment for client-side scripting. + * Value: An integer value that specifies the index of the corresponding Labels collection. + */ + labelIndex: number; + /** + * Gets the client appointment value that is equivalent in meaning to the Subject property. + * Value: A string representing the appointment subject. + */ + subject: string; + /** + * Gets the client appointment value that is equivalent in meaning to the Description property. + * Value: A string, representing the description for an appointment. + */ + description: string; + /** + * Gets the client appointment value that is equivalent in meaning to the Location property. + * Value: A string representing the appointment location. + */ + location: string; + /** + * Gets the client appointment value that is equivalent in meaning to the AllDay property. + * Value: true indicates the all-day appointment; otherwise, false. + */ + allDay: boolean; + /** + * Adds a resource to the collection of resources associated with the client appointment. + * @param resourceId An object, representing the resource id. + */ + AddResource(resourceId: Object): void; + /** + * Gets the resource associated with the client-side appointment by its index. + * @param index An integer, representing an index of a resource in a resource collection associated with the current appointment. + */ + GetResource(index: number): Object; + /** + * Sets the property value of the client appointment, corresponding to the Start appointment property. + * @param start A JavaScript Date object representing the appointment start. + */ + SetStart(start: Date): void; + /** + * Gets the property value of the client appointment corresponding to the Start appointment property. + */ + GetStart(): Date; + /** + * Sets the property value of the client appointment, corresponding to the End appointment property. + * @param end A JavaScript Date object representing the end of the appointment. + */ + SetEnd(end: Date): void; + /** + * Gets the property value of the client appointment corresponding to the End appointment property. + */ + GetEnd(): Date; + /** + * Sets the property value of the client appointment, corresponding to the Duration appointment property. + * @param duration A TimeSpan object representing the appointment duration. + */ + SetDuration(duration: any): void; + /** + * Gets the property value of the client appointment corresponding to the Duration appointment property. + */ + GetDuration(): number; + /** + * Sets the ID of the client appointment. + * @param id An object representing the appointment identifier. + */ + SetId(id: Object): void; + /** + * Gets the ID of the client appointment. + */ + GetId(): Object; + /** + * Specifies the type of the current client appointment. + * @param type An ASPxAppointmentType enumeration value indicating the appointment type. + */ + SetAppointmentType(type: ASPxAppointmentType): void; + /** + * Gets the type of the client appointment. + */ + GetAppointmentType(): ASPxAppointmentType; + /** + * Sets the property value of the client appointment, corresponding to the StatusId appointment property. + * @param statusId An integer representing the index in the AppointmentStatusCollection. + */ + SetStatusId(statusId: number): void; + /** + * Gets the property value of the client appointment corresponding to the StatusId appointment property. + */ + GetStatusId(): number; + /** + * Sets the property value of the client appointment, corresponding to the LabelId appointment property. + * @param statusId An integer representing the index of the label in the Labels label collection. + */ + SetLabelId(statusId: number): void; + /** + * Gets the property value of the client appointment corresponding to the LabelId appointment property. + */ + GetLabelId(): number; + /** + * Sets the property value of the client appointment, corresponding to the Subject appointment property. + * @param subject A string containing the appointment subject. + */ + SetSubject(subject: string): void; + /** + * Gets the property value of the client appointment corresponding to the Subject appointment property. + */ + GetSubject(): string; + /** + * Sets the property value of the client appointment, corresponding to the Description appointment property. + * @param description A string representing the appointment description. + */ + SetDescription(description: string): void; + /** + * Gets the property value of the client appointment corresponding to the Description appointment property. + */ + GetDescription(): string; + /** + * Sets the property value of the client appointment, corresponding to the Location appointment property. + * @param location A string representing the appointment location. + */ + SetLocation(location: string): void; + /** + * Gets the property value of the client appointment corresponding to the Location appointment property. + */ + GetLocation(): string; + /** + * Specifies the property value of the client appointment corresponding to the AllDay appointment property. + * @param allDay true to indicate the all-day appointment; otherwise, false. + */ + SetAllDay(allDay: boolean): void; + /** + * Gets the property value of the client appointment corresponding to the AllDay appointment property. + */ + GetAllDay(): boolean; + /** + * Gets the appointment that is the RecurrencePattern for the current appointment. + */ + GetRecurrencePattern(): ASPxClientAppointment; + /** + * Sets the property value of the client appointment, corresponding to the RecurrenceInfo appointment property. + * @param recurrenceInfo An ASPxClientRecurrenceInfo object representing the recurrence information. + */ + SetRecurrenceInfo(recurrenceInfo: ASPxClientRecurrenceInfo): void; + /** + * Gets the property value of the client appointment corresponding to the RecurrenceInfo appointment property. + */ + GetRecurrenceInfo(): ASPxClientRecurrenceInfo; +} +/** + * A client point object. + */ +interface ASPxClientPoint { + /** + * Gets the point's X-coordinate. + */ + GetX(): number; + /** + * Gets the point's Y-coordinate. + */ + GetY(): number; +} +/** + * A client rectangle object. + */ +interface ASPxClientRect { + /** + * Gets the X-coordinate of the rectangle's left edge. + */ + GetLeft(): number; + /** + * Gets the X-coordinate of the rectangle's right edge. + */ + GetRight(): number; + /** + * Gets the Y-coordinate of the rectangle's top edge. + */ + GetTop(): number; + /** + * Gets the Y-coordinate of the rectangle's bottom edge. + */ + GetBottom(): number; + /** + * Gets the rectangle's width. + */ + GetWidth(): number; + /** + * Gets the rectangle's height. + */ + GetHeight(): number; +} +/** + * Contains information defining the occurrences of a recurring client appointment. + */ +interface ASPxClientRecurrenceInfo { + /** + * Sets the recurrence start date. + * @param start A JavaScript date object value that specifies the start date for the recurrence. + */ + SetStart(start: Date): void; + /** + * Gets the recurrence start date. + */ + GetStart(): Date; + /** + * Sets the recurrence end date. + * @param end A JavaScript Date object that specifies the end date for the recurrence. + */ + SetEnd(end: Date): void; + /** + * Gets the recurrence end date. + */ + GetEnd(): Date; + /** + * Sets the duration of the recurrence. + * @param duration A TimeSpan object representing the duration. + */ + SetDuration(duration: any): void; + /** + * Gets the duration of the recurrence. + */ + GetDuration(): number; + /** + * Sets the time base for the frequency of the corresponding appointment occurrences. + * @param type An ASPxClientRecurrenceType enumeration value that specifies the recurrence's frequency type. + */ + SetRecurrenceType(type: ASPxClientRecurrenceType): void; + /** + * Gets the time base for the frequency of the corresponding appointment reoccurrence. + */ + GetRecurrenceType(): ASPxClientRecurrenceType; + /** + * Sets the day/days in a week that the corresponding appointment recurs on. + * @param weekDays The ASPxClientWeekDays enumeration value specifying the day/days in a week. + */ + SetWeekDays(weekDays: ASPxClientWeekDays): void; + /** + * Gets the day/days in a week on which the corresponding appointment occurs. + */ + GetWeekDays(): ASPxClientWeekDays; + /** + * Sets how many times the appointment occurs. + * @param occurrenceCount An integer value that specifies how many times the appointment occurs. + */ + SetOccurrenceCount(occurrenceCount: number): void; + /** + * Gets how many times the appointment occurs. + */ + GetOccurrenceCount(): number; + /** + * Sets the frequency with which the corresponding appointment occurs (dependent on the recurrence Type). + * @param periodicity An integer value that specifies the frequency with which the corresponding appointment occurs. + */ + SetPeriodicity(periodicity: number): void; + /** + * Gets the frequency with which the corresponding appointment reoccurs (dependent on the recurrence Type). + */ + GetPeriodicity(): number; + /** + * Sets the ordinal number of a day within a defined month. + * @param dayNubmer A positive integer value that specifies the day number within a month. + */ + SetDayNumber(dayNubmer: number): void; + /** + * Gets the ordinal number of a day within a defined month. + */ + GetDayNumber(): number; + /** + * Sets the occurrence number of the week in a month for the recurrence pattern. + * @param weekOfMonth A ASPxClientWeekOfMonth enumeration value that specifies a particular week in every month. + */ + SetWeekOfMonth(weekOfMonth: ASPxClientWeekOfMonth): void; + /** + * Gets the occurrence number of the week in a month for the recurrence pattern. + */ + GetWeekOfMonth(): ASPxClientWeekOfMonth; + /** + * Sets the month (as a number) on which the corresponding appointment occurs. + * @param month A positive integer value that specifies the month's number. + */ + SetMonth(month: number): void; + /** + * Gets the month (as a number) on which the corresponding appointment recurs. + */ + GetMonth(): number; + /** + * Gets the type of the recurrence range. + */ + GetRange(): ASPxClientRecurrenceRange; + /** + * Sets the type of the recurrence range. + * @param range An ASPxClientRecurrenceRangeenumeration value that specifies the recurrence range type. + */ + SetRange(range: ASPxClientRecurrenceRange): void; +} +/** + * Contains types of the recurrence range. + */ +interface ASPxClientRecurrenceRange { + /** + * A recurring appointment will not have an end date, i.e. infinite recurrence + * Value: The "NoEndDate" string. + */ + NoEndDate: string; + /** + * A recurring appointment will end after its recurrence count exceeds the value specified by the SetOccurrenceCount method. + * Value: The "OccurrenceCount" string. + */ + OccurrenceCount: string; + /** + * A recurring appointment will end after the date specified by the SetEnd method. + * Value: The "EndByDate" string. + */ + EndByDate: string; +} +/** + * Contains recurrence types. + */ +interface ASPxClientRecurrenceType { + /** + * The recurring appointment occurs on a daily basis. + * Value: The "Daily" string. + */ + Daily: string; + /** + * The recurring appointment reoccurs on a weekly basis. + * Value: The "Weekly" string. + */ + Weekly: string; + /** + * The recurring appointment reoccurs on a monthly basis. + * Value: The "Monthly" string. + */ + Monthly: string; + /** + * The recurring appointment reoccurs on an yearly basis. + * Value: The "Yearly" string. + */ + Yearly: string; + /** + * The recurring appointment occurs on an hourly base. + * Value: The "Hourly" string. + */ + Hourly: string; +} +/** + * Contains days and groups of days for use in recurrence patterns. + */ +interface ASPxClientWeekDays { + /** + * Specifies Sunday. + * Value: The integer 1 value. + */ + Sunday: number; + /** + * Specifies Monday. + * Value: The integer 2 value. + */ + Monday: number; + /** + * Specifies Tuesday. + * Value: The integer 4 value. + */ + Tuesday: number; + /** + * Specifies Wednesday. + * Value: The integer 8 value. + */ + Wednesday: number; + /** + * Specifies Thursday. + * Value: The integer 16 value. + */ + Thursday: number; + /** + * Specifies Friday. + * Value: The integer 32 value. + */ + Friday: number; + /** + * Specifies Saturday. + * Value: The integer 64 value. + */ + Saturday: number; + /** + * Specifies Saturday and Sunday. + * Value: The integer 65 value. + */ + WeekendDays: number; + /** + * Specifies work days (Monday, Tuesday, Wednesday, Thursday and Friday). + * Value: The integer 62 value. + */ + WorkDays: number; + /** + * Specifies every day of the week. + * Value: The integer 127 value. + */ + EveryDay: number; +} +/** + * Contains number of weeks in a month in which the event occurs. + */ +interface ASPxClientWeekOfMonth { + /** + * There isn't any recurrence rule based on the weeks in a month. + * Value: The integer 0 value. + */ + None: number; + /** + * The recurring event will occur once a month, on the specified day or days of the first week in the month. + * Value: The integer 1 value. + */ + First: number; + /** + * The recurring event will occur once a month, on the specified day or days of the second week in the month. + * Value: The integer 2 value. + */ + Second: number; + /** + * The recurring event will occur once a month, on the specified day or days of the third week in the month. + * Value: The integer 3 value. + */ + Third: number; + /** + * The recurring event will occur once a month, on the specified day or days of the fourth week in the month. + * Value: The integer 4 value; + */ + Fourth: number; + /** + * The recurring event will occur once a month, on the specified day or days of the last week in the month. + * Value: The integer 5 value; + */ + Last: number; +} +/** + * Represents a client-side equivalent of the WeekDaysCheckEdit control. + */ +interface ASPxClientWeekDaysCheckEdit extends ASPxClientControl { + /** + * Gets the selection state of the week day check boxes. + */ + GetValue(): ASPxClientWeekDays; + /** + * Gets the selection state of the week day check boxes. + * @param value An ASPxClientWeekDays object specifying the selection state of the week day check boxes. + */ + SetValue(value: ASPxClientWeekDays): void; +} +/** + * Represents a client-side equivalent of the RecurrenceRangeControl. + */ +interface ASPxClientRecurrenceRangeControl extends ASPxClientControl { + /** + * Gets the type of the recurrence range. + */ + GetRange(): ASPxClientRecurrenceRange; + /** + * Gets how many times the appointment occurs. + */ + GetOccurrenceCount(): number; + /** + * Gets the recurrence end date. + */ + GetEndDate(): Date; + /** + * Sets the type of the recurrence range. + * @param range An ASPxClientRecurrenceRangeenumeration value that specifies the recurrence range type. + */ + SetRange(range: ASPxClientRecurrenceRange): void; + /** + * Sets how many times the appointment occurs. + * @param occurrenceCount An integer value that specifies how many times the appointment occurs. + */ + SetOccurrenceCount(occurrenceCount: number): void; + /** + * Sets the recurrence end date. + * @param date A JavaScript Date object that specifies the end date for the recurrence. + */ + SetEndDate(date: Date): void; +} +/** + * A base for client equivalents of recurrence controls available in the XtraScheduler library. + */ +interface ASPxClientRecurrenceControlBase extends ASPxClientControl { + /** + * Returns an object providing access to the ASPxClientRecurrenceControlBase control's editor values. + */ + CreateValueAccessor(): DefaultRecurrenceRuleValuesAccessor; + /** + * Updates values of editors displayed by the ASPxClientRecurrenceControlBase control. + * @param recurrenceInfo An ASPxClientRecurrenceInfo object containing new editor values. + */ + Update(recurrenceInfo: ASPxClientRecurrenceInfo): void; +} +/** + * Represents a client-side equivalent of the DailyRecurrenceControl - a control for specifying the daily recurrence. + */ +interface ASPxClientDailyRecurrenceControl extends ASPxClientRecurrenceControlBase { + /** + * Returns an object providing access to the ASPxClientDailyRecurrenceControl's editor values. + */ + CreateValueAccessor(): DefaultRecurrenceRuleValuesAccessor; + /** + * Updates values of editors displayed by the ASPxClientDailyRecurrenceControl. + * @param recurrenceInfo An ASPxClientRecurrenceInfo object containing new editor values. + */ + Update(recurrenceInfo: ASPxClientRecurrenceInfo): void; +} +/** + * Represents a client-side equivalent of the WeeklyRecurrenceControl. + */ +interface ASPxClientWeeklyRecurrenceControl extends ASPxClientRecurrenceControlBase { + /** + * Returns an object providing access to the ASPxClientWeeklyRecurrenceControl's editor values. + */ + CreateValueAccessor(): DefaultRecurrenceRuleValuesAccessor; + /** + * Updates values of editors displayed by the ASPxClientWeeklyRecurrenceControl. + * @param recurrenceInfo An ASPxClientRecurrenceInfo object containing new editor values. + */ + Update(recurrenceInfo: ASPxClientRecurrenceInfo): void; +} +/** + * Represents a client-side equivalent of the MonthlyRecurrenceControl. + */ +interface ASPxClientMonthlyRecurrenceControl extends ASPxClientRecurrenceControlBase { + /** + * Returns an object providing access to the ASPxClientMonthlyRecurrenceControl's editor values. + */ + CreateValueAccessor(): DefaultRecurrenceRuleValuesAccessor; + /** + * Updates values of editors displayed by the ASPxClientMonthlyRecurrenceControll. + * @param recurrenceInfo An ASPxClientRecurrenceInfo object containing new editor values. + */ + Update(recurrenceInfo: ASPxClientRecurrenceInfo): void; +} +/** + * Represents a client-side equivalent of the YearlyRecurrenceControl. + */ +interface ASPxClientYearlyRecurrenceControl extends ASPxClientRecurrenceControlBase { + /** + * Returns an object providing access to the ASPxClientYearlyRecurrenceControl's editor values. + */ + CreateValueAccessor(): DefaultRecurrenceRuleValuesAccessor; + /** + * Updates values of editors displayed by the ASPxClientYearlyRecurrenceControl. + * @param recurrenceInfo An ASPxClientRecurrenceInfo object containing new editor values. + */ + Update(recurrenceInfo: ASPxClientRecurrenceInfo): void; +} +/** + * An object providing access to an ASPxClientRecurrenceControlBase control's editor values. + */ +interface DefaultRecurrenceRuleValuesAccessor { + /** + * Get the frequency with which the appointment occurs with respect to the appointment's recurrence type. + */ + GetPeriodicity(): number; + /** + * Gets the number of the month's day in which the appointment is scheduled. + */ + GetDayNumber(): number; + /** + * Gets or sets the month's number. + */ + GetMonth(): number; + /** + * Gets the days of the week to which a weekly recurrent appointment is scheduled. + */ + GetWeekDays(): ASPxClientWeekDays; + /** + * Gets the number of the week in a month when an appointment is scheduled. + */ + GetWeekOfMonth(): ASPxClientWeekOfMonth; +} +/** + * An object providing access to an ASPxClientDailyRecurrenceControl's editor values. + */ +interface DailyRecurrenceValuesAccessor extends DefaultRecurrenceRuleValuesAccessor { + /** + * Gets the number of days between appointment occurrences. + */ + GetPeriodicity(): number; + /** + * Gets the days of the week to which a daily recurrent appointment is scheduled. + */ + GetWeekDays(): ASPxClientWeekDays; +} +/** + * An object providing access to an ASPxClientWeeklyRecurrenceControl's editor values. + */ +interface WeeklyRecurrenceValuesAccessor extends DefaultRecurrenceRuleValuesAccessor { + /** + * Gets the number of weeks between appointment occurrences. + */ + GetPeriodicity(): number; + /** + * Gets the days of the week to which a weekly recurrent appointment is scheduled. + */ + GetWeekDays(): ASPxClientWeekDays; +} +/** + * An object providing access to an ASPxClientMonthlyRecurrenceControl's editor values. + */ +interface MonthlyRecurrenceValuesAccessor extends DefaultRecurrenceRuleValuesAccessor { + /** + * Gets the number of the month's day in which the appointment is scheduled. + */ + GetDayNumber(): number; + /** + * Gets the number of months between appointment occurrences. + */ + GetPeriodicity(): number; + /** + * Gets the days of the week to which a monthly recurrent appointment is scheduled. + */ + GetWeekDays(): ASPxClientWeekDays; + /** + * Gets the number of the week in a month when an appointment is scheduled. + */ + GetWeekOfMonth(): ASPxClientWeekOfMonth; +} +/** + * An object providing access to an ASPxClientYearlyRecurrenceControl's editor values. + */ +interface YearlyRecurrenceValuesAccessor extends DefaultRecurrenceRuleValuesAccessor { + /** + * Gets the number of the month's day in which the appointment is scheduled. + */ + GetDayNumber(): number; + /** + * Gets or sets the month's number. + */ + GetMonth(): number; + /** + * Gets the days of the week to which a yearly recurrent appointment is scheduled. + */ + GetWeekDays(): ASPxClientWeekDays; + /** + * Gets or sets the number of a week in a month when an appointment is scheduled. + */ + GetWeekOfMonth(): ASPxClientWeekOfMonth; +} +/** + * Provides base functionality for ASPxClientScheduler's forms. + */ +interface ASPxClientFormBase { + /** + * Occurs when the form has been closed. + */ + FormClosed: ASPxClientEvent>; + /** + * Closes the form. + */ + Close(): void; + /** + * Sets the visibility state of the specified form element. + * @param element An object specifying the element whose visibility state should be changed. + * @param isVisible true to display the element; false to hide the element. + */ + SetVisibleCore(element: Object, isVisible: boolean): void; +} +/** + * Represents a client-side equivalent of the RecurrenceTypeEdit. + */ +interface ASPxClientRecurrenceTypeEdit extends ASPxClientRadioButtonList { + /** + * Gets the selected recurrence type. + */ + GetRecurrenceType(): ASPxClientRecurrenceType; + /** + * Sets the selected recurrence type. + * @param recurrenceType An ASPxClientRecurrenceType enumeration value. + */ + SetRecurrenceType(recurrenceType: ASPxClientRecurrenceType): void; +} +/** + * Contains lists of property names for different appointment types. + */ +interface AppointmentPropertyNames { + /** + * Gets the list of properties characteristic for appointments of the Normal type. + * Value: A string array which is composed of the appointment property names. + */ + Normal: string; + /** + * Gets the list of properties characteristic for appointments of the Pattern type. + * Value: A string array which is composed of the appointment property names. + */ + Pattern: string; +} +/** + * Represents the client-side equivalent of the TimeInterval class. + */ +interface ASPxClientTimeInterval { + /** + * Gets a value indicating if the time interval is All-Day. + */ + GetAllDay(): boolean; + /** + * Sets a value specifying if the time interval is All-Day. + * @param allDayValue true, if this is an all-day time interval; otherwise, false. + */ + SetAllDay(allDayValue: boolean): void; + /** + * Client-side function that returns the start time of the interval. + */ + GetStart(): Date; + /** + * Client-side function that returns the duration of the specified time interval. + */ + GetDuration(): number; + /** + * Client-side function that returns the end time of the interval. + */ + GetEnd(): Date; + /** + * Client-side function that sets the start time of the interval. + * @param value A DateTime value, representing the beginning of the interval. + */ + SetStart(value: Date): void; + /** + * Client-side function that returns the duration of the specified time interval. + * @param value A TimeSpan object, representing the duration of the time period. + */ + SetDuration(value: any): void; + /** + * Client-side function that sets the end time of the interval. + * @param value A DateTime value, representing the end of the interval. + */ + SetEnd(value: Date): void; + /** + * Determines whether the specified object is equal to the current ASPxClientTimeInterval instance. + * @param interval The object to compare with the current object. + */ + Equals(interval: ASPxClientTimeInterval): boolean; + /** + * Checks if the current time interval intersects with the specified time interval. + * @param interval A ASPxClientTimeInterval object which represents the time interval to be checked. + */ + IntersectsWith(interval: ASPxClientTimeInterval): boolean; + /** + * Checks if the current time interval intersects with the specified time interval. The boundaries of the time intervals are excluded from the check. + * @param interval A ASPxClientTimeInterval object which represents the time interval to be checked. + */ + IntersectsWithExcludingBounds(interval: ASPxClientTimeInterval): boolean; + /** + * Client-side function that determines whether the specified interval is contained within the current one. + * @param interval An ASPxClientTimeInterval object, representing the time interval to check. + */ + Contains(interval: ASPxClientTimeInterval): boolean; +} +/** + * Holds action types for the client-side Refresh method. + */ +interface ASPxClientSchedulerRefreshAction { + /** + * Gets the value of the action parameter which initiates a simple reload of the control. + * Value: An integer representing the action parameter value. + */ + None: number; + /** + * Gets the value of the action parameter which initiates reloading of the main ASPxScheduler control and its data-dependent satellites. + * Value: An integer representing the action parameter value. + */ + VisibleIntervalChanged: number; + /** + * Gets the value of the action parameter which initiates reloading of the main ASPxScheduler control and its satellite View controls. + * Value: An integer representing the action parameter value. + */ + ActiveViewTypeChanged: number; +} +/** + * Contains methods allowing you to perform or cancel an operation. + */ +interface ASPxClientAppointmentOperation { + /** + * Passes parameters to the corresponding callback function to accomplish the operation. + */ + Apply(): void; + /** + * Cancels the operation. + */ + Cancel(): void; +} +/** + * Represents the client-side equivalent of the ASPxScheduler control. + */ +interface ASPxClientScheduler extends ASPxClientControl { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientScheduler. + */ + CallbackError: ASPxClientEvent>; + /** + * Occurs on the client side when the Scheduler control is about to change its active view. + */ + ActiveViewChanging: ASPxClientEvent>; + /** + * Client-side event. Occurs after the active view of the ASPxScheduler has been changed. + */ + ActiveViewChanged: ASPxClientEvent>; + /** + * Occurs when the end-user clicks an appointment. + */ + AppointmentClick: ASPxClientEvent>; + /** + * Occurs when the end-user double clicks on an appointment. + */ + AppointmentDoubleClick: ASPxClientEvent>; + /** + * Occurs on the client side when the user selects an appointment. + */ + AppointmentsSelectionChanged: ASPxClientEvent>; + /** + * Fires on the client side when the time cell selection is changed. + */ + SelectionChanged: ASPxClientEvent>; + /** + * Occurs on the client side when the time cell selection is about to change. + */ + SelectionChanging: ASPxClientEvent>; + /** + * Fires on the client side when the time interval of the scheduling area is changed. + */ + VisibleIntervalChanged: ASPxClientEvent>; + /** + * Occurs when one of More Buttons is clicked. + */ + MoreButtonClicked: ASPxClientEvent>; + /** + * Client-side event that occurs when a popup menu item is clicked. + */ + MenuItemClicked: ASPxClientEvent>; + /** + * Client-side event that occurs after an appointment has been dragged and dropped. + */ + AppointmentDrop: ASPxClientEvent>; + /** + * Client-side event that occurs when an appointment is resized. + */ + AppointmentResize: ASPxClientEvent>; + /** + * Client-side event that fires before an appointment is deleted. + */ + AppointmentDeleting: ASPxClientEvent>; + /** + * Client-side scripting method that gets the active View. + */ + GetActiveViewType(): ASPxSchedulerViewType; + /** + * Client-side scripting method to change the ASPxScheduler's active View. + * @param value A ASPxSchedulerViewType enumeration value, representing a view type to set. + */ + SetActiveViewType(value: ASPxSchedulerViewType): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument + * @param parameter A string value that represents any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(parameter: string): void; + /** + * Client-side scripting method which initiates a round trip to the server so that the current page will be reloaded. + */ + Refresh(): void; + /** + * Client-side scripting method which initiates a round trip to the server, so that the control will be reloaded using the specified refresh action. + * @param refreshAction An ASPxClientSchedulerRefreshAction enumeration value, specifying the refresh action. + */ + Refresh(refreshAction: ASPxClientSchedulerRefreshAction): void; + /** + * Client-side function that returns the type of grouping applied to the appointments displayed in the scheduler. + */ + GetGroupType(): ASPxSchedulerGroupType; + /** + * Client-side scripting method which raises the callback command to set the GroupType. + * @param value An ASPxSchedulerGroupType enumeration value, which specifies how appointments are grouped. + */ + SetGroupType(value: ASPxSchedulerGroupType): void; + /** + * Client-side method that navigates the scheduler to the current system date. + */ + GotoToday(): void; + /** + * Client-side scripting method which raises the GotoDate callback command. + * @param date A DateTime value specifying the destination time. + */ + GotoDate(date: Date): void; + /** + * Client-side function which slides the visible interval one time span back. + */ + NavigateBackward(): void; + /** + * Client-side function which slides the visible interval one time span forward. + */ + NavigateForward(): void; + /** + * Client-side method which raises the callback command to change the ClientTimeZoneId of the scheduler. + * @param timeZoneId A string, a time zone identifier which is valid for the System.TimeZoneInfo.Id property. + */ + ChangeTimeZoneId(timeZoneId: string): void; + /** + * Displays a Selection ToolTip on a position given by the specified coordinates. + * @param x An integer representing the X-coordinate. + * @param y An integer representing the Y-coordinate. + */ + ShowSelectionToolTip(x: number, y: number): void; + /** + * Client-side function that returns the time interval, selected in the scheduler. + */ + GetSelectedInterval(): ASPxClientTimeInterval; + /** + * Client-side function that returns the ResourceId of selected time cell's resource. + */ + GetSelectedResource(): string; + /** + * Client-side function that returns an appointment with the specified ID. + * @param id An appointment's identifier. + */ + GetAppointmentById(id: Object): ASPxClientAppointment; + /** + * Client-side function that returns the id's of selected appointments. + */ + GetSelectedAppointmentIds(): string[]; + /** + * Client-side function that removes the appointment specified by its client ID from a collection of selected appointments. + * @param aptId An appointment's identifier. + */ + DeselectAppointmentById(aptId: Object): void; + /** + * Client-side function that selects an appointment with the specified ID. + * @param aptId An appointment's identifier. + */ + SelectAppointmentById(aptId: Object): void; + /** + * Enables obtaining appointment property values in a client-side script. Executes the callback command with the AppointmentData identifier. + * @param aptId An integer, representing the appointment ID. + * @param propertyNames An array of strings, representing the appointment properties to query. + * @param onCallBack A handler of a function which will receive and process the properties' values. + */ + GetAppointmentProperties(aptId: number, propertyNames: string[], onCallBack: Object): string[]; + /** + * Initiates a callback to retrieve and apply the values for the specified list of properties to the specified appointment, and transfer control to the specified function. + * @param clientAppointment An ASPxClientAppointment object that is the client appointment for which the data is retrieved. + * @param propertyNames An array of strings, that are the names of appointment properties to query. + * @param onCallBack A handler of a function executed after a callback. + */ + RefreshClientAppointmentProperties(clientAppointment: ASPxClientAppointment, propertyNames: string[], onCallBack: Object): void; + /** + * Client-side function that invokes the editing form for the appointment specified by its client ID. + * @param aptClientId A string, representing the appointment client identifier. + */ + ShowAppointmentFormByClientId(aptClientId: string): void; + /** + * Client-side function that invokes the editing form for the appointment specified by its storage identifier. + * @param aptServerId A string, representing the appointment identifier. + */ + ShowAppointmentFormByServerId(aptServerId: string): void; + /** + * Sets the time of the day corresponding to the start of the topmost displayed time cell row. + * @param duration An integer, representing the number of milliseconds passed since the start of the day. + * @param viewType An ASPxSchedulerViewType enumeration member, representing the scheduler's View. It can be either 'Day' or 'WorkWeek'. + */ + SetTopRowTime(duration: number, viewType: ASPxSchedulerViewType): void; + /** + * Sets the time of the day corresponding to the start of the topmost displayed time cell row. + * @param duration An integer, representing the number of milliseconds passed since the start of the day. + */ + SetTopRowTime(duration: number): void; + /** + * Gets the time of the day corresponding to the start of the topmost displayed time cell row. + * @param viewType An ASPxSchedulerViewType enumeration member, representing the scheduler's View. It can be either "Day" or "WorkWeek", otherwise the result is undefined. + */ + GetTopRowTime(viewType: ASPxSchedulerViewType): number; + /** + * Gets the time of day corresponding to the start of the topmost displayed time cell row. + */ + GetTopRowTime(): number; + /** + * Client-side scripting method which displays the Loading Panel. + */ + ShowLoadingPanel(): void; + /** + * Client-side scripting method which hides the Loading Panel from view. + */ + HideLoadingPanel(): void; + /** + * Client-side method that invokes the inplace editor form to create a new appointment. + * @param start A date object, representing the start of the new appointment. + * @param end A date object, representing the end of the new appointment. + */ + ShowInplaceEditor(start: Date, end: Date): void; + /** + * Client-side method that invokes the inplace editor form to create a new appointment. + * @param start A date object, representing the start of the new appointment. + * @param end A date object, representing the end of the new appointment. + * @param resourceId An object representing the identifier of a resource associated with the new appointment. + */ + ShowInplaceEditor(start: Date, end: Date, resourceId: string): void; + /** + * Client-side scripting method to insert the specified appointment. + * @param apt An ASPxClientAppointment object representing the client-side appointment. + */ + InsertAppointment(apt: ASPxClientAppointment): void; + /** + * Client-side scripting method to update the specified appointment. + * @param apt An ASPxClientAppointment object representing the client-side appointment. + */ + UpdateAppointment(apt: ASPxClientAppointment): void; + /** + * Client-side scripting method to delete the specified appointment. + * @param apt An ASPxClientAppointment object representing the client-side appointment. + */ + DeleteAppointment(apt: ASPxClientAppointment): void; + /** + * Client-side method that allows retrieving a collection of time intervals displayed by the ASPxScheduler. + */ + GetVisibleIntervals(): ASPxClientTimeInterval[]; + /** + * Changes the container that the ASPxScheduler tooltip belongs to. + * @param container An object that serves as the new container for the pop-up menu. + */ + ChangeToolTipContainer(container: Object): void; + /** + * Changes the container that the ASPxScheduler pop-up menu belongs to. + * @param container An object that serves as the new container for the pop-up menu. + */ + ChangePopupMenuContainer(container: Object): void; + /** + * Returns focus to the form if the ASPxScheduler control is not visible when the reminder fires. + * @param container A DIV object that is located in such a way that it is visible on the page in situations when the ASPxScheduler control is hidden. + */ + ChangeFormContainer(container: Object): void; + /** + * Client-side scripting method that saves appointment modifications and closes the form. + */ + AppointmentFormSave(): void; + /** + * Client-side scripting method that deletes the appointment being edited. + */ + AppointmentFormDelete(): void; + /** + * Client-side scripting method that cancels changes and closes the appointment editing form. + */ + AppointmentFormCancel(): void; + /** + * Client-side scripting method that navigates the scheduler to the date selected in the GotoDate form and closes the form. + */ + GoToDateFormApply(): void; + /** + * Client-side scripting method that cancels changes and closes the GotoDate form. + */ + GoToDateFormCancel(): void; + /** + * Client-side scripting method that cancels changes and closes the form. + */ + InplaceEditFormSave(): void; + /** + * Client-side scripting method that cancels changes and closes the form. + */ + InplaceEditFormCancel(): void; + /** + * Client-side scripting method that invokes the appointment editing form for the appointment being edited in the inplace editor. + */ + InplaceEditFormShowMore(): void; + /** + * Client-side scripting method that closes the Reminder form. + */ + ReminderFormCancel(): void; + /** + * Client-side scripting method that calls the Dismiss method for the selected reminder. + */ + ReminderFormDismiss(): void; + /** + * Client-side scripting method that dismisses all reminders shown in the Reminder form. + */ + ReminderFormDismissAll(): void; + /** + * Client-side scripting method that changes the alert time for the selected reminder to the specified interval. + */ + ReminderFormSnooze(): void; +} +/** + * Represents a client-side equivalent of the SchedulerViewType object. + */ +interface ASPxSchedulerViewType { + /** + * Gets a string representation equivalent of Day enumeration for use in client scripts. + * Value: A string "Day", indicating the DayView. + */ + Day: string; + /** + * Gets a string representation equivalent of WorkWeek enumeration for use in client scripts. + * Value: A string "WorkWeek", indicating the WorkWeekView. + */ + WorkWeek: string; + /** + * Gets a string representation equivalent of Week enumeration for use in client scripts. + * Value: A string "Week", indicating the WeekView. + */ + Week: string; + /** + * Gets a string representation equivalent of Month enumeration for use in client scripts. + * Value: A string "Month", indicating the MonthView. + */ + Month: string; + /** + * Gets a string representation equivalent of Timeline enumeration for use in client scripts. + * Value: A string "Timeline", indicating the TimelineView. + */ + Timeline: string; + /** + * Gets a string representation equivalent of FullWeek enumeration for use in client scripts. + * Value: A string "FullWeek", indicating the FullWeekView. + */ + FullWeek: string; +} +/** + * Represents a client-side equivalent of the SchedulerGroupType enumeration. + */ +interface ASPxSchedulerGroupType { + /** + * Gets a string representation equivalent of None enumeration for use in client scripts. + * Value: A "None" string value. + */ + None: string; + /** + * Gets a string representation equivalent of Date enumeration for use in client scripts. + * Value: A "Date" string value. + */ + Date: string; + /** + * Gets a string representation equivalent of Resource enumeration for use in client scripts. + * Value: A "Resource" string value. + */ + Resource: string; +} +/** + * Represents a client-side equivalent of the AppointmentType enumeration. + */ +interface ASPxAppointmentType { + /** + * Gets a string representation equivalent of Normal enumeration for use in client scripts. + * Value: A "Normal" string value. + */ + Normal: string; + /** + * Gets a string representation equivalent of Pattern enumeration for use in client scripts. + * Value: A "Pattern" string value. + */ + Pattern: string; + /** + * Gets a string representation equivalent of Occurrence enumeration for use in client scripts. + * Value: An "Occurrence" string value. + */ + Occurrence: string; + /** + * Gets a string representation equivalent of ChangedOccurrence enumeration for use in client scripts. + * Value: A "ChangedOccurrence" string value. + */ + ChangedOccurrence: string; + /** + * Gets a string representation equivalent of DeletedOccurrence enumeration for use in client scripts. + * Value: A "DeletedOccurrence" string value. + */ + DeletedOccurrence: string; +} +interface ASPxClientAppointmentDeletingEventHandler { + /** + * A method that will handle the AppointmentDeleting event. + * @param source The event sender (typically an ASPxClientScheduler control). + * @param e A ASPxClientAppointmentDeletingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientAppointmentDeletingEventArgs): void; +} +/** + * Provides data for the AppointmentDeleting event. + */ +interface ASPxClientAppointmentDeletingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets client IDs of the appointments that are intended to be removed. + * Value: An array of client appointment identifiers, representing appointments passed for deletion. + */ + appointmentIds: Object[]; +} +interface AppointmentClickEventHandler { + /** + * A method that will handle the AppointmentClick event. + * @param source The event sender (typically an ASPxClientScheduler control). + * @param e A AppointmentClickEventArgs object that contains event data. + */ + (source: S, e: AppointmentClickEventArgs): void; +} +/** + * Provides data for the AppointmentDoubleClick events. + */ +interface AppointmentClickEventArgs extends ASPxClientEventArgs { + /** + * Gets the client appointment ID for the appointment being clicked. + * Value: A string, representing the client ID of the appointment. + */ + appointmentId: string; + /** + * Gets the HTML element that the event was triggered on. + * Value: An object containing event data. + */ + htmlElement: Object; + /** + * Gets or sets whether an event is handled, and that default actions are not required. + * Value: true if no default processing is required; otherwise, false. + */ + handled: boolean; +} +/** + * A method that will handle the AppointmentsSelectionChanged event. + */ +interface AppointmentsSelectionEventHandler { + /** + * A method that will handle the AppointmentsSelectionChanged event. + * @param source The ASPxScheduler control which fires the event. + * @param e A AppointmentsSelectionEventArgs object that contains event data. + */ + (source: S, e: AppointmentsSelectionEventArgs): void; +} +/** + * Provides data for the AppointmentsSelectionChanged event. + */ +interface AppointmentsSelectionEventArgs extends ASPxClientEventArgs { + /** + * Gets identifiers of the selected appointments. + * Value: A comma separated list of string values, representing appointment IDs. + */ + appointmentIds: string[]; +} +/** + * A method that will handle the ActiveViewChanging event. + */ +interface ActiveViewChangingEventHandler { + /** + * A method that will handle the ActiveViewChanging event. + * @param source The ASPxClientScheduler control which fires the event. + * @param e An ActiveViewChangingEventArgs object that contains event data + */ + (source: S, e: ActiveViewChangingEventArgs): void; +} +/** + * Provides data for the client-side ActiveViewChanging event. + */ +interface ActiveViewChangingEventArgs extends ASPxClientEventArgs { + /** + * Gets the value of the ActiveView property before modification. + * Value: A SchedulerViewType enumeration. + */ + oldView: ASPxSchedulerViewType; + /** + * Gets the new value of the ActiveView property. + * Value: A string, which is the SchedulerViewType enumeration value. + */ + newView: ASPxSchedulerViewType; + /** + * Gets or sets whether the change of active view should be canceled. + * Value: true to cancel the operation; otherwise, false. + */ + cancel: boolean; +} +/** + * A method that will handle the MoreButtonClicked event. + */ +interface MoreButtonClickedEventHandler { + /** + * A method that will handle MoreButtonClicked event. + * @param source The ASPxClientScheduler control which fires the event. + * @param e A MoreButtonClickedEventArgs object that contains event data. + */ + (source: S, e: MoreButtonClickedEventArgs): void; +} +/** + * Provides data for the MoreButtonClicked client-side event. + */ +interface MoreButtonClickedEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the Start or End values of the target appointment. + * Value: A DateTime value representing the target appointment's boundary. + */ + targetDateTime: Date; + /** + * Gets the time interval of the cell where the button is located. + * Value: An ASPxClientTimeInterval object representing the time interval of the cell which holds the button. + */ + interval: ASPxClientTimeInterval; + /** + * Gets the resource identifier associated with the cell where the button is located. + * Value: A string, corresponding to ResourceId. + */ + resource: string; + /** + * Gets or sets whether an event is handled. If it is handled, default actions are not required. + * Value: true if no default processing is required; otherwise, false. + */ + handled: boolean; +} +/** + * A method that will handle the MenuItemClicked event. + */ +interface MenuItemClickedEventHandler { + /** + * A method that will handle the MenuItemClicked event. + * @param source The ASPxClientScheduler control which fires the event. + * @param e A MenuItemClickedEventArgs object that contains event data. + */ + (source: S, e: MenuItemClickedEventArgs): void; +} +/** + * Provides data for the MenuItemClicked event. + */ +interface MenuItemClickedEventArgs extends ASPxClientEventArgs { + /** + * Gets the name of the menu item which is clicked. + * Value: A string, containing the menu item name. + */ + itemName: string; + /** + * Gets or sets whether an event is handled, and that default actions are not required. + * Value: true if no default processing is required; otherwise, false. + */ + handled: boolean; +} +interface AppointmentDropEventHandler { + /** + * A method that will handle the AppointmentDrop event. + * @param source The event sender (typically an ASPxClientScheduler control). + * @param e A ASPxClientAppointmentDragEventArgs object that contains event data. + */ + (source: S, e: ASPxClientAppointmentDragEventArgs): void; +} +/** + * Provides data for the AppointmentDrop event. + */ +interface ASPxClientAppointmentDragEventArgs extends ASPxClientEventArgs { + /** + * Gets or sets whether default event processing is required. + * Value: true to process an event using only custom code; otherwise, false. + */ + handled: boolean; + /** + * Provides access to an object that enables you to choose an operation to perform. + * Value: An ASPxClientAppointmentOperation object providing methods to perform the required operation. + */ + operation: ASPxClientAppointmentOperation; +} +interface AppointmentResizeEventHandler { + /** + * A method that will handle the AppointmentResize event. + * @param source The event sender (typically an ASPxClientScheduler control). + * @param e A ASPxClientAppointmentResizeEventArgs object that contains event data. + */ + (source: S, e: ASPxClientAppointmentResizeEventArgs): void; +} +/** + * Provides data for the AppointmentResize event. + */ +interface ASPxClientAppointmentResizeEventArgs extends ASPxClientEventArgs { + /** + * Gets or sets whether default event processing is required. + * Value: true to process an event using only custom code; otherwise, false. + */ + handled: boolean; + /** + * Provides access to an object that enables you to choose an operation to perform. + * Value: An ASPxClientAppointmentOperation object providing methods to perform the required operation. + */ + operation: ASPxClientAppointmentOperation; +} +/** + * Contains information about a client tooltip. + */ +interface ASPxClientSchedulerToolTipData { + /** + * Returns the client appointment for which the tooltip is displayed. + */ + GetAppointment(): ASPxClientAppointment; + /** + * Returns the client time interval for which the tooltip is displayed. + */ + GetInterval(): ASPxClientTimeInterval; + /** + * Returns the resources associated with the appointment for which the tooltip is displayed. + */ + GetResources(): Object[]; +} +/** + * A client-side equivalent of the ASPxSchedulerToolTipBase control. + */ +interface ASPxClientToolTipBase { + /** + * Returns the value that indicates whether or not the tooltip can be displayed. + */ + CanShowToolTip(): boolean; + /** + * Ends updating the tooltip content. + * @param toolTipData An ASPxClientSchedulerToolTipData object providing data required to update the tooltip content. + */ + FinalizeUpdate(toolTipData: ASPxClientSchedulerToolTipData): void; + /** + * Updates the tooltip content. + * @param toolTipData An ASPxClientSchedulerToolTipData object providing data required to update the tooltip content. + */ + Update(toolTipData: ASPxClientSchedulerToolTipData): void; + /** + * Closes the tooltip. + */ + Close(): void; + /** + * + * @param bounds + */ + CalculatePosition(bounds: Object): ASPxClientPoint; + /** + * Displays the Appointment Menu in the position of the tooltip. + * @param eventObject An object containing information about the event on which the menu is displayed. + */ + ShowAppointmentMenu(eventObject: Object): void; + /** + * Displays the View Menu in the position of the tooltip. + * @param eventObject An object containing information about the event on which the menu is displayed. + */ + ShowViewMenu(eventObject: Object): void; + /** + * Returns the string representation of the specified interval. + * @param interval An ASPxClientTimeInterval object to convert. + */ + ConvertIntervalToString(interval: ASPxClientTimeInterval): string; +} +/** + * Represents the client-side equivalent of the ASPxSpellChecker class. + */ +interface ASPxClientSpellChecker extends ASPxClientControl { + /** + * Client-side event that occurs before the spell check starts. + */ + BeforeCheck: ASPxClientEvent>; + /** + * Client-side event that occurs before a message box informing about process completion is shown. + */ + CheckCompleteFormShowing: ASPxClientEvent>; + /** + * Client-side event that occurs when a spell check is finished. + */ + AfterCheck: ASPxClientEvent>; + /** + * Occurs after a word is changed in a checked text. + */ + WordChanged: ASPxClientEvent>; + /** + * Starts the spelling check of the text contained within the element specified by the CheckedElementID value. + */ + Check(): void; + /** + * Starts checking contents of the specified element. + * @param element An object representing the element being checked. + */ + CheckElement(element: Object): void; + /** + * Starts checking contents of the specified element. + * @param id A string representing the identifier of the element being checked. + */ + CheckElementById(id: string): void; + /** + * Starts checking the contents of controls in the specified container. + * @param containerElement An object representing a control which contains elements being checked. + */ + CheckElementsInContainer(containerElement: Object): void; + /** + * Starts checking the contents of controls in the specified container. + * @param containerId A string, specifying the control's identifier. + */ + CheckElementsInContainerById(containerId: string): void; +} +/** + * Represents an object that will handle the client-side BeforeCheck event. + */ +interface ASPxClientBeforeCheckEventHandler { + /** + * A method that will handle the BeforeCheck event. + * @param source The ASPxClientSpellChecker control which fires the event. + * @param e A ASPxClientSpellCheckerBeforeCheckEventArgs object that contains event data + */ + (source: S, e: ASPxClientSpellCheckerBeforeCheckEventArgs): void; +} +/** + * Provides data for an event that occurs before a spelling check is started. Represents the client-side equivalent of the BeforeCheckEventArgs class. + */ +interface ASPxClientSpellCheckerBeforeCheckEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the programmatic identifier assigned to the control which is going to be checked. + * Value: A string, containing the control's identifier. + */ + controlId: string; +} +/** + * Represents an object that will handle the client-side AfterCheck event. + */ +interface ASPxClientAfterCheckEventHandler { + /** + * A method that will handle the AfterCheck event. + * @param source The ASPxClientSpellChecker control which fires the event. + * @param e A ASPxClientSpellCheckerAfterCheckEventArgs object that contains event data + */ + (source: S, e: ASPxClientSpellCheckerAfterCheckEventArgs): void; +} +/** + * Provides data for the client event that occurs after a spelling check is complete. + */ +interface ASPxClientSpellCheckerAfterCheckEventArgs extends ASPxClientEventArgs { + /** + * Gets the programmatic identifier assigned to the control which has been checked. + * Value: A string, containing the control's identifier. + */ + controlId: string; + /** + * Gets the text that has been checked. + * Value: A string, containing checked text. + */ + checkedText: string; +} +/** + * Represents an object that will handle the client-side WordChanged event. + */ +interface ASPxClientWordChangedEventHandler { + /** + * A method that will handle the AfterCheck event. + * @param source The event source. + * @param e An ASPxClientSpellCheckerAfterCheckEventArgs object which contains event data. + */ + (source: S, e: ASPxClientSpellCheckerAfterCheckEventArgs): void; +} +/** + * A method that will handle the CustomCommandExecuted event. + */ +interface ASPxClientSpreadsheetCustomCommandExecutedEventHandler { + /** + * A method that will handle the CustomCommandExecuted event. + * @param source An object representing the event source. Identifies the Spreadsheet that raised the event. + * @param e A ASPxClientSpreadsheetCustomCommandExecutedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientSpreadsheetCustomCommandExecutedEventArgs): void; +} +/** + * Provides data for the CustomCommandExecuted event. + */ +interface ASPxClientSpreadsheetCustomCommandExecutedEventArgs extends ASPxClientEventArgs { + /** + * Gets the name of the processed command. + * Value: A string value representing the processed command's name. + */ + commandName: string; + /** + * Gets an optional parameter that complements the processed command. + * Value: A string value containing additional information about the processed command. + */ + parameter: string; + item: ASPxClientRibbonItem; +} +/** + * A method that will handle the DocumentChanged event. + */ +interface ASPxClientSpreadsheetDocumentChangedEventHandler { + /** + * A method that will handle the DocumentChanged event. + * @param source An object representing the event source. Identifies the Spreadsheet that raised the event. + * @param e A ASPxClientSpreadsheetDocumentChangedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientSpreadsheetDocumentChangedEventArgs): void; +} +/** + * Provides data for the DocumentChanged event. + */ +interface ASPxClientSpreadsheetDocumentChangedEventArgs extends ASPxClientEventArgs { +} +/** + * A method that will handle the EndSynchronization events. + */ +interface ASPxClientSpreadsheetSynchronizationEventHandler { + /** + * A method that will handle the EndSynchronization events. + * @param source An object representing the event source. Identifies the Spreadsheet that raised the event. + * @param e A ASPxClientSpreadsheetSynchronizationEventArgs object that contains event data. + */ + (source: S, e: ASPxClientSpreadsheetSynchronizationEventArgs): void; +} +/** + * Provides data for the EndSynchronization events. + */ +interface ASPxClientSpreadsheetSynchronizationEventArgs extends ASPxClientEventArgs { +} +/** + * A method that will handle the HyperlinkClick event. + */ +interface ASPxClientSpreadsheetHyperlinkClickEventHandler { + /** + * A method that will handle the HyperlinkClick event. + * @param source An object representing the event source. Identifies the Spreadsheet that raised the event. + * @param e An ASPxClientSpreadsheetHyperlinkClickEventArgs object that contains event data. + */ + (source: S, e: ASPxClientSpreadsheetHyperlinkClickEventArgs): void; +} +/** + * Provides data for the HyperlinkClick event. + */ +interface ASPxClientSpreadsheetHyperlinkClickEventArgs extends ASPxClientEventArgs { + /** + * Gets or sets a value that specifies whether the event is handled, and the default processing is not required. + * Value: true, if if the event is completely handled by custom code and no default processing is required; otherwise, false. + */ + handled: boolean; + /** + * Gets a DHTML event object that relates to the processed event. + * Value: An object that maintains DHTML event-specific information. + */ + htmlEvent: Object; + /** + * Gets a value identifying the clicked hyperlink type. + * Value: One of the values. + */ + hyperlinkType: ASPxClientOfficeDocumentLinkType; + /** + * Gets the clicked link's URI. + * Value: A sting value specifying the link's URI. + */ + targetUri: string; +} +/** + * A client-side equivalent of the ASPxSpreadsheet object. + */ +interface ASPxClientSpreadsheet extends ASPxClientControl { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientSpreadsheet. + */ + CallbackError: ASPxClientEvent>; + /** + * Occurs on the client when a selection is changed in the ASPxSpreadsheet. + */ + SelectionChanged: ASPxClientEvent>; + /** + * Occurs after a custom command has been executed on the client side. + */ + CustomCommandExecuted: ASPxClientEvent>; + /** + * Fires if any change is made to the Spreadsheet's document on the client. + */ + DocumentChanged: ASPxClientEvent>; + /** + * Fires after a client change has been made to the document and the client-server synchronization starts to apply the change on the server. + */ + BeginSynchronization: ASPxClientEvent>; + /** + * Fires after a document change has been applied to the server and server and client document models have been synchronized. + */ + EndSynchronization: ASPxClientEvent>; + /** + * Occurs on the client side after a hyperlink is clicked within the Spreadsheet's document. + */ + HyperlinkClick: ASPxClientEvent>; + /** + * Sets input focus to the Spreadsheet. + */ + Focus(): void; + /** + * Gets access to the client ribbon object. + */ + GetRibbon(): ASPxClientRibbon; + /** + * Enables you to switch the full-screen mode of the Spreadsheet. + * @param fullscreen true to activate full-screen mode; false to deactivate full-screen mode. + */ + SetFullscreenMode(fullscreen: boolean): void; + /** + * Returns the current selection made in a Spreadsheet. + */ + GetSelection(): ASPxClientSpreadsheetSelection; + /** + * Indicates whether any unsaved changes are contained in the current document. + */ + HasUnsavedChanges(): boolean; + /** + * Gets the value of the specified cell. + * @param colModelIndex An integer value specifying the cell's column index. + * @param rowModelIndex An integer value specifying the cell's row index. + */ + GetCellValue(colModelIndex: number, rowModelIndex: number): Object; + /** + * Gets the value of the currently active cell. + */ + GetActiveCellValue(): Object; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side event. + */ + PerformCallback(parameter: string): void; + /** + * + * @param parameter + * @param onSuccess + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side DocumentCallback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side DocumentCallback event. + */ + PerformDocumentCallback(parameter: string): void; + /** + * Reconnects the Spreadsheet to an external ribbon. + */ + ReconnectToExternalRibbon(): void; +} +/** + * A method that will handle the client SelectionChanged event. + */ +interface ASPxClientSpreadsheetSelectionChangedEventHandler { + /** + * A method that will handle the SelectionChanged event. + * @param source An object representing the event source. Identifies the button editor that raised the event. + * @param e An ASPxClientSpreadsheetSelectionChangedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientSpreadsheetSelectionChangedEventArgs): void; +} +/** + * Provides data for the SelectionChanged event. + */ +interface ASPxClientSpreadsheetSelectionChangedEventArgs extends ASPxClientEventArgs { + /** + * Gets an object that determines the currently selected region within the Spreadsheet. + * Value: A object defining the current selection. + */ + selection: ASPxClientSpreadsheetSelection; +} +/** + * Represents the selection in the Spreadsheet. + */ +interface ASPxClientSpreadsheetSelection { + /** + * Gets the column index of the active cell. + * Value: An integer value specifying the active cell column index. + */ + activeCellColumnIndex: number; + /** + * Gets the row index of the active cell. + * Value: An integer value specifying the active cell row index. + */ + activeCellRowIndex: number; + /** + * Gets the index of the selection's left column. + * Value: An integer value specifying the index of the left column within the selection. + */ + leftColumnIndex: number; + /** + * Gets the index of the selection's top row. + * Value: An integer value specifying the index of the top row within the selection. + */ + topRowIndex: number; + /** + * Gets the index of the selection's right column. + * Value: An integer value specifying the index of the right column within the selection. + */ + rightColumnIndex: number; + /** + * Gets the index of the selection's bottom row. + * Value: An integer value specifying the index of the bottom row within the selection. + */ + bottomRowIndex: number; +} +/** + * Represents the client ASPxTreeList. + */ +interface ASPxClientTreeList extends ASPxClientControl { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any unhandled server error occurs during server-side processing of a callback sent by the ASPxClientTreeList. + */ + CallbackError: ASPxClientEvent>; + /** + * Enables you to display a context menu. + */ + ContextMenu: ASPxClientEvent>; + /** + * Occurs when a custom command button has been clicked. + */ + CustomButtonClick: ASPxClientEvent>; + /** + * Fires before the focused node has been changed. + */ + NodeFocusing: ASPxClientEvent>; + /** + * Fires in response to changing node focus. + */ + FocusedNodeChanged: ASPxClientEvent>; + /** + * Fires after the selection has been changed via end-user interaction. + */ + SelectionChanged: ASPxClientEvent>; + /** + * Fires after the Customization Window has been closed. + */ + CustomizationWindowCloseUp: ASPxClientEvent>; + /** + * Fires after the callback has been processed in the CustomDataCallback event handler. + */ + CustomDataCallback: ASPxClientEvent>; + /** + * Fires on the client when a node is clicked. + */ + NodeClick: ASPxClientEvent>; + /** + * Fires on the client when a node is double clicked. + */ + NodeDblClick: ASPxClientEvent>; + /** + * Fires before a node is expanded. + */ + NodeExpanding: ASPxClientEvent>; + /** + * Fires before a node is collapsed. + */ + NodeCollapsing: ASPxClientEvent>; + /** + * Occurs before a node is dragged by an end-user. + */ + StartDragNode: ASPxClientEvent>; + /** + * Occurs after a node drag and drop operation is completed. + */ + EndDragNode: ASPxClientEvent>; + /** + * Enables you to prevent columns from being resized. + */ + ColumnResizing: ASPxClientEvent>; + /** + * Occurs after a column's width has been changed by an end-user. + */ + ColumnResized: ASPxClientEvent>; + /** + * Sets input focus to the ASPxTreeList. + */ + Focus(): void; + GetPopupEditForm(): ASPxClientPopupControl; + /** + * Returns the focused node's key value. + */ + GetFocusedNodeKey(): string; + /** + * Moves focus to the specified node. + * @param key A String value that uniquely identifies the node. + */ + SetFocusedNodeKey(key: string): void; + /** + * Indicates whether the specified node is selected. + * @param nodeKey A String value that identifies the node by its key value. + */ + IsNodeSelected(nodeKey: string): any; + /** + * Selects the specified node. + * @param nodeKey A string value that identifies the node. + */ + SelectNode(nodeKey: string): void; + /** + * Selects or deselects the specified node. + * @param nodeKey A string value that identifies the node. + * @param state true to select the node; otherwise, false. + */ + SelectNode(nodeKey: string, state: boolean): void; + /** + * Obtains key values of selected nodes that are displayed within the current page. + */ + GetVisibleSelectedNodeKeys(): string[]; + /** + * Indicates whether the Customization Window is displayed. + */ + IsCustomizationWindowVisible(): boolean; + /** + * Invokes the Customization Window. + */ + ShowCustomizationWindow(): void; + /** + * Invokes the Customization Window and displays it over the specified HTML element. + * @param htmlElement An object that specifies the HTML element relative to whose position the customization window is invoked. + */ + ShowCustomizationWindow(htmlElement: Object): void; + /** + * Closes the Customization Window. + */ + HideCustomizationWindow(): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param arg A string value that represents any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCustomCallback(arg: string): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param args A string value that represents any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(args: string): void; + /** + * + * @param args + * @param onSuccess + */ + PerformCallback(args: string, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side CustomDataCallback event passing it the specified argument. + * @param arg A string value that represents any information that needs to be sent to the server-side CustomDataCallback event. + */ + PerformCustomDataCallback(arg: string): void; + /** + * Obtains specified data source field values within a specified node, and submits them to the specified JavaScript function. + * @param nodeKey A string value that identifies the node. + * @param fieldNames A string value that contains the names of data source fields whose values within the specified node are returned. The field names should be separated by ';'. + * @param onCallback A ASPxClientTreeListValuesCallback object that represents the JavaScript function which receives the list of values as a parameter. + */ + GetNodeValues(nodeKey: string, fieldNames: string, onCallback: ASPxClientTreeListValuesCallback): void; + /** + * Obtains specified data source field values within a specified node, and submits them to the specified JavaScript function. + * @param nodeKey A string value that identifies the node. + * @param fieldNames The names of data source fields whose values within the specified node are returned. + * @param onCallback A ASPxClientTreeListValuesCallback object that represents the JavaScript function which receives the list of values as a parameter. + */ + GetNodeValues(nodeKey: string, fieldNames: string[], onCallback: ASPxClientTreeListValuesCallback): void; + /** + * Obtains specified data source field values within nodes that are displayed within the current page, and submits them to the specified JavaScript function. + * @param fieldNames A string value that contains the names of data source fields whose values within visible nodes are returned. The field names should be separated by ';'. + * @param onCallback A ASPxClientTreeListValuesCallback object that represents the JavaScript function which receives the list of values as a parameter. + */ + GetVisibleNodeValues(fieldNames: string, onCallback: ASPxClientTreeListValuesCallback): void; + /** + * Obtains specified data source field values within nodes that are displayed within the current page, and submits them to the specified JavaScript function. + * @param fieldNames The names of data source fields whose values within visible nodes are returned. + * @param onCallback A ASPxClientTreeListValuesCallback object that represents the JavaScript function which receives the list of values as a parameter. + */ + GetVisibleNodeValues(fieldNames: string[], onCallback: ASPxClientTreeListValuesCallback): void; + /** + * Obtains specified data source field values within selected nodes, and submits them to the specified JavaScript function. + * @param fieldNames A string value that contains the names of data source fields whose values within selected nodes are returned. The field names should be separated by ';'. + * @param onCallback A ASPxClientTreeListValuesCallback object that represents the JavaScript function which receives the list of values as a parameter. + */ + GetSelectedNodeValues(fieldNames: string, onCallback: ASPxClientTreeListValuesCallback): void; + /** + * Obtains specified data source field values within selected nodes, and submits them to the specified JavaScript function. + * @param fieldNames The names of data source fields whose values within selected nodes are returned. + * @param onCallback A ASPxClientTreeListValuesCallback object that represents the JavaScript function which receives the list of values as a parameter. + */ + GetSelectedNodeValues(fieldNames: string[], onCallback: ASPxClientTreeListValuesCallback): void; + /** + * Obtains specified data source field values within selected nodes, and submits them to the specified JavaScript function. + * @param fieldNames A string value that contains the names of data source fields whose values within selected nodes are returned. The field names should be separated by ';'. + * @param onCallback A ASPxClientTreeListValuesCallback object that represents the JavaScript function which receives the list of values as a parameter. + * @param visibleOnly true to return values within selected nodes that are displayed within the current page; false to return values within all selected nodes. + */ + GetSelectedNodeValues(fieldNames: string, onCallback: ASPxClientTreeListValuesCallback, visibleOnly: boolean): void; + /** + * Obtains specified data source field values within selected nodes, and submits them to the specified JavaScript function. + * @param fieldNames The names of data source fields whose values within selected nodes are returned. + * @param onCallback A ASPxClientTreeListValuesCallback object that represents the JavaScript function which receives the list of values as a parameter. + * @param visibleOnly true to return values within selected nodes that are displayed within the current page; false to return values within all selected nodes. + */ + GetSelectedNodeValues(fieldNames: string[], onCallback: ASPxClientTreeListValuesCallback, visibleOnly: boolean): void; + /** + * Selects the specified page. + * @param index An integer value that specifies the active page's index. + */ + GoToPage(index: number): void; + /** + * Activates the previous page. + */ + PrevPage(): void; + /** + * Activates the next page. + */ + NextPage(): void; + /** + * Gets the index of the page currently being selected. + */ + GetPageIndex(): number; + /** + * Gets the number of pages to which the ASPxTreeList's data is divided. + */ + GetPageCount(): number; + /** + * Returns the specified node's state. + * @param nodeKey A String value that identifies the node. + */ + GetNodeState(nodeKey: string): string; + /** + * Expands all nodes. + */ + ExpandAll(): void; + /** + * Collapses all Node. + */ + CollapseAll(): void; + /** + * Expands the specified node preserving the collapsed state of child nodes. + * @param key A String value that uniquely identifies the node. + */ + ExpandNode(key: string): void; + /** + * Collapses the specified node preserving the expanded state of child nodes. + * @param key A String value that uniquely identifies the node. + */ + CollapseNode(key: string): void; + /** + * Obtains key values of nodes that are displayed within the current page. + */ + GetVisibleNodeKeys(): string[]; + /** + * Returns an HTML table row that represents the specified node. + * @param nodeKey A string value that identifies the node. + */ + GetNodeHtmlElement(nodeKey: string): Object; + /** + * Returns the number of visible columns within the client ASPxTreeList. + */ + GetVisibleColumnCount(): number; + /** + * Returns the number of columns within the client ASPxTreeList. + */ + GetColumnCount(): number; + /** + * Returns the column located at the specified position within the Columns collection. + * @param index An integer value that identifies the column within the collection (the column's Index property value). + */ + GetColumnByIndex(index: number): ASPxClientTreeListColumn; + /** + * Returns the column with the specified name. + * @param name A string value that specifies the column's name (the column's Name property value). + */ + GetColumnByName(name: string): ASPxClientTreeListColumn; + /** + * Returns the client column which is bound to the specified data source field. + * @param fieldName A string value that specifies the name of the data source field to which the column is bound (the column's FieldName property value). + */ + GetColumnByFieldName(fieldName: string): ASPxClientTreeListColumn; + /** + * Sorts data by the specified data column's values. + * @param columnIndex An integer value that specifies the column's position within the column collection. + */ + SortBy(columnIndex: number): void; + /** + * Sorts data by the specified data column's values. + * @param columnIndex An integer value that specifies the column's position within the column collection. + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DESC' or 'NONE'). + */ + SortBy(columnIndex: number, sortOrder: string): void; + /** + * Sorts data by the specified data column's values. + * @param columnIndex An integer value that specifies the column's position within the column collection. + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DESC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + */ + SortBy(columnIndex: number, sortOrder: string, reset: boolean): void; + /** + * Sorts data by the specified data column's values. + * @param nameOrFieldName A String value that specifies the column's name or field name. + */ + SortBy(nameOrFieldName: string): void; + /** + * Sorts data by the specified data column's values. + * @param nameOrFieldName A String value that specifies the column's name or field name. + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DESC' or 'NONE'). + */ + SortBy(nameOrFieldName: string, sortOrder: string): void; + /** + * Sorts data by the specified data column's values. + * @param nameOrFieldName A String value that specifies the column's name or field name. + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DESC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + */ + SortBy(nameOrFieldName: string, sortOrder: string, reset: boolean): void; + /** + * Sorts data by the specified data column's values. + * @param column An ASPxClientTreeListColumn object that represents the data column. + */ + SortBy(column: ASPxClientTreeListColumn): void; + /** + * Sorts data by the specified data column's values. + * @param column An ASPxClientTreeListColumn object that represents the data column. + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DESC' or 'NONE'). + */ + SortBy(column: ASPxClientTreeListColumn, sortOrder: string): void; + /** + * Sorts data by the specified data column's values. + * @param column An ASPxClientTreeListColumn object that represents the data column. + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DESC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + */ + SortBy(column: ASPxClientTreeListColumn, sortOrder: string, reset: boolean): void; + /** + * Switches the ASPxTreeList to edit mode. + * @param nodeKey A string value that identifies the node by its key value. + */ + StartEdit(nodeKey: string): void; + /** + * Saves all the changes made and switches the ASPxTreeList to browse mode. + */ + UpdateEdit(): void; + /** + * Cancels all the changes made and switches the ASPxTreeList to browse mode. + */ + CancelEdit(): void; + /** + * Indicates whether the ASPxTreeList is in edit mode. + */ + IsEditing(): boolean; + /** + * Gets the key value of the node currently being edited. + */ + GetEditingNodeKey(): string; + /** + * Moves the specified node to a new position. + * @param nodeKey A string value that identifies the target node by its key value. + * @param parentNodeKey A string value that identifies the node to whose child collection the target node is moved. An empty string to display the target node within the root. + */ + MoveNode(nodeKey: string, parentNodeKey: string): void; + /** + * Deletes the specified node. + * @param nodeKey A string value that identifies the node. + */ + DeleteNode(nodeKey: string): void; + /** + * Switches the ASPxTreeList to edit mode and allows new root node values to be edited. + */ + StartEditNewNode(): void; + /** + * Switches the ASPxTreeList to edit mode and allows new node values to be edited. + * @param parentNodeKey A String value that identifies the parent node, which owns a new node. + */ + StartEditNewNode(parentNodeKey: string): void; + /** + * Returns the editor used to edit the specified column's values. + * @param column An ASPxClientTreeListColumn object that represents the data column within the client ASPxTreeList. + */ + GetEditor(column: ASPxClientTreeListColumn): Object; + /** + * Returns the editor used to edit the specified column's values. + * @param columnIndex An integer value that identifies the column by its position within the column collection. + */ + GetEditor(columnIndex: number): Object; + /** + * Returns the editor used to edit the specified column's values. + * @param columnNameOrFieldName A String value that identifies the column by its name or field name. + */ + GetEditor(columnNameOrFieldName: string): Object; + /** + * Returns the value of the specified edit cell. + * @param column An ASPxClientTreeListColumn object that represents the data column within the client ASPxTreeList. + */ + GetEditValue(column: ASPxClientTreeListColumn): Object; + /** + * Returns the value of the specified edit cell. + * @param columnIndex An integer value that identifies the data column by its index within the ASPxTreeList's column collection. + */ + GetEditValue(columnIndex: number): Object; + /** + * Returns the value of the specified edit cell. + * @param columnNameOrFieldName A String value that identifies the column by its name or field name. + */ + GetEditValue(columnNameOrFieldName: string): Object; + /** + * Sets the value of the specified edit cell. + * @param column An ASPxClientTreeListColumn object that represents the data column within the client ASPxTreeList. + * @param value An object that specifies the edit cell's new value. + */ + SetEditValue(column: ASPxClientTreeListColumn, value: Object): void; + /** + * Sets the value of the specified edit cell. + * @param columnIndex An integer value that identifies the data column by its index within the ASPxTreeList's column collection. + * @param value An object that specifies the edit cell's new value. + */ + SetEditValue(columnIndex: number, value: Object): void; + /** + * Sets the value of the specified edit cell. + * @param columnNameOrFieldName A String value that identifies the column by its name or field name. + * @param value An object that specifies the edit cell's new value. + */ + SetEditValue(columnNameOrFieldName: string, value: Object): void; + /** + * Moves focus to the specified editor within the edited node. + * @param column A ASPxClientTreeListColumn object that represents the data column within the client ASPxTreeList. + */ + FocusEditor(column: ASPxClientTreeListColumn): void; + /** + * Moves focus to the specified editor within the edited node. + * @param columnIndex An integer value that identifies the data column. + */ + FocusEditor(columnIndex: number): void; + /** + * Moves focus to the specified editor within the edited node. + * @param columnNameOrFieldName A String value that specifies the column's name or field name. + */ + FocusEditor(columnNameOrFieldName: string): void; + /** + * Scrolls the tree list so that the specified node becomes visible. + * @param nodeKey An integer value that specifies the node index within the tree list's client item list. + */ + MakeNodeVisible(nodeKey: string): void; + /** + * Returns the current vertical scroll position of the tree list's content. + */ + GetVerticalScrollPosition(): number; + /** + * Returns the current horizontal scroll position of the tree list's content. + */ + GetHorizontalScrollPosition(): number; + /** + * Specifies the vertical scroll position for the tree list's content. + * @param position An integer value specifying the vertical scroll position. + */ + SetVerticalScrollPosition(position: number): void; + /** + * Specifies the horizontal scroll position for the tree list's content. + * @param position An integer value specifying the horizontal scroll position. + */ + SetHorizontalScrollPosition(position: number): void; +} +/** + * Represents a client column. + */ +interface ASPxClientTreeListColumn { + /** + * Gets the column's position within the collection. + * Value: An integer zero-bazed index that specifies the column's position within the collection. + */ + index: number; + /** + * Gets the name that uniquely identifies the column. + * Value: A string value assigned to the column's Name property. + */ + name: string; + /** + * Gets the name of the database field assigned to the current column. + * Value: A String value that specifies the name of a data field. + */ + fieldName: string; +} +/** + * Provides data for the CustomDataCallback event. + */ +interface ASPxClientTreeListCustomDataCallbackEventArgs extends ASPxClientEventArgs { + /** + * Gets the information that has been collected on the client-side and sent to the server-side CustomDataCallback event. + * Value: A string value that represents the information that has been collected on the client-side and sent to the server-side CustomDataCallback event. + */ + arg: string; + /** + * Gets the information passed from the server-side CustomDataCallback event. + * Value: An object that represents the information passed from the server-side CustomDataCallback event. + */ + result: Object; +} +/** + * A method that will handle the CustomDataCallback event. + */ +interface ASPxClientTreeListCustomDataCallbackEventHandler { + /** + * A method that will handle the CustomDataCallback event. + * @param source The event source. + * @param e An ASPxClientTreeListCustomDataCallbackEventArgs object that contains event data. + */ + (source: S, e: ASPxClientTreeListCustomDataCallbackEventArgs): void; +} +/** + * Provides data for the NodeDblClick events. + */ +interface ASPxClientTreeListNodeEventArgs extends ASPxClientEventArgs { + /** + * Gets the processed node's key value. + * Value: A String value that identifies the processed node. + */ + nodeKey: string; + /** + * Provides access to the parameters associated with the NodeDblClick events. + * Value: An object that contains parameters associated with the event. + */ + htmlEvent: Object; + /** + * Gets or sets a value indicating whether the action which raised the event should be canceled. + * Value: true if the action that raised the event should be canceled; otherwise, false. + */ + cancel: boolean; +} +/** + * A method that will handle the NodeDblClick event. + */ +interface ASPxClientTreeListNodeEventHandler { + /** + * A method that will handle the NodeDblClick event. + * @param source The event source. + * @param e An ASPxClientTreeListNodeEventArgs object that contains event data. + */ + (source: S, e: ASPxClientTreeListNodeEventArgs): void; +} +/** + * Provides data for the ContextMenu event. + */ +interface ASPxClientTreeListContextMenuEventArgs extends ASPxClientEventArgs { + /** + * Identifies which tree list element has been right-clicked. + * Value: A string value that identifies which tree list element ('Header' or 'Node') has been right-clicked. + */ + objectType: string; + /** + * Gets a value that identifies the right-clicked object. + * Value: The right-clicked object's identifier. + */ + objectKey: Object; + /** + * Gets a DHTML event object that relates to the processed event. + * Value: An object that relates to the processed event. + */ + htmlEvent: Object; + /** + * Gets or sets whether to invoke the browser's context menu. + * Value: true to hide the browser's context menu; otherwise, false. + */ + cancel: boolean; +} +/** + * A method that will handle the ContextMenu event. + */ +interface ASPxClientTreeListContextMenuEventHandler { + /** + * A method that will handle the ContextMenu event. + * @param source The event sender. + * @param e An ASPxClientTreeListContextMenuEventArgs object that contains event data. + */ + (source: S, e: ASPxClientTreeListContextMenuEventArgs): void; +} +/** + * Provides data for the StartDragNode event. + */ +interface ASPxClientTreeListStartDragNodeEventArgs extends ASPxClientTreeListNodeEventArgs { + /** + * Gets an array of targets where a node can be dragged. + * Value: An array of objects that represent targets for the dragged node. + */ + targets: Object[]; +} +/** + * A method that will handle the StartDragNode event. + */ +interface ASPxClientTreeListStartDragNodeEventHandler { + /** + * A method that will handle the StartDragNode event. + * @param source The event source. + * @param e An ASPxClientTreeListStartDragNodeEventArgs object that contains event data. + */ + (source: S, e: ASPxClientTreeListStartDragNodeEventArgs): void; +} +/** + * Provides data for the EndDragNode event. + */ +interface ASPxClientTreeListEndDragNodeEventArgs extends ASPxClientTreeListNodeEventArgs { + /** + * Gets the target element. + * Value: An object that represents the target element to which the dragged node has been dropped. + */ + targetElement: Object; +} +/** + * A method that will handle the EndDragNode event. + */ +interface ASPxClientTreeListEndDragNodeEventHandler { + /** + * A method that will handle the EndDragNode event. + * @param source The event source. + * @param e An ASPxClientTreeListEndDragNodeEventArgs object that contains event data. + */ + (source: S, e: ASPxClientTreeListEndDragNodeEventArgs): void; +} +/** + * Provides data for the CustomButtonClick event. + */ +interface ASPxClientTreeListCustomButtonEventArgs extends ASPxClientEventArgs { + /** + * Gets the key value of the node whose custom button has been clicked. + * Value: A string value that uniquely identifies the node whose custom button has been clicked. + */ + nodeKey: string; + /** + * Gets the button's index. + * Value: An integer value that specifies the button's position within the CustomButtons collection. + */ + buttonIndex: number; + /** + * Gets the value which identifies the custom button. + * Value: A String value that identifies the clicked custom button. + */ + buttonID: string; +} +/** + * A method that will handle the CustomButtonClick event. + */ +interface ASPxClientTreeListCustomButtonEventHandler { + /** + * A method that will handle the CustomButtonClick event. + * @param source The event source. + * @param e An ASPxClientTreeListCustomButtonEventArgs object that contains event data. + */ + (source: S, e: ASPxClientTreeListCustomButtonEventArgs): void; +} +/** + * Represents a JavaScript function which receives the list of row values when a specific client method (such as the GetSelectedNodeValues) is called. + */ +interface ASPxClientTreeListValuesCallback { + /** + * A JavaScript function which receives the list of row values when a specific client method (such as the GetSelectedNodeValues) is called. + * @param result An object that represents the list of row values received from the server. + */ + (result: Object): void; +} +/** + * Provides data for the ColumnResizing event. + */ +interface ASPxClientTreeListColumnResizingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the processed client column. + * Value: An object that is the processed column. + */ + column: ASPxClientTreeListColumn; +} +/** + * A method that will handle the client ColumnResizing event. + */ +interface ASPxClientTreeListColumnResizingEventHandler { + /** + * A method that will handle the ColumnResizing event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientTreeListColumnResizingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientTreeListColumnResizingEventArgs): void; +} +/** + * Provides data for the ColumnResized event. + */ +interface ASPxClientTreeListColumnResizedEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the processed client column. + * Value: An object that is the processed column. + */ + column: ASPxClientTreeListColumn; +} +/** + * A method that will handle the client ColumnResized event. + */ +interface ASPxClientTreeListColumnResizedEventHandler { + /** + * A method that will handle the ColumnResized event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientTreeListColumnResizedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientTreeListColumnResizedEventArgs): void; +} +/** + * A client-side counterpart of the Calendar and CalendarFor extensions. + */ +interface MVCxClientCalendar extends ASPxClientCalendar { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; +} +/** + * A client-side counterpart of the CallbackPanel extension. + */ +interface MVCxClientCallbackPanel extends ASPxClientCallbackPanel { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the Callback Panel by processing the passed information on the server, in an Action specified by the Callback Panel's CallbackRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified by the CallbackRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * + * @param data + * @param onSuccess + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side Callback event. + */ + PerformCallback(parameter: string): void; + /** + * + * @param parameter + * @param onSuccess + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; +} +/** + * A client-side counterpart of the CardView extension. + */ +interface MVCxClientCardView extends ASPxClientCardView { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the CardView by processing the passed information on the server, in an Action specified via the CardView's CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CardView's CustomActionRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * + * @param data + * @param onSuccess + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback with a parameter to process the passed information on the server, in an Action specified via the CardView's CustomDataActionRouteValues property, and then process the returned result in the specified client function. This method does not update the CardView. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CustomDataActionRouteValues property. + * @param onCallback A ASPxClientCardViewValuesCallback object that represents the JavaScript function which receives the information on the client side. + */ + GetValuesOnCustomCallback(data: Object, onCallback: ASPxClientCardViewValuesCallback): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param args A string value that represents any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(args: string): void; + /** + * Sends a callback to the server and generates the server-side CustomDataCallback event. + * @param args A string value that is any information that needs to be sent to the server-side CustomDataCallback event. + * @param onCallback An ASPxClientCardViewValuesCallback object that is the JavaScript function which receives the information on the client side. + */ + GetValuesOnCustomCallback(args: string, onCallback: ASPxClientCardViewValuesCallback): void; +} +/** + * A client-side counterpart of the Chart extension. + */ +interface MVCxClientChart extends ASPxClientWebChartControl { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update a Chart by processing the passed information on the server, in an Action specified via the Chart's CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CustomActionRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * + * @param data + * @param onSuccess + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side event, passing it the specified argument. + * @param args A string value that represents any information that needs to be sent to the server-side event. + */ + PerformCallback(args: string): void; + /** + * + * @param args + * @param onSuccess + */ + PerformCallback(args: string, onSuccess: (arg1: string) => void): void; +} +/** + * A client-side counterpart of the ComboBox and ComboBoxFor extensions. + */ +interface MVCxClientComboBox extends ASPxClientComboBox { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the ComboBox by processing the passed information on the server, in an Action specified by the ComboBox's CallbackRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified by the CallbackRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * + * @param data + * @param onSuccess + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side Callback event. + */ + PerformCallback(parameter: string): void; +} +/** + * A client-side counterpart of the DataView extension. + */ +interface MVCxClientDataView extends ASPxClientDataView { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the DataView by processing the passed information on the server, in an Action specified via the DataView's CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CustomActionRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * + * @param data + * @param onSuccess + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(parameter: string): void; + /** + * + * @param parameter + * @param onSuccess + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; +} +/** + * A client-side counterpart of the DateEdit extension. + */ +interface MVCxClientDateEdit extends ASPxClientDateEdit { +} +/** + * A client-side counterpart of the DockManager extension. + */ +interface MVCxClientDockManager extends ASPxClientDockManager { + /** + * Sends a callback with a parameter to update the DockManager by processing the passed information on the server, in an Action specified by the DockManager's CallbackRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified by the CallbackRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * + * @param data + * @param onSuccess + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that contains any information that needs to be sent to the server-side Callback event. + */ + PerformCallback(parameter: string): void; + /** + * + * @param parameter + * @param onSuccess + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; +} +/** + * A client-side counterpart of the DockPanel extension. + */ +interface MVCxClientDockPanel extends ASPxClientDockPanel { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the DockPanel by processing the passed information on the server, in an Action specified by the DockPanel's DockPanelSettings.CallbackRouteValues) property. + * @param data An object containing any information that needs to be passed to a handling Action specified by the CallbackRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * + * @param data + * @param onSuccess + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side WindowCallback event, passing the specified argument to it. + * @param parameter A string value that is any information that needs to be sent to the server-side WindowCallback event. + */ + PerformCallback(parameter: string): void; +} +/** + * A client-side counterpart of the FileManager extension. + */ +interface MVCxClientFileManager extends ASPxClientFileManager { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the FileManager by processing the passed information on the server, in an Action specified via the extension's CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the file manager's CustomActionRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * + * @param data + * @param onSuccess + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param args A string value that specifies any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(args: string): void; + /** + * + * @param args + * @param onSuccess + */ + PerformCallback(args: string, onSuccess: (arg1: string) => void): void; +} +/** + * A client-side counterpart of the GridView extension. + */ +interface MVCxClientGridView extends ASPxClientGridView { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the GridView by processing the passed information on the server, in an Action specified via the grid's CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the grid's CustomActionRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * + * @param data + * @param onSuccess + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback with a parameter to process the passed information on the server, in an Action specified via the GridView's CustomDataActionRouteValues property, and then process the returned result in the specified client function. This method does not update the GridView. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CustomDataActionRouteValues property. + * @param onCallback A ASPxClientGridViewValuesCallback object that represents the JavaScript function which receives the information on the client side. + */ + GetValuesOnCustomCallback(data: Object, onCallback: ASPxClientGridViewValuesCallback): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param args A string value that represents any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(args: string): void; + /** + * Sends a callback to the server and generates the server-side CustomDataCallback event. + * @param args A string value that is any information that needs to be sent to the server-side CustomDataCallback event. + * @param onCallback A ASPxClientGridViewValuesCallback object that is the JavaScript function which receives the information on the client side. + */ + GetValuesOnCustomCallback(args: string, onCallback: ASPxClientGridViewValuesCallback): void; +} +/** + * A client-side counterpart of the HtmlEditor extension. + */ +interface MVCxClientHtmlEditor extends ASPxClientHtmlEditor { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to process the passed information on the server, in an Action specified via the HtmlEditor's CustomDataCallback event on the client. This method does not update the HtmlEditor. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CustomDataActionRouteValues property. + */ + PerformDataCallback(data: Object): void; + /** + * Sends a callback with a parameter to process the passed information on the server, in an Action specified via the HtmlEditor's CustomDataCallback event on the client. This method does not update the HtmlEditor. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CustomDataActionRouteValues property. + * @param onCallback An ASPxClientDataCallback object that is the JavaScript function which receives the callback data as a parameter. + */ + PerformDataCallback(data: Object, onCallback: ASPxClientDataCallback): void; + /** + * Sends a callback to the server and generates the server-side CustomDataCallback event passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side CustomDataCallback event. + * @param onCallback A ASPxClientDataCallback object that represents the JavaScript function which receives the callback data as a parameter. + */ + PerformDataCallback(parameter: string, onCallback: ASPxClientDataCallback): void; +} +/** + * A client-side counterpart of the ImageGallery extension. + */ +interface MVCxClientImageGallery extends ASPxClientImageGallery { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the ImageGallery by processing the passed information on the server, in an Action specified via the ImageGallery's CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CustomActionRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * + * @param data + * @param onSuccess + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(parameter: string): void; + /** + * + * @param parameter + * @param onSuccess + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; +} +/** + * A client-side counterpart of the ListBox and ListBoxFor extensions. + */ +interface MVCxClientListBox extends ASPxClientListBox { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the ListBox by processing the passed information on the server, in an Action specified by the ListBox's CallbackRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified by the CallbackRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * + * @param data + * @param onSuccess + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server, and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side Callback event. + */ + PerformCallback(parameter: string): void; +} +/** + * A client-side counterpart of the NavBar extension. + */ +interface MVCxClientNavBar extends ASPxClientNavBar { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; +} +/** + * A client-side counterpart of the PivotGrid extension. + */ +interface MVCxClientPivotGrid extends ASPxClientPivotGrid { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the PivotGrid by processing the passed information on the server, in an Action specified via the grid's CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the grid's CustomActionRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * + * @param data + * @param onSuccess + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Passes PivotGrid callback parameters to the specified object. + * @param obj An object that receives PivotGrid callback parameters. + */ + FillStateObject(obj: Object): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param args A string value that represents any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(args: string): void; + /** + * + * @param args + * @param onSuccess + */ + PerformCallback(args: string, onSuccess: (arg1: string) => void): void; +} +/** + * A client-side counterpart of the PopupControl extension. + */ +interface MVCxClientPopupControl extends ASPxClientPopupControl { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the PopupControl by processing the passed information on the server, in an Action specified via the PopupControl's CallbackRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CallbackRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * + * @param data + * @param onSuccess + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback with a parameters to update the popup window by processing the related popup window and the passed information on the server, in an Action specified by the PopupControl's CallbackRouteValues property. + * @param window A ASPxClientPopupWindow object identifying the processed popup window. + * @param data An object containing any information that needs to be passed to a handling Action specified by the CallbackRouteValues property. + */ + PerformWindowCallback(window: ASPxClientPopupWindow, data: Object): void; + /** + * + * @param window + * @param parameter + */ + PerformWindowCallback(window: ASPxClientPopupWindow, parameter: string): void; + /** + * + * @param window + * @param parameter + * @param onSuccess + */ + PerformWindowCallback(window: ASPxClientPopupWindow, parameter: string, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side WindowCallback event, passing the specified argument to it. + * @param parameter A string value that is any information that needs to be sent to the server-side WindowCallback event. + */ + PerformCallback(parameter: string): void; +} +/** + * A client-side equivalent of the MVCxDocumentViewer class. + */ +interface MVCxClientDocumentViewer extends ASPxClientDocumentViewer { + /** + * Occurs before performing a document export request. + */ + BeforeExportRequest: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; +} +/** + * Obsolete. Use the MVCxClientDocumentViewer class instead. + */ +interface MVCxClientReportViewer extends ASPxClientReportViewer { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs before performing a document export request. + */ + BeforeExportRequest: ASPxClientEvent>; +} +/** + * A method that will handle the BeforeExportRequest event. + */ +interface MVCxClientBeforeExportRequestEventHandler { + /** + * A method that will handle the BeforeExportRequest event. + * @param source An object which is the event source. Identifies the client object that raised the event. + * @param e A MVCxClientBeforeExportRequestEventArgs object that contains event data. + */ + (source: S, e: MVCxClientBeforeExportRequestEventArgs): void; +} +/** + * Provides data for client BeforeExportRequest events. + */ +interface MVCxClientBeforeExportRequestEventArgs extends ASPxClientEventArgs { + /** + * Gets an object containing specific information (if any, as name/value pairs) that should be passed as a request parameter from the client to the server side for further processing. + * Value: A hash table object containing named values to be passed from the client to the server side via request parameters. + */ + customArgs: Object; +} +/** + * A client-side equivalent of the MVCxReportDesigner class. + */ +interface MVCxClientReportDesigner extends ASPxClientReportDesigner { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs after executing the Save command on the client. + */ + SaveCommandExecuted: ASPxClientEvent>; + /** + * Sends a callback to the server with the specified argument. + * @param arg A Object value, specifying the callback argument. + */ + PerformCallback(arg: Object): void; + /** + * + * @param arg + * @param onSuccess + */ + PerformCallback(arg: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server with the specified argument. + * @param arg A String value, specifying the callback argument. + */ + PerformCallback(arg: string): void; + /** + * + * @param arg + * @param onSuccess + */ + PerformCallback(arg: string, onSuccess: (arg1: string) => void): void; +} +/** + * A method that will handle the SaveCommandExecuted event. + */ +interface MVCxClientReportDesignerSaveCommandExecutedEventHandler { + /** + * A method that will handle the SaveCommandExecuted event. + * @param source An object which is the event source. Identifies the client object that raised the event. + * @param e A MVCxClientBeforeExportRequestEventArgs object that contains event data. + */ + (source: S, e: MVCxClientReportDesignerSaveCommandExecutedEventArgs): void; +} +/** + * Provides data for the SaveCommandExecuted event. + */ +interface MVCxClientReportDesignerSaveCommandExecutedEventArgs extends ASPxClientEventArgs { + /** + * Returns the operation result. + * Value: A String value, specifying the operation result. + */ + Result: string; +} +/** + * A client-side counterpart of the RichEdit extension. + */ +interface MVCxClientRichEdit extends ASPxClientRichEdit { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the RichEdit by processing the passed information on the server, in an Action specified via the CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CustomActionRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * + * @param data + * @param onSuccess + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side event. + */ + PerformCallback(parameter: string): void; + /** + * + * @param parameter + * @param onSuccess + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; +} +/** + * A client-side counterpart of the RoundPanel extension. + */ +interface MVCxClientRoundPanel extends ASPxClientRoundPanel { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the Round Panel by processing the passed information on the server, in an Action specified by the Round Panel's CallbackRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified by the CallbackRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * + * @param data + * @param onSuccess + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side ContentCallback event, passing it the specified argument. + * @param parameter A string value that is any information that needs to be sent to the server-side ContentCallback event. + */ + PerformCallback(parameter: string): void; + /** + * + * @param parameter + * @param onSuccess + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; +} +/** + * A client-side counterpart of the Scheduler extension. + */ +interface MVCxClientScheduler extends ASPxClientScheduler { + ToolTipDisplaying: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the Scheduler by processing the passed information on the server, in an Action specified via the Scheduler's CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CustomActionRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * + * @param data + * @param onSuccess + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument + * @param parameter A string value that represents any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(parameter: string): void; +} +/** + * A template that is rendered to display a tooltip. + */ +interface MVCxClientSchedulerTemplateToolTip extends ASPxClientToolTipBase { + type: MVCxSchedulerToolTipType; +} +/** + * A delegate method that enables you to adjust the tooltip content before displaying. + */ +interface MVCxClientSchedulerToolTipDisplayingEventHandler { + /** + * + * @param source + * @param e + */ + (source: S, e: MVCxClientSchedulerToolTipDisplayingEventArgs): void; +} +/** + * Provides data for the ToolTipDisplaying event. + */ +interface MVCxClientSchedulerToolTipDisplayingEventArgs extends ASPxClientEventArgs { + toolTip: MVCxClientSchedulerTemplateToolTip; + data: ASPxClientSchedulerToolTipData; +} +/** + * Lists available tooltip types. + */ +interface MVCxSchedulerToolTipType { +} +/** + * A client-side counterpart of the Spreadsheet extension. + */ +interface MVCxClientSpreadsheet extends ASPxClientSpreadsheet { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the Spreadsheet by processing the passed information on the server, in an Action specified via the CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CustomActionRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * + * @param data + * @param onSuccess + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side event. + */ + PerformCallback(parameter: string): void; + /** + * + * @param parameter + * @param onSuccess + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; +} +/** + * A client-side counterpart of the PageControl extension. + */ +interface MVCxClientPageControl extends ASPxClientPageControl { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the PageControl by processing the passed information on the server, in an Action specified by the PageControl's CallbackRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified by the CallbackRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * + * @param data + * @param onSuccess + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side Callback event. + */ + PerformCallback(parameter: string): void; + /** + * + * @param parameter + * @param onSuccess + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; +} +/** + * A client-side counterpart of the TokenBox and TokenBoxFor extensions. + */ +interface MVCxClientTokenBox extends ASPxClientTokenBox { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the TokenBox by processing the passed information on the server, in an Action specified by the TokenBox's CallbackRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified by the CallbackRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * + * @param data + * @param onSuccess + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side Callback event. + */ + PerformCallback(parameter: string): void; +} +/** + * A client-side counterpart of the TreeList extension. + */ +interface MVCxClientTreeList extends ASPxClientTreeList { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the TreeList by processing the passed information on the server, in an Action specified via the TreeList's CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CustomActionRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * + * @param data + * @param onSuccess + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback with a parameter to process the passed information on the server, in an Action specified via the TreeList's CustomDataCallback event. This method does not update the TreeList. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CustomDataActionRouteValues property. + */ + PerformCustomDataCallback(data: Object): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param args A string value that represents any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(args: string): void; + /** + * + * @param args + * @param onSuccess + */ + PerformCallback(args: string, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side CustomDataCallback event passing it the specified argument. + * @param arg A string value that represents any information that needs to be sent to the server-side CustomDataCallback event. + */ + PerformCustomDataCallback(arg: string): void; +} +/** + * A client-side counterpart of the TreeView extension. + */ +interface MVCxClientTreeView extends ASPxClientTreeView { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; +} +/** + * A client-side counterpart of the UploadControl extension. + */ +interface MVCxClientUploadControl extends ASPxClientUploadControl { +} +/** + * A method that will handle client BeginCallback events. + */ +interface MVCxClientBeginCallbackEventHandler { + /** + * A method that will handle client BeginCallback events. + * @param source An object which is the event source. Identifies the client object that raised the event. + * @param e A MVCxClientBeginCallbackEventArgs object that contains event data. + */ + (source: S, e: MVCxClientBeginCallbackEventArgs): void; +} +/** + * Provides data for client BeginCallback events. + */ +interface MVCxClientBeginCallbackEventArgs extends ASPxClientBeginCallbackEventArgs { + /** + * Gets an object containing specific information (if any, as name/value pairs) that should be passed as a request parameter from the client to the server side for further processing. + * Value: A hash table object containing named values to be passed from the client to the server side via request parameters. + */ + customArgs: Object; +} +/** + * A method that will handle the BeginCallback event. + */ +interface MVCxClientGlobalBeginCallbackEventHandler { + /** + * A method that will handle the BeginCallback event. + * @param source An object which is the event source. Identifies the client object that raised the event. + * @param e A MVCxClientGlobalBeginCallbackEventArgs object that contains event data. + */ + (source: S, e: MVCxClientGlobalBeginCallbackEventArgs): void; +} +/** + * Provides data for the BeginCallback event. + */ +interface MVCxClientGlobalBeginCallbackEventArgs extends ASPxClientGlobalBeginCallbackEventArgs { + /** + * Gets an object containing specific information (if any, as name/value pairs) that should be passed as a request parameter from the client to the server side for further processing. + * Value: A hash table object containing named values to be passed from the client to the server side via request parameters. + */ + customArgs: Object; +} +/** + * An ASP.NET MVC equivalent of the client ASPxClientGlobalEvents component. + */ +interface MVCxClientGlobalEvents { + /** + * Occurs on the client side after client object models of all DevExpress MVC extensions contained within the page have been initialized. + */ + ControlsInitialized: ASPxClientEvent>; + /** + * Occurs on the client when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by a DevExpress MVC extension. + */ + CallbackError: ASPxClientEvent>; +} +/** + * A client-side counterpart of the VerticalGrid extension. + */ +interface MVCxClientVerticalGrid extends ASPxClientVerticalGrid { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the VerticalGrid by processing the passed information on the server in an Action specified via the grid's CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the grid's CustomActionRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * + * @param data + * @param onSuccess + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback with a parameter to process the passed information on the server, in an Action specified via the VerticalGrid's CustomDataActionRouteValues property, and then process the returned result in the specified client function. This method does not update the VerticalGrid. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CustomDataActionRouteValues property. + * @param onCallback A ASPxClientGridViewValuesCallback object that represents the JavaScript function which receives the information on the client side. + */ + GetValuesOnCustomCallback(data: Object, onCallback: ASPxClientGridViewValuesCallback): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param args A string value that represents any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(args: string): void; + /** + * Sends a callback to the server and generates the server-side CustomDataCallback event. + * @param args A string value that is any information that needs to be sent to the server-side CustomDataCallback event. + * @param onCallback A ASPxClientVerticalGridValuesCallback object that is the JavaScript function which receives the information on the client side. + */ + GetValuesOnCustomCallback(args: string, onCallback: ASPxClientVerticalGridValuesCallback): void; +} +/** + * A client-side equivalent of the MVCxWebDocumentViewer class. + */ +interface MVCxClientWebDocumentViewer extends ASPxClientWebDocumentViewer { +} +/** + * Serves as the base type for all the objects included in the client-side object model. + */ +interface ASPxClientControlBase { + /** + * Gets the unique, hierarchically-qualified identifier for the control. + * Value: The fully-qualified identifier for the control. + */ + name: string; + /** + * Occurs on the client side after the control has been initialized. + */ + Init: ASPxClientEvent>; + /** + * Returns an HTML element that is the root of the control's hierarchy. + */ + GetMainElement(): Object; + /** + * Returns a value specifying whether a control is displayed. + */ + GetClientVisible(): boolean; + /** + * Specifies whether a control is displayed. + * @param visible + */ + SetClientVisible(visible: boolean): void; + /** + * Returns a value specifying whether a control is displayed. + */ + GetVisible(): boolean; + /** + * Specifies whether a control is displayed. + * @param visible true to make a control visible; false to make it hidden. + */ + SetVisible(visible: boolean): void; + /** + * Returns a value that determines whether a callback request sent by a web control is being currently processed on the server side. + */ + InCallback(): boolean; +} +/** + * Serves as the base type for all the objects included in the client-side object model. + */ +interface ASPxClientControl extends ASPxClientControlBase { + /** + * Returns the control's width. + */ + GetWidth(): number; + /** + * Returns the control's height. + */ + GetHeight(): number; + /** + * Specifies the control's width. + * @param width An integer value that specifies the control's width. + */ + SetWidth(width: number): void; + /** + * Specifies the control's height. Note that this method is not in effect for some controls. + * @param height An integer value that specifies the control's height. + */ + SetHeight(height: number): void; + /** + * Modifies the control's size against the control's container. + */ + AdjustControl(): void; +} +/** + * Represents a client-side equivalent of the ASPxCallback control. + */ +interface ASPxClientCallback extends ASPxClientControl { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientCallback. + */ + CallbackError: ASPxClientEvent>; + /** + * Fires on the client side when a callback initiated by the client Callback event's handler returns back to the client. + */ + CallbackComplete: ASPxClientEvent>; + /** + * Sends a callback to the server and generates the server-side Callback event passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side Callback event. + */ + SendCallback(parameter: string): void; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side Callback event. + */ + PerformCallback(parameter: string): void; + /** + * + * @param parameter + * @param onSuccess + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; +} +/** + * A method that will handle the client events related to completion of callback server-side processing. + */ +interface ASPxClientCallbackCompleteEventHandler { + /** + * A method that will handle the client events related to completion of callback server-side processing. + * @param source An object representing the event source. Identifies the web control that raised the event. + * @param e An ASPxClientCallbackCompleteEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCallbackCompleteEventArgs): void; +} +/** + * Serves as the base class for arguments of the web controls' client-side events. + */ +interface ASPxClientEventArgs { +} +/** + * Provides data for events concerning the final processing of a callback. + */ +interface ASPxClientCallbackCompleteEventArgs extends ASPxClientEventArgs { + /** + * Gets a string that contains specific information (if any) passed from the client side for server-side processing. + * Value: A string value representing specific information passed from the client to the server side. + */ + parameter: string; + /** + * Gets a string that contains specific information (if any) that has been passed from the server to the client side for further processing. + * Value: A string value representing specific information passed from the server back to the client side. + */ + result: string; +} +/** + * Represents a client-side equivalent of the ASPxCallbackPanel control. + */ +interface ASPxClientCallbackPanel extends ASPxClientControl { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientCallbackPanel. + */ + CallbackError: ASPxClientEvent>; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side Callback event. + */ + PerformCallback(parameter: string): void; + /** + * + * @param parameter + * @param onSuccess + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; + /** + * Returns the text displayed within the control's loading panel. + */ + GetLoadingPanelText(): string; + /** + * Sets the text to be displayed within the control's loading panel. + * @param loadingPanelText A string value specifying the text to be displayed within the loading panel. + */ + SetLoadingPanelText(loadingPanelText: string): void; + /** + * Sets a value specifying whether the callback panel is enabled. + * @param enabled true, to enable the callback panel; false to disable it. + */ + SetEnabled(enabled: boolean): void; + /** + * Returns a value specifying whether a callback panel is enabled. + */ + GetEnabled(): boolean; +} +/** + * Represents the event object used for client-side events. + */ +interface ASPxClientEvent { + /** + * Dynamically connects the event with an appropriate event handler function. + * @param handler An object representing the event handling function's content. + */ + AddHandler(handler: T): void; + /** + * Dynamically disconnects the event from the associated event handler function. + * @param handler An object representing the event handling function's content. + */ + RemoveHandler(handler: T): void; + /** + * Dynamically disconnects the event from all the associated event handler functions. + */ + ClearHandlers(): void; + /** + * For internal use only. + * @param source + * @param e + */ + FireEvent(source: Object, e: ASPxClientEventArgs): void; +} +/** + * A method that will handle the client-side events of a web control's client-side equivalent. + */ +interface ASPxClientEventHandler { + /** + * A method that will handle the client-side events of a web control's client-side equivalent. + * @param source An object representing the event source. Identifies the control that raised the event. + * @param e An ASPxClientEventArgs object that contains event data. + */ + (source: S, e: ASPxClientEventArgs): void; +} +/** + * A method that will handle the cancelable events of a web control's client-side equivalent. + */ +interface ASPxClientCancelEventHandler { + /** + * A method that will handle the cancelable events of a web control's client-side equivalent. + * @param source An object representing the event source. Identifies the web control that raised the event. + * @param e An ASPxClientCancelEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCancelEventArgs): void; +} +/** + * Provides data for cancelable client events. + */ +interface ASPxClientCancelEventArgs extends ASPxClientEventArgs { + /** + * Gets or sets a value indicating whether the action which raised the event should be canceled. + * Value: true if the action that raised the event should be canceled; otherwise, false. + */ + cancel: boolean; +} +/** + * A method that will handle the client events which can't be cancelled and allow the event's processing to be passed to the server side. + */ +interface ASPxClientProcessingModeEventHandler { + /** + * A method that will handle the client events which can't be cancelled and allow the event's processing to be passed to the server side. + * @param source An object representing the event source. Identifies the web control that raised the event. + * @param e An ASPxClientProcessingModeEventArgs object that contains event data. + */ + (source: S, e: ASPxClientProcessingModeEventArgs): void; +} +/** + * Provides data for the client events which can't be cancelled and allow the event's processing to be passed to the server side. + */ +interface ASPxClientProcessingModeEventArgs extends ASPxClientEventArgs { + /** + * Gets or sets a value that specifies whether the event should be finally processed on the server side. + * Value: true to process the event on the server side; false to completely handle it on the client side. + */ + processOnServer: boolean; +} +/** + * A method that will handle the cancelable client-side events which allow the event's processing to be passed to the server side. + */ +interface ASPxClientProcessingModeCancelEventHandler { + /** + * A method that will handle the cancelable client-side events which allow the event's processing to be passed to the server side. + * @param source An object representing the event source. Identifies the web control that raised the event. + * @param e An ASPxClientProcessingModeCancelEventArgs object that contains event data. + */ + (source: S, e: ASPxClientProcessingModeCancelEventArgs): void; +} +/** + * Provides data for the cancelable client-side events which allow the event's processing to be passed to the server side. + */ +interface ASPxClientProcessingModeCancelEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets or sets a value indicating whether the action which raised the event should be canceled. + * Value: true if the action that raised the event should be canceled; otherwise, false. + */ + cancel: boolean; +} +/** + * Represents a JavaScript function which receives callback data obtained via a call to a specific client method (such as the PerformDataCallback). + */ +interface ASPxClientDataCallback { + /** + * A JavaScript function which receives a callback data obtained via a call to a specific client method (such as the PerformDataCallback). + * @param sender An object whose client method generated a callback. + * @param result A string value that represents the result of server-side callback processing. + */ + (sender: Object, result: string): void; +} +/** + * Represents a client-side equivalent of the ASPxCloudControl control. + */ +interface ASPxClientCloudControl extends ASPxClientControl { + /** + * Fires after an item has been clicked. + */ + ItemClick: ASPxClientEvent>; +} +/** + * A method that will handle client events involving manipulations with the control's items. + */ +interface ASPxClientCloudControlItemEventHandler { + /** + * A method that will handle client events concerning manipulations with items. + * @param source The event source. This parameter identifies the cloud control object which raised the event. + * @param e An ASPxClientCloudControlItemEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCloudControlItemEventArgs): void; +} +/** + * Provides data for events which involve clicking on the control's items. + */ +interface ASPxClientCloudControlItemEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the name that uniquely identifies the processed item. + * Value: A string value that represents the value assigned to the item's Name property. + */ + name: Object; + /** + * Gets the HTML object that contains the processed item. + * Value: An object representing a container for the item related to the event. + */ + htmlElement: Object; + /** + * Gets a DHTML event object that relates to the processed event. + * Value: An object that maintains DHTML event-specific information. + */ + htmlEvent: Object; +} +/** + * A method that will handle the client events related to the begining of a callback processing round trip. + */ +interface ASPxClientBeginCallbackEventHandler { + /** + * A method that will handle client BeginCallback events. + * @param source An object representing the event source. Identifies the web control that raised the event. + * @param e An ASPxClientBeginCallbackEventArgs object that contains event data. + */ + (source: S, e: ASPxClientBeginCallbackEventArgs): void; +} +/** + * Provides data for client events related to the beginning of a callback processing round trip. + */ +interface ASPxClientBeginCallbackEventArgs extends ASPxClientEventArgs { + /** + * Gets a command name that identifies which client action forced a callback to be occurred. + * Value: A string value that represents the name of the command which initiated a callback. + */ + command: string; +} +/** + * A method that will handle the BeginCallback event. + */ +interface ASPxClientGlobalBeginCallbackEventHandler { + /** + * A method that will handle the BeginCallback event. + * @param source The event source. + * @param e An ASPxDataValidationEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGlobalBeginCallbackEventArgs): void; +} +/** + * Provides data for the BeginCallback event. + */ +interface ASPxClientGlobalBeginCallbackEventArgs extends ASPxClientBeginCallbackEventArgs { + /** + * Gets an object that initiated a callback. + * Value: An class descendant object that is the control that initiated a callback. + */ + control: ASPxClientControl; +} +/** + * A method that will handle the client events related to the completion of a callback processing round trip. + */ +interface ASPxClientEndCallbackEventHandler { + /** + * A method that will handle client EndCallback events. + * @param source An object representing the event source. + * @param e A MenuItemEventArgs object that contains event data. + */ + (source: S, e: ASPxClientEndCallbackEventArgs): void; +} +/** + * Provides data for client events related to the completion of a callback processing round trip. + */ +interface ASPxClientEndCallbackEventArgs extends ASPxClientEventArgs { +} +/** + * A method that will handle the EndCallback event. + */ +interface ASPxClientGlobalEndCallbackEventHandler { + /** + * A method that will handle the EndCallback event. + * @param source The event source. + * @param e An ASPxDataValidationEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGlobalEndCallbackEventArgs): void; +} +/** + * Provides data for the EndCallback event. + */ +interface ASPxClientGlobalEndCallbackEventArgs extends ASPxClientEndCallbackEventArgs { + /** + * Gets an object that initiated a callback. + * Value: An class descendant object that is the control that initiated a callback. + */ + control: ASPxClientControl; +} +/** + * A method that will handle a CustomCallback client event exposed by some DevExpress web controls. + */ +interface ASPxClientCustomDataCallbackEventHandler { + /** + * A method that will handle the client CustomCallback event of some controls. + * @param source An object representing the event source. + * @param e An ASPxClientCustomDataCallbackEventHandler object that contains event data. + */ + (source: S, e: ASPxClientCustomDataCallbackEventArgs): void; +} +/** + * Provides data for the CustomCallback event. + */ +interface ASPxClientCustomDataCallbackEventArgs extends ASPxClientEventArgs { + /** + * Gets a string that contains specific information (if any) that has been passed from the server to the client side for further processing, related to the CustomCallback event. + * Value: A string value representing specific information passed from the server back to the client side. + */ + result: string; +} +/** + * A method that will handle client events related to server-side errors that occured during callback processing. + */ +interface ASPxClientCallbackErrorEventHandler { + /** + * A method that will handle client CallbackError events. + * @param source An object representing the event source. + * @param e A ASPxClientCallbackErrorEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCallbackErrorEventArgs): void; +} +/** + * Provides data for client events related to server-side errors that occured during callback processing. + */ +interface ASPxClientCallbackErrorEventArgs extends ASPxClientEventArgs { + /** + * Gets the error message that describes the server error that occurred. + * Value: A string value that represents the error message. + */ + message: string; + /** + * Gets or sets whether the event is handled and the default error handling actions are not required. + * Value: true if the error is handled and no default processing is required; otherwise false. + */ + handled: boolean; +} +/** + * A method that will handle the CallbackError event. + */ +interface ASPxClientGlobalCallbackErrorEventHandler { + /** + * A method that will handle the CallbackError event. + * @param source The event source. + * @param e An ASPxDataValidationEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGlobalCallbackErrorEventArgs): void; +} +/** + * Provides data for the CallbackError event. + */ +interface ASPxClientGlobalCallbackErrorEventArgs extends ASPxClientCallbackErrorEventArgs { + /** + * Gets an object that initiated a callback. + * Value: An class descendant object that is the control that initiated a callback. + */ + control: ASPxClientControl; +} +/** + * A method that will handle the ValidationCompleted client event. + */ +interface ASPxClientValidationCompletedEventHandler { + /** + * A method that will handle the ValidationCompleted event. + * @param source An object representing the event source. Identifies the ASPxClientGlobalEvents object that raised the event. + * @param e An ASPxClientValidationCompletedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientValidationCompletedEventArgs): void; +} +/** + * Provides data for the ValidationCompleted client event that allows you to centrally validate user input within all DevExpress web controls to which validation is applied. + */ +interface ASPxClientValidationCompletedEventArgs extends ASPxClientEventArgs { + /** + * Gets a container object that holds the validated control(s). + * Value: An object that represents a container of the validated control(s). + */ + container: Object; + /** + * Gets the name of the validation group name to which validation has been applied. + * Value: A string value that represents the name of the validation group that has been validated. + */ + validationGroup: string; + /** + * Gets a value that indicates whether validation has been applied to both visible and invisible controls. + * Value: true if validation has been applied to both visible and invisible controls; false if only visible controls have been validated. + */ + invisibleControlsValidated: boolean; + /** + * Gets a value specifying whether the validation has been completed successfully. + * Value: true if the validation has been completed successfully; otherwise, false. + */ + isValid: boolean; + /** + * Gets the first control (either visible or invisible) that hasn't passed the validation applied. + * Value: An ASPxClientControl object that represents the first invalid control. + */ + firstInvalidControl: ASPxClientControl; + /** + * Gets the first visible control that hasn't passed the validation applied. + * Value: An ASPxClientControl object that represents the first visible invalid control. + */ + firstVisibleInvalidControl: ASPxClientControl; +} +/** + * A method that will handle the client ControlsInitialized event. + */ +interface ASPxClientControlsInitializedEventHandler { + /** + * A method that will handle the client ControlsInitialized event. + * @param source An object representing the event source. + * @param e An ASPxClientControlsInitializedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientControlsInitializedEventArgs): void; +} +/** + * Provides data for the client ControlsInitialized event. + */ +interface ASPxClientControlsInitializedEventArgs extends ASPxClientEventArgs { + /** + * Gets a value that specifies whether a callback is sent during a controls initialization. + * Value: true if a callback is sent; otherwise, false. + */ + isCallback: boolean; +} +interface ASPxClientControlPredicate { + (control: Object): boolean; +} +interface ASPxClientControlAction { + (control: Object): void; +} +/** + * A collection object used on the client side to maintain particular client control objects + */ +interface ASPxClientControlCollection { + /** + * Occurs on the client side after client object models of all DevExpress web controls contained within the page have been initialized. + */ + ControlsInitialized: ASPxClientEvent>; + /** + * Occurs when the browser window is being resized. + */ + BrowserWindowResized: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated by any DevExpress control. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side, after server-side processing of a callback initiated by any DevExpress web control, has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by any DevExpress web control. + */ + CallbackError: ASPxClientEvent>; + /** + * Occurs after the validation initiated for a DevExpress web control (or a group of DevExpress web controls) has been completed. + */ + ValidationCompleted: ASPxClientEvent>; + /** + * Returns a collection item identified by its unique hierarchically-qualified identifier. + * @param name A string value representing the hierarchically-qualified identifier of the required control. + */ + Get(name: Object): Object; + /** + * Returns a DevExpress client control object identified by its unique hierarchically-qualified identifier (either ClientInstanceName or ClientID property value). + * @param name A string value that is the hierarchically-qualified identifier of the required DevExpress control. + */ + GetByName(name: string): Object; + /** + * + * @param predicate + */ + GetControlsByPredicate(predicate: ASPxClientControlPredicate): Object[]; + /** + * + * @param type + */ + GetControlsByType(type: Object): Object[]; + /** + * + * @param action + */ + ForEachControl(action: ASPxClientControlAction): void; +} +/** + * Represents a client-side equivalent of the ASPxDataView object. + */ +interface ASPxClientDataView extends ASPxClientControl { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientDataView. + */ + CallbackError: ASPxClientEvent>; + /** + * Activates the specified page. + * @param pageIndex An integer value that specifies the active page's index. + */ + GotoPage(pageIndex: number): void; + /** + * Gets the index of the page that is currently active. + */ + GetPageIndex(): number; + /** + * Gets the size of a single ASPxDataView's page. + */ + GetPageSize(): number; + /** + * Sets the size of a single ASPxDataView's page. + * @param pageSize An integer value that specifies the page size. + */ + SetPageSize(pageSize: number): void; + /** + * Gets the number of pages into which the ASPxDataView's data is divided. + */ + GetPageCount(): number; + /** + * Activates the next page. + */ + NextPage(): void; + /** + * Activates the previous page. + */ + PrevPage(): void; + /** + * Activates the first page. + */ + FirstPage(): void; + /** + * Activates the last page. + */ + LastPage(): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(parameter: string): void; + /** + * + * @param parameter + * @param onSuccess + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; +} +/** + * A JavaScript function which returns a value specifying whether an object meets the criteria defined within the method specified by this delegate. + */ +interface ASPxClientDockingFilterPredicate { + /** + * A JavaScript function which returns a value specifying whether an object meets the criteria defined within the method specified by this delegate. + * @param item An object to compare against the criteria defined within the method. + */ + (item: Object): boolean; +} +/** + * A client-side equivalent of the ASPxDockManager object. + */ +interface ASPxClientDockManager extends ASPxClientControl { + /** + * Fires on the client side before a panel is docked in a zone and allows you to cancel the action. + */ + BeforeDock: ASPxClientEvent>; + /** + * Fires on the client side after a panel is docked in a zone. + */ + AfterDock: ASPxClientEvent>; + /** + * Fires on the client side before a panel is made floating (undocked from a zone) and allows you to cancel the action. + */ + BeforeFloat: ASPxClientEvent>; + /** + * Fires on the client side after a panel is undocked from a zone. + */ + AfterFloat: ASPxClientEvent>; + /** + * Occurs when a panel dragging operation is started. + */ + StartPanelDragging: ASPxClientEvent>; + /** + * Occurs after a panel dragging operation is complete. + */ + EndPanelDragging: ASPxClientEvent>; + /** + * Occurs on the client side before a panel is closed, and allows you to cancel the action. + */ + PanelClosing: ASPxClientEvent>; + /** + * Occurs on the client side when a panel is closed. + */ + PanelCloseUp: ASPxClientEvent>; + /** + * Occurs on the client side when a panel pops up. + */ + PanelPopUp: ASPxClientEvent>; + /** + * Occurs on the client side after a panel has been invoked. + */ + PanelShown: ASPxClientEvent>; + /** + * Occurs on the client side after a panel has been resized. + */ + PanelResize: ASPxClientEvent>; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that contains any information that needs to be sent to the server-side Callback event. + */ + PerformCallback(parameter: string): void; + /** + * + * @param parameter + * @param onSuccess + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; + /** + * Returns a zone specified by its unique identifier (zoneUID). + * @param zoneUID A string value specifying the unique identifier of the zone. + */ + GetZoneByUID(zoneUID: string): ASPxClientDockZone; + /** + * Returns a panel specified by its unique identifier (panelUID). + * @param panelUID A string value specifying the unique identifier of the panel. + */ + GetPanelByUID(panelUID: string): ASPxClientDockPanel; + /** + * Returns an array of panels contained in a page. + */ + GetPanels(): ASPxClientDockPanel[]; + /** + * Returns an array of panels that are contained in a page and meet a specified criteria. + * @param filterPredicate An ASPxClientDockingFilterPredicate delegate that defines a set of criteria and determines whether a panel meets those criteria. + */ + GetPanels(filterPredicate: ASPxClientDockingFilterPredicate): ASPxClientDockPanel[]; + /** + * Returns an array of zones contained in a page. + */ + GetZones(): ASPxClientDockZone[]; + /** + * Returns an array of zones that are contained in a page and meet a specified criteria. + * @param filterPredicate An ASPxClientDockingFilterPredicate delegate that defines a set of criteria and determines whether a zone meets those criteria. + */ + GetZones(filterPredicate: ASPxClientDockingFilterPredicate): ASPxClientDockZone[]; +} +/** + * A method that will handle the client BeforeDock event. + */ +interface ASPxClientDockManagerProcessingModeCancelEventHandler { + /** + * A method that will handle the BeforeDock event. + * @param source The event source. This parameter identifies the dock manager object which raised the event. + * @param e An ASPxClientDockManagerProcessingModeCancelEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDockManagerProcessingModeCancelEventArgs): void; +} +/** + * Provides data for the BeforeDock event. + */ +interface ASPxClientDockManagerProcessingModeCancelEventArgs extends ASPxClientProcessingModeCancelEventArgs { + /** + * Gets the panel currently being processed. + * Value: An ASPxClientDockPanel object that is the processed panel. + */ + panel: ASPxClientDockPanel; + /** + * Gets the zone currently being processed. + * Value: An ASPxClientDockZone object that is the processed zone. + */ + zone: ASPxClientDockZone; +} +/** + * A method that will handle the client AfterDock event. + */ +interface ASPxClientDockManagerProcessingModeEventHandler { + /** + * A method that will handle the AfterDock event. + * @param source The event source. This parameter identifies the dock manager object which raised the event. + * @param e An ASPxClientDockManagerProcessingModeEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDockManagerProcessingModeEventArgs): void; +} +/** + * Provides data for the AfterDock event. + */ +interface ASPxClientDockManagerProcessingModeEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the panel currently being processed. + * Value: An ASPxClientDockPanel object that is the processed panel. + */ + panel: ASPxClientDockPanel; + /** + * Gets the zone currently being processed. + * Value: An ASPxClientDockZone object that is the processed zone. + */ + zone: ASPxClientDockZone; +} +/** + * A method that will handle client-side events concerning manipulations with panels. + */ +interface ASPxClientDockManagerEventHandler { + /** + * A method that will handle client-side events concerning manipulations with panels. + * @param source The event source. This parameter identifies the dock manager object which raised the event. + * @param e An ASPxClientDockManagerEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDockManagerEventArgs): void; +} +/** + * Provides data for events which concern manipulations on panels. + */ +interface ASPxClientDockManagerEventArgs extends ASPxClientEventArgs { + /** + * Gets the panel currently being processed. + * Value: An ASPxClientDockPanel object that is the processed panel. + */ + panel: ASPxClientDockPanel; +} +/** + * A method that will handle the client BeforeDock event. + */ +interface ASPxClientDockManagerCancelEventHandler { + /** + * A method that will handle the PanelClosing event. + * @param source The event source. This parameter identifies the dock manager object which raised the event. + * @param e An ASPxClientDockManagerCancelEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDockManagerCancelEventArgs): void; +} +/** + * Provides data for the BeforeDock event. + */ +interface ASPxClientDockManagerCancelEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the panel currently being processed. + * Value: An ASPxClientDockPanel object that is the processed panel. + */ + panel: ASPxClientDockPanel; +} +/** + * Serves as a base class for the ASPxClientPopupControl classes. + */ +interface ASPxClientPopupControlBase extends ASPxClientControl { + /** + * Occurs on the client side when window resizing initiates. + */ + BeforeResizing: ASPxClientEvent>; + /** + * Occurs on the client side when window resizing completes. + */ + AfterResizing: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the control. + */ + CallbackError: ASPxClientEvent>; + /** + * Occurs on the client side when a control's window closes or hides. + */ + CloseUp: ASPxClientEvent>; + /** + * Enables you to cancel window closing on the client side. + */ + Closing: ASPxClientEvent>; + /** + * Occurs on the client side when a control's window is invoked. + */ + PopUp: ASPxClientEvent>; + /** + * Occurs on the client side after a window has been resized. + */ + Resize: ASPxClientEvent>; + /** + * Occurs on the client side after a control's window has been invoked. + */ + Shown: ASPxClientEvent>; + /** + * Occurs on the client side when the window pin state is changed. + */ + PinnedChanged: ASPxClientEvent>; + /** + * Modifies a control's window size in accordance with the content. + */ + AdjustSize(): void; + /** + * Brings the window to the front of the z-order. + */ + BringToFront(): void; + /** + * Returns a value indicating whether the window is collapsed. + */ + GetCollapsed(): boolean; + /** + * Returns the HTML code that specifies the contents of the control's window. + */ + GetContentHtml(): string; + /** + * Returns an iframe object containing a web page specified via the control's SetContentUrl client method). + */ + GetContentIFrame(): Object; + /** + * Returns an iframe object containing a web page specified via the control's SetContentUrl client method). + */ + GetContentIFrameWindow(): Object; + /** + * Returns the URL pointing to the web page displayed within the control's window. + */ + GetContentUrl(): string; + /** + * Returns the URL pointing to the image displayed within the window footer by default. + */ + GetFooterImageUrl(): string; + /** + * Returns the URL where the web browser will navigate when the text or image is clicked within a window's footer. + */ + GetFooterNavigateUrl(): string; + /** + * Returns the text displayed within a window's footer. + */ + GetFooterText(): string; + /** + * Returns the URL pointing to the image displayed within the window header. + */ + GetHeaderImageUrl(): string; + /** + * Returns the URL where the web browser will navigate when the text or image is clicked within a window's header. + */ + GetHeaderNavigateUrl(): string; + /** + * Returns the text displayed within a window's header. + */ + GetHeaderText(): string; + /** + * Gets the width of the default window's (for ASPxPopupControl) or panel's (for ASPxDockPanel) content region. + */ + GetContentWidth(): number; + /** + * Gets the height of the default window's (for ASPxPopupControl) or panel's (for ASPxDockPanel) content region. + */ + GetContentHeight(): number; + /** + * Returns a value indicating whether the window is maximized. + */ + GetMaximized(): boolean; + /** + * Returns a value indicating whether the window is pinned. + */ + GetPinned(): boolean; + /** + * Sends a callback to the server and generates the server-side WindowCallback event, passing the specified argument to it. + * @param parameter A string value that is any information that needs to be sent to the server-side WindowCallback event. + */ + PerformCallback(parameter: string): void; + /** + * Refreshes the content of the web page displayed within the control's window. + */ + RefreshContentUrl(): void; + /** + * Sets a value indicating whether the window is collapsed. + * @param value true, to collapse the window; otherwise, false. + */ + SetCollapsed(value: boolean): void; + /** + * Sets the HTML markup specifying the contents of the control's window. + * @param html A string value that specifies the HTML markup. + */ + SetContentHtml(html: string): void; + /** + * Sets the URL to point to the web page that should be loaded into, and displayed within the control's window. + * @param url A string value specifying the URL to the web page displayed within the control's window. + */ + SetContentUrl(url: string): void; + /** + * Specifies the URL which points to the image displayed within the window footer by default. + * @param value A string value that is the URL for the image displayed within the window footer. + */ + SetFooterImageUrl(value: string): void; + /** + * Specifies the URL where the web browser will navigate when the text or image is clicked within a window's footer. + * @param value A string value which specifies the required navigation location. + */ + SetFooterNavigateUrl(value: string): void; + /** + * Specifies the text displayed within a window's footer. + * @param value A string value that specifies a window's footer text. + */ + SetFooterText(value: string): void; + /** + * Specifies the URL which points to the image displayed within the window header. + * @param value A string value that is the URL to the image displayed within the header. + */ + SetHeaderImageUrl(value: string): void; + /** + * Specifies the URL where the web browser will navigate when the text or image is clicked within a window's header. + * @param value A string value which specifies the required navigation location. + */ + SetHeaderNavigateUrl(value: string): void; + /** + * Specifies the text displayed within a window's header. + * @param value A string value that specifies a window's header text. + */ + SetHeaderText(value: string): void; + /** + * Sets a value indicating whether the window is maximized. + * @param value true. to maximize the window; otherwise, false. + */ + SetMaximized(value: boolean): void; + /** + * Sets a value indicating whether the window is pinned. + * @param value true, to pin the window; otherwise, false. + */ + SetPinned(value: boolean): void; + /** + * Invokes the control's window. + */ + Show(): void; + /** + * Invokes the control's window at the popup element with the specified index. + * @param popupElementIndex An integer value specifying the zero-based index of the popup element. + */ + Show(popupElementIndex: number): void; + /** + * Invokes the control's window and displays it over the specified HTML element. + * @param htmlElement An object specifying the HTML element relative to whose position the window is invoked. + */ + ShowAtElement(htmlElement: Object): void; + /** + * Invokes the control's window and displays it over an HTML element specified by its unique identifier. + * @param id A string value that specifies the hierarchically qualified identifier of an HTML element relative to whose position the window is invoked. + */ + ShowAtElementByID(id: string): void; + /** + * Invokes the control's window at the specified position. + * @param x A integer value specifying the x-coordinate of the window's display position. + * @param y A integer value specifying the y-coordinate of the window's display position. + */ + ShowAtPos(x: number, y: number): void; + /** + * Closes the control's window. + */ + Hide(): void; + /** + * Returns a value that specifies whether the control's window is displayed. + */ + IsVisible(): boolean; +} +/** + * A client-side equivalent of the ASPxDockPanel object. + */ +interface ASPxClientDockPanel extends ASPxClientPopupControlBase { + /** + * Gets or sets the unique identifier of a panel on a page. + * Value: A string that is the unique identifier of a panel. + */ + panelUID: string; + /** + * Fires on the client side before a panel is docked in a zone and allows you to cancel the action. + */ + BeforeDock: ASPxClientEvent>; + /** + * Fires on the client side after a panel is docked in a zone. + */ + AfterDock: ASPxClientEvent>; + /** + * Fires on the client side before a panel is made floating (undocked from a zone) and allows you to cancel the action. + */ + BeforeFloat: ASPxClientEvent>; + /** + * Fires on the client side after a panel is undocked from a zone. + */ + AfterFloat: ASPxClientEvent>; + /** + * Occurs when a panel dragging operation is started. + */ + StartDragging: ASPxClientEvent>; + /** + * Occurs after a panel dragging operation is complete. + */ + EndDragging: ASPxClientEvent>; + /** + * Retrieves a zone that owns the current panel. + */ + GetOwnerZone(): ASPxClientDockZone; + /** + * Docks the current panel in the specified zone. + * @param zone An ASPxClientDockZone object specifying the zone. + */ + Dock(zone: ASPxClientDockZone): void; + /** + * Docks the current panel in a zone at the specified position. + * @param zone An ASPxClientDockZone object specifying the zone, where the panel is docked + * @param visibleIndex An integer value specifying the visible index position. + */ + Dock(zone: ASPxClientDockZone, visibleIndex: number): void; + /** + * Undocks the current panel. + */ + MakeFloat(): void; + /** + * Undocks the current panel and place it at the specified position. + * @param x An integer value that specifies the X-coordinate of the panel's display position. + * @param y An integer value that specifies the Y-coordinate of the panel's display position. + */ + MakeFloat(x: number, y: number): void; + /** + * Gets or sets a value specifying the position of the current panel, amongst the visible panels within a zone. + */ + GetVisibleIndex(): number; + /** + * Sets a value specifying the position of the current panel, amongst the visible panels in a zone. + * @param visibleIndex An integer value specifying the zero-based index of the panel amongst visible panels in the zone. + */ + SetVisibleIndex(visibleIndex: number): void; + /** + * Returns a value indicating whether the panel is docked. + */ + IsDocked(): boolean; +} +/** + * A method that will handle the client BeforeDock event. + */ +interface ASPxClientDockPanelProcessingModeCancelEventHandler { + /** + * A method that will handle the BeforeDock event. + * @param source A ASPxClientDockPanel object that raised the event. + * @param e A ASPxClientDockPanelProcessingModeCancelEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDockPanelProcessingModeCancelEventArgs): void; +} +/** + * Provides data for the BeforeDock event. + */ +interface ASPxClientDockPanelProcessingModeCancelEventArgs extends ASPxClientProcessingModeCancelEventArgs { + /** + * Gets the zone currently being processed. + * Value: An ASPxClientDockZone object that is the processed zone. + */ + zone: ASPxClientDockZone; +} +/** + * A method that will handle the client BeforeDock event. + */ +interface ASPxClientDockPanelProcessingModeEventHandler { + /** + * A method that will handle the AfterFloat event. + * @param source A ASPxClientDockPanel object that raised the event. + * @param e A ASPxClientDockPanelProcessingModeEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDockPanelProcessingModeEventArgs): void; +} +/** + * Provides data for the AfterFloat event. + */ +interface ASPxClientDockPanelProcessingModeEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the zone currently being processed. + * Value: An ASPxClientDockZone object that is the processed zone. + */ + zone: ASPxClientDockZone; +} +/** + * A client-side equivalent of the ASPxDockZone object. + */ +interface ASPxClientDockZone extends ASPxClientControl { + /** + * Gets or sets the unique identifier of a zone on a page. + * Value: A string that is the unique identifier of a zone. + */ + zoneUID: string; + /** + * Fires on the client side before a panel is docked in a zone and allows you to cancel the action. + */ + BeforeDock: ASPxClientEvent>; + /** + * Fires on the client side after a panel is docked in a zone. + */ + AfterDock: ASPxClientEvent>; + /** + * Returns a value that indicates the orientation in which panels are stacked in the current zone. + */ + IsVertical(): boolean; + /** + * Gets a value that indicates whether the zone can enlarge its size. + */ + GetAllowGrowing(): boolean; + /** + * Gets the number of panels contained in the zone. + */ + GetPanelCount(): number; + /** + * Returns a panel specified by its unique identifier (panelUID). + * @param panelUID A string value specifying the unique identifier of the panel. + */ + GetPanelByUID(panelUID: string): ASPxClientDockPanel; + /** + * Returns a panel specified by its visible index. + * @param visibleIndex An integer value specifying the panel's position among the visible panels within the current zone. + */ + GetPanelByVisibleIndex(visibleIndex: number): ASPxClientDockPanel; + /** + * Returns an array of panels docked in the current zone. + */ + GetPanels(): ASPxClientDockPanel[]; + /** + * Returns an array of panels that are docked in the current zone and meet a specified criteria. + * @param filterPredicate An ASPxClientDockingFilterPredicate delegate that defines a set of criteria and determines whether a panel meets those criteria. + */ + GetPanels(filterPredicate: ASPxClientDockingFilterPredicate): ASPxClientDockPanel[]; +} +/** + * A method that will handle the client BeforeDock event. + */ +interface ASPxClientDockZoneCancelEventHandler { + /** + * A method that will handle the BeforeDock event. + * @param source The event source. This parameter identifies the zone object which raised the event. + * @param e A ASPxClientDockZoneCancelEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDockZoneCancelEventArgs): void; +} +/** + * Provides data for the BeforeDock event. + */ +interface ASPxClientDockZoneCancelEventArgs extends ASPxClientProcessingModeCancelEventArgs { + /** + * Gets the panel currently being processed. + * Value: An ASPxClientDockPanel object that is the processed panel. + */ + panel: ASPxClientDockPanel; +} +/** + * A method that will handle the client AfterDock event. + */ +interface ASPxClientDockZoneProcessingModeEventHandler { + /** + * A method that will handle the AfterDock event. + * @param source The event source. This parameter identifies the zone object which raised the event. + * @param e An ASPxClientDockZoneProcessingModeEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDockZoneProcessingModeEventArgs): void; +} +/** + * Provides data for the AfterDock event. + */ +interface ASPxClientDockZoneProcessingModeEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the panel currently being processed. + * Value: An ASPxClientDockPanel object that is the processed panel. + */ + panel: ASPxClientDockPanel; +} +/** + * Represents the client-side equivalent of the ASPxFileManager control. + */ +interface ASPxClientFileManager extends ASPxClientControl { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientFileManager. + */ + CallbackError: ASPxClientEvent>; + /** + * Fires on the client side after the selected file has been changed. + */ + SelectedFileChanged: ASPxClientEvent>; + /** + * Fires on the client side when an end-user opens a file by double-clicking it or pressing the Enter key. + */ + SelectedFileOpened: ASPxClientEvent>; + /** + * Fires after the focused item has been changed. + */ + FocusedItemChanged: ASPxClientEvent>; + /** + * Fires after the selection has been changed. + */ + SelectionChanged: ASPxClientEvent>; + /** + * Fires on the client side after the current folder has been changed within a file manager. + */ + CurrentFolderChanged: ASPxClientEvent>; + /** + * Fires on the client side before the folder is created, and allows you to cancel the action. + */ + FolderCreating: ASPxClientEvent>; + /** + * Occurs on the client side after a folder has been created. + */ + FolderCreated: ASPxClientEvent>; + /** + * Fires on the client side before an item is renamed and allows you to cancel the action. + */ + ItemRenaming: ASPxClientEvent>; + /** + * Occurs on the client side after a file manager's item has been renamed. + */ + ItemRenamed: ASPxClientEvent>; + /** + * Fires on the client side before an item is deleted and allows you to cancel the action. + */ + ItemDeleting: ASPxClientEvent>; + /** + * Occurs on the client side after a file manager's item has been deleted. + */ + ItemDeleted: ASPxClientEvent>; + /** + * Occurs on the client side after all the selected items have been deleted. + */ + ItemsDeleted: ASPxClientEvent>; + /** + * Fires on the client side before an item is moved and allows you to cancel the action. + */ + ItemMoving: ASPxClientEvent>; + /** + * Occurs on the client side after a file manager's item has been moved. + */ + ItemMoved: ASPxClientEvent>; + /** + * Occurs on the client side after all the selected items have been moved . + */ + ItemsMoved: ASPxClientEvent>; + /** + * Fires on the client side before an item is copied and allows you to cancel the action. + */ + ItemCopying: ASPxClientEvent>; + /** + * Occurs on the client side after a file manager item has been copied. + */ + ItemCopied: ASPxClientEvent>; + /** + * Occurs on the client side after all the selected items have been copied. + */ + ItemsCopied: ASPxClientEvent>; + /** + * Fires on the client if any error occurs while editing an item. + */ + ErrorOccurred: ASPxClientEvent>; + /** + * Enables you to display the alert with the result error description. + */ + ErrorAlertDisplaying: ASPxClientEvent>; + /** + * Fires when a custom item is clicked, allowing you to perform custom actions. + */ + CustomCommand: ASPxClientEvent>; + /** + * Fires on the client side when the file manager updates the state of toolbar or context menu items. + */ + ToolbarUpdating: ASPxClientEvent>; + /** + * Enables you to highlight the search text, which is specified using the filter box, in templates. + */ + HighlightItemTemplate: ASPxClientEvent>; + /** + * Fires on the client side before a file upload starts, and allows you to cancel the action. + */ + FileUploading: ASPxClientEvent>; + /** + * Fires on the client side before the selected items are uploaded and allows you to cancel the action. + */ + FilesUploading: ASPxClientEvent>; + /** + * Occurs on the client side after a file has been uploaded. + */ + FileUploaded: ASPxClientEvent>; + /** + * Occurs on the client side after upload of all selected files has been completed. + */ + FilesUploaded: ASPxClientEvent>; + /** + * Fires on the client side before a file download starts, and allows you to cancel the action. + */ + FileDownloading: ASPxClientEvent>; + /** + * Gets the name of the currently active file manager area. + */ + GetActiveAreaName(): string; + /** + * Client-side scripting method which initiates a round trip to the server, so that the current page will be reloaded. + */ + Refresh(): void; + /** + * Executes the specified command. + * @param commandName A string value that specifies the command to perform. + */ + ExecuteCommand(commandName: string): boolean; + /** + * Returns the selected file within the ASPxFileManager control's file container. + */ + GetSelectedFile(): ASPxClientFileManagerFile; + /** + * Returns an array of the file manager's selected items. + */ + GetSelectedItems(): ASPxClientFileManagerFile[]; + /** + * Returns a list of files that are loaded on the current page. + */ + GetItems(): ASPxClientFileManagerFile[]; + /** + * Sends a callback to the server and returns a list of files that are contained within the current folder. + * @param onCallback A object that represents the JavaScript function which receives the list of row values as a parameter. + */ + GetAllItems(onCallback: ASPxClientFileManagerAllItemsCallback): void; + /** + * Returns a toolbar item specified by its command name. + * @param commandName A string value specifying the command name of the item. + */ + GetToolbarItemByCommandName(commandName: string): ASPxClientFileManagerToolbarItem; + /** + * Returns a context menu item specified by its command name. + * @param commandName A string value specifying the command name of the item. + */ + GetContextMenuItemByCommandName(commandName: string): ASPxClientFileManagerToolbarItem; + /** + * Gets the current folder's path. + */ + GetCurrentFolderPath(): string; + /** + * Gets the current folder's path with the specified separator. + * @param separator A string value that specifies the separator between the folder's name within a path. + */ + GetCurrentFolderPath(separator: string): string; + /** + * Gets the current folder's path with the specified settings. + * @param separator A string value that specifies the separator between the folder's name within the path. + * @param skipRootFolder true to skip the root folder; otherwise, false. + */ + GetCurrentFolderPath(separator: string, skipRootFolder: boolean): string; + /** + * Sets the current folder's path. + * @param path A String value that is the relative path to the folder (without the root folder). + * @param onCallback A ASPxClientFileManagerCallback object that is the JavaScript function that receives the callback data as a parameter. + */ + SetCurrentFolderPath(path: string, onCallback: ASPxClientFileManagerCallback): void; + /** + * Gets the current folder's ID. + */ + GetCurrentFolderId(): string; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param args A string value that specifies any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(args: string): void; + /** + * + * @param args + * @param onSuccess + */ + PerformCallback(args: string, onSuccess: (arg1: string) => void): void; +} +/** + * A JavaScript function which receives callback data obtained via a call to the client SetCurrentFolderPath method. + */ +interface ASPxClientFileManagerCallback { + /** + * A JavaScript function that receives callback data obtained via a call to the SetCurrentFolderPath method. + * @param result An object that contains a callback data. + */ + (result: Object): void; +} +/** + * A client-side equivalent of the file manager's FileManagerItem object and serves as a base class for client file and folder objects. + */ +interface ASPxClientFileManagerItem { + /** + * Gets the name of the current item. + * Value: A string value that is the item's name. + */ + name: string; + /** + * Gets the item's unique identifier. + * Value: A String value that specifies the item's unique identifier. + */ + id: string; + /** + * Gets a value that indicates if the current file manager item is a folder. + * Value: true if the current item is a folder or parent folder; false if the current item is a file. + */ + isFolder: boolean; + /** + * Specifies whether the file manager item is selected. + * @param selected true, to select the item; otherwise, false. + */ + SetSelected(selected: boolean): void; + /** + * Gets a value indicating whether the item is selected in the file manager. + */ + IsSelected(): boolean; + /** + * Gets the current item's full name. + */ + GetFullName(): string; + /** + * Gets the current item's full name with the specified separator. + * @param separator A string value that specifies the separator between the folder name inside the item's full name. + */ + GetFullName(separator: string): string; + /** + * Gets the current item's full name with the specified settings. + * @param separator A string value that specifies the separator between the folder name inside the item's full name. + * @param skipRootFolder true, to skip the root folder; otherwise, false. + */ + GetFullName(separator: string, skipRootFolder: boolean): string; +} +/** + * Represents the client-side equivalent of the FileManagerFile object. + */ +interface ASPxClientFileManagerFile extends ASPxClientFileManagerItem { + /** + * Downloads a file from a file manager. + */ + Download(): void; +} +/** + * A client-side equivalent of the FileManagerFolder object. + */ +interface ASPxClientFileManagerFolder extends ASPxClientFileManagerItem { + isParentFolder: boolean; +} +/** + * A JavaScript function which receives callback data obtained by a call to the client GetAllItems method. + */ +interface ASPxClientFileManagerAllItemsCallback { + /** + * A JavaScript function which receives callback data obtained by a call to the client GetAllItems method. + * @param items An array of ASPxClientFileManagerItem objects that are items contained in the current folder. + */ + (items: ASPxClientFileManagerItem[]): void; +} +/** + * A method that will handle the client SelectedFileOpened events. + */ +interface ASPxClientFileManagerFileEventHandler { + /** + * A method that will handle the SelectedFileOpened events. + * @param source An object representing the event's source. + * @param e An ASPxClientFileManagerFileEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerFileEventArgs): void; +} +/** + * Provides data for the SelectedFileOpened events. + */ +interface ASPxClientFileManagerFileEventArgs extends ASPxClientEventArgs { + /** + * Gets a file related to the event. + * Value: An ASPxClientFileManagerFile object that represents a file currently being processed. + */ + file: ASPxClientFileManagerFile; +} +/** + * A method that will handle the client SelectedFileOpened event. + */ +interface ASPxClientFileManagerFileOpenedEventHandler { + /** + * A method that will handle the SelectedFileOpened event. + * @param source The event source. This parameter identifies the file manager object which raised the event. + * @param e An ASPxClientFileManagerFileOpenedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerFileOpenedEventArgs): void; +} +/** + * Provides data for the SelectedFileOpened event. + */ +interface ASPxClientFileManagerFileOpenedEventArgs extends ASPxClientFileManagerFileEventArgs { + /** + * Gets or sets a value that specifies whether the event should be finally processed on the server side. + * Value: true to process the event on the server side; false to completely handle it on the client side. + */ + processOnServer: boolean; +} +/** + * Serves as a base for classes that are used as arguments for events generated on the client side. + */ +interface ASPxClientFileManagerActionEventArgsBase extends ASPxClientEventArgs { + /** + * Gets the full name of the item currently being processed. + * Value: A string value that is the item's full name. + */ + fullName: string; + /** + * Gets the name of the currently processed item. + * Value: A string value that specifies the item's name. + */ + name: string; + /** + * Gets a value specifying whether the current processed item is a folder. + * Value: true if the processed item is a folder; false if the processed item is a file. + */ + isFolder: boolean; +} +/** + * A method that will handle the client ItemRenaming events. + */ +interface ASPxClientFileManagerItemEditingEventHandler { + /** + * A method that will handle the ItemRenaming events. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientFileManagerItemEditingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerItemEditingEventArgs): void; +} +/** + * Provides data for the item editing event. + */ +interface ASPxClientFileManagerItemEditingEventArgs extends ASPxClientFileManagerActionEventArgsBase { + /** + * Gets or sets a value indicating whether the action which raised the event should be canceled. + * Value: true if the action that raised the event should be canceled; otherwise, false. + */ + cancel: boolean; +} +/** + * A method that will handle the client ItemRenamed event. + */ +interface ASPxClientFileManagerItemRenamedEventHandler { + /** + * A method that will handle the ItemRenamed event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientFileManagerItemRenamedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerItemRenamedEventArgs): void; +} +/** + * Provides data for the ItemRenamed event. + */ +interface ASPxClientFileManagerItemRenamedEventArgs extends ASPxClientFileManagerActionEventArgsBase { + /** + * Gets the previous name of the renamed item. + * Value: A string value that specifies the item name. + */ + oldName: string; +} +/** + * A method that will handle the client ItemDeleted event. + */ +interface ASPxClientFileManagerItemDeletedEventHandler { + /** + * A method that will handle the ItemDeleted event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientFileManagerItemDeletedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerItemDeletedEventArgs): void; +} +/** + * Provides data for the ItemDeleted event. + */ +interface ASPxClientFileManagerItemDeletedEventArgs extends ASPxClientFileManagerActionEventArgsBase { +} +/** + * A method that will handle the client ItemsDeleted event. + */ +interface ASPxClientFileManagerItemsDeletedEventHandler { + /** + * A method that will handle the ItemsDeleted event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientFileManagerItemsDeletedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerItemsDeletedEventArgs): void; +} +/** + * Provides data for the ItemsDeleted event. + */ +interface ASPxClientFileManagerItemsDeletedEventArgs extends ASPxClientEventArgs { + /** + * Gets an array of the currently processed items. + * Value: An array of ASPxClientFileManagerItem objects that are items currently being processed. + */ + items: ASPxClientFileManagerItem[]; +} +/** + * A method that will handle the client ItemMoved event. + */ +interface ASPxClientFileManagerItemMovedEventHandler { + /** + * A method that will handle the ItemMoved event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientFileManagerItemMovedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerItemMovedEventArgs): void; +} +/** + * Provides data for the ItemMoved event. + */ +interface ASPxClientFileManagerItemMovedEventArgs extends ASPxClientFileManagerActionEventArgsBase { + /** + * Gets the full name of the folder from which an item is moved. + * Value: A string value that specifies the folder's full name. + */ + oldFolderFullName: string; +} +/** + * A method that will handle the client ItemsMoved event. + */ +interface ASPxClientFileManagerItemsMovedEventHandler { + /** + * A method that will handle the ItemsMoved event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientFileManagerItemsMovedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerItemsMovedEventArgs): void; +} +/** + * Provides data for the ItemsMoved event. + */ +interface ASPxClientFileManagerItemsMovedEventArgs extends ASPxClientEventArgs { + /** + * Gets an array of the currently processed items. + * Value: An array of ASPxClientFileManagerItem objects that are items currently being processed. + */ + items: ASPxClientFileManagerItem[]; + /** + * Gets the full name of the folder from which items are moved. + * Value: A string value that specifies the folder's full name. + */ + oldFolderFullName: string; +} +/** + * A method that will handle the client ItemCopied event. + */ +interface ASPxClientFileManagerItemCopiedEventHandler { + /** + * A method that will handle the ItemCopied event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientFileManagerItemCopiedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerItemCopiedEventArgs): void; +} +/** + * Provides data for the ItemCopied event. + */ +interface ASPxClientFileManagerItemCopiedEventArgs extends ASPxClientFileManagerActionEventArgsBase { + /** + * Gets the full name of the folder from which an item is copied. + * Value: A string value that specifies the folder's full name. + */ + oldFolderFullName: string; +} +/** + * A method that will handle the client ItemsCopied event. + */ +interface ASPxClientFileManagerItemsCopiedEventHandler { + /** + * A method that will handle the ItemsCopied event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientFileManagerItemsCopiedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerItemsCopiedEventArgs): void; +} +/** + * Provides data for the ItemsCopied event. + */ +interface ASPxClientFileManagerItemsCopiedEventArgs extends ASPxClientEventArgs { + /** + * Gets an array of the currently processed items. + * Value: An array of ASPxClientFileManagerItem objects that are items currently being processed. + */ + items: ASPxClientFileManagerItem[]; + /** + * Gets the full name of the folder from which items are copied. + * Value: A string value that specifies the folder's full name. + */ + oldFolderFullName: string; +} +/** + * A method that will handle the client FolderCreated event. + */ +interface ASPxClientFileManagerItemCreatedEventHandler { + /** + * A method that will handle the FolderCreated event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientFileManagerItemCreatedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerItemCreatedEventArgs): void; +} +/** + * Provides data for the FolderCreated event. + */ +interface ASPxClientFileManagerItemCreatedEventArgs extends ASPxClientFileManagerActionEventArgsBase { +} +/** + * A method that will handle the client ErrorOccurred event. + */ +interface ASPxClientFileManagerErrorEventHandler { + /** + * A method that will handle the client ErrorOccurred event. + * @param source An object representing the event's source. + * @param e An ASPxClientFileManagerErrorEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerErrorEventArgs): void; +} +/** + * Provides data for the ErrorOccurred event. + */ +interface ASPxClientFileManagerErrorEventArgs extends ASPxClientEventArgs { + /** + * Gets the name of the processed command. + * Value: A string value representing the processed command's name. + */ + commandName: string; + /** + * Gets or sets the error description. + * Value: A string value specifying the error description. + */ + errorText: string; + /** + * Gets or sets a value specifying whether an event error message is sent to the ErrorAlertDisplaying event. + * Value: true to sent an error message; otherwise, false. + */ + showAlert: boolean; + /** + * Gets a specifically generated code that uniquely identifies an error, which occurs while editing an item. + * Value: An integer value that specifies the code uniquely identifying an error. + */ + errorCode: number; +} +/** + * A method that will handle the client ErrorAlertDisplaying event. + */ +interface ASPxClientFileManagerErrorAlertDisplayingEventHandler { + /** + * A method that will handle the ErrorAlertDisplaying event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientFileManagerErrorAlertDisplayingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerErrorAlertDisplayingEventArgs): void; +} +/** + * Provides data for the ErrorAlertDisplaying event. + */ +interface ASPxClientFileManagerErrorAlertDisplayingEventArgs extends ASPxClientEventArgs { + /** + * Gets the name of the processed command. + * Value: A string value that is the processed command's name. + */ + commandName: string; + /** + * Gets or sets the errors description. + * Value: A string that is the errors description. + */ + errorText: string; + /** + * Gets or sets a value specifying whether an alert message is displayed when the event fires. + * Value: true to display an alert message; otherwise, false. + */ + showAlert: boolean; +} +/** + * A method that will handle the client FileUploading event. + */ +interface ASPxClientFileManagerFileUploadingEventHandler { + /** + * A method that will handle the FileUploading event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientFileManagerFileUploadingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerFileUploadingEventArgs): void; +} +/** + * Provides data for the FileUploading event. + */ +interface ASPxClientFileManagerFileUploadingEventArgs extends ASPxClientEventArgs { + /** + * Gets the path to the folder where a file is being uploaded. + * Value: A string value specifying the path where a file is being uploaded. + */ + folder: string; + /** + * Gets the name of a file selected for upload. + * Value: A string value that specifies the file name. + */ + fileName: string; + /** + * Gets or sets a value indicating whether the action which raised the event should be canceled. + * Value: true if the action that raised the event should be canceled; otherwise, false. + */ + cancel: boolean; +} +/** + * A method that will handle the client FilesUploading event. + */ +interface ASPxClientFileManagerFilesUploadingEventHandler { + /** + * A method that will handle the FilesUploading event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientFileManagerFilesUploadingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerFilesUploadingEventArgs): void; +} +/** + * Provides data for the FilesUploading event. + */ +interface ASPxClientFileManagerFilesUploadingEventArgs extends ASPxClientEventArgs { + /** + * Gets the path to the folder where files are being uploaded. + * Value: A string value specifying the folder path. + */ + folder: string; + /** + * Gets the names of files selected for upload. + * Value: An array of string values that are the file names. + */ + fileNames: string[]; + /** + * Gets or sets a value indicating whether the action which raised the event should be canceled. + * Value: true if the action that raised the event should be canceled; otherwise, false. + */ + cancel: boolean; +} +/** + * A method that will handle the client FileUploaded event. + */ +interface ASPxClientFileManagerFileUploadedEventHandler { + /** + * A method that will handle the FileUploaded event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientFileManagerFileUploadedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerFileUploadedEventArgs): void; +} +/** + * Provides data for the FileUploaded event. + */ +interface ASPxClientFileManagerFileUploadedEventArgs extends ASPxClientEventArgs { + /** + * Gets the path to the folder where a file is uploaded. + * Value: A string value specifying the uploaded file path. + */ + folder: string; + /** + * Gets the name of the uploaded file. + * Value: A string value that specifies the file name. + */ + fileName: string; +} +/** + * A method that will handle the client FilesUploaded event. + */ +interface ASPxClientFileManagerFilesUploadedEventHandler { + /** + * A method that will handle the FilesUploaded event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientFileManagerFilesUploadedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerFilesUploadedEventArgs): void; +} +/** + * Provides data for the FilesUploaded event. + */ +interface ASPxClientFileManagerFilesUploadedEventArgs extends ASPxClientEventArgs { + /** + * Gets the path to the folder where files are uploaded. + * Value: A string value specifying the uploaded files path. + */ + folder: string; + /** + * Gets an array of uploaded file names. + * Value: An array of string values that are the file names. + */ + fileNames: string[]; +} +/** + * A method that will handle the client FileDownloading event. + */ +interface ASPxClientFileManagerFileDownloadingEventHandler { + /** + * A method that will handle the FileDownloading event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientFileManagerFileDownloadingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerFileDownloadingEventArgs): void; +} +/** + * Provides data for the FileDownloading event. + */ +interface ASPxClientFileManagerFileDownloadingEventArgs extends ASPxClientFileManagerFileEventArgs { + /** + * Gets or sets a value indicating whether the action which raised the event, should be canceled. + * Value: true, if the action that raised the event should be canceled; otherwise, false. + */ + cancel: boolean; +} +/** + * A method that will handle the client FocusedItemChanged event. + */ +interface ASPxClientFileManagerFocusedItemChangedEventHandler { + /** + * A method that will handle the FocusedItemChanged event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientFileManagerFocusedItemChangedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerFocusedItemChangedEventArgs): void; +} +/** + * Provides data for the FocusedItemChanged event. + */ +interface ASPxClientFileManagerFocusedItemChangedEventArgs extends ASPxClientEventArgs { + /** + * Gets the file manager item object related to the event. + * Value: An object, manipulations on which forced the event to be raised. + */ + item: ASPxClientFileManagerItem; + /** + * Gets the name of the focused item. + * Value: A string value that specifies the item's name. + */ + name: string; + /** + * Gets the full name of the item currently being processed. + * Value: A string value that is the item's full name. + */ + fullName: string; +} +/** + * A method that will handle the client CurrentFolderChanged event. + */ +interface ASPxClientFileManagerCurrentFolderChangedEventHandler { + /** + * A method that will handle the CurrentFolderChanged event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientFileManagerCurrentFolderChangedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerCurrentFolderChangedEventArgs): void; +} +/** + * Provides data for the CurrentFolderChanged event. + */ +interface ASPxClientFileManagerCurrentFolderChangedEventArgs extends ASPxClientEventArgs { + /** + * Gets the name of the currently processed folder. + * Value: A string value that specifies the folder's name. + */ + name: string; + /** + * Gets the full name of the folder currently being processed. + * Value: A string value that is the folder's full name. + */ + fullName: string; +} +/** + * A method that will handle the client SelectionChanged event. + */ +interface ASPxClientFileManagerSelectionChangedEventHandler { + /** + * A method that will handle the SelectionChanged event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientFileManagerSelectionChangedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerSelectionChangedEventArgs): void; +} +/** + * Provides data for the SelectionChanged event. + */ +interface ASPxClientFileManagerSelectionChangedEventArgs extends ASPxClientEventArgs { + /** + * Gets the file manager item object related to the event. + * Value: An object, manipulations on which forced the event to be raised. + */ + item: ASPxClientFileManagerItem; + /** + * Gets the name of the currently processed file. + * Value: A string value that specifies the file's name. + */ + name: string; + /** + * Gets the full name of the file currently being processed. + * Value: A string value that is the file's full name. + */ + fullName: string; + /** + * Gets whether the item has been selected. + * Value: true if the file has been selected; otherwise, false. + */ + isSelected: boolean; +} +/** + * A method that will handle the CustomCommand event. + */ +interface ASPxClientFileManagerCustomCommandEventHandler { + /** + * A method that will handle the CustomCommand event. + * @param source The event source. + * @param e An ASPxClientFileManagerCustomCommandEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerCustomCommandEventArgs): void; +} +/** + * Provides data for the CustomCommand event. + */ +interface ASPxClientFileManagerCustomCommandEventArgs extends ASPxClientEventArgs { + /** + * Gets the name of the processed command. + * Value: A string value that is the processed command's name. + */ + commandName: string; +} +/** + * A method that will handle the ToolbarUpdating event. + */ +interface ASPxClientFileManagerToolbarUpdatingEventHandler { + /** + * A method that will handle the ToolbarUpdating event. + * @param source The event source. + * @param e An ASPxClientFileManagerToolbarUpdatingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerToolbarUpdatingEventArgs): void; +} +/** + * Provides data for the ToolbarUpdating event. + */ +interface ASPxClientFileManagerToolbarUpdatingEventArgs extends ASPxClientEventArgs { + /** + * Gets the name of the currently active file manager area. + * Value: A string value that identifies the active area. + */ + activeAreaName: string; +} +/** + * A method that will handle the client HighlightItemTemplate event. + */ +interface ASPxClientFileManagerHighlightItemTemplateEventHandler { + /** + * A method that will handle the HighlightItemTemplate event. + * @param source The event source. This parameter identifies the file manager object that raised the event. + * @param e An ASPxClientFileManagerHighlightItemTemplateEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerHighlightItemTemplateEventArgs): void; +} +/** + * Provides data for the HighlightItemTemplate event. + */ +interface ASPxClientFileManagerHighlightItemTemplateEventArgs extends ASPxClientEventArgs { + /** + * Gets a string that is a filter value specified by the filter box. + * Value: A string that is a filter value. + */ + filterValue: string; + /** + * Gets the name of the item currently being processed. + * Value: A string that is the item name. + */ + itemName: string; + /** + * Gets an element containing the item template. + * Value: An object that is an element containing the item template. + */ + templateElement: string; + /** + * Get the name of the cascading style sheet (CSS) class associated with an item in the highlighted state. + * Value: A string that is the name of a CSS class. + */ + highlightCssClassName: string; +} +/** + * Represents a client-side equivalent of the menu's MenuItem object. + */ +interface ASPxClientMenuItem { + /** + * Gets the menu object to which the current item belongs. + * Value: An ASPxClientMenuBase object representing the menu to which the item belongs. + */ + menu: ASPxClientMenuBase; + /** + * Gets the immediate parent item to which the current item belongs. + * Value: An ASPxClientMenuItem object representing the item's immediate parent. + */ + parent: ASPxClientMenuItem; + /** + * Gets the item's index within the parent's collection of items. + * Value: An integer value representing the item's zero-based index within the Items collection of the parent object (a menu or item) to which the item belongs. + */ + index: number; + /** + * Gets the name that uniquely identifies the menu item. + * Value: A string value that represents the value assigned to the item's Name property. + */ + name: string; + /** + * For internal use only. + */ + indexPath: string; + /** + * Returns the number of the current menu item's immediate child items. + */ + GetItemCount(): number; + /** + * Returns the current menu item's immediate subitem specified by its index. + * @param index An integer value specifying the zero-based index of the submenu item to be retrieved. + */ + GetItem(index: number): ASPxClientMenuItem; + /** + * Returns the current menu item's subitem specified by its name. + * @param name A string value specifying the name of the menu item. + */ + GetItemByName(name: string): ASPxClientMenuItem; + /** + * Indicates whether the menu item is checked. + */ + GetChecked(): boolean; + /** + * Specifies whether the menu item is checked. + * @param value true if the menu item is checked; otherwise, false. + */ + SetChecked(value: boolean): void; + /** + * Returns a value specifying whether a menu item is enabled. + */ + GetEnabled(): boolean; + /** + * Specifies whether the menu item is enabled. + * @param value true to enable the menu item; otherwise, false. + */ + SetEnabled(value: boolean): void; + /** + * Returns the URL pointing to the image displayed within the menu item. + */ + GetImageUrl(): string; + /** + * Sets the URL which points to the image displayed within the menu item. + * @param value A string value specifying the URL to the image displayed within the menu item. + */ + SetImageUrl(value: string): void; + /** + * Gets a URL which defines the navigation location for the menu item. + */ + GetNavigateUrl(): string; + /** + * Specifies a URL which defines the navigation location for the menu item. + * @param value A string value which specifies a URL to where the client web browser will navigate when the menu item is clicked. + */ + SetNavigateUrl(value: string): void; + /** + * Returns text displayed within the menu item. + */ + GetText(): string; + /** + * Sets the text to be displayed within the menu item. + * @param value A string value specifying the text to be displayed within the menu item. + */ + SetText(value: string): void; + /** + * Returns a value specifying whether a menu item is displayed. + */ + GetVisible(): boolean; + /** + * Specifies the menu item's visibility. + * @param value true if the menu item is visible; otherwise, false. + */ + SetVisible(value: boolean): void; +} +/** + * A client-side equivalent of the file manager's FileManagerToolbarItemBase object. + */ +interface ASPxClientFileManagerToolbarItem extends ASPxClientMenuItem { + /** + * This property is not in effect for the ASPxClientFileManagerToolbarItem class. + */ + menu: ASPxClientMenuBase; + /** + * This property is not in effect for the ASPxClientFileManagerToolbarItem class. + */ + parent: ASPxClientMenuItem; + /** + * This property is not in effect for the ASPxClientFileManagerToolbarItem class. + */ + index: number; +} +/** + * A client-side equivalent of the ASPxFormLayout's LayoutItem object. + */ +interface ASPxClientLayoutItem { + /** + * Gets the form layout object to which the current item belongs. + * Value: An object representing the form layout to which the item belongs. + */ + formLayout: ASPxClientFormLayout; + /** + * Gets the name that uniquely identifies the layout item. + * Value: A string value that represents the value assigned to the layout item's Name property. + */ + name: string; + /** + * Gets the immediate parent layout item to which the current layout item belongs. + * Value: An object representing the item's immediate parent. + */ + parent: ASPxClientLayoutItem; + /** + * Returns the current layout item's subitem specified by its name. + * @param name A string value specifying the name of the layout item. + */ + GetItemByName(name: string): ASPxClientLayoutItem; + /** + * Returns a value specifying whether a layout item is displayed. + */ + GetVisible(): boolean; + /** + * Specifies the layout item's visibility. + * @param value true, if the layout item is visible; otherwise, false. + */ + SetVisible(value: boolean): void; + /** + * Specifies the text displayed in the layout item caption. + * @param caption A string value specifying the item caption. + */ + SetCaption(caption: string): void; + /** + * Returns the text displayed in the layout item caption. + */ + GetCaption(): string; +} +/** + * Represents a client-side equivalent of the ASPxFormLayout object. + */ +interface ASPxClientFormLayout extends ASPxClientControl { + /** + * Returns an item specified by its name. + * @param name A string value specifying the name of the item. + */ + GetItemByName(name: string): ASPxClientLayoutItem; +} +/** + * Represents a client-side equivalent of the ASPxGlobalEvents component. + */ +interface ASPxClientGlobalEvents { + /** + * Occurs on the client side after client object models of all DevExpress web controls contained within the page have been initialized. + */ + ControlsInitialized: ASPxClientEvent>; + /** + * Occurs when the browser window is being resized. + */ + BrowserWindowResized: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated by any DevExpress control. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side, after server-side processing of a callback initiated by any DevExpress web control, has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by any of DevExpress web controls. + */ + CallbackError: ASPxClientEvent>; + /** + * Occurs on the client side after the validation initiated for a DevExpress web control (or a group of DevExpress web controls) has been completed. + */ + ValidationCompleted: ASPxClientEvent>; +} +/** + * Represents a client-side equivalent of the ASPxHiddenField control. + */ +interface ASPxClientHiddenField extends ASPxClientControl { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientHiddenField. + */ + CallbackError: ASPxClientEvent>; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(parameter: string): void; + /** + * Adds a new value to the control's collection of property name/value pairs, on the client side. + * @param propertyName A string value that specifies the property name. It can contain letters, digits, underline characters, and dollar signs. It cannot begin with a digit character. + * @param propertyValue An object that represents the value of the specified property. + */ + Add(propertyName: string, propertyValue: Object): void; + /** + * Returns the value with the specified property name. + * @param propertyName A string value that specifies the property name. + */ + Get(propertyName: string): Object; + /** + * Adds a new value to the control's collection of property name/value pairs, on the client side. + * @param propertyName A string value that specifies the property name. It can contain letters, digits, underline characters, and dollar signs. It cannot begin with a digit character. + * @param propertyValue An object that represents the property value. + */ + Set(propertyName: string, propertyValue: Object): void; + /** + * Removes the specified value from the ASPxHiddenField collection. + * @param propertyName A string value representing the property name. + */ + Remove(propertyName: string): void; + /** + * Clears the ASPxHiddenField's value collection. + */ + Clear(): void; + /** + * Returns a value indicating whether the value with the specified property name is contained within the ASPxHiddenField control's value collection. + * @param propertyName A string value that specifies the property name. + */ + Contains(propertyName: string): boolean; +} +/** + * The client-side equivalent of the ASPxImageGallery control. + */ +interface ASPxClientImageGallery extends ASPxClientDataView { + /** + * Fires on the client side before the fullscreen viewer is shown and allows you to cancel the action. + */ + FullscreenViewerShowing: ASPxClientEvent>; + /** + * Occurs on the client side after an active item has been changed within the fullscreen viewer. + */ + FullscreenViewerActiveItemIndexChanged: ASPxClientEvent>; + /** + * Shows the fullscreen viewer with the specified active item. + * @param index An Int32 value that is an index of the active item. + */ + ShowFullscreenViewer(index: number): void; + /** + * Hides the fullscreen viewer. + */ + HideFullscreenViewer(): void; + /** + * Makes the specified item active within the fullscreen viewer on the client side. + * @param index An integer value specifying the index of the item to select. + * @param preventAnimation true to prevent the animation effect; false to change images using animation. + */ + SetFullscreenViewerActiveItemIndex(index: number, preventAnimation: boolean): void; + /** + * Gets the number of items contained in the control's item collection. + */ + GetFullscreenViewerItemCount(): number; + /** + * Returns the index of the active item within the fullscreen viewer. + */ + GetFullscreenViewerActiveItemIndex(): number; + /** + * Plays a slide show within a fullscreen viewer. + */ + PlaySlideShow(): void; + /** + * Pauses a slide show within a fullscreen viewer. + */ + PauseSlideShow(): void; +} +/** + * A method that will handle the client FullscreenViewerShowing event. + */ +interface ASPxClientImageGalleryCancelEventHandler { + /** + * A method that will handle the FullscreenViewerShowing event. + * @param source The event source. Identifies the ASPxImageGallery control that raised the event. + * @param e An ASPxClientImageGalleryCancelEventArgs object that contains event data. + */ + (source: S, e: ASPxClientImageGalleryCancelEventArgs): void; +} +/** + * Provides data for the FullscreenViewerShowing event. + */ +interface ASPxClientImageGalleryCancelEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the index of the item related to the event. + * Value: An value that is the related item's index. + */ + index: number; + /** + * Gets the unique identifier name of the item related to the event. + * Value: A string value that specifies the item's unique identifier name. + */ + name: string; +} +/** + * A method that will handle the client FullscreenViewerActiveItemIndexChanged event. + */ +interface ASPxClientImageGalleryFullscreenViewerEventHandler { + /** + * A method that will handle the FullscreenViewerActiveItemIndexChanged event. + * @param source The event source. Identifies the ASPxImageGallery control that raised the event. + * @param e An ASPxClientImageGalleryFullscreenViewerEventArgs object that contains event data. + */ + (source: S, e: ASPxClientImageGalleryFullscreenViewerEventArgs): void; +} +/** + * Provides data for the FullscreenViewerActiveItemIndexChanged event. + */ +interface ASPxClientImageGalleryFullscreenViewerEventArgs extends ASPxClientEventArgs { + /** + * Gets the index of the item related to the event. + * Value: An value that is the related item's index. + */ + index: number; + /** + * Gets the unique identifier name of the item related to the event. + * Value: A string value that specifies the item's unique identifier name. + */ + name: string; +} +/** + * A client-side equivalent of the ASPxImageSlider object. + */ +interface ASPxClientImageSlider extends ASPxClientControl { + /** + * Occurs after the active image, displayed within the image area, is changed. + */ + ActiveItemChanged: ASPxClientEvent>; + /** + * Fires after an image item has been clicked within the image area. + */ + ItemClick: ASPxClientEvent>; + /** + * Occurs on the client side when a thumbnail is clicked. + */ + ThumbnailItemClick: ASPxClientEvent>; + /** + * Returns an item specified by its index within the image slider's item collection. + * @param index An integer value specifying the zero-based index of the item to be retrieved. + */ + GetItem(index: number): ASPxClientImageSliderItem; + /** + * Returns an item specified by its name. + * @param name A string value specifying the name of the item. + */ + GetItemByName(name: string): ASPxClientImageSliderItem; + /** + * Returns the index of the active item within the image slider control. + */ + GetActiveItemIndex(): number; + /** + * Makes the specified item active within the image slider control on the client side. + * @param index An integer value specifying the index of the item to select. + * @param preventAnimation true to prevent the animation effect; false to change images using animation. + */ + SetActiveItemIndex(index: number, preventAnimation: boolean): void; + /** + * Returns the active item within the ASPxImageSlider control. + */ + GetActiveItem(): ASPxClientImageSliderItem; + /** + * Makes the specified item active within the image slider control on the client side. + * @param item An ASPxClientImageSliderItem object specifying the item to select. + * @param preventAnimation true to prevent animation effect; false to enable animation. + */ + SetActiveItem(item: ASPxClientImageSliderItem, preventAnimation: boolean): void; + /** + * Gets the number of items contained in the control's item collection. + */ + GetItemCount(): number; + /** + * Sets input focus to the ASPxImageSlider control. + */ + Focus(): void; + /** + * Plays a slide show within an image slider. + */ + Play(): void; + /** + * Pauses a slide show within image slider. + */ + Pause(): void; + /** + * Gets a value indicating whether the slide show is playing. + */ + IsSlideShowPlaying(): boolean; +} +/** + * A method that will handle the ItemClick events. + */ +interface ASPxClientImageSliderItemEventHandler { + /** + * A method that will handle the ItemClick events. + * @param source The event source. Identifies the ASPxImageSlider control that raised the event. + * @param e An ASPxClientImageSliderItemEventArgs object that contains event data. + */ + (source: S, e: ASPxClientImageSliderItemEventArgs): void; +} +/** + * Provides data for the ItemClick events. + */ +interface ASPxClientImageSliderItemEventArgs extends ASPxClientEventArgs { + /** + * Gets an item object related to the event. + * Value: An object, manipulations on which forced the event to be raised. + */ + item: ASPxClientImageSliderItem; +} +/** + * A client-side equivalent of the image slider's ImageSliderItem object. + */ +interface ASPxClientImageSliderItem { + /** + * Gets an image slider to which the current item belongs. + * Value: An object that is the item's owner. + */ + imageSlider: ASPxClientImageSlider; + /** + * Gets the item's index within an items collection. + * Value: An integer value is the item's zero-based index within the Items collection. + */ + index: number; + /** + * Gets the name that uniquely identifies the image slider item. + * Value: A string value that is the value assigned to the item's Name property. + */ + name: string; + /** + * Gets or sets the path to the image displayed within the ASPxClientImageSliderItem. + * Value: A value specifying the path to the image. + */ + imageUrl: string; + /** + * Gets the item's display text. + * Value: A string value that is the item's display text. + */ + text: string; +} +/** + * The client-side equivalent of the ASPxImageZoomNavigator object. + */ +interface ASPxClientImageZoomNavigator extends ASPxClientImageSlider { +} +/** + * A client-side equivalent of the ASPxImageZoom object. + */ +interface ASPxClientImageZoom extends ASPxClientControl { + /** + * Sets the properties on an image displayed in the image zoom control. + * @param imageUrl A string value specifying the path to the preview image displayed in the preview image. + * @param largeImageUrl A string value specifying the path to the preview image displayed in the zoom window and the expand window. + * @param zoomWindowText A string value specifying the text displayed in the zoom window. + * @param expandWindowText A string value specifying the text displayed in the expand window. + * @param alternateText A string value that specifies the alternate text displayed instead of the image. + */ + SetImageProperties(imageUrl: string, largeImageUrl: string, zoomWindowText: string, expandWindowText: string, alternateText: string): void; +} +/** + * Represents a client-side equivalent of the ASPxLoadingPanel control. + */ +interface ASPxClientLoadingPanel extends ASPxClientControl { + /** + * Invokes the loading panel. + */ + Show(): void; + /** + * Invokes the loading panel, displaying it over the specified HTML element. + * @param htmlElement An object that specifies the required HTML element. + */ + ShowInElement(htmlElement: Object): void; + /** + * Invokes the loading panel, displaying it over the specified element. + * @param id A string that specifies the required element's identifier. + */ + ShowInElementByID(id: string): void; + /** + * Invokes the loading panel at the specified position. + * @param x An integer value specifying the x-coordinate of the loading panel's display position. + * @param y An integer value specifying the y-coordinate of the loaidng panel's display position. + */ + ShowAtPos(x: number, y: number): void; + /** + * Sets the text to be displayed within the ASPxLoadingPanel. + * @param text A string value specifying the text to be displayed within the ASPxLoadingPanel. + */ + SetText(text: string): void; + /** + * Gets the text displayed within the ASPxLoadingPanel. + */ + GetText(): string; + /** + * Hides the loading panel. + */ + Hide(): void; +} +/** + * Serves as the base type for the ASPxClientPopupMenu objects. + */ +interface ASPxClientMenuBase extends ASPxClientControl { + /** + * Fires after a menu item has been clicked. + */ + ItemClick: ASPxClientEvent>; + /** + * Occurs on the client side when the mouse cursor is moved into a menu item. + */ + ItemMouseOver: ASPxClientEvent>; + /** + * Occurs on the client side when the mouse cursor moves outside a menu item. + */ + ItemMouseOut: ASPxClientEvent>; + /** + * Occurs on the client side when a submenu pops up. + */ + PopUp: ASPxClientEvent>; + /** + * Occurs on the client side when a submenu closes. + */ + CloseUp: ASPxClientEvent>; + /** + * Returns the number of menu items at the root menu level. + */ + GetItemCount(): number; + /** + * Returns the menu's root menu item specified by its index. + * @param index An integer value specifying the zero-based index of the root menu item to be retrieved. + */ + GetItem(index: number): ASPxClientMenuItem; + /** + * Returns a menu item specified by its name. + * @param name A string value specifying the name of the menu item. + */ + GetItemByName(name: string): ASPxClientMenuItem; + /** + * Returns the selected item within the menu control. + */ + GetSelectedItem(): ASPxClientMenuItem; + /** + * Selects the specified menu item within a menu control on the client side. + * @param item An ASPxClientMenuItem object specifying the menu item to select. + */ + SetSelectedItem(item: ASPxClientMenuItem): void; + /** + * Returns a root menu item. + */ + GetRootItem(): ASPxClientMenuItem; +} +/** + * Represents a client collection that maintains client menu objects. + */ +interface ASPxClientMenuCollection extends ASPxClientControlCollection { + RecalculateAll(): void; + /** + * Hides all menus maitained by the collection. + */ + HideAll(): void; +} +/** + * Represents a client-side equivalent of the ASPxMenu object. + */ +interface ASPxClientMenu extends ASPxClientMenuBase { + /** + * Gets a value specifying the menu orientation. + */ + GetOrientation(): string; + /** + * Sets the menu orientation. + * @param orientation 'Vertical' to orient the menu vertically; 'Horizontal' to orient the menu horizontally. + */ + SetOrientation(orientation: string): void; +} +/** + * A method that will handle the menu's client events concerning manipulations with an item. + */ +interface ASPxClientMenuItemEventHandler { + /** + * A method that will handle the menu's client events concerning manipulations with an item. + * @param source The event source. This parameter identifies the menu object which raised the event. + * @param e An ASPxClientMenuItemEventArgs object that contains event data. + */ + (source: S, e: ASPxClientMenuItemEventArgs): void; +} +/** + * Provides data for events which concern manipulations on menu items. + */ +interface ASPxClientMenuItemEventArgs extends ASPxClientEventArgs { + /** + * Gets the menu item object related to the event. + * Value: An ASPxClientMenuItem object, manipulations on which forced the event to be raised. + */ + item: ASPxClientMenuItem; +} +/** + * A method that will handle client events which relate to mouse hovering (such as entering or leaving) over menu items. + */ +interface ASPxClientMenuItemMouseEventHandler { + /** + * A method that will handle the ItemMouseOver events. + * @param source An object representing the event source. + * @param e A MenuItemEventArgs object that contains event data. + */ + (source: S, e: ASPxClientMenuItemMouseEventArgs): void; +} +/** + * Provides data for client events which relate to mouse hovering (such as entering or leaving) over menu items. + */ +interface ASPxClientMenuItemMouseEventArgs extends ASPxClientMenuItemEventArgs { + /** + * Gets the HTML object that contains the processed item. + * Value: An HTML object representing a container for the item related to the event. + */ + htmlElement: Object; +} +/** + * A method that will handle client events concerning clicks on the control's items. + */ +interface ASPxClientMenuItemClickEventHandler { + /** + * A method that will handle client ItemClick events. + * @param source An object representing the event source. + * @param e A MenuItemEventArgs object that contains event data. + */ + (source: S, e: ASPxClientMenuItemClickEventArgs): void; +} +/** + * Provides data for events which concern clicking on the control's items. + */ +interface ASPxClientMenuItemClickEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the menu item object related to the event. + * Value: An ASPxClientMenuItem object, manipulations on which forced the event to be raised. + */ + item: ASPxClientMenuItem; + /** + * Gets the HTML object that contains the processed item. + * Value: An object representing a container for the item related to the event. + */ + htmlElement: Object; + /** + * Gets a DHTML event object that relates to the processed event. + * Value: An object that maintains DHTML event-specific information. + */ + htmlEvent: Object; +} +/** + * Contains options affecting the touch scrolling functionality. + */ +interface ASPxClientTouchUIOptions { + /** + * Gets or sets a value that specifies whether or not the horizontal scroll bar should be displayed. + * Value: true to display the horizontal scroll bar; otherwise, false. The default value is true. + */ + showHorizontalScrollbar: boolean; + /** + * Gets or sets a value that specifies whether or not the vertical scroll bar should be displayed. + * Value: true to display the vertical scroll bar; otherwise, false. The default value is true. + */ + showVerticalScrollbar: boolean; + /** + * Gets or sets the name of the CSS class defining the vertical scroll bar's appearance. + * Value: A string value specifying the class name. + */ + vScrollClassName: string; + /** + * Gets or sets the name of the CSS class defining the horizontal scroll bar's appearance. + * Value: A string value specifying the class name. + */ + hScrollClassName: string; +} +/** + * Contains a method allowing you to apply the current scroll extender to a specific element. + */ +interface ScrollExtender { + /** + * Applies the current scroll extender to the element specified by the ID. + * @param id A string value specifying the element's ID. + */ + ChangeElement(id: string): void; + /** + * Applies the current scroll extender to the specified DOM element. + * @param element An object specifying the required DOM element. + */ + ChangeElement(element: Object): void; +} +/** + * Represents a client-side equivalent of the ASPxNavBar control. + */ +interface ASPxClientNavBar extends ASPxClientControl { + /** + * Fires after an item has been clicked. + */ + ItemClick: ASPxClientEvent>; + /** + * Fires on the client side after a group's expansion state has been changed. + */ + ExpandedChanged: ASPxClientEvent>; + /** + * Fires on the client side before the expansion state of a group is changed. + */ + ExpandedChanging: ASPxClientEvent>; + /** + * Fires when a group header is clicked. + */ + HeaderClick: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientNavBar. + */ + CallbackError: ASPxClientEvent>; + /** + * Returns the number of groups in the navbar. + */ + GetGroupCount(): number; + /** + * Returns a group specified by its index. + * @param index An integer value specifying the zero-based index of the group object to retrieve. + */ + GetGroup(index: number): ASPxClientNavBarGroup; + /** + * Returns a group specified by its name. + * @param name A string value specifying the name of the group. + */ + GetGroupByName(name: string): ASPxClientNavBarGroup; + /** + * Returns the navbar's active group. + */ + GetActiveGroup(): ASPxClientNavBarGroup; + /** + * Makes the specified group active. + * @param group A ASPxClientNavBarGroup object that specifies the active group. + */ + SetActiveGroup(group: ASPxClientNavBarGroup): void; + /** + * Returns an item specified by its name. + * @param name A string value specifying the name of the item. + */ + GetItemByName(name: string): ASPxClientNavBarItem; + /** + * Returns the selected item within the navbar control. + */ + GetSelectedItem(): ASPxClientNavBarItem; + /** + * Selects the specified item within the navbar control on the client side. + * @param item An ASPxClientNavBarItem object specifying the item to select. + */ + SetSelectedItem(item: ASPxClientNavBarItem): void; + /** + * Collapses all groups of the navbar. + */ + CollapseAll(): void; + /** + * Expands all groups of the navbar. + */ + ExpandAll(): void; +} +/** + * Represents a client-side equivalent of the navbar's NavBarGroup object. + */ +interface ASPxClientNavBarGroup { + /** + * Gets the navbar to which the current group belongs. + * Value: An ASPxClientNavBar object representing the navbar to which the group belongs. + */ + navBar: ASPxClientNavBar; + /** + * Gets the group's index within a collection of a navbar's groups. + * Value: An integer value representing the group's zero-based index within the Groups collection of the navbar to which the group belongs. + */ + index: number; + /** + * Gets the name that uniquely identifies the group. + * Value: A string value that represents the value assigned to the group's Name property. + */ + name: string; + /** + * Returns a value specifying whether a group is enabled. + */ + GetEnabled(): boolean; + /** + * Returns a value specifying whether the group is expanded. + */ + GetExpanded(): boolean; + /** + * Sets the group's expansion state. + * @param value true to expand the group; false to collapse the group. + */ + SetExpanded(value: boolean): void; + /** + * Returns a value specifying whether a group is displayed. + */ + GetVisible(): boolean; + /** + * Returns text displayed within a group. + */ + GetText(): string; + /** + * Specifies the text displayed within a group. + * @param text A string value that is the text displayed within the navbar group. + */ + SetText(text: string): void; + /** + * Specifies whether the group is visible. + * @param value true if the group is visible; otherwise, false. + */ + SetVisible(value: boolean): void; + /** + * Returns the number of items in the group. + */ + GetItemCount(): number; + /** + * Returns the group's item specified by its index. + * @param index An integer value specifying the zero-based index of the item to be retrieved. + */ + GetItem(index: number): ASPxClientNavBarItem; + /** + * Returns a group item specified by its name. + * @param name A string value specifying the name of the item. + */ + GetItemByName(name: string): ASPxClientNavBarItem; +} +/** + * Represents a client-side equivalent of the navbar's NavBarItem object. + */ +interface ASPxClientNavBarItem { + /** + * Gets the navbar to which the current item belongs. + * Value: An ASPxClientNavBar object representing the navbar to which the item belongs. + */ + navBar: ASPxClientNavBar; + /** + * Gets the group to which the current item belongs. + * Value: An ASPxClientNavBarGroup object representing the group to which the item belongs. + */ + group: ASPxClientNavBarGroup; + /** + * Gets the item's index within a collection of a group's items. + * Value: An integer value representing the item's zero-based index within the Items collection of the group to which the item belongs. + */ + index: number; + /** + * Gets the name that uniquely identifies the item. + * Value: A string value that represents the value assigned to the item's Name property. + */ + name: string; + /** + * Returns a value indicating whether an item is enabled. + */ + GetEnabled(): boolean; + /** + * Specifies whether the item is enabled. + * @param value true if the item is enabled; otherwise, false. + */ + SetEnabled(value: boolean): void; + /** + * Returns the URL which points to the image displayed within the item. + */ + GetImageUrl(): string; + /** + * Specifies the URL which points to the image displayed within the item. + * @param value A string value that specifies the URL to the image displayed within the item. + */ + SetImageUrl(value: string): void; + /** + * Gets an URL which defines the item's navigation location. + */ + GetNavigateUrl(): string; + /** + * Specifies a URL which defines the item's navigation location. + * @param value A string value which represents the URL to where the client web browser will navigate when the item is clicked. + */ + SetNavigateUrl(value: string): void; + /** + * Returns text displayed within the item. + */ + GetText(): string; + /** + * Specifies the text displayed within the item. + * @param value A string value that represents the text displayed within the item. + */ + SetText(value: string): void; + /** + * Returns a value specifying whether an item is displayed. + */ + GetVisible(): boolean; + /** + * Specifies whether the item is visible. + * @param value true is the item is visible; otherwise, false. + */ + SetVisible(value: boolean): void; +} +/** + * A method that will handle the navbar's client events concerning manipulations with an item. + */ +interface ASPxClientNavBarItemEventHandler { + /** + * A method that will handle the navbar's client events concerning manipulations with an item. + * @param source An object representing the event's source. Identifies the navbar object that raised the event. + * @param e An ASPxClientNavBarItemEventArgs object that contains event data. + */ + (source: S, e: ASPxClientNavBarItemEventArgs): void; +} +/** + * Provides data for events which concern manipulations on items. + */ +interface ASPxClientNavBarItemEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the item object related to the event. + * Value: An ASPxClientNavBarItem object, manipulations on which forced the event to be raised. + */ + item: ASPxClientNavBarItem; + /** + * Gets the HTML object that contains the processed navbar item. + * Value: An object representing a container for the navbar item related to the event. + */ + htmlElement: Object; + /** + * Gets a DHTML event object that relates to the processed event. + * Value: An object that maintains DHTML event-specific information. + */ + htmlEvent: Object; +} +/** + * A method that will handle the navbar's client events concerning manipulations with a group. + */ +interface ASPxClientNavBarGroupEventHandler { + /** + * A method that will handle the navbar's client events concerning manipulations with a group. + * @param source An object representing the event's source. Identifies the navbar object that raised the event. + * @param e An ASPxClientNavBarGroupEventArgs object that contains event data. + */ + (source: S, e: ASPxClientNavBarGroupEventArgs): void; +} +/** + * Provides data for events which concern manipulations on groups. + */ +interface ASPxClientNavBarGroupEventArgs extends ASPxClientEventArgs { + /** + * Gets the group object related to the event. + * Value: An ASPxClientNavBarGroup object, manipulations on which forced the event to be raised. + */ + group: ASPxClientNavBarGroup; +} +/** + * A method that will handle the navbar's cancelable client events concerning manipulations with a group. + */ +interface ASPxClientNavBarGroupCancelEventHandler { + /** + * A method that will handle the navbar's cancelable client events concerning manipulations with a group. + * @param source An object representing the event's source. Identifies the navbar object that raised the event. + * @param e An ASPxClientNavBarGroupCancelEventArgs object that contains event data. + */ + (source: S, e: ASPxClientNavBarGroupCancelEventArgs): void; +} +/** + * Provides data for cancellable events which concern manipulations on groups. + */ +interface ASPxClientNavBarGroupCancelEventArgs extends ASPxClientProcessingModeCancelEventArgs { + /** + * Gets the group object related to the event. + * Value: An ASPxClientNavBarGroup object representing the group manipulations on which forced the navbar to raise the event. + */ + group: ASPxClientNavBarGroup; +} +/** + * A method that will handle client events concerning clicks on the control's group headers. + */ +interface ASPxClientNavBarGroupClickEventHandler { + /** + * A method that will handle the navbar's client events concerning clicks on groups. + * @param source The event source. This parameter identifies the navbar object which raised the event. + * @param e An ASPxClientNavBarGroupClickEventArgs object that contains event data. + */ + (source: S, e: ASPxClientNavBarGroupClickEventArgs): void; +} +/** + * Provides data for events which concern clicking on the control's group headers. + */ +interface ASPxClientNavBarGroupClickEventArgs extends ASPxClientNavBarGroupCancelEventArgs { + /** + * Gets the HTML object that contains the processed group. + * Value: An object representing a container for the group related to the event. + */ + htmlElement: Object; + /** + * Gets a DHTML event object that relates to the processed event. + * Value: An object that maintains DHTML event-specific information. + */ + htmlEvent: Object; +} +/** + * Represents a client-side equivalent of the ASPxNewsControl object. + */ +interface ASPxClientNewsControl extends ASPxClientDataView { + /** + * Fires after an item's tail has been clicked. + */ + TailClick: ASPxClientEvent>; +} +/** + * A method that will handle client events concerning manipulations with an item. + */ +interface ASPxClientNewsControlItemEventHandler { + /** + * A method that will handle the news control's client events concerning manipulations with an item. + * @param source An object representing the event's source. Identifies the news control object that raised the event. + * @param e An ASPxClientNewsControlItemEventArgs object that contains event data. + */ + (source: S, e: ASPxClientNewsControlItemEventArgs): void; +} +/** + * Provides data for events which concern tail clicking within the control's items. + */ +interface ASPxClientNewsControlItemEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the name that uniquely identifies the processed item. + * Value: A string value that represents the value assigned to the processed item's Name property. + */ + name: Object; + /** + * Gets the HTML object that contains the processed item. + * Value: An object representing a container for the item related to the event. + */ + htmlElement: Object; + /** + * Gets a DHTML event object that relates to the processed event. + * Value: An object that maintains DHTML event-specific information. + */ + htmlEvent: Object; +} +/** + * Represents a client-side equivalent of the ASPxObjectContainer control. + */ +interface ASPxClientObjectContainer extends ASPxClientControl { + /** + * Occurs on the client side when the FSCommand action is called within the associated flash object's action script. + */ + FlashScriptCommand: ASPxClientEvent>; + /** + * Play the Flash movie backwards. + */ + Back(): void; + /** + * Returns the value of the Flash variable specified. + * @param name A string value that specifies the Flash variable. + */ + GetVariable(name: string): string; + /** + * Play the Flash movie forwards. + */ + Forward(): void; + /** + * Activates the specified frame in the Flash movie. + * @param frameNumber An integer value that specifies the requested frame. + */ + GotoFrame(frameNumber: number): void; + /** + * Indicates whether the Flash movie is currently playing. + */ + IsPlaying(): boolean; + /** + * Loads the Flash movie to the specified layer. + * @param layerNumber An integer value that identifies a layer in which to load the movie. + * @param url A string value that specifies the movie's URL. + */ + LoadMovie(layerNumber: number, url: string): void; + /** + * Pans a zoomed-in Flash movie to the specified coordinates. + * @param x An integer value that specifies the X-coordinate. + * @param y An integer value that specifies the Y-coordinate. + * @param mode 0 the coordinates are pixels; 1 the coordinates are a percentage of the window. + */ + Pan(x: number, y: number, mode: number): void; + /** + * Returns the percent of the Flash Player movie that has streamed into the browser so far. + */ + PercentLoaded(): string; + /** + * Starts playing the Flash movie. + */ + Play(): void; + /** + * Rewinds the Flash movie to the first frame. + */ + Rewind(): void; + /** + * Sets the value of the specified Flash variable. + * @param name A string value that specifies the Flash variable. + * @param value A string value that represents a new value. + */ + SetVariable(name: string, value: string): void; + /** + * Zooms in on the specified rectangular area of the Flash movie. + * @param left An integer value that specifies the x-coordinate of the rectangle's left side, in twips. + * @param top An integer value that specifies the y-coordinate of the rectangle's top side, in twips. + * @param right An integer value that specifies the x-coordinate of the rectangle's right side, in twips. + * @param bottom An integer value that specifies the y-coordinate of the rectangle's bottom side, in twips. + */ + SetZoomRect(left: number, top: number, right: number, bottom: number): void; + /** + * Stops playing the Flash movie. + */ + StopPlay(): void; + /** + * Returns the total number of frames in the Flash movie. + */ + TotalFrames(): number; + /** + * Zooms the Flash view by a relative scale factor. + * @param percent An integer value that specifies the relative scale factor, as a percentage. + */ + Zoom(percent: number): void; + /** + * Starts playing a Quick Time movie. + */ + QTPlay(): void; + /** + * Stops playing a Quick Time movie. + */ + QTStopPlay(): void; + /** + * Rewinds a Quick Time movie to the first frame. + */ + QTRewind(): void; + /** + * Steps through a Quick Time video stream by a specified number of frames. + * @param count An integer value that specifies the number of frames to step. + */ + QTStep(count: number): void; +} +/** + * A method that will handle the FlashScriptCommand event. + */ +interface ASPxClientFlashScriptCommandEventHandler { + /** + * A method that will handle the FlashScriptCommand event. + * @param source The event source. + * @param e A ASPxClientFlashScriptCommandEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFlashScriptCommandEventArgs): void; +} +/** + * Provides data for the FlashScriptCommand client event. + */ +interface ASPxClientFlashScriptCommandEventArgs extends ASPxClientEventArgs { + /** + * Gets a command passed via the FSCommand action of the flash object. + * Value: A string that represents the value of the FSCommand action's command parameter. + */ + command: string; + /** + * Gets arguments passed via the FSCommand action of the flash object. + * Value: A string that represents the value of the FSCommand action's args parameter. + */ + args: string; +} +/** + * Lists the available link types within office documents. + */ +interface ASPxClientOfficeDocumentLinkType { +} +/** + * Serves as the base class for controls that implement panel functionality. + */ +interface ASPxClientPanelBase extends ASPxClientControl { + /** + * Returns the HTML code that is the content of the panel. + */ + GetContentHtml(): string; + /** + * Sets the HTML content for the panel. + * @param html A string value that is the HTML code defining the content of the panel. + */ + SetContentHtml(html: string): void; + /** + * Sets a value specifying whether the panel is enabled. + * @param enabled true to enable the panel; false to disable it. + */ + SetEnabled(enabled: boolean): void; + /** + * Returns a value specifying whether a panel is enabled. + */ + GetEnabled(): boolean; +} +/** + * Represents a client-side equivalent of the ASPxPanel control. + */ +interface ASPxClientPanel extends ASPxClientPanelBase { + /** + * Occurs when the expanded panel is closed. + */ + Collapsed: ASPxClientEvent>; + /** + * Occurs when an end-user opens the expand panel. + */ + Expanded: ASPxClientEvent>; + /** + * Expands or collapses the client panel. + */ + Toggle(): void; + /** + * Returns a value specifying whether the panel can be expanded. + */ + IsExpandable(): boolean; + /** + * Returns a value specifying whether the panel is expanded. + */ + IsExpanded(): boolean; + /** + * Expands the collapsed panel. + */ + Expand(): void; + /** + * Collapses the expanded panel. + */ + Collapse(): void; +} +/** + * Represents a client-side equivalent of the ASPxPopupControl control. + */ +interface ASPxClientPopupControl extends ASPxClientPopupControlBase { + /** + * Occurs when a popup window's close button is clicked. + */ + CloseButtonClick: ASPxClientEvent>; + /** + * This method is not in effect for a ASPxClientPopupControl object. + */ + GetMainElement(): Object; + /** + * Returns an object containing the information about a mouse event that invoked a default popup window. + */ + GetPopUpReasonMouseEvent(): Object; + /** + * Returns an object containing the information about a mouse event that invoked the specified popup window. + * @param window A ASPxClientPopupWindow object that specifies the required popup window. + */ + GetWindowPopUpReasonMouseEvent(window: ASPxClientPopupWindow): Object; + /** + * + * @param window + * @param parameter + */ + PerformWindowCallback(window: ASPxClientPopupWindow, parameter: string): void; + /** + * + * @param window + * @param parameter + * @param onSuccess + */ + PerformWindowCallback(window: ASPxClientPopupWindow, parameter: string, onSuccess: (arg1: string) => void): void; + /** + * Specifies the default popup window's size. + * @param width An integer value that specifies the default popup window's width. + * @param height An integer value that specifies the default popup window's height. + */ + SetSize(width: number, height: number): void; + /** + * Gets the width of the specified popup window's content region. + * @param window An ASPxClientPopupWindow object that specifies the required popup window. + */ + GetWindowContentWidth(window: ASPxClientPopupWindow): number; + /** + * Gets the height of the specified popup window's content region. + * @param window An ASPxClientPopupWindow object that specifies the required popup window. + */ + GetWindowContentHeight(window: ASPxClientPopupWindow): number; + /** + * Returns the height of a specific popup window. + * @param window A ASPxClientPopupWindow object that specifies the required popup window. + */ + GetWindowHeight(window: ASPxClientPopupWindow): number; + /** + * Returns the width of a specific popup window. + * @param window A ASPxClientPopupWindow object that specifies the required popup window. + */ + GetWindowWidth(window: ASPxClientPopupWindow): number; + /** + * Specifies the size of a specific popup window. + * @param window A ASPxClientPopupWindow object that specifies the required popup window. + * @param width An integer value that specifies the required popup window's width. + * @param height An integer value that specifies the required popup window's height. + */ + SetWindowSize(window: ASPxClientPopupWindow, width: number, height: number): void; + /** + * Returns the HTML code that is the content of the popup control's default popup window. + */ + GetContentHTML(): string; + /** + * Defines the HTML content for the popup control's default popup window. + * @param html A string value that is the HTML code defining the content of the popup window. + */ + SetContentHTML(html: string): void; + /** + * Sets the ID of a web control or HTML element (or a list of IDs) with which the current popup control's window is associated. + * @param window An ASPxClientPopupWindow object representing a popup control's window. + * @param popupElementId A string value specifying the ID (or a list of IDs) of the web control or HTML element with which the popup control's window is associated. + */ + SetWindowPopupElementID(window: ASPxClientPopupWindow, popupElementId: string): void; + /** + * Sets the ID of a web control or HTML element (or a list of IDs) with which the current popup control is associated. + * @param popupElementId A string value specifying the ID (or a list of IDs) of the web control or HTML element to which the popup control is associated. + */ + SetPopupElementID(popupElementId: string): void; + /** + * Returns an index of the object that invoked the default window within the PopupElementID list. + */ + GetCurrentPopupElementIndex(): number; + /** + * Returns an index of the object that invoked the specified popup window, within the window's PopupElementID list. + * @param window An ASPxClientPopupWindow object that specifies the required popup window. + */ + GetWindowCurrentPopupElementIndex(window: ASPxClientPopupWindow): number; + /** + * Returns an object that invoked the default window. + */ + GetCurrentPopupElement(): Object; + /** + * Returns an object that invoked the specified popup window. + * @param window An ASPxClientPopupWindow object that specifies the required popup window. + */ + GetWindowCurrentPopupElement(window: ASPxClientPopupWindow): Object; + /** + * Returns a value that specifies whether the popup control's specific window is displayed. + * @param window A ASPxClientPopupWindow object representing the popup window whose visibility is checked. + */ + IsWindowVisible(window: ASPxClientPopupWindow): boolean; + /** + * Returns a popup window specified by its index. + * @param index An integer value specifying the zero-based index of the popup window object to be retrieved. + */ + GetWindow(index: number): ASPxClientPopupWindow; + /** + * Returns a popup window specified by its name. + * @param name A string value specifying the name of the popup window. + */ + GetWindowByName(name: string): ASPxClientPopupWindow; + /** + * Returns the number of popup windows in the popup control. + */ + GetWindowCount(): number; + /** + * Invokes the popup control's specific window. + * @param window A ASPxClientPopupWindow object representing the popup window to display. + */ + ShowWindow(window: ASPxClientPopupWindow): void; + /** + * Invokes the specified popup window at the popup element with the specified index. + * @param window A ASPxClientPopupWindow object that specifies the required popup window. + * @param popupElementIndex An integer value specifying the zero-based index of the popup element within the window's PopupElementID list. + */ + ShowWindow(window: ASPxClientPopupWindow, popupElementIndex: number): void; + /** + * Invokes the popup control's specific window and displays it over the specified HTML element. + * @param window A ASPxClientPopupWindow object representing the popup window to display. + * @param htmlElement An object specifying the HTML element relative to whose position the default popup window is invoked. + */ + ShowWindowAtElement(window: ASPxClientPopupWindow, htmlElement: Object): void; + /** + * Invokes the popup control's specific window and displays it over an HTML element specified by its unique identifier. + * @param window A ASPxClientPopupWindow object representing the popup window to display. + * @param id A string value that specifies the hierarchically qualified identifier of an HTML element relative to whose position the default popup window is invoked. + */ + ShowWindowAtElementByID(window: ASPxClientPopupWindow, id: string): void; + /** + * Invokes the popup control's specific popup window at the specified position. + * @param window A ASPxClientPopupWindow object representing the popup window to display. + * @param x A integer value specifying the x-coordinate of the popup window's display position. + * @param y A integer value specifying the y-coordinate of the popup window's display position. + */ + ShowWindowAtPos(window: ASPxClientPopupWindow, x: number, y: number): void; + /** + * Brings the specified popup window to the front of the z-order. + * @param window A ASPxClientPopupWindow object representing the popup window. + */ + BringWindowToFront(window: ASPxClientPopupWindow): void; + /** + * Closes the popup control's specified window. + * @param window A ASPxClientPopupWindow object representing the popup window to close. + */ + HideWindow(window: ASPxClientPopupWindow): void; + /** + * Returns the HTML code that represents the contents of the specified popup window. + * @param window An ASPxClientPopupWindow object that specifies the required popup window. + */ + GetWindowContentHtml(window: ASPxClientPopupWindow): string; + /** + * Defines the HTML content for a specific popup window within the popup control. + * @param window An ASPxClientPopupWindow object that specifies the required popup window. + * @param html A string value that represents the HTML code defining the content of the specified popup window. + */ + SetWindowContentHtml(window: ASPxClientPopupWindow, html: string): void; + /** + * Returns an iframe object containing a web page specified via the specified popup window's SetWindowContentUrl client method). + * @param window A ASPxClientPopupWindow object representing the required popup window. + */ + GetWindowContentIFrame(window: ASPxClientPopupWindow): Object; + /** + * Returns the URL pointing to the web page displayed within the control's specific popup window. + * @param window A ASPxClientPopupWindow object representing the required popup window. + */ + GetWindowContentUrl(window: ASPxClientPopupWindow): string; + /** + * Sets the URL pointing to the web page that should be loaded into and displayed within the control's specific popup window. + * @param window A ASPxClientPopupWindow object representing the required popup window. + * @param url A string value specifying the URL to the web page to be displayed within the specified popup window. + */ + SetWindowContentUrl(window: ASPxClientPopupWindow, url: string): void; + /** + * Returns a value indicating whether the specified window is pinned. + * @param window An ASPxClientPopupWindow object specifying the popup window. + */ + GetWindowPinned(window: ASPxClientPopupWindow): boolean; + /** + * Sets a value indicating whether the specified window is pinned. + * @param window An ASPxClientPopupWindow object specifying the popup window. + * @param value true to pin the window; otherwise, false. + */ + SetWindowPinned(window: ASPxClientPopupWindow, value: boolean): void; + /** + * Returns a value indicating whether the specified window is maximized. + * @param window An ASPxClientPopupWindow object specifying the popup window. + */ + GetWindowMaximized(window: ASPxClientPopupWindow): boolean; + /** + * Sets a value indicating whether the specified window is maximized. + * @param window An ASPxClientPopupWindow object specifying the popup window. + * @param value true to maximize the window; otherwise, false. + */ + SetWindowMaximized(window: ASPxClientPopupWindow, value: boolean): void; + /** + * Returns a value indicating whether the specified window is collapsed. + * @param window An ASPxClientPopupWindow object specifying the popup window. + */ + GetWindowCollapsed(window: ASPxClientPopupWindow): boolean; + /** + * Sets a value indicating whether the specified window is collapsed. + * @param window An ASPxClientPopupWindow object specifying the popup window. + * @param value true to collapse the window; otherwise, false. + */ + SetWindowCollapsed(window: ASPxClientPopupWindow, value: boolean): void; + /** + * Refreshes the content of the web page displayed within the control's specific popup window. + * @param window A ASPxClientPopupWindow object representing the required popup window. + */ + RefreshWindowContentUrl(window: ASPxClientPopupWindow): void; + /** + * Updates the default popup window's position, to correctly align it at either the specified element, or the center of the browser's window. + */ + UpdatePosition(): void; + /** + * Updates the default popup window's position, to correctly align it at the specified HTML element. + * @param htmlElement An object specifying the HTML element to which the default popup window is aligned using the PopupVerticalAlign properties. + */ + UpdatePositionAtElement(htmlElement: Object): void; + /** + * Updates the specified popup window's position, to correctly align it at either the specified element, or the center of the browser's window. + * @param window An ASPxClientPopupWindow object that specifies the required popup window. + */ + UpdateWindowPosition(window: ASPxClientPopupWindow): void; + /** + * Updates the specified popup window's position, to correctly align it at the specified HTML element. + * @param window An ASPxClientPopupWindow object that specifies the required popup window. + * @param htmlElement An object specifying the HTML element to which the specified popup window is aligned using the PopupVerticalAlign properties. + */ + UpdateWindowPositionAtElement(window: ASPxClientPopupWindow, htmlElement: Object): void; + /** + * Refreshes the connection between the ASPxPopupControl and the popup element. + */ + RefreshPopupElementConnection(): void; +} +/** + * Represents a client-side equivalent of a popup control's PopupWindow object. + */ +interface ASPxClientPopupWindow { + /** + * Gets the popup control to which the current popup window belongs. + * Value: An ASPxClientPopupControl object representing the popup control to which the window belongs. + */ + popupControl: ASPxClientPopupControl; + /** + * Gets the index of the current popup window within the popup control's Windows collection. + * Value: An integer value representing the zero-based index of the current popup window within the Windows collection of the popup control to which the window belongs. + */ + index: number; + /** + * Gets the name that uniquely identifies the current popup window. + * Value: A string value that represents a value assigned to the popup window's Name property. + */ + name: string; + /** + * Returns the URL pointing to the image displayed within the window header. + */ + GetHeaderImageUrl(): string; + /** + * Specifies the URL which points to the image displayed within the window header. + * @param value A string value that is the URL to the image displayed within the header. + */ + SetHeaderImageUrl(value: string): void; + /** + * Returns the URL pointing to the image displayed within the window footer. + */ + GetFooterImageUrl(): string; + /** + * Specifies the URL which points to the image displayed within the window footer. + * @param value A string value that is the URL to the image displayed within the window footer. + */ + SetFooterImageUrl(value: string): void; + /** + * Returns the URL where the web browser will navigate when the text or image is clicked within the popup window's header. + */ + GetHeaderNavigateUrl(): string; + /** + * Returns the URL where the web browser will navigate when the text or image is clicked within the popup window's header. + * @param value A string value which specifies the required navigation location. + */ + SetHeaderNavigateUrl(value: string): void; + /** + * Returns the URL where the web browser will navigate when the text or image is clicked within the popup window's footer. + */ + GetFooterNavigateUrl(): string; + /** + * Specifies the URL where the web browser will navigate when the text or image is clicked within the popup window's footer. + * @param value A string value which specifies the required navigation location. + */ + SetFooterNavigateUrl(value: string): void; + /** + * Returns the text displayed within the window's header. + */ + GetHeaderText(): string; + /** + * Specifies the text displayed within the window's header. + * @param value A string value that specifies the window's header text. + */ + SetHeaderText(value: string): void; + /** + * Returns the text displayed within the popup window's footer. + */ + GetFooterText(): string; + /** + * Specifies the text displayed within the window's footer. + * @param value A string value that specifies the window's footer text. + */ + SetFooterText(value: string): void; +} +/** + * A method that will handle the popup control's client events invoked in response to manipulating a popup window. + */ +interface ASPxClientPopupWindowEventHandler { + /** + * A method that will handle the popup control's client events when a popup window is manipulated. + * @param source An object representing the event's source. Identifies the popup control object (ASPxClientPopupControl) that raised the event. + * @param e An ASPxClientPopupWindowEventArgs object that contains event data. + */ + (source: S, e: ASPxClientPopupWindowEventArgs): void; +} +/** + * Provides data for events concerning client manipulations on popup windows. + */ +interface ASPxClientPopupWindowEventArgs extends ASPxClientEventArgs { + /** + * Gets the popup window object related to the event. + * Value: An ASPxClientPopupWindow object representing the popup window that was manipulated, causing the popup control to raise the event. + */ + window: ASPxClientPopupWindow; +} +/** + * A method that will handle the popup window's cancellable client events, such as the Closing. + */ +interface ASPxClientPopupWindowCancelEventHandler { + /** + * A method that will handle the popup window's cancelable client events. + * @param source An object representing the event's source. Identifies the popup window object that raised the event. + * @param e An ASPxClientPopupWindowCancelEventArgs object that contains event data. + */ + (source: S, e: ASPxClientPopupWindowCancelEventArgs): void; +} +/** + * Provides data for the popup control's cancellable client events, such as the Closing. + */ +interface ASPxClientPopupWindowCancelEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the popup window object related to the event. + * Value: An ASPxClientPopupWindow object representing the popup window that was manipulated, causing the popup control to raise the event. + */ + window: ASPxClientPopupWindow; + /** + * Gets the value that identifies the reason the popup window is about to close. + * Value: One of the ASPxClientPopupControlCloseReason enumeration values. + */ + closeReason: ASPxClientPopupControlCloseReason; +} +/** + * A method that will handle the CloseUp event. + */ +interface ASPxClientPopupWindowCloseUpEventHandler { + /** + * A method that will handle the CloseUp event. + * @param source The event source. + * @param e An ASPxClientPopupWindowCloseUpEventArgs object that contains event data. + */ + (source: S, e: ASPxClientPopupWindowCloseUpEventArgs): void; +} +/** + * Provides data for the CloseUp event. + */ +interface ASPxClientPopupWindowCloseUpEventArgs extends ASPxClientPopupWindowEventArgs { + /** + * Gets the value that identifies the reason the popup window closes. + * Value: One of the ASPxClientPopupControlCloseReason enumeration values. + */ + closeReason: ASPxClientPopupControlCloseReason; +} +/** + * A method that will handle the Resize event. + */ +interface ASPxClientPopupWindowResizeEventHandler { + /** + * A method that will handle the Resize event. + * @param source The event source. + * @param e A ASPxClientPopupWindowResizeEventArgs object that contains event data. + */ + (source: S, e: ASPxClientPopupWindowResizeEventArgs): void; +} +/** + * Provides data for the Resize event. + */ +interface ASPxClientPopupWindowResizeEventArgs extends ASPxClientPopupWindowEventArgs { + /** + * Returns the value indicating the window state after resizing. + * Value: The integer value indicating the window resize state. + */ + resizeState: number; +} +/** + * A method that will handle the PinnedChanged event. + */ +interface ASPxClientPopupWindowPinnedChangedEventHandler { + /** + * A method that will handle the PinnedChanged event. + * @param source The event source. + * @param e A ASPxClientPopupWindowPinnedChangedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientPopupWindowPinnedChangedEventArgs): void; +} +/** + * Provides data for the PinnedChanged event. + */ +interface ASPxClientPopupWindowPinnedChangedEventArgs extends ASPxClientPopupWindowEventArgs { + /** + * Gets a value indicating whether the processed popup window has been pinned. + * Value: true, if the window has been pinned; otherwise, false. + */ + pinned: boolean; +} +/** + * Represents a client collection that maintains client popup control objects. + */ +interface ASPxClientPopupControlCollection extends ASPxClientControlCollection { + /** + * Hides all popup windows maintained by the collection. + */ + HideAllWindows(): void; +} +/** + * Declares client constants that identify the reason the popup window closes. + */ +interface ASPxClientPopupControlCloseReason { +} +/** + * Represents a client-side equivalent of the ASPxPopupMenu object. + */ +interface ASPxClientPopupMenu extends ASPxClientMenuBase { + /** + * Sets the ID of a web control or HTML element (or a list of IDs) with which the current popup menu is associated. + * @param popupElementId A string value specifying the ID (or a list of IDs) of the web control or HTML element with which the popup menu is associated. + */ + SetPopupElementID(popupElementId: string): void; + /** + * Returns an index of the object that invoked the popup menu within the PopupElementID list. + */ + GetCurrentPopupElementIndex(): number; + /** + * Returns an object that invoked the popup menu. + */ + GetCurrentPopupElement(): Object; + /** + * Refreshes the connection between the ASPxPopupMenu and the popup element. + */ + RefreshPopupElementConnection(): void; + /** + * Hides the popup menu. + */ + Hide(): void; + /** + * Invokes the popup menu. + */ + Show(): void; + /** + * Invokes the popup menu at the popup element with the specified index. + * @param popupElementIndex An integer value specifying the zero-based index of the popup element. + */ + Show(popupElementIndex: number): void; + /** + * Invokes the popup menu and displays it over the specified HTML element. + * @param htmlElement An object specifying the HTML element relative to which position the popup menu is invoked. + */ + ShowAtElement(htmlElement: Object): void; + /** + * Invokes the popup menu and displays it over an HTML element specified by its unique identifier. + * @param id A string value that specifies the hierarchically qualified identifier of an HTML element relative to which position the popup menu is invoked. + */ + ShowAtElementByID(id: string): void; + /** + * Invokes the popup menu at the specified position. + * @param x An integer value specifying the x-coordinate of the popup menu's display position. + * @param y An integer value specifying the y-coordinate of the popup menu's display position. + */ + ShowAtPos(x: number, y: number): void; +} +/** + * Represents the client-side equivalent of the ASPxRatingControl control. + */ +interface ASPxClientRatingControl extends ASPxClientControl { + /** + * Fires on the server after an item has been clicked. + */ + ItemClick: ASPxClientEvent>; + /** + * Occurs on the client side when the mouse cursor is moved into a rating control item. + */ + ItemMouseOver: ASPxClientEvent>; + /** + * Occurs on the client side when the mouse cursor moves outside a rating control item. + */ + ItemMouseOut: ASPxClientEvent>; + /** + * Gets the item tooltip title specified by the item index. + * @param index An integer value specifying the item index. + */ + GetTitle(index: number): string; + /** + * Returns a value indicating whether the control's status is read-only. + */ + GetReadOnly(): boolean; + /** + * Specifies whether the control's status is read-only. + * @param value true to make the control read-only; otherwise, false. + */ + SetReadOnly(value: boolean): void; + /** + * Returns the value of the ASPxRatingControl. + */ + GetValue(): number; + /** + * Modifies the value of the ASPxRatingControl on the client side. + * @param value A decimal value representing the value of the control. + */ + SetValue(value: number): void; +} +/** + * A method that will handle the client ItemClick event. + */ +interface ASPxClientRatingControlItemClickEventHandler { + /** + * A method that will handle the client ItemClick event. + * @param source An object representing the event source. + * @param e A ASPxClientRatingControlItemClickEventArgs object that contains event data. + */ + (source: S, e: ASPxClientRatingControlItemClickEventArgs): void; +} +/** + * Provides data for the ItemClick event. + */ +interface ASPxClientRatingControlItemClickEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the index of the item related to the event. + * Value: An integer value that represents the clicked item's index. + */ + index: number; +} +/** + * A method that will handle the rating control's ItemMouseOver and ItemMouseOut client events (such as ItemMouseOut). + */ +interface ASPxClientRatingControlItemMouseEventHandler { + /** + * A method that will handle the ItemMouseOver events. + * @param source The event source. + * @param e An ASPxClientRatingControlItemMouseEventArgs object that contains event data. + */ + (source: S, e: ASPxClientRatingControlItemMouseEventArgs): void; +} +/** + * Provides data for the rating control's ItemMouseOver and ItemMouseOut client events (such as ItemMouseOut). + */ +interface ASPxClientRatingControlItemMouseEventArgs extends ASPxClientEventArgs { + /** + * Gets the index of the item related to the event. + * Value: An integer value that represents the related item's index. + */ + index: number; +} +/** + * Represents the client-side equivalent of the ASPxRibbon control. + */ +interface ASPxClientRibbon extends ASPxClientControl { + /** + * Occurs after an end-user executes an action on a ribbon item. + */ + CommandExecuted: ASPxClientEvent>; + /** + * Fires on the client side after the active tab has been changed within a ribbon control. + */ + ActiveTabChanged: ASPxClientEvent>; + /** + * Occurs on the client side when the ribbon minimization state is changed by end-user actions. + */ + MinimizationStateChanged: ASPxClientEvent>; + /** + * Occurs when the file tab is clicked. + */ + FileTabClicked: ASPxClientEvent>; + /** + * Fires on the client side after a dialog box launcher has been clicked. + */ + DialogBoxLauncherClicked: ASPxClientEvent>; + /** + * Fires after key tips are closed by pressing Esc. + */ + KeyTipsClosedOnEscape: ASPxClientEvent>; + /** + * Specifies whether the ribbon control is enabled. + * @param enabled true to enable the ribbon; false to disable it. + */ + SetEnabled(enabled: boolean): void; + /** + * Returns a value indicating whether the ribbon is enabled. + */ + GetEnabled(): boolean; + /** + * Returns a tab specified by its index. + * @param index An integer value specifying the zero-based index of the tab object to retrieve. + */ + GetTab(index: number): ASPxClientRibbonTab; + /** + * Returns a tab specified by its name. + * @param name A string value specifying the name of the tab. + */ + GetTabByName(name: string): ASPxClientRibbonTab; + /** + * Returns the number of tabs in the ribbon Tabs collection. + */ + GetTabCount(): number; + /** + * Returns the active tab within the ribbon control. + */ + GetActiveTab(): ASPxClientRibbonTab; + /** + * Makes the specified tab active in the ribbon control on the client side. + * @param tab A ASPxClientRibbonTab object specifying the tab selection. + */ + SetActiveTab(tab: ASPxClientRibbonTab): void; + /** + * Makes a tab active within the ribbon control, specifying the tab's index. + * @param index An integer value specifying the index of the tab to select. + */ + SetActiveTabIndex(index: number): void; + /** + * Returns a ribbon item specified by its name. + * @param name A string value specifying the name of the item. + */ + GetItemByName(name: string): ASPxClientRibbonItem; + /** + * Returns a value of item with the specified name. + * @param name A string value specifying the name of the item. + */ + GetItemValueByName(name: string): Object; + /** + * Sets the value of the item with the specified name. + * @param name A string value specifying the name of the item. + * @param value An object that is the new item value. + */ + SetItemValueByName(name: string, value: Object): void; + /** + * Specifies whether the ribbon is minimized. + * @param minimized true to set the ribbon state to minimized; false to set the ribbon state to normal. + */ + SetMinimized(minimized: boolean): void; + /** + * Gets a value specifying whether the ribbon is minimized. + */ + GetMinimized(): boolean; + /** + * Specifies the visibility of a context tab category specified by its name. + * @param categoryName A Name property value of the required category. + * @param visible true to make a category visible; false to make it hidden. + */ + SetContextTabCategoryVisible(categoryName: string, visible: boolean): void; + /** + * Shows ribbon key tips. + */ + ShowKeyTips(): void; +} +/** + * A client-side equivalent of the ribbon's RibbonTab object. + */ +interface ASPxClientRibbonTab { + /** + * Gets the client ribbon object to which the current tab belongs. + * Value: An object to which the tab belongs. + */ + ribbon: ASPxClientRibbon; + /** + * Gets or sets the tab's index within the collection. + * Value: An integer value that is the zero-based index of the tab within the collection. + */ + index: number; + /** + * Gets the name of the current ribbon tab. + * Value: A string value that is the tab's name. + */ + name: string; + /** + * Returns the text displayed in the tab. + */ + GetText(): string; + /** + * Sets a value specifying whether the tab is enabled. + * @param enabled true to enable the tab; false to disable it. + */ + SetEnabled(enabled: boolean): void; + /** + * Returns a value indicating whether a ribbon tab is enabled. + */ + GetEnabled(): boolean; + /** + * Returns a value specifying whether a ribbon tab is displayed. + */ + GetVisible(): boolean; +} +/** + * A client-side equivalent of the ribbon's RibbonGroup object. + */ +interface ASPxClientRibbonGroup { + /** + * Gets the client ribbon object to which the current group belongs. + * Value: An object to which the group belongs. + */ + ribbon: ASPxClientRibbon; + /** + * Gets the client tab object to which the current group belongs. + * Value: An object to which the group belongs. + */ + tab: ASPxClientRibbonTab; + /** + * Gets or sets the group's index within the collection. + * Value: An integer value that is the zero-based index of the group within the collection. + */ + index: number; + /** + * Gets the name of the current ribbon group. + * Value: A string value that is the group's name. + */ + name: string; + /** + * Returns a value specifying whether a ribbon group is displayed. + */ + GetVisible(): boolean; +} +/** + * A client-side equivalent of the ribbon's RibbonItemBase object. + */ +interface ASPxClientRibbonItem { + /** + * Gets the client group object to which the current item belongs. + * Value: An object to which the item belongs. + */ + group: ASPxClientRibbonGroup; + /** + * Gets or sets the item's index within the collection. + * Value: An integer value that is the zero-based index of the item within the collection. + */ + index: number; + /** + * Gets the name of the current ribbon item. + * Value: A string value that is the item's name. + */ + name: string; + /** + * Gets the client ribbon object to which the current item belongs. + * Value: An object to which the item belongs. + */ + ribbon: ASPxClientRibbon; + /** + * Returns a value indicating whether a ribbon item is enabled. + */ + GetEnabled(): boolean; + /** + * Sets a value specifying whether the item is enabled. + * @param enabled true to enable the item; false to disable it. + */ + SetEnabled(enabled: boolean): void; + /** + * Returns the item value. + */ + GetValue(): Object; + /** + * Sets the item value. + * @param value An that specifies the item value. + */ + SetValue(value: Object): void; + /** + * Returns a value specifying whether a ribbon item is displayed. + */ + GetVisible(): boolean; +} +/** + * A method that will handle the CommandExecuted event. + */ +interface ASPxClientRibbonCommandExecutedEventHandler { + /** + * A method that will handle the CommandExecuted event. + * @param source The event source. Identifies the ASPxRibbon control that raised the event. + * @param e An ASPxClientRibbonCommandExecutedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientRibbonCommandExecutedEventArgs): void; +} +/** + * Provides data for the CommandExecuted event. + */ +interface ASPxClientRibbonCommandExecutedEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets an item object related to the event. + * Value: An object, manipulations on which forced the event to be raised. + */ + item: ASPxClientRibbonItem; + /** + * Gets an optional parameter that complements the processed command. + * Value: A string value containing additional information about the processed command. + */ + parameter: string; +} +/** + * A method that will handle the ActiveTabChanged event. + */ +interface ASPxClientRibbonTabEventHandler { + /** + * A method that will handle the ActiveTabChanged event. + * @param source The event source. Identifies the ASPxRibbon control that raised the event. + * @param e A ASPxClientRibbonTabEventArgs object that contains event data. + */ + (source: S, e: ASPxClientRibbonTabEventArgs): void; +} +/** + * Provides data for the ActiveTabChanged event. + */ +interface ASPxClientRibbonTabEventArgs extends ASPxClientEventArgs { + /** + * Gets the tab object related to the event. + * Value: An object that is the tab, manipulations on which forced the ribbon control to raise the event. + */ + tab: ASPxClientRibbonTab; +} +/** + * A method that will handle the MinimizationStateChanged event. + */ +interface ASPxClientRibbonMinimizationStateEventHandler { + /** + * A method that will handle the MinimizationStateChanged event. + * @param source The event source. Identifies the ASPxRibbon control that raised the event. + * @param e An ASPxClientRibbonMinimizationStateEventArgs object that contains event data. + */ + (source: S, e: ASPxClientRibbonMinimizationStateEventArgs): void; +} +/** + * Provides data for the MinimizationStateChanged event. + */ +interface ASPxClientRibbonMinimizationStateEventArgs extends ASPxClientEventArgs { + /** + * Returns the value indicating the new ribbon state. + * Value: The integer value indicating the ribbon minimization state. + */ + ribbonState: number; +} +/** + * A method that will handle the DialogBoxLauncherClicked event. + */ +interface ASPxClientRibbonDialogBoxLauncherClickedEventHandler { + /** + * A method that will handle the DialogBoxLauncherClicked event. + * @param source The event source. This parameter identifies the ribbon object which raised the event. + * @param e An ASPxClientRibbonDialogBoxLauncherClickedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientRibbonDialogBoxLauncherClickedEventArgs): void; +} +/** + * Provides data for the DialogBoxLauncherClicked event. + */ +interface ASPxClientRibbonDialogBoxLauncherClickedEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the client group object to which the clicked dialog box launcher belongs. + * Value: An object to which the dialog box launcher belongs. + */ + group: ASPxClientRibbonGroup; +} +/** + * Represents a client-side equivalent of the ASPxRoundPanel control. + */ +interface ASPxClientRoundPanel extends ASPxClientPanelBase { + /** + * Fires on the client side after a panel has been expanded or collapsed via end-user interactions, i.e., by clicking a panel header or collapse button. + */ + CollapsedChanged: ASPxClientEvent>; + /** + * Fires on the client side before a panel is expanded or collapsed by end-user interactions, i.e., by clicking a panel header or collapse button. + */ + CollapsedChanging: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientRoundPanel. + */ + CallbackError: ASPxClientEvent>; + /** + * Sends a callback to the server and generates the server-side ContentCallback event, passing it the specified argument. + * @param parameter A string value that is any information that needs to be sent to the server-side ContentCallback event. + */ + PerformCallback(parameter: string): void; + /** + * + * @param parameter + * @param onSuccess + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; + /** + * Returns the text displayed within the panel's header. + */ + GetHeaderText(): string; + /** + * Specifies the text displayed in the panel's header. + * @param text A string value that specifies the panel header's text. + */ + SetHeaderText(text: string): void; + /** + * Returns a value indicating whether the panel is collapsed. + */ + GetCollapsed(): boolean; + /** + * Sets a value indicating whether the panel is collapsed. + * @param collapsed true, to collapse the panel; otherwise, false. + */ + SetCollapsed(collapsed: boolean): void; +} +/** + * Represents a client-side equivalent of the ASPxSplitter object. + */ +interface ASPxClientSplitter extends ASPxClientControl { + /** + * Fires before a pane is resized. + */ + PaneResizing: ASPxClientEvent>; + /** + * Fires after a pane has been resized. + */ + PaneResized: ASPxClientEvent>; + /** + * Fires before a pane is collapsed. + */ + PaneCollapsing: ASPxClientEvent>; + /** + * Fires after a pane has been collapsed. + */ + PaneCollapsed: ASPxClientEvent>; + /** + * Fires before a pane is expanded. + */ + PaneExpanding: ASPxClientEvent>; + /** + * Fires after a pane has been expanded. + */ + PaneExpanded: ASPxClientEvent>; + /** + * Occurs when a pane resize operation has been completed. + */ + PaneResizeCompleted: ASPxClientEvent>; + /** + * Fires after a specific web page has been loaded into a pane. + */ + PaneContentUrlLoaded: ASPxClientEvent>; + /** + * Returns the number of panes at the root level of a splitter. + */ + GetPaneCount(): number; + /** + * Returns the splitter's root pane specified by its index within the Panes collection. + * @param index An integer value specifying the zero-based index of the root pane to be retrieved. + */ + GetPane(index: number): ASPxClientSplitterPane; + /** + * Returns a pane specified by its name. + * @param name A string value specifying the name of the pane. + */ + GetPaneByName(name: string): ASPxClientSplitterPane; + /** + * Specifies whether the control's panes can be resized by end-users on the client side. + * @param allowResize true if pane resizing is allowed; otherwise, false. + */ + SetAllowResize(allowResize: boolean): void; + /** + * Returns a string value that represents the client state of splitter panes. + */ + GetLayoutData(): string; +} +/** + * Represents a client-side equivalent of the splitter's SplitterPane object. + */ +interface ASPxClientSplitterPane { + /** + * Gets the index of the current pane within the pane collection to which it belongs. + * Value: An integer value representing the zero-based index of the current pane within the SplitterPaneCollection collection. + */ + index: number; + /** + * Gets the name that uniquely identifies the current splitter pane. + * Value: A string value that represents the value assigned to the pane's Name property. + */ + name: string; + /** + * Returns a client splitter object that contains the current pane. + */ + GetSplitter(): ASPxClientSplitter; + /** + * Returns the immediate parent of the current pane. + */ + GetParentPane(): ASPxClientSplitterPane; + /** + * Returns the previous sibling pane of the current pane. + */ + GetPrevPane(): ASPxClientSplitterPane; + /** + * Returns the next sibling pane of the current pane. + */ + GetNextPane(): ASPxClientSplitterPane; + /** + * Determines whether the current pane is the first pane within the SplitterPaneCollection. + */ + IsFirstPane(): boolean; + /** + * Determines whether the current pane is the last pane within the SplitterPaneCollection. + */ + IsLastPane(): boolean; + /** + * Returns a value that indicates the orientation in which the current pane and its sibling panes are stacked. + */ + IsVertical(): boolean; + /** + * Returns the number of the current pane's immediate child panes. + */ + GetPaneCount(): number; + /** + * Returns the current pane's immediate child pane specified by its index. + * @param index An integer value specifying the zero-based index of the child pane to be retrieved. + */ + GetPane(index: number): ASPxClientSplitterPane; + /** + * Returns the current pane's child pane specified by its name. + * @param name A string value specifying the name of the pane. + */ + GetPaneByName(name: string): ASPxClientSplitterPane; + /** + * Gets the width of the pane's content area. + */ + GetClientWidth(): number; + /** + * Gets the height of the pane's content area. + */ + GetClientHeight(): number; + /** + * Collapses the current pane and occupies its space by maximizing the specified pane. + * @param maximizedPane A ASPxClientSplitterPane object specifying the pane to be maximized to occupy the freed space. + */ + Collapse(maximizedPane: ASPxClientSplitterPane): boolean; + /** + * Collapses the current pane in a forward direction and occupies its space by maximizing the previous adjacent pane. + */ + CollapseForward(): boolean; + /** + * Collapses the current pane in a backward direction, and occupies its space by maximizing the next adjacent pane. + */ + CollapseBackward(): boolean; + /** + * Expands the current pane object on the client side. + */ + Expand(): boolean; + /** + * Returns whether the pane is collapsed. + */ + IsCollapsed(): boolean; + /** + * Returns whether the pane's content is loaded from an external web page. + */ + IsContentUrlPane(): boolean; + /** + * Gets the URL of a web page displayed as a pane's content. + */ + GetContentUrl(): string; + /** + * Sets the URL to point to a web page that should be loaded into, and displayed within the current pane. + * @param url A string value specifying the URL to a web page displayed within the pane. + */ + SetContentUrl(url: string): void; + /** + * Sets the URL to point to a web page that should be loaded into, and displayed within the current pane, but should not be cached by a client browser. + * @param url A string value specifying the URL to a web page displayed within the pane. + * @param preventBrowserCaching true to prevent the browser to cache the loaded content; false to allow browser caching. + */ + SetContentUrl(url: string, preventBrowserCaching: boolean): void; + /** + * Refreshes the content of the web page displayed within the current pane. + */ + RefreshContentUrl(): void; + /** + * Returns an iframe object containing a web page specified via the pane's SetContentUrl client method). + */ + GetContentIFrame(): Object; + /** + * Specifies whether the current pane can be resized by end-users on the client side. + * @param allowResize true if pane resizing is allowed; otherwise, false. + */ + SetAllowResize(allowResize: boolean): void; + /** + * Forces the client PaneResized event to be generated. + */ + RaiseResizedEvent(): void; + /** + * Returns an HTML element representing a splitter pane object. + */ + GetElement(): Object; + /** + * Specifies the splitter pane's size in pixels. + * @param size An integer value that specifies the splitter pane's size. + */ + SetSize(size: number): void; + /** + * Specifies the splitter pane's size, in pixels or percents. + * @param size A string value that specifies the splitter pane's size, in pixels or percents. + */ + SetSize(size: string): void; + /** + * Returns the splitter pane's size, in pixels or percents. + */ + GetSize(): string; + /** + * Returns the distance between the top edge of the pane content and the topmost portion of the content currently visible in the pane. + */ + GetScrollTop(): number; + /** + * Specifies the distance between the top edge of the pane content and the topmost portion of the content currently visible in the pane. + * @param value An integer value that is the distance (in pixels). + */ + SetScrollTop(value: number): void; + /** + * Returns the distance between the left edge of the pane content and the leftmost portion of the content currently visible in the pane. + */ + GetScrollLeft(): number; + /** + * Specifies the distance between the left edge of the pane content and the leftmost portion of the content currently visible in the pane. + * @param value An integer value that is the distance (in pixels). + */ + SetScrollLeft(value: number): void; +} +/** + * A method that will handle the splitter's client events concerning manipulations with a pane. + */ +interface ASPxClientSplitterPaneEventHandler { + /** + * A method that will handle the splitter's client events concerning pane manipulations. + * @param source An object representing the event's source. Identifies the splitter object that raised the event. + * @param e An ASPxClientSplitterPaneEventArgs object that contains event data. + */ + (source: S, e: ASPxClientSplitterPaneEventArgs): void; +} +/** + * A method that will handle the splitter's client events concerning manipulations with a pane. + */ +interface ASPxClientSplitterPaneEventArgs extends ASPxClientEventArgs { + /** + * Gets the pane object related to the event. + * Value: An ASPxClientSplitterPane object, manipulations on which forced the event to be raised. + */ + pane: ASPxClientSplitterPane; +} +/** + * A method that will handle a splitter control's cancelable client events concerning manipulations with a pane. + */ +interface ASPxClientSplitterPaneCancelEventHandler { + /** + * A method that will handle a splitter control's cancelable client events concerning pane manipulations. + * @param source An object representing the event's source. Identifies the splitter control object that raised the event. + * @param e An ASPxClientSplitterPaneCancelEventArgs object that contains event data. + */ + (source: S, e: ASPxClientSplitterPaneCancelEventArgs): void; +} +/** + * Provides data for a splitter control's cancelable client events concerning manipulations with a pane. + */ +interface ASPxClientSplitterPaneCancelEventArgs extends ASPxClientSplitterPaneEventArgs { + /** + * Gets or sets a value indicating whether the action which raised the event should be canceled. + * Value: true if the action that raised the event should be canceled; otherwise, false. + */ + cancel: boolean; +} +/** + * Represents a base for the ASPxClientPageControl objects. + */ +interface ASPxClientTabControlBase extends ASPxClientControl { + /** + * Fires when a tab is clicked. + */ + TabClick: ASPxClientEvent>; + /** + * Fires on the client side after the active tab has been changed within a tab control. + */ + ActiveTabChanged: ASPxClientEvent>; + /** + * Fires on the client side before the active tab is changed within a tab control. + */ + ActiveTabChanging: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by a client tab control. + */ + CallbackError: ASPxClientEvent>; + /** + * Modifies a tab page's size in accordance with the content. + */ + AdjustSize(): void; + /** + * Returns the active tab within the tab control. + */ + GetActiveTab(): ASPxClientTab; + /** + * Makes the specified tab active within the tab control on the client side. + * @param tab An ASPxClientTab object specifying the tab to select. + */ + SetActiveTab(tab: ASPxClientTab): void; + /** + * Returns the index of the active tab within the tab control. + */ + GetActiveTabIndex(): number; + /** + * Makes a tab active within the tab control, specifying the tab's index. + * @param index An integer value specifying the index of the tab to select. + */ + SetActiveTabIndex(index: number): void; + /** + * Returns the number of tabs in the ASPxTabControl. + */ + GetTabCount(): number; + /** + * Returns a tab specified by its index. + * @param index An integer value specifying the zero-based index of the tab object to retrieve. + */ + GetTab(index: number): ASPxClientTab; + /** + * Returns a tab specified by its name. + * @param name A string value specifying the name of the tab. + */ + GetTabByName(name: string): ASPxClientTab; +} +/** + * Represents a client-side equivalent of the ASPxTabControl object. + */ +interface ASPxClientTabControl extends ASPxClientTabControlBase { +} +/** + * Represents a client-side equivalent of the ASPxPageControl object. + */ +interface ASPxClientPageControl extends ASPxClientTabControlBase { + /** + * Returns the HTML code that represents the contents of the specified page within the page control. + * @param tab An ASPxClientTab object that specifies the required page. + */ + GetTabContentHTML(tab: ASPxClientTab): string; + /** + * Defines the HTML content for a specific tab page within the page control. + * @param tab An ASPxClientTab object that specifies the required tab page. + * @param html A string value that represents the HTML code defining the content of the specified page. + */ + SetTabContentHTML(tab: ASPxClientTab, html: string): void; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side Callback event. + */ + PerformCallback(parameter: string): void; + /** + * + * @param parameter + * @param onSuccess + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; +} +/** + * Represents a client-side equivalent of a tab control's TabPage object. + */ +interface ASPxClientTab { + /** + * Gets the tab control to which the current tab belongs. + * Value: An ASPxClientTabControlBase object representing the control to which the tab belongs. + */ + tabControl: ASPxClientTabControlBase; + /** + * Gets the index of the current tab (tabbed page) within the control's collection of tabs (tabbed pages). + * Value: An integer value representing the zero-based index of the current tab (tabbed page) within the TabPages) collection of the control to which the tab belongs. + */ + index: number; + /** + * Gets the name that uniquely identifies the current tab. + * Value: A string value that represents the value assigned to the tab's Name property. + */ + name: string; + /** + * Returns a value specifying whether a tab is enabled. + */ + GetEnabled(): boolean; + /** + * Specifies whether the tab is enabled. + * @param value true to enable the tab; otherwise, false. + */ + SetEnabled(value: boolean): void; + /** + * Returns the URL pointing to the image displayed within the tab. + */ + GetImageUrl(): string; + /** + * Specifies the URL which points to the image displayed within the tab. + * @param value A string value that is the URL to the image displayed within the tab. + */ + SetImageUrl(value: string): void; + /** + * Returns the URL pointing to the image displayed within the active tab. + */ + GetActiveImageUrl(): string; + /** + * Specifies the URL which points to the image displayed within the active tab. + * @param value A string value that is the URL to the image displayed within the active tab. + */ + SetActiveImageUrl(value: string): void; + /** + * Gets an URL which defines the navigation location for the tab. + */ + GetNavigateUrl(): string; + /** + * Specifies a URL which defines the navigation location for the tab. + * @param value A string value which is a URL to where the client web browser will navigate when the tab is clicked. + */ + SetNavigateUrl(value: string): void; + /** + * Returns text displayed within the tab. + */ + GetText(): string; + /** + * Specifies the text displayed within the tab. + * @param value A string value that is the text displayed within the tab. + */ + SetText(value: string): void; + /** + * Returns a value specifying whether a tab is displayed. + */ + GetVisible(): boolean; + /** + * Specifies whether the tab is visible. + * @param value true is the tab is visible; otherwise, false. + */ + SetVisible(value: boolean): void; +} +/** + * A method that will handle a tab control's client events concerning manipulations with a tab. + */ +interface ASPxClientTabControlTabEventHandler { + /** + * A method that will handle a tab control's client events concerning manipulations with a tab. + * @param source An object representing the event's source. Identifies the tab control object that raised the event. + * @param e An ASPxClientTabControlTabEventArgs object that contains event data. + */ + (source: S, e: ASPxClientTabControlTabEventArgs): void; +} +/** + * Provides data for events which concern manipulations on tabs. + */ +interface ASPxClientTabControlTabEventArgs extends ASPxClientEventArgs { + /** + * Gets the tab object related to the event. + * Value: An ASPxClientTab object, manipulations on which forced the event to be raised. + */ + tab: ASPxClientTab; +} +/** + * A method that will handle a tab control's cancelable client events concerning manipulations with a tab. + */ +interface ASPxClientTabControlTabCancelEventHandler { + /** + * A method that will handle a tab control's cancelable client events concerning manipulations with a tab. + * @param source An object representing the event's source. Identifies the tab control object that raised the event. + * @param e An ASPxClientTabControlTabCancelEventArgs object that contains event data. + */ + (source: S, e: ASPxClientTabControlTabCancelEventArgs): void; +} +/** + * Provides data for cancellable events which concern manipulations on tabs. + */ +interface ASPxClientTabControlTabCancelEventArgs extends ASPxClientProcessingModeCancelEventArgs { + /** + * Gets the tab object related to the event. + * Value: An ASPxClientTab object representing the tab manipulations on which forced the tab control to raise the event. + */ + tab: ASPxClientTab; + /** + * Gets or sets a value specifying whether a callback should be sent to the server to reload the content of the page being activated. + * Value: true to reload the page's content; otherwise, false. + */ + reloadContentOnCallback: boolean; +} +/** + * A method that will handle client events concerning clicks on the control's tabs. + */ +interface ASPxClientTabControlTabClickEventHandler { + /** + * A method that will handle client events concerning clicks on tabs. + * @param source The event source. This parameter identifies the tab control object which raised the event. + * @param e An ASPxClientTabControlTabClickEventArgs object that contains event data. + */ + (source: S, e: ASPxClientTabControlTabClickEventArgs): void; +} +/** + * Provides data for events which concern clicking on the control's tabs. + */ +interface ASPxClientTabControlTabClickEventArgs extends ASPxClientTabControlTabCancelEventArgs { + /** + * Gets the HTML object that contains the processed tab. + * Value: An object representing a container for the tab related to the event. + */ + htmlElement: Object; + /** + * Gets a DHTML event object that relates to the processed event. + * Value: An object that maintains DHTML event-specific information. + */ + htmlEvent: Object; +} +/** + * Represents a client-side equivalent of the ASPxTimer object. + */ +interface ASPxClientTimer extends ASPxClientControl { + /** + * Fires on the client side when the specified timer interval has elapsed, and the timer is enabled. + */ + Tick: ASPxClientEvent>; + /** + * Returns a value indicating whether the timer is enabled. + */ + GetEnabled(): boolean; + /** + * Enables the timer. + * @param enabled true to turn the timer on; false, to turn the timer off. + */ + SetEnabled(enabled: boolean): void; + /** + * Gets the time before the Tick event. + */ + GetInterval(): number; + /** + * Specifies the time before the Tick event. + * @param interval An integer value that specifies the number of milliseconds before the Tick event is raised relative to the last occurrence of the Tick event. The value cannot be less than one. + */ + SetInterval(interval: number): void; +} +/** + * Represents a client-side equivalent of the ASPxTitleIndex object. + */ +interface ASPxClientTitleIndex extends ASPxClientControl { + /** + * Fires after an item has been clicked. + */ + ItemClick: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientTitleIndex. + */ + CallbackError: ASPxClientEvent>; +} +/** + * A method that will handle client events concerning manipulations with an item. + */ +interface ASPxClientTitleIndexItemEventHandler { + /** + * A method that will handle the title index control's client events concerning manipulations with an item. + * @param source An object representing the event's source. Identifies the title index control object that raised the event. + * @param e An ASPxClientTitleIndexItemEventArgs object that contains event data. + */ + (source: S, e: ASPxClientTitleIndexItemEventArgs): void; +} +/** + * Provides data for events which concern manipulations on the control's items. + */ +interface ASPxClientTitleIndexItemEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the name that uniquely identifies the processed item. + * Value: A string value that represents the value assigned to the processed item's Name property. + */ + name: Object; + /** + * Gets the HTML object that contains the processed item. + * Value: An object representing a container for the item related to the event. + */ + htmlElement: Object; + /** + * Gets a DHTML event object that relates to the processed event. + * Value: An object that maintains DHTML event-specific information. + */ + htmlEvent: Object; +} +/** + * Represents a client-side equivalent of the ASPxTreeView object. + */ +interface ASPxClientTreeView extends ASPxClientControl { + /** + * Fires on the client side after a node has been clicked. + */ + NodeClick: ASPxClientEvent>; + /** + * Fires on the client side after a node's expansion state has been changed by end-user interaction. + */ + ExpandedChanged: ASPxClientEvent>; + /** + * Fires on the client side before the expansion state of a node is changed via end-user interaction. + */ + ExpandedChanging: ASPxClientEvent>; + /** + * Occurs on the client side when the node's checked state is changed by clicking on a check box. + */ + CheckedChanged: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientTreeView. + */ + CallbackError: ASPxClientEvent>; + /** + * Returns a node specified by its index within the ASPxTreeView's node collection. + * @param index An integer value specifying the zero-based index of the node to be retrieved. + */ + GetNode(index: number): ASPxClientTreeViewNode; + /** + * Returns a node specified by its name. + * @param name A string value specifying the name of the node. + */ + GetNodeByName(name: string): ASPxClientTreeViewNode; + /** + * Returns a node specified by its text. + * @param text A string value specifying the text content of the node. + */ + GetNodeByText(text: string): ASPxClientTreeViewNode; + /** + * Returns the number of nodes at the ASPxTreeView's zero level. + */ + GetNodeCount(): number; + /** + * Returns the selected node within the ASPxTreeView control on the client side. + */ + GetSelectedNode(): ASPxClientTreeViewNode; + /** + * Selects the specified node within the ASPxTreeView control on the client side. + * @param node An ASPxClientTreeViewNode object specifying the node to select. + */ + SetSelectedNode(node: ASPxClientTreeViewNode): void; + /** + * Gets the root node of the ASPxTreeView object. + */ + GetRootNode(): ASPxClientTreeViewNode; + /** + * Collapses all nodes in the ASPxTreeView on the client side. + */ + CollapseAll(): void; + /** + * Expands all nodes in the ASPxTreeView on the client side. + */ + ExpandAll(): void; +} +/** + * Represents a client-side equivalent of the ASPxTreeView's TreeViewNode object. + */ +interface ASPxClientTreeViewNode { + /** + * Gets the client representation of the ASPxTreeView control to which the current node belongs. + * Value: An ASPxClientTreeView object representing the control to which the node belongs. + */ + treeView: ASPxClientTreeView; + /** + * Gets the current node's parent node. + * Value: An ASPxClientTreeViewNode object representing the node's immediate parent. + */ + parent: ASPxClientTreeViewNode; + /** + * Gets the node's index within the parent's collection of nodes. + * Value: An integer value representing the node's zero-based index within the Nodes collection of the node to which the node belongs. + */ + index: number; + /** + * Gets the name that uniquely identifies the node. + * Value: A string value that represents the value assigned to the node's Name property. + */ + name: string; + /** + * Returns the number of the current node's immediate child nodes. + */ + GetNodeCount(): number; + /** + * Returns the current node's immediate child node specified by its index. + * @param index An integer value specifying the zero-based index of the node to be retrieved. + */ + GetNode(index: number): ASPxClientTreeViewNode; + /** + * Returns the current node's child node specified by its name. + * @param name A string value specifying the name of the node. + */ + GetNodeByName(name: string): ASPxClientTreeViewNode; + /** + * Returns the current node's child node specified by its text. + * @param text A string value specifying the text content of the node. + */ + GetNodeByText(text: string): ASPxClientTreeViewNode; + /** + * Returns a value indicating whether the node is expanded. + */ + GetExpanded(): boolean; + /** + * Sets a value which specifies the node's expansion state. + * @param value true if the node is expanded; otherwise, false. + */ + SetExpanded(value: boolean): void; + /** + * Returns a value indicating whether the node is checked. + */ + GetChecked(): boolean; + /** + * Sets a value indicating whether the node is checked. + * @param value true if the node is checked; otherwise, false. + */ + SetChecked(value: boolean): void; + /** + * Returns a value which specifies the node's check state. + */ + GetCheckState(): string; + /** + * Returns a value specifying whether the node is enabled. + */ + GetEnabled(): boolean; + /** + * Sets a value specifying whether the node is enabled. + * @param value true to make the node enabled; false to disable it. + */ + SetEnabled(value: boolean): void; + /** + * Returns the URL pointing to the image displayed within the node. + */ + GetImageUrl(): string; + /** + * Sets the URL which points to the image displayed within the node. + * @param value A string value specifying the URL to the image displayed within the node. + */ + SetImageUrl(value: string): void; + /** + * Gets an URL which defines the navigation location for the node's hyperlink. + */ + GetNavigateUrl(): string; + /** + * Specifies a URL which defines the node's navigate URL. + * @param value A string value which specifies a URL to where the client web browser will navigate when the node is clicked. + */ + SetNavigateUrl(value: string): void; + /** + * Gets the text, displayed within the node. + */ + GetText(): string; + /** + * Specifies the text, displayed within the node. + * @param value A string value that represents the text displayed within the node. + */ + SetText(value: string): void; + /** + * Returns a value specifying whether a node is displayed. + */ + GetVisible(): boolean; + /** + * Specifies whether the node is visible. + * @param value true if the node is visible; otherwise, false. + */ + SetVisible(value: boolean): void; + /** + * Gets the HTML object that contains the current node. + */ + GetHtmlElement(): Object; +} +/** + * A method that will handle the client events concerned with node processing. + */ +interface ASPxClientTreeViewNodeProcessingModeEventHandler { + /** + * A method that will handle the client events concerned with node processing. + * @param source An object representing the event source. Identifies the ASPxClientTreeView control that raised the event. + * @param e An ASPxClientTreeViewNodeProcessingModeEventArgs object that contains event data. + */ + (source: S, e: ASPxClientTreeViewNodeProcessingModeEventArgs): void; +} +/** + * Provides data for the client events concerned with node processing, and that allow the event's processing to be passed to the server side. + */ +interface ASPxClientTreeViewNodeProcessingModeEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets a node object related to the event. + * Value: An ASPxClientTreeViewNode object, manipulations on which forced the event to be raised. + */ + node: ASPxClientTreeViewNode; +} +/** + * A method that will handle the ASPxClientTreeView.ItemClick event. + */ +interface ASPxClientTreeViewNodeClickEventHandler { + /** + * A method that will handle the NodeClick event. + * @param source The ASPxClientTreeView control which fires the event. + * @param e An ASPxClientTreeViewNodeClickEventArgs object that contains event data. + */ + (source: S, e: ASPxClientTreeViewNodeClickEventArgs): void; +} +/** + * Provides data for the NodeClick event. + */ +interface ASPxClientTreeViewNodeClickEventArgs extends ASPxClientTreeViewNodeProcessingModeEventArgs { + /** + * Gets the HTML object that contains the processed node. + * Value: An object representing a container for the node related to the event. + */ + htmlElement: Object; + /** + * Gets a DHTML event object that relates to the processed event. + * Value: An object that maintains DHTML event-specific information. + */ + htmlEvent: Object; +} +/** + * A method that will handle the ASPxTreeView control's client events concerning manipulations with a node. + */ +interface ASPxClientTreeViewNodeEventHandler { + /** + * A method that will handle the ASPxTreeView control's client events, concerning manipulations with a node. + * @param source An object representing the event's source. Identifies the ASPxClientTreeView control object that raised the event. + * @param e An ASPxClientTreeViewNodeEventArgs object that contains event data. + */ + (source: S, e: ASPxClientTreeViewNodeEventArgs): void; +} +/** + * Provides data for the ExpandedChanged events. + */ +interface ASPxClientTreeViewNodeEventArgs extends ASPxClientEventArgs { + /** + * Gets a node object related to the event. + * Value: An ASPxClientTreeViewNode object, manipulations on which forced the event to be raised. + */ + node: ASPxClientTreeViewNode; +} +/** + * A method that will handle the ASPxTreeView's cancelable client events, concerning manipulations with nodes. + */ +interface ASPxClientTreeViewNodeCancelEventHandler { + /** + * A method that will handle the ASPxTreeView's cancelable client events, concerning manipulations with nodes. + * @param source An object representing the event's source. Identifies the ASPxClientTreeView object that raised the event. + * @param e An ASPxClientTreeViewNodeCancelEventArgs object that contains event data. + */ + (source: S, e: ASPxClientTreeViewNodeCancelEventArgs): void; +} +/** + * Provides data for the ExpandedChanging event. + */ +interface ASPxClientTreeViewNodeCancelEventArgs extends ASPxClientProcessingModeCancelEventArgs { + /** + * Gets a node object related to the event. + * Value: An ASPxClientTreeViewNode object, manipulations on which forced the event to be raised. + */ + node: ASPxClientTreeViewNode; +} +/** + * Represents a client-side equivalent of the ASPxUploadControl control. + */ +interface ASPxClientUploadControl extends ASPxClientControl { + /** + * Occurs on the client after a file has been uploaded. + */ + FileUploadComplete: ASPxClientEvent>; + /** + * Occurs on the client after upload of all selected files has been completed. + */ + FilesUploadComplete: ASPxClientEvent>; + /** + * Occurs on the client side before upload of the specified files starts. + */ + FileUploadStart: ASPxClientEvent>; + /** + * Occurs on the client side before file upload is started. + */ + FilesUploadStart: ASPxClientEvent>; + /** + * Fires on the client side when the text within the control's edit box is changed while the control has focus. + */ + TextChanged: ASPxClientEvent>; + /** + * Occurs on the client side when the progress bar indicator position is changed. + */ + UploadingProgressChanged: ASPxClientEvent>; + /** + * Occurs on the client side when the file input elements count is changed. + */ + FileInputCountChanged: ASPxClientEvent>; + /** + * Fires when the mouse enters a drop zone or an external drop zone element while dragging a file. + */ + DropZoneEnter: ASPxClientEvent>; + /** + * Fires when the mouse leaves a drop zone or an external drop zone element while dragging a file. + */ + DropZoneLeave: ASPxClientEvent>; + /** + * Initiates uploading of the specified file to the web server's memory. + */ + UploadFile(): void; + /** + * Adds a new file input element to the ASPxUploadControl. + */ + AddFileInput(): void; + /** + * Removes a file input element from the ASPxUploadControl. + * @param index An integer value that represents a file input element's index. + */ + RemoveFileInput(index: number): void; + /** + * Removes a file with the specified index from the selected file list. + * @param fileIndex An integer value that is the zero-based index of an item in the file list. + */ + RemoveFileFromSelection(fileIndex: number): void; + /** + * Gets the text displayed within the edit box of the specified file input element. + * @param index An integer value that specifies the required file input element's index. + */ + GetText(index: number): string; + /** + * Gets the number of file input elements contained within the ASPxUploadControl. + */ + GetFileInputCount(): number; + /** + * Specifies the count of the file input elements within the upload control. + * @param count An integer value that specifies the file input elements count. + */ + SetFileInputCount(count: number): void; + /** + * Specifies whether the upload control is enabled. + * @param enabled true, to enable the upload control; otherwise, false. + */ + SetEnabled(enabled: boolean): void; + /** + * Returns a value indicating whether the upload control is enabled. + */ + GetEnabled(): boolean; + /** + * Initiates uploading of the specified file(s) to the web server's memory. + */ + Upload(): void; + /** + * Cancels the initiated file uploading process. + */ + Cancel(): void; + /** + * Clears the file selection in the upload control. + */ + ClearText(): void; + /** + * Sets the text to be displayed within the add button. + * @param text A string value specifying the text to be displayed within the button. + */ + SetAddButtonText(text: string): void; + /** + * Sets the text to be displayed within the upload button. + * @param text A string value specifying the text to be displayed within the button. + */ + SetUploadButtonText(text: string): void; + /** + * Returns the text displayed within the add button. + */ + GetAddButtonText(): string; + /** + * Returns the text displayed within the upload button. + */ + GetUploadButtonText(): string; + /** + * Sets the ID of a web control or HTML element (or a list of IDs), a click on which invokes file upload dialog. + * @param ids A string value specifying the ID or a list of IDs separated by the semicolon (;). + */ + SetDialogTriggerID(ids: string): void; +} +/** + * A method that will handle the client FilesUploadStart event. + */ +interface ASPxClientUploadControlFilesUploadStartEventHandler { + /** + * A method that will handle the FilesUploadStart event. + * @param source The event source. Identifies the ASPxUploadControl control that raised the event. + * @param e A ASPxClientUploadControlFilesUploadStartEventArgs object that contains event data. + */ + (source: S, e: ASPxClientUploadControlFilesUploadStartEventArgs): void; +} +/** + * Provides data for the FilesUploadStart event. + */ +interface ASPxClientUploadControlFilesUploadStartEventArgs extends ASPxClientEventArgs { + /** + * Gets or sets a value indicating whether the action which raised the event should be canceled. + * Value: true if the action that raised the event should be canceled; otherwise, false. + */ + cancel: boolean; +} +/** + * A method that handles the FileUploadComplete client event. + */ +interface ASPxClientUploadControlFileUploadCompleteEventHandler { + /** + * A method that will handle the corresponding client event. + * @param source The event source. This parameter identifies the upload control which raised the event. + * @param e An ASPxClientUploadControlFileUploadCompleteEventArgs object that contains event data. + */ + (source: S, e: ASPxClientUploadControlFileUploadCompleteEventArgs): void; +} +/** + * Provides data for the FileUploadComplete event. + */ +interface ASPxClientUploadControlFileUploadCompleteEventArgs extends ASPxClientEventArgs { + /** + * Gets the index of a file input element within the ASPxUploadControl. + * Value: An integer value that specifies the file input element's index. + */ + inputIndex: number; + /** + * Gets or sets a value indicating whether the uploaded file passes validation. + * Value: true if the file is valid; otherwise, false. + */ + isValid: boolean; + /** + * Gets the error text to be displayed within the ASPxUploadControl's error frame. + * Value: A string value that represents the error text. + */ + errorText: string; + /** + * Gets a string that contains specific information (if any) passed from the server side for further client processing. + * Value: A string value representing callback data passed from the server. + */ + callbackData: string; +} +/** + * A method that will handle the FilesUploadComplete client event. + */ +interface ASPxClientUploadControlFilesUploadCompleteEventHandler { + /** + * A method that will handle the client FilesUploadComplete event. + * @param source The event source. This parameter identifies the upload control which raised the event. + * @param e A object that contains event data. + */ + (source: S, e: ASPxClientUploadControlFilesUploadCompleteEventArgs): void; +} +/** + * Provides data for the FilesUploadComplete client event, which enables you to perform specific actions after all selected files have been uploaded. + */ +interface ASPxClientUploadControlFilesUploadCompleteEventArgs extends ASPxClientEventArgs { + /** + * Gets the error text to be displayed within the upload control's error frame. + * Value: A string value that is the error text. + */ + errorText: string; + /** + * Gets a string that contains specific information (if any) passed from the server side for further client processing. + * Value: A string value that is the callback data passed from the server. + */ + callbackData: string; +} +/** + * A method that will handle the TextChanged client event. + */ +interface ASPxClientUploadControlTextChangedEventHandler { + /** + * A method that will handle the TextChanged client event. + * @param source The event source. This parameter identifies the upload control which raised the event. + * @param e An ASPxClientUploadControlTextChangedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientUploadControlTextChangedEventArgs): void; +} +/** + * Provides data for the TextChanged client event that allows you to respond to an end-user changing an edit box's text. + */ +interface ASPxClientUploadControlTextChangedEventArgs extends ASPxClientEventArgs { + /** + * Gets the index of a file input element within the ASPxUploadControl. + * Value: An integer value that specifies the file input element's index. + */ + inputIndex: number; +} +/** + * A method that will handle the ASPxUploadControl's client event, concerned with changes in upload progress. + */ +interface ASPxClientUploadControlUploadingProgressChangedEventHandler { + /** + * A method that will handle the ASPxUploadControl's client event concerning the uploading process being changed. + * @param source An object representing the event's source. Identifies the ASPxUploadControl object that raised the event. + * @param e An ASPxClientUploadControlUploadingProgressChangedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientUploadControlUploadingProgressChangedEventArgs): void; +} +/** + * Provides data for the UploadingProgressChanged event. + */ +interface ASPxClientUploadControlUploadingProgressChangedEventArgs extends ASPxClientEventArgs { + /** + * Gets the number of the files selected for upload. + * Value: An integer value that represents the total number of selected files. + */ + fileCount: number; + /** + * Gets the name of the file being currently uploaded. + * Value: A string value that represents the file name. + */ + currentFileName: string; + /** + * Gets the content length of the currently uploaded file. + * Value: An integer value specifying the content length. + */ + currentFileContentLength: number; + /** + * Gets the content length of the current file already uploaded to the server. + * Value: An integer value that is the content length. + */ + currentFileUploadedContentLength: number; + /** + * Gets the position of the current file upload progress. + * Value: An value specifying the upload progress position. + */ + currentFileProgress: number; + /** + * Gets the content length of the files selected for upload. + * Value: An integer value specifying the total content length of the selected files. + */ + totalContentLength: number; + /** + * Gets the content length of the files already uploaded to the server. + * Value: An integer value that represents the content length. + */ + uploadedContentLength: number; + /** + * Gets the current position of total upload progress. + * Value: An value specifying the total upload progress position. + */ + progress: number; +} +/** + * A method that will handle the DropZoneEnter event. + */ +interface ASPxClientUploadControlDropZoneEnterEventHandler { + /** + * A method that will handle the DropZoneEnter event. + * @param source The event source. This parameter identifies the upload control object which raised the event. + * @param e An ASPxClientUploadControlDropZoneEnterEventArgs object that contains event data. + */ + (source: S, e: ASPxClientUploadControlDropZoneEnterEventArgs): void; +} +/** + * Provides data for the DropZoneEnter event. + */ +interface ASPxClientUploadControlDropZoneEnterEventArgs extends ASPxClientEventArgs { + /** + * Gets a drop zone object related to the processed event. + * Value: An object that is a drop zone related to the processed event. + */ + dropZone: Object; +} +/** + * A method that will handle the DropZoneLeave event. + */ +interface ASPxClientUploadControlDropZoneLeaveEventHandler { + /** + * A method that will handle the DropZoneLeave event. + * @param source The event source. Identifies the upload control object that raised the event. + * @param e A ASPxClientUploadControlDropZoneLeaveEventArgs object that contains event data. + */ + (source: S, e: ASPxClientUploadControlDropZoneLeaveEventArgs): void; +} +/** + * Provides data for the DropZoneLeave event. + */ +interface ASPxClientUploadControlDropZoneLeaveEventArgs extends ASPxClientEventArgs { + /** + * Gets a drop zone object related to the processed event. + * Value: An object that is a drop zone related to the processed event. + */ + dropZone: Object; +} +/** + * The JavaScript equivalent of the ASPxChartDesigner class. + */ +interface ASPxClientChartDesigner extends ASPxClientControl { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientChartDesigner. + */ + CallbackError: ASPxClientEvent>; + /** + * Occurs when executing the Save command on the client. + */ + SaveCommandExecute: ASPxClientEvent>; + /** + * Enables you to customize the menu actions of a Client Chart Designer. + */ + CustomizeMenuActions: ASPxClientEvent>; + /** + * Sends a callback to the server and generates the server-side event, passing it the specified argument. + * @param arg A string value that represents any information that needs to be sent to the server-side event. + */ + PerformCallback(arg: string): void; + /** + * + * @param arg + * @param onSuccess + */ + PerformCallback(arg: string, onSuccess: (arg1: string) => void): void; + /** + * Updates the localization settings of the ASPxClientChartDesigner properties. + * @param localization A dictionary containing the property names, along with their localized equivalents. + */ + UpdateLocalization(localization: { [key: string]: string; }): void; + /** + * Returns the model of the Client Chart Designer. + */ + GetDesignerModel(): Object; + /** + * For internal use. + */ + GetJsonChartModel(): string; +} +/** + * A method that will handle the SaveCommandExecute event. + */ +interface ASPxClientChartDesignerSaveCommandExecuteEventHandler { + /** + * Represents a method that will handle the SaveCommandExecute event. + * @param source The event source. This parameter identifies the ASPxChartDesigner which raised the event. + * @param e A ASPxClientChartDesignerSaveCommandExecuteEventArgs object which contains event data. + */ + (source: S, e: ASPxClientChartDesignerSaveCommandExecuteEventArgs): void; +} +/** + * Provides data for a chart control's SaveCommandExecute event. + */ +interface ASPxClientChartDesignerSaveCommandExecuteEventArgs extends ASPxClientEventArgs { + /** + * Gets or sets a value specifying whether an event has been handled. + * Value: true, if the event hasn't been handled by a control; otherwise, false. + */ + handled: boolean; +} +/** + * Represents a method that will handle the CustomizeMenuActions events. + */ +interface ASPxClientChartDesignerCustomizeMenuActionsEventHandler { + /** + * Represents a method that will handle the CustomizeMenuActions event. + * @param source The event source. This parameter identifies the ASPxChartDesigner which raised the event. + * @param e An ASPxClientChartDesignerCustomizeMenuActionsEventArgs object which contains event data. + */ + (source: S, e: ASPxClientChartDesignerCustomizeMenuActionsEventArgs): void; +} +/** + * An action of the Client Chart Designer's menu. + */ +interface ASPxClientChartDesignerMenuAction { + /** + * Provides access to the text for the command. + * Value: A String value. + */ + text: string; + /** + * Provides access to the CSS class of the command's glyph. + * Value: A String value. + */ + imageClassName: string; + /** + * Provides access to the action performed when the Client Chart Designer's button is clicked. + * Value: The specific action implementation. + */ + clickAction: Function; + /** + * Provides access to the value that specifies whether or not the command is disabled by default. + * Value: true, if the command is disabled by default; otherwise, false. + */ + disabled: boolean; + /** + * Provides access to the value that specifies whether or not the command is visible in the designer user interface. + * Value: true if the command is visible; otherwise false. + */ + visible: boolean; + /** + * Provides access to the keyboard shortcut used to invoke the command. + * Value: A String value. + */ + hotKey: string; + /** + * Provides access to the value that specifies whether or not the command has a visual separator. + * Value: true, if the command has a visual separator; otherwise, false. + */ + hasSeparator: string; + /** + * Provides access to the location of the displayed command. + * Value: A String value. + */ + container: string; +} +/** + * Provides data for a chart control's CustomizeMenuActions event on the client side. + */ +interface ASPxClientChartDesignerCustomizeMenuActionsEventArgs extends ASPxClientEventArgs { + /** + * Returns an array of the Client Chart Designer's menu actions. + * Value: An array of the ASPxClientChartDesignerMenuAction objects. + */ + actions: ASPxClientChartDesignerMenuAction[]; +} +/** + * A class which provides access to the entire hierarchy of chart elements on the client side. + */ +interface ASPxClientWebChartControl extends ASPxClientControl { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientWebChartControl. + */ + CallbackError: ASPxClientEvent>; + /** + * Occurs on the client side when any chart element is hot-tracked. + */ + ObjectHotTracked: ASPxClientEvent>; + /** + * Occurs before crosshair items are drawn when the chart's contents are being drawn. + */ + CustomDrawCrosshair: ASPxClientEvent>; + /** + * Occurs on the client side when any chart element is selected. + */ + ObjectSelected: ASPxClientEvent>; + /** + * Returns an ASPxClientWebChart object, which contains information about the hierarchy of a chart control, and provides access to the main properties of chart elements on the client side. + */ + GetChart(): ASPxClientWebChart; + /** + * Returns the printing options of the chart control. + */ + GetPrintOptions(): ASPxClientChartPrintOptions; + /** + * Changes the mouse pointer, which is shown when the mouse is over the chart control, to the pointer with the specified name. + * @param cursor A string value representing the name of the desired cursor. + */ + SetCursor(cursor: string): void; + /** + * Returns the specific chart element which is located under the test point. + * @param x An integer value that specifies the x coordinate of the test point. + * @param y An integer value that specifies the y coordinate of the test point. + */ + HitTest(x: number, y: number): ASPxClientHitObject[]; + /** + * Sends a callback to the server and generates the server-side event, passing it the specified argument. + * @param args A string value that represents any information that needs to be sent to the server-side event. + */ + PerformCallback(args: string): void; + /** + * + * @param args + * @param onSuccess + */ + PerformCallback(args: string, onSuccess: (arg1: string) => void): void; + /** + * Prints the current chart on the client side. + */ + Print(): void; + /** + * Loads a chart which should be customized from its object model. + * @param serializedChartObjectModel A String object representing the chart model. + */ + LoadFromObjectModel(serializedChartObjectModel: string): void; + /** + * Exports a chart to the file of the specified format, and saves it to the disk. + * @param format A string value specifying the format, to which a chart should be exported. + */ + SaveToDisk(format: string): void; + /** + * Exports a chart to a file in the specified format, and saves it to disk, using the specified file name. + * @param format A string value specifying the format, to which a chart should be exported. + * @param filename A string value specifying the file name, to which a chart should be exported. If this parameter is missing or set to an empty string, then the created file will be named using the client-side name of a chart. + */ + SaveToDisk(format: string, filename: string): void; + /** + * Exports a report to the file of the specified format, and shows it in a new Web Browser window. + * @param format A string value specifying a format in which a report should be exported. + */ + SaveToWindow(format: string): void; + /** + * Gets the main DOM (Document Object Model) element on a Web Page representing this ASPxClientWebChartControl object. + */ + GetMainDOMElement(): Object; +} +/** + * A method that will handle the CustomDrawCrosshair event. + */ +interface ASPxClientWebChartControlCustomDrawCrosshairEventHandler { + /** + * A method that will handle the CustomDrawCrosshair event. + * @param source The event source. This parameter identifies the chartControl which raised the event. + * @param e An ASPxClientWebChartControlCustomDrawCrosshairEventArgs object which contains event data. + */ + (source: S, e: ASPxClientWebChartControlCustomDrawCrosshairEventArgs): void; +} +/** + * Provides data for a chart control's CustomDrawCrosshair event. + */ +interface ASPxClientWebChartControlCustomDrawCrosshairEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets crosshair elements settings to custom draw a crosshair cursor. + * Value: An ASPxClientCrosshairElement object. + */ + crosshairElements: ASPxClientCrosshairElement; + /** + * Gets the settings of crosshair axis label elements to customize their appearance. + * Value: An ASPxClientCrosshairAxisLabelElement object. + */ + cursorCrosshairAxisLabelElements: ASPxClientCrosshairAxisLabelElement; + /** + * Gets crosshair line element settings that are used to custom draw a crosshair cursor. + * Value: An ASPxClientCrosshairLineElement object that contains crosshair line element settings. + */ + cursorCrosshairLineElement: ASPxClientCrosshairLineElement; + /** + * Gets the settings of crosshair group header elements to customize their appearance. + * Value: An ASPxClientCrosshairGroupHeaderElement object. + */ + crosshairGroupHeaderElements: ASPxClientCrosshairGroupHeaderElement; + /** + * Provides access to the settings of crosshair elements and crosshair group header elements to customize their appearance. + * Value: An ASPxClientCrosshairElementGroup object. + */ + crosshairElementGroups: ASPxClientCrosshairElementGroup; +} +/** + * Represents the client-side equivalent of the CrosshairElement class. + */ +interface ASPxClientCrosshairElement { + /** + * Gets a series that a crosshair element hovers over when implementing a custom draw. + * Value: An ASPxClientSeries object which represents the series currently being painted. + */ + Series: ASPxClientSeries; + /** + * Gets the series point that a crosshair element hovers over when implementing a custom draw. + * Value: An ASPxClientSeriesPoint object, representing the series point that a crosshair element hovers over. + */ + Point: ASPxClientSeriesPoint; + /** + * Gets or sets the crosshair line element to custom draw a crosshair cursor. + * Value: An ASPxClientCrosshairLineElement object, representing the crosshair line element. + */ + LineElement: ASPxClientCrosshairLineElement; + /** + * Provides access to the crosshair axis label element. + * Value: An ASPxClientCrosshairAxisLabelElement object, representing the crosshair axis label element. + */ + AxisLabelElement: ASPxClientCrosshairAxisLabelElement; + /** + * Gets the crosshair label element. + * Value: An ASPxClientCrosshairSeriesLabelElement object, representing the crosshair label element. + */ + LabelElement: ASPxClientCrosshairSeriesLabelElement; + /** + * Specifies whether the crosshair element is visible when implementing custom drawing in the crosshair cursor. + * Value: true, if the crosshair element is visible; otherwise, false. + */ + visible: boolean; +} +/** + * Represents the client-side equivalent of the CrosshairLineElement class. + */ +interface ASPxClientCrosshairLineElement { +} +/** + * Represents the client-side equivalent of the CrosshairAxisLabelElement class. + */ +interface ASPxClientCrosshairAxisLabelElement { +} +/** + * The client-side equivalent of the CrosshairGroupHeaderElement class. + */ +interface ASPxClientCrosshairGroupHeaderElement { +} +/** + * The client-side equivalent of the CrosshairLabelElement class. + */ +interface ASPxClientCrosshairSeriesLabelElement { +} +/** + * Represents the client-side equivalent of the CrosshairElementGroup class. + */ +interface ASPxClientCrosshairElementGroup { +} +/** + * Represents a method that will handle the ObjectSelected events. + */ +interface ASPxClientWebChartControlHotTrackEventHandler { + /** + * Represents a method that will handle the ObjectSelected events. + * @param source The event source. This parameter identifies the ASPxClientWebChartControl which raised the event. + * @param e An ASPxClientWebChartControlHotTrackEventArgs object which contains event data. + */ + (source: S, e: ASPxClientWebChartControlHotTrackEventArgs): void; +} +/** + * Provides data for a chart control's ObjectSelected events on the client side. + */ +interface ASPxClientWebChartControlHotTrackEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Provides access on the client side to the chart element, for which the event was raised. + * Value: An ASPxClientWebChartElement object, which represents the chart element for which the event was raised. + */ + hitObject: ASPxClientWebChartElement; + /** + * Provides access on the client side to the object, which is in some way related to the object being hit. The returned value depends on the hitObject type and hit point location. + * Value: An ASPxClientWebChartElement object representing an additional object that relates to the one being hit. + */ + additionalHitObject: ASPxClientWebChartElement; + /** + * Gets details on the chart elements located at the point where an end-user has clicked when hot-tracking or selecting a chart element on the client side. + * Value: An ASPxClientWebChartHitInfo object, which contains information about the chart elements located at the point where an end-user has clicked. + */ + hitInfo: ASPxClientWebChartHitInfo; + /** + * Provides access on the client side to the chart and all its elements. + * Value: An ASPxClientWebChart object, which provides access to chart properties. + */ + chart: ASPxClientWebChart; + /** + * Gets the HTML object that contains the processed item. + * Value: An object representing a container for the item related to the event. + */ + htmlElement: Object; + /** + * Gets the X-coordinate of the hit test point, relative to the top left corner of the chart. + * Value: An integer value specifying X-coordinate of the hit test point (in pixels). + */ + x: number; + /** + * Gets the Y-coordinate of the hit test point, relative to the top left corner of the chart. + * Value: An integer value specifying Y-coordinate of the hit test point (in pixels). + */ + y: number; + /** + * Gets the X-coordinate of the hit test point, relative to the top left corner of the Web Page containing this chart. + * Value: An integer value specifying X-coordinate of the hit test point (in pixels). + */ + absoluteX: number; + /** + * Gets the Y-coordinate of the hit test point, relative to the top left corner of the Web Page containing this chart. + * Value: An integer value specifying Y-coordinate of the hit test point (in pixels). + */ + absoluteY: number; + /** + * Gets a value indicating whether the hot-tracking or object selection should be canceled. + * Value: true to cancel the hot-tracking or selection of an object; otherwise, false. + */ + cancel: boolean; +} +/** + * Represents an object under the hit test point within a chart control, on the client side. + */ +interface ASPxClientHitObject { + /** + * Gets the chart element for which the event was raised. + * Value: An ASPxClientWebChartElement object, representing the chart element for which the event was raised. + */ + Object: ASPxClientWebChartElement; + /** + * Provides access to an object, which is in some way related to the object being hit. The returned value depends on the Object type and hit point location. + * Value: An ASPxClientWebChartElement object that represents an additional object related to the one being hit. + */ + AdditionalObject: ASPxClientWebChartElement; +} +/** + * Contains information about a specific test point within a chart control, on the client side. + */ +interface ASPxClientWebChartHitInfo { + /** + * Gets a value indicating whether the test point is within the chart. + * Value: true if the test point is within a chart; otherwise, false. + */ + inChart: boolean; + /** + * Gets a value indicating whether the test point is within the chart title. + * Value: true if the test point is within a chart title; otherwise, false. + */ + inChartTitle: boolean; + /** + * Gets a value indicating whether the test point is within the axis. + * Value: true if the test point is within an axis; otherwise, false. + */ + inAxis: boolean; + /** + * Gets a value indicating whether the test point is within the axis label item. + * Value: true if the test point is within an axis label item; otherwise, false. + */ + inAxisLabelItem: boolean; + /** + * Gets a value indicating whether the test point is within the axis title. + * Value: true if the test point is within an axis title; otherwise, false. + */ + inAxisTitle: boolean; + /** + * Gets a value indicating whether the test point is within the constant line. + * Value: true if the test point is within a constant line; otherwise, false. + */ + inConstantLine: boolean; + /** + * Gets a value indicating whether the test point is within the diagram. + * Value: true if the test point is within a diagram; otherwise, false. + */ + inDiagram: boolean; + /** + * Gets a value indicating whether the test point is within the non-default pane. + * Value: true if the test point is within a non-default pane; otherwise, false. + */ + inNonDefaultPane: boolean; + /** + * Gets a value indicating whether the test point is within the legend. + * Value: true if the test point is within a legend; otherwise, false. + */ + inLegend: boolean; + /** + * Gets the value indicating whether or not the test point is within a custom legend item. + * Value: true if the test point is within a custom legend item; otherwise, false. + */ + inCustomLegendItem: boolean; + /** + * Gets a value indicating whether the test point is within the series. + * Value: true if the test point is within a series; otherwise, false. + */ + inSeries: boolean; + /** + * Gets a value indicating whether the test point is within the series label. + * Value: true if the test point is within a series label; otherwise, false. + */ + inSeriesLabel: boolean; + /** + * Gets a value indicating whether the test point is within the series point. + * Value: true if the test point is within a series point; otherwise, false. + */ + inSeriesPoint: boolean; + /** + * Gets a value indicating whether the test point is within the series title. + * Value: true if the test point is within a series title; otherwise, false. + */ + inSeriesTitle: boolean; + /** + * Gets a value indicating whether the test point is within the trendline. + * Value: true if the test point is within a trendline; otherwise, false. + */ + inTrendLine: boolean; + /** + * Gets a value indicating whether the test point is within the Fibonacci Indicator. + * Value: true if the test point is within a Fibonacci Indicator; otherwise, false. + */ + inFibonacciIndicator: boolean; + /** + * Gets a value indicating whether the test point is within the regression line. + * Value: true if the test point is within a regression line; otherwise, false. + */ + inRegressionLine: boolean; + /** + * Gets a value specifying whether the test point is within an indicator. + * Value: true if the test point is within an indicator; otherwise, false. + */ + inIndicator: boolean; + /** + * Gets a value indicating whether the test point is within an annotation. + * Value: true if the test point is within an annotation; otherwise, false. + */ + inAnnotation: boolean; + /** + * Gets a value indicating whether the test point is within a hyperlink. + * Value: true, if the test point is within a hyperlink; otherwise, false. + */ + inHyperlink: boolean; + /** + * Gets the client-side chart instance from under the test point. + * Value: An ASPxClientWebChart object. + */ + chart: ASPxClientWebChart; + /** + * Gets the client-side chart title instance from under the test point. + * Value: An ASPxClientChartTitle object. + */ + chartTitle: ASPxClientChartTitle; + /** + * Gets the client-side axis instance from under the test point. + * Value: An ASPxClientAxisBase descendant. + */ + axis: ASPxClientAxisBase; + /** + * Gets the client-side constant line instance from under the test point. + * Value: An ASPxClientConstantLine object. + */ + constantLine: ASPxClientConstantLine; + /** + * Gets the client-side diagram instance from under the test point. + * Value: An ASPxClientXYDiagramBase descendant. + */ + diagram: ASPxClientXYDiagramBase; + /** + * Gets the client-side non-default pane instance from under the test point. + * Value: An ASPxClientXYDiagramPane object. + */ + nonDefaultPane: ASPxClientXYDiagramPane; + /** + * Gets the client-side legend instance from under the test point. + * Value: An ASPxClientLegend object. + */ + legend: ASPxClientLegend; + /** + * Gets a custom legend item which is located under the test point. + * Value: An ASPxClientCustomLegendItem object which represents the item located under the test point. + */ + customLegendItem: ASPxClientCustomLegendItem; + /** + * Gets the client-side series instance from under the test point. + * Value: An ASPxClientSeries object. + */ + series: ASPxClientSeries; + /** + * Gets the client-side series label instance from under the test point. + * Value: An ASPxClientSeriesLabel object. + */ + seriesLabel: ASPxClientSeriesLabel; + /** + * Gets the client-side series title instance from under the test point. + * Value: An ASPxClientSeriesTitle object. + */ + seriesTitle: ASPxClientSeriesTitle; + /** + * Gets the client-side trendline instance from under the test point. + * Value: An ASPxClientTrendLine object. + */ + trendLine: ASPxClientTrendLine; + /** + * Gets the client-side Fibonacci indicator instance from under the test point. + * Value: An ASPxClientFibonacciIndicator object. + */ + fibonacciIndicator: ASPxClientFibonacciIndicator; + /** + * Gets the client-side regression line instance from under the test point. + * Value: An ASPxClientRegressionLine object. + */ + regressionLine: ASPxClientRegressionLine; + /** + * Gets the client-side indicator instance from under the test point. + * Value: An ASPxClientIndicator descendant. + */ + indicator: ASPxClientIndicator; + /** + * Gets the client-side annotation instance from under the test point. + * Value: An ASPxClientAnnotation object. + */ + annotation: ASPxClientAnnotation; + /** + * Gets the client-side series point instance from under the test point. + * Value: An ASPxClientSeriesPoint object. + */ + seriesPoint: ASPxClientSeriesPoint; + /** + * Gets the client-side axis label item instance from under the test point. + * Value: An ASPxClientAxisLabelItem object. + */ + axisLabelItem: ASPxClientAxisLabelItem; + /** + * Gets the client-side axis title instance from under the test point. + * Value: An ASPxClientAxisTitle object. + */ + axisTitle: ASPxClientAxisTitle; + /** + * Returns a hyperlink which is located under the test point. + * Value: A String object representing a hyperlink. + */ + hyperlink: string; +} +/** + * Represents the client-side equivalent of the DiagramCoordinates class. + */ +interface ASPxClientDiagramCoordinates { + /** + * Gets the type of the argument scale. + * Value: A string object which contains the current scale type. + */ + argumentScaleType: string; + /** + * Gets the type of the value scale. + * Value: A string object which contains the current scale type. + */ + valueScaleType: string; + /** + * Gets the argument of the data point as a text string. + * Value: A string object, representing a data point's argument. + */ + qualitativeArgument: string; + /** + * Gets the numerical representation of the data point's argument. + * Value: A Double value, representing the data point's argument. + */ + numericalArgument: number; + /** + * Gets the date-time representation of the data point's argument. + * Value: A date object, representing the point's argument. + */ + dateTimeArgument: Date; + /** + * Gets the numerical representation of the data point's value. + * Value: A Double value, representing the data point's value. + */ + numericalValue: number; + /** + * Gets the date-time representation of the data point's value. + * Value: A date object, representing the point's value. + */ + dateTimeValue: Date; + /** + * Gets the X-axis of the diagram point. + * Value: An ASPxClientAxisBase descendant, representing the axis of arguments (X-axis). + */ + axisX: ASPxClientAxisBase; + /** + * Gets the Y-axis of the diagram point. + * Value: An ASPxClientAxisBase descendant, representing the axis of values (Y-axis). + */ + axisY: ASPxClientAxisBase; + /** + * Gets the pane of the diagram point. + * Value: An ASPxClientXYDiagramPane descendant, representing the pane. + */ + pane: ASPxClientXYDiagramPane; + /** + * Checks whether the current object represents a point outside the diagram area. + */ + IsEmpty(): boolean; + /** + * Gets the value of the client-side axis instance. + * @param axis An ASPxClientAxisBase class descendant, representing the axis that contains the requested value. + */ + GetAxisValue(axis: ASPxClientAxisBase): ASPxClientAxisValue; +} +/** + * Contains the information about an axis value. + */ +interface ASPxClientAxisValue { + /** + * Gets the axis scale type. + * Value: A String value, specifying the axis scale type. + */ + scaleType: string; + /** + * Gets the axis value, if the axis scale type is qualitative. + * Value: A String value, specifying the axis value. + */ + qualitativeValue: string; + /** + * Gets the axis value, if the axis scale type is numerical. + * Value: A Double value, specifying the axis value. + */ + numericalValue: number; + /** + * Gets the axis value, if the axis scale type is date-time. + * Value: A DateTime value, specifying the axis value. + */ + dateTimeValue: Date; +} +/** + * Represents the client-side equivalent of the ControlCoordinates class. + */ +interface ASPxClientControlCoordinates { + /** + * Gets the point's pane. + * Value: An ASPxClientXYDiagramPane object. + */ + pane: ASPxClientXYDiagramPane; + /** + * Gets the point's X-coordinate, in pixels. + * Value: An integer value, specifying the X-coordinate (in pixels). + */ + x: number; + /** + * Gets the point's Y-coordinate, in pixels. + * Value: An integer value, specifying the Y-coordinate (in pixels). + */ + y: number; + /** + * Gets the point's visibility state. + * Value: "Visible", "Hidden", or "Undefined". + */ + visibility: string; +} +/** + * Represents the client-side equivalent of the ChartElement class. + */ +interface ASPxClientWebChartElement { + /** + * Gets the chart that owns the current chart element. + * Value: An ASPxClientWebChart object, to which the chart element belongs. + */ + chart: ASPxClientWebChart; +} +/** + * Represents a base class for chart elements, which are not necessarily required to be present on the client side. + */ +interface ASPxClientWebChartEmptyElement extends ASPxClientWebChartElement { +} +/** + * Represents a base class for chart elements, which are required to be present on the client side. + */ +interface ASPxClientWebChartRequiredElement extends ASPxClientWebChartElement { +} +/** + * Represents the client-side equivalent of the ChartElementNamed class. + */ +interface ASPxClientWebChartElementNamed extends ASPxClientWebChartRequiredElement { + /** + * Gets the name of the chart element. + * Value: A string object representing the name of the chart element. + */ + name: string; +} +/** + * Represents the client-side equivalent of the WebChartControl control. + */ +interface ASPxClientWebChart extends ASPxClientWebChartRequiredElement { + /** + * Gets the client-side Chart Control that owns the current chart. + * Value: An ASPxClientWebChartControl object, to which the chart belongs. + */ + chartControl: ASPxClientWebChartControl; + /** + * Gets the chart's diagram and provides access to its settings. + * Value: An ASPxClientRadarDiagram), that represents the chart's diagram. + */ + diagram: ASPxClientWebChartElement; + /** + * Provides access to the chart's collection of series. + * Value: An array of ASPxClientSeries objects that represent the collection of series. + */ + series: ASPxClientSeries[]; + /** + * Provides access to the collection of chart titles. + * Value: An array of ASPxClientChartTitle objects, that represent the collection of chart titles. + */ + titles: ASPxClientChartTitle[]; + /** + * Provides access to the chart's collection of annotations. + * Value: An array of ASPxClientAnnotation objects, representing the collection of annotations. + */ + annotations: ASPxClientAnnotation[]; + /** + * Gets the chart's legend and provides access to its settings. + * Value: An ASPxClientLegend object that represents the chart's legend. + */ + legend: ASPxClientLegend; + /** + * Returns the collection of legends. + * Value: An array of ASPxClientLegend objects. + */ + legends: ASPxClientLegend[]; + /** + * Gets the name of the appearance, which is currently used to draw the chart's elements. + * Value: A string value that represents the appearance name. + */ + appearanceName: string; + /** + * Gets the name of the palette currently used to draw the chart's series. + * Value: A string value that represents the palette name. + */ + paletteName: string; + /** + * Gets a value indicating whether series tooltips should be shown. + * Value: true to show tooltips for series; otherwise, false. + */ + showSeriesToolTip: boolean; + /** + * Gets a value indicating whether point tooltips should be shown. + * Value: true to show tooltips for series points; otherwise, false. + */ + showPointToolTip: boolean; + /** + * Gets a value indicating whether a crosshair cursor should be shown. + * Value: true to show a crosshair cursor; otherwise, false. + */ + showCrosshair: boolean; + /** + * Gets a value that contains information on how the tooltip position is defined, for example, relative to a mouse pointer or chart element. + * Value: An ASPxClientToolTipPosition class descendant that defines the tooltip position type. + */ + toolTipPosition: ASPxClientToolTipPosition; + /** + * Returns the tooltip controller that shows tooltips for chart elements. + * Value: An ASPxClientToolTipController object. + */ + toolTipController: ASPxClientToolTipController; + /** + * Gets the settings for a crosshair cursor concerning its position and appearance on a diagram. + * Value: An ASPxClientCrosshairOptions object descendant which provides access to crosshair cursor options on a diagram. + */ + crosshairOptions: ASPxClientCrosshairOptions; + /** + * Gets a css postfix for a chart. + * Value: A string value. + */ + cssPostfix: string; + /** + * Gets or sets a value which specifies how the chart elements are selected. + * Value: A String object representing the name of the selection mode. + */ + selectionMode: string; +} +/** + * Represents the client-side equivalent of the SimpleDiagram class. + */ +interface ASPxClientSimpleDiagram extends ASPxClientWebChartEmptyElement { +} +/** + * Represents the base class for all diagram classes, which have X and Y axes. + */ +interface ASPxClientXYDiagramBase extends ASPxClientWebChartRequiredElement { + /** + * Gets the X-axis. + * Value: An ASPxClientAxisBase object which represents the X-axis. + */ + axisX: ASPxClientAxisBase; + /** + * Gets the Y-axis. + * Value: An ASPxClientAxisBase object which represents the Y-axis. + */ + axisY: ASPxClientAxisBase; +} +/** + * Represents the client-side equivalent of the XYDiagram2D class. + */ +interface ASPxClientXYDiagram2D extends ASPxClientXYDiagramBase { + /** + * Provides access to a collection of secondary X-axes for a given 2D XY-diagram. + * Value: An array of ASPxClientAxis objects, that is a collection of secondary X-axes. + */ + secondaryAxesX: ASPxClientAxis[]; + /** + * Provides access to a collection of secondary Y-axes for a given 2D XY-diagram. + * Value: An array of ASPxClientAxis objects, that is a collection of secondary X-axes. + */ + secondaryAxesY: ASPxClientAxis[]; + /** + * Provides access to a default pane object. + * Value: An ASPxClientXYDiagramPane object which represents the default pane of a chart. + */ + defaultPane: ASPxClientXYDiagramPane; + /** + * Provides access to an array of a diagram's panes. + * Value: An array of ASPxClientXYDiagramPane objects. + */ + panes: ASPxClientXYDiagramPane[]; + /** + * Converts the display coordinates into a diagram coordinates object. + * @param x An integer value, representing the X-coordinate of a point (measured in pixels relative to the top left corner of a chart). + * @param y An integer value, representing the Y-coordinate of a point (measured in pixels relative to the top left corner of a chart). + */ + PointToDiagram(x: number, y: number): ASPxClientDiagramCoordinates; + /** + * Converts the diagram coordinates of a point into screen coordinates. + * @param argument An object, representing the point's argument. + * @param value An object, representing the point's value. + * @param axisX An ASPxClientAxis2D descendant, representing the X-axis. + * @param axisY An ASPxClientAxis2D descendant, representing the Y-axis. + * @param pane An ASPxClientXYDiagramPane object, representing the pane. + */ + DiagramToPoint(argument: Object, value: Object, axisX: ASPxClientAxis2D, axisY: ASPxClientAxis2D, pane: ASPxClientXYDiagramPane): ASPxClientControlCoordinates; +} +/** + * Represents the client-side equivalent of the XYDiagram class. + */ +interface ASPxClientXYDiagram extends ASPxClientXYDiagram2D { + /** + * Gets a value indicating whether the diagram is rotated. + * Value: true if the diagram is rotated; otherwise, false. + */ + rotated: boolean; +} +/** + * Represents the client-side equivalent of the SwiftPlotDiagram class. + */ +interface ASPxClientSwiftPlotDiagram extends ASPxClientXYDiagram2D { +} +/** + * Represents the client-side equivalent of the XYDiagramPane class. + */ +interface ASPxClientXYDiagramPane extends ASPxClientWebChartElementNamed { + /** + * Gets the diagram that owns the current pane object. + * Value: An ASPxClientXYDiagram object, to which the pane belongs. + */ + diagram: ASPxClientXYDiagram; +} +/** + * Represents the client-side equivalent of the XYDiagram3D class. + */ +interface ASPxClientXYDiagram3D extends ASPxClientXYDiagramBase { +} +/** + * Represents the client-side equivalent of the RadarDiagram class. + */ +interface ASPxClientRadarDiagram extends ASPxClientXYDiagramBase { + /** + * Converts the display coordinates into a diagram coordinates object. + * @param x An integer value, representing the X-coordinate of a point (measured in pixels relative to the top left corner of a chart). + * @param y An integer value, representing the Y-coordinate of a point (measured in pixels relative to the top left corner of a chart). + */ + PointToDiagram(x: number, y: number): ASPxClientDiagramCoordinates; + /** + * Converts the diagram coordinates of a point into screen coordinates. + * @param argument An object, representing the point's argument. + * @param value An object, representing the point's value. + */ + DiagramToPoint(argument: Object, value: Object): ASPxClientControlCoordinates; +} +/** + * Represents the client-side equivalent of the AxisBase class. + */ +interface ASPxClientAxisBase extends ASPxClientWebChartElementNamed { + /** + * Provides access to the XY-diagram which contains the current axis. + * Value: An ASPxClientXYDiagramBase class descendant. + */ + diagram: ASPxClientXYDiagramBase; + /** + * Provides acess to the range of the axis coordinates. + * Value: An ASPxClientAxisRange object, which contains the common range settings of the axis coordinates. + */ + range: ASPxClientAxisRange; +} +/** + * Represents the client-side equivalent of the Axis2D class. + */ +interface ASPxClientAxis2D extends ASPxClientAxisBase { + /** + * Provides access to an axis title object. + * Value: An ASPxClientAxisTitle object which represents the axis title. + */ + axisTitle: ASPxClientAxisTitle; + /** + * Provides access to the axis strips collection. + * Value: An array of ASPxClientStrip objects. + */ + strips: ASPxClientStrip[]; + /** + * Provides access to the collection of the axis constant lines. + * Value: An array of ASPxClientConstantLine objects which represent constant lines that belong to this axis. + */ + constantLines: ASPxClientConstantLine[]; +} +/** + * Represents the client-side equivalent of the Axis class. + */ +interface ASPxClientAxis extends ASPxClientAxis2D { + /** + * Gets a value indicating whether the axis is reversed. + * Value: true if the axis is reversed; otherwise, false. + */ + reverse: boolean; +} +/** + * Represents the client-side equivalent of the SwiftPlotDiagramAxis class. + */ +interface ASPxClientSwiftPlotDiagramAxis extends ASPxClientAxis2D { +} +/** + * Represents the client-side equivalent of the Axis3D class. + */ +interface ASPxClientAxis3D extends ASPxClientAxisBase { +} +/** + * Represents the client-side equivalent of the RadarAxis class. + */ +interface ASPxClientRadarAxis extends ASPxClientAxisBase { +} +/** + * Represents the client-side equivalent of the AxisTitle class. + */ +interface ASPxClientAxisTitle extends ASPxClientWebChartRequiredElement { + /** + * Gets the axis to which the axis title belongs. + * Value: An ASPxClientAxisBase descendant, which identifies the axis. + */ + axis: ASPxClientAxisBase; + /** + * Gets the text of the axis title. + * Value: A string object which contains the axis title's text. + */ + text: string; +} +/** + * Represents the client-side equivalent of the AxisLabelItem class. + */ +interface ASPxClientAxisLabelItem extends ASPxClientWebChartRequiredElement { + /** + * Gets the axis to which an axis label item belongs. + * Value: An ASPxClientAxisBase descendant, which identifies the axis. + */ + axis: ASPxClientAxisBase; + /** + * Gets the text of an axis label item. + * Value: A string object which contains the axis label item's text. + */ + text: string; + /** + * Gets the axis value to which an axis label item corresponds. + * Value: An object that specifies the axis value. + */ + axisValue: Object; + /** + * Gets the internal representation of the axis value to which an axis label item corresponds. + * Value: A Double value which specifies the internal representation of the axis value. + */ + axisValueInternal: number; +} +/** + * Represents the client-side equivalent of the AxisRange class. + */ +interface ASPxClientAxisRange extends ASPxClientWebChartRequiredElement { + /** + * Gets the axis that owns the current axis range object. + * Value: An ASPxClientAxisBase object, to which the axis range belongs. + */ + axis: ASPxClientAxisBase; + /** + * Gets the minimum value to display on an axis. + * Value: An object representing the minimum value of the axis range. + */ + minValue: Object; + /** + * Gets the maximum value to display on an axis. + * Value: An object representing the maximum value of the axis range. + */ + maxValue: Object; + /** + * Gets the internal float representation of the range minimum value. + * Value: A Double value which specifies the internal representation of the range minimum value. + */ + minValueInternal: number; + /** + * Gets the internal float representation of the range maximum value. + * Value: A Double value which specifies the internal representation of the range maximum value. + */ + maxValueInternal: number; +} +/** + * Represents the client-side equivalent of the Strip class. + */ +interface ASPxClientStrip extends ASPxClientWebChartElementNamed { + /** + * Gets the axis that owns the current strip object. + * Value: An ASPxClientAxis object, to which the strip belongs. + */ + axis: ASPxClientAxis; + /** + * Gets the minimum value of the strip's range. + * Value: An object that represents the minimum value of the strip's range. + */ + minValue: Object; + /** + * Gets the maximum value of the strip's range. + * Value: An object that represents the maximum value of the strip's range. + */ + maxValue: Object; +} +/** + * Represents the client-side equivalent of the ConstantLine class. + */ +interface ASPxClientConstantLine extends ASPxClientWebChartElementNamed { + /** + * Gets the axis that owns the current constant line object. + * Value: An ASPxClientAxis object, to which the constant line belongs. + */ + axis: ASPxClientAxis; + /** + * Gets the constant line's position along the axis. + * Value: An object that specifies the constant line's position. + */ + value: Object; + /** + * Gets the constant line title. + * Value: A string object, representing the title's text. + */ + title: string; +} +/** + * Represents the client-side equivalent of the Series class. + */ +interface ASPxClientSeries extends ASPxClientWebChartElementNamed { + /** + * Gets a value that specifies the view type of the series. + * Value: A string object which contains the current view type. + */ + viewType: string; + /** + * Gets a value that specifies the scale type for the argument data of the series' data points. + * Value: A string object which contains the current scale type. + */ + argumentScaleType: string; + /** + * Gets a value that specifies the scale type for the value data of the series' data points. + * Value: A string object which contains the current scale type. + */ + valueScaleType: string; + /** + * Gets the X-Axis that is used to plot the current series on the XY-diagram. + * Value: A string object, which represents the X-axis name. + */ + axisX: string; + /** + * Gets the Y-Axis that is used to plot the current series on the XY-diagram. + * Value: A string object, which represents the Y-axis name. + */ + axisY: string; + /** + * Gets the pane that is used to plot the current series on the XY-diagram. + * Value: A string object, which represents the pane's name. + */ + pane: string; + /** + * Gets a value indicating whether the series is visible. + * Value: true if the series is visible; otherwise, false. + */ + visible: boolean; + /** + * Gets a value that specifies whether or not a tooltip is enabled for a chart. + * Value: true - a tooltip is enabled for a chart; false - a tooltip is disabled. + */ + toolTipEnabled: boolean; + /** + * Gets the text to be displayed within series tooltips. + * Value: A string value. + */ + toolTipText: string; + /** + * Gets an image to be displayed within series tooltips. + * Value: A string value. + */ + toolTipImage: string; + /** + * Gets the settings of series labels. + * Value: An ASPxClientSeriesLabel object, which provides the series label settings. + */ + label: ASPxClientSeriesLabel; + /** + * Gets the series' collection of data points. + * Value: An array of ASPxClientSeriesPoint objects, that represent the series' data points. + */ + points: ASPxClientSeriesPoint[]; + /** + * Provides access to the collection of series titles. + * Value: An array of ASPxClientSeriesTitle objects, that represent the collection of series titles. + */ + titles: ASPxClientSeriesTitle[]; + /** + * Gets the series' collection of indicators. + * Value: An array of ASPxClientIndicator objects, that belong to the series. + */ + indicators: ASPxClientIndicator[]; + /** + * Provides access to the collection of regression lines. + * Value: An array of ASPxClientRegressionLine objects which represent regression lines available for the series. + */ + regressionLines: ASPxClientRegressionLine[]; + /** + * Provides access to the collection of trendlines. + * Value: An array of ASPxClientTrendLine objects, that represent the collection of trendlines. + */ + trendLines: ASPxClientTrendLine[]; + /** + * Provides access to the collection of Fibonacci Indicators. + * Value: An array of ASPxClientFibonacciIndicator objects, that represent the collection of Fibonacci Indicators. + */ + fibonacciIndicators: ASPxClientFibonacciIndicator[]; + /** + * Gets the color of a series. + * Value: A string value. + */ + color: string; + /** + * Gets a value that defines a group for stacked series. + * Value: A string value. + */ + stackedGroup: string; + /** + * Gets a string which represents the pattern specifying the text to be displayed within a crosshair label for the current Series type. + * Value: A Empty. + */ + crosshairLabelPattern: string; + /** + * This property is intended for internal use only. + * Value: A String value. + */ + groupedElementsPattern: string; + /** + * Returns a collection of crosshair value items. + * Value: An array of ASPxClientCrosshairValueItem objects. + */ + crosshairValueItems: ASPxClientCrosshairValueItem[]; + /** + * Gets a value indicating whether a crosshair cursor is enabled. + * Value: true if a crosshair cursor is enabled; otherwise, false. + */ + actualCrosshairEnabled: boolean; + /** + * Gets a value indicating whether a crosshair label should be shown for this series. + * Value: true if crosshair labels are visible; otherwise, false. + */ + actualCrosshairLabelVisibility: boolean; +} +/** + * Represents the client-side equivalent of the SeriesLabelBase class. + */ +interface ASPxClientSeriesLabel extends ASPxClientWebChartElement { + /** + * Gets the series that owns the current series label object. + * Value: An ASPxClientSeries object, to which the series label belongs. + */ + series: ASPxClientSeries; + /** + * Gets the common text for all series point labels. + * Value: Returns an empty string object. + */ + text: string; +} +/** + * Represents the client-side equivalent of the SeriesPoint class. + */ +interface ASPxClientSeriesPoint extends ASPxClientWebChartRequiredElement { + /** + * Gets the series that owns the current series point object. + * Value: An ASPxClientSeries object, to which the series point belongs. + */ + series: ASPxClientSeries; + /** + * Gets the data point's argument. + * Value: An object that specifies the data point's argument. + */ + argument: Object; + /** + * Gets the point's data value(s). + * Value: An array of objects that represent the data value(s) of the series data point. + */ + values: Object[]; + /** + * Gets the text to be displayed within series points tooltips. + * Value: A string value. + */ + toolTipText: string; + /** + * Gets the color of a series point. + * Value: A string value. + */ + color: string; + /** + * Gets the percent value of a series point. + * Value: A float value. + */ + percentValue: number; + /** + * Gets a hint that is shown in series points tooltips. + * Value: A string value. + */ + toolTipHint: string; +} +/** + * Represents the client-side equivalent of the Legend class. + */ +interface ASPxClientLegend extends ASPxClientWebChartEmptyElement { + /** + * Returns a value which determines whether to use checkboxes instead of markers on a chart legend for all legend items. + * Value: true, if legend checkboxes are shown instead of markers for all legend items; otherwise, false. + */ + useCheckBoxes: boolean; + /** + * Returns a collection of custom legend items of the legend. + * Value: A collection of ASPxClientCustomLegendItem objects. + */ + customItems: ASPxClientCustomLegendItem[]; + /** + * Returns the name of the legend. + * Value: The string value representing the name of the legend. + */ + name: string; +} +/** + * Represents the base for ASPxClientSeriesTitle classes. + */ +interface ASPxClientTitleBase extends ASPxClientWebChartRequiredElement { + /** + * Gets the lines of text within a title. + * Value: An array of string values containing the text of a title. + */ + lines: string[]; + /** + * Gets the alignment of the title. + * Value: A string value containing the text, which specifies the alignment of a title. + */ + alignment: string; + /** + * Gets a value that specifies to which edges of a parent element the title should be docked. + * Value: A string value. + */ + dock: string; +} +/** + * Represents the client-side equivalent of the ChartTitle class. + */ +interface ASPxClientChartTitle extends ASPxClientTitleBase { +} +/** + * Represents the client-side equivalent of the SeriesTitle class. + */ +interface ASPxClientSeriesTitle extends ASPxClientTitleBase { + /** + * Gets the series that owns the current title object. + * Value: An ASPxClientSeries object, to which the series title belongs. + */ + series: ASPxClientSeries; +} +/** + * Represents the client-side equivalent of the Indicator class. + */ +interface ASPxClientIndicator extends ASPxClientWebChartElementNamed { + /** + * Gets the indicator's associated series. + * Value: An ASPxClientSeries object. + */ + series: ASPxClientSeries; +} +/** + * Represents the client-side equivalent of the FinancialIndicator class. + */ +interface ASPxClientFinancialIndicator extends ASPxClientIndicator { + /** + * Gets the first point of the financial indicator. + * Value: An ASPxClientFinancialIndicatorPoint object, which represents a financial indicator's first point. + */ + point1: ASPxClientFinancialIndicatorPoint; + /** + * Gets the second point of the financial indicator. + * Value: An ASPxClientFinancialIndicatorPoint object, which represents a financial indicator's second point. + */ + point2: ASPxClientFinancialIndicatorPoint; +} +/** + * Represents the client-side equivalent of the TrendLine class. + */ +interface ASPxClientTrendLine extends ASPxClientFinancialIndicator { +} +/** + * Represents the client-side equivalent of the FibonacciIndicator class. + */ +interface ASPxClientFibonacciIndicator extends ASPxClientFinancialIndicator { +} +/** + * Represents the client-side equivalent of the FinancialIndicatorPoint class. + */ +interface ASPxClientFinancialIndicatorPoint extends ASPxClientWebChartRequiredElement { + /** + * Gets the financial indicator that owns the current financial indicator point. + * Value: An ASPxClientFinancialIndicator object, to which the point belongs. + */ + financialIndicator: ASPxClientFinancialIndicator; + /** + * Gets the argument of the financial indicator's point. + * Value: An object that specifies the point argument. + */ + argument: Object; + /** + * Gets a value, indicating how the value of a financial indicator's point is obtained. + * Value: A string value, which indicates how to obtain a financial indicator point's value. + */ + valueLevel: string; +} +/** + * The client-side equivalent of the SingleLevelIndicator class. + */ +interface ASPxClientSingleLevelIndicator extends ASPxClientIndicator { + /** + * Gets a value specifying the value level to which the single-level indicator corresponds. + * Value: A string value. + */ + valueLevel: string; +} +/** + * Represents the client-side equivalent of the RegressionLine class. + */ +interface ASPxClientRegressionLine extends ASPxClientSingleLevelIndicator { +} +/** + * The client-side equivalent of the MovingAverage class. + */ +interface ASPxClientMovingAverage extends ASPxClientSingleLevelIndicator { + /** + * Gets the number of data points used to calculate the moving average. + * Value: An integer value, specifying the number of points. + */ + pointsCount: number; + /** + * Gets a value specifying whether to display a Moving Average, Envelope, or both. + * Value: A string value. + */ + kind: string; + /** + * Gets a value specifying the Envelope percent. + * Value: A double value which specifies the Envelope percent. + */ + envelopePercent: number; +} +/** + * The client-side equivalent of the SimpleMovingAverage class. + */ +interface ASPxClientSimpleMovingAverage extends ASPxClientMovingAverage { +} +/** + * The client-side equivalent of the ExponentialMovingAverage class. + */ +interface ASPxClientExponentialMovingAverage extends ASPxClientMovingAverage { +} +/** + * The client-side equivalent of the WeightedMovingAverage class. + */ +interface ASPxClientWeightedMovingAverage extends ASPxClientMovingAverage { +} +/** + * The client-side equivalent of the TriangularMovingAverage class. + */ +interface ASPxClientTriangularMovingAverage extends ASPxClientMovingAverage { +} +/** + * Represents the client-side equivalent of the TripleExponentialMovingAverageTema class. + */ +interface ASPxClientTripleExponentialMovingAverageTema extends ASPxClientMovingAverage { +} +/** + * Represents the client-side equivalent of the BollingerBands class. + */ +interface ASPxClientBollingerBands extends ASPxClientIndicator { + /** + * Gets the number of data points used to calculate the indicator values. + * Value: An integer value, specifying the number of points. + */ + pointsCount: number; + /** + * Gets a value, indicating whose series point values are used to calculate the indicator's values. + * Value: A string value, which indicates which series point value should be used to calculate indicator values. + */ + valueLevel: string; +} +/** + * Represents the client-side equivalent of the MedianPrice class. + */ +interface ASPxClientMedianPrice extends ASPxClientIndicator { +} +/** + * Represents the client-side equivalent of the TypicalPrice class. + */ +interface ASPxClientTypicalPrice extends ASPxClientIndicator { +} +/** + * Represents the client-side equivalent of the WeightedClose class. + */ +interface ASPxClientWeightedClose extends ASPxClientIndicator { +} +/** + * Represents the client-side equivalent of the SeparatePaneIndicator class. + */ +interface ASPxSeparatePaneIndicator extends ASPxClientIndicator { + /** + * Returns the name of the Y-axis that is used to plot the current indicator on a ASPxClientXYDiagram. + * Value: A string value specifying the Y-axis name. + */ + axisY: string; + /** + * Returns the name of a pane, used to plot the separate pane indicator on an XYDiagram. + * Value: A string that is the name of a pane. + */ + pane: string; +} +/** + * Represents the client-side equivalent of the AverageTrueRange class. + */ +interface ASPxClientAverageTrueRange extends ASPxSeparatePaneIndicator { + /** + * Gets the number of data points used to calculate the indicator values. + * Value: An integer value, specifying the number of points. + */ + pointsCount: number; +} +/** + * Represents the client-side equivalent of the ChaikinsVolatility class. + */ +interface ASPxClientChaikinsVolatility extends ASPxSeparatePaneIndicator { + /** + * Gets the number of data points used to calculate the indicator values. + * Value: An integer value, specifying the number of points. + */ + pointsCount: number; +} +/** + * Represents the client-side equivalent of the CommodityChannelIndex class. + */ +interface ASPxClientCommodityChannelIndex extends ASPxSeparatePaneIndicator { + /** + * Gets the number of data points used to calculate the indicator values. + * Value: An integer value, specifying the number of points. + */ + pointsCount: number; +} +/** + * Represents the client-side equivalent of the DetrendedPriceOscillator class. + */ +interface ASPxClientDetrendedPriceOscillator extends ASPxSeparatePaneIndicator { + /** + * Gets the number of data points used to calculate the indicator values. + * Value: An integer value, specifying the number of points. + */ + pointsCount: number; + /** + * Gets a value, indicating whose series point values are used to calculate the indicator's values. + * Value: A string value, which indicates which series point value should be used to calculate indicator values. + */ + valueLevel: string; +} +/** + * Represents the client-side equivalent of the MassIndex class. + */ +interface ASPxClientMassIndex extends ASPxSeparatePaneIndicator { + /** + * Returns the count of points used to calculate the exponential moving average (EMA). + * Value: An integer value, specifying the count of points used to calculate EMA. + */ + movingAveragePointsCount: number; + /** + * Returns the count of summable values. + * Value: An integer value specifying the count of summable ratios. + */ + sumPointsCount: number; +} +/** + * Represents the client-side equivalent of the MovingAverageConvergenceDivergence class. + */ +interface ASPxClientMovingAverageConvergenceDivergence extends ASPxSeparatePaneIndicator { + /** + * Returns the short period value required to calculate the indicator. + * Value: An integer value specifying the short period value. + */ + shortPeriod: number; + /** + * Returns the long period value required to calculate the indicator. + * Value: An integer value specifying the long period. + */ + longPeriod: number; + /** + * Returns the smoothing period value required to calculate the indicator. + * Value: An integer value specifying the smoothing period value. + */ + signalSmoothingPeriod: number; +} +/** + * Represents the client-side equivalent of the RateOfChange class. + */ +interface ASPxClientRateOfChange extends ASPxSeparatePaneIndicator { + /** + * Gets the number of data points used to calculate the indicator values. + * Value: An integer value, specifying the number of points. + */ + pointsCount: number; + /** + * Gets a value, indicating whose series point values are used to calculate the indicator's values. + * Value: A string value, which indicates which series point value should be used to calculate indicator values. + */ + valueLevel: string; +} +/** + * Represents the client-side equivalent of the RelativeStrengthIndex class. + */ +interface ASPxClientRelativeStrengthIndex extends ASPxSeparatePaneIndicator { + /** + * Gets the number of data points used to calculate the indicator values. + * Value: An integer value, specifying the number of points. + */ + pointsCount: number; + /** + * Gets a value, indicating whose series point values are used to calculate the indicator's values. + * Value: A string value, which indicates which series point value should be used to calculate indicator values. + */ + valueLevel: string; +} +/** + * Represents the client-side equivalent of the StandardDeviation class. + */ +interface ASPxClientStandardDeviation extends ASPxSeparatePaneIndicator { + /** + * Gets the number of data points used to calculate the indicator values. + * Value: An integer value, specifying the number of points. + */ + pointsCount: number; + /** + * Gets a value, indicating whose series point values are used to calculate the indicator's values. + * Value: A string value, which indicates which series point value should be used to calculate indicator values. + */ + valueLevel: string; +} +/** + * Represents the client-side equivalent of the TripleExponentialMovingAverageTrix class. + */ +interface ASPxClientTripleExponentialMovingAverageTrix extends ASPxSeparatePaneIndicator { + /** + * Gets the number of data points used to calculate the indicator values. + * Value: An integer value, specifying the number of points. + */ + pointsCount: number; + /** + * Gets a value, indicating whose series point values are used to calculate the indicator's values. + * Value: A string value, which indicates which series point value should be used to calculate indicator values. + */ + valueLevel: string; +} +/** + * Represents the client-side equivalent of the WilliamsR class. + */ +interface ASPxClientWilliamsR extends ASPxSeparatePaneIndicator { + /** + * Gets the number of data points used to calculate the indicator values. + * Value: An integer value, specifying the number of points. + */ + pointsCount: number; +} +/** + * Represents the client-side equivalent of the FixedValueErrorBars class. + */ +interface ASPxClientFixedValueErrorBars extends ASPxClientIndicator { + /** + * Gets or sets the fixed positive error value. + * Value: A double value specifying the positive error value. + */ + positiveError: number; + /** + * Returns the fixed negative error value. + * Value: A double value specifying the negative error value. + */ + negativeError: number; +} +/** + * Represents the client-side equivalent of the PercentageErrorBars class. + */ +interface ASPxClientPercentageErrorBars extends ASPxClientIndicator { + /** + * Returns the value specifying the percentage of error values of series point values. + * Value: A double value specifying the percentage. Values less than or equal to 0 are not allowed. + */ + percent: number; +} +/** + * Represents the client-side equivalent of the StandardDeviationErrorBars class. + */ +interface ASPxClientStandardDeviationErrorBars extends ASPxClientIndicator { + /** + * Returns the multiplier on which the standard deviation value is multiplied before display. + * Value: A double value specifying the multiplier. Values less than 0 are not allowed. + */ + multiplier: number; +} +/** + * Represents the client-side equivalent of the StandardErrorBars class. + */ +interface ASPxClientStandardErrorBars extends ASPxClientIndicator { +} +/** + * Represents the client-side equivalent of the DataSourceBasedErrorBars class. + */ +interface ASPxClientDataSourceBasedErrorBars extends ASPxClientIndicator { +} +/** + * Represents the client-side equivalent of the Annotation class. + */ +interface ASPxClientAnnotation extends ASPxClientWebChartElementNamed { +} +/** + * Represents the client-side equivalent of the TextAnnotation class. + */ +interface ASPxClientTextAnnotation extends ASPxClientAnnotation { + /** + * Gets the lines of text within an annotation. + * Value: An array of string values containing the text of a title. + */ + lines: string[]; +} +/** + * Represents the client-side equivalent of the ImageAnnotation class. + */ +interface ASPxClientImageAnnotation extends ASPxClientAnnotation { +} +/** + * The client-side equivalent of the CrosshairValueItem class. + */ +interface ASPxClientCrosshairValueItem { + /** + * Gets the value that is displayed in a crosshair label. + * Value: A float value. + */ + value: number; + /** + * Gets an index of a point for which this crosshair value item is displayed. + * Value: An integer value. + */ + pointIndex: number; +} +/** + * The client-side equivalent of the ChartToolTipController class. + */ +interface ASPxClientToolTipController extends ASPxClientWebChartEmptyElement { + /** + * Gets a value indicating whether an image should be shown in tooltips. + * Value: true to show an image in tooltips; otherwise, false. + */ + showImage: boolean; + /** + * Gets a value indicating whether it is necessary to show text in tooltips. + * Value: true to show text in tooltips; otherwise, false. + */ + showText: boolean; + /** + * Gets a value that defines the position of an image within a tooltip. + * Value: A string value. + */ + imagePosition: string; + /** + * Gets a value that defines when tooltips should be invoked. + * Value: A string value. + */ + openMode: string; +} +/** + * The client-side equivalent of the ToolTipPosition class. + */ +interface ASPxClientToolTipPosition { +} +/** + * The client-side equivalent of the ToolTipRelativePosition class. + */ +interface ASPxClientToolTipRelativePosition extends ASPxClientToolTipPosition { + /** + * Gets the horizontal offset of a tooltip. + * Value: An integer value. + */ + offsetX: number; + /** + * Gets the vertical offset of a tooltip. + * Value: An integer value. + */ + offsetY: number; +} +/** + * The client-side equivalent of the ToolTipFreePosition class. + */ +interface ASPxClientToolTipFreePosition extends ASPxClientToolTipPosition { + /** + * Gets the horizontal offset of a tooltip. + * Value: An integer value. + */ + offsetX: number; + /** + * Gets the vertical offset of a tooltip. + * Value: An integer value. + */ + offsetY: number; + /** + * Gets the ID of a pane. + * Value: An integer value. + */ + paneID: number; + /** + * Gets an object containing settings that define how a tooltip should be docked. + * Value: A string value. + */ + dockPosition: string; +} +/** + * The client-side equivalent of the CrosshairLabelPosition class. + */ +interface ASPxClientCrosshairPosition { + /** + * Gets the horizontal offset of a crosshair cursor. + * Value: An integer value that is the X-offset. + */ + offsetX: number; + /** + * Gets the vertical offset of a crosshair cursor. + * Value: An integer value that is the Y-offset. + */ + offsetY: number; +} +/** + * The client-side equivalent of the CrosshairMousePosition class. + */ +interface ASPxClientCrosshairMousePosition extends ASPxClientCrosshairPosition { +} +/** + * The client-side equivalent of the CrosshairFreePosition class. + */ +interface ASPxClientCrosshairFreePosition extends ASPxClientCrosshairPosition { + /** + * Gets a Pane's ID when the crosshair cursor is in the free position mode. + * Value: An integer value that is the pane's ID. + */ + paneID: number; + /** + * Gets a string containing information on a crosshair label's dock position when the crosshair cursor is in the free position mode. + * Value: A string value containing information on a crosshair label's dock position. + */ + dockPosition: string; +} +/** + * Defines line style settings. + */ +interface ASPxClientLineStyle extends ASPxClientWebChartElement { + /** + * Gets the dash style used to paint the line. + * Value: A string value that contains information about the style used to paint the line. + */ + dashStyle: string; + /** + * Gets the thickness that corresponds to the value of the current ASPxClientLineStyle object. + * Value: An integer value which specifies the thickness, in pixels. + */ + thickness: number; + /** + * Returns the join style for the ends of consecutive lines. + * Value: A string representing the name of the line join type. + */ + lineJoin: string; +} +/** + * The client-side equivalent of the CrosshairOptions class. + */ +interface ASPxClientCrosshairOptions extends ASPxClientWebChartEmptyElement { + /** + * Gets a value indicating whether it is necessary to show a crosshair label for the X-axis. + * Value: true to show a crosshair label for the X-axis; otherwise, false. + */ + showAxisXLabels: boolean; + /** + * Gets a value indicating whether it is necessary to show a crosshair label for the Y-axis. + * Value: true to show the crosshair label for the Y-axis; otherwise, false. + */ + showAxisYLabels: boolean; + /** + * Gets a value that defines whether a crosshair label of a series point indicated by a crosshair cursor is shown on a diagram. + * Value: true if a crosshair label indicated by a crosshair cursor is shown on a diagram; otherwise, false. + */ + showCrosshairLabels: boolean; + /** + * Gets a value that indicates whether a crosshair cursor argument line is shown for a series point on a diagram. + * Value: true if a crosshair cursor argument line is displayed on a diagram; otherwise, false. + */ + showArgumentLine: boolean; + /** + * Specifies whether to show a value line of a series point indicated by a crosshair cursor on a diagram. + * Value: true to display a value line indicated by a crosshair cursor on a diagram; otherwise, false. + */ + showValueLine: boolean; + /** + * Gets a value that specifies whether to show a crosshair cursor in a focused pane only. + * Value: true to display a crosshair cursor in a focused pane; otherwise, false. + */ + showOnlyInFocusedPane: boolean; + /** + * Specifies the current snap mode of a crosshair cursor. + * Value: A string value. + */ + snapMode: string; + /** + * Specifies the way in which the crosshair label is shown for a series on a diagram. + * Value: A string value that specifies how the crosshair label is shown for a series. + */ + crosshairLabelMode: string; + /** + * Gets a value that indicates whether to show a header for each series group in crosshair cursor labels. + * Value: true, to show a group header in crosshair cursor labels; otherwise, false. + */ + showGroupHeaders: boolean; + /** + * Gets a string which represents the pattern specifying the group header text to be displayed within the crosshair label. + * Value: A String, which represents the group header's pattern. + */ + groupHeaderPattern: string; + /** + * Gets the color of a crosshair argument line. + * Value: A String value, specifying the color of a crosshair argument line. + */ + argumentLineColor: string; + /** + * Gets the color of a crosshair value line. + * Value: A String value, specifying the color of a crosshair value line. + */ + valueLineColor: string; +} +/** + * The chart print options storage. + */ +interface ASPxClientChartPrintOptions { + /** + * Gets the size mode used to print a chart. + */ + GetSizeMode(): string; + /** + * Sets the size mode used to print a chart. + * @param sizeMode A System.String object, specifying the name of the size mode. + */ + SetSizeMode(sizeMode: string): void; + /** + * Gets a value indicating that the landscape orientation will be used to print a chart. + */ + GetLandscape(): boolean; + /** + * Sets a value indicating that the landscape orientation will be used to print a chart. + * @param landscape A Boolean value, specifying that the landscape orientation will be used to print a chart. + */ + SetLandscape(landscape: boolean): void; + /** + * Gets the left margin which will be used to print a chart. + */ + GetMarginLeft(): number; + /** + * Sets the left margin which will be used to print a chart. + * @param marginLeft A System.Int32 value, specifying the margin in hundredths of an inch. + */ + SetMarginLeft(marginLeft: number): void; + /** + * Gets the top margin which will be used to print a chart. + */ + GetMarginTop(): number; + /** + * Sets the top margin which will be used to print a chart. + * @param marginTop A System.Int32 value, specifying the margin in hundredths of an inch. + */ + SetMarginTop(marginTop: number): void; + /** + * Gets the right margin which will be used to print a chart. + */ + GetMarginRight(): number; + /** + * Sets the right margin which will be used to print a chart. + * @param marginRight A System.Int32 value, specifying the margin in hundredths of an inch. + */ + SetMarginRight(marginRight: number): void; + /** + * Gets the bottom margin which will be used to print a chart. + */ + GetMarginBottom(): number; + /** + * Sets the bottom margin which will be used to print a chart. + * @param marginBottom A System.Int32 value, specifying the margin in hundredths of an inch. + */ + SetMarginBottom(marginBottom: number): void; + /** + * Gets the predefined size ratio of the paper which will be used to print a chart. + */ + GetPaperKind(): string; + /** + * Sets the predefined size ratio of the paper which will be used to print a chart. + * @param paperKind A System.String object, specifying the name of a size ratio. + */ + SetPaperKind(paperKind: string): void; + /** + * Gets the custom paper width which will be used to print a chart. + */ + GetCustomPaperWidth(): number; + /** + * Sets the custom paper width which will be used to print a chart. + * @param customPaperWidth A System.Int32 object, specifying the width in hundredths of an inch. + */ + SetCustomPaperWidth(customPaperWidth: number): void; + /** + * Gets the custom paper height which will be used to print a chart. + */ + GetCustomPaperHeight(): number; + /** + * Sets the custom paper height which will be used to print a chart. + * @param customPaperHeight A System.Int32 object, specifying the height in hundredths of an inch. + */ + SetCustomPaperHeight(customPaperHeight: number): void; + /** + * Gets the name of the custom paper width-height ratio used to print the chart. + */ + GetCustomPaperName(): string; + /** + * Sets the name of the custom paper width-height ratio used to print a chart. + * @param customPaperName A String object, specifying the name of the custom paper width-height ratio. + */ + SetCustomPaperName(customPaperName: string): void; +} +/** + * Represents the client-side equivalent of the CustomLegendItem class. + */ +interface ASPxClientCustomLegendItem extends ASPxClientWebChartElementNamed { + /** + * Returns the text displayed by the custom legend item. + * Value: A string value that specifies legend item text. + */ + text: string; +} +/** + * The client-side equivalent of the ASPxDocumentViewer control. + */ +interface ASPxClientDocumentViewer extends ASPxClientControl { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientDocumentViewer. + */ + CallbackError: ASPxClientEvent>; + /** + * Occurs when the value of an item within the Document Viewer's report toolbar is changed. + */ + ToolbarItemValueChanged: ASPxClientEvent>; + /** + * Occurs when an item within the Document Viewer's report toolbar is clicked. + */ + ToolbarItemClick: ASPxClientEvent>; + /** + * Occurs on the client side when a report page is loaded into this ASPxClientDocumentViewer instance. + */ + PageLoad: ASPxClientEvent>; + /** + * Provides access to the Splitter of the ASPxClientDocumentViewer. + */ + GetSplitter(): ASPxClientSplitter; + /** + * Provides access to the ASPxClientDocumentViewer's preview that exposes methods to print and export the document. + */ + GetViewer(): ASPxClientReportViewer; + /** + * Provides access to the Document Viewer toolbar on the client. + */ + GetToolbar(): ASPxClientReportToolbar; + /** + * Provides access to the Ribbon of the ASPxClientDocumentViewer. + */ + GetRibbonToolbar(): ASPxClientRibbon; + /** + * Provides access to the parameters panel of the ASPxClientDocumentViewer. + */ + GetParametersPanel(): ASPxClientReportParametersPanel; + /** + * Provides access to the document of the ASPxClientDocumentViewer. + */ + GetDocumentMap(): ASPxClientReportDocumentMap; + /** + * Sets focus on the report control specified by its bookmark. + * @param pageIndex An integer value, specifying the page index. + * @param bookmarkPath A String value, specifying the path to the bookmark. + */ + GotoBookmark(pageIndex: number, bookmarkPath: string): void; + /** + * Initiates a round trip to the server so that the current page will be reloaded. + */ + Refresh(): void; + /** + * Prints the current document. + */ + Print(): void; + /** + * Prints the document's page with the specified page index. + * @param pageIndex A Int32 representing the index of the page to be printed. + */ + Print(pageIndex: number): void; + /** + * Displays the specified report page. + * @param pageIndex An integer value, identifying the report page. + */ + GotoPage(pageIndex: number): void; + /** + * Invokes the Search dialog, which allows end-users to search for specific text in a report. + */ + Search(): void; + /** + * Gets a value indicating whether or not searching text across a report is permitted in the web browser. + */ + IsSearchAllowed(): boolean; + /** + * Exports a report to a file of the specified format, and shows it in a new Web Browser window. + * @param format A string specifying the format to which a report should be exported. + */ + SaveToWindow(format: string): void; + /** + * Exports a report to a file of the specified format, and saves it to the disk. + * @param format A string specifying the format to which a report should be exported. + */ + SaveToDisk(format: string): void; +} +/** + * A method that will handle the ItemValueChanged event. + */ +interface ASPxClientToolbarItemValueChangedEventHandler { + /** + * A method that will handle the ToolbarItemValueChanged event. + * @param source A Object that is the event source. + * @param e An ASPxClientToolbarItemValueChangedEventArgs object, containing the event arguments. + */ + (source: S, e: ASPxClientToolbarItemValueChangedEventArgs): void; +} +/** + * Provides data for the ItemValueChanged event. + */ +interface ASPxClientToolbarItemValueChangedEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the menu item object related to the event. + * Value: An ASPxClientMenuItem object, manipulations on which forced the event to be raised. + */ + item: ASPxClientMenuItem; + /** + * Provides access to the toolbar's value editor on the client. + * Value: An ASPxClientControl descendant. + */ + editor: ASPxClientControl; +} +/** + * The client-side equivalent of the ASPxQueryBuilder control. + */ +interface ASPxClientQueryBuilder extends ASPxClientControl { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientQueryBuilder. + */ + CallbackError: ASPxClientEvent>; + /** + * Enables you to customize the menu actions of a Query Builder. + */ + CustomizeToolbarActions: ASPxClientEvent>; + /** + * Occurs when executing the Save command on the client. + */ + SaveCommandExecute: ASPxClientEvent>; + /** + * Sends a callback to the server with the specified argument. + * @param arg A String value, specifying the callback argument. + */ + PerformCallback(arg: string): void; + /** + * + * @param arg + * @param onSuccess + */ + PerformCallback(arg: string, onSuccess: (arg1: string) => void): void; + /** + * Updates the localization settings of the ASPxClientQueryBuilder properties. + * @param localization A dictionary containing the property names, along with their localized equivalents. + */ + UpdateLocalization(localization: { [key: string]: string; }): void; + /** + * Returns the object model of a Query Builder. + */ + GetDesignerModel(): Object; + /** + * Gets a client-side model of the currently opened query serialized to Json. + */ + GetJsonQueryModel(): string; + /** + * Saves the current query. + */ + Save(): void; + /** + * Invokes a Data Preview for the current query. + */ + ShowPreview(): void; + /** + * Specifies whether or not the current query is a valid SQL string. + */ + IsQueryValid(): boolean; +} +/** + * A method that will handle the SaveCommandExecute event. + */ +interface ASPxClientQueryBuilderSaveCommandExecuteEventHandler { + /** + * A method that will handle the SaveCommandExecute event. + * @param source The event sender. + * @param e An ASPxClientQueryBuilderSaveCommandExecuteEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientQueryBuilderSaveCommandExecuteEventArgs): void; +} +/** + * Provides data for the SaveCommandExecute event. + */ +interface ASPxClientQueryBuilderSaveCommandExecuteEventArgs extends ASPxClientEventArgs { + /** + * Specifies whether or not the event was handled. + * Value: true if the event was handled and default processing should not occur; false if the event should be handled using default processing. + */ + handled: boolean; +} +/** + * A method that will handle the CustomizeToolbarActions event. + */ +interface ASPxClientQueryBuilderCustomizeToolbarActionsEventHandler { + /** + * A method that will handle the CustomizeToolbarActions event. + * @param source The event sender. + * @param e An ASPxClientQueryBuilderCustomizeToolbarActionsEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientQueryBuilderCustomizeToolbarActionsEventArgs): void; +} +/** + * Provides settings to the actions listed in a Query Builder menu. + */ +interface ASPxClientQueryBuilderMenuAction { + /** + * Provides access to the text for the command. + * Value: A String value. + */ + text: string; + /** + * Provides access to the CSS class of the command's glyph. + * Value: A String value. + */ + imageClassName: string; + /** + * Provides access to the action performed when a Query Builder's button is clicked. + * Value: The specific action implementation. + */ + clickAction: Function; + /** + * Provides access to the value that specifies whether or not the command is disabled by default. + * Value: true, if the command is disabled by default; otherwise, false. + */ + disabled: boolean; + /** + * Provides access to the value that specifies whether or not the command is visible in the Query Builder user interface. + * Value: true if the command is visible; otherwise false. + */ + visible: boolean; + /** + * Provides access to the keyboard shortcut used to invoke the command. + * Value: A String value. + */ + hotKey: string; + /** + * Provides access to the value that specifies whether or not the command has a visual separator. + * Value: true, if the command has a visual separator; otherwise, false. + */ + hasSeparator: string; + /** + * Provides access to the location of the displayed command. + * Value: A String value. + */ + container: string; +} +/** + * Provides data for the CustomizeToolbarActions event. + */ +interface ASPxClientQueryBuilderCustomizeToolbarActionsEventArgs extends ASPxClientEventArgs { + /** + * Returns the collection of customized menu actions. + * Value: An ASPxClientQueryBuilderMenuAction array. + */ + Actions: ASPxClientQueryBuilderMenuAction[]; + /** + * Returns a menu action with the specified ID. + * @param actionId A String value, specifying the action ID. + */ + GetById(actionId: string): ASPxClientQueryBuilderMenuAction; +} +/** + * The client-side equivalent of the Web Report Designer control. + */ +interface ASPxClientReportDesigner extends ASPxClientControl { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientReportDesigner. + */ + CallbackError: ASPxClientEvent>; + /** + * Occurs when executing the Save command on the client. + */ + SaveCommandExecute: ASPxClientEvent>; + /** + * Enables you to customize the menu actions of a Web Report Designer. + */ + CustomizeMenuActions: ASPxClientEvent>; + /** + * Occurs each time a standard editor is created for a report parameter based on a parameter type. + */ + CustomizeParameterEditors: ASPxClientEvent>; + /** + * Occurs on the client side when the Report Designer is being closed. + */ + ExitDesigner: ASPxClientEvent>; + /** + * Sends a callback to the server with the specified argument. + * @param arg A String value, specifying the callback argument. + */ + PerformCallback(arg: string): void; + /** + * + * @param arg + * @param onSuccess + */ + PerformCallback(arg: string, onSuccess: (arg1: string) => void): void; + /** + * Updates the localization settings of the ASPxClientReportDesigner properties. + * @param localization A dictionary containing the property names, along with their localized equivalents. + */ + UpdateLocalization(localization: { [key: string]: string; }): void; + /** + * Returns the object model of a Web Report Designer. + */ + GetDesignerModel(): Object; + /** + * Gets a client-side model of the currently opened report serialized to Json. + */ + GetJsonReportModel(): string; + /** + * Returns serialization information for the specific property of the specific control type. + * @param controlType A string that identifies the name of the control type for which serialization information is to be returned. + * @param propertyDisplayName A string that identifies the name of the property for which serialization information is to be returned. + */ + GetPropertyInfo(controlType: string, propertyDisplayName: string): ASPxDesignerElementSerializationInfo; + /** + * Indicates whether or not the current ASPxClientReportDesigner instance has been modified. + */ + IsModified(): boolean; + /** + * Resets the value returned by the IsModified method. + */ + ResetIsModified(): void; +} +/** + * A method that will handle the SaveCommandExecute event. + */ +interface ASPxClientReportDesignerSaveCommandExecuteEventHandler { + /** + * A method that will handle the SaveCommandExecute event. + * @param source The event sender. + * @param e An ASPxClientReportDesignerSaveCommandExecuteEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientReportDesignerSaveCommandExecuteEventArgs): void; +} +/** + * Provides data for the SaveCommandExecute event. + */ +interface ASPxClientReportDesignerSaveCommandExecuteEventArgs extends ASPxClientEventArgs { + /** + * Specifies whether or not the event was handled. + * Value: true if the event was handled and default processing should not occur; false if the event should be handled using default processing. + */ + handled: boolean; +} +/** + * A method that will handle the CustomizeMenuActions event. + */ +interface ASPxClientReportDesignerCustomizeMenuActionsEventHandler { + /** + * A method that will handle the CustomizeMenuActions event. + * @param source The event sender. + * @param e An ASPxClientReportDesignerCustomizeMenuActionsEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientReportDesignerCustomizeMenuActionsEventArgs): void; +} +/** + * Provides settings to the actions listed in a Web Report Designer menu. + */ +interface ASPxClientReportDesignerMenuAction { + /** + * Provides access to the text for the command. + * Value: A String value. + */ + text: string; + /** + * Provides access to the CSS class of the command's glyph. + * Value: A String value. + */ + imageClassName: string; + /** + * Provides access to the action performed when a Web Report Designer's button is clicked. + * Value: The specific action implementation. + */ + clickAction: Function; + /** + * Provides access to the value that specifies whether or not the command is disabled by default. + * Value: true, if the command is disabled by default; otherwise, false. + */ + disabled: boolean; + /** + * Provides access to the value that specifies whether or not the command is visible in the designer user interface. + * Value: true if the command is visible; otherwise false. + */ + visible: boolean; + /** + * Provides access to the keyboard shortcut used to invoke the command. + * Value: A String value. + */ + hotKey: string; + /** + * Provides access to the value that specifies whether or not the command has a visual separator. + * Value: true, if the command has a visual separator; otherwise, false. + */ + hasSeparator: string; + /** + * Provides access to the location of the displayed command. + * Value: A String value. + */ + container: string; +} +/** + * Provides data for the CustomizeMenuActions event. + */ +interface ASPxClientReportDesignerCustomizeMenuActionsEventArgs extends ASPxClientEventArgs { + /** + * Returns the collection of customized menu actions. + * Value: An ASPxClientReportDesignerMenuAction array. + */ + Actions: ASPxClientReportDesignerMenuAction[]; + /** + * Returns a menu action with the specified ID. + * @param actionId A String value, specifying the action ID. + */ + GetById(actionId: string): ASPxClientReportDesignerMenuAction; +} +/** + * Provides data for the ExitDesigner event. + */ +interface ASPxClientReportDesignerExitDesignerEventArgs extends ASPxClientEventArgs { +} +/** + * A method that will handle the CustomizeParameterEditors event. + */ +interface ASPxClientReportDesignerCustomizeParameterEditorsEventHandler { + /** + * A method that will handle the CustomizeParameterEditors event. + * @param source The event sender. + * @param e An ASPxClientCustomizeParameterEditorsEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientCustomizeParameterEditorsEventArgs): void; +} +/** + * A method that will handle the ExitDesigner event. + */ +interface ASPxClientReportDesignerExitDesignerEventHandler { + /** + * A method that will handle the ExitDesigner event. + * @param source The event sender. + * @param e An ASPxClientReportDesignerExitDesignerEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientReportDesignerExitDesignerEventArgs): void; +} +/** + * The client-side equivalent of the ASPxClientDocumentViewer control's Document Map. + */ +interface ASPxClientReportDocumentMap extends ASPxClientControl { + /** + * Occurs after the content of the Document Viewer's document map is updated. + */ + ContentChanged: ASPxClientEvent>; +} +/** + * The client-side equivalent of the ASPxClientDocumentViewer control's Parameters Panel. + */ +interface ASPxClientReportParametersPanel extends ASPxClientControl { + /** + * Assigns a value to a parameter of the report displayed in the document viewer. + * @param parametersInfo An array of ASPxClientReportParameterInfo values specifying parameters and values to assign. + */ + AssignParameters(parametersInfo: ASPxClientReportParameterInfo[]): void; + /** + * Assigns a value to a parameter of the report displayed in the document viewer. + * @param path A System.String specifying the parameter's path. + * @param value An object specifying the parameter value. + */ + AssignParameter(path: string, value: Object): void; + /** + * Returns an array storing the names of parameters available in a report. + */ + GetParameterNames(): string[]; + /** + * Returns a value editor that is associated with a parameter with the specified name. + * @param parameterName A String value, specifying the parameter name. + */ + GetEditorByParameterName(parameterName: string): ASPxClientControl; +} +interface ASPxClientReportParameterInfo { + Path: string; + Value: Object; +} +/** + * The client-side equivalent of the ASPxClientDocumentViewer control's toolbar. + */ +interface ASPxClientReportToolbar extends ASPxClientControl { + /** + * Provides access to the control template assigned for the specified menu item. + * @param name A String value, specifying the menu item name. + */ + GetItemTemplateControl(name: string): ASPxClientControl; +} +/** + * The client-side equivalent of the ReportViewer. + */ +interface ASPxClientReportViewer extends ASPxClientControl { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientReportViewer. + */ + CallbackError: ASPxClientEvent>; + /** + * Occurs on the client side when another report page is loaded into this ASPxClientReportViewer instance. + */ + PageLoad: ASPxClientEvent>; + /** + * Submits the values of the specified parameters. + * @param parameters A dictionary containing the parameter names, along with their Object values. + */ + SubmitParameters(parameters: { [key: string]: Object; }): void; + /** + * Prints a report shown in the ReportViewer. + */ + Print(): void; + /** + * Prints a report page with the specified page index. + * @param pageIndex An integer value which specifies an index of the page to be printed. + */ + Print(pageIndex: number): void; + /** + * Displays a report page with the specified page index in the ReportViewer. + * @param pageIndex An integer value which specifies the index of a page to be displayed. + */ + GotoPage(pageIndex: number): void; + /** + * Initiates a round trip to the server so that the current page will be reloaded. + */ + Refresh(): void; + /** + * Invokes the Search dialog, which allows end-users to search for specific text in a report. + */ + Search(): void; + /** + * Exports a report to a file of the specified format, and shows it in a new Web Browser window. + * @param format A string specifying the format, to which a report should be exported. + */ + SaveToWindow(format: string): void; + /** + * Exports a report to a file of the specified format, and saves it to the disk. + * @param format A string specifying the format, to which a report should be exported. + */ + SaveToDisk(format: string): void; + /** + * Gets a value indicating whether or not searching text across a report is permitted in the web browser. + */ + IsSearchAllowed(): boolean; +} +interface ASPxClientReportViewerPageLoadEventHandler { + (source: S, e: ASPxClientReportViewerPageLoadEventArgs): void; +} +/** + * Provides data for a Report Viewer's PageLoad event on the client side. + */ +interface ASPxClientReportViewerPageLoadEventArgs extends ASPxClientEventArgs { + /** + * Gets a value specifying a zero-based index of a page to be displayed in a report viewer. + * Returns: $ + */ + PageIndex: number; + /** + * Gets a value specifying the total number of pages displayed in a report viewer. + * Returns: $ + */ + PageCount: number; + /** + * Gets a value indicating whether a report page, which is currently loaded into the ASPxClientReportViewer, is the first page of a report. + */ + IsFirstPage(): boolean; + /** + * Gets a value indicating whether a report page, which is currently loaded into the ASPxClientReportViewer, is the last page of a report. + */ + IsLastPage(): boolean; +} +/** + * Provides data for the CustomizeParameterEditors events. + */ +interface ASPxClientCustomizeParameterEditorsEventArgs extends ASPxClientEventArgs { + /** + * Provides access to an object that stores information about a parameter. + * Value: An ASPxDesignerElementParameterDescriptor object. + */ + parameter: ASPxDesignerElementParameterDescriptor; + /** + * Provides access to an object that stores information required to serialize a parameter editor. + * Value: An ASPxDesignerElementSerializationInfo object. + */ + info: ASPxDesignerElementSerializationInfo; +} +/** + * Provides general information about a report parameter. + */ +interface ASPxDesignerElementParameterDescriptor { + /** + * Provides access to the parameter description. + * Value: A String value, specifying the parameter description. + */ + description: string; + /** + * Provides access to the parameter name. + * Value: A String value, specifying the parameter name. + */ + name: string; + /** + * Provides access to the parameter type. + * Value: A String value, specifying the parameter type. + */ + type: string; + /** + * Provides access to the parameter value. + * Value: A Object, specifying the parameter value. + */ + value: Object; + /** + * Provides access to the parameter visibility state. + * Value: true if the parameter is visible; otherwise false. + */ + visible: boolean; +} +/** + * Provides information required to serialize an element. + */ +interface ASPxDesignerElementSerializationInfo { + /** + * Gets the property name that will be used in the model to store the property value. + * Value: A String value. + */ + propertyName: string; + /** + * Gets the property name in the model that is displayed in the Property grid. + * Value: A String value. + */ + displayName: string; + /** + * Gets the property name that will be used during serialization to store the property value. + * Value: A String value. + */ + modelName: string; + /** + * Gets the default property value used for serialization. + * Value: A Object value. + */ + defaultVal: Object; + /** + * Gets the information about a complex object's content. + * Value: An array of ASPxDesignerElementSerializationInfo objects. + */ + info: ASPxDesignerElementSerializationInfo[]; + /** + * Gets a value indicating whether or not the property returns an array. + * Value: true if the property returns an array; otherwise false. + */ + array: boolean; + /** + * Gets a value indicating whether an object should be serialized to the ComponentStorage property. + * Value: true to serialize an object to the ObjectStorage; otherwise false. + */ + link: boolean; + /** + * Gets a value specifying the type of value editor for the Property Grid. + * Value: An ASPxDesignerElementEditor object. + */ + editor: ASPxDesignerElementEditor; + /** + * Gets the collection of values displayed in the Property grid. + * Value: An array of ASPxDesignerElementEditorItem objects. + */ + valuesArray: ASPxDesignerElementEditorItem[]; + /** + * Gets the rules for validating the property value entered into its editor. + * Value: An array of Object values. + */ + validationRules: Object[]; + /** + * Gets the visibility state of the value editor in the Property Grid. + * Value: A Object value. + */ + visible: Object; + /** + * Gets a value, indicating whether or not the property value can be edited. + * Value: true to disable the property editing; otherwise false. + */ + disabled: Object; +} +/** + * Provides information about a serialized property's value editor used in the Property Grid. + */ +interface ASPxDesignerElementEditor { + /** + * Gets the name of an HTML template specifying the editor and header of a complex object (i.e., an object having its content properties specified). + * Value: A String value. + */ + header: string; + /** + * Gets a nullable value, specifying the name of an HTML template used by a complex object's editor. + * Value: A String value. + */ + content: string; + /** + * Gets a nullable value, specifying the type of the editor's model. + * Value: A Object value. + */ + editorType: Object; +} +/** + * Provides information about property values. + */ +interface ASPxDesignerElementEditorItem { + /** + * Gets an actual property value. + * Value: A Object value. + */ + value: Object; + /** + * Gets a value displayed by a property editor. + * Value: A String value. + */ + displayValue: string; +} +/** + * A client-side equivalent of the ASPxWebDocumentViewer class. + */ +interface ASPxClientWebDocumentViewer extends ASPxClientControl { + /** + * Enables you to customize the menu actions of a Web Document Viewer. + */ + CustomizeMenuActions: ASPxClientEvent>; + /** + * Occurs each time a standard editor is created for a report parameter based on a parameter type. + */ + CustomizeParameterEditors: ASPxClientEvent>; + /** + * Provides access to the preview model of the ASPxClientWebDocumentViewer. + */ + GetPreviewModel(): Object; + /** + * Opens the specified report in the HTML5 Document Viewer. + */ + OpenReport(): Object; + /** + * Prints the current document. + */ + Print(): void; + /** + * Prints the document's page with the specified index. + * @param pageIndex An index of the page to be printed. + */ + Print(pageIndex: number): void; + /** + * Exports the document to a PDF file. + */ + ExportTo(): void; + /** + * Exports the document to a specified file format. + * @param format A String value, specifying the export format. The following formats are currently supported: 'csv', 'html', 'image', 'mht', 'pdf', 'rtf', 'txt', 'xls', and 'xlsx'. + */ + ExportTo(format: string): void; + /** + * Updates the localization settings of the ASPxClientWebDocumentViewer properties. + * @param localization A dictionary containing the property names, along with their localized equivalents. + */ + UpdateLocalization(localization: { [key: string]: string; }): void; +} +/** + * A method that will handle the CustomizeMenuActions event. + */ +interface ASPxClientWebDocumentViewerCustomizeMenuActionsEventHandler { + /** + * A method that will handle the CustomizeMenuActions event. + * @param source The event sender. + * @param e An ASPxClientWebDocumentViewerCustomizeMenuActionsEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientWebDocumentViewerCustomizeMenuActionsEventArgs): void; +} +/** + * Provides settings to the actions listed in a Web Document Viewer menu. + */ +interface ASPxClientWebDocumentViewerMenuAction { + /** + * Provides access to the text for the command. + * Value: A String value. + */ + text: string; + /** + * Provides access to the CSS class of the command's glyph. + * Value: A String value. + */ + imageClassName: string; + /** + * Provides access to the action performed when a Document Viewer's button is clicked. + * Value: The specific action implementation. + */ + clickAction: Function; + /** + * Provides access to the value that specifies whether or not the command is disabled by default. + * Value: true, if the command is disabled by default; otherwise, false. + */ + disabled: boolean; + /** + * Provides access to the value that specifies whether or not the command is visible in the Document Viewer user interface. + * Value: true if the command is visible; otherwise false. + */ + visible: boolean; + /** + * Provides access to the keyboard shortcut used to invoke the command. + * Value: A String value. + */ + hotKey: string; + /** + * Provides access to the value that specifies whether or not the command has a visual separator. + * Value: true, if the command has a visual separator; otherwise, false. + */ + hasSeparator: string; + /** + * Provides access to the location of the displayed command. + * Value: A String value. + */ + container: string; +} +/** + * Provides data for the CustomizeMenuActions event. + */ +interface ASPxClientWebDocumentViewerCustomizeMenuActionsEventArgs extends ASPxClientEventArgs { + /** + * Returns the collection of customized menu actions. + * Value: An ASPxClientWebDocumentViewerMenuAction array. + */ + Actions: ASPxClientWebDocumentViewerMenuAction[]; + /** + * Returns a menu action with the specified ID. + * @param actionId A String value, specifying the action ID. + */ + GetById(actionId: string): ASPxClientWebDocumentViewerMenuAction; +} +/** + * A method that will handle the CustomizeParameterEditors event. + */ +interface ASPxClientWebDocumentViewerCustomizeParameterEditorsEventHandler { + /** + * A method that will handle the CustomizeParameterEditors event. + * @param source The event sender. + * @param e An ASPxClientCustomizeParameterEditorsEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientCustomizeParameterEditorsEventArgs): void; } -declare namespace DevExpress.XtraCharts.Web.Scripts { - export interface ASPxClientWebChartElement { - chart: ASPxClientWebChart; - } - - export interface ASPxClientWebChartRequiredElement extends ASPxClientWebChartElement { - } - - export interface ASPxClientWebChart extends ASPxClientWebChartRequiredElement { - annotations: any; - appearanceName: any; - chart: any; - chartControl: any; - crosshairOptions: any; - cssPostfix: any; - diagram: any; - legend: any; - paletteName: any; - selectionMode: any; - series: any; - showCrosshair: any; - showPointToolTip: any; - showSeriesToolTip: any; - titles: any; - toolTipController: any; - toolTipPosition: any; - } - - export interface ASPxClientWebChartHitInfo { - annotation: any; - axis: any; - axisLabelItem: any; - axisTitle: any; - chart: any; - chartTitle: any; - constantLine: any; - diagram: any; - hyperlink: any; - inAnnotation: boolean; - inAxis: boolean; - inAxisLabelItem: boolean; - inAxisTitle: boolean; - inChart: boolean; - inChartTitle: boolean; - inConstantLine: boolean; - inDiagram: boolean; - indicator: boolean; - inHyperlink: boolean; - inIndicator: boolean; - inLegend: boolean; - inNonDefaultPane: boolean; - inSeries: boolean; - inSeriesLabel: boolean; - inSeriesPoint: boolean; - inSeriesTitle: boolean; - legend: any; - nonDefaultPane: any; - series: any; - seriesLabel: any; - seriesPoint: any; - seriesTitle: any; - } - - export interface ASPxClientSeriesPoint extends ASPxClientWebChartRequiredElement { - argument: any; - color: any; - percentValue: any; - series: any; - toolTipHint: any; - toolTipText: any; - values: Object[]; - } - - export interface ASPxClientWebChartControlHotTrackEventArgs extends DevExpress.Web.Scripts.ASPxClientProcessingModeEventArgs { - absoluteX: number; - absoluteY: number; - additionalHitObject: ASPxClientSeriesPoint; - cancel: boolean; - chart: ASPxClientWebChart; - hitInfo: ASPxClientWebChartHitInfo; - hitObject: any; - htmlElement: any; - x: number; - y: number; - } - - export interface ASPxClientWebChartControl extends DevExpress.Web.Scripts.ASPxClientControl { - // Methods - SetCursor(cursor: string): any; - InCallback(): boolean; - PerformCallback(): void; - - // Events - BeginCallback: DevExpress.Web.Scripts.ASPxClientEvent; - EndCallback: DevExpress.Web.Scripts.ASPxClientEvent; - ObjectHotTracked: DevExpress.Web.Scripts.ASPxClientEvent; - ObjectSelected: DevExpress.Web.Scripts.ASPxClientEvent; - } +interface MVCxClientDashboardViewerStatic extends ASPxClientDashboardViewerStatic { } +interface DashboardDataAxisNamesStatic { + /** + * Identifies a default axis in all data-bound dashboard items. + */ + DefaultAxis: string; + /** + * Identifies a series axis in a chart and pie. + */ + ChartSeriesAxis: string; + /** + * Identifies an argument axis in a chart, scatter chart and pie. + */ + ChartArgumentAxis: string; + /** + * Identifies a sparkline axis in a grid and cards. + */ + SparklineAxis: string; + /** + * Identifies a pivot column axis. + */ + PivotColumnAxis: string; + /** + * Identifies a pivot row axis. + */ + PivotRowAxis: string; +} +interface DashboardSpecialValuesStatic { + /** + * Represents a null value. + */ + NullValue: string; + /** + * Represents a null value in OLAP mode. + */ + OlapNullValue: string; + /** + * Represents an Others value. + */ + OthersValue: string; + /** + * Represents an error value for calculated fields. + */ + ErrorValue: string; + /** + * Returns whether or not the specified value is an NullValue. + * @param value The specified value. + */ + IsNullValue(value: Object): boolean; + /** + * Returns whether or not the specified value is an OlapNullValue. + * @param value The specified value. + */ + IsOlapNullValue(value: Object): boolean; + /** + * Returns whether or not the specified value is an OthersValue. + * @param value The specified value. + */ + IsOthersValue(value: Object): boolean; + /** + * Returns whether or not the specified value is an ErrorValue. + * @param value The specified value. + */ + IsErrorValue(value: Object): boolean; +} +interface ASPxClientDashboardDesignerStatic extends ASPxClientControlStatic { +} +interface ASPxClientDashboardViewerStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientDashboardViewer; +} +interface DashboardExportPageLayoutStatic { + /** + * The page orientation used to export a dashboard (dashboard item) is portrait. + */ + Portrait: string; + /** + * The page orientation used to export a dashboard (dashboard item) is landscape. + */ + Landscape: string; +} +interface DashboardExportPaperKindStatic { + /** + * Letter paper (8.5 in. by 11 in.). + */ + Letter: string; + /** + * Legal paper (8.5 in. by 14 in.). + */ + Legal: string; + /** + * Executive paper (7.25 in. by 10.5 in.). + */ + Executive: string; + /** + * A5 paper (148 mm by 210 mm). + */ + A5: string; + /** + * A4 paper (210 mm by 297 mm). + */ + A4: string; + /** + * A3 paper (297 mm by 420 mm). + */ + A3: string; +} +interface DashboardExportScaleModeStatic { + /** + * The dashboard (dashboard item) on the exported page retains its original size. + */ + None: string; + /** + * The size of the dashboard (dashboard item) on the exported page is changed according to the scale factor value. + */ + UseScaleFactor: string; + /** + * The size of the dashboard (dashboard item) is changed according to the width of the exported page. + */ + AutoFitToPageWidth: string; + /** + * The size of the dashboard (dashboard item) is changed to fit its content on a single page. + */ + AutoFitWithinOnePage: string; +} +interface DashboardExportFilterStateStatic { + /** + * The filter state is not included in the exported document. + */ + None: string; + /** + * The filter state is placed below the dashboard (dashboard item) in the exported document. + */ + Below: string; + /** + * The filter state is placed on a separate page in the exported document. + */ + SeparatePage: string; +} +interface DashboardExportImageFormatStatic { + /** + * The PNG image format. + */ + Png: string; + /** + * The GIF image format. + */ + Gif: string; + /** + * The JPG image format. + */ + Jpg: string; +} +interface DashboardExportExcelFormatStatic { + /** + * The Excel 97 - Excel 2003 (XLS) file format. + */ + Xls: string; + /** + * The Office Excel 2007 XML-based (XLSX) file format. + */ + Xlsx: string; + /** + * A comma-separated values (CSV) file format. + */ + Csv: string; +} +interface ChartExportSizeModeStatic { + /** + * A chart dashboard item is exported in a size identical to that shown on the dashboard. + */ + None: string; + /** + * A chart dashboard item is stretched or shrunk to fit the page to which it is exported. + */ + Stretch: string; + /** + * A chart dashboard item is resized proportionally to best fit the exported page. + */ + Zoom: string; +} +interface MapExportSizeModeStatic { + /** + * A map dashboard item is exported in a size identical to that shown on the dashboard + */ + None: string; + /** + * A map dashboard item is resized proportionally to best fit the exported page. + */ + Zoom: string; +} +interface RangeFilterExportSizeModeStatic { + /** + * A Range Filter dashboard item is exported in a size identical to that shown on the dashboard. + */ + None: string; + /** + * A Range Filter dashboard item is stretched or shrunk to fit the page to which it is exported. + */ + Stretch: string; + /** + * A Range Filter dashboard item is resized proportionally to best fit the printed page. + */ + Zoom: string; +} +interface DashboardSelectionModeStatic { + None: string; + Single: string; + Multiple: string; +} +interface ASPxClientEditBaseStatic extends ASPxClientControlStatic { +} +interface ASPxClientEditStatic extends ASPxClientEditBaseStatic { + /** + * Assigns a null value to all editors in a specified visibility state, which are located within a specified container and belong to a specific validation group. + * @param container An HTML element specifying the container of editors to be validated. + * @param validationGroup A string value specifying the validation group's name. + * @param clearInvisibleEditors true to clear both visible and invisible editors that belong to the specified container and group; false to clear only visible editors. + */ + ClearEditorsInContainer(container: Object, validationGroup: string, clearInvisibleEditors: boolean): void; + /** + * Assigns a null value to all visible editors located within a specified container, and belonging to a specific validation group. + * @param container An HTML element specifying the container of editors to be validated. + * @param validationGroup A string value specifying the validation group's name. + */ + ClearEditorsInContainer(container: Object, validationGroup: string): void; + /** + * Assigns a null value to all visible editors located within a specified container. + * @param container An HTML element specifying the container of editors to be validated. + */ + ClearEditorsInContainer(container: Object): void; + /** + * Assigns a null value to all editors which are located within the specified container object, and belonging to a specific validation group, dependent on the visibility state specified. + * @param containerId A string value specifying the editor container's identifier. + * @param validationGroup A string value specifying the validatiion group's name. + * @param clearInvisibleEditors true to clear both visible and invisible editors that belong to the specified container and group; false to clear only visible editors. + */ + ClearEditorsInContainerById(containerId: string, validationGroup: string, clearInvisibleEditors: boolean): void; + /** + * Assigns a null value to all visible editors that are located within the specified container object, and belonging to a specific validation group. + * @param containerId A string value specifying the editor container's identifier. + * @param validationGroup A string value specifying the validatiion group's name. + */ + ClearEditorsInContainerById(containerId: string, validationGroup: string): void; + /** + * Assigns a null value to all visible editors that are located within the specified container object. + * @param containerId A string value specifying the editor container's identifier. + */ + ClearEditorsInContainerById(containerId: string): void; + /** + * Assigns a null value to all editors which belong to a specific validation group, dependent on the visibility state specified. + * @param validationGroup A string value specifying the validation group's name. + * @param clearInvisibleEditors true to clear both visible and invisible editors that belong to the specified validation group; false to clear only visible editors. + */ + ClearGroup(validationGroup: string, clearInvisibleEditors: boolean): void; + /** + * Assigns a null value to all visible editors which belong to a specific validation group. + * @param validationGroup A string value specifying the validation group's name. + */ + ClearGroup(validationGroup: string): void; + /** + * Performs validation of all editors in a specified visibility state, which are located within a specified container and belong to a specific validation group. + * @param container An HTML element specifying the container of editors to be validated. + * @param validationGroup A string value that specifies the validation group's name. + * @param validateInvisibleEditors true to validate both visible and invisible editors that belong to the specified container and group; false to validate only visible editors. + */ + ValidateEditorsInContainer(container: Object, validationGroup: string, validateInvisibleEditors: boolean): boolean; + /** + * Performs validation of visible editors that are located within the specified container and belong to a specific validation group. + * @param container An HTML element specifying the container of editors to be validated. + * @param validationGroup A string value that specifies the validation group's name. + */ + ValidateEditorsInContainer(container: Object, validationGroup: string): boolean; + /** + * Performs validation of visible editors that are located within the specified container. + * @param container An HTML element specifying the container of editors to be validated. + */ + ValidateEditorsInContainer(container: Object): boolean; + /** + * Performs validation of the editors which are located within the specified container and belong to a specific validation group, dependent on the visibility state specified. + * @param containerId A string value specifying the editor container's identifier. + * @param validationGroup A string value that specifies the validation group's name. + * @param validateInvisibleEditors true to validate both visible and invisible editors that belong to the specified container and group; false to validate only visible editors. + */ + ValidateEditorsInContainerById(containerId: string, validationGroup: string, validateInvisibleEditors: boolean): boolean; + /** + * Performs validation of visible editors that are located within the specified container and belong to a specific validation group. + * @param containerId A string value that specifies the container's unique identifier. + * @param validationGroup A string value that specifies the validation group's name. + */ + ValidateEditorsInContainerById(containerId: string, validationGroup: string): boolean; + /** + * Performs validation of visible editors which are located within the specified container. + * @param containerId A string value that specifies the container's unique identifier. + */ + ValidateEditorsInContainerById(containerId: string): boolean; + /** + * Performs validation of editors contained within the specified validation group, dependent on the editor visibility state specified. + * @param validationGroup A string value specifying the validation group's name. + * @param validateInvisibleEditors true to validate both visible and invisible editors that belong to the specified validation group; false to validate only visible editors. + */ + ValidateGroup(validationGroup: string, validateInvisibleEditors: boolean): boolean; + /** + * Performs validation of visible editors contained within the specified validation group. + * @param validationGroup A string value specifying the validation group's name. + */ + ValidateGroup(validationGroup: string): boolean; + /** + * Verifies whether the editors in a specified visibility state, which are located within a specified container and belong to a specific validation group, are valid. + * @param container An HTML element specifying the container of editors to be validated. + * @param validationGroup A string value that specifies the validation group's name. + * @param checkInvisibleEditors true to check both visible and invisible editors that belong to the specified container; false to check only visible editors. + */ + AreEditorsValid(container: Object, validationGroup: string, checkInvisibleEditors: boolean): boolean; + /** + * Verifies whether visible editors, which are located within a specified container and belong to a specific validation group, are valid. + * @param container An HTML element specifying the container of editors to be validated. + * @param validationGroup A string value that specifies the validation group's name. + */ + AreEditorsValid(container: Object, validationGroup: string): boolean; + /** + * Verifies whether visible editors located in a specified container are valid. + * @param container An HTML element specifying the container of editors to be validated. + */ + AreEditorsValid(container: Object): boolean; + /** + * Verifies whether the editors with the specified settings are valid. + * @param containerId A string value that specifies the container's unique identifier. + * @param validationGroup A string value that specifies the validation group's name. + * @param checkInvisibleEditors true to check both visible and invisible editors that belong to the specified container; false to check only visible editors. + */ + AreEditorsValid(containerId: string, validationGroup: string, checkInvisibleEditors: boolean): boolean; + /** + * Verifies whether visible editors with the specified settings are valid. + * @param containerId A string value that specifies the container's unique identifier. + * @param validationGroup A string value that specifies the validation group's name. + */ + AreEditorsValid(containerId: string, validationGroup: string): boolean; + /** + * Verifies whether visible editors with the specified settings are valid. + * @param containerId A string value that specifies the container's unique identifier. + */ + AreEditorsValid(containerId: string): boolean; + /** + * Verifies whether visible editors on a page are valid. + */ + AreEditorsValid(): boolean; +} +interface ASPxClientBinaryImageStatic extends ASPxClientEditStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientBinaryImage; +} +interface ASPxClientButtonStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientButton; +} +interface ASPxClientCalendarStatic extends ASPxClientEditStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientCalendar; +} +interface ASPxClientCaptchaStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientCaptcha; +} +interface ASPxClientCheckBoxStatic extends ASPxClientEditStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientCheckBox; +} +interface ASPxClientRadioButtonStatic extends ASPxClientCheckBoxStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientRadioButton; +} +interface ASPxClientTextEditStatic extends ASPxClientEditStatic { +} +interface ASPxClientTextBoxBaseStatic extends ASPxClientTextEditStatic { +} +interface ASPxClientButtonEditBaseStatic extends ASPxClientTextBoxBaseStatic { +} +interface ASPxClientDropDownEditBaseStatic extends ASPxClientButtonEditBaseStatic { +} +interface ASPxClientColorEditStatic extends ASPxClientDropDownEditBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientColorEdit; +} +interface ASPxClientComboBoxStatic extends ASPxClientDropDownEditBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientComboBox; +} +interface ASPxClientDateEditStatic extends ASPxClientDropDownEditBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientDateEdit; +} +interface ASPxClientDropDownEditStatic extends ASPxClientDropDownEditBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientDropDownEdit; +} +interface ASPxClientFilterControlStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientFilterControl; +} +interface ASPxClientListEditStatic extends ASPxClientEditStatic { +} +interface ASPxClientListBoxStatic extends ASPxClientListEditStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientListBox; +} +interface ASPxClientCheckListBaseStatic extends ASPxClientListEditStatic { +} +interface ASPxClientRadioButtonListStatic extends ASPxClientCheckListBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientRadioButtonList; +} +interface ASPxClientCheckBoxListStatic extends ASPxClientCheckListBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientCheckBoxList; +} +interface ASPxClientProgressBarStatic extends ASPxClientEditBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientProgressBar; +} +interface ASPxClientSpinEditBaseStatic extends ASPxClientButtonEditBaseStatic { +} +interface ASPxClientSpinEditStatic extends ASPxClientSpinEditBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientSpinEdit; +} +interface ASPxClientTimeEditStatic extends ASPxClientSpinEditBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientTimeEdit; +} +interface ASPxClientStaticEditStatic extends ASPxClientEditBaseStatic { +} +interface ASPxClientHyperLinkStatic extends ASPxClientStaticEditStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientHyperLink; +} +interface ASPxClientImageBaseStatic extends ASPxClientStaticEditStatic { +} +interface ASPxClientImageStatic extends ASPxClientImageBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientImage; +} +interface ASPxClientLabelStatic extends ASPxClientStaticEditStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientLabel; +} +interface ASPxClientTextBoxStatic extends ASPxClientTextBoxBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientTextBox; +} +interface ASPxClientMemoStatic extends ASPxClientTextEditStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientMemo; +} +interface ASPxClientButtonEditStatic extends ASPxClientButtonEditBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientButtonEdit; +} +interface ASPxClientTokenBoxStatic extends ASPxClientComboBoxStatic { +} +interface ASPxClientTrackBarStatic extends ASPxClientEditStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientTrackBar; +} +interface ASPxClientValidationSummaryStatic extends ASPxClientControlStatic { +} +interface ASPxClientGaugeControlStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientGaugeControl; +} +interface ASPxClientGridBaseStatic extends ASPxClientControlStatic { +} +interface ASPxClientGridViewCallbackCommandStatic { + /** + * Default value: "NEXTPAGE" + */ + NextPage: string; + /** + * Default value: "PREVPAGE" + */ + PreviousPage: string; + /** + * Default value: "GOTOPAGE" + */ + GotoPage: string; + /** + * Default value: "SELECTROWS" + */ + SelectRows: string; + /** + * Default value: "SELECTROWSKEY" + */ + SelectRowsKey: string; + /** + * Default value: "SELECTION" + */ + Selection: string; + /** + * Default value: "FOCUSEDROW" + */ + FocusedRow: string; + /** + * Default value: "GROUP" + */ + Group: string; + /** + * Default value: "UNGROUP" + */ + UnGroup: string; + /** + * Default value: "SORT" + */ + Sort: string; + /** + * Default value: "COLUMNMOVE" + */ + ColumnMove: string; + /** + * Default value: "COLLAPSEALL" + */ + CollapseAll: string; + /** + * Default value: "EXPANDALL" + */ + ExpandAll: string; + /** + * Default value: "EXPANDROW" + */ + ExpandRow: string; + /** + * Default value: "COLLAPSEROW" + */ + CollapseRow: string; + /** + * Default value: "HIDEALLDETAIL" + */ + HideAllDetail: string; + /** + * Default value: "SHOWALLDETAIL" + */ + ShowAllDetail: string; + /** + * Default value: "SHOWDETAILROW" + */ + ShowDetailRow: string; + /** + * Default value: "HIDEDETAILROW" + */ + HideDetailRow: string; + /** + * Default value: "PAGERONCLICK" + */ + PagerOnClick: string; + /** + * Default value: "APPLYFILTER" + */ + ApplyFilter: string; + /** + * Default value: "APPLYCOLUMNFILTER" + */ + ApplyColumnFilter: string; + /** + * Default value: "APPLYMULTICOLUMNFILTER" + */ + ApplyMultiColumnFilter: string; + /** + * Default value: "APPLYHEADERCOLUMNFILTER" + */ + ApplyHeaderColumnFilter: string; + /** + * Default value: "APPLYSEARCHPANELFILTER" + */ + ApplySearchPanelFilter: string; + /** + * Default value: "FILTERROWMENU" + */ + FilterRowMenu: string; + /** + * Default value: "STARTEDIT" + */ + StartEdit: string; + /** + * Default value: "CANCELEDIT" + */ + CancelEdit: string; + /** + * Default value: "UPDATEEDIT" + */ + UpdateEdit: string; + /** + * Default value: "ADDNEWROW" + */ + AddNewRow: string; + /** + * Default value: "DELETEROW" + */ + DeleteRow: string; + /** + * Default value: "CUSTOMBUTTON" + */ + CustomButton: string; + /** + * Default value: "CUSTOMCALLBACK" + */ + CustomCallback: string; + /** + * Default value: "SHOWFILTERCONTROL" + */ + ShowFilterControl: string; + /** + * Default value: "CLOSEFILTERCONTROL" + */ + CloseFilterControl: string; + /** + * Default value: "SETFILTERENABLED" + */ + SetFilterEnabled: string; + /** + * Default value: "REFRESH" + */ + Refresh: string; + /** + * Default value: "SELFIELDVALUES" + */ + SelFieldValues: string; + /** + * Default value: "ROWVALUES" + */ + RowValues: string; + /** + * Default value: "PAGEROWVALUES" + */ + PageRowValues: string; + /** + * Default value: "FILTERPOPUP" + */ + FilterPopup: string; + /** + * Default value: "CONTEXTMENU" + */ + ContextMenu: string; + /** + * Default value: "CUSTOMVALUES" + */ + CustomValues: string; +} +interface ASPxClientGridLookupStatic extends ASPxClientDropDownEditBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientGridLookup; +} +interface ASPxClientCardViewStatic extends ASPxClientGridBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientCardView; +} +interface ASPxClientGridViewStatic extends ASPxClientGridBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientGridView; +} +interface ASPxClientVerticalGridStatic extends ASPxClientGridBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientVerticalGrid; +} +interface ASPxClientVerticalGridCallbackCommandStatic { + /** + * Default value: "EXPANDROW" + */ + ExpandRow: string; +} +interface ASPxClientCommandConstsStatic { + /** + * Identifies a command that shows a search panel. + * Value: "showsearchpanel" + */ + SHOWSEARCHPANEL_COMMAND: string; + /** + * Identifies a command that invokes the Find and Replace dialog. + * Value: "findandreplacedialog" + */ + FINDANDREPLACE_DIALOG_COMMAND: string; + /** + * Identifies a command that applies the bold text formatting to the selected text. If it's already applied, cancels it. + * Value: "bold" + */ + BOLD_COMMAND: string; + /** + * Identifies a command that makes the selected text italic or regular type depending on the current state. + * Value: "italic" + */ + ITALIC_COMMAND: string; + /** + * Identifies a command that applies the underline text formatting to the selected text. If it's already applied, cancels it. + * Value: "underline" + */ + UNDERLINE_COMMAND: string; + /** + * Identifies a command that applies the strike through text formatting to the selected text. If it's already applied, cancels it. + * Value: "strikethrough" + */ + STRIKETHROUGH_COMMAND: string; + /** + * Identifies a command that applies the superscript text formatting to the selected text. If it's already applied, cancels it. + * Value: "superscript" + */ + SUPERSCRIPT_COMMAND: string; + /** + * Identifies a command that applies the subscript text formatting to the selected text. If it's already applied, cancels it. + * Value: "subscript" + */ + SUBSCRIPT_COMMAND: string; + /** + * Identifies a command that centers the content of the currently focused paragraph. + * Value: "justifycenter" + */ + JUSTIFYCENTER_COMMAND: string; + /** + * Identifies a command that left justifies the content of the currently focused paragraph. + * Value: "justifyleft" + */ + JUSTIFYLEFT_COMMAND: string; + /** + * Identifies a command that creates an indent for the selected paragarph. + * Value: "indent" + */ + INDENT_COMMAND: string; + /** + * Identifies a command that creates an outdent for the focused paragarph. + * Value: "outdent" + */ + OUTDENT_COMMAND: string; + /** + * Identifies a command that right justifies the content of the currently focused paragraph. + * Value: "justifyright" + */ + JUSTIFYRIGHT_COMMAND: string; + /** + * Identifies a command that fully justifies the content of the currently focused paragraph (aligned with both the left and right margines). + * Value: "justifyfull" + */ + JUSTIFYFULL_COMMAND: string; + /** + * Identifies a command that changes the size of the selected text. + * Value: "fontsize" + */ + FONTSIZE_COMMAND: string; + /** + * Identifies a command that changes the font of the selected text. + * Value: "fontname" + */ + FONTNAME_COMMAND: string; + /** + * Identifies a command that changes the color of a fore color pickers and sets the selected text fore color. + * Value: "forecolor" + */ + FONTCOLOR_COMMAND: string; + /** + * Identifies a command that changes the color of a back color pickers and sets the selected text back color. + * Value: "backcolor" + */ + BACKCOLOR_COMMAND: string; + /** + * Identifies a command that wraps the selected paragraph in the specified html tag. + * Value: "formatblock" + */ + FORMATBLOCK_COMMAND: string; + /** + * Identifies a command that wraps the currently selected text content in a specific html tag with a css class assigned to it. + * Value: "applycss" + */ + APPLYCSS_COMMAND: string; + /** + * Identifies a command that removes all formatting from the selected content. + * Value: "removeformat" + */ + REMOVEFORMAT_COMMAND: string; + /** + * Identifies a command that cancels the last action. + * Value: "undo" + */ + UNDO_COMMAND: string; + /** + * Identifies a command that returns a previously canceled action. + * Value: "redo" + */ + REDO_COMMAND: string; + /** + * Identifies a command that copies the selected content. + * Value: "copy" + */ + COPY_COMMAND: string; + /** + * Identifies a command that pastes the content of the clipboard at the current cursor position. + * Value: "paste" + */ + PASTE_COMMAND: string; + /** + * Identifies a command that pastes a specified content taking into account that it was copied from Word. + * Value: "pastefromword" + */ + PASTEFROMWORD_COMMAND: string; + /** + * Identifies a command that invokes the Paste from Word dialog. + * Value: "pastefromworddialog" + */ + PASTEFROMWORDDIALOG_COMMAND: string; + /** + * Identifies a command that cuts the selected content. + * Value: "cut" + */ + CUT_COMMAND: string; + /** + * Identifies a command that selects all content inside the html editor. + * Value: "selectall" + */ + SELECT_ALL: string; + /** + * Identifies a command that deletes the selected content. + * Value: "delete" + */ + DELETE_COMMAND: string; + /** + * Identifies a command that can be used to correctly insert HTML code into the editor. + * Value: "pastehtml" + */ + PASTEHTML_COMMAND: string; + /** + * Identifies a command that inserts a new ordered list. + * Value: "insertorderedlist" + */ + INSERTORDEREDLIST_COMMAND: string; + /** + * Identifies a command that inserts a new unordered list. + * Value: "insertunorderedlist" + */ + INSERTUNORDEREDLIST_COMMAND: string; + /** + * Identifies a command that restarts the current ordered list. + * Value: "restartorderedlist" + */ + RESTARTORDEREDLIST_COMMAND: string; + /** + * Identifies a command that continues a disrupted ordered list. + * Value: "continueorderedlist" + */ + CONTINUEORDEREDLIST_COMMAND: string; + /** + * Identifies a command that removes a hyperlink from the selected text or image. + * Value: "unlink" + */ + UNLINK_COMMAND: string; + /** + * Identifies a command that inserts a new hyperlink. + * Value: "insertlink" + */ + INSERTLINK_COMMAND: string; + /** + * Identifies a command that inserts a new image. + * Value: "insertimage" + */ + INSERTIMAGE_COMMAND: string; + /** + * Identifies a command that changes the selected image. + * Value: "changeimage" + */ + CHANGEIMAGE_COMMAND: string; + /** + * Identifies a command that initiates spell checking. + * Value: "checkspelling" + */ + CHECKSPELLING_COMMAND: string; + /** + * Identifies a command that invokes the Insert Image dialog. + * Value: "insertimagedialog" + */ + INSERTIMAGE_DIALOG_COMMAND: string; + /** + * Identifies a command that invokes the Change Image dialog. + * Value: "changeimagedialog" + */ + CHANGEIMAGE_DIALOG_COMMAND: string; + /** + * Identifies a command that invokes the Insert Link dialog. + * Value: "insertlinkdialog" + */ + INSERTLINK_DIALOG_COMMAND: string; + /** + * Identifies a command that invokes the Change Link dialog. + * Value: "changelinkdialog" + */ + CHANGELINK_DIALOG_COMMAND: string; + /** + * Identifies a command that invokes the Insert Table dialog. + * Value: "inserttabledialog" + */ + INSERTTABLE_DIALOG_COMMAND: string; + /** + * Identifies a command that invokes the Table Properties dialog. + * Value: "tablepropertiesdialog" + */ + TABLEPROPERTIES_DIALOG_COMMAND: string; + /** + * Identifies a command that invokes the Cell Properties dialog. + * Value: "tablecellpropertiesdialog" + */ + TABLECELLPROPERTIES_DIALOG_COMMAND: string; + /** + * Identifies a command that invokes the Column Properties dialog. + * Value: "tablecolumnpropertiesdialog" + */ + TABLECOLUMNPROPERTIES_DIALOG_COMMAND: string; + /** + * Identifies a command that invokes the Row Properties dialog. + * Value: "tablerowpropertiesdialog" + */ + TABLEROWPROPERTIES_DIALOG_COMMAND: string; + /** + * Identifies a command that invokes a default browser Print dialog, allowing an end-user to print the content of the html editor. + * Value: "print" + */ + PRINT_COMMAND: string; + /** + * Identifies a command that toggles the full-screen mode. + * Value: "fullscreen" + */ + FULLSCREEN_COMMAND: string; + /** + * Identifies a command that inserts a new table. + * Value: "inserttable" + */ + INSERTTABLE_COMMAND: string; + /** + * Identifies a command that changes the selected table. + * Value: "changetable" + */ + CHANGETABLE_COMMAND: string; + /** + * Identifies a command that changes the selected table cell. + * Value: "changetablecell" + */ + CHANGETABLECELL_COMMAND: string; + /** + * Identifies a command that changes the selected table row. + * Value: "changetablerow" + */ + CHANGETABLEROW_COMMAND: string; + /** + * Identifies a command that changes the selected table column. + * Value: "changetablecolumn" + */ + CHANGETABLECOLUMN_COMMAND: string; + /** + * Identifies a command that deletes the currently selected table. + * Value: "deletetable" + */ + DELETETABLE_COMMAND: string; + /** + * Identifies a command that deletes the currently selected table row. + * Value: "deletetablerow" + */ + DELETETABLEROW_COMMAND: string; + /** + * Identifies a command that deletes the currently selected table column. + * Value: "deletetablecolumn" + */ + DELETETABLECOLUMN_COMMAND: string; + /** + * Identifies a command that inserts a new column to the left from the currently focused one. + * Value: "inserttablecolumntoleft" + */ + INSERTTABLECOLUMNTOLEFT_COMMAND: string; + /** + * Identifies a command that inserts a new column to the right from the currently focused one. + * Value: "inserttablecolumntoright" + */ + INSERTTABLECOLUMNTORIGHT_COMMAND: string; + /** + * Identifies a command that inserts a new row below the currently focused one. + * Value: "inserttablerowbelow" + */ + INSERTTABLEROWBELOW_COMMAND: string; + /** + * Identifies a command that inserts a new row above the currently focused one. + * Value: "inserttablerowabove" + */ + INSERTTABLEROWABOVE_COMMAND: string; + /** + * Identifies a command that splits the current table cell horizontally. + * Value: "splittablecellhorizontally" + */ + SPLITTABLECELLHORIZONTALLY_COMMAND: string; + /** + * Identifies a command that splits the current table cell vertically. + * Value: "splittablecellvertically" + */ + SPLITTABLECELLVERTICALLY_COMMAND: string; + /** + * Identifies a command that merges the focused table cell with the one to the right. + * Value: "mergetablecellright" + */ + MERGETABLECELLRIGHT_COMMAND: string; + /** + * Identifies a command that merges the focused table cell with the one below. + * Value: "mergetablecelldown" + */ + MERGETABLECELLDOWN_COMMAND: string; + /** + * Identifies a command that invokes a custom dialog. + * Value: "customdialog" + */ + CUSTOMDIALOG_COMMAND: string; + /** + * Identifies a command that exports the html editor content. + * Value: "export" + */ + EXPORT_COMMAND: string; + /** + * Identifies a command that inserts a new audio element. + * Value: "insertaudio" + */ + INSERTAUDIO_COMMAND: string; + /** + * Identifies a command that inserts a new video. + * Value: "insertvideo" + */ + INSERTVIDEO_COMMAND: string; + /** + * Identifies a command that inserts a new flash element. + * Value: "insertflash" + */ + INSERTFLASH_COMMAND: string; + /** + * Identifies a command that inserts a new YouTube video. + * Value: "insertyoutubevideo" + */ + INSERTYOUTUBEVIDEO_COMMAND: string; + /** + * Identifies a command that changes the selected audio element. + * Value: "changeaudio" + */ + CHANGEAUDIO_COMMAND: string; + /** + * Identifies a command that changes the selected video element. + * Value: "changevideo" + */ + CHANGEVIDEO_COMMAND: string; + /** + * Identifies a command that changes the selected flash element. + * Value: "changeflash" + */ + CHANGEFLASH_COMMAND: string; + /** + * Identifies a command that changes the selected YouTube video element. + * Value: "changeyoutubevideo" + */ + CHANGEYOUTUBEVIDEO_COMMAND: string; + /** + * Identifies a command that invokes the Insert Audio dialog. + * Value: "insertaudiodialog" + */ + INSERTAUDIO_DIALOG_COMMAND: string; + /** + * Identifies a command that invokes the Insert Video dialog. + * Value: "insertvideodialog" + */ + INSERTVIDEO_DIALOG_COMMAND: string; + /** + * Identifies a command that invokes the Insert Flash dialog. + * Value: "insertflashdialog" + */ + INSERTFLASH_DIALOG_COMMAND: string; + /** + * Identifies a command that invokes the Insert YouTube Video dialog. + * Value: "insertyoutubevideodialog" + */ + INSERTYOUTUBEVIDEO_DIALOG_COMMAND: string; + /** + * Identifies a command that invokes the Change Audio dialog. + * Value: "changeaudiodialog" + */ + CHANGEAUDIO_DIALOG_COMMAND: string; + /** + * Identifies a command that invokes the Change Video dialog. + * Value: "changevideodialog" + */ + CHANGEVIDEO_DIALOG_COMMAND: string; + /** + * Identifies a command that invokes the Change Flash dialog. + * Value: "changeflash" + */ + CHANGEFLASH_DIALOG_COMMAND: string; + /** + * Identifies a command that invokes the Change YouTube Video dialog. + * Value: "changeyoutubevideodialog" + */ + CHANGEYOUTUBEVIDEO_DIALOG_COMMAND: string; + /** + * Identifies a command that pastes the content of the clipboard to the current cursor position, taking into account that the PasteMode property is set to SourceFormatting. + * Value: "pastehtmlsourceformatting" + */ + PASTEHTMLSOURCEFORMATTING_COMMAND: string; + /** + * Identifies a command that pastes the content of the clipboard to the current cursor position, taking into account that the PasteMode property is set to PlainText. + * Value: "pastehtmlplaintext" + */ + PASTEHTMLPLAINTEXT_COMMAND: string; + /** + * Identifies a command that pastes the content of the clipboard to the current cursor position, taking into account that the PasteMode property is set to MergeFormatting. + * Value: "pastehtmlmergeformatting" + */ + PASTEHTMLMERGEFORMATTING_COMMAND: string; + /** + * Identifies a command that inserts a new placeholder. + * Value: "insertplaceholder" + */ + INSERTPLACEHOLDER_COMMAND: string; + /** + * Identifies a command that changes the selected placeholder. + * Value: "changeplaceholder" + */ + CHANGEPLACEHOLDER_COMMAND: string; + /** + * Identifies a command that invokes the Insert Placeholder dialog. + * Value: "insertplaceholderdialog" + */ + INSERTPLACEHOLDER_DIALOG_COMMAND: string; + /** + * Identifies a command that invokes the Change Placeholder dialog. + * Value: "changeplaceholderdialog" + */ + CHANGEPLACEHOLDER_DIALOG_COMMAND: string; + /** + * Identifies a command that updates the editor content. + * Value: "updatedocument" + */ + UPDATEDOCUMENT_COMMAND: string; + /** + * Identifies a command that changes properties of the element selected in the tag inspector. + * Value: "changeelementproperties" + */ + CHANGEELEMENTPROPERTIES_COMMAND: string; + /** + * Identifies a command that invokes the Change Element Properties dialog. + * Value: "changeelementpropertiesdialog" + */ + CHANGEELEMENTPROPERTIES_DIALOG_COMMAND: string; + /** + * Identifies a command that comments the selected HTML code. If no code is selected, it comments the focused tag. + * Value: "comment" + */ + COMMENT_COMMAND: string; + /** + * Identifies a command that uncomments the selected HTML code. If no code is selected, the command uncomments the currently focused tag. + * Value: "uncomment" + */ + UNCOMMENTHTML_COMMAND: string; + /** + * Identifies a command that formats the current HTML document. + * Value: "formatdocument" + */ + FORMATDOCUMENT_COMMAND: string; + /** + * Identifies a command that applies the indent formatting to the selected content. + * Value: "indent" + */ + INDENTLINE_COMMAND: string; + /** + * Identifies a command that applies the outdent formatting to the focused content. + * Value: "outdent" + */ + OUTDENTLINE_COMMAND: string; + /** + * Identifies a command that collapses the selected HTML tag. + * Value: "collapsetag" + */ + COLLAPSETAG_COMMAND: string; + /** + * Identifies a command that expands the selected HTML tag. + * Value: "expandtag" + */ + EXPANDTAG_COMMAND: string; + /** + * Identifies a command that shows intellisense for the HTML code editor. + * Value: "showintellisense" + */ + SHOWINTELLISENSE_COMMAND: string; +} +interface ASPxClientHtmlEditorStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientHtmlEditor; + /** + * Programmatically closes a custom dialog, supplying it with specific parameters. + * @param status An object representing a custom dialog's closing status. + * @param data An object representing custom data associated with a custom dialog. + */ + CustomDialogComplete(status: Object, data: Object): void; +} +interface ASPxClientHtmlEditorMediaPreloadModeStatic { + /** + * The browser does not load a media file when the page loads. + */ + None: string; + /** + * The browser loads the entire video when the page loads. + */ + Auto: string; + /** + * The browser loads only metadata when the page loads. + */ + Metadata: string; +} +interface ASPxClientPivotGridStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientPivotGrid; +} +interface ASPxClientPivotCustomizationStatic extends ASPxClientControlStatic { +} +interface ASPxClientRichEditStatic extends ASPxClientControlStatic { +} +interface ASPxSchedulerDateTimeHelperStatic { + /** + * Returns the date part of the specified DateTime value. + * @param date A DateTime object from which to extract the date. + */ + TruncToDate(date: Date): Date; + /** + * Returns the day time part of the specified DateTime value. + * @param date A DateTime object from which to extract the day time. + */ + ToDayTime(date: Date): any; + /** + * Adds the specified number of days to a DateTime object and returns the result. + * @param date A DateTime object to which to add days. + */ + AddDays(date: Date): Date; + /** + * Adds the specified timespan to a DateTime object and returns the result. + * @param date A DateTime object to which to add a timespan. + * @param timeSpan A TimeSpan object specifying the timespan to add. + */ + AddTimeSpan(date: Date, timeSpan: any): Date; + /** + * Rounds a DateTime value up to the nearest interval. + * @param date A DateTime object containing a value to round. + * @param spanInMs A TimeSpan object specifying an interval to which to round. + */ + CeilDateTime(date: Date, spanInMs: any): Date; +} +interface ASPxClientWeekDaysCheckEditStatic extends ASPxClientControlStatic { +} +interface ASPxClientRecurrenceRangeControlStatic extends ASPxClientControlStatic { +} +interface ASPxClientRecurrenceControlBaseStatic extends ASPxClientControlStatic { +} +interface ASPxClientDailyRecurrenceControlStatic extends ASPxClientRecurrenceControlBaseStatic { +} +interface ASPxClientWeeklyRecurrenceControlStatic extends ASPxClientRecurrenceControlBaseStatic { +} +interface ASPxClientMonthlyRecurrenceControlStatic extends ASPxClientRecurrenceControlBaseStatic { +} +interface ASPxClientYearlyRecurrenceControlStatic extends ASPxClientRecurrenceControlBaseStatic { +} +interface ASPxClientRecurrenceTypeEditStatic extends ASPxClientRadioButtonListStatic { +} +interface ASPxClientTimeIntervalStatic { + /** + * Gets the duration of a time interval between two points in time. + * @param start A DateTime object specifying the starting point of the time interval. + * @param end A DateTime object specifying the ending point of the time interval. + */ + CalculateDuration(start: Date, end: Date): number; +} +interface ASPxClientSchedulerStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientScheduler; +} +interface ASPxClientSpellCheckerStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientSpellChecker; +} +interface ASPxClientSpreadsheetStatic extends ASPxClientControlStatic { +} +interface ASPxClientTreeListStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientTreeList; +} +interface MVCxClientCalendarStatic extends ASPxClientCalendarStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientCalendar; +} +interface MVCxClientCallbackPanelStatic extends ASPxClientCallbackPanelStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientCallbackPanel; +} +interface MVCxClientCardViewStatic extends ASPxClientCardViewStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientCardView; +} +interface MVCxClientChartStatic extends ASPxClientWebChartControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientChart; +} +interface MVCxClientComboBoxStatic extends ASPxClientComboBoxStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientComboBox; +} +interface MVCxClientDataViewStatic extends ASPxClientDataViewStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientDataView; +} +interface MVCxClientDateEditStatic extends ASPxClientDateEditStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientDateEdit; +} +interface MVCxClientDockManagerStatic extends ASPxClientDockManagerStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientDockManager; +} +interface MVCxClientDockPanelStatic extends ASPxClientDockPanelStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientDockPanel; +} +interface MVCxClientFileManagerStatic extends ASPxClientFileManagerStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientFileManager; +} +interface MVCxClientGridViewStatic extends ASPxClientGridViewStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientGridView; +} +interface MVCxClientHtmlEditorStatic extends ASPxClientHtmlEditorStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientHtmlEditor; +} +interface MVCxClientImageGalleryStatic extends ASPxClientImageGalleryStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientImageGallery; +} +interface MVCxClientListBoxStatic extends ASPxClientListBoxStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientListBox; +} +interface MVCxClientNavBarStatic extends ASPxClientNavBarStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientNavBar; +} +interface MVCxClientPivotGridStatic extends ASPxClientPivotGridStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientPivotGrid; +} +interface MVCxClientPopupControlStatic extends ASPxClientPopupControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientPopupControl; +} +interface MVCxClientDocumentViewerStatic extends ASPxClientDocumentViewerStatic { +} +interface MVCxClientReportViewerStatic extends ASPxClientReportViewerStatic { +} +interface MVCxClientReportDesignerStatic extends ASPxClientReportDesignerStatic { +} +interface MVCxClientRichEditStatic extends ASPxClientRichEditStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientRichEdit; +} +interface MVCxClientRoundPanelStatic extends ASPxClientRoundPanelStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientRoundPanel; +} +interface MVCxClientSchedulerStatic extends ASPxClientSchedulerStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientScheduler; +} +interface MVCxSchedulerToolTipTypeStatic { + Appointment: number; + AppointmentDrag: number; + Selection: number; +} +interface MVCxClientSpreadsheetStatic extends ASPxClientSpreadsheetStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientSpreadsheet; +} +interface MVCxClientPageControlStatic extends ASPxClientPageControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientPageControl; +} +interface MVCxClientTokenBoxStatic extends ASPxClientTokenBoxStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientTokenBox; +} +interface MVCxClientTreeListStatic extends ASPxClientTreeListStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientTreeList; +} +interface MVCxClientTreeViewStatic extends ASPxClientTreeViewStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientTreeView; +} +interface MVCxClientUploadControlStatic extends ASPxClientUploadControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientUploadControl; +} +interface MVCxClientUtilsStatic { + /** + * Loads service resources (such as scripts, CSS files, etc.) required for DevExpress functionality to work properly after a non DevExpress callback has been processed on the server and returned back to the client. + */ + FinalizeCallback(): void; + /** + * Returns values of editors placed in the specified container. + * @param containerOrId A container of editors, or its ID. + */ + GetSerializedEditorValuesInContainer(containerOrId: Object): Object; + /** + * Returns values of editors placed in the specified container. + * @param containerOrId A container of editors, or its ID. + * @param processInvisibleEditors true to process both visible and invisible editors that belong to the specified container; false to process only visible editors. + */ + GetSerializedEditorValuesInContainer(containerOrId: Object, processInvisibleEditors: boolean): Object; +} +interface MVCxClientGlobalEventsStatic { + /** + * Dynamically connects the ControlsInitialized client event with an appropriate event handler function. + * @param handler A object representing the event handling function's content. + */ + AddControlsInitializedEventHandler(handler: ASPxClientControlsInitializedEventHandler): void; + /** + * Dynamically connects the BeginCallback client event with an appropriate event handler function. + * @param handler A object containing the event handling function's content. + */ + AddBeginCallbackEventHandler(handler: MVCxClientBeginCallbackEventHandler): void; + /** + * Dynamically connects the EndCallback client event with an appropriate event handler function. + * @param handler A object containing the event handling function's content. + */ + AddEndCallbackEventHandler(handler: ASPxClientEndCallbackEventHandler): void; + /** + * Dynamically connects the CallbackError client event with an appropriate event handler function. + * @param handler A object containing the event handling function's content. + */ + AddCallbackErrorHandler(handler: ASPxClientCallbackErrorEventHandler): void; +} +interface MVCxClientVerticalGridStatic extends ASPxClientVerticalGridStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientVerticalGrid; +} +interface MVCxClientWebDocumentViewerStatic extends ASPxClientWebDocumentViewerStatic { +} +interface ASPxClientControlBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientControlBase; +} +interface ASPxClientControlStatic extends ASPxClientControlBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientControl; + /** + * Modifies the controls size on the page. + */ + AdjustControls(): void; + /** + * Modifies the controls size within the specified container. + * @param container An HTML element that is the container of the controls. + */ + AdjustControls(container: Object): void; + /** + * Returns a collection of client web control objects. + */ + GetControlCollection(): ASPxClientControlCollection; +} +interface ASPxClientCallbackStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientCallback; +} +interface ASPxClientCallbackPanelStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientCallbackPanel; +} +interface ASPxClientCloudControlStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientCloudControl; +} +interface ASPxClientDataViewStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientDataView; +} +interface ASPxClientDockManagerStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientDockManager; +} +interface ASPxClientPopupControlBaseStatic extends ASPxClientControlStatic { +} +interface ASPxClientDockPanelStatic extends ASPxClientPopupControlBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientDockPanel; +} +interface ASPxClientDockZoneStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientDockZone; +} +interface ASPxClientFileManagerStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientFileManager; +} +interface ASPxClientFileManagerCommandConstsStatic { + /** + * The name of a command that is executed when an end-user renames an item. + */ + Rename: string; + /** + * The name of a command that is executed when an end-user moves an item. + */ + Move: string; + /** + * The name of a command that is executed when an end-user deletes an item. + */ + Delete: string; + /** + * The name of a command that is executed when an end-user creates a folder. + */ + Create: string; + /** + * The name of a command that is executed when an end-user uploads a file. + */ + Upload: string; + /** + * The name of a command that is executed when an end-user downloads an item. + */ + Download: string; + /** + * The name of a command that is executed when an end-user copies an item. + */ + Copy: string; + /** + * The name of a command that is executed when an end-user opens an item. + */ + Open: string; +} +interface ASPxClientFileManagerErrorConstsStatic { + /** + * The specified file is not found. Return Value: 0 + */ + FileNotFound: number; + /** + * The specified folder is not found. Return Value: 1 + */ + FolderNotFound: number; + /** + * Access is denied. Return Value: 2 + */ + AccessDenied: number; + /** + * Unspecified IO error occurs. Return Value: 3 + */ + UnspecifiedIO: number; + /** + * Unspecified error occurs. Return Value: 4 + */ + Unspecified: number; + /** + * The file/folder name is empty. Return Value: 5 + */ + EmptyName: number; + /** + * The operation was canceled. Return Value: 6 + */ + CanceledOperation: number; + /** + * The specified name contains invalid characters. Return Value: 7 + */ + InvalidSymbols: number; + /** + * The specified file extension is not allowed. Return Value: 8 + */ + WrongExtension: number; + /** + * The file/folder is being used by another process. Return Value: 9 + */ + UsedByAnotherProcess: number; + /** + * The specified file/folder already exists. Return Value: 10 + */ + AlreadyExists: number; +} +interface ASPxClientFormLayoutStatic extends ASPxClientControlStatic { +} +interface ASPxClientHiddenFieldStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientHiddenField; +} +interface ASPxClientImageGalleryStatic extends ASPxClientDataViewStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientImageGallery; +} +interface ASPxClientImageSliderStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientImageSlider; +} +interface ASPxClientImageZoomNavigatorStatic extends ASPxClientImageSliderStatic { +} +interface ASPxClientImageZoomStatic extends ASPxClientControlStatic { +} +interface ASPxClientLoadingPanelStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientLoadingPanel; +} +interface ASPxClientMenuBaseStatic extends ASPxClientControlStatic { + /** + * Returns a collection of client menu objects. + */ + GetMenuCollection(): ASPxClientMenuCollection; +} +interface ASPxClientMenuStatic extends ASPxClientMenuBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientMenu; +} +interface ASPxClientTouchUIStatic { + /** + * Extends the specified element's functionality with scrolling via touch behavior (one finger) and the ability to display vertical and horizontal scroll bars. + * @param id A string value specifying the element's ID. + */ + MakeScrollable(id: string): ScrollExtender; + /** + * Extends the specified element's functionality with scrolling via touch behavior (one finger) and the ability to display vertical and horizontal scroll bars. + * @param element An object that specifies the required DOM element. + */ + MakeScrollable(element: Object): ScrollExtender; + /** + * Extends the specified element's functionality with scrolling via touch behavior (one finger) and customized scrollbar-related options. + * @param id A string value specifying the name of a DOM element that should be extended with the touch scrolling functionality. + * @param options An ASPxClientTouchUIOptions object that provides options affecting the touch scrolling functionality. + */ + MakeScrollable(id: string, options: ASPxClientTouchUIOptions): ScrollExtender; + /** + * Extends the specified element's functionality with scrolling via touch behavior (one finger) and customized scrollbar-related options. + * @param element An object specifying the DOM element to extend with the touch scrolling functionality. + * @param options An ASPxClientTouchUIOptions object that provides options affecting the touch scrolling functionality. + */ + MakeScrollable(element: Object, options: ASPxClientTouchUIOptions): ScrollExtender; +} +interface ASPxClientNavBarStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientNavBar; +} +interface ASPxClientNewsControlStatic extends ASPxClientDataViewStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientNewsControl; +} +interface ASPxClientObjectContainerStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientObjectContainer; +} +interface ASPxClientPanelBaseStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientPanelBase; +} +interface ASPxClientPanelStatic extends ASPxClientPanelBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientPanel; +} +interface ASPxClientPopupControlStatic extends ASPxClientPopupControlBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientPopupControl; + /** + * Returns a collection of client popup control objects. + */ + GetPopupControlCollection(): ASPxClientPopupControlCollection; +} +interface ASPxClientPopupControlResizeStateStatic { + /** + * A window has been resized. Returns 0. + */ + Resized: number; + /** + * A window has been collapsed. Returns 1. + */ + Collapsed: number; + /** + * A window has been expanded. Returns 2. + */ + Expanded: number; + /** + * A window has been maximized. Returns 3. + */ + Maximized: number; + /** + * A window has been restored after maximizing. Returns 4. + */ + RestoredAfterMaximized: number; +} +interface ASPxClientPopupControlCloseReasonStatic { + /** + * The window has been closed by an API. + */ + API: string; + /** + * An end-user clicks the close header button. + */ + CloseButton: string; + /** + * An end-user clicks outside the window's region + */ + OuterMouseClick: string; + /** + * An end-user moves the mouse pointer out of the window region. + */ + MouseOut: string; + /** + * An end-user presses the ESC key. + */ + Escape: string; +} +interface ASPxClientPopupMenuStatic extends ASPxClientMenuBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientPopupMenu; +} +interface ASPxClientRatingControlStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientRatingControl; +} +interface ASPxClientRibbonStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientRibbon; +} +interface ASPxClientRibbonStateStatic { + /** + * A ribbon is in the normal state. Returns 0 + */ + Normal: number; + /** + * A ribbon is minimized. Returns 1 + */ + Minimized: number; + /** + * A ribbon is temporarily shown. Returns 2 + */ + TemporaryShown: number; +} +interface ASPxClientRoundPanelStatic extends ASPxClientPanelBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientRoundPanel; +} +interface ASPxClientSplitterStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientSplitter; +} +interface ASPxClientTabControlBaseStatic extends ASPxClientControlStatic { +} +interface ASPxClientTabControlStatic extends ASPxClientTabControlBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientTabControl; +} +interface ASPxClientPageControlStatic extends ASPxClientTabControlBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientPageControl; +} +interface ASPxClientTimerStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientTimer; +} +interface ASPxClientTitleIndexStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientTitleIndex; +} +interface ASPxClientTreeViewStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientTreeView; +} +interface ASPxClientUploadControlStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientUploadControl; +} +interface ASPxClientUtilsStatic { + /** + * Gets the user-agent string, which identifies the client browser and provides certain system details of the client computer. + * Value: A string value representing the browser's user-agent string. + */ + agent: string; + /** + * Gets a value that specifies whether the client browser is Opera. + * Value: true if the client browser is Opera; otherwise, false. + */ + opera: boolean; + /** + * Gets a value that specifies whether the client browser is Opera version 9. + * Value: true if the client browser is Opera version 9; otherwise, false. + */ + opera9: boolean; + /** + * Gets a value that specifies whether the client browser is Safari. + * Value: true if the client browser is Safari; otherwise, false. + */ + safari: boolean; + /** + * Gets a value that specifies whether the client browser is Safari version 3. + * Value: true if the client browser is Safari version 3; otherwise, false. + */ + safari3: boolean; + /** + * Gets a value that specifies whether the client browser is Safari, running under a MacOS operating system. + * Value: true if the client browser is Safari, running under a MacOS operating system; otherwise, false. + */ + safariMacOS: boolean; + /** + * Gets a value that specifies whether the client browser is Google Chrome. + * Value: true if the client browser is Google Chrome; otherwise, false. + */ + chrome: boolean; + /** + * Gets a value that specifies whether the client browser is Internet Explorer. + * Value: true if the client browser is Intenet Explorer; otherwise, false. + */ + ie: boolean; + /** + * Gets a value that specifies whether the client browser is Internet Explorer version 7. + * Value: true if the client browser is Intenet Explorer version 7; otherwise, false. + */ + ie7: boolean; + /** + * Gets a value that specifies whether the client browser is Firefox. + * Value: true if the client browser is Firefox; otherwise, false. + */ + firefox: boolean; + /** + * Gets a value that specifies whether the client browser is Firefox version 3. + * Value: true if the client browser is Firefox version 3; otherwise, false. + */ + firefox3: boolean; + /** + * Gets a value that specifies whether the client browser is Mozilla. + * Value: true if the client browser is Mozilla; otherwise, false. + */ + mozilla: boolean; + /** + * Gets a value that specifies whether the client browser is Netscape. + * Value: true if the client browser is Netscape; otherwise, false. + */ + netscape: boolean; + /** + * Gets a value that specifies a client browser's full version. + * Value: A double precision floating-point value that specifies a client browser's version. + */ + browserVersion: number; + /** + * Gets a value that specifies a client browser's major version. + * Value: An integer value that specifies a client browser's major version. + */ + browserMajorVersion: number; + /** + * Gets a value that specifies whether the application is run under a MacOS platform. + * Value: true if the application is run under the MacOS platform; otherwise, false. + */ + macOSPlatform: boolean; + /** + * Gets a value that specifies whether the application is run under the Windows platform. + * Value: true if the application is run under the Windows platform; otherwise, false. + */ + windowsPlatform: boolean; + /** + * Gets a value that specifies whether a client browser is based on WebKit. + * Value: true if the client browser is based on WebKit; otherwise, false. + */ + webKitFamily: boolean; + /** + * Gets a value that specifies whether a client browser is based on Netscape. + * Value: true if client browser is based on Netscape; otherwise, false. + */ + netscapeFamily: boolean; + /** + * Gets a value that specifies whether the client browser supports touch. + * Value: true if the client browser supports touch; otherwise, false. + */ + touchUI: boolean; + /** + * Gets a value that specifies whether the client browser supports the WebKit touch user interface. + * Value: true if the client browser supports the WebKit touch user interface; otherwise, false. + */ + webKitTouchUI: boolean; + /** + * Gets a value that specifies whether the client browser supports the Microsoft touch user interface. + * Value: true if the client browser supports the Microsoft touch user interface; otherwise, false. + */ + msTouchUI: boolean; + /** + * Gets a value that specifies whether the application is run under an iOS platform. + * Value: true if the application is run under the iOS platform; otherwise, false. + */ + iOSPlatform: boolean; + /** + * Gets a value that specifies whether the application is run under the Android platform. + * Value: true if the application is run under the Android platform; otherwise, false. + */ + androidPlatform: boolean; + /** + * Inserts the specified item into the specified array object. + * @param array An object that specifies the array to manipulate. + * @param element An object that specifies the array item to insert. + */ + ArrayInsert(array: Object[], element: Object): void; + /** + * Removes the specified item from the specified array object. + * @param array An object that specifies the array to manipulate. + * @param element An object that specifies the array item to remove. + */ + ArrayRemove(array: Object[], element: Object): void; + /** + * Removes an item at the specified index location from the specified array object. + * @param array An object that specifies the array to manipulate. + * @param index The zero-based index location of the array item to remove. + */ + ArrayRemoveAt(array: Object[], index: number): void; + /** + * Removes all items from the specified array object. + * @param array An object that specifies the array to manipulate. + */ + ArrayClear(array: Object[]): void; + /** + * Searches for the specified array item and returns the zero-based index of its first occurrence within the specified array object. + * @param array An object that specifies the array to manipulate. + * @param element An object that specifies the array item to locate. + */ + ArrayIndexOf(array: Object[], element: Object): number; + /** + * Binds the specified function to a specific element's event, so that the function gets called whenever the event fires on the element. + * @param element An object specifying the required element. + * @param eventName A string value that specifies the required event name without the "on" prefix. + * @param method An object that specifies the event's handling function. + */ + AttachEventToElement(element: Object, eventName: string, method: Object): void; + /** + * Unbinds the specified function from a specific element's event, so that the function stops receiving notifications when the event fires. + * @param element An object specifying the required element. + * @param eventName A string value that specifies the required event name. + * @param method An object that specifies the event's handling function. + */ + DetachEventFromElement(element: Object, eventName: string, method: Object): void; + /** + * Returns the object that fired the event. + * @param htmlEvent An object that represents the current event. + */ + GetEventSource(htmlEvent: Object): Object; + /** + * Gets the x-coordinate of the event-related mouse pointer position relative to an end-user's screen. + * @param htmlEvent An object specifying the required HTML event. + */ + GetEventX(htmlEvent: Object): number; + /** + * Gets the y-coordinate of the event-related mouse pointer position relative to an end-user's screen. + * @param htmlEvent An object specifying the required HTML event. + */ + GetEventY(htmlEvent: Object): number; + /** + * Gets the keyboard code for the specified event. + * @param htmlEvent An object specifying the required HTML event. + */ + GetKeyCode(htmlEvent: Object): number; + /** + * Cancels the default action of the specified event. + * @param htmlEvent An object that specifies the required HTML event. + */ + PreventEvent(htmlEvent: Object): boolean; + /** + * Cancels both the specified event's default action and the event's bubbling upon the hierarchy of event handlers. + * @param htmlEvent An object that specifies the required HTML event. + */ + PreventEventAndBubble(htmlEvent: Object): boolean; + /** + * Removes mouse capture from the specified event's source object. + * @param htmlEvent An object that specifies the required HTML event. + */ + PreventDragStart(htmlEvent: Object): boolean; + /** + * Clears any text selection made within the window's client region. + */ + ClearSelection(): void; + /** + * Gets a value that indicates whether the specified object exists on the client side. + * @param obj The object to test. + */ + IsExists(obj: Object): boolean; + /** + * Gets a value that indicates whether the specified object is a function. + * @param obj The object to test. + */ + IsFunction(obj: Object): boolean; + /** + * Gets the x-coordinate of the specified element's top left corner relative to the client area of the window, excluding scroll bars. + * @param element An object identifying the HTML element whose position should be obtained. + */ + GetAbsoluteX(element: Object): number; + /** + * Gets the y-coordinate of the specified element's top left corner relative to the client area of the window, excluding scroll bars. + * @param element An object identifying the HTML element whose position should be obtained. + */ + GetAbsoluteY(element: Object): number; + /** + * Sets the x-coordinate of the specified element's top left corner relative to the client area of the window, excluding scroll bars. + * @param element An object identifying the HTML element whose position should be defined. + * @param x An integer value specifying the required element's x-coordinate, in pixels. + */ + SetAbsoluteX(element: Object, x: number): void; + /** + * Sets the y-coordinate of the specified element's top left corner relative to the client area of the window, excluding scroll bars. + * @param element An object identifying the HTML element whose position should be defined. + * @param y An integer value specifying the required element's y-coordinate, in pixels. + */ + SetAbsoluteY(element: Object, y: number): void; + /** + * Returns the distance between the top edge of the document and the topmost portion of the content currently visible in the window. + */ + GetDocumentScrollTop(): number; + /** + * Returns the distance between the left edge of the document and the leftmost portion of the content currently visible in the window. + */ + GetDocumentScrollLeft(): number; + /** + * Gets the width of the window's client region. + */ + GetDocumentClientWidth(): number; + /** + * Gets the height of the window's client region. + */ + GetDocumentClientHeight(): number; + /** + * Gets a value indicating whether the object passed via the parentElement parameter is a parent of the object passed via the element parameter. + * @param parentElement An object specifying the parent HTML element. + * @param element An object specifying the child HTML element. + */ + GetIsParent(parentElement: Object, element: Object): boolean; + /** + * Returns a reference to the specified HTML element's first parent object which has an ID that matches the specified value. + * @param element An object specifying the child HTML element whose parent elements are searched. + * @param id A string specifying the required parent's ID. + */ + GetParentById(element: Object, id: string): Object; + /** + * Returns a reference to the specified HTML element's first parent object whose element name matches the specified value. + * @param element An object specifying the child HTML element whose parent elements are searched. + * @param tagName A string value specifying the element name (tag name) of the desired HTML element. + */ + GetParentByTagName(element: Object, tagName: string): Object; + /** + * Returns a reference to the specified HTML element's first parent object whose class name matches the specified value. + * @param element An object specifying the child HTML element whose parent elements are searched. + * @param className A string value specifying the class name of the desired HTML element. + */ + GetParentByClassName(element: Object, className: string): Object; + /** + * Returns a reference to the first element that has the specified ID in the parent HTML element specified. + * @param element An object identifying the parent HTML element to search. + * @param id A string specifying the ID attribute value of the desired child element. + */ + GetChildById(element: Object, id: string): Object; + /** + * Returns a reference to the particular element that has the specified element name and is contained within the specified parent HTML element. + * @param element An object specifying the parent HTML element to search. + * @param tagName A string value specifying the element name (tag name) of the desired HTML element. + * @param index An integer value specifying the zero-based index of the desired element amongst all the matching elements found. + */ + GetChildByTagName(element: Object, tagName: string, index: number): Object; + /** + * Creates or updates the HTTP cookie for the response. + * @param name A string value that represents the name of a cookie. + * @param value A string representing the cookie value. + */ + SetCookie(name: string, value: string): void; + /** + * Creates or updates the HTTP cookie for the response. + * @param name A string value that represents the name of a cookie. + * @param value A string representing the cookie value. + * @param expirationDate A date-time object that represents the expiration date and time for the cookie. + */ + SetCookie(name: string, value: string, expirationDate: Date): void; + /** + * Retrieves a cookie with the specified name. + * @param name A string value that represents the name of a cookie. + */ + GetCookie(name: string): string; + /** + * Deletes a cookie with the specified name. + * @param name A string value that represents the name of a cookie. + */ + DeleteCookie(name: string): void; + /** + * Returns a specifically generated code that uniquely identifies the combination of keys specified via the parameters. + * @param keyCode An integer value that specifies the code of the key. + * @param isCtrlKey true if the CTRL key should be included into the key combination; otherwise, false. + * @param isShiftKey true if the SHIFT key should be included into the key combination; otherwise, false. + * @param isAltKey true if the ALT key should be included into the key combination; otherwise, false. + */ + GetShortcutCode(keyCode: number, isCtrlKey: boolean, isShiftKey: boolean, isAltKey: boolean): number; + /** + * Returns a specifically generated code that uniquely identifies the pressed key combination, which is specified by the related HTML event. + * @param htmlEvent A DHTML event object that relates to a key combination being pressed. + */ + GetShortcutCodeByEvent(htmlEvent: Object): number; + /** + * Returns a specifically generated code that uniquely identifies the combination of keys specified via the parameter. + * @param shortcutString A string value that specifies the key combination. + */ + StringToShortcutCode(shortcutString: string): number; + /** + * Trims all leading and trailing whitespaces from the string. + * @param str A string value representing the string for trimming. + */ + Trim(str: string): string; + /** + * Trims all leading whitespaces from the string. + * @param str A string value representing the string for trimming. + */ + TrimStart(str: string): string; + /** + * Trims all trailing whitespaces from the string. + * @param str A string value representing the string for trimming. + */ + TrimEnd(str: string): string; +} +interface ASPxClientChartDesignerStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientChartDesigner; +} +interface ASPxClientWebChartControlStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientWebChartControl; +} +interface ASPxClientDocumentViewerStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientDocumentViewer; +} +interface ASPxClientQueryBuilderStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientQueryBuilder; +} +interface ASPxClientReportDesignerStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientReportDesigner; +} +interface ASPxClientReportDocumentMapStatic extends ASPxClientControlStatic { +} +interface ASPxClientReportParametersPanelStatic extends ASPxClientControlStatic { +} +interface ASPxClientReportToolbarStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientReportToolbar; +} +interface ASPxClientReportViewerStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientReportViewer; +} +interface ASPxClientWebDocumentViewerStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientWebDocumentViewer; +} + +declare var MVCxClientDashboardViewer: MVCxClientDashboardViewerStatic; +declare var DashboardDataAxisNames: DashboardDataAxisNamesStatic; +declare var DashboardSpecialValues: DashboardSpecialValuesStatic; +declare var ASPxClientDashboardDesigner: ASPxClientDashboardDesignerStatic; +declare var ASPxClientDashboardViewer: ASPxClientDashboardViewerStatic; +declare var DashboardExportPageLayout: DashboardExportPageLayoutStatic; +declare var DashboardExportPaperKind: DashboardExportPaperKindStatic; +declare var DashboardExportScaleMode: DashboardExportScaleModeStatic; +declare var DashboardExportFilterState: DashboardExportFilterStateStatic; +declare var DashboardExportImageFormat: DashboardExportImageFormatStatic; +declare var DashboardExportExcelFormat: DashboardExportExcelFormatStatic; +declare var ChartExportSizeMode: ChartExportSizeModeStatic; +declare var MapExportSizeMode: MapExportSizeModeStatic; +declare var RangeFilterExportSizeMode: RangeFilterExportSizeModeStatic; +declare var DashboardSelectionMode: DashboardSelectionModeStatic; +declare var ASPxClientEditBase: ASPxClientEditBaseStatic; +declare var ASPxClientEdit: ASPxClientEditStatic; +declare var ASPxClientBinaryImage: ASPxClientBinaryImageStatic; +declare var ASPxClientButton: ASPxClientButtonStatic; +declare var ASPxClientCalendar: ASPxClientCalendarStatic; +declare var ASPxClientCaptcha: ASPxClientCaptchaStatic; +declare var ASPxClientCheckBox: ASPxClientCheckBoxStatic; +declare var ASPxClientRadioButton: ASPxClientRadioButtonStatic; +declare var ASPxClientTextEdit: ASPxClientTextEditStatic; +declare var ASPxClientTextBoxBase: ASPxClientTextBoxBaseStatic; +declare var ASPxClientButtonEditBase: ASPxClientButtonEditBaseStatic; +declare var ASPxClientDropDownEditBase: ASPxClientDropDownEditBaseStatic; +declare var ASPxClientColorEdit: ASPxClientColorEditStatic; +declare var ASPxClientComboBox: ASPxClientComboBoxStatic; +declare var ASPxClientDateEdit: ASPxClientDateEditStatic; +declare var ASPxClientDropDownEdit: ASPxClientDropDownEditStatic; +declare var ASPxClientFilterControl: ASPxClientFilterControlStatic; +declare var ASPxClientListEdit: ASPxClientListEditStatic; +declare var ASPxClientListBox: ASPxClientListBoxStatic; +declare var ASPxClientCheckListBase: ASPxClientCheckListBaseStatic; +declare var ASPxClientRadioButtonList: ASPxClientRadioButtonListStatic; +declare var ASPxClientCheckBoxList: ASPxClientCheckBoxListStatic; +declare var ASPxClientProgressBar: ASPxClientProgressBarStatic; +declare var ASPxClientSpinEditBase: ASPxClientSpinEditBaseStatic; +declare var ASPxClientSpinEdit: ASPxClientSpinEditStatic; +declare var ASPxClientTimeEdit: ASPxClientTimeEditStatic; +declare var ASPxClientStaticEdit: ASPxClientStaticEditStatic; +declare var ASPxClientHyperLink: ASPxClientHyperLinkStatic; +declare var ASPxClientImageBase: ASPxClientImageBaseStatic; +declare var ASPxClientImage: ASPxClientImageStatic; +declare var ASPxClientLabel: ASPxClientLabelStatic; +declare var ASPxClientTextBox: ASPxClientTextBoxStatic; +declare var ASPxClientMemo: ASPxClientMemoStatic; +declare var ASPxClientButtonEdit: ASPxClientButtonEditStatic; +declare var ASPxClientTokenBox: ASPxClientTokenBoxStatic; +declare var ASPxClientTrackBar: ASPxClientTrackBarStatic; +declare var ASPxClientValidationSummary: ASPxClientValidationSummaryStatic; +declare var ASPxClientGaugeControl: ASPxClientGaugeControlStatic; +declare var ASPxClientGridBase: ASPxClientGridBaseStatic; +declare var ASPxClientGridViewCallbackCommand: ASPxClientGridViewCallbackCommandStatic; +declare var ASPxClientGridLookup: ASPxClientGridLookupStatic; +declare var ASPxClientCardView: ASPxClientCardViewStatic; +declare var ASPxClientGridView: ASPxClientGridViewStatic; +declare var ASPxClientVerticalGrid: ASPxClientVerticalGridStatic; +declare var ASPxClientVerticalGridCallbackCommand: ASPxClientVerticalGridCallbackCommandStatic; +declare var ASPxClientCommandConsts: ASPxClientCommandConstsStatic; +declare var ASPxClientHtmlEditor: ASPxClientHtmlEditorStatic; +declare var ASPxClientHtmlEditorMediaPreloadMode: ASPxClientHtmlEditorMediaPreloadModeStatic; +declare var ASPxClientPivotGrid: ASPxClientPivotGridStatic; +declare var ASPxClientPivotCustomization: ASPxClientPivotCustomizationStatic; +declare var ASPxClientRichEdit: ASPxClientRichEditStatic; +declare var ASPxSchedulerDateTimeHelper: ASPxSchedulerDateTimeHelperStatic; +declare var ASPxClientWeekDaysCheckEdit: ASPxClientWeekDaysCheckEditStatic; +declare var ASPxClientRecurrenceRangeControl: ASPxClientRecurrenceRangeControlStatic; +declare var ASPxClientRecurrenceControlBase: ASPxClientRecurrenceControlBaseStatic; +declare var ASPxClientDailyRecurrenceControl: ASPxClientDailyRecurrenceControlStatic; +declare var ASPxClientWeeklyRecurrenceControl: ASPxClientWeeklyRecurrenceControlStatic; +declare var ASPxClientMonthlyRecurrenceControl: ASPxClientMonthlyRecurrenceControlStatic; +declare var ASPxClientYearlyRecurrenceControl: ASPxClientYearlyRecurrenceControlStatic; +declare var ASPxClientRecurrenceTypeEdit: ASPxClientRecurrenceTypeEditStatic; +declare var ASPxClientTimeInterval: ASPxClientTimeIntervalStatic; +declare var ASPxClientScheduler: ASPxClientSchedulerStatic; +declare var ASPxClientSpellChecker: ASPxClientSpellCheckerStatic; +declare var ASPxClientSpreadsheet: ASPxClientSpreadsheetStatic; +declare var ASPxClientTreeList: ASPxClientTreeListStatic; +declare var MVCxClientCalendar: MVCxClientCalendarStatic; +declare var MVCxClientCallbackPanel: MVCxClientCallbackPanelStatic; +declare var MVCxClientCardView: MVCxClientCardViewStatic; +declare var MVCxClientChart: MVCxClientChartStatic; +declare var MVCxClientComboBox: MVCxClientComboBoxStatic; +declare var MVCxClientDataView: MVCxClientDataViewStatic; +declare var MVCxClientDateEdit: MVCxClientDateEditStatic; +declare var MVCxClientDockManager: MVCxClientDockManagerStatic; +declare var MVCxClientDockPanel: MVCxClientDockPanelStatic; +declare var MVCxClientFileManager: MVCxClientFileManagerStatic; +declare var MVCxClientGridView: MVCxClientGridViewStatic; +declare var MVCxClientHtmlEditor: MVCxClientHtmlEditorStatic; +declare var MVCxClientImageGallery: MVCxClientImageGalleryStatic; +declare var MVCxClientListBox: MVCxClientListBoxStatic; +declare var MVCxClientNavBar: MVCxClientNavBarStatic; +declare var MVCxClientPivotGrid: MVCxClientPivotGridStatic; +declare var MVCxClientPopupControl: MVCxClientPopupControlStatic; +declare var MVCxClientDocumentViewer: MVCxClientDocumentViewerStatic; +declare var MVCxClientReportViewer: MVCxClientReportViewerStatic; +declare var MVCxClientReportDesigner: MVCxClientReportDesignerStatic; +declare var MVCxClientRichEdit: MVCxClientRichEditStatic; +declare var MVCxClientRoundPanel: MVCxClientRoundPanelStatic; +declare var MVCxClientScheduler: MVCxClientSchedulerStatic; +declare var MVCxSchedulerToolTipType: MVCxSchedulerToolTipTypeStatic; +declare var MVCxClientSpreadsheet: MVCxClientSpreadsheetStatic; +declare var MVCxClientPageControl: MVCxClientPageControlStatic; +declare var MVCxClientTokenBox: MVCxClientTokenBoxStatic; +declare var MVCxClientTreeList: MVCxClientTreeListStatic; +declare var MVCxClientTreeView: MVCxClientTreeViewStatic; +declare var MVCxClientUploadControl: MVCxClientUploadControlStatic; +declare var MVCxClientUtils: MVCxClientUtilsStatic; +declare var MVCxClientGlobalEvents: MVCxClientGlobalEventsStatic; +declare var MVCxClientVerticalGrid: MVCxClientVerticalGridStatic; +declare var MVCxClientWebDocumentViewer: MVCxClientWebDocumentViewerStatic; +declare var ASPxClientControlBase: ASPxClientControlBaseStatic; +declare var ASPxClientControl: ASPxClientControlStatic; +declare var ASPxClientCallback: ASPxClientCallbackStatic; +declare var ASPxClientCallbackPanel: ASPxClientCallbackPanelStatic; +declare var ASPxClientCloudControl: ASPxClientCloudControlStatic; +declare var ASPxClientDataView: ASPxClientDataViewStatic; +declare var ASPxClientDockManager: ASPxClientDockManagerStatic; +declare var ASPxClientPopupControlBase: ASPxClientPopupControlBaseStatic; +declare var ASPxClientDockPanel: ASPxClientDockPanelStatic; +declare var ASPxClientDockZone: ASPxClientDockZoneStatic; +declare var ASPxClientFileManager: ASPxClientFileManagerStatic; +declare var ASPxClientFileManagerCommandConsts: ASPxClientFileManagerCommandConstsStatic; +declare var ASPxClientFileManagerErrorConsts: ASPxClientFileManagerErrorConstsStatic; +declare var ASPxClientFormLayout: ASPxClientFormLayoutStatic; +declare var ASPxClientHiddenField: ASPxClientHiddenFieldStatic; +declare var ASPxClientImageGallery: ASPxClientImageGalleryStatic; +declare var ASPxClientImageSlider: ASPxClientImageSliderStatic; +declare var ASPxClientImageZoomNavigator: ASPxClientImageZoomNavigatorStatic; +declare var ASPxClientImageZoom: ASPxClientImageZoomStatic; +declare var ASPxClientLoadingPanel: ASPxClientLoadingPanelStatic; +declare var ASPxClientMenuBase: ASPxClientMenuBaseStatic; +declare var ASPxClientMenu: ASPxClientMenuStatic; +declare var ASPxClientTouchUI: ASPxClientTouchUIStatic; +declare var ASPxClientNavBar: ASPxClientNavBarStatic; +declare var ASPxClientNewsControl: ASPxClientNewsControlStatic; +declare var ASPxClientObjectContainer: ASPxClientObjectContainerStatic; +declare var ASPxClientPanelBase: ASPxClientPanelBaseStatic; +declare var ASPxClientPanel: ASPxClientPanelStatic; +declare var ASPxClientPopupControl: ASPxClientPopupControlStatic; +declare var ASPxClientPopupControlResizeState: ASPxClientPopupControlResizeStateStatic; +declare var ASPxClientPopupControlCloseReason: ASPxClientPopupControlCloseReasonStatic; +declare var ASPxClientPopupMenu: ASPxClientPopupMenuStatic; +declare var ASPxClientRatingControl: ASPxClientRatingControlStatic; +declare var ASPxClientRibbon: ASPxClientRibbonStatic; +declare var ASPxClientRibbonState: ASPxClientRibbonStateStatic; +declare var ASPxClientRoundPanel: ASPxClientRoundPanelStatic; +declare var ASPxClientSplitter: ASPxClientSplitterStatic; +declare var ASPxClientTabControlBase: ASPxClientTabControlBaseStatic; +declare var ASPxClientTabControl: ASPxClientTabControlStatic; +declare var ASPxClientPageControl: ASPxClientPageControlStatic; +declare var ASPxClientTimer: ASPxClientTimerStatic; +declare var ASPxClientTitleIndex: ASPxClientTitleIndexStatic; +declare var ASPxClientTreeView: ASPxClientTreeViewStatic; +declare var ASPxClientUploadControl: ASPxClientUploadControlStatic; +declare var ASPxClientUtils: ASPxClientUtilsStatic; +declare var ASPxClientChartDesigner: ASPxClientChartDesignerStatic; +declare var ASPxClientWebChartControl: ASPxClientWebChartControlStatic; +declare var ASPxClientDocumentViewer: ASPxClientDocumentViewerStatic; +declare var ASPxClientQueryBuilder: ASPxClientQueryBuilderStatic; +declare var ASPxClientReportDesigner: ASPxClientReportDesignerStatic; +declare var ASPxClientReportDocumentMap: ASPxClientReportDocumentMapStatic; +declare var ASPxClientReportParametersPanel: ASPxClientReportParametersPanelStatic; +declare var ASPxClientReportToolbar: ASPxClientReportToolbarStatic; +declare var ASPxClientReportViewer: ASPxClientReportViewerStatic; +declare var ASPxClientWebDocumentViewer: ASPxClientWebDocumentViewerStatic; + diff --git a/devextreme/devextreme-15.2.9.d.ts b/devextreme/devextreme-15.2.9.d.ts new file mode 100644 index 0000000000..3a7d42e05a --- /dev/null +++ b/devextreme/devextreme-15.2.9.d.ts @@ -0,0 +1,7443 @@ +// Type definitions for DevExtreme 15.2.9 +// Project: http://js.devexpress.com/ +// Definitions by: DevExpress Inc. +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module DevExpress { + /** A mixin that provides a capability to fire and subscribe to events. */ + export interface EventsMixin { + /** Subscribes to a specified event. */ + on(eventName: string, eventHandler: Function): T; + /** Subscribes to the specified events. */ + on(events: { [eventName: string]: Function; }): T; + /** Detaches all event handlers from the specified event. */ + off(eventName: string): Object; + /** Detaches a particular event handler from the specified event. */ + off(eventName: string, eventHandler: Function): T; + } + /** An object that serves as a namespace for the methods required to perform validation. */ + export module validationEngine { + export interface IValidator { + validate(): ValidatorValidationResult; + reset(): void; + } + export interface ValidatorValidationResult { + isValid: boolean; + name?: string; + value: any; + brokenRule: any; + validationRules: any[]; + } + export interface ValidationGroupValidationResult { + isValid: boolean; + brokenRules: any[]; + validators: IValidator[]; + } + export interface GroupConfig extends EventsMixin { + group: any; + validators: IValidator[]; + validate(): ValidationGroupValidationResult; + reset(): void; + } + /** Provides access to the object that represents the specified validation group. */ + export function getGroupConfig(group: any): GroupConfig + /** Provides access to the object that represents the default validation group. */ + export function getGroupConfig(): GroupConfig + /** Validates rules of the validators that belong to the specified validation group. */ + export function validateGroup(group: any): ValidationGroupValidationResult; + /** Validates rules of the validators that belong to the default validation group. */ + export function validateGroup(): ValidationGroupValidationResult; + /** Resets the values and validation result of the editors that belong to the specified validation group. */ + export function resetGroup(group: any): void; + /** Resets the values and validation result of the editors that belong to the default validation group. */ + export function resetGroup(): void; + /** Validates the rules that are defined within the dxValidator objects that are registered for the specified ViewModel. */ + export function validateModel(model: Object): ValidationGroupValidationResult; + /** Registers all the dxValidator objects by which the fields of the specified ViewModel are extended. */ + export function registerModelForValidation(model: Object) : void; + } + export var hardwareBackButton: JQueryCallback; + /** Processes the hardware back button click. */ + export function processHardwareBackButton(): void; + /** Hides the last displayed overlay widget. */ + export function hideTopOverlay(): boolean; + /** Specifies whether or not the entire application/site supports right-to-left representation. */ + export var rtlEnabled: boolean; + /** Registers a new component in the DevExpress.ui namespace as a jQuery plugin, Angular directive and Knockout binding. */ + export function registerComponent(name: string, componentClass: Object): void; + /** Registers a new component in the specified namespace as a jQuery plugin, Angular directive and Knockout binding. */ + export function registerComponent(name: string, namespace: Object, componentClass: Object): void; + export function requestAnimationFrame(callback: Function): number; + export function cancelAnimationFrame(requestID: number): void; + /** Custom Knockout binding that links an HTML element with a specific action. */ + export class Action { } + /** Used to get URLs that vary in a locally running application and the application running on production. */ + export class EndpointSelector { + constructor(options: { + [key: string]: { + local?: string; + production?: string; + } + }); + /** Returns a local or a productional URL depending on how the application is currently running. */ + urlFor(key: string): string; + } + /** An object that serves as a namespace for the methods that are used to animate UI elements. */ + export module fx { + /** Defines animation options. */ + export interface AnimationOptions { + /** A function called after animation is completed. */ + complete?: (element: JQuery, config: AnimationOptions) => void; + /** A number specifying wait time before animation execution. */ + delay?: number; + /** A number specifying the time period to wait before the animation of the next stagger item starts. */ + staggerDelay?: number; + /** A number specifying the time in milliseconds spent on animation. */ + duration?: number; + /** A string specifying the type of an easing function used for animation. */ + easing?: string; + /** Specifies the initial animation state. */ + from?: any; + /** A function called before animation is started. */ + start?: (element: JQuery, config: AnimationOptions) => void; + /** Specifies a final animation state. */ + to?: any; + /** A string value specifying the animation type. */ + type?: string; + /** Specifies the animation direction for the "slideIn" and "slideOut" animation types. */ + direction?: string; + } + /** Animates the specified element. */ + export function animate(element: HTMLElement, config: AnimationOptions): Object; + /** Returns a value indicating whether the specified element is being animated. */ + export function isAnimating(element: HTMLElement): boolean; + /** Stops the animation. */ + export function stop(element: HTMLElement, jumpToEnd: boolean): void; + } + /** The manager that performs several specified animations at a time. */ + export class TransitionExecutor { + /** Deletes all the animations registered in the Transition Executor by using the enter(elements, animation) and leave(elements, animation) methods. */ + reset(): void; + /** Registers a set of elements that should be animated as "entering" using the specified animation configuration. */ + enter(elements: JQuery, animation: any): void; + /** Registers a set of elements that should be animated as "leaving" using the specified animation configuration. */ + leave(elements: JQuery, animation: any): void; + /** Starts all the animations registered using the enter(elements, animation) and leave(elements, animation) methods beforehand. */ + start(config: Object): JQueryPromise; + /** Stops all started animations. */ + stop(): void; + } + export class AnimationPresetCollection { + /** Resets all the changes made in the animation repository. */ + resetToDefaults(): void; + /** Deletes the specified animation or clears all the animation repository, if an animation name is not passed. */ + clear(name: string): void; + /** Adds the specified animation preset to the animation repository by the specified name. */ + registerPreset(name: string, config: any): void; + /** Applies the changes made in the animation repository. */ + applyChanges(): void; + /** Returns the configuration of the animation found in the animation repository by the specified name for the current device. */ + getPreset(name: string): void; + /** Registers predefined animations in the animation repository. */ + registerDefaultPresets(): void; + } + /** A repository of animations. */ + export var animationPresets: AnimationPresetCollection; + /** The device object defines the device on which the application is running. */ + export interface Device { + /** Indicates whether or not the device platform is Android. */ + android?: boolean; + /** Specifies the type of the device on which the application is running. */ + deviceType?: string; + /** Indicates whether or not the device platform is generic, which means that the application will look and behave according to a generic "light" or "dark" theme. */ + generic?: boolean; + /** Indicates whether or not the device platform is iOS. */ + ios?: boolean; + /** Indicates whether or not the device type is 'phone'. */ + phone?: boolean; + /** Specifies the platform of the device on which the application is running. */ + platform?: string; + /** Indicates whether or not the device type is 'tablet'. */ + tablet?: boolean; + /** Specifies an array with the major and minor versions of the device platform. */ + version?: Array; + /** Indicates whether or not the device platform is Windows. */ + win?: boolean; + /** Specifies a performance grade of the current device. */ + grade?: string; + } + export class Devices implements EventsMixin { + constructor(options: { window: Window }); + /** Overrides actual device information to force the application to operate as if it was running on the specified device. */ + current(deviceName: any): void; + /** Returns information about the current device. */ + current(): Device; + orientationChanged: JQueryCallback; + /** Returns the current device orientation. */ + orientation(): string; + /** Returns real information about the current device regardless of the value passed to the devices.current(deviceName) method. */ + real(): Device; + on(eventName: "orientationChanged", eventHandler: (e: { orientation: string }) => void): Devices; + on(eventName: string, eventHandler: Function): Devices; + on(events: { [eventName: string]: Function; }): Devices; + off(eventName: "orientationChanged"): Devices; + off(eventName: string): Devices; + off(eventName: "orientationChanged", eventHandler: (e: { orientation: string }) => void): Devices; + off(eventName: string, eventHandler: Function): Devices; + } + /** An object that serves as a namespace for the methods and events specifying information on the current device. */ + export var devices: Devices; + /** The position object specifies the widget positioning options. */ + export interface PositionOptions { + /** The target element position that the widget is positioned against. */ + at?: string; + /** The element within which the widget is positioned. */ + boundary?: Element; + /** A string value holding horizontal and vertical offset from the window's boundaries. */ + boundaryOffset?: string; + /** Specifies how to move the widget if it overflows the screen. */ + collision?: any; + /** The position of the widget to align against the target element. */ + my?: string; + /** The target element that the widget is positioned against. */ + of?: HTMLElement; + /** A string value holding horizontal and vertical offset in pixels, separated by a space (e.g., "5 -10"). */ + offset?: string; + } + export interface ComponentOptions { + /** A handler for the initialized event. */ + onInitialized?: Function; + /** A handler for the optionChanged event. */ + onOptionChanged?: Function; + /** A handler for the disposing event. */ + onDisposing?: Function; + } + /** A base class for all components and widgets. */ + export class Component { + constructor(options?: ComponentOptions) + /** Prevents the component from refreshing until the endUpdate method is called. */ + beginUpdate(): void; + /** Enables the component to refresh after the beginUpdate method call. */ + endUpdate(): void; + /** Returns an instance of this component class. */ + instance(): Component; + /** Returns the configuration options of this component. */ + option(): { + [optionKey: string]: any; + }; + /** Sets one or more options of this component. */ + option(options: { + [optionKey: string]: any; + }): void; + /** Gets the value of the specified configuration option of this component. */ + option(optionName: string): any; + /** Sets a value to the specified configuration option of this component. */ + option(optionName: string, optionValue: any): void; + } + export interface DOMComponentOptions extends ComponentOptions { + /** Specifies whether or not the current component supports a right-to-left representation. */ + rtlEnabled?: boolean; + /** Specifies the height of the widget. */ + height?: any; + /** Specifies the width of the widget. */ + width?: any; + } + /** A base class for all components. */ + export class DOMComponent extends Component { + constructor(element: JQuery, options?: DOMComponentOptions); + constructor(element: HTMLElement, options?: DOMComponentOptions); + /** Returns the root HTML element of the widget. */ + element(): JQuery; + /** Specifies the device-dependent default configuration options for this component. */ + static defaultOptions(rule: { + device?: any; + options?: any; + }): void; + } + export module data { + export interface ODataError extends Error { + httpStatus?: number; + errorDetails?: any; + } + export interface StoreOptions { + /** A handler for the modified event. */ + onModified?: () => void; + /** A handler for the modifying event. */ + onModifying?: () => void; + /** A handler for the removed event. */ + onRemoved?: (key: any) => void; + /** A handler for the removing event. */ + onRemoving?: (key: any) => void; + /** A handler for the updated event. */ + onUpdated?: (key: any, values: Object) => void; + /** A handler for the updating event. */ + onUpdating?: (key: any, values: Object) => void; + /** A handler for the loaded event. */ + onLoaded?: (result: Array) => void; + /** A handler for the loading event. */ + onLoading?: (loadOptions: LoadOptions) => void; + /** A handler for the inserted event. */ + onInserted?: (values: Object, key: any) => void; + /** A handler for the inserting event. */ + onInserting?: (values: Object) => void; + /** Specifies the function called when the Store causes an error. */ + errorHandler?: (e: Error) => void; + /** Specifies the key properties within the data associated with the Store. */ + key?: any; + } + export interface LoadOptions { + filter?: Object; + sort?: Object; + select?: Object; + expand?: Object; + group?: Object; + skip?: number; + take?: number; + userData?: Object; + requireTotalCount?: boolean; + } + /** The base class for all Stores. */ + export class Store implements EventsMixin { + constructor(options?: StoreOptions); + /** Returns the data item specified by the key. */ + byKey(key: any): JQueryPromise; + /** Adds an item to the data associated with this Store. */ + insert(values: Object): JQueryPromise; + /** Returns the key expression specified via the key configuration option. */ + key(): any; + /** Returns the key of the Store item that matches the specified object. */ + keyOf(obj: Object): any; + /** Starts loading data. */ + load(obj?: LoadOptions): JQueryPromise; + /** Removes the data item specified by the key. */ + remove(key: any): JQueryPromise; + /** Obtains the total count of items that will be returned by the load() function. */ + totalCount(options?: { + filter?: Object; + group?: Object; + }): JQueryPromise; + /** Updates the data item specified by the key. */ + update(key: any, values: Object): JQueryPromise; + on(eventName: "removing", eventHandler: (key: any) => void): Store; + on(eventName: "removed", eventHandler: (key: any) => void): Store; + on(eventName: "updating", eventHandler: (key: any, values: Object) => void): Store; + on(eventName: "updated", eventHandler: (key: any, values: Object) => void): Store; + on(eventName: "inserting", eventHandler: (values: Object) => void): Store; + on(eventName: "inserted", eventHandler: (values: Object, key: any) => void): Store; + on(eventName: "modifying", eventHandler: () => void): Store; + on(eventName: "modified", eventHandler: () => void): Store; + on(eventName: "loading", eventHandler: (loadOptions: LoadOptions) => void): Store; + on(eventName: "loaded", eventHandler: (result: Array) => void): Store; + on(eventName: string, eventHandler: Function): Store; + on(events: { [eventName: string]: Function; }): Store; + off(eventName: "removing"): Store; + off(eventName: "removed"): Store; + off(eventName: "updating"): Store; + off(eventName: "updated"): Store; + off(eventName: "inserting"): Store; + off(eventName: "inserted"): Store; + off(eventName: "modifying"): Store; + off(eventName: "modified"): Store; + off(eventName: "loading"): Store; + off(eventName: "loaded"): Store; + off(eventName: string): Store; + off(eventName: "removing", eventHandler: (key: any) => void): Store; + off(eventName: "removed", eventHandler: (key: any) => void): Store; + off(eventName: "updating", eventHandler: (key: any, values: Object) => void): Store; + off(eventName: "updated", eventHandler: (key: any, values: Object) => void): Store; + off(eventName: "inserting", eventHandler: (values: Object) => void): Store; + off(eventName: "inserted", eventHandler: (values: Object, key: any) => void): Store; + off(eventName: "modifying", eventHandler: () => void): Store; + off(eventName: "modified", eventHandler: () => void): Store; + off(eventName: "loading", eventHandler: (loadOptions: LoadOptions) => void): Store; + off(eventName: "loaded", eventHandler: (result: Array) => void): Store; + off(eventName: string, eventHandler: Function): Store; + } + export interface ArrayStoreOptions extends StoreOptions { + /** Specifies the array associated with this Store. */ + data?: Array; + } + /** A Store accessing an in-memory array. */ + export class ArrayStore extends Store { + constructor(options?: ArrayStoreOptions); + /** Clears all data associated with the current ArrayStore. */ + clear(): void; + /** Creates the Query object for the underlying array. */ + createQuery(): Query; + } + interface Promise { + then(doneFn?: Function, failFn?: Function, progressFn?: Function): Promise; + } + export interface CustomStoreOptions extends StoreOptions { + /** The user implementation of the byKey(key, extraOptions) method. */ + byKey?: (key: any) => Promise; + /** The user implementation of the insert(values) method. */ + insert?: (values: Object) => Promise; + /** The user implementation of the load(options) method. */ + load?: (options?: LoadOptions) => Promise; + /** The user implementation of the remove(key) method. */ + remove?: (key: any) => Promise; + /** The user implementation of the totalCount(options) method. */ + totalCount?: (options?: { + filter?: Object; + group?: Object; + }) => Promise; + /** The user implementation of the update(key, values) method. */ + update?: (key: any, values: Object) => Promise; + } + /** A Store object that enables you to implement your own data access logic. */ + export class CustomStore extends Store { + constructor(options: CustomStoreOptions); + } + export interface DataSourceOptions { + /** Specifies data filtering conditions. */ + filter?: Object; + /** Specifies data grouping conditions. */ + group?: Object; + /** The item mapping function. */ + map?: (record: any) => any; + /** Specifies the maximum number of items the page can contain. */ + pageSize?: number; + /** Specifies whether a DataSource loads data by pages, or all items at once. */ + paginate?: boolean; + /** The data post processing function. */ + postProcess?: (data: any[]) => any[]; + /** Specifies a value by which the required items are searched. */ + searchExpr?: Object; + /** Specifies the comparison operation used to search for the required items. */ + searchOperation?: string; + /** Specifies the value to which the search expression is compared. */ + searchValue?: Object; + /** Specifies the initial select option value. */ + select?: Object; + /** An array of the strings that represent the names of the navigation properties to be loaded simultaneously with the OData store's entity. */ + expand?: Object; + /** Specifies whether or not the DataSource instance requests the total count of items available in the storage. */ + requireTotalCount?: boolean; + /** Specifies the initial sort option value. */ + sort?: Object; + /** Specifies the underlying Store instance used to access data. */ + store?: any; + /** A handler for the changed event. */ + onChanged?: () => void; + /** A handler for the loadingChanged event. */ + onLoadingChanged?: (isLoading: boolean) => void; + /** A handler for the loadError event. */ + onLoadError?: (e?: Error) => void; + } + export interface OperationPromise extends JQueryPromise { + operationId: number; + } + /** An object that provides access to a data web service or local data storage for collection container widgets. */ + export class DataSource implements EventsMixin { + constructor(url: string); + constructor(data: Array); + constructor(options: CustomStoreOptions); + constructor(options: DataSourceOptions); + /** Disposes all resources associated with this DataSource. */ + dispose(): void; + /** Returns the current filter option value. */ + filter(): Object; + /** Sets the filter option value. */ + filter(filterExpr: Object): void; + /** Returns the current group option value. */ + group(): Object; + /** Sets the group option value. */ + group(groupExpr: Object): void; + /** Indicates whether or not the current page contains fewer items than the number of items specified by the pageSize configuration option. */ + isLastPage(): boolean; + /** Indicates whether or not at least one load() method execution has successfully finished. */ + isLoaded(): boolean; + /** Indicates whether or not the DataSource is currently being loaded. */ + isLoading(): boolean; + /** Returns the array of items currently operated by the DataSource. */ + items(): Array; + /** Returns the key expression. */ + key(): any; + /** Starts loading data. */ + load(): OperationPromise>; + /** Clears currently loaded DataSource items and calls the load() method. */ + reload(): OperationPromise>; + /** Returns an object that would be passed to the load() method of the underlying Store according to the current data shaping option values of the current DataSource instance. */ + loadOptions(): Object; + /** Returns the current pageSize option value. */ + pageSize(): number; + /** Sets the pageSize option value. */ + pageSize(value: number): void; + /** Specifies the index of the currently loaded page. */ + pageIndex(): number; + /** Specifies the index of the page to be loaded during the next load() method execution. */ + pageIndex(newIndex: number): void; + /** Returns the current paginate option value. */ + paginate(): boolean; + /** Sets the paginate option value. */ + paginate(value: boolean): void; + /** Returns the searchExpr option value. */ + searchExpr(): Object; + /** Sets the searchExpr option value. */ + searchExpr(expr: Object): void; + /** Returns the currently specified search operation. */ + searchOperation(): string; + /** Sets the current search operation. */ + searchOperation(op: string): void; + /** Returns the searchValue option value. */ + searchValue(): Object; + /** Sets the searchValue option value. */ + searchValue(value: Object): void; + /** Returns the current select option value. */ + select(): Object; + /** Sets the select option value. */ + select(expr: Object): void; + /** Returns the current requireTotalCount option value. */ + requireTotalCount(): boolean; + /** Sets the requireTotalCount option value. */ + requireTotalCount(value: boolean): void; + /** Returns the current sort option value. */ + sort(): Object; + /** Sets the sort option value. */ + sort(sortExpr: Object): void; + /** Returns the underlying Store instance. */ + store(): Store; + /** Returns the number of data items available in an underlying Store after the last load() operation without paging. */ + totalCount(): number; + cancel(operationId: number): boolean; + on(eventName: "loadingChanged", eventHandler: (isLoading: boolean) => void): DataSource; + on(eventName: "loadError", eventHandler: (e?: Error) => void): DataSource; + on(eventName: "changed", eventHandler: () => void): DataSource; + on(eventName: string, eventHandler: Function): DataSource; + on(events: { [eventName: string]: Function; }): DataSource; + off(eventName: "loadingChanged"): DataSource; + off(eventName: "loadError"): DataSource; + off(eventName: "changed"): DataSource; + off(eventName: string): DataSource; + off(eventName: "loadingChanged", eventHandler: (isLoading: boolean) => void): DataSource; + off(eventName: "loadError", eventHandler: (e?: Error) => void): DataSource; + off(eventName: "changed", eventHandler: () => void): DataSource; + off(eventName: string, eventHandler: Function): DataSource; + } + /** An object used to work with primitive data types not supported by JavaScript when accessing an OData web service. */ + export class EdmLiteral { + /** Creates an EdmLiteral instance and assigns the specified value to it. */ + constructor(value: string); + /** Returns a string representation of the value associated with this EdmLiteral object. */ + valueOf(): string; + } + /** An object used to generate and hold the GUID. */ + export class Guid { + /** Creates a new Guid instance that holds the specified GUID. */ + constructor(value: string); + /** Creates a new Guid instance holding the generated GUID. */ + constructor(); + /** Returns a string representation of the Guid instance. */ + toString(): string; + /** Returns a string representation of the Guid instance. */ + valueOf(): string; + } + export interface LocalStoreOptions extends ArrayStoreOptions { + /** Specifies the time (in miliseconds) after the change operation, before the data is flushed. */ + flushInterval?: number; + /** Specifies whether the data is flushed immediatelly after each change operation, or after the delay specified via the flushInterval option. */ + immediate?: boolean; + /** The unique identifier used to distinguish the data within the HTML5 Web Storage. */ + name?: string; + } + /** A Store providing access to the HTML5 Web Storage. */ + export class LocalStore extends ArrayStore { + constructor(options?: LocalStoreOptions); + /** Removes all data associated with this Store. */ + clear(): void; + } + export interface ODataContextOptions extends ODataStoreOptions { + /** Specifies the list of entities to be accessed via the ODataContext. */ + entities?: Object; + /** Specifies the function called if the ODataContext causes an error. */ + errorHandler?: (e: Error) => void; + } + /** Provides access to the entire OData service. */ + export class ODataContext { + constructor(options?: ODataContextOptions); + /** Initiates the specified WebGet service operation that returns a value. For the information on service operations, refer to the OData documentation. */ + get(operationName: string, params: Object): JQueryPromise; + /** Initiates the specified WebGet service operation that returns nothing. For the information on service operations, refer to the OData documentation. */ + invoke(operationName: string, params: Object, httpMethod: Object): JQueryPromise; + /** Return a special proxy object to describe the entity link. */ + objectLink(entityAlias: string, key: any): Object; + } + export interface ODataStoreOptions extends StoreOptions { + /** A function used to customize a web request before it is sent. */ + beforeSend?: (request: { + url: string; + async: boolean; + method: string; + timeout: number; + params: Object; + payload: Object; + headers: Object; + }) => void; + /** Specifies whether the ODataStore uses the JSONP approach to access non-CORS-compatible remote services. */ + jsonp?: boolean; + /** Specifies the type of the ODataStore key property. The following key types are supported out of the box: String, Int32, Int64, and Guid. */ + keyType?: any; + /** Specifies whether or not dates found in the response are deserialized. */ + deserializeDates?: boolean; + /** Specifies the URL of the data service being accessed via the current ODataContext. */ + url?: string; + /** Specifies the version of the OData protocol used to interact with the data service. */ + version?: number; + /** Specifies the value of the withCredentials field of the underlying jqXHR object. */ + withCredentials?: boolean; + } + /** A Store providing access to a separate OData web service entity. */ + export class ODataStore extends Store { + constructor(options?: ODataStoreOptions); + /** Creates the Query object for the OData endpoint. */ + createQuery(loadOptions: Object): Object; + /** Returns the data item specified by the key. */ + byKey(key: any, extraOptions?: { expand?: Object }): JQueryPromise; + } + /** An universal chainable data query interface object. */ + export interface Query { + /** Calculates a custom summary for the items in the current Query. */ + aggregate(step: (accumulator: any, value: any) => any): JQueryPromise; + /** Calculates a custom summary for the items in the current Query. */ + aggregate(seed: any, step: (accumulator: any, value: any) => any, finalize: (result: any) => any): JQueryPromise; + /** Calculates the average item value for the current Query. */ + avg(getter: Object): JQueryPromise; + /** Finds the item with the maximum getter value. */ + max(getter: Object): JQueryPromise; + /** Finds the item with the maximum value in the Query. */ + max(): JQueryPromise; + /** Finds the item with the minimum value in the Query. */ + min(): JQueryPromise; + /** Finds the item with the minimum getter value. */ + min(getter: Object): JQueryPromise; + /** Calculates the average item value for the current Query, if each Query item has a numeric type. */ + avg(): JQueryPromise; + /** Returns the total count of items in the current Query. */ + count(): JQueryPromise; + /** Executes the Query. */ + enumerate(): JQueryPromise; + /** Filters the current Query data. */ + filter(criteria: Array): Query; + /** Filters the current Query data. */ + filter(predicate: (item: any) => boolean): Query; + /** Groups the current Query data. */ + groupBy(getter: Object): Query; + /** Applies the specified transformation to each item. */ + select(getter: Object): Query; + /** Limits the data item count. */ + slice(skip: number, take?: number): Query; + /** Sorts current Query data. */ + sortBy(getter: Object, desc: boolean): Query; + /** Sorts current Query data. */ + sortBy(getter: Object): Query; + /** Calculates the sum of item getter values in the current Query. */ + sum(getter: Object): JQueryPromise; + /** Calculates the sum of item values in the current Query. */ + sum(): JQueryPromise; + /** Adds one more sorting condition to the current Query. */ + thenBy(getter: Object): Query; + /** Adds one more sorting condition to the current Query. */ + thenBy(getter: Object, desc: boolean): Query; + /** Returns the array of current Query items. */ + toArray(): Array; + } + /** The global data layer error handler. */ + export var errorHandler: (e: Error) => void; + /** Encodes the specified string or array of bytes to base64 encoding. */ + export function base64_encode(input: any): string; + /** Creates a Query instance. */ + export function query(array: Array): Query; + /** Creates a Query instance for accessing the remote service specified by a URL. */ + export function query(url: string, queryOptions: Object): Query; + /** This section describes the utility objects provided by the DevExtreme data layer. */ + export var utils: { + /** Compiles a getter function from the getter expression. */ + compileGetter(expr: any): Function; + /** Compiles a setter function from the setter expression. */ + compileSetter(expr: any): Function; + odata: { + /** Holds key value converters for OData. */ + keyConverters: { + String(value: any): string; + Int32(value: any): number; + Int64(value: any): EdmLiteral; + Guid(value: any): Guid; + Boolean(value: any): boolean; + Single(value: any): EdmLiteral; + Decimal(value: any): EdmLiteral; + }; + } + } + } + /** An object that serves as a namespace for DevExtreme UI widgets as well as for methods implementing UI logic in DevExtreme sites/applications. */ + export module ui { + export interface WidgetOptions extends DOMComponentOptions { + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** A Boolean value specifying whether or not the widget can respond to user interaction. */ + disabled?: boolean; + /** A Boolean value specifying whether or not the widget changes its state when being hovered by an end user. */ + hoverStateEnabled?: boolean; + /** Specifies whether or not the widget can be focused. */ + focusStateEnabled?: boolean; + /** Specifies a shortcut key that sets focus on the widget element. */ + accessKey?: string; + /** A Boolean value specifying whether or not the widget is visible. */ + visible?: boolean; + /** Specifies the widget tab index. */ + tabIndex?: number; + /** Specifies the text of the hint displayed for the widget. */ + hint?: string; + } + /** The base class for widgets. */ + export class Widget extends DOMComponent { + constructor(options?: WidgetOptions); + /** Redraws the widget. */ + repaint(): void; + /** Sets focus on the widget. */ + focus(): void; + /** Registers a handler when a specified key is pressed. */ + registerKeyHandler(key: string, handler: Function): void; + } + export interface CollectionWidgetOptions extends WidgetOptions { + /** A data source used to fetch data to be displayed by the widget. */ + dataSource?: any; + /** The time period in milliseconds before the onItemHold event is raised. */ + itemHoldTimeout?: number; + /** An array of items displayed by the widget. */ + items?: Array; + /** The template to be used for rendering items. */ + itemTemplate?: any; + loopItemFocus?: boolean; + /** The text or HTML markup displayed by the widget if the item collection is empty. */ + noDataText?: string; + onContentReady?: any; + /** A handler for the itemClick event. */ + onItemClick?: any; + /** A handler for the itemContextMenu event. */ + onItemContextMenu?: Function; + /** A handler for the itemHold event. */ + onItemHold?: Function; + /** A handler for the itemRendered event. */ + onItemRendered?: Function; + /** A handler for the selectionChanged event. */ + onSelectionChanged?: Function; + /** The index of the currently selected widget item. */ + selectedIndex?: number; + /** The selected item object. */ + selectedItem?: Object; + /** An array of currently selected item objects. */ + selectedItems?: Array; + /** A handler for the itemDeleting event. */ + onItemDeleting?: Function; + /** A handler for the itemDeleted event. */ + onItemDeleted?: Function; + /** A handler for the itemReordered event. */ + onItemReordered?: Function; + } + /** The base class for widgets containing an item collection. */ + export class CollectionWidget extends Widget { + constructor(element: JQuery, options?: CollectionWidgetOptions); + constructor(element: HTMLElement, options?: CollectionWidgetOptions); + selectItem(itemElement: any): void; + unselectItem(itemElement: any): void; + deleteItem(itemElement: any): JQueryPromise; + isItemSelected(itemElement: any): boolean; + reorderItem(itemElement: any, toItemElement: any): JQueryPromise; + } + export interface DataExpressionMixinOptions { + /** A data source used to fetch data to be displayed by the widget. */ + dataSource?: any; + /** Specifies the name of the data source item field whose value is displayed by the widget. */ + displayExpr?: any; + /** Specifies the name of a data source item field whose value is held in the value configuration option. */ + valueExpr?: any; + /** An array of items displayed by the widget. */ + items?: Array; + /** The template to be used for rendering items. */ + itemTemplate?: any; + /** The currently selected value in the widget. */ + value?: Object; + } + export interface EditorOptions extends WidgetOptions { + /** The currently specified value. */ + value?: Object; + /** A handler for the valueChanged event. */ + onValueChanged?: Function; + /** A Boolean value specifying whether or not the widget is read-only. */ + readOnly?: boolean; + /** Holds the object that defines the error that occurred during validation. */ + validationError?: Object; + /** Specifies whether the editor's value is valid. */ + isValid?: boolean; + /** Specifies how the message about the validation rules that are not satisfied by this editor's value is displayed. */ + validationMessageMode?: string; + } + /** A base class for editors. */ + export class Editor extends Widget { + /** Resets the editor's value to undefined. */ + reset(): void; + } + /** An object that serves as a namespace for methods displaying a message in an application/site. */ + export var dialog: { + /** Creates an alert dialog message containing a single "OK" button. */ + alert(message: string, title: string): JQueryPromise; + /** Creates a confirm dialog that contains "Yes" and "No" buttons. */ + confirm(message: string, title: string): JQueryPromise; + /** Creates a custom dialog using the options specified by the passed configuration object. */ + custom(options: { title?: string; message?: string; buttons?: Array; }): { + show(): JQueryPromise; + hide(): void; + hide(value: any): void; + }; + }; + /** Creates a toast message. */ + export function notify(message: any, type: string, displayTime: number): void; + /** Creates a toast message. */ + export function notify(options: Object): void; + /** An object that serves as a namespace for the methods that work with DevExtreme CSS Themes. */ + export var themes: { + /** Returns the name of the currently applied theme. */ + current(): string; + /** Changes the current theme to the specified one. */ + current(themeName: string): void; + }; + /** Sets a specified template engine. */ + export function setTemplateEngine(name: string): void; + /** Sets a custom template engine defined via custom compile and render functions. */ + export function setTemplateEngine(options: Object): void; + } + /** An object that serves as a namespace for utility methods that can be helpful when working with the DevExtreme framework and UI widgets. */ + export var utils: { + /** Sets parameters for the viewport meta tag. */ + initMobileViewport(options: { allowZoom?: boolean; allowPan?: boolean; allowSelection?: boolean }): void; + /** Requests that the browser call a specified function to update animation before the next repaint. */ + requestAnimationFrame(callback: Function): number; + /** Cancels an animation frame request scheduled with the requestAnimationFrame method. */ + cancelAnimationFrame(requestID: number): void; + }; + /** An object that serves as a namespace for DevExtreme Data Visualization Widgets. */ + export module viz { + /** Applies a theme for the entire page with several DevExtreme visualization widgets. */ + export function currentTheme(theme: string): void; + /** Applies a new theme (with the color scheme defined separately) for the entire page with several DevExtreme visualization widgets. */ + export function currentTheme(platform: string, colorScheme: string): void; + /** Registers a new theme based on the existing one. */ + export function registerTheme(customTheme: Object, baseTheme: string): void; + /** Applies a predefined or registered custom palette to all visualization widgets at once. */ + export function currentPalette(paletteName: string): void; + /** Obtains the color sets of a predefined or registered palette. */ + export function getPalette(paletteName: string): Object; + /** Registers a new palette. */ + export function registerPalette(paletteName: string, palette: Object): void; + } +} +declare module DevExpress.ui { + export interface dxValidatorOptions extends DOMComponentOptions { + /** An array of validation rules to be checked for the editor with which the dxValidator object is associated. */ + validationRules?: Array; + /** Specifies the editor name to be used in the validation default messages. */ + name?: string; + /** An object that specifies what and when to validate and how to apply the validation result. */ + adapter?: Object; + /** Specifies the validation group the editor will be related to. */ + validationGroup?: string; + /** A handler for the validated event. */ + onValidated?: (params: validationEngine.ValidatorValidationResult) => void; + } + /** A widget that is used to validate the associated DevExtreme editors against the defined validation rules. */ + export class dxValidator extends DOMComponent implements validationEngine.IValidator { + constructor(element: JQuery, options?: dxValidatorOptions); + constructor(element: Element, options?: dxValidatorOptions); + /** Validates the value of the editor that is controlled by the current dxValidator object against the list of the specified validation rules. */ + validate(): validationEngine.ValidatorValidationResult; + /** Resets the value and validation result of the editor associated with the current dxValidator object. */ + reset(): void; + } + /** The widget that is used in the Knockout and Angular approaches to combine the editors to be validated. */ + export class dxValidationGroup extends DOMComponent { + constructor(element: JQuery); + constructor(element: Element); + /** Validates rules of the validators that belong to the current validation group. */ + validate(): validationEngine.ValidationGroupValidationResult; + /** Resets the value and validation result of the editors that are included to the current validation group. */ + reset(): void; + } + export interface dxValidationSummaryOptions extends CollectionWidgetOptions { + /** Specifies the validation group for which summary should be generated. */ + validationGroup?: string; + } + /** A widget for displaying the result of checking validation rules for editors. */ + export class dxValidationSummary extends CollectionWidget { + constructor(element: JQuery, options?: dxValidationSummaryOptions); + constructor(element: Element, options?: dxValidationSummaryOptions); + } + export interface dxResizableOptions extends DOMComponentOptions { + /** Specifies which borders of the widget element are used as a handle. */ + handles?: string; + /** Specifies the lower width boundary for resizing. */ + minWidth?: number; + /** Specifies the upper width boundary for resizing. */ + maxWidth?: number; + /** Specifies the lower height boundary for resizing. */ + minHeight?: number; + /** Specifies the upper height boundary for resizing. */ + maxHeight?: number; + /** A handler for the resizeStart event. */ + onResizeStart?: Function; + /** A handler for the resize event. */ + onResize?: Function; + /** A handler for the resizeEnd event. */ + onResizeEnd?: Function; + } + /** A widget that displays required content in a resizable element. */ + export class dxResizable extends DOMComponent { + constructor(element: JQuery, options?: dxResizableOptions); + constructor(element: Element, options?: dxResizableOptions); + } + export interface dxTooltipOptions extends dxPopoverOptions { + } + /** A tooltip widget. */ + export class dxTooltip extends dxPopover { + constructor(element: JQuery, options?: dxTooltipOptions); + constructor(element: Element, options?: dxTooltipOptions); + } + export interface dxDropDownListOptions extends dxDropDownEditorOptions, DataExpressionMixinOptions { + /** Returns the value currently displayed by the widget. */ + displayValue?: string; + /** The minimum number of characters that must be entered into the text box to begin a search. */ + minSearchLength?: number; + /** Specifies whether or not the widget displays unfiltered values until a user types a number of characters exceeding the minSearchLength option value. */ + showDataBeforeSearch?: boolean; + /** Specifies the name of a data source item field or an expression whose value is compared to the search criterion. */ + searchExpr?: Object; + /** Specifies the binary operation used to filter data. */ + searchMode?: string; + /** Specifies the time delay, in milliseconds, after the last character has been typed in, before a search is executed. */ + searchTimeout?: number; + /** A handler for the valueChanged event. */ + onValueChanged?: Function; + /** Specifies DOM event names that update a widget's value. */ + valueChangeEvent?: string; + /** Specifies whether or not the widget supports searching. */ + searchEnabled?: boolean; + /** + * Specifies whether or not the widget displays items by pages. + * @deprecated dataSource.paginate.md + */ + pagingEnabled?: boolean; + /** The text or HTML markup displayed by the widget if the item collection is empty. */ + noDataText?: string; + /** A handler for the selectionChanged event. */ + onSelectionChanged?: Function; + /** A handler for the itemClick event. */ + onItemClick?: Function; + onContentReady?: Function; + } + /** A base class for drop-down list widgets. */ + export class dxDropDownList extends dxDropDownEditor { + constructor(element: JQuery, options?: dxDropDownListOptions); + constructor(element: Element, options?: dxDropDownListOptions); + } + export interface dxToolbarOptions extends CollectionWidgetOptions { + /** The template used to render menu items. */ + menuItemTemplate?: any; + /** Informs the widget about its location in a view HTML markup. */ + renderAs?: string; + } + /** A toolbar widget. */ + export class dxToolbar extends CollectionWidget { + constructor(element: JQuery, options?: dxToolbarOptions); + constructor(element: Element, options?: dxToolbarOptions); + } + export interface dxToastOptions extends dxOverlayOptions { + animation?: fx.AnimationOptions; + /** The time span in milliseconds during which the dxToast widget is visible. */ + displayTime?: number; + height?: any; + /** The dxToast message text. */ + message?: string; + position?: PositionOptions; + shading?: boolean; + /** Specifies the dxToast widget type. */ + type?: string; + width?: any; + closeOnBackButton?: boolean; + /** A Boolean value specifying whether or not the toast is closed if a user swipes it out of the screen boundaries. */ + closeOnSwipe?: boolean; + /** A Boolean value specifying whether or not the toast is closed if a user clicks it. */ + closeOnClick?: boolean; + } + /** The toast message widget. */ + export class dxToast extends dxOverlay { + constructor(element: JQuery, options?: dxToastOptions); + constructor(element: Element, options?: dxToastOptions); + } + export interface dxTextEditorOptions extends EditorOptions { + /** A handler for the change event. */ + onChange?: Function; + /** A handler for the copy event. */ + onCopy?: Function; + /** A handler for the cut event. */ + onCut?: Function; + /** A handler for the enterKey event. */ + onEnterKey?: Function; + /** A handler for the focusIn event. */ + onFocusIn?: Function; + /** A handler for the focusOut event. */ + onFocusOut?: Function; + /** A handler for the input event. */ + onInput?: Function; + /** A handler for the keyDown event. */ + onKeyDown?: Function; + /** A handler for the keyPress event. */ + onKeyPress?: Function; + /** A handler for the keyUp event. */ + onKeyUp?: Function; + /** A handler for the paste event. */ + onPaste?: Function; + /** The text displayed by the widget when the widget value is empty. */ + placeholder?: string; + /** Specifies whether to display the Clear button in the widget. */ + showClearButton?: boolean; + /** Specifies the current value displayed by the widget. */ + value?: any; + /** Specifies DOM event names that update a widget's value. */ + valueChangeEvent?: string; + /** Specifies whether or not the widget checks the inner text for spelling mistakes. */ + spellcheck?: boolean; + /** Specifies HTML attributes applied to the inner input element of the widget. */ + attr?: Object; + /** The read-only option that holds the text displayed by the widget input element. */ + text?: string; + focusStateEnabled?: boolean; + hoverStateEnabled?: boolean; + /** The editor mask that specifies the format of the entered string. */ + mask?: string; + /** Specifies a mask placeholder character. */ + maskChar?: string; + /** Specifies custom mask rules. */ + maskRules?: Object; + /** A message displayed when the entered text does not match the specified pattern. */ + maskInvalidMessage?: string; + /** Specifies whether the value option holds only characters entered by a user or prompt characters as well. */ + useMaskedValue?: boolean; + } + /** A base class for text editing widgets. */ + export class dxTextEditor extends Editor { + constructor(element: JQuery, options?: dxTextEditorOptions); + constructor(element: Element, options?: dxTextEditorOptions); + /** Removes focus from the input element. */ + blur(): void; + /** Sets focus to the input element representing the widget. */ + focus(): void; + } + export interface dxTextBoxOptions extends dxTextEditorOptions { + /** Specifies the maximum number of characters you can enter into the textbox. */ + maxLength?: any; + /** The "mode" attribute value of the actual HTML input element representing the text box. */ + mode?: string; + } + /** A single-line text box widget. */ + export class dxTextBox extends dxTextEditor { + constructor(element: JQuery, options?: dxTextBoxOptions); + constructor(element: Element, options?: dxTextBoxOptions); + } + export interface dxTextAreaOptions extends dxTextBoxOptions { + /** Specifies whether or not the widget checks the inner text for spelling mistakes. */ + spellcheck?: boolean; + } + /** A widget used to display and edit multi-line text. */ + export class dxTextArea extends dxTextBox { + constructor(element: JQuery, options?: dxTextAreaOptions); + constructor(element: Element, options?: dxTextAreaOptions); + } + export interface dxTabsOptions extends CollectionWidgetOptions { + /** Specifies whether the widget enables an end-user to select only a single item or multiple items. */ + selectionMode?: string; + /** Specifies whether or not an end-user can scroll tabs by swiping. */ + scrollByContent?: boolean; + /** Specifies whether or not an end-user can scroll tabs. */ + scrollingEnabled?: boolean; + /** A Boolean value that specifies the availability of navigation buttons. */ + showNavButtons?: boolean; + } + /** A tab strip used to switch between pages. */ + export class dxTabs extends CollectionWidget { + constructor(element: JQuery, options?: dxTabsOptions); + constructor(element: Element, options?: dxTabsOptions); + } + export interface dxTabPanelOptions extends dxMultiViewOptions { + /** A handler for the titleClick event. */ + onTitleClick?: any; + /** A handler for the titleHold event. */ + onTitleHold?: Function; + /** A handler for the titleRendered event. */ + onTitleRendered?: Function; + /** The template to be used for rendering an item title. */ + itemTitleTemplate?: any; + /** A Boolean value specifying if the list is scrolled by content. */ + scrollByContent?: boolean; + /** A Boolean value specifying whether to enable or disable scrolling. */ + scrollingEnabled?: boolean; + /** A Boolean value that specifies the availability of navigation buttons. */ + showNavButtons?: boolean; + } + /** A widget used to display a view and to switch between several views by clicking the appropriate tabs. */ + export class dxTabPanel extends dxMultiView { + constructor(element: JQuery, options?: dxTabPanelOptions); + constructor(element: Element, options?: dxTabPanelOptions); + } + export interface dxSelectBoxOptions extends dxDropDownListOptions { + /** Specifies DOM event names that update a widget's value. */ + valueChangeEvent?: string; + /** The template to be used for rendering the widget text field. */ + fieldTemplate?: any; + /** The text that is provided as a hint in the select box editor. */ + placeholder?: string; + /** Specifies whether or not the widget allows an end-user to enter a custom value. */ + fieldEditEnabled?: boolean; + } + /** A widget that allows you to select an item in a dropdown list. */ + export class dxSelectBox extends dxDropDownList { + constructor(element: JQuery, options?: dxSelectBoxOptions); + constructor(element: Element, options?: dxSelectBoxOptions); + } + export interface dxTagBoxOptions extends dxSelectBoxOptions { + /** Holds the list of selected values. */ + values?: Array; + /** A read-only option that holds the last selected value. */ + value?: Object; + } + /** A widget that allows you to select multiple items from a dropdown list. */ + export class dxTagBox extends dxSelectBox { + constructor(element: JQuery, options?: dxTagBoxOptions); + constructor(element: Element, options?: dxTagBoxOptions); + } + export interface dxScrollViewOptions extends dxScrollableOptions { + /** A handler for the pullDown event. */ + onPullDown?: Function; + /** Specifies the text shown in the pullDown panel when pulling the content down lowers the refresh threshold. */ + pulledDownText?: string; + /** Specifies the text shown in the pullDown panel while pulling the content down to the refresh threshold. */ + pullingDownText?: string; + /** A handler for the reachBottom event. */ + onReachBottom?: Function; + /** Specifies the text shown in the pullDown panel displayed when content is scrolled to the bottom. */ + reachBottomText?: string; + /** Specifies the text shown in the pullDown panel displayed when the content is being refreshed. */ + refreshingText?: string; + /** Returns a value indicating if the scrollView content is larger then the widget container. */ + isFull(): boolean; + /** Locks the widget until the release(preventScrollBottom) method is called and executes the function passed to the onPullDown option and the handler assigned to the pullDown event. */ + refresh(): void; + /** Notifies the scroll view that data loading is finished. */ + release(preventScrollBottom: boolean): JQueryPromise; + /** Toggles the loading state of the widget. */ + toggleLoading(showOrHide: boolean): void; + } + /** A widget used to display scrollable content. */ + export class dxScrollView extends dxScrollable { + constructor(element: JQuery, options?: dxScrollViewOptions); + constructor(element: Element, options?: dxScrollViewOptions); + } + export interface dxScrollableLocation { + top?: number; + left?: number; + } + export interface dxScrollableOptions extends DOMComponentOptions { + /** A string value specifying the available scrolling directions. */ + direction?: string; + /** A Boolean value specifying whether or not the widget can respond to user interaction. */ + disabled?: boolean; + /** A handler for the scroll event. */ + onScroll?: Function; + /** Specifies when the widget shows the scrollbar. */ + showScrollbar?: string; + /** A handler for the update event. */ + onUpdated?: Function; + /** Indicates whether to use native or simulated scrolling. */ + useNative?: boolean; + /** A Boolean value specifying whether to enable or disable the bounce-back effect. */ + bounceEnabled?: boolean; + /** A Boolean value specifying whether or not an end-user can scroll the widget content swiping it up or down. */ + scrollByContent?: boolean; + /** A Boolean value specifying whether or not an end-user can scroll the widget content using the scrollbar. */ + scrollByThumb?: boolean; + } + /** A widget used to display scrollable content. */ + export class dxScrollable extends DOMComponent { + constructor(element: JQuery, options?: dxScrollableOptions); + constructor(element: Element, options?: dxScrollableOptions); + /** Returns the height of the scrollable widget in pixels. */ + clientHeight(): number; + /** Returns the width of the scrollable widget in pixels. */ + clientWidth(): number; + /** Returns an HTML element of the widget. */ + content(): JQuery; + /** Scrolls the widget content by the specified number of pixels. */ + scrollBy(distance: number): void; + /** Scrolls widget content by the specified number of pixels in horizontal and vertical directions. */ + scrollBy(distanceObject: dxScrollableLocation): void; + /** Returns the height of the scrollable content in pixels. */ + scrollHeight(): number; + /** Returns the current scroll position against the leftmost position. */ + scrollLeft(): number; + /** Returns how far the scrollable content is scrolled from the top and from the left. */ + scrollOffset(): dxScrollableLocation; + /** Scrolls widget content to the specified position. */ + scrollTo(targetLocation: number): void; + /** Scrolls widget content to a specified position. */ + scrollTo(targetLocation: dxScrollableLocation): void; + /** Scrolls widget content to the specified element. */ + scrollToElement(element: Element): void; + /** Returns the current scroll position against the topmost position. */ + scrollTop(): number; + /** Returns the width of the scrollable content in pixels. */ + scrollWidth(): number; + /** Updates the dimensions of the scrollable contents. */ + update(): void; + } + export interface dxRadioGroupOptions extends EditorOptions, DataExpressionMixinOptions { + activeStateEnabled?: boolean; + /** Specifies the radio group layout. */ + layout?: string; + } + /** A widget that enables a user to select one item within a list of items represented by radio buttons. */ + export class dxRadioGroup extends CollectionWidget { + constructor(element: JQuery, options?: dxRadioGroupOptions); + constructor(element: Element, options?: dxRadioGroupOptions); + } + export interface dxPopupOptions extends dxOverlayOptions { + animation?: fx.AnimationOptions; + /** Specifies whether or not to allow a user to drag the popup window. */ + dragEnabled?: boolean; + /** A Boolean value specifying whether or not to display the widget in full-screen mode. */ + fullScreen?: boolean; + position?: PositionOptions; + /** A Boolean value specifying whether or not to display the title in the popup window. */ + showTitle?: boolean; + /** The title in the overlay window. */ + title?: string; + /** A template to be used for rendering the widget title. */ + titleTemplate?: any; + width?: any; + /** Specifies items displayed on the top or bottom toolbar of the popup window. */ + buttons?: Array; + /** Specifies whether or not the widget displays the Close button. */ + showCloseButton?: boolean; + /** A handler for the titleRendered event. */ + onTitleRendered?: Function; + } + /** A widget that displays required content in a popup window. */ + export class dxPopup extends dxOverlay { + constructor(element: JQuery, options?: dxPopupOptions); + constructor(element: Element, options?: dxPopupOptions); + } + export interface dxPopoverOptions extends dxPopupOptions { + /** An object defining animation options of the widget. */ + animation?: fx.AnimationOptions; + /** Specifies the height of the widget. */ + height?: any; + /** An object defining widget positioning options. */ + position?: PositionOptions; + shading?: boolean; + /** A Boolean value specifying whether or not to display the title in the overlay window. */ + showTitle?: boolean; + /** The target element associated with a popover. */ + target?: any; + /** Specifies the width of the widget. */ + width?: any; + } + /** A widget that displays the required content in a popup window. */ + export class dxPopover extends dxPopup { + constructor(element: JQuery, options?: dxPopoverOptions); + constructor(element: Element, options?: dxPopoverOptions); + /** Displays the widget for the specified target element. */ + show(target?: any): JQueryPromise; + } + export interface dxOverlayOptions extends WidgetOptions { + /** An object that defines the animation options of the widget. */ + animation?: fx.AnimationOptions; + /** A Boolean value specifying whether or not the widget is closed if a user presses the Back hardware button. */ + closeOnBackButton?: boolean; + /** A Boolean value specifying whether or not the widget is closed if a user clicks outside of the overlapping window. */ + closeOnOutsideClick?: any; + /** A template to be used for rendering widget content. */ + contentTemplate?: any; + /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ + deferRendering?: boolean; + /** Specifies whether or not an end-user can drag the widget. */ + dragEnabled?: boolean; + /** Specifies whether or not an end user can resize the widget. */ + resizeEnabled?: boolean; + /** The height of the widget in pixels. */ + height?: any; + /** Specifies the maximum height the widget can reach while resizing. */ + maxHeight?: any; + /** Specifies the maximum width the widget can reach while resizing. */ + maxWidth?: any; + /** Specifies the minimum height the widget can reach while resizing. */ + minHeight?: any; + /** Specifies the minimum width the widget can reach while resizing. */ + minWidth?: any; + /** A handler for the hidden event. */ + onHidden?: Function; + /** A handler for the resizeStart event. */ + onResizeStart?: Function; + /** A handler for the resize event. */ + onResize?: Function; + /** A handler for the resizeEnd event. */ + onResizeEnd?: Function; + /** A handler for the hiding event. */ + onHiding?: Function; + /** An object defining widget positioning options. */ + position?: PositionOptions; + /** A Boolean value specifying whether or not the main screen is inactive while the widget is active. */ + shading?: boolean; + /** Specifies the shading color. */ + shadingColor?: string; + /** A handler for the showing event. */ + onShowing?: Function; + /** A handler for the shown event. */ + onShown?: Function; + onContentReady?: Function; + /** A Boolean value specifying whether or not the widget is visible. */ + visible?: boolean; + /** The widget width in pixels. */ + width?: any; + } + /** A widget displaying the required content in an overlay window. */ + export class dxOverlay extends Widget { + constructor(element: JQuery, options?: dxOverlayOptions); + constructor(element: Element, options?: dxOverlayOptions); + /** An HTML element of the widget. */ + content(): JQuery; + /** Hides the widget. */ + hide(): JQueryPromise; + /** Recalculates the overlay's size and position. */ + repaint(): void; + /** Shows the widget. */ + show(): JQueryPromise; + /** Toggles the visibility of the widget. */ + toggle(showing: boolean): JQueryPromise; + /** A static method that specifies the base z-index for all overlay widgets. */ + static baseZIndex(zIndex: number): void; + } + export interface dxNumberBoxOptions extends dxTextEditorOptions { + /** The maximum value accepted by the number box. */ + max?: number; + /** The minimum value accepted by the number box. */ + min?: number; + /** Specifies whether or not to show spin buttons. */ + showSpinButtons?: boolean; + useTouchSpinButtons?: boolean; + /** Specifies by which value the widget value changes when a spin button is clicked. */ + step?: number; + /** The current number box value. */ + value?: number; + /** The "mode" attribute value of the actual HTML input element representing the widget. */ + mode?: string; + } + /** A textbox widget that enables a user to enter numeric values. */ + export class dxNumberBox extends dxTextEditor { + constructor(element: JQuery, options?: dxNumberBoxOptions); + constructor(element: Element, options?: dxNumberBoxOptions); + } + export interface dxNavBarOptions extends dxTabsOptions { + scrollingEnabled?: boolean; + } + /** A widget that contains items used to navigate through application views. */ + export class dxNavBar extends dxTabs { + constructor(element: JQuery, options?: dxNavBarOptions); + constructor(element: Element, options?: dxNavBarOptions); + } + export interface dxMultiViewOptions extends CollectionWidgetOptions { + /** Specifies whether or not to animate the displayed item change. */ + animationEnabled?: boolean; + /** A Boolean value specifying whether or not to scroll back to the first item after the last item is swiped. */ + loop?: boolean; + /** The index of the currently displayed item. */ + selectedIndex?: number; + /** A Boolean value specifying whether or not to allow users to change the selected index by swiping. */ + swipeEnabled?: boolean; + /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ + deferRendering?: boolean; + } + /** A widget used to display a view and to switch between several views. */ + export class dxMultiView extends CollectionWidget { + constructor(element: JQuery, options?: dxMultiViewOptions); + constructor(element: Element, options?: dxMultiViewOptions); + } + export interface dxMapOptions extends WidgetOptions { + /** Specifies whether or not the widget automatically adjusts center and zoom option values when adding a new marker or route, or when creating a widget if it initially contains markers or routes. */ + autoAdjust?: boolean; + center?: { + /** The latitude location displayed in the center of the widget. */ + lat?: number; + /** The longitude location displayed in the center of the widget. */ + lng?: number; + }; + /** A handler for the click event. */ + onClick?: any; + /** Specifies whether or not map widget controls are available. */ + controls?: boolean; + /** Specifies the height of the widget. */ + height?: any; + /** A key used to authenticate the application within the required map provider. */ + key?: { + /** A key used to authenticate the application within the "Bing" map provider. */ + bing?: string; + /** A key used to authenticate the application within the "Google" map provider. */ + google?: string; + /** A key used to authenticate the application within the "Google Static" map provider. */ + googleStatic?: string; + } + /** A handler for the markerAdded event. */ + onMarkerAdded?: Function; + /** A URL pointing to the custom icon to be used for map markers. */ + markerIconSrc?: string; + /** A handler for the markerRemoved event. */ + onMarkerRemoved?: Function; + /** An array of markers displayed on a map. */ + markers?: Array; + /** The name of the current map data provider. */ + provider?: string; + /** A handler for the ready event. */ + onReady?: Function; + /** A handler for the routeAdded event. */ + onRouteAdded?: Function; + /** A handler for the routeRemoved event. */ + onRouteRemoved?: Function; + /** An array of routes shown on the map. */ + routes?: Array; + /** The type of a map to display. */ + type?: string; + /** Specifies the width of the widget. */ + width?: any; + /** The zoom level of the map. */ + zoom?: number; + } + /** An interactive map widget. */ + export class dxMap extends Widget { + constructor(element: JQuery, options?: dxMapOptions); + constructor(element: Element, options?: dxMapOptions); + /** Adds a marker to the map. */ + addMarker(markerOptions: Object): JQueryPromise; + /** Adds a route to the map. */ + addRoute(routeOptions: Object): JQueryPromise; + /** Removes a marker from the map. */ + removeMarker(marker: Object): JQueryPromise; + /** Removes a route from the map. */ + removeRoute(route: any): JQueryPromise; + } + export interface dxLookupOptions extends dxDropDownListOptions { + /** An object defining widget animation options. */ + animation?: fx.AnimationOptions; + /** The text displayed on the Cancel button. */ + cancelButtonText?: string; + /** The text displayed on the Clear button. */ + clearButtonText?: string; + /** Specifies whether or not the widget cleans the search box when the popup window is displayed. */ + cleanSearchOnOpening?: boolean; + /** A Boolean value specifying whether or not a widget is closed if a user clicks outside of the overlaying window. */ + closeOnOutsideClick?: any; + /** The text displayed on the Apply button. */ + applyButtonText?: string; + /** A Boolean value specifying whether or not to display the lookup in full-screen mode. */ + fullScreen?: boolean; + focusStateEnabled?: boolean; + /** A Boolean value specifying whether or not to group widget items. */ + grouped?: boolean; + /** The name of the template used to display a group header. */ + groupTemplate?: any; + /** The text displayed on the button used to load the next page from the data source. */ + nextButtonText?: string; + /** A handler for the pageLoading event. */ + onPageLoading?: Function; + /** Specifies whether the next page is loaded when a user scrolls the widget to the bottom or when the "next" button is clicked. */ + pageLoadMode?: string; + /** Specifies the text shown in the pullDown panel, which is displayed when the widget is scrolled to the bottom. */ + pageLoadingText?: string; + /** The text displayed by the widget when nothing is selected. */ + placeholder?: string; + /** The height of the widget popup element. */ + popupHeight?: any; + /** The width of the widget popup element. */ + popupWidth?: any; + /** An object defining widget positioning options. */ + position?: PositionOptions; + /** Specifies the text displayed in the pullDown panel when the widget is pulled below the refresh threshold. */ + pulledDownText?: string; + /** Specifies the text shown in the pullDown panel while the list is being pulled down to the refresh threshold. */ + pullingDownText?: string; + /** A handler for the pullRefresh event. */ + onPullRefresh?: Function; + /** A Boolean value specifying whether or not the widget supports the "pull down to refresh" gesture. */ + pullRefreshEnabled?: boolean; + /** Specifies the text displayed in the pullDown panel while the widget is being refreshed. */ + refreshingText?: string; + /** A handler for the scroll event. */ + onScroll?: Function; + /** A Boolean value specifying whether or not the search bar is visible. */ + searchEnabled?: boolean; + /** The text that is provided as a hint in the lookup's search bar. */ + searchPlaceholder?: string; + /** A Boolean value specifying whether or not the main screen is inactive while the lookup is active. */ + shading?: boolean; + /** Specifies whether to display the Cancel button in the lookup window. */ + showCancelButton?: boolean; + /** + * A Boolean value specifying whether the widget loads the next page automatically when you reach the bottom of the list or when a button is clicked. + * @deprecated pageLoadMode.md + */ + showNextButton?: boolean; + /** The title of the lookup window. */ + title?: string; + /** A template to be used for rendering the widget title. */ + titleTemplate?: any; + /** Specifies whether or not the widget uses native scrolling. */ + useNativeScrolling?: boolean; + /** Specifies whether or not to show lookup contents in a dxPopover widget. */ + usePopover?: boolean; + /** A handler for the valueChanged event. */ + onValueChanged?: Function; + /** A handler for the titleRendered event. */ + onTitleRendered?: Function; + /** A Boolean value specifying whether or not to display the title in the popup window. */ + showPopupTitle?: boolean; + /** The template to be used for rendering the widget text field. */ + fieldTemplate?: any; + } + /** A widget that allows a user to select predefined values from a lookup window. */ + export class dxLookup extends dxDropDownList { + constructor(element: JQuery, options?: dxLookupOptions); + constructor(element: Element, options?: dxLookupOptions); + /** This section lists the data source fields that are used in a default template for lookup drop-down items. */ + } + export interface dxLoadPanelOptions extends dxOverlayOptions { + /** An object defining the animation options of the widget. */ + animation?: fx.AnimationOptions; + /** The delay in milliseconds after which the load panel is displayed. */ + delay?: number; + /** The height of the widget. */ + height?: number; + /** A URL pointing to an image to be used as a load indicator. */ + indicatorSrc?: string; + /** The text displayed in the load panel. */ + message?: string; + /** A Boolean value specifying whether or not to show a load indicator. */ + showIndicator?: boolean; + /** A Boolean value specifying whether or not to show the pane behind the load indicator. */ + showPane?: boolean; + /** The width of the widget. */ + width?: number; + } + /** A widget used to indicate whether or not an element is loading. */ + export class dxLoadPanel extends dxOverlay { + constructor(element: JQuery, options?: dxLoadPanelOptions); + constructor(element: Element, options?: dxLoadPanelOptions); + } + export interface dxLoadIndicatorOptions extends WidgetOptions { + /** Specifies the path to an image used as the indicator. */ + indicatorSrc?: string; + } + /** The widget used to indicate the loading process. */ + export class dxLoadIndicator extends Widget { + constructor(element: JQuery, options?: dxLoadIndicatorOptions); + constructor(element: Element, options?: dxLoadIndicatorOptions); + } + export interface dxListOptions extends CollectionWidgetOptions { + /** A Boolean value specifying whether or not to display a grouped list. */ + grouped?: boolean; + /** The template to be used for rendering item groups. */ + groupTemplate?: any; + onItemDeleting?: Function; + /** A handler for the itemDeleted event. */ + onItemDeleted?: Function; + /** A handler for the groupRendered event. */ + onGroupRendered?: Function; + /** A handler for the itemReordered event. */ + onItemReordered?: Function; + /** A handler for the itemClick event. */ + onItemClick?: any; + /** A handler for the itemSwipe event. */ + onItemSwipe?: Function; + /** The text displayed on the button used to load the next page from the data source. */ + nextButtonText?: string; + /** A handler for the pageLoading event. */ + onPageLoading?: Function; + /** Specifies the text shown in the pullDown panel, which is displayed when the list is scrolled to the bottom. */ + pageLoadingText?: string; + /** Specifies the text displayed in the pullDown panel when the list is pulled below the refresh threshold. */ + pulledDownText?: string; + /** Specifies the text shown in the pullDown panel while the list is being pulled down to the refresh threshold. */ + pullingDownText?: string; + /** A handler for the pullRefresh event. */ + onPullRefresh?: Function; + /** A Boolean value specifying whether or not the widget supports the "pull down to refresh" gesture. */ + pullRefreshEnabled?: boolean; + /** Specifies the text displayed in the pullDown panel while the list is being refreshed. */ + refreshingText?: string; + /** A handler for the scroll event. */ + onScroll?: Function; + /** A Boolean value specifying whether to enable or disable list scrolling. */ + scrollingEnabled?: boolean; + /** Specifies when the widget shows the scrollbar. */ + showScrollbar?: string; + /** Specifies whether or not the widget uses native scrolling. */ + useNativeScrolling?: boolean; + /** A Boolean value specifying whether to enable or disable the bounce-back effect. */ + bounceEnabled?: boolean; + /** A Boolean value specifying if the list is scrolled by content. */ + scrollByContent?: boolean; + /** A Boolean value specifying if the list is scrolled using the scrollbar. */ + scrollByThumb?: boolean; + onItemContextMenu?: Function; + onItemHold?: Function; + /** Specifies whether or not an end-user can collapse groups. */ + collapsibleGroups?: boolean; + /** Specifies whether the next page is loaded when a user scrolls the widget to the bottom or when the "next" button is clicked. */ + pageLoadMode?: string; + /** Specifies whether or not to display controls used to select list items. */ + showSelectionControls?: boolean; + /** Specifies item selection mode. */ + selectionMode?: string; + selectAllText?: string; + onSelectAllChanged?: Function; + /** Specifies the array of items for a context menu called for a list item. */ + menuItems?: Array; + /** Specifies whether an item context menu is shown when a user holds or swipes an item. */ + menuMode?: string; + /** Specifies whether or not an end user can delete list items. */ + allowItemDeleting?: boolean; + /** Specifies the way a user can delete items from the list. */ + itemDeleteMode?: string; + /** Specifies whether or not an end user can reorder list items. */ + allowItemReordering?: boolean; + /** Specifies whether or not to show the loading panel when the DataSource bound to the widget is loading data. */ + indicateLoading?: boolean; + activeStateEnabled?: boolean; + } + /** A list widget. */ + export class dxList extends CollectionWidget { + constructor(element: JQuery, options?: dxListOptions); + constructor(element: Element, options?: dxListOptions); + /** Returns the height of the widget in pixels. */ + clientHeight(): number; + /** Removes the specified item from the list. */ + deleteItem(itemIndex: any): JQueryPromise; + /** Removes the specified item from the list. */ + deleteItem(itemElement: Element): JQueryPromise; + /** Returns a Boolean value that indicates whether or not the specified item is selected. */ + isItemSelected(itemIndex: any): boolean; + /** Returns a Boolean value that indicates whether or not the specified item is selected. */ + isItemSelected(itemElement: Element): boolean; + /** Reloads list data. */ + reload(): void; + /** Moves the specified item to the specified position in the list. */ + reorderItem(itemElement: Element, toItemElement: Element): JQueryPromise; + /** Moves the specified item to the specified position in the list. */ + reorderItem(itemIndex: any, toItemIndex: any): JQueryPromise; + /** Scrolls the list content by the specified number of pixels. */ + scrollBy(distance: number): void; + /** Returns the height of the list content in pixels. */ + scrollHeight(): number; + /** Scrolls list content to the specified position. */ + scrollTo(location: number): void; + /** Scrolls the list to the specified item. */ + scrollToItem(itemElement: Element): void; + /** Scrolls the list to the specified item. */ + scrollToItem(itemIndex: any): void; + /** Returns how far the list content is scrolled from the top. */ + scrollTop(): number; + /** Selects the specified item from the list. */ + selectItem(itemElement: Element): void; + /** Selects the specified item from the list. */ + selectItem(itemIndex: any): void; + /** Deselects the specified item from the list. */ + unselectItem(itemElement: Element): void; + /** Unselects the specified item from the list. */ + unselectItem(itemIndex: any): void; + /** Updates the widget scrollbar according to widget content size. */ + updateDimensions(): JQueryPromise; + /** Expands the specified group. */ + expandGroup(groupIndex: number): JQueryPromise; + /** Collapses the specified group. */ + collapseGroup(groupIndex: number): JQueryPromise; + } + export interface dxGalleryOptions extends CollectionWidgetOptions { + /** The time, in milliseconds, spent on slide animation. */ + animationDuration?: number; + /** Specifies whether or not to animate the displayed item change. */ + animationEnabled?: boolean; + /** A Boolean value specifying whether or not to allow users to switch between items by clicking an indicator. */ + indicatorEnabled?: boolean; + /** A Boolean value specifying whether or not to scroll back to the first item after the last item is swiped. */ + loop?: boolean; + /** The index of the currently active gallery item. */ + selectedIndex?: number; + /** A Boolean value specifying whether or not to display an indicator that points to the selected gallery item. */ + showIndicator?: boolean; + /** A Boolean value that specifies the availability of the "Forward" and "Back" navigation buttons. */ + showNavButtons?: boolean; + /** The time interval in milliseconds, after which the gallery switches to the next item. */ + slideshowDelay?: number; + /** A Boolean value specifying whether or not to allow users to switch between items by swiping. */ + swipeEnabled?: boolean; + /** Specifies whether or not to display parts of previous and next images along the sides of the current image. */ + wrapAround?: boolean; + /** Specifies if the widget stretches images to fit the total gallery width. */ + stretchImages?: boolean; + /** Specifies the width of an area used to display a single image. */ + initialItemWidth?: number; + } + /** An image gallery widget. */ + export class dxGallery extends CollectionWidget { + constructor(element: JQuery, options?: dxGalleryOptions); + constructor(element: Element, options?: dxGalleryOptions); + /** Shows the specified gallery item. */ + goToItem(itemIndex: number, animation: boolean): JQueryPromise; + /** Shows the next gallery item. */ + nextItem(animation: boolean): JQueryPromise; + /** Shows the previous gallery item. */ + prevItem(animation: boolean): JQueryPromise; + } + export interface dxDropDownEditorOptions extends dxTextBoxOptions { + /** Specifies the current value displayed by the widget. */ + value?: Object; + /** A handler for the closed event. */ + onClosed?: Function; + /** A handler for the opened event. */ + onOpened?: Function; + /** Specifies whether or not the drop-down editor is displayed. */ + opened?: boolean; + /** Specifies whether or not the widget allows an end-user to enter a custom value. */ + fieldEditEnabled?: boolean; + /** Specifies the way an end-user applies the selected value. */ + applyValueMode?: string; + /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ + deferRendering?: boolean; + activeStateEnabled?: boolean; + } + /** A drop-down editor widget. */ + export class dxDropDownEditor extends dxTextBox { + constructor(element: JQuery, options?: dxDropDownEditorOptions); + constructor(element: Element, options?: dxDropDownEditorOptions); + /** Closes the drop-down editor. */ + close(): void; + /** Opens the drop-down editor. */ + open(): void; + /** Resets the widget's value to null. */ + reset(): void; + /** Returns an <input> element of the widget. */ + field(): JQuery; + /** Returns an HTML element of the popup window content. */ + content(): JQuery; + } + export interface dxDateBoxOptions extends dxTextEditorOptions { + /** A format used to display date/time information. */ + format?: string; + /** A Globalize format string specifying the date display format. */ + formatString?: string; + /** The last date that can be selected within the widget. */ + max?: any; + /** The minimum date that can be selected within the widget. */ + min?: any; + /** The text displayed by the widget when the widget value is not yet specified. This text is also used as a title of the date picker. */ + placeholder?: string; + /** + * Specifies whether or not a user can pick out a date using the drop-down calendar. + * @deprecated Use 'pickerType' option instead. + */ + useCalendar?: boolean; + /** An object or a value, specifying the date and time currently selected using the date box. */ + value?: any; + /** + * Specifies whether or not the widget uses the native HTML input element. + * @deprecated Use 'pickerType' option instead. + */ + useNative?: boolean; + /** Specifies the interval between neighboring values in the popup list in minutes. */ + interval?: number; + /** Specifies the maximum zoom level of a calendar, which is used to pick the date. */ + maxZoomLevel?: string; + /** Specifies the minimal zoom level of a calendar, which is used to pick the date. */ + minZoomLevel?: string; + /** Specifies the type of date/time picker. */ + pickerType?: string; + /** Specifies the message displayed if the typed value is not a valid date or time. */ + invalidDateMessage?: string; + /** Specifies the message displayed if the specified date is later than the max value or earlier than the min value. */ + dateOutOfRangeMessage?: string; + /** The text displayed on the Apply button. */ + applyButtonText?: string; + /** The text displayed on the Cancel button. */ + cancelButtonText?: string; + } + /** A date box widget. */ + export class dxDateBox extends dxDropDownEditor { + constructor(element: JQuery, options?: dxDateBoxOptions); + constructor(element: Element, options?: dxDateBoxOptions); + } + export interface dxCheckBoxOptions extends EditorOptions { + activeStateEnabled?: boolean; + /** Specifies the widget state. */ + value?: boolean; + /** Specifies the text displayed by the check box. */ + text?: string; + } + /** A check box widget. */ + export class dxCheckBox extends Editor { + constructor(element: JQuery, options?: dxCheckBoxOptions); + constructor(element: Element, options?: dxCheckBoxOptions); + } + export interface dxCalendarOptions extends EditorOptions { + activeStateEnabled?: boolean; + /** Specifies a date displayed on the current calendar page. */ + currentDate?: Date; + /** Specifies the first day of a week. */ + firstDayOfWeek?: number; + /** The latest date the widget allows to select. */ + max?: Date; + /** The earliest date the widget allows to select. */ + min?: Date; + /** Specifies whether or not the widget displays a button that selects the current date. */ + showTodayButton?: boolean; + /** Specifies the current calendar zoom level. */ + zoomLevel?: string; + /** Specifies the maximum zoom level of the calendar. */ + maxZoomLevel?: string; + /** Specifies the minimum zoom level of the calendar. */ + minZoomLevel?: string; + /** The template to be used for rendering calendar cells. */ + cellTemplate?: any; + } + /** A calendar widget. */ + export class dxCalendar extends Editor { + constructor(element: JQuery, options?: dxCalendarOptions); + constructor(element: Element, options?: dxCalendarOptions); + } + export interface dxButtonOptions extends WidgetOptions { + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** A handler for the click event. */ + onClick?: any; + /** Specifies the icon to be displayed on the button. */ + icon?: string; + iconSrc?: string; + /** A template to be used for rendering the dxButton widget. */ + template?: any; + /** The text displayed on the button. */ + text?: string; + /** Specifies the button type. */ + type?: string; + /** Specifies the name of the validation group to be accessed in the click event handler. */ + validationGroup?: string; + } + /** A button widget. */ + export class dxButton extends Widget { + constructor(element: JQuery, options?: dxButtonOptions); + constructor(element: Element, options?: dxButtonOptions); + } + export interface dxBoxOptions extends CollectionWidget { + /** Specifies how widget items are aligned along the main direction. */ + align?: string; + /** Specifies the direction of item positioning in the widget. */ + direction?: string; + /** Specifies how widget items are aligned cross-wise. */ + crossAlign?: string; + } + /** A container widget used to arrange inner elements. */ + export class dxBox extends CollectionWidget { + constructor(element: JQuery, options?: dxBoxOptions); + constructor(element: Element, options?: dxBoxOptions); + } + export interface dxResponsiveBoxOptions extends CollectionWidgetOptions { + /** Specifies the collection of rows for the grid used to position layout elements. */ + rows?: Array; + /** Specifies the collection of columns for the grid used to position layout elements. */ + cols?: Array; + /** Specifies the function returning the screen factor depending on the screen width. */ + screenByWidth?: (width: number) => string; + /** Specifies the screen factor with which all elements are located in a single column. */ + singleColumnScreen?: string; + } + /** A widget used to build an adaptive markup that is dependent on screen resolution. */ + export class dxResponsiveBox extends CollectionWidget { + constructor(element: JQuery, options?: dxBoxOptions); + constructor(element: Element, options?: dxBoxOptions); + } + export interface dxAutocompleteOptions extends dxDropDownListOptions { + /** Specifies the current value displayed by the widget. */ + value?: string; + /** The minimum number of characters that must be entered into the text box to begin a search. */ + minSearchLength?: number; + /** Specifies the maximum count of items displayed by the widget. */ + maxItemCount?: number; + /** Gets the currently selected item. */ + selectedItem?: Object; + } + /** A textbox widget that supports autocompletion. */ + export class dxAutocomplete extends dxDropDownList { + constructor(element: JQuery, options?: dxAutocompleteOptions); + constructor(element: Element, options?: dxAutocompleteOptions); + /** Opens the drop-down editor. */ + open(): void; + /** Closes the drop-down editor. */ + close(): void; + } + export interface dxAccordionOptions extends CollectionWidgetOptions { + /** A number specifying the time in milliseconds spent on the animation of the expanding or collapsing of a panel. */ + animationDuration?: number; + /** Specifies the height of the widget. */ + height?: any; + /** Specifies whether all items can be collapsed or whether at least one item must always be expanded. */ + collapsible?: boolean; + /** Specifies whether the widget can expand several items or only a single item at once. */ + multiple?: boolean; + /** The template to be used for rendering dxAccordion items. */ + itemTemplate?: any; + /** A handler for the itemTitleClick event. */ + onItemTitleClick?: any; + /** A handler for the itemTitleHold event. */ + onItemTitleHold?: Function; + /** The template to be used for rendering an item title. */ + itemTitleTemplate?: any; + /** The index number of the currently selected item. */ + selectedIndex?: number; + /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ + deferRendering?: boolean; + } + /** A widget that displays data source items on collapsible panels. */ + export class dxAccordion extends CollectionWidget { + constructor(element: JQuery, options?: dxAccordionOptions); + constructor(element: Element, options?: dxAccordionOptions); + /** Collapses the specified item. */ + collapseItem(index: number): JQueryPromise; + /** Expands the specified item. */ + expandItem(index: number): JQueryPromise; + /** Updates the dimensions of the widget contents. */ + updateDimensions(): JQueryPromise; + } + export interface dxFileUploaderOptions extends EditorOptions { + /** A read-only option that holds a File instance representing the selected file. */ + value?: File; + /** Holds the File instances representing files selected in the widget. */ + values?: Array; + buttonText?: string; + /** The text displayed on the button that opens the file browser. */ + selectButtonText?: string; + /** The text displayed on the button that starts uploading. */ + uploadButtonText?: string; + /** Specifies the text displayed on the area to which an end-user can drop a file. */ + labelText?: string; + /** Specifies the value passed to the name attribute of the underlying input element. */ + name?: string; + /** Specifies whether the widget enables an end-user to select a single file or multiple files. */ + multiple?: boolean; + /** Specifies a file type or several types accepted by the widget. */ + accept?: string; + /** Specifies a target Url for the upload request. */ + uploadUrl?: string; + /** Specifies if an end user can remove a file from the selection and interrupt uploading. */ + allowCanceling?: boolean; + /** Specifies whether or not the widget displays the list of selected files. */ + showFileList?: boolean; + /** Gets the current progress in percentages. */ + progress?: number; + /** The message displayed by the widget when it is ready to upload the specified files. */ + readyToUploadMessage?: string; + /** The message displayed by the widget when uploading is finished. */ + uploadedMessage?: string; + /** The message displayed by the widget on uploading failure. */ + uploadFailedMessage?: string; + /** Specifies how the widget uploads files. */ + uploadMode?: string; + /** A handler for the uploaded event. */ + onUploaded?: Function; + /** A handler for the uploaded event. */ + onProgress?: Function; + /** A handler for the uploadError event. */ + onUploadError?: Function; + /** A handler for the valueChanged event. */ + onValueChanged?: Function; + } + /** A widget used to select and upload a file or multiple files. */ + export class dxFileUploader extends Editor { + constructor(element: JQuery, options?: dxFileUploaderOptions); + constructor(element: Element, options?: dxFileUploaderOptions); + } + export interface dxTrackBarOptions extends EditorOptions { + /** The minimum value the widget can accept. */ + min?: number; + /** The maximum value the widget can accept. */ + max?: number; + /** The current widget value. */ + value?: number; + } + /** A base class for track bar widgets. */ + export class dxTrackBar extends Editor { + constructor(element: JQuery, options?: dxTrackBarOptions); + constructor(element: Element, options?: dxTrackBarOptions); + } + export interface dxProgressBarOptions extends dxTrackBarOptions { + /** Specifies a format for the progress status. */ + statusFormat?: any; + /** Specifies whether or not the widget displays a progress status. */ + showStatus?: boolean; + /** A handler for the complete event. */ + onComplete?: Function; + } + /** A widget used to indicate progress. */ + export class dxProgressBar extends dxTrackBar { + constructor(element: JQuery, options?: dxProgressBarOptions); + constructor(element: Element, options?: dxProgressBarOptions); + } + export interface dxSliderOptions extends dxTrackBarOptions { + activeStateEnabled?: boolean; + /** The slider step size. */ + step?: number; + /** The current slider value. */ + value?: number; + /** Specifies whether or not to highlight a range selected within the widget. */ + showRange?: boolean; + /** Specifies the size of a step by which a slider handle is moved when a user uses the Page up or Page down keyboard shortcuts. */ + keyStep?: number; + /** Specifies options for the slider tooltip. */ + tooltip?: { + /** Specifies whether or not the tooltip is enabled. */ + enabled?: boolean; + /** Specifies format for the tooltip. */ + format?: any; + /** Specifies whether the tooltip is located over or under the slider. */ + position?: string; + /** Specifies whether the widget always shows a tooltip or only when a pointer is over the slider. */ + showMode?: string; + }; + /** Specifies options for labels displayed at the min and max values. */ + label?: { + /** Specifies whether or not slider labels are visible. */ + visible?: boolean; + /** Specifies whether labels are located over or under the scale. */ + position?: string; + /** Specifies a format for labels. */ + format?: any; + }; + } + /** A widget that allows a user to select a numeric value within a given range. */ + export class dxSlider extends dxTrackBar { + constructor(element: JQuery, options?: dxSliderOptions); + constructor(element: Element, options?: dxSliderOptions); + } + export interface dxRangeSliderOptions extends dxSliderOptions { + /** The left edge of the interval currently selected using the range slider. */ + start?: number; + /** The right edge of the interval currently selected using the range slider. */ + end?: number; + } + /** A widget that enables a user to select a range of numeric values. */ + export class dxRangeSlider extends dxSlider { + constructor(element: JQuery, options?: dxRangeSliderOptions); + constructor(element: Element, options?: dxRangeSliderOptions); + } + export interface dxFormItemLabel { + /** Specifies the label text. */ + text?: string; + /** Specifies whether or not the label is visible. */ + visible?: boolean; + /** Specifies whether or not a colon is displayed at the end of the current label. */ + showColon?: boolean; + /** Specifies the location of a label against the editor. */ + location?: string; + /** Specifies the label horizontal alignment. */ + alignment?: string; + } + export interface dxFormItem { + /** Specifies the type of the current item. */ + itemType?: string; + /** Specifies whether or not the current form item is visible. */ + visible?: boolean; + /** Specifies the sequence number of the item in a form, group or tab. */ + visibleIndex?: number; + /** Specifies a CSS class to be applied to the form item. */ + cssClass?: string; + /** Specifies the number of columns spanned by the item. */ + colSpan?: number; + } + export interface dxFormEmptyItem extends dxFormItem { + /** Specifies the form item name. */ + name?: string; + } + export interface dxFormSimpleItem extends dxFormItem { + /** Specifies the path to the formData object field bound to the current form item. */ + dataField?: string; + /** Specifies the form item name. */ + name?: string; + /** Specifies which editor widget is used to display and edit the form item value. */ + editorType?: string; + /** Specifies configuration options for the editor widget of the current form item. */ + editorOptions?: Object; + /** A template to be used for rendering the form item. */ + template?: any; + /** Specifies the help text displayed for the current form item. */ + helpText?: string; + /** Specifies whether the current form item is required. */ + isRequired?: boolean; + /** Specifies options for the form item label. */ + label?: dxFormItemLabel; + /** An array of validation rules to be checked for the form item editor. */ + validationRules?: Array; + } + export interface dxFormGroupItem extends dxFormItem { + /** Specifies the group caption. */ + caption?: string; + /** A template to be used for rendering the group item. */ + template?: any; + /** The count of columns in the group layout. */ + colCount?: number; + /** Specifies whether or not all group item labels are aligned. */ + alignItemLabels?: boolean; + /** Holds an array of form items displayed within the group. */ + items?: Array; + } + export interface dxFormTab { + /** Specifies the tab title. */ + title?: string; + /** The count of columns in the tab layout. */ + colCount?: number; + /** Specifies whether or not labels of items displayed within the current tab are aligned. */ + alignItemLabels?: boolean; + /** Holds an array of form items displayed within the tab. */ + items?: Array; + /** Specifies a badge text for the tab. */ + badge?: string; + /** A Boolean value specifying whether or not the tab can respond to user interaction. */ + disabled?: boolean; + /** Specifies the icon to be displayed on the tab. */ + icon?: string; + /** The template to be used for rendering the tab. */ + tabTemplate?: any; + /** The template to be used for rendering the tab content. */ + template?: any; + } + export interface dxFormTabbedItem extends dxFormItem { + /** Holds a configuration object for the dxTabPanel widget used to display the current form item. */ + tabPanelOptions?: Object; + /** An array of tab configuration objects. */ + tabs?: Array; + } + export interface dxFormOptions extends WidgetOptions { + /** An object providing data for the form. */ + formData?: Object; + /** The count of columns in the form layout. */ + colCount?: any; + /** Specifies the location of a label against the editor. */ + labelLocation?: string; + /** Specifies whether or not all editors on the form are read-only. */ + readOnly?: boolean; + /** A handler for the fieldDataChanged event. */ + onFieldDataChanged?: (e: Object) => void; + /** A handler for the editorEnterKey event. */ + onEditorEnterKey?: (e: Object) => void; + /** Specifies a function that customizes a form item after it has been created. */ + customizeItem?: Function; + /** The minimum column width used for calculating column count in the form layout. */ + minColWidth?: number; + /** Specifies whether or not all root item labels are aligned. */ + alignItemLabels?: boolean; + /** Specifies whether or not item labels in all groups are aligned. */ + alignItemLabelsInAllGroups?: boolean; + /** Specifies whether or not a colon is displayed at the end of form labels. */ + showColonAfterLabel?: boolean; + /** Specifies whether or not the required mark is displayed for required fields. */ + showRequiredMark?: boolean; + /** Specifies whether or not the optional mark is displayed for optional fields. */ + showOptionalMark?: boolean; + /** The text displayed for required fields. */ + requiredMark?: string; + /** The text displayed for optional fields. */ + optionalMark?: string; + /** Specifies the message that is shown for end-users if a required field value is not specified. */ + requiredMessage?: string; + /** Specifies whether or not the total validation summary is displayed on the form. */ + showValidationSummary?: boolean; + /** Holds an array of form items. */ + items?: Array; + /** A Boolean value specifying whether to enable or disable form scrolling. */ + scrollingEnabled?: boolean; + onContentReady?: Function; + } + /** A form widget used to display and edit values of object fields. */ + export class dxForm extends Widget { + constructor(element: JQuery, options?: dxFormOptions); + constructor(element: Element, options?: dxFormOptions); + /** Updates the specified field of the formData object and the corresponding editor on the form. */ + updateData(dataField: string, value: any): void; + /** Updates the specified fields of the formData object and the corresponding editors on the form. */ + updateData(data: Object): void; + /** Updates the value of a form item option. */ + itemOption(field: string, option: string, value: any): void; + /** Updates the values of form item options. */ + itemOption(field: string, options: Object): void; + /** Returns an editor instance associated with the specified formData field. */ + getEditor(field: string): Object; + /** Updates the dimensions of the widget contents. */ + updateDimensions(): JQueryPromise; + /** Validates the values of all editors on the form against the list of the validation rules specified for each form item. */ + validate(): Object; + } +} +interface JQuery { + dxProgressBar(): JQuery; + dxProgressBar(options: "instance"): DevExpress.ui.dxProgressBar; + dxProgressBar(options: string): any; + dxProgressBar(options: string, ...params: any[]): any; + dxProgressBar(options: DevExpress.ui.dxProgressBarOptions): JQuery; + dxSlider(): JQuery; + dxSlider(options: "instance"): DevExpress.ui.dxSlider; + dxSlider(options: string): any; + dxSlider(options: string, ...params: any[]): any; + dxSlider(options: DevExpress.ui.dxSliderOptions): JQuery; + dxRangeSlider(): JQuery; + dxRangeSlider(options: "instance"): DevExpress.ui.dxRangeSlider; + dxRangeSlider(options: string): any; + dxRangeSlider(options: string, ...params: any[]): any; + dxRangeSlider(options: DevExpress.ui.dxRangeSliderOptions): JQuery; + dxFileUploader(): JQuery; + dxFileUploader(options: "instance"): DevExpress.ui.dxFileUploader; + dxFileUploader(options: string): any; + dxFileUploader(options: string, ...params: any[]): any; + dxFileUploader(options: DevExpress.ui.dxFileUploaderOptions): JQuery; + dxValidator(): JQuery; + dxValidator(options: "instance"): DevExpress.ui.dxValidator; + dxValidator(options: string): any; + dxValidator(options: string, ...params: any[]): any; + dxValidator(options: DevExpress.ui.dxValidatorOptions): JQuery; + dxValidationGroup(): JQuery; + dxValidationGroup(options: "instance"): DevExpress.ui.dxValidationGroup; + dxValidationGroup(options: string): any; + dxValidationGroup(options: string, ...params: any[]): any; + dxValidationSummary(): JQuery; + dxValidationSummary(options: "instance"): DevExpress.ui.dxValidationSummary; + dxValidationSummary(options: string): any; + dxValidationSummary(options: string, ...params: any[]): any; + dxValidationSummary(options: DevExpress.ui.dxValidationSummaryOptions): JQuery; + dxTooltip(): JQuery; + dxTooltip(options: "instance"): DevExpress.ui.dxTooltip; + dxTooltip(options: string): any; + dxTooltip(options: string, ...params: any[]): any; + dxTooltip(options: DevExpress.ui.dxTooltipOptions): JQuery; + dxResizable(): JQuery; + dxResizable(options: "instance"): DevExpress.ui.dxResizable; + dxResizable(options: string): any; + dxResizable(options: string, ...params: any[]): any; + dxResizable(options: DevExpress.ui.dxResizableOptions): JQuery; + dxDropDownList(): JQuery; + dxDropDownList(options: "instance"): DevExpress.ui.dxDropDownList; + dxDropDownList(options: string): any; + dxDropDownList(options: string, ...params: any[]): any; + dxDropDownList(options: DevExpress.ui.dxDropDownListOptions): JQuery; + dxToolbar(): JQuery; + dxToolbar(options: "instance"): DevExpress.ui.dxToolbar; + dxToolbar(options: string): any; + dxToolbar(options: string, ...params: any[]): any; + dxToolbar(options: DevExpress.ui.dxToolbarOptions): JQuery; + dxToast(): JQuery; + dxToast(options: "instance"): DevExpress.ui.dxToast; + dxToast(options: string): any; + dxToast(options: string, ...params: any[]): any; + dxToast(options: DevExpress.ui.dxToastOptions): JQuery; + dxTextEditor(): JQuery; + dxTextEditor(options: "instance"): DevExpress.ui.dxTextEditor; + dxTextEditor(options: string): any; + dxTextEditor(options: string, ...params: any[]): any; + dxTextEditor(options: DevExpress.ui.dxTextEditorOptions): JQuery; + dxTextBox(): JQuery; + dxTextBox(options: "instance"): DevExpress.ui.dxTextBox; + dxTextBox(options: string): any; + dxTextBox(options: string, ...params: any[]): any; + dxTextBox(options: DevExpress.ui.dxTextBoxOptions): JQuery; + dxTextArea(): JQuery; + dxTextArea(options: "instance"): DevExpress.ui.dxTextArea; + dxTextArea(options: string): any; + dxTextArea(options: string, ...params: any[]): any; + dxTextArea(options: DevExpress.ui.dxTextAreaOptions): JQuery; + dxTabs(): JQuery; + dxTabs(options: "instance"): DevExpress.ui.dxTabs; + dxTabs(options: string): any; + dxTabs(options: string, ...params: any[]): any; + dxTabs(options: DevExpress.ui.dxTabsOptions): JQuery; + dxTabPanel(): JQuery; + dxTabPanel(options: "instance"): DevExpress.ui.dxTabPanel; + dxTabPanel(options: string): any; + dxTabPanel(options: string, ...params: any[]): any; + dxTabPanel(options: DevExpress.ui.dxTabPanelOptions): JQuery; + dxSelectBox(): JQuery; + dxSelectBox(options: "instance"): DevExpress.ui.dxSelectBox; + dxSelectBox(options: string): any; + dxSelectBox(options: string, ...params: any[]): any; + dxSelectBox(options: DevExpress.ui.dxSelectBoxOptions): JQuery; + dxTagBox(): JQuery; + dxTagBox(options: "instance"): DevExpress.ui.dxTagBox; + dxTagBox(options: string): any; + dxTagBox(options: string, ...params: any[]): any; + dxTagBox(options: DevExpress.ui.dxTagBoxOptions): JQuery; + dxScrollView(): JQuery; + dxScrollView(options: "instance"): DevExpress.ui.dxScrollView; + dxScrollView(options: string): any; + dxScrollView(options: string, ...params: any[]): any; + dxScrollView(options: DevExpress.ui.dxScrollViewOptions): JQuery; + dxScrollable(): JQuery; + dxScrollable(options: "instance"): DevExpress.ui.dxScrollable; + dxScrollable(options: string): any; + dxScrollable(options: string, ...params: any[]): any; + dxScrollable(options: DevExpress.ui.dxScrollableOptions): JQuery; + dxRadioGroup(): JQuery; + dxRadioGroup(options: "instance"): DevExpress.ui.dxRadioGroup; + dxRadioGroup(options: string): any; + dxRadioGroup(options: string, ...params: any[]): any; + dxRadioGroup(options: DevExpress.ui.dxRadioGroupOptions): JQuery; + dxPopup(): JQuery; + dxPopup(options: "instance"): DevExpress.ui.dxPopup; + dxPopup(options: string): any; + dxPopup(options: string, ...params: any[]): any; + dxPopup(options: DevExpress.ui.dxPopupOptions): JQuery; + dxPopover(): JQuery; + dxPopover(options: "instance"): DevExpress.ui.dxPopover; + dxPopover(options: string): any; + dxPopover(options: string, ...params: any[]): any; + dxPopover(options: DevExpress.ui.dxPopoverOptions): JQuery; + dxOverlay(): JQuery; + dxOverlay(options: "instance"): DevExpress.ui.dxOverlay; + dxOverlay(options: string): any; + dxOverlay(options: string, ...params: any[]): any; + dxOverlay(options: DevExpress.ui.dxOverlayOptions): JQuery; + dxNumberBox(): JQuery; + dxNumberBox(options: "instance"): DevExpress.ui.dxNumberBox; + dxNumberBox(options: string): any; + dxNumberBox(options: string, ...params: any[]): any; + dxNumberBox(options: DevExpress.ui.dxNumberBoxOptions): JQuery; + dxNavBar(): JQuery; + dxNavBar(options: "instance"): DevExpress.ui.dxNavBar; + dxNavBar(options: string): any; + dxNavBar(options: string, ...params: any[]): any; + dxNavBar(options: DevExpress.ui.dxNavBarOptions): JQuery; + dxMultiView(): JQuery; + dxMultiView(options: "instance"): DevExpress.ui.dxMultiView; + dxMultiView(options: string): any; + dxMultiView(options: string, ...params: any[]): any; + dxMultiView(options: DevExpress.ui.dxMultiViewOptions): JQuery; + dxMap(): JQuery; + dxMap(options: "instance"): DevExpress.ui.dxMap; + dxMap(options: string): any; + dxMap(options: string, ...params: any[]): any; + dxMap(options: DevExpress.ui.dxMapOptions): JQuery; + dxLookup(): JQuery; + dxLookup(options: "instance"): DevExpress.ui.dxLookup; + dxLookup(options: string): any; + dxLookup(options: string, ...params: any[]): any; + dxLookup(options: DevExpress.ui.dxLookupOptions): JQuery; + dxLoadPanel(): JQuery; + dxLoadPanel(options: "instance"): DevExpress.ui.dxLoadPanel; + dxLoadPanel(options: string): any; + dxLoadPanel(options: string, ...params: any[]): any; + dxLoadPanel(options: DevExpress.ui.dxLoadPanelOptions): JQuery; + dxLoadIndicator(): JQuery; + dxLoadIndicator(options: "instance"): DevExpress.ui.dxLoadIndicator; + dxLoadIndicator(options: string): any; + dxLoadIndicator(options: string, ...params: any[]): any; + dxLoadIndicator(options: DevExpress.ui.dxLoadIndicatorOptions): JQuery; + dxList(): JQuery; + dxList(options: "instance"): DevExpress.ui.dxList; + dxList(options: string): any; + dxList(options: string, ...params: any[]): any; + dxList(options: DevExpress.ui.dxListOptions): JQuery; + dxGallery(): JQuery; + dxGallery(options: "instance"): DevExpress.ui.dxGallery; + dxGallery(options: string): any; + dxGallery(options: string, ...params: any[]): any; + dxGallery(options: DevExpress.ui.dxGalleryOptions): JQuery; + dxDropDownEditor(): JQuery; + dxDropDownEditor(options: "instance"): DevExpress.ui.dxDropDownEditor; + dxDropDownEditor(options: string): any; + dxDropDownEditor(options: string, ...params: any[]): any; + dxDropDownEditor(options: DevExpress.ui.dxDropDownEditorOptions): JQuery; + dxDateBox(): JQuery; + dxDateBox(options: "instance"): DevExpress.ui.dxDateBox; + dxDateBox(options: string): any; + dxDateBox(options: string, ...params: any[]): any; + dxDateBox(options: DevExpress.ui.dxDateBoxOptions): JQuery; + dxCheckBox(): JQuery; + dxCheckBox(options: "instance"): DevExpress.ui.dxCheckBox; + dxCheckBox(options: string): any; + dxCheckBox(options: string, ...params: any[]): any; + dxCheckBox(options: DevExpress.ui.dxCheckBoxOptions): JQuery; + dxBox(): JQuery; + dxBox(options: "instance"): DevExpress.ui.dxBox; + dxBox(options: string): any; + dxBox(options: string, ...params: any[]): any; + dxBox(options: DevExpress.ui.dxBoxOptions): JQuery; + dxButton(): JQuery; + dxButton(options: "instance"): DevExpress.ui.dxButton; + dxButton(options: string): any; + dxButton(options: string, ...params: any[]): any; + dxButton(options: DevExpress.ui.dxButtonOptions): JQuery; + dxCalendar(): JQuery; + dxCalendar(options: "instance"): DevExpress.ui.dxCalendar; + dxCalendar(options: string): any; + dxCalendar(options: string, ...params: any[]): any; + dxCalendar(options: DevExpress.ui.dxCalendarOptions): JQuery; + dxAccordion(): JQuery; + dxAccordion(options: "instance"): DevExpress.ui.dxAccordion; + dxAccordion(options: string): any; + dxAccordion(options: string, ...params: any[]): any; + dxAccordion(options: DevExpress.ui.dxAccordionOptions): JQuery; + dxResponsiveBox(): JQuery; + dxResponsiveBox(options: "instance"): DevExpress.ui.dxResponsiveBox; + dxResponsiveBox(options: string): any; + dxResponsiveBox(options: string, ...params: any[]): any; + dxResponsiveBox(options: DevExpress.ui.dxResponsiveBoxOptions): JQuery; + dxAutocomplete(): JQuery; + dxAutocomplete(options: "instance"): DevExpress.ui.dxAutocomplete; + dxAutocomplete(options: string): any; + dxAutocomplete(options: string, ...params: any[]): any; + dxAutocomplete(options: DevExpress.ui.dxAutocompleteOptions): JQuery; + dxForm(): JQuery; + dxForm(options: "instance"): DevExpress.ui.dxForm; + dxForm(options: string): any; + dxForm(options: string, ...params: any[]): any; + dxForm(options: DevExpress.ui.dxFormOptions): JQuery; +} + +declare module DevExpress.ui { + export interface dxTileViewOptions extends CollectionWidgetOptions { + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** Specifies the height of the base tile view item. */ + baseItemHeight?: number; + /** Specifies the width of the base tile view item. */ + baseItemWidth?: number; + /** Specifies whether tiles are placed horizontally or vertically. */ + direction?: string; + /** Specifies the height of the widget. */ + height?: any; + /** Specifies the distance in pixels between adjacent tiles. */ + itemMargin?: number; + /** A Boolean value specifying whether or not to display a scrollbar. */ + showScrollbar?: boolean; + } + /** A widget displaying several blocks of data as tiles. */ + export class dxTileView extends CollectionWidget { + constructor(element: JQuery, options?: dxTileViewOptions); + constructor(element: Element, options?: dxTileViewOptions); + /** Returns the current scroll position of the widget content. */ + scrollPosition(): number; + } + export interface dxSwitchOptions extends EditorOptions { + activeStateEnabled?: boolean; + /** Text displayed when the widget is in a disabled state. */ + offText?: string; + /** Text displayed when the widget is in an enabled state. */ + onText?: string; + /** A Boolean value specifying whether the current switch state is "On" or "Off". */ + value?: boolean; + } + /** A switch widget. */ + export class dxSwitch extends Editor { + constructor(element: JQuery, options?: dxSwitchOptions); + constructor(element: Element, options?: dxSwitchOptions); + } + export interface dxSlideOutViewOptions extends WidgetOptions { + /** Specifies the current menu position. */ + menuPosition?: string; + /** Specifies whether or not the menu panel is visible. */ + menuVisible?: boolean; + /** Specifies whether or not the menu is shown when a user swipes the widget content. */ + swipeEnabled?: boolean; + /** A template to be used for rendering menu panel content. */ + menuTemplate?: any; + /** A template to be used for rendering widget content. */ + contentTemplate?: any; + } + /** The widget that allows you to slide-out the current view to reveal a custom menu. */ + export class dxSlideOutView extends Widget { + constructor(element: JQuery, options?: dxSlideOutViewOptions); + constructor(element: Element, options?: dxSlideOutViewOptions); + /** Returns an HTML element of the widget menu block. */ + menuContent(): JQuery; + /** Returns an HTML element of the widget content block. */ + content(): JQuery; + /** Displays the widget's menu block. */ + showMenu(): JQueryPromise; + /** Hides the widget's menu block. */ + hideMenu(): JQueryPromise; + /** Toggles the visibility of the widget's menu block. */ + toggleMenuVisibility(): JQueryPromise; + } + export interface dxSlideOutOptions extends CollectionWidgetOptions { + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** A Boolean value specifying whether or not to display a grouped menu. */ + menuGrouped?: boolean; + /** Specifies the current menu position. */ + menuPosition?: string; + /** The name of the template used to display a group header. */ + menuGroupTemplate?: any; + /** The template used to render menu items. */ + menuItemTemplate?: any; + /** A handler for the menuGroupRendered event. */ + onMenuGroupRendered?: Function; + /** A handler for the menuItemRendered event. */ + onMenuItemRendered?: Function; + /** Specifies whether or not the slide-out menu is displayed. */ + menuVisible?: boolean; + /** Indicates whether the menu can be shown/hidden by swiping the widget's main panel. */ + swipeEnabled?: boolean; + /** A template to be used for rendering widget content. */ + contentTemplate?: any; + } + /** The widget that allows you to slide-out the current view to reveal an item list. */ + export class dxSlideOut extends CollectionWidget { + constructor(element: JQuery, options?: dxSlideOutOptions); + constructor(element: Element, options?: dxSlideOutOptions); + /** Hides the widget's slide-out menu. */ + hideMenu(): JQueryPromise; + /** Displays the widget's slide-out menu. */ + showMenu(): JQueryPromise; + /** Toggles the visibility of the widget's slide-out menu. */ + toggleMenuVisibility(showing: boolean): JQueryPromise; + } + export interface dxPivotOptions extends CollectionWidgetOptions { + /** The index of the currently active pivot item. */ + selectedIndex?: number; + /** A Boolean value specifying whether or not to allow users to switch between items by swiping. */ + swipeEnabled?: boolean; + /** A template to be used for rendering widget content. */ + contentTemplate?: any; + /** The template to be used for rendering an item title. */ + itemTitleTemplate?: any; + } + /** A widget that is similar to a traditional tab control, but optimized for the phone with simplified end-user interaction. */ + export class dxPivot extends CollectionWidget { + constructor(element: JQuery, options?: dxPivotOptions); + constructor(element: Element, options?: dxPivotOptions); + } + export interface dxPanoramaOptions extends CollectionWidgetOptions { + /** An object exposing options for setting a background image for the panorama. */ + backgroundImage?: { + /** Specifies the height of the panorama's background image. */ + height?: number; + /** Specifies the URL of the image that is used as the panorama's background image. */ + url?: string; + /** Specifies the width of the panorama's background image. */ + width?: number; + }; + /** The index of the currently active panorama item. */ + selectedIndex?: number; + /** Specifies the widget content title. */ + title?: string; + } + /** A widget displaying the required content in a long horizontal canvas that extends beyond the frames of the screen. */ + export class dxPanorama extends CollectionWidget { + constructor(element: JQuery, options?: dxDropDownEditorOptions); + constructor(element: Element, options?: dxDropDownEditorOptions); + } + export interface dxDropDownMenuOptions extends WidgetOptions { + /** A handler for the buttonClick event. */ + onButtonClick?: any; + /** The name of the icon to be displayed by the DropDownMenu button. */ + buttonIcon?: string; + /** The text displayed in the DropDownMenu button. */ + buttonText?: string; + buttonIconSrc?: string; + /** A data source used to fetch data to be displayed by the widget. */ + dataSource?: any; + /** A handler for the itemClick event. */ + onItemClick?: any; + /** An array of items displayed by the widget. */ + items?: Array; + /** The template to be used for rendering items. */ + itemTemplate?: any; + /** Specifies whether or not to show the drop down menu within a dxPopover widget. */ + usePopover?: boolean; + /** The width of the menu popup in pixels. */ + popupWidth?: any; + /** The height of the menu popup in pixels. */ + popupHeight?: any; + /** Specifies whether or not the drop-down menu is displayed. */ + opened?: boolean; + hoverStateEnabled?: boolean; + activeStateEnabled?: boolean; + } + /** A drop-down menu widget. */ + export class dxDropDownMenu extends Widget { + constructor(element: JQuery, options?: dxDropDownEditorOptions); + constructor(element: Element, options?: dxDropDownEditorOptions); + /** This section lists the data source fields that are used in a default template for drop-down menu items. */ + /** Opens the drop-down menu. */ + open(): void; + /** Closes the drop-down menu. */ + close(): void; + } + export interface dxActionSheetOptions extends CollectionWidgetOptions { + /** A handler for the cancelClick event. */ + onCancelClick?: any; + /** The text displayed in the button that closes the action sheet. */ + cancelText?: string; + /** Specifies whether or not to display the Cancel button in action sheet. */ + showCancelButton?: boolean; + /** A Boolean value specifying whether or not the title of the action sheet is visible. */ + showTitle?: boolean; + /** Specifies the element the action sheet popover points at. */ + target?: any; + /** The title of the action sheet. */ + title?: string; + /** Specifies whether or not to show the action sheet within a dxPopover widget. */ + usePopover?: boolean; + /** A Boolean value specifying whether or not the dxActionSheet widget is visible. */ + visible?: boolean; + } + /** A widget consisting of a set of choices related to a certain task. */ + export class dxActionSheet extends CollectionWidget { + constructor(element: JQuery, options?: dxActionSheetOptions); + constructor(element: Element, options?: dxActionSheetOptions); + /** Hides the widget. */ + hide(): JQueryPromise; + /** Shows the widget. */ + show(): JQueryPromise; + /** Shows or hides the widget depending on the Boolean value passed as the parameter. */ + toggle(showing: boolean): JQueryPromise; + } +} +interface JQuery { + dxTileView(): JQuery; + dxTileView(options: "instance"): DevExpress.ui.dxTileView; + dxTileView(options: string): any; + dxTileView(options: string, ...params: any[]): any; + dxTileView(options: DevExpress.ui.dxTileViewOptions): JQuery; + dxSwitch(): JQuery; + dxSwitch(options: "instance"): DevExpress.ui.dxSwitch; + dxSwitch(options: string): any; + dxSwitch(options: string, ...params: any[]): any; + dxSwitch(options: DevExpress.ui.dxSwitchOptions): JQuery; + dxSlideOut(): JQuery; + dxSlideOut(options: "instance"): DevExpress.ui.dxSlideOut; + dxSlideOut(options: string): any; + dxSlideOut(options: string, ...params: any[]): any; + dxSlideOut(options: DevExpress.ui.dxSlideOutOptions): JQuery; + dxPivot(): JQuery; + dxPivot(options: "instance"): DevExpress.ui.dxPivot; + dxPivot(options: string): any; + dxPivot(options: string, ...params: any[]): any; + dxPivot(options: DevExpress.ui.dxPivotOptions): JQuery; + dxPanorama(): JQuery; + dxPanorama(options: "instance"): DevExpress.ui.dxPanorama; + dxPanorama(options: string): any; + dxPanorama(options: string, ...params: any[]): any; + dxPanorama(options: DevExpress.ui.dxPanoramaOptions): JQuery; + dxActionSheet(): JQuery; + dxActionSheet(options: "instance"): DevExpress.ui.dxActionSheet; + dxActionSheet(options: string): any; + dxActionSheet(options: string, ...params: any[]): any; + dxActionSheet(options: DevExpress.ui.dxActionSheetOptions): JQuery; + dxDropDownMenu(): JQuery; + dxDropDownMenu(options: "instance"): DevExpress.ui.dxDropDownMenu; + dxDropDownMenu(options: string): any; + dxDropDownMenu(options: string, ...params: any[]): any; + dxDropDownMenu(options: DevExpress.ui.dxDropDownMenuOptions): JQuery; +} +declare module DevExpress.data { + export interface XmlaStoreOptions { + /** The HTTP address to an XMLA OLAP server. */ + url?: string; + /** The name of the database associated with the Store. */ + catalog?: string; + /** The cube name. */ + cube?: string; + /** A function used to customize a web request before it is sent. */ + beforeSend?: (request: Object) => void; + } + /** A Store that provides access to an OLAP cube using the XMLA standard. */ + export class XmlaStore { + constructor(options: XmlaStoreOptions); + } + export interface PivotGridField { + index?: number; + /** A boolean value specifying whether or not the field is visible in the pivot grid and the Field Chooser. */ + visible?: boolean; + /** Name of the data source field containing data for the pivot grid field. */ + dataField?: string; + /** A caption that will be displayed in the pivot grid's field chooser to identify the field. */ + caption?: string; + /** Specifies a type of field values. */ + dataType?: string; + /** Specifies how the values of the current field are combined into groups. Cannot be used for the XmlaStore store type. */ + groupInterval?: any; + /** Specifies how to aggregate field data. Cannot be used for the XmlaStore store type. */ + summaryType?: string; + /** Allows you to use a custom aggregate function to calculate the summary values. Cannot be used for the XmlaStore store type. */ + calculateCustomSummary?: (options: { + summaryProcess?: string; + value?: any; + totalValue?: any; + }) => void; + /** Specifies the function that determines how to split data from the data source into ranges for header items. Cannot be used for the XmlaStore store type. */ + selector?: (data: Object) => any; + /** Type of the area where the field is located. */ + area?: string; + /** Index among the other fields displayed within the same area. */ + areaIndex?: number; + /** The name of the folder in which the field is located. */ + displayFolder?: string; + /** The name of the group to which the field belongs. */ + groupName?: string; + /** The index of the field within a group. */ + groupIndex?: number; + /** Specifies the sort order of field values. */ + sortOrder?: string; + /** Specifies how field data should be sorted. Can be used for the XmlaStore store type only. */ + sortBy?: string; + /** Sorts the header items of this field by the summary values of another field. */ + sortBySummaryField?: string; + /** The array of field names that specify a path to column/row whose summary field is used for sorting of this field's header items. */ + sortBySummaryPath?: Array; + /** The filter values for the current field. */ + filterValues?: Array; + /** The filter type for the current field. */ + filterType?: string; + /** Indicates whether all header items of the field's header level are expanded. */ + expanded?: boolean; + /** Specifies whether the field should be treated as a Data Field. */ + isMeasure?: boolean; + /** Specifies a display format for field values. */ + format?: string; + /** Specifies a callback function that returns the text to be displayed in the cells of a field. */ + customizeText?: (cellInfo: { value: any; valueText: string }) => string; + /** Specifies a precision for formatted field values. */ + precision?: number; + /** Specifies how to sort the header items. */ + sortingMethod?: (a: Object, b: Object) => number; + /** Allows an end-user to change sorting options. */ + allowSorting?: boolean; + /** Allows an end-user to sort columns by summary values. */ + allowSortingBySummary?: boolean; + /** Allows an end-user to change filtering options. */ + allowFiltering?: boolean; + /** Allows an end-user to expand/collapse all header items within a header level. */ + allowExpandAll?: boolean; + /** Specifies the absolute width of the field in the pivot grid. */ + width?: number; + /** Specifies the summary post-processing algorithm. */ + summaryDisplayMode?: string; + /** Specifies whether to summarize each next summary value with the previous one by rows or columns. */ + runningTotal?: string; + /** Specifies whether to allow the predefined summary post-processing functions ('absoluteVariation' and 'percentVariation') and runningTotal to take values of different groups into account. */ + allowCrossGroupCalculation?: boolean; + /** Specifies a callback function that allows you to modify summary values after they are calculated. */ + calculateSummaryValue?: (e: Object) => number; + /** Specifies whether or not to display Total values for the field. */ + showTotals?: boolean; + /** Specifies whether or not to display Grand Total values for the field. */ + showGrandTotals?: boolean; + } + export class SummaryCell { + /** Gets the parent cell in a specified direction. */ + parent(direction: string): SummaryCell; + /** Gets all children cells in a specified direction. */ + children(direction: string): Array; + /** Gets a partial Grand Total cell of a row or column. */ + grandTotal(direction: string): SummaryCell; + /** Gets the Grand Total of the entire pivot grid. */ + grandTotal(): SummaryCell; + /** Gets the cell next to the current one in a specified direction. */ + next(direction: string): SummaryCell; + /** Gets the cell next to current in a specified direction. */ + next(direction: string, allowCrossGroup: boolean): SummaryCell; + /** Gets the cell prior to the current one in a specified direction. */ + prev(direction: string): SummaryCell; + /** Gets the cell previous to current in a specified direction. */ + prev(direction: string, allowCrossGroup: boolean): SummaryCell; + /** Gets the child cell in a specified direction. */ + child(direction: string, fieldValue: any): SummaryCell; + /** Gets the cell located by the path of the source cell with one field value changed. */ + slice(field: PivotGridField, value: any): SummaryCell; + /** Gets the header cell of a row or column field to which the current cell belongs. */ + field(area: string): PivotGridField; + /** Gets the value of the current cell. */ + value(): any; + /** Gets the value of the current cell. */ + value(isCalculatedValue: boolean): any; + /** Gets the value of any field linked with the current cell. */ + value(field: PivotGridField): any; + /** Gets the value of any field linked with the current cell. */ + value(field: PivotGridField, isCalculatedValue: boolean): any; + } + export interface PivotGridDataSourceOptions { + /** Specifies the underlying Store instance used to access data. */ + store?: any; + /** Indicates whether or not the automatic field generation from data in the Store is enabled. */ + retrieveFields?: boolean; + /** Specifies data filtering conditions. Cannot be used for the XmlaStore store type. */ + filter?: Object; + /** An array of pivot grid fields. */ + fields?: Array; + /** A handler for the changed event. */ + onChanged?: () => void; + /** A handler for the loadingChanged event. */ + onLoadingChanged?: (isLoading: boolean) => void; + /** A handler for the loadError event. */ + onLoadError?: (e?: Object) => void; + /** A handler for the fieldsPrepared event. */ + onFieldsPrepared?: (e?: Array) => void; + } + /** An object that provides access to data for the dxPivotGrid widget. */ + export class PivotGridDataSource implements EventsMixin { + constructor(options?: PivotGridDataSource); + /** Starts reloading data from any store and updating the data source. */ + reload(): JQueryPromise; + /** Starts updating the data source. Reloads data from the XMLA store only. */ + load(): JQueryPromise; + /** Indicates whether or not the PivotGridDataSource is currently being loaded. */ + isLoading(): boolean; + /** Gets data displayed in a PivotGrid. */ + getData(): Object; + /** Gets all fields within a specified area. */ + getAreaFields(area: string, collectGroups: boolean): Array; + /** Gets all fields from the data source. */ + fields(): Array; + /** Sets the fields option. */ + fields(fields: Array): void; + /** Gets current options of a specified field. */ + field(id: any): PivotGridField; + /** Sets one or more options of a specified field. */ + field(id: any, field: PivotGridField): void; + /** Collapses a specified header item. */ + collapseHeaderItem(area: string, path: Array): void; + /** Expands a specified header item. */ + expandHeaderItem(area: string, path: Array): void; + /** Expands all header items of a field. */ + expandAll(id: any): void; + /** Collapses all header items of a field. */ + collapseAll(id: any): void; + /** Disposes of all resources associated with this PivotGridDataSource. */ + dispose(): void; + /** Gets the current filter expression. Cannot be used for the XmlaStore store type. */ + filter(): Object; + /** Applies a new filter expression. Cannot be used for the XmlaStore store type. */ + filter(filterExpr: Object): void; + /** Provides access to a list of records (facts) that were used to calculate a specific summary. */ + createDrillDownDataSource(options: { + columnPath?: Array; + rowPath?: Array; + dataIndex?: number; + maxRowCount?: number; + customColumns?: Array; + }): DevExpress.data.DataSource; + /** Gets the current PivotGridDataSource state (fields configuration, sorting, filters, expanded headers, etc.) */ + state(): Object; + /** Sets the PivotGridDataSource state. */ + state(state: Object): void; + on(eventName: string, eventHandler: Function): PivotGridDataSource; + on(events: { [eventName: string]: Function; }): PivotGridDataSource; + off(eventName: string): PivotGridDataSource; + off(eventName: string, eventHandler: Function): PivotGridDataSource; + } +} +declare module DevExpress.ui { + export interface dxSchedulerOptions extends WidgetOptions { + /** Specifies a date displayed on the current scheduler view by default. */ + currentDate?: Date; + /** The earliest date the widget allows you to select. */ + min?: Date; + /** The latest date the widget allows you to select. */ + max?: Date; + /** Specifies the view used in the scheduler by default. */ + currentView?: string; + /** A data source used to fetch data to be displayed by the widget. */ + dataSource?: any; + /** Specifies the first day of a week. */ + firstDayOfWeek?: number; + /** The template to be used for rendering appointments. */ + appointmentTemplate?: any; + /** The template to be used for rendering an appointment tooltip. */ + appointmentTooltipTemplate?: any; + /** Lists the views to be available within the scheduler's View Selector. */ + views?: Array; + /** Specifies the resource kinds by which the scheduler's appointments are grouped in a timetable. */ + groups?: Array; + /** Specifies a start hour in the scheduler view's time interval. */ + startDayHour?: number; + /** Specifies an end hour in the scheduler view's time interval. */ + endDayHour?: number; + /** Specifies whether or not the "All-day" panel is visible. */ + showAllDayPanel?: boolean; + /** Specifies cell duration in minutes. */ + cellDuration?: number; + /** Specifies the edit mode for recurring appointments. */ + recurrenceEditMode?: string; + /** Specifies which editing operations an end-user can perform on appointments. */ + editing?: { + /** Specifies whether or not an end-user can add appointments. */ + allowAdding?: boolean; + /** Specifies whether or not an end-user can change appointment options. */ + allowUpdating?: boolean; + /** Specifies whether or not an end-user can delete appointments. */ + allowDeleting?: boolean; + /** Specifies whether or not an end-user can change an appointment duration. */ + allowResizing?: boolean; + /** Specifies whether or not an end-user can drag appointments. */ + allowDragging?: boolean; + } + /** Specifies an array of resources available in the scheduler. */ + resources?: Array<{ + /** Indicates whether or not several resources of this kind can be assigned to an appointment. */ + allowMultiple?: boolean; + /** + * Indicates whether or not resources of this kind have priority in the color identification of the appointments that have resources of different kinds assigned. + * @deprecated Use the 'useColorAsDefault' property instead + */ + mainColor?: boolean; + /** Indicates whether or not resources of this kind have priority in the color identification of the appointments that have resources of different kinds assigned. */ + useColorAsDefault?: boolean; + /** A data source used to fetch resources to be available in the scheduler. */ + dataSource?: any; + /** Specifies the resource object field whose value is displayed by the Resource editor in the Appointment popup window. */ + displayExpr?: any; + /** Specifies the resource object field that is used as a value of the Resource editor in the Appointment popup window. */ + valueExpr?: any; + /** The name of the appointment object field that specifies a resource of this kind. */ + field?: string; + /** Specifies the label of the Appointment popup window field that allows end users to assign a resource of this kind. */ + label?: string; + }>; + /** A handler for the AppointmentAdding event. */ + onAppointmentAdding?: Function; + /** A handler for the appointmentAdded event. */ + onAppointmentAdded?: Function; + /** A handler for the AppointmentUpdating event. */ + onAppointmentUpdating?: Function; + /** A handler for the appointmentUpdated event. */ + onAppointmentUpdated?: Function; + /** A handler for the AppointmentDeleting event. */ + onAppointmentDeleting?: Function; + /** A handler for the appointmentDeleted event. */ + onAppointmentDeleted?: Function; + /** A handler for the appointmentRendered event. */ + onAppointmentRendered?: Function; + /** A handler for the appointmentClick event. */ + onAppointmentClick?: any; + /** A handler for the appointmentDblClick event. */ + onAppointmentDblClick?: any; + /** A handler for the cellClick event. */ + onCellClick?: any; + /** A handler for the appointmentFormCreated event. */ + onAppointmentFormCreated?: Function; + /** Specifies whether or not an end-user can scroll the view horizontally. */ + horizontalScrollingEnabled?: boolean; + /** Specifies whether a user can switch views using tabs or a drop-down menu. */ + useDropDownViewSwitcher?: boolean; + /** Specifies the name of the data source item field that defines the start of an appointment. */ + startDateExpr?: string; + /** Specifies the name of the data source item field that defines the ending of an appointment. */ + endDateExpr?: string; + /** Specifies the name of the data source item field that holds the subject of an appointment. */ + textExpr?: string; + /** Specifies the name of the data source item field whose value holds the description of the corresponding appointment. */ + descriptionExpr?: string; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding appointment is an all-day appointment. */ + allDayExpr?: string; + /** Specifies the name of the data source item field that defines a recurrence rule for generating recurring appointments. */ + recurrenceRuleExpr?: string; + /** Specifies the name of the data source item field that defines exceptions for the current recurring appointment. */ + recurrenceExceptionExpr?: string; + /** Specifies whether filtering is performed on the server or client side. */ + remoteFiltering?: boolean; + } + /** A widget that displays scheduled data using different views and provides the capability to load, add and edit appointments. */ + export class dxScheduler extends Widget { + constructor(element: JQuery, options?: dxSchedulerOptions); + constructor(element: Element, options?: dxSchedulerOptions); + /** Add the appointment defined by the object passed as a parameter to the data associated with the widget. */ + addAppointment(appointment: Object): void; + /** Updates the appointment specified by the first method parameter by the appointment object specified by the second method parameter in the the data associated with the widget. */ + updateAppointment(target: Object, appointment: Object): void; + /** Deletes the appointment defined by the parameter from the the data associated with the widget. */ + deleteAppointment(appointment: Object): void; + /** Scrolls the scheduler work space to the specified time of the specified day. */ + scrollToTime(hours: number, minutes: number, date: Date): void; + /** Displayes the Appointment Details popup. */ + showAppointmentPopup(appointmentData: Object, createNewAppointment?: boolean, currentAppointmentData?: Object): void; + } + export interface dxColorBoxOptions extends dxDropDownEditorOptions { + /** Specifies the text displayed on the button that applies changes and closes the drop-down editor. */ + applyButtonText?: string; + applyValueMode?: string; + /** Specifies the text displayed on the button that cancels changes and closes the drop-down editor. */ + cancelButtonText?: string; + /** Specifies whether or not the widget value includes the alpha channel component. */ + editAlphaChannel?: boolean; + /** Specifies the size of a step by which a handle is moved using a keyboard shortcut. */ + keyStep?: number; + } + /** A widget used to specify a color value. */ + export class dxColorBox extends dxDropDownEditor { + constructor(element: JQuery, options?: dxColorBoxOptions); + constructor(element: Element, options?: dxColorBoxOptions); + } + export interface HierarchicalCollectionWidgetOptions extends CollectionWidgetOptions { + /** Specifies the name of the data source item field whose value is displayed by the widget. */ + displayExpr?: any; + /** Specifies the name of the data source item field used as a key. */ + keyExpr?: any; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding widget items is selected. */ + selectedExpr?: any; + /** Specifies the name of the data source item field that contains an array of nested items. */ + itemsExpr?: any; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding widget item is disabled. */ + disabledExpr?: any; + /** Specifies the name of the data source item field that holds the key of the parent item. */ + parentIdExpr?: any; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding widget items is expanded. */ + expandedExpr?: any; + hoverStateEnabled?: boolean; + focusStateEnabled?: boolean; + } + export class HierarchicalCollectionWidget extends CollectionWidget { + } + export interface dxTreeViewOptions extends HierarchicalCollectionWidgetOptions { + /** Specifies whether or not to animate item collapsing and expanding. */ + animationEnabled?: boolean; + /** Specifies whether a nested or plain array is used as a data source. */ + dataStructure?: string; + /** Specifies whether or not a user can expand all tree view items by the "*" hot key. */ + expandAllEnabled?: boolean; + /** + * Specifies whether or not a check box is displayed at each tree view item. + * @deprecated Use the showCheckBoxesMode option instead. + */ + showCheckBoxes?: boolean; + /** Specifies the current check boxes display mode. */ + showCheckBoxesMode?: string; + /** Specifies whether or not to select nodes recursively. */ + selectNodesRecursive?: boolean; + /** Specifies whether or not all parent nodes of an initially expanded node are displayed expanded. */ + expandNodesRecursive?: boolean; + /** + * Specifies whether the "Select All" check box is displayed over the tree view. + * @deprecated Use the showCheckBoxesMode option instead. + */ + selectAllEnabled?: boolean; + /** Specifies the text displayed at the "Select All" check box. */ + selectAllText?: string; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding node includes child nodes. */ + hasItemsExpr?: any; + /** Specifies if the virtual mode is enabled. */ + virtualModeEnabled?: boolean; + /** Specifies the parent ID value of the root item. */ + rootValue?: any; + /** Specifies the current value used to filter tree view items. */ + searchValue?: string; + /** A string value specifying available scrolling directions. */ + scrollDirection?: string; + /** A handler for the itemSelected event. */ + onItemSelected?: Function; + /** A handler for the itemExpanded event. */ + onItemExpanded?: Function; + /** A handler for the itemCollapsed event. */ + onItemCollapsed?: Function; + onItemClick?: Function; + onItemContextMenu?: Function; + onItemRendered?: Function; + onItemHold?: Function; + } + /** A widget displaying specified data items as a tree. */ + export class dxTreeView extends HierarchicalCollectionWidget { + constructor(element: JQuery, options?: dxTreeViewOptions); + constructor(element: Element, options?: dxTreeViewOptions); + /** Updates the tree view scrollbars according to the current size of the widget content. */ + updateDimensions(): JQueryPromise; + /** Selects the specified item. */ + selectItem(itemElement: any): void; + /** Unselects the specified item. */ + unselectItem(itemElement: any): void; + /** Expands the specified item. */ + expandItem(itemElement: any): void; + /** Collapses the specified item. */ + collapseItem(itemElement: any): void; + /** Returns all nodes of the tree view. */ + getNodes(): Array; + /** Selects all widget items. */ + selectAll(): void; + /** Unselects all widget items. */ + unselectAll(): void; + } + export interface dxMenuBaseOptions extends HierarchicalCollectionWidgetOptions { + /** An object that defines the animation options of the widget. */ + animation?: fx.AnimationOptions; + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** Specifies the name of the CSS class associated with the menu. */ + cssClass?: string; + /** Holds an array of menu items. */ + items?: Array; + /** Specifies whether or not an item becomes selected if an end-user clicks it. */ + selectionByClick?: boolean; + /** Specifies the selection mode supported by the menu. */ + selectionMode?: string; + /** Specifies options of submenu showing and hiding. */ + showSubmenuMode?: { + /** Specifies the mode name. */ + name?: string; + /** Specifies the delay of submenu show and hiding. */ + delay?: { + /** The time span after which the submenu is shown. */ + show?: number; + /** The time span after which the submenu is hidden. */ + hide?: number; + }; + }; + } + export class dxMenuBase extends HierarchicalCollectionWidget { + constructor(element: JQuery, options?: dxMenuBaseOptions); + constructor(element: Element, options?: dxMenuBaseOptions); + /** Selects the specified item. */ + selectItem(itemElement: any): void; + /** Unselects the specified item. */ + unselectItem(itemElement: any): void; + } + export interface dxMenuOptions extends dxMenuBaseOptions { + /** Specifies whether or not the submenu is hidden when the mouse pointer leaves it. */ + hideSubmenuOnMouseLeave?: boolean; + /** Specifies whether the menu has horizontal or vertical orientation. */ + orientation?: string; + /** Specifies options for showing and hiding the first level submenu. */ + showFirstSubmenuMode?: { + /** Specifies the mode name. */ + name?: string; + /** Specifies the delay in submenu showing and hiding. */ + delay?: { + /** The time span after which the submenu is shown. */ + show?: number; + /** The time span after which the submenu is hidden. */ + hide?: number; + }; + }; + /** Specifies the direction at which the submenus are displayed. */ + submenuDirection?: string; + /** A handler for the submenuHidden event. */ + onSubmenuHidden?: Function; + /** A handler for the submenuHiding event. */ + onSubmenuHiding?: Function; + /** A handler for the submenuShowing event. */ + onSubmenuShowing?: Function; + /** A handler for the submenuShown event. */ + onSubmenuShown?: Function; + } + /** A menu widget. */ + export class dxMenu extends dxMenuBase { + constructor(element: JQuery, options?: dxMenuOptions); + constructor(element: Element, options?: dxMenuOptions); + } + export interface dxContextMenuOptions extends dxMenuBaseOptions { + /** Holds an object that specifies options of alternative menu invocation. */ + alternativeInvocationMode?: { + /** Specifies whether or not the standard context menu invocation (on a right mouse click or on a long tap) is disabled. */ + enabled?: Boolean; + /** Specifies the element used to invoke the context menu. */ + invokingElement?: any; + }; + /** A handler for the hidden event. */ + onHidden?: Function; + /** A handler for the hiding event. */ + onHiding?: Function; + /** A handler for the positioning event. */ + onPositioning?: Function; + /** A handler for the showing event. */ + onShowing?: Function; + /** A handler for the shown event. */ + onShown?: Function; + /** An object defining widget positioning options. */ + position?: PositionOptions; + /** Specifies the direction at which submenus are displayed. */ + submenuDirection?: string; + /** The target element associated with a popover. */ + target?: any; + /** A Boolean value specifying whether or not the widget is visible. */ + visible?: boolean; + } + /** A context menu widget. */ + export class dxContextMenu extends dxMenuBase { + constructor(element: JQuery, options?: dxContextMenuOptions); + constructor(element: Element, options?: dxContextMenuOptions); + /** Toggles the visibility of the widget. */ + toggle(showing: boolean): JQueryPromise; + /** Shows the widget. */ + show(): JQueryPromise; + /** Hides the widget. */ + hide(): JQueryPromise; + } + export interface dxRemoteOperations { + /** Specifies whether or not filtering must be performed on the server side. */ + filtering?: boolean; + /** Specifies whether or not paging must be performed on the server side. */ + paging?: boolean; + /** Specifies whether or not sorting must be performed on the server side. */ + sorting?: boolean; + /** Specifies whether or not grouping must be performed on the server side. */ + grouping?: boolean; + /** Specifies whether or not summaries calculation must be performed on the server side. */ + summary?: boolean; + } + export interface dxDataGridRow { + /** The data object represented by the row. */ + data: Object; + /** The key of the data object represented by the row. */ + key: any; + /** The visible index of the row. */ + rowIndex: number; + /** The type of the row. */ + rowType: string; + } + export interface dxDataGridColumn { + /** Specifies the content alignment within column cells. */ + alignment?: string; + /** Specifies whether the values in a column can be edited at runtime. Setting this option makes sense only when editing is enabled for a grid. */ + allowEditing?: boolean; + /** Specifies whether or not a column can be used for filtering grid records. Setting this option makes sense only when the filter row and column header filtering are visible. */ + allowFiltering?: boolean; + /** Specifies whether or not to allow filtering by this column using its header. */ + allowHeaderFiltering?: boolean; + /** Specifies whether or not the column can be anchored to a grid edge by end users. Setting this option makes sense only when the columnFixing | enabled option is set to true. */ + allowFixing?: boolean; + /** Specifies if a column can be used for searching grid records. Setting this option makes sense only when the search panel is visible. */ + allowSearch?: boolean; + /** Specifies whether a column can be used for grouping grid records at runtime. Setting this option makes sense only when the group panel is visible. */ + allowGrouping?: boolean; + /** Specifies whether or not a column can be hidden by a user. Setting this option makes sense only when the column chooser is visible. */ + allowHiding?: boolean; + /** Specifies whether or not a particular column can be used in column reordering. Setting this option makes sense only when the allowColumnReordering option is set to true. */ + allowReordering?: boolean; + /** Specifies whether or not a particular column can be resized by a user. Setting this option makes sense only when the allowColumnResizing option is true. */ + allowResizing?: boolean; + /** Specifies whether grid records can be sorted by a specific column at runtime. Setting this option makes sense only when the sorting mode differs from none. */ + allowSorting?: boolean; + /** Specifies whether groups appear expanded or not when records are grouped by a specific column. Setting this option makes sense only when grouping is allowed for this column. */ + autoExpandGroup?: boolean; + /** Specifies a callback function that returns a value to be displayed in a column cell. */ + calculateCellValue?: (rowData: Object) => string; + /** Specifies a callback function to be invoked after the cell value is edited by an end-user and before the new value is saved to the data source. */ + setCellValue?: (rowData: Object, value: any) => void; + /** Specifies a callback function that defines filters for customary calculated grid cells. */ + calculateFilterExpression?: (filterValue: any, selectedFilterOperation: string, target: string) => Array; + /** Specifies a caption for a column. */ + caption?: string; + /** Specifies a custom template for grid column cells. */ + cellTemplate?: any; + /** Specifies a CSS class to be applied to a column. */ + cssClass?: string; + /** Specifies how to get a value to be displayed in a cell when it is not in an editing state. */ + calculateDisplayValue?: any; + /** Specifies a field name or a function that returns a field name or a value to be used for grouping column cells. */ + calculateGroupValue?: any; + /** Specifies a field name or a function that returns a field name or a value to be used for sorting column cells. */ + calculateSortValue?: any; + /** Specifies a callback function that returns the text to be displayed in the cells of a column. */ + customizeText?: (cellInfo: { value: any; valueText: string }) => string; + /** Specifies the field of a data source that provides data for a column. */ + dataField?: string; + /** Specifies the required type of column values. */ + dataType?: string; + /** Specifies a custom template for the cell of a grid column when it is in an editing state. */ + editCellTemplate?: any; + /** Specifies configuration options for the editor widget of the current column. */ + editorOptions?: Object; + /** Specifies whether HTML tags are displayed as plain text or applied to the values of the column. */ + encodeHtml?: boolean; + /** In a boolean column, replaces all false items with a specified text. */ + falseText?: string; + /** Specifies the set of available filter operations. */ + filterOperations?: Array; + /** Specifies a filter value for a column. */ + filterValue?: any; + /** Specifies initial filter values for the column's header filter. */ + filterValues?: Array; + /** Specifies whether to include or exclude the records with the values selected in the column's header filter. */ + filterType?: string; + /** Indicates whether the column takes part in horizontal grid scrolling or is anchored to a grid edge. */ + fixed?: boolean; + /** Specifies the grid edge to which the column is anchored. */ + fixedPosition?: string; + /** Specifies a format for the values displayed in a column. */ + format?: string; + /** Specifies a custom template for the group cell of a grid column. */ + groupCellTemplate?: any; + /** Specifies the index of a column when grid records are grouped by the values of this column. */ + groupIndex?: number; + /** Specifies a custom template for the header of a grid column. */ + headerCellTemplate?: any; + /** Specifies options of a lookup column. */ + lookup?: { + /** Specifies whether or not a user can nullify values of a lookup column. */ + allowClearing?: boolean; + /** Specifies the data source providing data for a lookup column. */ + dataSource?: any; + /** Specifies the expression defining the data source field whose values must be displayed. */ + displayExpr?: any; + /** Specifies the expression defining the data source field whose values must be replaced. */ + valueExpr?: string; + }; + /** Specifies column-level options for filtering using a column header filter. */ + headerFilter?: { + /** Specifies the data source to be used for the header filter. */ + dataSource?: any; + /** Specifies how header filter values should be combined into groups. */ + groupInterval?: any; + }; + /** Specifies a precision for formatted values displayed in a column. */ + precision?: number; + /** Specifies a filter operation applied to a column. */ + selectedFilterOperation?: string; + /** Specifies whether or not the column displays its values by using editors. */ + showEditorAlways?: boolean; + /** Specifies whether or not to display the column when grid records are grouped by it. */ + showWhenGrouped?: boolean; + /** Specifies the index of a column when grid records are sorted by the values of this column. */ + sortIndex?: number; + /** Specifies the initial sort order of column values. */ + sortOrder?: string; + /** In a boolean column, replaces all true items with a specified text. */ + trueText?: string; + /** Specifies whether a column is visible or not. */ + visible?: boolean; + /** Specifies the sequence number of the column in the grid. */ + visibleIndex?: number; + /** Specifies a column width in pixels or percentages. */ + width?: any; + /** Specifies an array of validation rules to be checked when updating column cell values. */ + validationRules?: Array; + /** Specifies whether or not to display the header of a hidden column in the column chooser. */ + showInColumnChooser?: boolean; + /** Specifies the identifier of the column. */ + name?: string; + /** The form item configuration object. Used only when the editing mode is "form". */ + formItem?: DevExpress.ui.dxFormItem; + } + export interface dxDataGridOptions extends WidgetOptions { + /** Specifies whether the outer borders of the grid are visible or not. */ + showBorders?: boolean; + /** Indicates whether to show the error row for the grid. */ + errorRowEnabled?: boolean; + /** A handler for the rowValidating event. */ + onRowValidating?: (e: Object) => void; + /** A handler for the contextMenuPreparing event. */ + onContextMenuPreparing?: (e: Object) => void; + /** A handler for the initNewRow event. */ + onInitNewRow?: (e: { data: Object }) => void; + /** A handler for the rowInserted event. */ + onRowInserted?: (e: { data: Object; key: any }) => void; + /** A handler for the rowInserting event. */ + onRowInserting?: (e: { data: Object; cancel: any }) => void; + /** A handler for the rowRemoved event. */ + onRowRemoved?: (e: { data: Object; key: any }) => void; + /** A handler for the rowRemoving event. */ + onRowRemoving?: (e: { data: Object; key: any; cancel: any }) => void; + /** A handler for the rowUpdated event. */ + onRowUpdated?: (e: { data: Object; key: any }) => void; + /** A handler for the rowUpdating event. */ + onRowUpdating?: (e: { oldData: Object; newData: Object; key: any; cancel: any }) => void; + /** Enables a hint that appears when a user hovers the mouse pointer over a cell with truncated content. */ + cellHintEnabled?: boolean; + /** Specifies whether or not grid columns can be reordered by a user. */ + allowColumnReordering?: boolean; + /** Specifies whether or not grid columns can be resized by a user. */ + allowColumnResizing?: boolean; + /** A handler for the cellClick event. */ + onCellClick?: any; + /** A handler for the cellHoverChanged event. */ + onCellHoverChanged?: (e: Object) => void; + /** A handler for the cellPrepared event. */ + onCellPrepared?: (e: Object) => void; + /** Specifies whether or not the width of grid columns depends on column content. */ + columnAutoWidth?: boolean; + /** Specifies the options of a column chooser. */ + columnChooser?: { + /** Specifies text displayed by the column chooser panel when it does not contain any columns. */ + emptyPanelText?: string; + /** Specifies whether a user can invoke the column chooser or not. */ + enabled?: boolean; + /** Specifies the height of the column chooser panel. */ + height?: number; + /** Specifies text displayed in the title of the column chooser panel. */ + title?: string; + /** Specifies the width of the column chooser panel. */ + width?: number; + }; + /** Specifies options for column fixing. */ + columnFixing?: { + /** Indicates if column fixing is enabled. */ + enabled?: boolean; + /** Contains options that specify texts for column-fixing related commands in the column header's context menu. */ + texts?: { + /** Specifies text for a context menu item that fixes the column for which the context menu is invoked. */ + fix?: string; + /** Specifies text for a context menu item that unfixes the column for which the context menu is invoked. */ + unfix?: string; + /** Specifies text for a context menu subitem that fixes a column, for which the context menu is invoked, to the left grid edge. */ + leftPosition?: string; + /** Specifies text for a context menu subitem that fixes a column, for which the context menu is invoked, to the right grid edge. */ + rightPosition?: string; + }; + }; + /** Specifies options for filtering using a column header filter. */ + headerFilter?: { + /** Indicates whether or not the column header filter button is visible. */ + visible?: boolean; + /** Specifies the height of the dropdown menu invoked when using a column header filter. */ + height?: number; + /** Specifies the width of the dropdown menu invoked when using a column header filter. */ + width?: number; + /** Contains options that specify texts for the dropdown menu invoked when you use a column header filter. */ + texts?: { + /** Specifies text for the item specifying an empty value in the column header filter's dropdown menu. */ + emptyValue?: string; + /** Specifies text for a button that closes the column header filter's dropdown menu and applies specified filtering. */ + ok?: string; + /** Specifies text for a button that closes the column header filter's dropdown menu without applying performed selection. */ + cancel?: string; + } + }; + /** An array of grid columns. */ + columns?: Array; + onContentReady?: Function; + /** Specifies a function that customizes grid columns after they are created. */ + customizeColumns?: (columns: Array) => void; + /** Specifies a data source for the grid. */ + dataSource?: any; + /** Specifies whether or not to enable data caching. */ + cacheEnabled?: boolean; + /** A handler for the editingStart event. */ + onEditingStart?: (e: { + data: Object; + key: any; + cancel: boolean; + column: dxDataGridColumn + }) => void; + /** A handler for the editorPrepared event. */ + onEditorPrepared?: (e: Object) => void; + /** A handler for the editorPreparing event. */ + onEditorPreparing?: (e: Object) => void; + /** Contains options that specify how grid content can be changed. */ + editing?: { + editMode?: string; + editEnabled?: boolean; + insertEnabled?: boolean; + removeEnabled?: boolean; + /** Specifies how grid values can be edited manually. */ + mode?: string; + /** Specifies whether or not grid records can be edited at runtime. */ + allowUpdating?: boolean; + /** Specifies whether or not new grid records can be added at runtime. */ + allowAdding?: boolean; + /** Specifies whether or not grid records can be deleted at runtime. */ + allowDeleting?: boolean; + /** The form configuration object. Used only when the editing mode is "form". */ + form?: DevExpress.ui.dxFormOptions; + /** Contains options that specify texts for editing-related grid controls. */ + texts?: { + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Save" button. Setting this option makes sense only when the editMode option is set to batch. */ + saveAllChanges?: string; + /** Specifies text for a cancel button displayed when a row is in the editing state. Setting this option makes sense only when the allowUpdating option is set to true. */ + cancelRowChanges?: string; + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Revert" button. Setting this option makes sense only when the editMode option is set to batch. */ + cancelAllChanges?: string; + /** Specifies a message to be displayed by a confirmation window. Setting this option makes sense only when the edit mode is "row". */ + confirmDeleteMessage?: string; + /** Specifies text to be displayed in the title of a confirmation window. Setting this option makes sense only when the edit mode is "row". */ + confirmDeleteTitle?: string; + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Cancel changes" button. Setting this option makes sense only when the editMode option is set to cell and the validation capabilities are enabled. */ + validationCancelChanges?: string; + /** Specifies text for a button that deletes a row from a grid. Setting this option makes sense only when the allowDeleting option is set to true. */ + deleteRow?: string; + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Add" button. Setting this option makes sense only when the allowAdding option is true. */ + addRow?: string; + /** Specifies text for a button that turns a row into the editing state. Setting this option makes sense only when the allowUpdating option is set to true. */ + editRow?: string; + /** Specifies text for a save button displayed when a row is in the editing state. Setting this option makes sense only when the allowUpdating option is set to true. */ + saveRowChanges?: string; + /** Specifies text for a button that recovers a deleted row. Setting this option makes sense only if the grid uses the batch edit mode and the allowDeleting option is set to true. */ + undeleteRow?: string; + }; + }; + /** Specifies filter row options. */ + filterRow?: { + /** Specifies when to apply a filter. */ + applyFilter?: string; + /** Specifies text for the hint that pops up when a user hovers the mouse pointer over the "Apply Filter" button. */ + applyFilterText?: string; + /** Specifies descriptions for filter operations. */ + operationDescriptions?: { + "=": string; + "<>": string; + "<": string; + "<=": string; + ">": string; + ">=": string; + "startswith": string; + "contains": string; + "notcontains": string; + "endswith": string; + }; + /** Specifies text for the reset operation in a filter list. */ + resetOperationText?: string; + /** Specifies text for the operation of clearing the applied filter when a select box is used. */ + showAllText?: string; + /** Specifies text for the range start in the 'between' filter type. */ + betweenStartText?: string; + /** Specifies text for the range end in the 'between' filter type. */ + betweenEndText?: string; + /** Specifies whether or not an icon that allows the user to choose a filter operation is visible. */ + showOperationChooser?: boolean; + /** Specifies whether the filter row is visible or not. */ + visible?: boolean; + }; + /** Specifies the behavior of grouped grid records. */ + grouping?: { + /** Specifies whether the user can collapse grouped records in a grid or not. */ + allowCollapsing?: boolean; + /** Specifies whether groups appear expanded or not. */ + autoExpandAll?: boolean; + /** Specifies the message displayed in a group row when the corresponding group is continued from the previous page. */ + groupContinuedMessage?: string; + /** Specifies the message displayed in a group row when the corresponding group continues on the next page. */ + groupContinuesMessage?: string; + }; + /** Specifies options that configure the group panel. */ + groupPanel?: { + /** Specifies whether columns can be dragged onto or from the group panel. */ + allowColumnDragging?: boolean; + /** Specifies text displayed by the group panel when it does not contain any columns. */ + emptyPanelText?: string; + /** Specifies whether the group panel is visible or not. */ + visible?: boolean; + }; + /** Specifies options configuring the load panel. */ + loadPanel?: { + /** Specifies whether to show the load panel or not. */ + enabled?: boolean; + /** Specifies the height of the load panel in pixels. */ + height?: number; + /** Specifies a URL pointing to an image to be used as a loading indicator. */ + indicatorSrc?: string; + /** Specifies whether or not a loading indicator must be displayed on the load panel. */ + showIndicator?: boolean; + /** Specifies whether or not the pane of the load panel must be displayed. */ + showPane?: boolean; + /** Specifies text displayed by the load panel. */ + text?: string; + /** Specifies the width of the load panel in pixels. */ + width?: number; + }; + /** Specifies text displayed when a grid does not contain any records. */ + noDataText?: string; + /** Specifies the options of a grid pager. */ + pager?: { + /** Specifies the page sizes that can be selected at runtime. */ + allowedPageSizes?: any; + /** Specifies whether to show the page size selector or not. */ + showPageSizeSelector?: boolean; + /** Specifies whether to show the pager or not. */ + visible?: any; + /** Specifies the text accompanying the page navigator. */ + infoText?: string; + /** Specifies whether or not to display the text accompanying the page navigator. This text is specified by the infoText option. */ + showInfo?: boolean; + /** Specifies whether or not to display buttons that switch the grid to the previous or next page. */ + showNavigationButtons?: boolean; + }; + /** Specifies paging options. */ + paging?: { + /** Specifies whether dxDataGrid loads data page by page or all at once. */ + enabled?: boolean; + /** Specifies the grid page that should be displayed by default. */ + pageIndex?: number; + /** Specifies the size of grid pages. */ + pageSize?: number; + }; + /** Specifies whether or not grid rows must be shaded in a different way. */ + rowAlternationEnabled?: boolean; + /** Specifies whether to enable two-way data binding. */ + twoWayBindingEnabled?: boolean; + /** A handler for the rowClick event. */ + onRowClick?: any; + /** A handler for the rowPrepared event. */ + onRowPrepared?: (e: Object) => void; + /** Specifies a custom template for grid rows. */ + rowTemplate?: any; + /** A configuration object specifying scrolling options. */ + scrolling?: { + /** Specifies the scrolling mode. */ + mode?: string; + /** Specifies whether or not a grid must preload pages adjacent to the current page when using virtual scrolling. */ + preloadEnabled?: boolean; + /** Specifies whether or not the widget uses native scrolling. */ + useNative?: any; + /** Specifies the scrollbar display policy. */ + showScrollbar?: string; + /** Specifies whether or not the scrolling by content is enabled. */ + scrollByContent?: boolean; + /** Specifies whether or not the scrollbar thumb scrolling enabled. */ + scrollByThumb?: boolean; + }; + /** Specifies options of the search panel. */ + searchPanel?: { + /** Specifies whether or not search strings in the located grid records should be highlighted. */ + highlightSearchText?: boolean; + /** Specifies text displayed by the search panel when no search string was typed. */ + placeholder?: string; + /** Specifies whether the search panel is visible or not. */ + visible?: boolean; + /** Specifies the width of the search panel in pixels. */ + width?: number; + /** Sets a search string for the search panel. */ + text?: string; + }; + /** Specifies the operations that must be performed on the server side. */ + remoteOperations?: any; + /** Allows you to sort groups according to the values of group summary items. */ + sortByGroupSummaryInfo?: Array<{ + /** Specifies the group summary item whose values must be used to sort groups. */ + summaryItem?: string; + /** Specifies the identifier of the column that must be used in grouping so that sorting by group summary item values be applied. */ + groupColumn?: string; + /** Specifies the sort order of group summary item values. */ + sortOrder?: string; + }>; + /** Allows you to build a master-detail interface in the grid. */ + masterDetail?: { + /** Enables an end-user to expand/collapse detail sections. */ + enabled?: boolean; + /** Specifies whether detail sections appear expanded or collapsed. */ + autoExpandAll?: boolean; + /** Specifies the template for detail sections. */ + template?: any; + }; + /** Specifies options for exporting grid data. */ + export?: { + /** Indicates if the export feature is enabled in the grid. */ + enabled?: boolean; + /** Specifies a default name for the file to which grid data is exported. */ + fileName?: string; + /** Specifies whether to enable Excel filtering for the exported data in the resulting XLSX file. */ + excelFilterEnabled?: boolean; + /** Specifies whether to enable word wrapping for the exported data in the resulting XLSX file. */ + excelWrapTextEnabled?: boolean; + /** Specifies the URL of the server-side proxy that streams the resulting file to the end user to enable export in IE8, IE9 and Safari browsers. */ + proxyUrl?: string; + /** Indicates whether to allow end users to export not only the data displayed in the grid, but the selected rows only. */ + allowExportSelectedData?: boolean; + /** Contains options that specify texts for the export-related commands and hints. */ + texts?: { + /** Specifies text for the Export button when this button invokes a dropdown menu so you can choose the required export format. */ + exportTo?: string; + /** Specifies text for the Export button's hint when this button exports to the XSLX format without invoking the drop-down menu. */ + exportToExcel?: string; + /** Specifies text for the item in the Export dropdown menu that exports grid data to Excel. */ + excelFormat?: string; + /** Specifies text for the option in the Export dropdown menu that allows you to choose whether to export all the grid data or the selected rows only. */ + selectedRows?: string; + } + }; + /** Specifies the keys of the records that must appear selected initially. */ + selectedRowKeys?: Array; + /** Specifies options of runtime selection. */ + selection?: { + /** Specifies the checkbox row display policy in the multiple mode. */ + showCheckBoxesMode?: string; + /** Specifies whether the user can select all grid records at once. */ + allowSelectAll?: boolean; + /** Specifies the selection mode. */ + mode?: string; + }; + /** A handler for the dataErrorOccured event. */ + onDataErrorOccurred?: (e: { error: Error }) => void; + /** A handler for the selectionChanged event. */ + onSelectionChanged?: (e: { + currentSelectedRowKeys: Array; + currentDeselectedRowKeys: Array; + selectedRowKeys: Array; + selectedRowsData: Array; + }) => void; + /** A handler for the exporting event. */ + onExporting?: (e: { + fileName: string; + cancel: boolean; + }) => void; + /** A handler for the fileSaving event. */ + onFileSaving?: (e: { + fileName: string; + format: string; + data: any; + cancel: boolean; + }) => void; + /** A handler for the exported event. */ + onExported?: (e: Object) => void; + /** A handler for the keyDown event. */ + onKeyDown?: (e: Object) => void; + /** A handler for the rowExpanding event. */ + onRowExpanding?: (e: Object) => void; + /** A handler for the rowExpanded event. */ + onRowExpanded?: (e: Object) => void; + /** A handler for the rowCollapsing event. */ + onRowCollapsing?: (e: Object) => void; + /** A handler for the rowCollapsed event. */ + onRowCollapsed?: (e: Object) => void; + /** Specifies whether column headers are visible or not. */ + showColumnHeaders?: boolean; + /** Specifies whether or not vertical lines separating one grid column from another are visible. */ + showColumnLines?: boolean; + /** Specifies whether or not horizontal lines separating one grid row from another are visible. */ + showRowLines?: boolean; + /** Specifies options of runtime sorting. */ + sorting?: { + /** Specifies text for the context menu item that sets an ascending sort order in a column. */ + ascendingText?: string; + /** Specifies text for the context menu item that resets sorting settings for a column. */ + clearText?: string; + /** Specifies text for the context menu item that sets a descending sort order in a column. */ + descendingText?: string; + /** Specifies the runtime sorting mode. */ + mode?: string; + }; + /** Specifies options of state storing. */ + stateStoring?: { + /** Specifies a callback function that performs specific actions on state loading. */ + customLoad?: () => JQueryPromise; + /** Specifies a callback function that performs specific actions on state saving. */ + customSave?: (state: Object) => void; + /** Specifies whether or not a grid saves its state. */ + enabled?: boolean; + /** Specifies the delay between the last change of a grid state and the operation of saving this state in milliseconds. */ + savingTimeout?: number; + /** Specifies a unique key to be used for storing the grid state. */ + storageKey?: string; + /** Specifies the type of storage to be used for state storing. */ + type?: string; + }; + /** Specifies the options of the grid summary. */ + summary?: { + /** Contains options that specify text patterns for summary items. */ + texts?: { + /** Specifies a pattern for the 'sum' summary items when they are displayed in the parent column. */ + sum?: string; + /** Specifies a pattern for the 'sum' summary items displayed in a group row or in any other column rather than the parent one. */ + sumOtherColumn?: string; + /** Specifies a pattern for the 'min' summary items when they are displayed in the parent column. */ + min?: string; + /** Specifies a pattern for the 'min' summary items displayed in a group row or in any other column rather than the parent one. */ + minOtherColumn?: string; + /** Specifies a pattern for the 'max' summary items when they are displayed in the parent column. */ + max?: string; + /** Specifies a pattern for the 'max' summary items displayed in a group row or in any other column rather than the parent one. */ + maxOtherColumn?: string; + /** Specifies a pattern for the 'avg' summary items when they are displayed in the parent column. */ + avg?: string; + /** Specifies a pattern for the 'avg' summary items displayed in a group row or in any other column rather than the parent one. */ + avgOtherColumn?: string; + /** Specifies a pattern for the 'count' summary items. */ + count?: string; + }; + /** Specifies items of the group summary. */ + groupItems?: Array<{ + /** Specifies the identifier of a summary item. */ + name?: string; + /** Specifies the column that provides data for a group summary item. */ + column?: string; + /** Customizes the text to be displayed in the summary item. */ + customizeText?: (itemInfo: { + value: any; + valueText: string; + }) => string; + /** Specifies a pattern for the summary item text. */ + displayFormat?: string; + /** Specifies a precision for the summary item value of a numeric format. */ + precision?: number; + /** Specifies whether or not a summary item must be displayed in the group footer. */ + showInGroupFooter?: boolean; + /** Indicates whether to display group summary items in parentheses after the group row header or to align them by the corresponding columns within the group row. */ + alignByColumn?: boolean; + /** Specifies the column that must hold the summary item when this item is displayed in the group footer or aligned by a column in the group row. */ + showInColumn?: string; + /** Specifies how to aggregate data for a summary item. */ + summaryType?: string; + /** Specifies a format for the summary item value. */ + valueFormat?: string; + /** Specifies whether or not to skip empty strings, null and undefined values when calculating a summary. */ + skipEmptyValues?: boolean; + }>; + /** Specifies items of the total summary. */ + totalItems?: Array<{ + /** Specifies the identifier of a summary item. */ + name?: string; + /** Specifies the alignment of a summary item. */ + alignment?: string; + /** Specifies the column that provides data for a summary item. */ + column?: string; + /** Specifies a CSS class to be applied to a summary item. */ + cssClass?: string; + /** Customizes the text to be displayed in the summary item. */ + customizeText?: (itemInfo: { + value: any; + valueText: string; + }) => string; + /** Specifies a pattern for the summary item text. */ + displayFormat?: string; + /** Specifies a precision for the summary item value of a numeric format. */ + precision?: number; + /** Specifies the column that must hold the summary item. */ + showInColumn?: string; + /** Specifies how to aggregate data for a summary item. */ + summaryType?: string; + /** Specifies a format for the summary item value. */ + valueFormat?: string; + /** Specifies whether or not to skip empty strings, null and undefined values when calculating a summary. */ + skipEmptyValues?: boolean; + }>; + /** Specifies whether or not to skip empty strings, null and undefined values when calculating a summary. */ + skipEmptyValues?: boolean; + /** Allows you to use a custom aggregate function to calculate the value of a summary item. */ + calculateCustomSummary?: (options: { + component: dxDataGrid; + name?: string; + value: any; + totalValue: any; + summaryProcess: string + }) => void; + }; + /** Specifies whether text that does not fit into a column should be wrapped. */ + wordWrapEnabled?: boolean; + } + /** A data grid widget. */ + export class dxDataGrid extends Widget { + constructor(element: JQuery, options?: dxDataGridOptions); + constructor(element: Element, options?: dxDataGridOptions); + /** Ungroups grid records. */ + clearGrouping(): void; + /** Clears sorting settings of all grid columns at once. */ + clearSorting(): void; + /** Allows you to obtain a cell by its row index and the data field of its column. */ + getCellElement(rowIndex: number, dataField: string): any; + /** Allows you to obtain a cell by its row index and the visible index of its column. */ + getCellElement(rowIndex: number, visibleColumnIndex: number): any; + /** Returns the current state of the grid. */ + state(): Object; + /** Sets the grid state. */ + state(state: Object): void; + /** Allows you to obtain the row index by a data key. */ + getRowIndexByKey(key: any): number; + /** Allows you to obtain the data key by a row index. */ + getKeyByRowIndex(rowIndex: number): any; + /** Adds a new column to a grid. */ + addColumn(columnOptions: dxDataGridColumn): void; + /** Removes the column from the grid. */ + deleteColumn(id: any): void; + /** Displays the load panel. */ + beginCustomLoading(messageText: string): void; + /** Discards changes made in a grid. */ + cancelEditData(): void; + /** Checks whether or not the grid contains unsaved changes. */ + hasEditData(): boolean; + /** Clears all the filters of a specific type applied to grid records. */ + clearFilter(): void; + /** Deselects all grid records. */ + clearSelection(): void; + /** Draws the cell being edited from the editing state. Use this method when the edit mode is batch. */ + closeEditCell(): void; + /** Collapses groups or master rows in a grid. */ + collapseAll(groupIndex?: number): void; + /** Returns the number of data columns in a grid. */ + columnCount(): number; + /** Returns the value of a specific column option. */ + columnOption(id: any, optionName: string): any; + /** Sets an option of a specific column. */ + columnOption(id: any, optionName: string, optionValue: any): void; + /** Returns the options of a column by an identifier. */ + columnOption(id: any): Object; + /** Sets several options of a column at once. */ + columnOption(id: any, options: Object): void; + /** Sets a specific cell into the editing state. */ + editCell(rowIndex: number, visibleColumnIndex: number): void; + /** Sets a specific cell into the editing state. */ + editCell(rowIndex: number, dataField: string): void; + /** Sets a specific row into the editing state. */ + editRow(rowIndex: number): void; + /** Gets the cell value. */ + cellValue(rowIndex: number, dataField: string): any; + /** Gets the cell value. */ + cellValue(rowIndex: number, visibleColumnIndex: number): any; + /** Sets the cell value. */ + cellValue(rowIndex: number, dataField: string, value: any): void; + /** Sets the cell value. */ + cellValue(rowIndex: number, visibleColumnIndex: number, value: any): void; + /** Hides the load panel. */ + endCustomLoading(): void; + /** Expands groups or master rows in a grid. */ + expandAll(groupIndex: number): void; + /** Allows you to find out whether a specific group or master row is expanded or collapsed. */ + isRowExpanded(key: any): boolean; + /** Allows you to expand a specific group or master row by its key. */ + expandRow(key: any): void; + /** Allows you to collapse a specific group or master row by its key. */ + collapseRow(key: any): void; + /** Applies a filter to the grid's data source. */ + filter(filterExpr?: any): void; + /** Returns a filter expression applied to the grid's data source using the filter(filterExpr) method. */ + filter(): any; + /** Returns a filter expression applied to the grid using all possible scenarious. */ + getCombinedFilter(): any; + /** Gets the keys of currently selected grid records. */ + getSelectedRowKeys(): Array; + /** Gets the data objects of currently selected grid records. */ + getSelectedRowsData(): Array; + /** Hides the column chooser panel. */ + hideColumnChooser(): void; + /** Adds a new data row to a grid. */ + addRow(): void; + /** + * Adds a new data row to a grid. + * @deprecated Use the addRow() method instead. + */ + insertRow(): void; + /** Returns the key corresponding to the passed data object. */ + keyOf(obj: Object): any; + /** Switches a grid to a specified page. */ + pageIndex(newIndex: number): void; + /** Gets the index of the current page. */ + pageIndex(): number; + /** Sets the page size. */ + pageSize(value: number): void; + /** Gets the current page size. */ + pageSize(): number; + /** Refreshes grid data. */ + refresh(): void; + /** Removes a specific row from a grid. */ + deleteRow(rowIndex: number): void; + /** + * Removes a specific row from a grid. + * @deprecated Use the deleteRow() method instead. + */ + removeRow(rowIndex: number): void; + /** Saves changes made in a grid. */ + saveEditData(): void; + /** Searches grid records by a search string. */ + searchByText(text: string): void; + /** Selects all grid records. */ + selectAll(): void; + /** Deselects the rows that are currently selected within the applied filter. */ + deselectAll(): void; + /** Selects specific grid records. */ + selectRows(keys: Array, preserve: boolean): void; + /** Deselects specific grid records. */ + deselectRows(keys: Array): void; + /** Selects grid rows by indexes. */ + selectRowsByIndexes(indexes: Array): void; + /** Allows you to find out whether a row is selected or not. */ + isRowSelected(key: any): boolean; + /** Invokes the column chooser panel. */ + showColumnChooser(): void; + startSelectionWithCheckboxes(): boolean; + /** Returns the number of records currently held by a grid. */ + totalCount(): number; + /** Recovers a row deleted in the batch edit mode. */ + undeleteRow(rowIndex: number): void; + /** Allows you to obtain a data object by its key. */ + byKey(key: any): JQueryPromise; + /** Gets the value of a total summary item. */ + getTotalSummaryValue(summaryItemName: string): any; + /** Exports grid data to Excel. */ + exportToExcel(selectionOnly: boolean): void; + /** Updates the grid to the size of its content. */ + updateDimensions(): void; + /** Focuses the specified cell element in the grid. */ + focus(element?: JQuery): void; + } + export interface dxPivotGridOptions extends WidgetOptions { + onContentReady?: Function; + /** Specifies a data source for the pivot grid. */ + dataSource?: any; + useNativeScrolling?: any; + /** A configuration object specifying scrolling options. */ + scrolling?: { + /** Specifies the scrolling mode. */ + mode?: string; + /** Specifies whether or not the widget uses native scrolling. */ + useNative?: any; + }; + /** Allows an end-user to change sorting options. */ + allowSorting?: boolean; + /** Allows an end-user to sort columns by summary values. */ + allowSortingBySummary?: boolean; + /** Allows an end-user to change filtering options. */ + allowFiltering?: boolean; + /** Allows an end-user to expand/collapse all header items within a header level. */ + allowExpandAll?: boolean; + /** Specifies whether to display the Total rows. */ + showRowTotals?: boolean; + /** Specifies whether to display the Grand Total row. */ + showRowGrandTotals?: boolean; + /** Specifies whether to display the Total columns. */ + showColumnTotals?: boolean; + /** Specifies whether to display the Grand Total column. */ + showColumnGrandTotals?: boolean; + /** Specifies whether or not to hide rows and columns with no data. */ + hideEmptySummaryCells?: boolean; + /** Specifies where to show the total rows or columns. */ + showTotalsPrior?: string; + /** Specifies whether the outer borders of the grid are visible or not. */ + showBorders?: boolean; + /** The Field Chooser configuration options. */ + fieldChooser?: { + /** Enables or disables the field chooser. */ + enabled?: boolean; + /** Specifies the field chooser layout. */ + layout?: number; + /** Specifies the text to display as a title of the field chooser popup window. */ + title?: string; + /** Specifies the field chooser width. */ + width?: number; + /** Specifies the field chooser height. */ + height?: number; + /** Strings that can be changed or localized in the pivot grid's integrated Field Chooser. */ + texts?: { + /** The string to display instead of Row Fields. */ + rowFields?: string; + /** The string to display instead of Column Fields. */ + columnFields?: string; + /** The string to display instead of Data Fields. */ + dataFields?: string; + /** The string to display instead of Filter Fields. */ + filterFields?: string; + /** The string to display instead of All Fields. */ + allFields?: string; + }; + } + /** Strings that can be changed or localized in the dxPivotGrid widget. */ + texts?: { + /** The string to display as a header of the Grand Total row and column. */ + grandTotal?: string; + /** The string to display as a header of the Total row and column. */ + total?: string; + /** Specifies the text displayed when a pivot grid does not contain any fields. */ + noData?: string; + /** The string to display as a Show Field Chooser context menu item. */ + showFieldChooser?: string; + /** The string to display as an Expand All context menu item. */ + expandAll?: string; + /** The string to display as a Collapse All context menu item. */ + collapseAll?: string; + /** The string to display as a Sort Column by Summary Value context menu item. */ + sortColumnBySummary?: string; + /** The string to display as a Sort Row by Summary Value context menu item. */ + sortRowBySummary?: string; + /** The string to display as a Remove All Sorting context menu item. */ + removeAllSorting?: string; + /** The string to display as an Export to Excel file context menu item. */ + exportToExcel?: string; + }; + /** Specifies options configuring the load panel. */ + loadPanel?: { + /** Enables or disables the load panel. */ + enabled?: boolean; + /** Specifies the height of the load panel. */ + height?: number; + /** Specifies the URL pointing to an image that will be used as a load indicator. */ + indicatorSrc?: string; + /** Specifies whether or not to show a load indicator. */ + showIndicator?: boolean; + /** Specifies whether or not to show load panel background. */ + showPane?: boolean; + /** Specifies the text to display inside a load panel. */ + text?: string; + /** Specifies the width of the load panel. */ + width?: number; + }; + /** A handler for the cellClick event. */ + onCellClick?: (e: any) => void; + /** A handler for the cellPrepared event. */ + onCellPrepared?: (e: any) => void; + /** A handler for the contextMenuPreparing event. */ + onContextMenuPreparing?: (e: Object) => void; + /** Specifies options for exporting pivot grid data. */ + export?: { + /** Indicates whether the export feature is enabled for the pivot grid. */ + enabled?: boolean; + /** Specifies a default name for the file to which grid data is exported. */ + fileName?: string; + /** Specifies the URL of the server-side proxy that streams the resulting file to the end user to enable export in IE8, IE9 and Safari browsers. */ + proxyUrl?: string; + }; + /** A handler for the exporting event. */ + onExporting?: (e: { + fileName: string; + cancel: boolean; + }) => void; + /** A handler for the fileSaving event. */ + onFileSaving?: (e: { + fileName: string; + format: string; + data: any; + cancel: boolean; + }) => void; + /** A handler for the exported event. */ + onExported?: (e: Object) => void; + /** A configuration object specifying options related to state storing. */ + stateStoring?: { + /** Specifies a callback function that performs specific actions on state loading. */ + customLoad?: () => JQueryPromise; + /** Specifies a callback function that performs specific actions on state saving. */ + customSave?: (gridState: Object) => void; + /** Specifies whether or not a grid saves its state. */ + enabled?: boolean; + /** Specifies the delay between the last change of a grid state and the operation of saving this state in milliseconds. */ + savingTimeout?: number; + /** Specifies a unique key to be used for storing the grid state. */ + storageKey?: string; + /** Specifies the type of storage to be used for state storing. */ + type?: string; + }; + } + /** A data summarization widget for multi-dimensional data analysis and data mining. */ + export class dxPivotGrid extends Widget { + constructor(element: JQuery, options?: dxPivotGridOptions); + constructor(element: Element, options?: dxPivotGridOptions); + /** Gets the PivotGridDataSource instance. */ + getDataSource(): DevExpress.data.PivotGridDataSource; + /** Gets the dxPopup instance of the field chooser window. */ + getFieldChooserPopup(): DevExpress.ui.dxPopup; + /** Updates the widget to the size of its content. */ + updateDimensions(): void; + /** Exports pivot grid data to the Excel file. */ + exportToExcel(): void; + } + export interface dxPivotGridFieldChooserOptions extends WidgetOptions { + /** Specifies the height of the widget. */ + height?: any; + /** Specifies the field chooser layout. */ + layout?: number; + /** The data source of a dxPivotGrid widget. */ + dataSource?: DevExpress.data.PivotGridDataSource; + onContentReady?: Function; + /** Strings that can be changed or localized in the dxPivotGridFieldChooser widget. */ + texts?: { + /** The string to display instead of Row Fields. */ + rowFields?: string; + /** The string to display instead of Column Fields. */ + columnFields?: string; + /** The string to display instead of Data Fields. */ + dataFields?: string; + /** The string to display instead of Filter Fields. */ + filterFields?: string; + /** The string to display instead of All Fields. */ + allFields?: string; + }; + } + /** A complementary widget for dxPivotGrid that allows you to manage data displayed in the dxPivotGrid. */ + export class dxPivotGridFieldChooser extends Widget { + constructor(element: JQuery, options?: dxPivotGridFieldChooserOptions); + constructor(element: Element, options?: dxPivotGridFieldChooserOptions); + /** Updates the widget to the size of its content. */ + updateDimensions(): void; + } +} +interface JQuery { + dxTreeView(): JQuery; + dxTreeView(options: "instance"): DevExpress.ui.dxTreeView; + dxTreeView(options: string): any; + dxTreeView(options: string, ...params: any[]): any; + dxTreeView(options: DevExpress.ui.dxTreeViewOptions): JQuery; + dxMenuBase(): JQuery; + dxMenuBase(options: "instance"): DevExpress.ui.dxMenuBase; + dxMenuBase(options: string): any; + dxMenuBase(options: string, ...params: any[]): any; + dxMenuBase(options: DevExpress.ui.dxMenuBaseOptions): JQuery; + dxMenu(): JQuery; + dxMenu(options: "instance"): DevExpress.ui.dxMenu; + dxMenu(options: string): any; + dxMenu(options: string, ...params: any[]): any; + dxMenu(options: DevExpress.ui.dxMenuOptions): JQuery; + dxContextMenu(): JQuery; + dxContextMenu(options: "instance"): DevExpress.ui.dxContextMenu; + dxContextMenu(options: string): any; + dxContextMenu(options: string, ...params: any[]): any; + dxContextMenu(options: DevExpress.ui.dxContextMenuOptions): JQuery; + dxColorBox(): JQuery; + dxColorBox(options: "instance"): DevExpress.ui.dxColorBox; + dxColorBox(options: string): any; + dxColorBox(options: string, ...params: any[]): any; + dxColorBox(options: DevExpress.ui.dxColorBoxOptions): JQuery; + dxDataGrid(): JQuery; + dxDataGrid(options: "instance"): DevExpress.ui.dxDataGrid; + dxDataGrid(options: string): any; + dxDataGrid(options: string, ...params: any[]): any; + dxDataGrid(options: DevExpress.ui.dxDataGridOptions): JQuery; + dxPivotGrid(): JQuery; + dxPivotGrid(options: "instance"): DevExpress.ui.dxPivotGrid; + dxPivotGrid(options: string): any; + dxPivotGrid(options: string, ...params: any[]): any; + dxPivotGrid(options: DevExpress.ui.dxPivotGridOptions): JQuery; + dxPivotGridFieldChooser(): JQuery; + dxPivotGridFieldChooser(options: "instance"): DevExpress.ui.dxPivotGridFieldChooser; + dxPivotGridFieldChooser(options: string): any; + dxPivotGridFieldChooser(options: string, ...params: any[]): any; + dxPivotGridFieldChooser(options: DevExpress.ui.dxPivotGridFieldChooserOptions): JQuery; + dxScheduler(): JQuery; + dxScheduler(options: "instance"): DevExpress.ui.dxScheduler; + dxScheduler(options: string): any; + dxScheduler(options: string, ...params: any[]): any; + dxScheduler(options: DevExpress.ui.dxSchedulerOptions): JQuery; +} +declare module DevExpress.framework { + /** An object used to store information on the views displayed in an application. */ + export class ViewCache { + viewRemoved: JQueryCallback; + /** Removes all the viewInfo objects from the cache. */ + clear(): void; + /** Obtains a viewInfo object from the cache by the specified key. */ + getView(key: string): Object; + /** Checks whether or not a viewInfo object is contained in the view cache under the specified key. */ + hasView(key: string): boolean; + /** Removes a viewInfo object from the cache by the specified key. */ + removeView(key: string): Object; + /** Adds the specified viewInfo object to the cache under the specified key. */ + setView(key: string, viewInfo: Object): void; + } + export interface dxCommandOptions extends DOMComponentOptions { + /** Specifies an action performed when the execute() method of the command is called. */ + onExecute?: any; + /** Indicates whether or not the widget that displays this command is disabled. */ + disabled?: boolean; + /** Specifies whether the current command is rendered when a view is being rendered or after a view is shown. */ + renderStage?: string; + /** Specifies the name of the icon shown inside the widget associated with this command. */ + icon?: string; + iconSrc?: string; + /** The identifier of the command. */ + id?: string; + /** Specifies the title of the widget associated with this command. */ + title?: string; + /** Specifies the type of the button, if the command is rendered as a dxButton widget. */ + type?: string; + /** A Boolean value specifying whether or not the widget associated with this command is visible. */ + visible?: boolean; + } + /** A markup component used to define markup options for a command. */ + export class dxCommand extends DOMComponent { + constructor(element: JQuery, options: dxCommandOptions); + constructor(options: dxCommandOptions); + /** Executes the action associated with this command. */ + execute(): void; + } + /** An object responsible for routing. */ + export class Router { + /** Adds a routing rule to the list of registered rules. */ + register(pattern: string, defaults?: Object, constraints?: Object): void; + /** Decodes the specified URI to an object using the registered routing rules. */ + parse(uri: string): Object; + /** Formats an object to a URI. */ + format(obj: Object): string; + } + export interface StateManagerOptions { + /** A storage to which the state manager saves the application state. */ + storage?: Object; + } + /** An object used to store the current application state. */ + export class StateManager { + constructor(options?: StateManagerOptions); + /** Adds an object that implements an interface of a state source to the state manager's collection of state sources. */ + addStateSource(stateSource: Object): void; + /** Removes a specified state source from the state manager's collection of state sources. */ + removeStateSource(stateSource: Object): void; + /** Saves the current application state. */ + saveState(): void; + /** Restores the application state that has been saved by the saveState() method to the state storage. */ + restoreState(): void; + /** Removes the application state that has been saved by the saveState() method to the state storage. */ + clearState(): void; + } + export module html { + export var layoutSets: Array; + export var animationSets: { [animationSetName: string]: AnimationSet }; + export interface AnimationSet { + [animationName: string]: any + } + export interface HtmlApplicationOptions { + /** Specifies where the commands that are defined in the application's views must be displayed. */ + commandMapping?: Object; + /** Specifies whether or not view caching is disabled. */ + disableViewCache?: boolean; + /** An array of layout controllers that should be used to show application views in the current navigation context. */ + layoutSet?: any; + /** Specifies the animation presets that are used to animate different UI elements in the current application. */ + animationSet?: AnimationSet; + /** Specifies whether the current application must behave as a mobile or web application. */ + mode?: string; + /** Specifies the object that represents a root namespace of the application. */ + namespace?: Object; + /** Specifies application behavior when the user navigates to a root view. */ + navigateToRootViewMode?: string; + /** An array of dxCommand configuration objects used to define commands available from the application's global navigation. */ + navigation?: Array; + /** A state manager to be used in the application. */ + stateManager?: StateManager; + /** Specifies the storage to be used by the application's state manager to store the application state. */ + stateStorage?: Object; + /** Indicates whether on not to use the title of the previously displayed view as text on the Back button. */ + useViewTitleAsBackText?: boolean; + /** A custom view cache to be used in the application. */ + viewCache?: Object; + /** Specifies a limit for the views that can be cached. */ + viewCacheSize?: number; + /** Specifies the current version of application templates. */ + templatesVersion?: string; + /** Specifies options for the viewport meta tag of a mobile browser. */ + viewPort?: JQuery; + /** A custom router to be used in the application. */ + router?: Router; + } + /** An object used to manage views, as well as control the application life cycle. */ + export class HtmlApplication implements EventsMixin { + constructor(options: HtmlApplicationOptions); + afterViewSetup: JQueryCallback; + beforeViewSetup: JQueryCallback; + initialized: JQueryCallback; + navigating: JQueryCallback; + navigatingBack: JQueryCallback; + resolveLayoutController: JQueryCallback; + resolveViewCacheKey: JQueryCallback; + viewDisposed: JQueryCallback; + viewDisposing: JQueryCallback; + viewHidden: JQueryCallback; + viewRendered: JQueryCallback; + viewShowing: JQueryCallback; + viewShown: JQueryCallback; + /** Provides access to the ViewCache object. */ + viewCache: ViewCache; + /** An array of dxCommand components that are created based on the application's navigation option value. */ + navigation: Array; + /** Provides access to the StateManager object. */ + stateManager: StateManager; + /** Provides access to the Router object. */ + router: Router; + /** Navigates to the URI preceding the current one in the navigation history. */ + back(): void; + /** Returns a Boolean value indicating whether or not backwards navigation is currently possible. */ + canBack(): boolean; + /** Calls the clearState() method of the application's StateManager object. */ + clearState(): void; + /** Creates global navigation commands. */ + createNavigation(navigationConfig: Array): void; + /** Returns an HTML template of the specified view. */ + getViewTemplate(viewName: string): JQuery; + /** Returns a configuration object used to create a dxView component for a specified view. */ + getViewTemplateInfo(viewName: string): Object; + /** Adds a specified HTML template to a collection of view or layout templates. */ + loadTemplates(source: any): JQueryPromise; + /** Navigates to the specified URI. */ + navigate(uri?: any, options?: Object): void; + /** Renders navigation commands to the navigation command containers that are located in the layouts used in the application. */ + renderNavigation(): void; + /** Calls the restoreState() method of the application's StateManager object. */ + restoreState(): void; + /** Calls the saveState method of the application's StateManager object. */ + saveState(): void; + /** Provides access to the object that defines the current context to be considered when choosing an appropriate template for a view. */ + templateContext(): Object; + on(eventName: "initialized", eventHandler: () => void): HtmlApplication; + on(eventName: "afterViewSetup", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "beforeViewSetup", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "navigating", eventHandler: (e: { + currentUri: string; + uri: string; + cancel: boolean; + options: { + root: boolean; + target: string; + direction: string; + rootInDetailPane: boolean; + modal: boolean; + }; + }) => void): HtmlApplication; + on(eventName: "navigatingBack", eventHandler: (e: { + cancel: boolean; + isHardwareButton: boolean; + }) => void): HtmlApplication; + on(eventName: "resolveLayoutController", eventHandler: (e: { + viewInfo: Object; + layoutController: Object; + availableLayoutControllers: Array; + }) => void): HtmlApplication; + on(eventName: "resolveViewCacheKey", eventHandler: (e: { + key: string; + navigationItem: Object; + routeData: Object; + }) => void): HtmlApplication; + on(eventName: "viewDisposed", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "viewDisposing", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "viewHidden", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "viewRendered", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "viewShowing", eventHandler: (e: { + viewInfo: Object; + direction: string; + }) => void): HtmlApplication; + on(eventName: "viewShown", eventHandler: (e: { + viewInfo: Object; + direction: string; + }) => void): HtmlApplication; + on(eventName: string, eventHandler: Function): HtmlApplication; + on(events: { [eventName: string]: Function; }): HtmlApplication; + off(eventName: "initialized"): HtmlApplication; + off(eventName: "afterViewSetup"): HtmlApplication; + off(eventName: "beforeViewSetup"): HtmlApplication; + off(eventName: "navigating"): HtmlApplication; + off(eventName: "navigatingBack"): HtmlApplication; + off(eventName: "resolveLayoutController"): HtmlApplication; + off(eventName: "resolveViewCacheKey"): HtmlApplication; + off(eventName: "viewDisposed"): HtmlApplication; + off(eventName: "viewDisposing"): HtmlApplication; + off(eventName: "viewHidden"): HtmlApplication; + off(eventName: "viewRendered"): HtmlApplication; + off(eventName: "viewShowing"): HtmlApplication; + off(eventName: "viewShown"): HtmlApplication; + off(eventName: string): HtmlApplication; + off(eventName: "initialized", eventHandler: () => void): HtmlApplication; + off(eventName: "afterViewSetup", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "beforeViewSetup", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "navigating", eventHandler: (e: { + currentUri: string; + uri: string; + cancel: boolean; + options: { + root: boolean; + target: string; + direction: string; + rootInDetailPane: boolean; + modal: boolean; + }; + }) => void): HtmlApplication; + off(eventName: "navigatingBack", eventHandler: (e: { + cancel: boolean; + isHardwareButton: boolean; + }) => void): HtmlApplication; + off(eventName: "resolveLayoutController", eventHandler: (e: { + viewInfo: Object; + layoutController: Object; + availableLayoutControllers: Array; + }) => void): HtmlApplication; + off(eventName: "resolveViewCacheKey", eventHandler: (e: { + key: string; + navigationItem: Object; + routeData: Object; + }) => void): HtmlApplication; + off(eventName: "viewDisposed", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "viewDisposing", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "viewHidden", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "viewRendered", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "viewShowing", eventHandler: (e: { + viewInfo: Object; + direction: string; + }) => void): HtmlApplication; + off(eventName: "viewShown", eventHandler: (e: { + viewInfo: Object; + direction: string; + }) => void): HtmlApplication; + off(eventName: string, eventHandler: Function): HtmlApplication; + } + } +} +declare module DevExpress.viz.core { + /** + * Applies a theme for the entire page with several DevExtreme visualization widgets. + * @deprecated Use the DevExpress.viz.currentTheme(theme) method instead. + */ + export function currentTheme(theme: string): void; + /** + * Applies a new theme (with the color scheme defined separately) for the entire page with several DevExtreme visualization widgets. + * @deprecated Use the DevExpress.viz.currentTheme(platform, colorScheme) method instead. + */ + export function currentTheme(platform: string, colorScheme: string): void; + /** + * Registers a new theme based on the existing one. + * @deprecated Use the DevExpress.viz.registerTheme(customTheme, baseTheme) method instead. + */ + export function registerTheme(customTheme: Object, baseTheme: string): void; + /** + * Applies a predefined or registered custom palette to all visualization widgets at once. + * @deprecated Use the DevExpress.viz.currentPalette(paletteName) method instead. + */ + export function currentPalette(paletteName: string): void; + /** + * Obtains the color sets of a predefined or registered palette. + * @deprecated Use the DevExpress.viz.getPalette(paletteName) method instead. + */ + export function getPalette(paletteName: string): Object; + /** + * Registers a new palette. + * @deprecated Use the DevExpress.viz.registerPalette(paletteName, palette) method instead. + */ + export function registerPalette(paletteName: string, palette: Object): void; + export interface Border { + /** Sets a border color for a selected series. */ + color?: string; + /** Sets border visibility for a selected series. */ + visible?: boolean; + /** Sets a border width for a selected series. */ + width?: number; + } + export interface DashedBorder extends Border { + /** Specifies a dash style for the border of a selected series point. */ + dashStyle?: string; + } + export interface DashedBorderWithOpacity extends DashedBorder { + /** Specifies the opacity of the tooltip's border. */ + opacity?: number; + } + export interface Font { + /** Specifies the font color for a strip label. */ + color?: string; + /** Specifies the font family for a strip label. */ + family?: string; + /** Specifies the font opacity for a strip label. */ + opacity?: number; + /** Specifies the font size for a strip label. */ + size?: any; + /** Specifies the font weight for the text displayed in strips. */ + weight?: number; + } + export interface Hatching { + direction?: string; + /** Specifies the opacity of hatching lines. */ + opacity?: number; + /** Specifies the distance between hatching lines in pixels. */ + step?: number; + /** Specifies the width of hatching lines in pixels. */ + width?: number; + } + export interface Margins { + /** Specifies the distance in pixels between the bottom side of the title and the surrounding widget elements. */ + bottom?: number; + /** Specifies the distance in pixels between the left side of the title and the surrounding widget elements. */ + left?: number; + /** Specifies the distance between the right side of the title and surrounding widget elements in pixels. */ + right?: number; + /** Specifies the distance between the top side of the title and surrounding widget elements in pixels. */ + top?: number; + } + export interface Size { + /** Specifies the width of the widget. */ + width?: number; + /** Specifies the height of the widget. */ + height?: number; + } + export interface Title { + /** Specifies font options for the title. */ + font?: viz.core.Font; + /** Specifies the widget title's horizontal position. */ + horizontalAlignment?: string; + /** Specifies the widget title's position in the vertical direction. */ + verticalAlignment?: string; + /** Specifies the distance between the title and surrounding widget elements in pixels. */ + margin?: viz.core.Margins; + /** Specifies the height of the space reserved for the title. */ + placeholderSize?: number; + /** Specifies text for the title. */ + text?: string; + /** Specifies a subtitle for the widget. */ + subtitle?: { + /** Specifies font options for the subtitle. */ + font?: viz.core.Font; + /** Specifies text for the subtitle. */ + text?: string; + } + } + export interface Tooltip { + /** Specifies the length of the tooltip's arrow in pixels. */ + arrowLength?: number; + /** Specifies the appearance of the tooltip's border. */ + border?: viz.core.DashedBorderWithOpacity; + /** Specifies a color for the tooltip. */ + color?: string; + /** Specifies the z-index for tooltips. */ + zIndex?: number; + /** Specifies the container to draw tooltips inside of it. */ + container?: any; + /** Specifies text and appearance of a set of tooltips. */ + customizeTooltip?: (arg: Object) => { color?: string; text?: string }; + /** Specifies whether or not the tooltip is enabled. */ + enabled?: boolean; + /** Specifies font options for the text displayed by the tooltip. */ + font?: Font; + /** Specifies a format for the text displayed by the tooltip. */ + format?: string; + /** Specifies the opacity of a tooltip. */ + opacity?: number; + /** Specifies a distance from the tooltip's left/right boundaries to the inner text in pixels. */ + paddingLeftRight?: number; + /** Specifies a distance from the tooltip's top/bottom boundaries to the inner text in pixels. */ + paddingTopBottom?: number; + /** Specifies a precision for formatted values displayed by the tooltip. */ + precision?: number; + /** Specifies options of the tooltip's shadow. */ + shadow?: { + /** Specifies the blur distance of the tooltip's shadow. */ + blur?: number; + /** Specifies the color of the tooltip's shadow. */ + color?: string; + /** Specifies the horizontal offset of the tooltip's shadow relative to the tooltip in pixels. */ + offsetX?: number; + /** Specifies the vertical offset of the tooltip's shadow relative to the tooltip in pixels. */ + offsetY?: number; + /** Specifies the opacity of the tooltip's shadow. */ + opacity?: number; + }; + } + export interface Animation { + /** Determines how long animation runs. */ + duration?: number; + /** Specifies the animation easing mode. */ + easing?: string; + /** Indicates whether or not animation is enabled. */ + enabled?: boolean; + } + export interface LoadingIndicator { + /** Specifies a color for the loading indicator background. */ + backgroundColor?: string; + /** Specifies font options for the loading indicator text. */ + font?: viz.core.Font; + /** Specifies whether to show the loading indicator or not. */ + show?: boolean; + /** Specifies a text to be displayed by the loading indicator. */ + text?: string; + } + export interface LegendBorder extends viz.core.DashedBorderWithOpacity { + /** Specifies a radius for the corners of the legend border. */ + cornerRadius?: number; + } + export interface BaseLegend { + /** Specifies the color of the legend's background. */ + backgroundColor?: string; + /** Specifies legend border settings. */ + border?: viz.core.LegendBorder; + /** Specifies how many columns must be taken to arrange legend items. */ + columnCount?: number; + /** Specifies the spacing between a pair of neighboring legend columns in pixels. */ + columnItemSpacing?: number; + /** Specifies font options for legend items. */ + font?: viz.core.Font; + /** Specifies the legend's position on the map. */ + horizontalAlignment?: string; + /** Specifies the alignment of legend items. */ + itemsAlignment?: string; + /** Specifies the position of text relative to the item marker. */ + itemTextPosition?: string; + /** Specifies the distance between the legend and the container borders in pixels. */ + margin?: viz.core.Margins; + /** Specifies the size of item markers in the legend in pixels. */ + markerSize?: number; + /** Specifies whether to arrange legend items horizontally or vertically. */ + orientation?: string; + /** Specifies the spacing between the legend left/right border and legend items in pixels. */ + paddingLeftRight?: number; + /** Specifies the spacing between the legend top/bottom border and legend items in pixels. */ + paddingTopBottom?: number; + /** Specifies how many rows must be taken to arrange legend items. */ + rowCount?: number; + /** Specifies the spacing between a pair of neighboring legend rows in pixels. */ + rowItemSpacing?: number; + /** Specifies the legend's position on the map. */ + verticalAlignment?: string; + /** Specifies whether or not the legend is visible on the map. */ + visible?: boolean; + } + export interface BaseWidgetOptions extends DOMComponentOptions { + /** A handler for the drawn event. */ + onDrawn?: (e: { + component: BaseWidget; + element: Element; + }) => void; + /** A handler for the incidentOccurred event. */ + onIncidentOccurred?: ( + component: BaseWidget, + element: Element, + target: { + id: string; + type: string; + args: any; + text: string; + widget: string; + version: string; + } + ) => void; + /** Notifies a widget that it is embedded into an HTML page that uses a path modifier. */ + pathModified?: boolean; + /** Specifies whether or not the widget supports right-to-left representation. */ + rtlEnabled?: boolean; + /** Sets the name of the theme to be used in the widget. */ + theme?: string; + } + /** This section describes options and methods that are common to all widgets. */ + export class BaseWidget extends DOMComponent { + /** Returns the widget's SVG markup. */ + svg(): string; + } +} +declare module DevExpress.viz.charts { + /** This section describes the fields and methods that can be used in code to manipulate the Series object. */ + export interface BaseSeries { + /** Provides information about the state of the series object. */ + fullState: number; + /** Returns the type of the series. */ + type: string; + /** Unselects all the selected points of the series. The points are displayed in an initial style. */ + clearSelection(): void; + /** Gets the color of a particular series. */ + getColor(): string; + /** Gets points from the series point collection based on the specified argument. */ + getPointsByArg(pointArg: any): Array; + /** Gets a point from the series point collection based on the specified point position. */ + getPointByPos(positionIndex: number): Object; + /** Selects the series. The series is displayed in a 'selected' style until another series is selected or the current series is deselected programmatically. */ + select(): void; + /** Selects the specified point. The point is displayed in a 'selected' style. */ + selectPoint(point: BasePoint): void; + /** Deselects the specified point. The point is displayed in an initial style. */ + deselectPoint(point: BasePoint): void; + /** Returns an array of all points in the series. */ + getAllPoints(): Array; + /** Returns visible series points. */ + getVisiblePoints(): Array; + /** Returns the name of the series. */ + name: string; + /** Returns the tag of the series. */ + tag: string; + /** Hides a series. */ + hide(): void; + /** Provides information about the hover state of a series. */ + isHovered(): boolean; + /** Provides information about the selection state of a series. */ + isSelected(): boolean; + /** Provides information about the visibility state of a series. */ + isVisible(): boolean; + /** Makes a particular series visible. */ + show(): void; + } + /** This section describes the methods that can be used in code to manipulate the Point object. */ + export interface BasePoint { + /** Provides information about the state of the point object. */ + fullState: number; + /** Returns the point's argument value that was set in the data source. */ + originalArgument: any; + /** Returns the point's value that was set in the data source. */ + originalValue: any; + /** Returns the tag of the point. */ + tag: string; + /** Deselects the point. */ + clearSelection(): void; + /** Gets the color of a particular point. */ + getColor(): string; + /** Hides the tooltip of the point. */ + hideTooltip(): void; + /** Provides information about the hover state of a point. */ + isHovered(): boolean; + /** Provides information about the selection state of a point. */ + isSelected(): boolean; + /** Selects the point. The point is displayed in a 'selected' style until another point is selected or the current point is deselected programmatically. */ + select(): void; + /** Shows the tooltip of the point. */ + showTooltip(): void; + /** Allows you to obtain the label of a series point. */ + getLabel(): any; + /** Returns the series object to which the point belongs. */ + series: BaseSeries; + } + /** This section describes the fields and methods that can be used in code to manipulate the Series object. */ + export interface ChartSeries extends BaseSeries { + /** Returns the name of the series pane. */ + pane: string; + /** Returns the name of the value axis of the series. */ + axis: string; + selectPoint(point: ChartPoint): void; + deselectPoint(point: ChartPoint): void; + getAllPoints(): Array; + getVisiblePoints(): Array; + } + /** This section describes the methods that can be used in code to manipulate the Point object. */ + export interface ChartPoint extends BasePoint { + /** Contains the close value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ + originalCloseValue: any; + /** Contains the high value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ + originalHighValue: any; + /** Contains the low value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ + originalLowValue: any; + /** Contains the first value of the point. This field is useful for points belonging to a series of the range area or range bar type only. */ + originalMinValue: any; + /** Contains the open value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ + originalOpenValue: any; + /** Contains the size of the bubble as it was set in the data source. This field is useful for points belonging to a series of the bubble type only. */ + size: any; + /** Gets the parameters of the point's minimum bounding rectangle (MBR). */ + getBoundingRect(): { x: number; y: number; width: number; height: number; }; + series: ChartSeries; + } + /** This section describes the methods that can be used in code to manipulate the Label object. */ + export interface Label { + /** Gets the parameters of the label's minimum bounding rectangle (MBR). */ + getBoundingRect(): { x: number; y: number; width: number; height: number; }; + /** Hides the point label. */ + hide(): void; + /** Shows the point label. */ + show(): void; + } + export interface PieSeries extends BaseSeries { + selectPoint(point: PiePoint): void; + deselectPoint(point: PiePoint): void; + getAllPoints(): Array; + getVisiblePoints(): Array; + } + /** This section describes the methods that can be used in code to manipulate the Point object. */ + export interface PiePoint extends BasePoint { + /** Gets the percentage value of the specific point. */ + percent: any; + /** Provides information about the visibility state of a point. */ + isVisible(): boolean; + /** Makes a specific point visible. */ + show(): void; + /** Hides a specific point. */ + hide(): void; + series: PieSeries; + } + /** This section describes the fields and methods that can be used in code to manipulate the Series object. */ + export interface PolarSeries extends BaseSeries { + /** Returns the name of the value axis of the series. */ + axis: string; + selectPoint(point: PolarPoint): void; + deselectPoint(point: PolarPoint): void; + getAllPoints(): Array; + getVisiblePoints(): Array; + } + /** This section describes the methods that can be used in code to manipulate the Point object. */ + export interface PolarPoint extends BasePoint { + series: PolarSeries; + } + export interface Strip { + /** Specifies a color for a strip. */ + color?: string; + /** An object that defines the label configuration options of a strip. */ + label?: { + /** Specifies the text displayed in a strip. */ + text?: string; + }; + /** Specifies a start value for a strip. */ + startValue?: any; + /** Specifies an end value for a strip. */ + endValue?: any; + } + export interface BaseSeriesConfigLabel { + /** Specifies a format for arguments displayed by point labels. */ + argumentFormat?: string; + /** Specifies a precision for formatted point arguments displayed in point labels. */ + argumentPrecision?: number; + /** Specifies a background color for point labels. */ + backgroundColor?: string; + /** Specifies border options for point labels. */ + border?: viz.core.DashedBorder; + /** Specifies connector options for series point labels. */ + connector?: { + /** Specifies the color of label connectors. */ + color?: string; + /** Indicates whether or not label connectors are visible. */ + visible?: boolean; + /** Specifies the width of label connectors. */ + width?: number; + }; + /** Specifies a callback function that returns the text to be displayed by point labels. */ + customizeText?: (pointInfo: Object) => string; + /** Specifies font options for the text displayed in point labels. */ + font?: viz.core.Font; + /** Specifies a format for the text displayed by point labels. */ + format?: string; + position?: string; + /** Specifies a precision for formatted point values displayed in point labels. */ + precision?: number; + /** Specifies the angle used to rotate point labels from their initial position. */ + rotationAngle?: number; + /** Specifies the visibility of point labels. */ + visible?: boolean; + } + export interface SeriesConfigLabel extends BaseSeriesConfigLabel { + /** Specifies whether or not to show a label when the point has a zero value. */ + showForZeroValues?: boolean; + } + export interface ChartSeriesConfigLabel extends SeriesConfigLabel { + /** Specifies how to align point labels relative to the corresponding data points that they represent. */ + alignment?: string; + /** Specifies how to shift point labels horizontally from their initial positions. */ + horizontalOffset?: number; + /** Specifies how to shift point labels vertically from their initial positions. */ + verticalOffset?: number; + /** Specifies a precision for the percentage values displayed in the labels of a full-stacked-like series. */ + percentPrecision?: number; + } + export interface BaseCommonSeriesConfig { + /** Specifies the data source field that provides arguments for series points. */ + argumentField?: string; + axis?: string; + /** An object defining the label configuration options for a series in the dxChart widget. */ + label?: ChartSeriesConfigLabel; + /** Specifies border options for point labels. */ + border?: viz.core.DashedBorder; + /** Specifies a series color. */ + color?: string; + /** Specifies the dash style of the series' line. */ + dashStyle?: string; + hoverMode?: string; + hoverStyle?: { + /** An object defining the border options for a hovered series. */ + border?: viz.core.DashedBorder; + /**

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

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

      Sets a color for a point when it is selected.

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

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

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

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

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

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

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

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

      */ + customizeText?: (seriesInfo: { seriesName: string; seriesIndex: number; seriesColor: string; }) => string; + /** Specifies what series elements to highlight when a corresponding item in the legend is hovered over. */ + hoverMode?: string; + } + export interface AdvancedOptions extends BaseChartOptions { + /** A handler for the argumentAxisClick event. */ + onArgumentAxisClick?: any; + /** Specifies the color of the parent page element. */ + containerBackgroundColor?: string; + /** An object providing options for managing data from a data source. */ + dataPrepareSettings?: { + /** Specifies whether or not to validate the values from a data source. */ + checkTypeForAllData?: boolean; + /** Specifies whether or not to convert the values from a data source into the data type of an axis. */ + convertToAxisDataType?: boolean; + /** Specifies how to sort the series points. */ + sortingMethod?: any; + }; + /** A handler for the legendClick event. */ + onLegendClick?: any; + /** A handler for the seriesClick event. */ + onSeriesClick?: any; + /** A handler for the seriesHoverChanged event. */ + onSeriesHoverChanged?: (e: { + component: BaseChart; + element: Element; + target: TSeries; + }) => void; + /** A handler for the seriesSelectionChanged event. */ + onSeriesSelectionChanged?: (e: { + component: BaseChart; + element: Element; + target: TSeries; + }) => void; + /** Specifies whether a single series or multiple series can be selected in the chart. */ + seriesSelectionMode?: string; + /** Specifies how the chart must behave when series point labels overlap. */ + resolveLabelOverlapping?: string; + /** Specifies whether or not all bars in a series must have the same angle, or may have different angles if any points in other series are missing. */ + equalBarWidth?: boolean; + /** Specifies a common bar width as a percentage from 0 to 1. */ + barWidth?: number; + /** Forces the widget to treat negative values as zeroes. Applies to stacked-like series only. */ + negativesAsZeroes?: boolean; + } + export interface Legend extends AdvancedLegend { + /** Specifies whether the legend is located outside or inside the chart's plot. */ + position?: string; + } + export interface ChartTooltip extends BaseChartTooltip { + /** Specifies whether the tooltip must be located in the center of a bar or on its edge. Applies to the Bar and Bubble series. */ + location?: string; + /** Specifies the kind of information to display in a tooltip. */ + shared?: boolean; + } + export interface dxChartOptions extends AdvancedOptions { + adaptiveLayout?: { + keepLabels?: boolean; + }; + /** Indicates whether or not to synchronize value axes when they are displayed on a single pane. */ + synchronizeMultiAxes?: boolean; + /** Specifies whether or not to filter the series points depending on their quantity. */ + useAggregation?: boolean; + /** Indicates whether or not to adjust a value axis to the current minimum and maximum values of a zoomed chart. */ + adjustOnZoom?: boolean; + /** Specifies argument axis options for the dxChart widget. */ + argumentAxis?: ChartArgumentAxis; + /** An object defining the configuration options that are common for all axes of the dxChart widget. */ + commonAxisSettings?: ChartCommonAxisSettings; + /** An object defining the configuration options that are common for all panes in the dxChart widget. */ + commonPaneSettings?: CommonPane; + /** An object defining the configuration options that are common for all series of the dxChart widget. */ + commonSeriesSettings?: CommonSeriesSettings; + /** An object that specifies the appearance options of the chart crosshair. */ + crosshair?: { + /** Specifies a color for the crosshair lines. */ + color?: string; + /** Specifies a dash style for the crosshair lines. */ + dashStyle?: string; + /** Specifies whether to enable the crosshair or not. */ + enabled?: boolean; + /** Specifies the opacity of the crosshair lines. */ + opacity?: number; + /** Specifies the width of the crosshair lines. */ + width?: number; + /** Specifies the appearance of the horizontal crosshair line. */ + horizontalLine?: CrosshaierWithLabel; + /** Specifies the appearance of the vertical crosshair line. */ + verticalLine?: CrosshaierWithLabel; + /** Specifies the options of the crosshair labels. */ + label?: { + /** Specifies a color for the background of the crosshair labels. */ + backgroundColor?: string; + /** Specifies whether the crosshair labels are visible or not. */ + visible?: boolean; + /** Specifies font options for the text of the crosshair labels. */ + font?: viz.core.Font; + /** Specifies the format of the values displayed by crosshair labels. */ + format?: string; + /** Specifies a precision for formatted values. */ + precision?: number; + /** Customizes the text displayed by the crosshair labels. */ + customizeText?: (info: { value: any; valueText: string; point: ChartPoint; }) => string; + } + }; + /** Specifies a default pane for the chart series. */ + defaultPane?: string; + /** Specifies a coefficient determining the diameter of the largest bubble. */ + maxBubbleSize?: number; + /** Specifies the diameter of the smallest bubble measured in pixels. */ + minBubbleSize?: number; + /** Defines the dxChart widget's pane(s). */ + panes?: Array; + /** Swaps the axes round so that the value axis becomes horizontal and the argument axes becomes vertical. */ + rotated?: boolean; + /** Specifies the options of a chart's legend. */ + legend?: Legend; + /** Specifies options for dxChart widget series. */ + series?: Array; + /** Defines options for the series template. */ + seriesTemplate?: SeriesTemplate; + /** Specifies tooltip options. */ + tooltip?: ChartTooltip; + /** Specifies value axis options for the dxChart widget. */ + valueAxis?: Array; + /** Enables scrolling in your chart. */ + scrollingMode?: string; + /** Enables zooming in your chart. */ + zoomingMode?: string; + /** Specifies the settings of the scroll bar. */ + scrollBar?: { + /** Specifies whether the scroll bar is visible or not. */ + visible?: boolean; + /** Specifies the spacing between the scroll bar and the chart's plot in pixels. */ + offset?: number; + /** Specifies the color of the scroll bar. */ + color?: string; + /** Specifies the width of the scroll bar in pixels. */ + width?: number; + /** Specifies the opacity of the scroll bar. */ + opacity?: number; + /** Specifies the position of the scroll bar in the chart. */ + position?: string; + }; + } + /** A widget used to embed charts into HTML JS applications. */ + export class dxChart extends BaseChart { + constructor(element: JQuery, options?: dxChartOptions); + constructor(element: Element, options?: dxChartOptions); + /** Sets the specified start and end values for the chart's argument axis. */ + zoomArgument(startValue: any, endValue: any): void; + } + interface CrosshaierWithLabel extends viz.core.DashedBorderWithOpacity { + /** Configures the label that belongs to the horizontal crosshair line. */ + label?: { + /** Specifies a color for the background of the label that belongs to the horizontal crosshair line. */ + backgroundColor?: string; + /** Specifies whether the label of the horizontal crosshair line is visible or not. */ + visible?: boolean; + /** Specifies font options for the text of the label that belongs to the horizontal crosshair line. */ + font?: viz.core.Font; + /** Specifies the format of the values displayed by crosshair labels. */ + format?: string; + /** Specifies a precision for formatted values. */ + precision?: number; + /** Customizes the text displayed by the crosshair label that accompany the horizontal line. */ + customizeText?: (info: { value: any; valueText: string; point: ChartPoint; }) => string; + } + } + export interface PolarChartTooltip extends BaseChartTooltip { + /** Specifies the kind of information to display in a tooltip. */ + shared?: boolean; + } + export interface dxPolarChartOptions extends AdvancedOptions { + /** Specifies adaptive layout options. */ + adaptiveLayout?: { + width?: number; + height?: number; + /** Specifies whether or not point labels can be hidden when the layout is adapting. */ + keepLabels?: boolean; + }; + /** Indicates whether or not to display a "spider web". */ + useSpiderWeb?: boolean; + /** Specifies argument axis options for the dxPolarChart widget. */ + argumentAxis?: PolarArgumentAxis; + /** An object defining the configuration options that are common for all axes of the dxPolarChart widget. */ + commonAxisSettings?: PolarCommonAxisSettings; + /** An object defining the configuration options that are common for all series of the dxPolarChart widget. */ + commonSeriesSettings?: CommonPolarSeriesSettings; + /** Specifies the options of a chart's legend. */ + legend?: AdvancedLegend; + /** Specifies options for dxPolarChart widget series. */ + series?: Array; + /** Defines options for the series template. */ + seriesTemplate?: PolarSeriesTemplate; + /** Specifies tooltip options. */ + tooltip?: PolarChartTooltip; + /** Specifies value axis options for the dxPolarChart widget. */ + valueAxis?: PolarValueAxis; + } + /** A chart widget displaying data in a polar coordinate system. */ + export class dxPolarChart extends BaseChart { + constructor(element: JQuery, options?: dxPolarChartOptions); + constructor(element: Element, options?: dxPolarChartOptions); + } + export interface PieLegend extends core.BaseLegend { + /** Specifies what chart elements to highlight when a corresponding item in the legend is hovered over. */ + hoverMode?: string; + /** Specifies the text for a hint that appears when a user hovers the mouse pointer over a legend item. */ + customizeHint?: (pointInfo: { pointName: string; pointIndex: number; pointColor: string; }) => string; + /** Specifies a callback function that returns the text to be displayed by a legend item. */ + customizeText?: (pointInfo: { pointName: string; pointIndex: number; pointColor: string; }) => string; + } + export interface dxPieChartOptions extends BaseChartOptions { + /** Specifies adaptive layout options. */ + adaptiveLayout?: { + /** Specifies whether or not point labels can be hidden when the layout is adapting. */ + keepLabels?: boolean; + }; + /** Specifies dxPieChart legend options. */ + legend?: PieLegend; + /** Specifies options for the series of the dxPieChart widget. */ + series?: Array; + /** Specifies the diameter of the pie. */ + diameter?: number; + /** Specifies the direction that the pie chart segments will occupy. */ + segmentsDirection?: string; + /** Specifies the angle in arc degrees from which the first segment of a pie chart should start. */ + startAngle?: number; + /** Specifies the fraction of the inner radius relative to the total radius in the series of the 'doughnut' type. The value should be between 0 and 1. */ + innerRadius?: number; + /** A handler for the legendClick event. */ + onLegendClick?: any; + /** Specifies how a chart must behave when series point labels overlap. */ + resolveLabelOverlapping?: string; + /** An object defining the configuration options that are common for all series of the dxPieChart widget. */ + commonSeriesSettings?: CommonPieSeriesSettings; + /** Specifies the type of the pie chart series. */ + type?: string; + } + /** A circular chart widget for HTML JS applications. */ + export class dxPieChart extends BaseChart { + constructor(element: JQuery, options?: dxPieChartOptions); + constructor(element: Element, options?: dxPieChartOptions); + /** + * Provides access to the dxPieChart series. + * @deprecated ..\..\BaseChart\3 Methods\getAllSeries().md + */ + getSeries(): PieSeries; + } +} +interface JQuery { + dxChart(options?: DevExpress.viz.charts.dxChartOptions): JQuery; + dxChart(methodName: string, ...params: any[]): any; + dxChart(methodName: "instance"): DevExpress.viz.charts.dxChart; + dxPieChart(options?: DevExpress.viz.charts.dxPieChartOptions): JQuery; + dxPieChart(methodName: string, ...params: any[]): any; + dxPieChart(methodName: "instance"): DevExpress.viz.charts.dxPieChart; + dxPolarChart(options?: DevExpress.viz.charts.dxPolarChartOptions): JQuery; + dxPolarChart(methodName: string, ...params: any[]): any; + dxPolarChart(methodName: "instance"): DevExpress.viz.charts.dxPolarChart; +} +declare module DevExpress.viz.gauges { + export interface BaseRangeContainer { + /** Specifies a range container's background color. */ + backgroundColor?: string; + /** Specifies the offset of the range container from an invisible scale line in pixels. */ + offset?: number; + /** Sets the name of the palette or an array of colors to be used for coloring the gauge range container. */ + palette?: any; + /** An array of objects representing ranges contained in the range container. */ + ranges?: Array<{ startValue: number; endValue: number; color: string }>; + /** Specifies a color of a range. */ + color?: string; + /** Specifies an end value of a range. */ + endValue?: number; + /** Specifies a start value of a range. */ + startValue?: number; + } + export interface ScaleTick { + /** Specifies the color of the scale's minor ticks. */ + color?: string; + /** + * Specifies an array of custom minor ticks. + * @deprecated ..\customMinorTicks.md + */ + customTickValues?: Array; + /** Specifies the length of the scale's minor ticks. */ + length?: number; + /** + * Indicates whether automatically calculated minor ticks are visible or not. + * @deprecated This functionality in not more available + */ + showCalculatedTicks?: boolean; + /** + * Specifies an interval between minor ticks. + * @deprecated ..\minorTickInterval.md + */ + tickInterval?: number; + /** Indicates whether scale minor ticks are visible or not. */ + visible?: boolean; + /** Specifies the width of the scale's minor ticks. */ + width?: number; + } + export interface ScaleMajorTick extends ScaleTick { + /** + * Specifies whether or not to expand the current major tick interval if labels overlap each other. + * @deprecated ..\label\overlappingBehavior\useAutoArrangement.md + */ + useTicksAutoArrangement?: boolean; + } + export interface ScaleMinorTick extends ScaleTick { + /** Specifies the opacity of the scale's minor ticks. */ + opacity?: number; + } + export interface BaseScaleLabel { + /** Specifies whether or not scale labels should be colored similarly to their corresponding ranges in the range container. */ + useRangeColors?: boolean; + /** Specifies a callback function that returns the text to be displayed in scale labels. */ + customizeText?: (scaleValue: { value: number; valueText: string }) => string; + /** Specifies the overlap resolving options to be applied to scale labels. */ + overlappingBehavior?: { + /** Specifies whether or not to expand the current major tick interval if labels overlap each other. */ + useAutoArrangement?: boolean; + /** Specifies what label to hide in case of overlapping. */ + hideFirstOrLast?: string; + }; + /** Specifies font options for the text displayed in the scale labels of the gauge. */ + font?: viz.core.Font; + /** Specifies a format for the text displayed in scale labels. */ + format?: string; + /** Specifies a precision for the formatted value displayed in the scale labels. */ + precision?: number; + /** Specifies whether or not scale labels are visible on the gauge. */ + visible?: boolean; + } + export interface BaseScale { + /** Specifies the end value for the scale of the gauge. */ + endValue?: number; + /** + * Specifies whether or not to hide the first scale label. + * @deprecated This functionality in not more available + */ + hideFirstLabel?: boolean; + /** + * Specifies whether or not to hide the first major tick on the scale. + * @deprecated This functionality in not more available + */ + hideFirstTick?: boolean; + /** + * Specifies whether or not to hide the last scale label. + * @deprecated This functionality in not more available + */ + hideLastLabel?: boolean; + /** + * Specifies whether or not to hide the last major tick on the scale. + * @deprecated This functionality in not more available + */ + hideLastTick?: boolean; + /** Specifies an interval between major ticks. */ + tickInterval?: number; + /** Specifies an interval between minor ticks. */ + minorTickInterval?: number; + /** Specifies an array of custom major ticks. */ + customTicks?: Array; + /** Specifies an array of custom minor ticks. */ + customMinorTicks?: Array; + /** Specifies common options for scale labels. */ + label?: BaseScaleLabel; + /** + * Specifies options of the gauge's major ticks. + * @deprecated ..\tick\tick.md + */ + majorTick?: ScaleMajorTick; + /** Specifies options of the gauge's major ticks. */ + tick?: { + /** Specifies the color of the scale's major ticks. */ + color?: string; + /** Specifies the length of the scale's major ticks. */ + length?: number; + /** Indicates whether scale major ticks are visible or not. */ + visible?: boolean; + /** Specifies the width of the scale's major ticks. */ + width?: number; + /** Specifies the opacity of the scale's major ticks. */ + opacity?: number; + }; + /** Specifies options of the gauge's minor ticks. */ + minorTick?: ScaleMinorTick; + /** Specifies the start value for the scale of the gauge. */ + startValue?: number; + } + export interface BaseValueIndicator { + /** Specifies the type of subvalue indicators. */ + type?: string; + /** Specifies the background color for the indicator of the rangeBar type. */ + backgroundColor?: string; + /** Specifies the base value for the indicator of the rangeBar type. */ + baseValue?: number; + /** Specifies a color of the indicator. */ + color?: string; + /** Specifies the range bar size for an indicator of the rangeBar type. */ + size?: number; + text?: { + /** Specifies a callback function that returns the text to be displayed in an indicator. */ + customizeText?: (indicatedValue: { value: number; valueText: string }) => string; + font?: viz.core.Font; + /** Specifies a format for the text displayed in an indicator. */ + format?: string; + /** Specifies the range bar's label indent in pixels. */ + indent?: number; + /** Specifies a precision for the formatted value displayed by an indicator. */ + precision?: number; + }; + offset?: number; + length?: number; + width?: number; + /** Specifies the length of an arrow for the indicator of the textCloud type in pixels. */ + arrowLength?: number; + /** Sets the array of colors to be used for coloring subvalue indicators. */ + palette?: Array; + /** Specifies the distance between the needle and the center of a gauge for the indicator of a needle-like type. */ + indentFromCenter?: number; + /** Specifies the second color for the indicator of the twoColorNeedle type. */ + secondColor?: string; + /** Specifies the length of a twoNeedleColor type indicator tip as a percentage. */ + secondFraction?: number; + /** Specifies the spindle's diameter in pixels for the indicator of a needle-like type. */ + spindleSize?: number; + /** Specifies the inner diameter in pixels, so that the spindle has the shape of a ring. */ + spindleGapSize?: number; + /** Specifies the orientation of the rangeBar indicator on a vertically oriented dxLinearGauge widget. */ + horizontalOrientation?: string; + /** Specifies the orientation of the rangeBar indicator on a horizontally oriented dxLinearGauge widget. */ + verticalOrientation?: string; + } + export interface SharedGaugeOptions { + /** Specifies animation options. */ + animation?: viz.core.Animation; + /** Specifies the appearance of the loading indicator. */ + loadingIndicator?: viz.core.LoadingIndicator; + /** Specifies whether to redraw the widget when the size of the parent browser window changes or a mobile device rotates. */ + redrawOnResize?: boolean; + /** Specifies the size of the widget in pixels. */ + size?: viz.core.Size; + /** + * Specifies a subtitle for the widget. + * @deprecated ..\..\..\BaseGauge\1 Configuration\title\subtitle\subtitle.md + */ + subtitle?: { + /** + * Specifies font options for the subtitle. + * @deprecated ..\..\title\subtitle\font\font.md + */ + font?: viz.core.Font; + /** + * Specifies a text for the subtitle. + * @deprecated ..\title\subtitle\text.md + */ + text?: string; + }; + /** Specifies a title for a gauge. */ + title?: { + /** Specifies font options for the title. */ + font?: viz.core.Font; + /** + * Specifies a title's position on the gauge. + * @deprecated basegaugeoptions_title_verticalAlignment and basegaugeoptions_title_horizontalAlignment + */ + position?: string; + /** Specifies the distance between the title and surrounding gauge elements in pixels. */ + margin?: viz.core.Margins; + /** Specifies the height of the space reserved for the title. */ + placeholderSize?: number; + /** Specifies the gauge title's position in the vertical direction. */ + verticalAlignment?: string; + /** Specifies the gauge title's horizontal position. */ + horizontalAlignment?: string; + /** Specifies text for the title. */ + text?: string; + /** Specifies a subtitle for the widget. */ + subtitle?: { + /** Specifies font options for the subtitle. */ + font?: viz.core.Font; + /** Specifies text for the subtitle. */ + text?: string; + } + }; + /** Specifies options for gauge tooltips. */ + tooltip?: viz.core.Tooltip; + /** A handler for the tooltipShown event. */ + onTooltipShown?: (e: { + component: dxBaseGauge; + element: Element; + target: {}; + }) => void; + /** A handler for the tooltipHidden event. */ + onTooltipHidden?: (e: { + component: dxBaseGauge; + element: Element; + target: {}; + }) => void; + } + export interface BaseGaugeOptions extends viz.core.BaseWidgetOptions, SharedGaugeOptions { + /** Specifies the color of the parent page element. */ + containerBackgroundColor?: string; + /** Specifies the blank space in pixels between the widget's extreme elements and the boundaries of the area provided for the widget (see the size option). */ + margin?: viz.core.Margins; + /** Specifies options of the gauge's range container. */ + rangeContainer?: BaseRangeContainer; + /** Specifies a gauge's scale options. */ + scale?: BaseScale; + /** Specifies the appearance options of subvalue indicators. */ + subvalueIndicator?: BaseValueIndicator; + /** Specifies a set of subvalues to be designated by the subvalue indicators. */ + subvalues?: Array; + /** Specifies the main value on a gauge. */ + value?: number; + /** Specifies the appearance options of the value indicator. */ + valueIndicator?: BaseValueIndicator; + } + /** A gauge widget. */ + export class dxBaseGauge extends viz.core.BaseWidget { + /** Displays the loading indicator. */ + showLoadingIndicator(): void; + /** Conceals the loading indicator. */ + hideLoadingIndicator(): void; + /** Redraws a widget. */ + render(): void; + /** Returns the main gauge value. */ + value(): number; + /** Updates a gauge value. */ + value(value: number): void; + /** Returns an array of gauge subvalues. */ + subvalues(): Array; + /** Updates gauge subvalues. */ + subvalues(subvalues: Array): void; + } + export interface LinearRangeContainer extends BaseRangeContainer { + /** Specifies the orientation of the range container on a vertically oriented dxLinearGauge widget. */ + horizontalOrientation?: string; + /** Specifies the orientation of a range container on a horizontally oriented dxLinearGauge widget. */ + verticalOrientation?: string; + /** Specifies the width of the range container's start and end boundaries in the dxLinearGauge widget. */ + width?: any; + /** Specifies an end width of a range container. */ + end?: number; + /** Specifies a start width of a range container. */ + start?: number; + } + export interface LinearScaleLabel extends BaseScaleLabel { + /** Specifies the spacing between scale labels and ticks. */ + indentFromTick?: number; + } + export interface LinearScale extends BaseScale { + /** Specifies the orientation of scale ticks on a vertically oriented dxLinearGauge widget. */ + horizontalOrientation?: string; + label?: LinearScaleLabel; + /** Specifies the orientation of scale ticks on a horizontally oriented dxLinearGauge widget. */ + verticalOrientation?: string; + } + export interface dxLinearGaugeOptions extends BaseGaugeOptions { + /** Specifies the options required to set the geometry of the dxLinearGauge widget. */ + geometry?: { + /** Indicates whether to display the dxLinearGauge widget vertically or horizontally. */ + orientation?: string; + }; + /** Specifies gauge range container options. */ + rangeContainer?: LinearRangeContainer; + scale?: LinearScale; + } + /** A widget that represents a gauge with a linear scale. */ + export class dxLinearGauge extends dxBaseGauge { + constructor(element: JQuery, options?: dxLinearGaugeOptions); + constructor(element: Element, options?: dxLinearGaugeOptions); + } + export interface CircularRangeContainer extends BaseRangeContainer { + /** Specifies the orientation of the range container in the dxCircularGauge widget. */ + orientation?: string; + /** Specifies the range container's width in pixels. */ + width?: number; + } + export interface CircularScaleLabel extends BaseScaleLabel { + /** Specifies the spacing between scale labels and ticks. */ + indentFromTick?: number; + } + export interface CircularScale extends BaseScale { + label?: CircularScaleLabel; + /** Specifies the orientation of scale ticks. */ + orientation?: string; + } + export interface dxCircularGaugeOptions extends BaseGaugeOptions { + /** Specifies the options required to set the geometry of the dxCircularGauge widget. */ + geometry?: { + /** Specifies the end angle of the circular gauge's arc. */ + endAngle?: number; + /** Specifies the start angle of the circular gauge's arc. */ + startAngle?: number; + }; + /** Specifies gauge range container options. */ + rangeContainer?: CircularRangeContainer; + scale?: CircularScale; + } + /** A widget that represents a gauge with a circular scale. */ + export class dxCircularGauge extends dxBaseGauge { + constructor(element: JQuery, options?: dxCircularGaugeOptions); + constructor(element: Element, options?: dxCircularGaugeOptions); + } + export interface dxBarGaugeOptions extends viz.core.BaseWidgetOptions, SharedGaugeOptions { + /** Specifies a color for the remaining segment of the bar's track. */ + backgroundColor?: string; + /** Specifies a distance between bars in pixels. */ + barSpacing?: number; + /** Specifies a base value for bars. */ + baseValue?: number; + /** Specifies an end value for the gauge's invisible scale. */ + endValue?: number; + /** Defines the shape of the gauge's arc. */ + geometry?: { + /** Specifies the end angle of the bar gauge's arc. */ + endAngle?: number; + /** Specifies the start angle of the bar gauge's arc. */ + startAngle?: number; + }; + /** Specifies the options of the labels that accompany gauge bars. */ + label?: { + /** Specifies a color for the label connector text. */ + connectorColor?: string; + /** Specifies the width of the label connector in pixels. */ + connectorWidth?: number; + /** Specifies a callback function that returns a text for labels. */ + customizeText?: (barValue: { value: number; valueText: string }) => string; + /** Specifies font options for bar labels. */ + font?: viz.core.Font; + /** Specifies a format for bar labels. */ + format?: string; + /** Specifies the distance between the upper bar and bar labels in pixels. */ + indent?: number; + /** Specifies a precision for the formatted value displayed by labels. */ + precision?: number; + /** Specifies whether bar labels appear on a gauge or not. */ + visible?: boolean; + }; + /** Sets the name of the palette or an array of colors to be used for coloring the gauge range container. */ + palette?: string; + /** Defines the radius of the bar that is closest to the center relatively to the radius of the topmost bar. */ + relativeInnerRadius?: number; + /** Specifies a start value for the gauge's invisible scale. */ + startValue?: number; + /** Specifies the array of values to be indicated on a bar gauge. */ + values?: Array; + } + /** A circular bar widget. */ + export class dxBarGauge extends viz.core.BaseWidget { + constructor(element: JQuery, options?: dxBarGaugeOptions); + constructor(element: Element, options?: dxBarGaugeOptions); + /** Displays the loading indicator. */ + showLoadingIndicator(): void; + /** Conceals the loading indicator. */ + hideLoadingIndicator(): void; + /** Redraws the widget. */ + render(): void; + /** Returns an array of gauge values. */ + values(): Array; + /** Updates the values displayed by a gauge. */ + values(values: Array): void; + } +} +interface JQuery { + dxLinearGauge(options?: DevExpress.viz.gauges.dxLinearGaugeOptions): JQuery; + dxLinearGauge(methodName: string, ...params: any[]): any; + dxLinearGauge(methodName: "instance"): DevExpress.viz.gauges.dxLinearGauge; + dxCircularGauge(options?: DevExpress.viz.gauges.dxCircularGaugeOptions): JQuery; + dxCircularGauge(methodName: string, ...params: any[]): any; + dxCircularGauge(methodName: "instance"): DevExpress.viz.gauges.dxCircularGauge; + dxBarGauge(options?: DevExpress.viz.gauges.dxBarGaugeOptions): JQuery; + dxBarGauge(methodName: string, ...params: any[]): any; + dxBarGauge(methodName: "instance"): DevExpress.viz.gauges.dxBarGauge; +} +declare module DevExpress.viz.rangeSelector { + export interface dxRangeSelectorOptions extends viz.core.BaseWidgetOptions { + /** Specifies the options for the range selector's background. */ + background?: { + /** Specifies the background color for the dxRangeSelector. */ + color?: string; + /** Specifies image options. */ + image?: { + /** Specifies a location for the image in the background of a range selector. */ + location?: string; + /** Specifies the image's URL. */ + url?: string; + }; + /** Indicates whether or not the background (background color and/or image) is visible. */ + visible?: boolean; + }; + /** Specifies a title for the range selector. */ + title?: viz.core.Title; + /** Specifies the dxRangeSelector's behavior options. */ + behavior?: { + /** Indicates whether or not you can swap sliders. */ + allowSlidersSwap?: boolean; + /** Indicates whether or not animation is enabled. */ + animationEnabled?: boolean; + /** Specifies when to call the onSelectedRangeChanged function. */ + callSelectedRangeChanged?: string; + /** Indicates whether or not an end user can specify the range using a mouse, without the use of sliders. */ + manualRangeSelectionEnabled?: boolean; + /** Indicates whether or not an end user can shift the selected range to the required location on a scale by clicking. */ + moveSelectedRangeByClick?: boolean; + /** Indicates whether to snap a slider to ticks. */ + snapToTicks?: boolean; + }; + /** Specifies the options required to display a chart as the range selector's background. */ + chart?: { + /** Specifies a coefficient for determining an indent from the bottom background boundary to the lowest chart point. */ + bottomIndent?: number; + /** An object defining the common configuration options for the chart’s series. */ + commonSeriesSettings?: viz.charts.CommonSeriesSettings; + /** An object providing options for managing data from a data source. */ + dataPrepareSettings?: { + /** Specifies whether or not to validate values from a data source. */ + checkTypeForAllData?: boolean; + /** Specifies whether or not to convert the values from a data source into the data type of an axis. */ + convertToAxisDataType?: boolean; + /** Specifies how to sort series points. */ + sortingMethod?: any; + }; + /** Specifies whether all bars in a series must have the same width, or may have different widths if any points in other series are missing. */ + equalBarWidth?: boolean; + /** Specifies a common bar width as a percentage from 0 to 1. */ + barWidth?: number; + /** Forces the widget to treat negative values as zeroes. Applies to stacked-like series only. */ + negativesAsZeroes?: boolean; + /** Sets the name of the palette to be used in the range selector's chart. Alternatively, an array of colors can be set as a custom palette to be used within this chart. */ + palette?: any; + /** An object defining the chart’s series. */ + series?: Array; + /** Defines options for the series template. */ + seriesTemplate?: viz.charts.SeriesTemplate; + /** Specifies a coefficient for determining an indent from the background's top boundary to the topmost chart point. */ + topIndent?: number; + /** Specifies whether or not to filter the series points depending on their quantity. */ + useAggregation?: boolean; + /** Specifies options for the chart's value axis. */ + valueAxis?: { + /** Indicates whether or not the chart's value axis must be inverted. */ + inverted?: boolean; + /** Specifies the value to be raised to a power when generating ticks for a logarithmic value axis. */ + logarithmBase?: number; + /** Specifies the maximum value of the chart's value axis. */ + max?: number; + /** Specifies the minimum value of the chart's value axis. */ + min?: number; + /** Specifies the type of the value axis. */ + type?: string; + /** Specifies the desired type of axis values. */ + valueType?: string; + }; + }; + /** Specifies the color of the parent page element. */ + containerBackgroundColor?: string; + /** Specifies a data source for the scale values and for the chart at the background. */ + dataSource?: any; + /** Specifies the data source field that provides data for the scale. */ + dataSourceField?: string; + /** Specifies the appearance of the loading indicator. */ + loadingIndicator?: viz.core.LoadingIndicator; + /** Specifies the blank space in pixels between the dxRangeSelector widget's extreme elements and the boundaries of the area provided for the widget (see size). */ + margin?: viz.core.Margins; + /** Specifies whether to redraw the widget when the size of the parent browser window changes or a mobile device rotates. */ + redrawOnResize?: boolean; + /** Specifies options of the range selector's scale. */ + scale?: { + /** Specifies the scale's end value. */ + endValue?: any; + /** Specifies common options for scale labels. */ + label?: { + /** Specifies a callback function that returns the text to be displayed in scale labels. */ + customizeText?: (scaleValue: { value: any; valueText: string; }) => string; + /** Specifies font options for the text displayed in the range selector's scale labels. */ + font?: viz.core.Font; + /** Specifies a format for the text displayed in scale labels. */ + format?: string; + /** Specifies a precision for the formatted value displayed in the scale labels. */ + precision?: number; + /** Specifies a spacing between scale labels and the background bottom edge. */ + topIndent?: number; + /** Specifies whether or not the scale's labels are visible. */ + visible?: boolean; + }; + /** Specifies the value to be raised to a power when generating ticks for a logarithmic scale. */ + logarithmBase?: number; + /** + * Specifies an interval between major ticks. + * @deprecated ..\tickInterval\tickInterval.md + */ + majorTickInterval?: any; + /** Specifies an interval between axis ticks. */ + tickInterval?: any; + /** Specifies options for the date-time scale's markers. */ + marker?: { + /** Defines the options that can be set for the text that is displayed by the scale markers. */ + label?: { + /** Specifies a callback function that returns the text to be displayed in scale markers. */ + customizeText?: (markerValue: { value: any; valueText: string }) => string; + /** Specifies a format for the text displayed in scale markers. */ + format?: string; + }; + /** Specifies the height of the marker's separator. */ + separatorHeight?: number; + /** Specifies the space between the marker label and the marker separator. */ + textLeftIndent?: number; + /** Specifies the space between the marker's label and the top edge of the marker's separator. */ + textTopIndent?: number; + /** Specified the indent between the marker and the scale lables. */ + topIndent?: number; + /** Indicates whether scale markers are visible. */ + visible?: boolean; + }; + /** Specifies the maximum range that can be selected. */ + maxRange?: any; + /** Specifies the number of minor ticks between neighboring major ticks. */ + minorTickCount?: number; + /** Specifies an interval between minor ticks. */ + minorTickInterval?: any; + /** Specifies the minimum range that can be selected. */ + minRange?: any; + /** Specifies the height of the space reserved for the scale in pixels. */ + placeholderHeight?: number; + /** Indicates whether or not to set ticks of a date-time scale at the beginning of each date-time interval. */ + setTicksAtUnitBeginning?: boolean; + /** Specifies whether or not to show ticks for the boundary scale values, when neither major ticks nor minor ticks are created for these values. */ + showCustomBoundaryTicks?: boolean; + /** + * Indicates whether or not to show minor ticks on the scale. + * @deprecated minorTick\visible.md + */ + showMinorTicks?: boolean; + /** Specifies the scale's start value. */ + startValue?: any; + /** Specifies options defining the appearance of scale ticks. */ + tick?: { + /** Specifies the color of scale ticks (both major and minor ticks). */ + color?: string; + /** Specifies the opacity of scale ticks (both major and minor ticks). */ + opacity?: number; + /** Specifies the width of the scale's ticks (both major and minor ticks). */ + width?: number; + }; + /** Specifies options of the range selector's minor ticks. */ + minorTick?: { + /** Specifies the color of the scale's minor ticks. */ + color?: string; + /** Specifies the opacity of the scale's minor ticks. */ + opacity?: number; + /** Specifies the width of the scale's minor ticks. */ + width?: number; + /** Indicates whether scale minor ticks are visible or not. */ + visible?: boolean; + }; + /** Specifies the type of the scale. */ + type?: string; + /** Specifies whether or not to expand the current tick interval if labels overlap each other. */ + useTicksAutoArrangement?: boolean; + /** Specifies the type of values on the scale. */ + valueType?: string; + /** Specifies the order of arguments on a discrete scale. */ + categories?: Array; + }; + /** Specifies the range to be selected when displaying the dxRangeSelector. */ + selectedRange?: { + /** Specifies the start value of the range to be selected when displaying the dxRangeSelector widget on a page. */ + startValue?: any; + /** Specifies the end value of the range to be selected when displaying the dxRangeSelector widget on a page. */ + endValue?: any; + }; + /** Specifies the color of the selected range. */ + selectedRangeColor?: string; + /** Range selector's indent options. */ + indent?: { + /** Specifies range selector's left indent. */ + left?: number; + /** Specifies range selector's right indent. */ + right?: number; + }; + /** A handler for the selectedRangeChanged event. */ + onSelectedRangeChanged?: (e: { + startValue: any; + endValue: any; + component: dxRangeSelector; + element: Element; + }) => void; + /** Specifies range selector shutter options. */ + shutter?: { + /** Specifies shutter color. */ + color?: string; + /** Specifies the opacity of the color of shutters. */ + opacity?: number; + }; + /** Specifies in pixels the size of the dxRangeSelector widget. */ + size?: viz.core.Size; + /** Specifies the appearance of the range selector's slider handles. */ + sliderHandle?: { + /** Specifies the color of the slider handles. */ + color?: string; + /** Specifies the opacity of the slider handles. */ + opacity?: number; + /** Specifies the width of the slider handles. */ + width?: number; + }; + /** Defines the options of the range selector slider markers. */ + sliderMarker?: { + /** Specifies the color of the slider markers. */ + color?: string; + /** Specifies a callback function that returns the text to be displayed by slider markers. */ + customizeText?: (scaleValue: { value: any; valueText: any; }) => string; + /** Specifies font options for the text displayed by the range selector slider markers. */ + font?: viz.core.Font; + /** Specifies a format for the text displayed in slider markers. */ + format?: string; + /** Specifies the color used for the slider marker text when the currently selected range does not match the minRange and maxRange values. */ + invalidRangeColor?: string; + /** + * Specifies the empty space between the marker's border and the marker’s text. + * @deprecated Use the 'paddingTopBottom' and 'paddingLeftRight' options instead + */ + padding?: number; + /** Specifies the empty space between the marker's top and bottom borders and the marker's text. */ + paddingTopBottom?: number; + /** Specifies the empty space between the marker's left and right borders and the marker's text. */ + paddingLeftRight?: number; + /** Specifies the placeholder height of the slider marker. */ + placeholderHeight?: number; + /** + * Specifies in pixels the height and width of the space reserved for the range selector slider markers. + * @deprecated Use the 'placeholderHeight' and 'indent' options instead + */ + placeholderSize?: { + /** Specifies the height of the placeholder for the left and right slider markers. */ + height?: number; + /** Specifies the width of the placeholder for the left and right slider markers. */ + width?: { + /** Specifies the width of the left slider marker's placeholder. */ + left?: number; + /** Specifies the width of the right slider marker's placeholder. */ + right?: number; + }; + }; + /** Specifies a precision for the formatted value displayed in slider markers. */ + precision?: number; + /** Indicates whether or not the slider markers are visible. */ + visible?: boolean; + }; + } + /** A widget that allows end users to select a range of values on a scale. */ + export class dxRangeSelector extends viz.core.BaseWidget { + constructor(element: JQuery, options?: dxRangeSelectorOptions); + constructor(element: Element, options?: dxRangeSelectorOptions); + /** Displays the loading indicator. */ + showLoadingIndicator(): void; + /** Conceals the loading indicator. */ + hideLoadingIndicator(): void; + /** Redraws a widget. */ + render(skipChartAnimation?: boolean): void; + /** Returns the currently selected range. */ + getSelectedRange(): { startValue: any; endValue: any; }; + /** Sets a specified range. */ + setSelectedRange(selectedRange: { startValue: any; endValue: any; }): void; + } +} +interface JQuery { + dxRangeSelector(options?: DevExpress.viz.rangeSelector.dxRangeSelectorOptions): JQuery; + dxRangeSelector(methodName: string, ...params: any[]): any; + dxRangeSelector(methodName: "instance"): DevExpress.viz.rangeSelector.dxRangeSelector; +} +declare module DevExpress.viz.map { + /** This section describes the fields and methods that can be used in code to manipulate the Layer object. */ + export interface MapLayer { + /** The name of the layer. */ + name: string; + /** The layer index in the layers array. */ + index: number; + /** The layer type. Can be "area", "line" or "marker". */ + type: string; + /** The type of the layer elements. */ + elementType: string; + /** Gets all layer elements. */ + getElements(): Array; + /** Deselects all layer elements. */ + clearSelection(): void; + } + /** This section describes the fields and methods that can be used in code to manipulate the Layer Element object. */ + export interface MapLayerElement { + /** The parent layer of the layer element. */ + layer: MapLayer; + /** Gets the layer element coordinates. */ + coordinates(): Object; + /** Sets the value of an attribute. */ + attribute(name: string, value: any): void; + /** Gets the value of an attribute. */ + attribute(name: string): any; + /** Gets the selection state of the layer element. */ + selected(): boolean; + /** Sets the selection state of the layer element. */ + selected(state: boolean): void; + /** Applies the layer element settings and updates element appearance. */ + applySettings(settings: any): void; + } + /** + * This section describes the fields and methods that can be used in code to manipulate the Area object. + * @deprecated Use the "Layer Element" instead + */ + export interface Area { + /** + * Contains the element type. + * @deprecated ..\..\Layer\2 Fields\type.md + */ + type: string; + /** + * Return the value of an attribute. + * @deprecated ..\..\Layer Element\3 Methods\attribute(name_value).md + */ + attribute(name: string): any; + /** + * Provides information about the selection state of an area. + * @deprecated Use the "selected()" method of the Layer Element + */ + selected(): boolean; + /** + * Sets a new selection state for an area. + * @deprecated Use the "selected(state)" method of the Layer Element + */ + selected(state: boolean): void; + /** + * Applies the area settings specified as a parameter and updates the area appearance. + * @deprecated ..\..\Layer Element\3 Methods\applySettings(settings).md + */ + applySettings(settings: any): void; + } + /** + * This section describes the fields and methods that can be used in code to manipulate the Markers object. + * @deprecated Use the "Layer Element" instead + */ + export interface Marker { + /** + * Contains the descriptive text accompanying the map marker. + * @deprecated Get the text with the "attribute" method (using the "layers.label.dataField" value) + */ + text: string; + /** + * Contains the type of the element. + * @deprecated ..\..\Layer\2 Fields\type.md + */ + type: string; + /** + * Contains the URL of an image map marker. + * @deprecated Get the url with the "attribute" method (using the "layers.dataField" value) + */ + url: string; + /** + * Contains the value of a bubble map marker. + * @deprecated Get the value with the "attribute" method (using the "layers.dataField" value) + */ + value: number; + /** + * Contains the values of a pie map marker. + * @deprecated Get the values with the "attribute" method (using the "layers.dataField" value) + */ + values: Array; + /** + * Returns the value of an attribute. + * @deprecated ..\..\Layer Element\3 Methods\attribute(name_value).md + */ + attribute(name: string): any; + /** + * Returns the coordinates of a specific marker. + * @deprecated ..\..\Layer Element\3 Methods\coordinates().md + */ + coordinates(): Array; + /** + * Provides information about the selection state of a marker. + * @deprecated Use the "selected()" method of the Layer Element + */ + selected(): boolean; + /** + * Sets a new selection state for a marker. + * @deprecated Use the "selected(state)" method of the Layer Element + */ + selected(state: boolean): void; + /** + * Applies the marker settings specified as a parameter and updates marker appearance. + * @deprecated ..\..\Layer Element\3 Methods\applySettings(settings).md + */ + applySettings(settings: any): void; + } + export interface MapLayerSettings { + /** Specifies the layer name. */ + name?: string; + /** Specifies layer type. */ + type?: string; + /** Specifies the type of a marker element. Setting this option makes sense only if the layer type is "marker". */ + elementType?: string; + /** Specifies a data source for the layer. */ + data?: any; + /** Specifies the line width (for layers of a line type) or width of the layer elements border in pixels. */ + borderWidth?: number; + /** Specifies a color for the border of the layer elements. */ + borderColor?: string; + /** Specifies a color for layer elements. */ + color?: string; + /** Specifies a color for the border of the layer element when it is hovered over. */ + hoveredBorderColor?: string; + /** Specifies the pixel-measured line width (for layers of a line type) or width for the border of the layer element when it is hovered over. */ + hoveredBorderWidth?: number; + /** Specifies a color for a layer element when it is hovered over. */ + hoveredColor?: string; + /** Specifies a pixel-measured line width (for layers of a line type) or width for the border of the layer element when it is selected. */ + selectedBorderWidth?: number; + /** Specifies a color for the border of the layer element when it is selected. */ + selectedBorderColor?: string; + /** Specifies a color for the layer element when it is selected. */ + selectedColor?: string; + /** Specifies the layer opacity (from 0 to 1). */ + opacity?: number; + /** Specifies the size of markers. Setting this option makes sense only if the layer type is "marker" and the elementType is "dot", "pie" or "image". */ + size?: number; + /** Specifies the pixel-measured diameter of the marker that represents the smallest value. Setting this option makes sense only if the layer type is "marker". */ + minSize?: number; + /** Specifies the pixel-measured diameter of the marker that represents the biggest value. Setting this option makes sense only if the layer type is "marker". */ + maxSize?: number; + /** Specifies whether or not to change the appearance of a layer element when it is hovered over. */ + hoverEnabled?: boolean; + /** Specifies whether single or multiple map elements can be selected on a vector map. */ + selectionMode?: string; + /** Specifies the name of the palette or a custom range of colors to be used for coloring a layer. */ + palette?: any; + /** Specifies the number of colors in a palette. */ + paletteSize?: number; + /** Allows you to paint layer elements with similar attributes in the same color. */ + colorGroups?: Array; + /** Specifies the field that provides data to be used for coloring of layer elements. */ + colorGroupingField?: string; + /** Allows you to display bubbles with similar attributes in the same size. Setting this option makes sense only if the layer type is "marker" and the elementType is "bubble". */ + sizeGroups?: Array; + /** Specifies the field that provides data to be used for sizing bubble markers. Setting this option makes sense only if the layer type is "marker" and the elementType is "bubble". */ + sizeGroupingField?: string; + /** Specifies the name of the attribute containing marker data. Setting this option makes sense only if the layer type is "marker" and the elementType is "bubble", "pie" or "image". */ + dataField?: string; + /** Specifies the function that customizes each layer element individually. */ + customize?: (eleemnts: Array) => void; + /** Specifies marker label options. */ + label?: { + /** The name of the data attribute containing marker texts. */ + dataField?: string; + /** Enables marker labels. */ + enabled?: boolean; + /** Specifies font options for marker labels. */ + font?: viz.core.Font; + }; + } + export interface AreaSettings { + /** + * Specifies the width of the area border in pixels. + * @deprecated ..\layers\borderWidth.md + */ + borderWidth?: number; + /** + * Specifies a color for the area border. + * @deprecated ..\layers\borderColor.md + */ + borderColor?: string; + /** + * Specifies a color for an area. + * @deprecated ..\layers\color.md + */ + color?: string; + /** + * Specifies the function that customizes each area individually. + * @deprecated ..\layers\customize.md + */ + customize?: (areaInfo: Area) => AreaSettings; + /** + * Specifies a color for the area border when the area is hovered over. + * @deprecated ..\layers\hoveredBorderColor.md + */ + hoveredBorderColor?: string; + /** + * Specifies the pixel-measured width of the area border when the area is hovered over. + * @deprecated ..\layers\hoveredBorderWidth.md + */ + hoveredBorderWidth?: number; + /** + * Specifies a color for an area when this area is hovered over. + * @deprecated ..\layers\hoveredColor.md + */ + hoveredColor?: string; + /** + * Specifies whether or not to change the appearance of an area when it is hovered over. + * @deprecated ..\layers\hoverEnabled.md + */ + hoverEnabled?: boolean; + /** + * Configures area labels. + * @deprecated ..\..\layers\label\label.md + */ + label?: { + /** + * Specifies the data field that provides data for area labels. + * @deprecated ..\..\layers\label\dataField.md + */ + dataField?: string; + /** + * Enables area labels. + * @deprecated ..\..\layers\label\enabled.md + */ + enabled?: boolean; + /** + * Specifies font options for area labels. + * @deprecated ..\..\..\layers\label\font\font.md + */ + font?: viz.core.Font; + }; + /** + * Specifies the name of the palette or a custom range of colors to be used for coloring a map. + * @deprecated ..\layers\palette.md + */ + palette?: any; + /** + * Specifies the number of colors in a palette. + * @deprecated ..\layers\paletteSize.md + */ + paletteSize?: number; + /** + * Allows you to paint areas with similar attributes in the same color. + * @deprecated ..\layers\colorGroups.md + */ + colorGroups?: Array; + /** + * Specifies the field that provides data to be used for coloring areas. + * @deprecated ..\layers\colorGroupingField.md + */ + colorGroupingField?: string; + /** + * Specifies a color for the area border when the area is selected. + * @deprecated ..\layers\selectedBorderColor.md + */ + selectedBorderColor?: string; + /** + * Specifies a color for an area when this area is selected. + * @deprecated ..\layers\selectedColor.md + */ + selectedColor?: string; + /** + * Specifies the pixel-measured width of the area border when the area is selected. + * @deprecated ..\layers\selectedBorderWidth.md + */ + selectedBorderWidth?: number; + /** + * Specifies whether single or multiple areas can be selected on a vector map. + * @deprecated ..\layers\selectionMode.md + */ + selectionMode?: string; + } + export interface MarkerSettings { + /** + * Specifies a color for the marker border. + * @deprecated ..\layers\borderColor.md + */ + borderColor?: string; + /** + * Specifies the width of the marker border in pixels. + * @deprecated ..\layers\borderWidth.md + */ + borderWidth?: number; + /** + * Specifies a color for a marker of the dot or bubble type. + * @deprecated ..\layers\color.md + */ + color?: string; + /** + * Specifies the function that customizes each marker individually. + * @deprecated ..\layers\customize.md + */ + customize?: (markerInfo: Marker) => MarkerSettings; + /** + * Specifies the pixel-measured width of the marker border when the marker is hovered over. + * @deprecated ..\layers\hoveredBorderWidth.md + */ + hoveredBorderWidth?: number; + /** + * Specifies a color for the marker border when the marker is hovered over. + * @deprecated ..\layers\hoveredBorderColor.md + */ + hoveredBorderColor?: string; + /** + * Specifies a color for a marker of the dot or bubble type when this marker is hovered over. + * @deprecated ..\layers\hoveredColor.md + */ + hoveredColor?: string; + /** + * Specifies whether or not to change the appearance of a marker when it is hovered over. + * @deprecated ..\layers\hoverEnabled.md + */ + hoverEnabled?: boolean; + /** + * Specifies marker label options. + * @deprecated ..\..\layers\label\label.md + */ + label?: { + /** + * Enables marker labels. + * @deprecated ..\..\layers\label\enabled.md + */ + enabled?: boolean; + /** + * Specifies font options for marker labels. + * @deprecated ..\..\..\layers\label\font\font.md + */ + font?: viz.core.Font; + }; + /** + * Specifies the pixel-measured diameter of the marker that represents the biggest value. Setting this option makes sense only if you use markers of the bubble type. + * @deprecated ..\layers\maxSize.md + */ + maxSize?: number; + /** + * Specifies the pixel-measured diameter of the marker that represents the smallest value. Setting this option makes sense only if you use markers of the bubble type. + * @deprecated ..\layers\minSize.md + */ + minSize?: number; + /** + * Specifies the opacity of markers. Setting this option makes sense only if you use markers of the bubble type. + * @deprecated ..\layers\opacity.md + */ + opacity?: number; + /** + * Specifies the pixel-measured width of the marker border when the marker is selected. + * @deprecated ..\layers\selectedBorderWidth.md + */ + selectedBorderWidth?: number; + /** + * Specifies a color for the marker border when the marker is selected. + * @deprecated ..\layers\selectedBorderColor.md + */ + selectedBorderColor?: string; + /** + * Specifies a color for a marker of the dot or bubble type when this marker is selected. + * @deprecated ..\layers\selectedColor.md + */ + selectedColor?: string; + /** + * Specifies whether a single or multiple markers can be selected on a vector map. + * @deprecated ..\layers\selectionMode.md + */ + selectionMode?: string; + /** + * Specifies the size of markers. Setting this option makes sense for any type of marker except bubble. + * @deprecated ..\layers\size.md + */ + size?: number; + /** + * Specifies the type of markers to be used on the map. + * @deprecated ..\layers\elementType.md + */ + type?: string; + /** + * Specifies the name of a palette or a custom set of colors to be used for coloring markers of the pie type. + * @deprecated ..\layers\palette.md + */ + palette?: any; + /** + * Allows you to paint markers with similar attributes in the same color. + * @deprecated ..\layers\colorGroups.md + */ + colorGroups?: Array; + /** + * Specifies the field that provides data to be used for coloring markers. + * @deprecated ..\layers\colorGroupingField.md + */ + colorGroupingField?: string; + /** + * Allows you to display bubbles with similar attributes in the same size. + * @deprecated ..\layers\sizeGroups.md + */ + sizeGroups?: Array; + /** + * Specifies the field that provides data to be used for sizing bubble markers. + * @deprecated ..\layers\sizeGroupingField.md + */ + sizeGroupingField?: string; + } + export interface dxVectorMapOptions extends viz.core.BaseWidgetOptions { + /** + * An object specifying options for the map areas. + * @deprecated Use the 'layers' option instead + */ + areaSettings?: AreaSettings; + /** Specifies the options for the map background. */ + background?: { + /** Specifies a color for the background border. */ + borderColor?: string; + /** Specifies a color for the background. */ + color?: string; + }; + /** Specifies options for dxVectorMap widget layers. */ + layers?: Array; + /** Specifies the map projection. */ + projection?: Object; + /** Specifies the positioning of a map in geographical coordinates. */ + bounds?: Array; + /** Specifies the options of the control bar. */ + controlBar?: { + /** Specifies a color for the outline of the control bar elements. */ + borderColor?: string; + /** Specifies a color for the inner area of the control bar elements. */ + color?: string; + /** Specifies whether or not to display the control bar. */ + enabled?: boolean; + /** Specifies the margin of the control bar in pixels. */ + margin?: number; + /** Specifies the position of the control bar. */ + horizontalAlignment?: string; + /** Specifies the position of the control bar. */ + verticalAlignment?: string; + /** Specifies the opacity of the Control_Bar. */ + opacity?: number; + }; + /** Specifies the appearance of the loading indicator. */ + loadingIndicator?: viz.core.LoadingIndicator; + /** + * Specifies a data source for the map area. + * @deprecated Use the 'layers.data' option instead + */ + mapData?: any; + /** + * Specifies a data source for the map markers. + * @deprecated Use the 'layers.data' option instead + */ + markers?: any; + /** + * An object specifying options for the map markers. + * @deprecated Use the 'layers' option instead + */ + markerSettings?: MarkerSettings; + /** Specifies the size of the dxVectorMap widget. */ + size?: viz.core.Size; + /** Specifies a title for the vector map. */ + title?: viz.core.Title; + /** Specifies tooltip options. */ + tooltip?: viz.core.Tooltip; + /** Configures map legends. */ + legends?: Array; + /** Specifies whether or not the map should respond when a user rolls the mouse wheel. */ + wheelEnabled?: boolean; + /** Specifies whether the map should respond to touch gestures. */ + touchEnabled?: boolean; + /** Disables the zooming capability. */ + zoomingEnabled?: boolean; + /** Specifies the geographical coordinates of the center for a map. */ + center?: Array; + /** A handler for the centerChanged event. */ + onCenterChanged?: (e: { + center: Array; + component: dxVectorMap; + element: Element; + }) => void; + /** A handler for the tooltipShown event. */ + onTooltipShown?: (e: { + component: dxVectorMap; + element: Element; + target: {}; + }) => void; + /** A handler for the tooltipHidden event. */ + onTooltipHidden?: (e: { + component: dxVectorMap; + element: Element; + target: {}; + }) => void; + /** Specifies a number that is used to zoom a map initially. */ + zoomFactor?: number; + /** Specifies a map's maximum zoom factor. */ + maxZoomFactor?: number; + /** A handler for the zoomFactorChanged event. */ + onZoomFactorChanged?: (e: { + component: dxVectorMap; + element: Element; + zoomFactor: number; + }) => void; + /** A handler for the click event. */ + onClick?: any; + /** A handler for the selectionChanged event. */ + onSelectionChanged?: (e: { + component: dxVectorMap; + element: Element; + target: MapLayerElement; + }) => void; + /** + * A handler for the areaClick event. + * @deprecated Use the 'onClick' option instead + */ + onAreaClick?: any; + /** + * A handler for the areaSelectionChanged event. + * @deprecated Use the 'onSelectionChanged' option instead + */ + onAreaSelectionChanged?: (e: { + target: Area; + component: dxVectorMap; + element: Element; + }) => void; + /** + * A handler for the markerClick event. + * @deprecated Use the 'onClick' option instead + */ + onMarkerClick?: any; + /** + * A handler for the markerSelectionChanged event. + * @deprecated Use the 'onSelecitonChanged' option instead + */ + onMarkerSelectionChanged?: (e: { + target: Marker; + component: dxVectorMap; + element: Element; + }) => void; + /** Disables the panning capability. */ + panningEnabled?: boolean; + } + export interface Legend extends viz.core.BaseLegend { + /** Specifies the color of item markers in the legend. The specified color applied only when the legend uses 'size' source. */ + markerColor?: string; + /** Specifies text for legend items. */ + customizeText?: (itemInfo: { start: number; end: number; index: number; color: string; size: number; }) => string; + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the text of a legend item. */ + customizeHint?: (itemInfo: { start: number; end: number; index: number; color: string; size: number }) => string; + /** Specifies the source of data for the legend. */ + source?: { + /** Specifies a layer to which the legend belongs. */ + layer?: string; + /** Specifies the type of the legend grouping. */ + grouping?: string; + } + } + /** A vector map widget. */ + export class dxVectorMap extends viz.core.BaseWidget { + constructor(element: JQuery, options?: dxVectorMapOptions); + constructor(element: Element, options?: dxVectorMapOptions); + /** Displays the loading indicator. */ + showLoadingIndicator(): void; + /** Conceals the loading indicator. */ + hideLoadingIndicator(): void; + /** Redraws a widget. */ + render(): void; + /** Gets the current coordinates of the map center. */ + center(): Array; + /** Sets the coordinates of the map center. */ + center(centerCoordinates: Array): void; + /** + * Deselects all the selected areas on a map. The areas are displayed in their initial style after. + * @deprecated Use the 'clearSelection' method on a layer instead + */ + clearAreaSelection(): void; + /** + * Deselects all the selected markers on a map. The markers are displayed in their initial style after. + * @deprecated Use the 'clearSelection' method on a layer instead + */ + clearMarkerSelection(): void; + /** Deselects all the selected area and markers on a map at once. The areas and markers are displayed in their initial style after. */ + clearSelection(): void; + /** Converts client area coordinates into map coordinates. */ + convertCoordinates(x: number, y: number): Array; + /** Gets all map layers. */ + getLayers(): Array; + /** Gets the layer by its index. */ + getLayerByIndex(index: number): MapLayer; + /** Gets the layer by its name. */ + getLayerByName(name: string): MapLayer; + /** + * Returns an array with all the map areas. + * @deprecated Use the 'getElements' method on a layer instead + */ + getAreas(): Array; + /** + * Returns an array with all the map markers. + * @deprecated Use the 'getElements' method on a layer instead + */ + getMarkers(): Array; + /** Gets the current coordinates of the map viewport. */ + viewport(): Array; + /** Sets the coordinates of the map viewport. */ + viewport(viewportCoordinates: Array): void; + /** Gets the current value of the map zoom factor. */ + zoomFactor(): number; + /** Sets the value of the map zoom factor. */ + zoomFactor(zoomFactor: number): void; + } + export var projection: ProjectionCreator; + export interface ProjectionCreator { + /** Creates a new projection. */ + (data: { + to?: (coordinates: Array) => Array; + from?: (coordinates: Array) => Array; + aspectRatio?: number; + }): Object; + /** Gets the default or custom projection from the projection storage. */ + get(name: string): Object; + /** Adds a new projection to the internal projections storage. */ + add(name: string, projection: Object): void; + } +} +interface JQuery { + dxVectorMap(options?: DevExpress.viz.map.dxVectorMapOptions): JQuery; + dxVectorMap(methodName: string, ...params: any[]): any; + dxVectorMap(methodName: "instance"): DevExpress.viz.map.dxVectorMap; +} +declare module DevExpress.viz.sparklines { + export interface SparklineTooltip extends viz.core.Tooltip { + /** + * Specifies how a tooltip is horizontally aligned relative to the graph. + * @deprecated Tooltip alignment is no more available. + */ + horizontalAlignment?: string; + /** + * Specifies how a tooltip is vertically aligned relative to the graph. + * @deprecated Tooltip alignment is no more available. + */ + verticalAlignment?: string; + } + export interface BaseSparklineOptions extends viz.core.BaseWidgetOptions { + /** Specifies the blank space between the widget's extreme elements and the boundaries of the area provided for the widget in pixels. */ + margin?: viz.core.Margins; + /** Specifies the size of the widget. */ + size?: viz.core.Size; + /** Specifies tooltip options. */ + tooltip?: SparklineTooltip; + /** A handler for the tooltipShown event. */ + onTooltipShown?: (e: { + component: BaseSparkline; + element: Element; + }) => void; + /** A handler for the tooltipHidden event. */ + onTooltipHidden?: (e: { + component: BaseSparkline; + element: Element; + }) => void; + } + /** Overridden by descriptions for particular widgets. */ + export class BaseSparkline extends viz.core.BaseWidget { + /** Redraws a widget. */ + render(): void; + } + export interface dxBulletOptions extends BaseSparkline { + /** Specifies a color for the bullet bar. */ + color?: string; + /** Specifies an end value for the invisible scale. */ + endScaleValue?: number; + /** Specifies whether or not to show the target line. */ + showTarget?: boolean; + /** Specifies whether or not to show the line indicating zero on the invisible scale. */ + showZeroLevel?: boolean; + /** Specifies a start value for the invisible scale. */ + startScaleValue?: number; + /** Specifies the value indicated by the target line. */ + target?: number; + /** Specifies a color for both the target and zero level lines. */ + targetColor?: string; + /** Specifies the width of the target line. */ + targetWidth?: number; + /** Specifies the primary value indicated by the bullet bar. */ + value?: number; + } + /** A bullet graph widget. */ + export class dxBullet extends BaseSparkline { + constructor(element: JQuery, options?: dxBulletOptions); + constructor(element: Element, options?: dxBulletOptions); + } + export interface dxSparklineOptions extends BaseSparklineOptions { + /** Specifies the data source field that provides arguments for a sparkline. */ + argumentField?: string; + /** Sets a color for the bars indicating negative values. Available for a sparkline of the bar type only. */ + barNegativeColor?: string; + /** Sets a color for the bars indicating positive values. Available for a sparkline of the bar type only. */ + barPositiveColor?: string; + /** Specifies a data source for the sparkline. */ + dataSource?: Array; + /** Sets a color for the boundary of both the first and last points on a sparkline. */ + firstLastColor?: string; + /** Specifies whether a sparkline ignores null data points or not. */ + ignoreEmptyPoints?: boolean; + /** Sets a color for a line on a sparkline. Available for the sparklines of the line- and area-like types. */ + lineColor?: string; + /** Specifies a width for a line on a sparkline. Available for the sparklines of the line- and area-like types. */ + lineWidth?: number; + /** Sets a color for the bars indicating the values that are less than the winloss threshold. Available for a sparkline of the winloss type only. */ + lossColor?: string; + /** Sets a color for the boundary of the maximum point on a sparkline. */ + maxColor?: string; + /** Sets a color for the boundary of the minimum point on a sparkline. */ + minColor?: string; + /** Sets a color for points on a sparkline. Available for the sparklines of the line- and area-like types. */ + pointColor?: string; + /** Specifies the diameter of sparkline points in pixels. Available for the sparklines of line- and area-like types. */ + pointSize?: number; + /** Specifies a symbol to use as a point marker on a sparkline. Available for the sparklines of the line- and area-like types. */ + pointSymbol?: string; + /** Specifies whether or not to indicate both the first and last values on a sparkline. */ + showFirstLast?: boolean; + /** Specifies whether or not to indicate both the minimum and maximum values on a sparkline. */ + showMinMax?: boolean; + /** Determines the type of a sparkline. */ + type?: string; + /** Specifies the data source field that provides values for a sparkline. */ + valueField?: string; + /** Sets a color for the bars indicating the values greater than a winloss threshold. Available for a sparkline of the winloss type only. */ + winColor?: string; + /** Specifies a value that serves as a threshold for the sparkline of the winloss type. */ + winlossThreshold?: number; + /** Specifies the minimum value of the sparkline value axis. */ + minValue?: number; + /** Specifies the maximum value of the sparkline's value axis. */ + maxValue?: number; + } + /** A sparkline widget. */ + export class dxSparkline extends BaseSparkline { + constructor(element: JQuery, options?: dxSparklineOptions); + constructor(element: Element, options?: dxSparklineOptions); + } +} +interface JQuery { + dxBullet(options?: DevExpress.viz.sparklines.dxBulletOptions): JQuery; + dxBullet(methodName: string, ...params: any[]): any; + dxBullet(methodName: "instance"): DevExpress.viz.sparklines.dxBullet; + dxSparkline(options?: DevExpress.viz.sparklines.dxSparklineOptions): JQuery; + dxSparkline(methodName: string, ...params: any[]): any; + dxSparkline(methodName: "instance"): DevExpress.viz.sparklines.dxSparkline; +} diff --git a/devextreme/devextreme.d.ts b/devextreme/devextreme.d.ts index 3a7d42e05a..d8b1149efd 100644 --- a/devextreme/devextreme.d.ts +++ b/devextreme/devextreme.d.ts @@ -1,4 +1,4 @@ -// Type definitions for DevExtreme 15.2.9 +// Type definitions for DevExtreme 15.2.10 // Project: http://js.devexpress.com/ // Definitions by: DevExpress Inc. // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -192,19 +192,19 @@ declare module DevExpress { /** The position object specifies the widget positioning options. */ export interface PositionOptions { /** The target element position that the widget is positioned against. */ - at?: string; + at?: any; /** The element within which the widget is positioned. */ - boundary?: Element; - /** A string value holding horizontal and vertical offset from the window's boundaries. */ - boundaryOffset?: string; + boundary?: Object; + /** Specifies the horizontal and vertical offset from the window's boundaries. */ + boundaryOffset?: any; /** Specifies how to move the widget if it overflows the screen. */ collision?: any; /** The position of the widget to align against the target element. */ - my?: string; + my?: any; /** The target element that the widget is positioned against. */ - of?: HTMLElement; - /** A string value holding horizontal and vertical offset in pixels, separated by a space (e.g., "5 -10"). */ - offset?: string; + of?: Object; + /** Specifies horizontal and vertical offset in pixels. */ + offset?: any; } export interface ComponentOptions { /** A handler for the initialized event. */ @@ -243,6 +243,8 @@ declare module DevExpress { height?: any; /** Specifies the width of the widget. */ width?: any; + /** A bag for holding any options that require two-way binding (Angular approach specific) */ + bindingOptions?: { [key: string]: any; }; } /** A base class for all components. */ export class DOMComponent extends Component { @@ -371,6 +373,8 @@ declare module DevExpress { then(doneFn?: Function, failFn?: Function, progressFn?: Function): Promise; } export interface CustomStoreOptions extends StoreOptions { + /** Specifies whether or not the store combines the search expression with the filter expression. */ + useDefaultSearch?: boolean; /** The user implementation of the byKey(key, extraOptions) method. */ byKey?: (key: any) => Promise; /** The user implementation of the insert(values) method. */ @@ -414,6 +418,8 @@ declare module DevExpress { select?: Object; /** An array of the strings that represent the names of the navigation properties to be loaded simultaneously with the OData store's entity. */ expand?: Object; + /** The bag of custom parameters passed to the query executed when the DataSource load operation is invoked. */ + customQueryParams?: Object; /** Specifies whether or not the DataSource instance requests the total count of items available in the storage. */ requireTotalCount?: boolean; /** Specifies the initial sort option value. */ @@ -477,7 +483,7 @@ declare module DevExpress { /** Returns the searchExpr option value. */ searchExpr(): Object; /** Sets the searchExpr option value. */ - searchExpr(expr: Object): void; + searchExpr(...expr: Object[]): void; /** Returns the currently specified search operation. */ searchOperation(): string; /** Sets the current search operation. */ @@ -502,6 +508,7 @@ declare module DevExpress { store(): Store; /** Returns the number of data items available in an underlying Store after the last load() operation without paging. */ totalCount(): number; + /** Cancels the load operation associated with the specified identifier. */ cancel(operationId: number): boolean; on(eventName: "loadingChanged", eventHandler: (isLoading: boolean) => void): DataSource; on(eventName: "loadError", eventHandler: (e?: Error) => void): DataSource; @@ -913,7 +920,7 @@ declare module DevExpress.ui { /** Specifies whether or not the widget displays unfiltered values until a user types a number of characters exceeding the minSearchLength option value. */ showDataBeforeSearch?: boolean; /** Specifies the name of a data source item field or an expression whose value is compared to the search criterion. */ - searchExpr?: Object; + searchExpr?: any; /** Specifies the binary operation used to filter data. */ searchMode?: string; /** Specifies the time delay, in milliseconds, after the last character has been typed in, before a search is executed. */ @@ -926,7 +933,7 @@ declare module DevExpress.ui { searchEnabled?: boolean; /** * Specifies whether or not the widget displays items by pages. - * @deprecated dataSource.paginate.md + * @deprecated Use the DataSource paging opportunities instead. */ pagingEnabled?: boolean; /** The text or HTML markup displayed by the widget if the item collection is empty. */ @@ -954,7 +961,12 @@ declare module DevExpress.ui { constructor(element: Element, options?: dxToolbarOptions); } export interface dxToastOptions extends dxOverlayOptions { - animation?: fx.AnimationOptions; + animation?: { + /** An object that defines the animation options used when the widget is being shown. */ + show?: fx.AnimationOptions; + /** An object that defines the animation options used when the widget is being hidden. */ + hide?: fx.AnimationOptions; + }; /** The time span in milliseconds during which the dxToast widget is visible. */ displayTime?: number; height?: any; @@ -1130,6 +1142,11 @@ declare module DevExpress.ui { reachBottomText?: string; /** Specifies the text shown in the pullDown panel displayed when the content is being refreshed. */ refreshingText?: string; + } + /** A widget used to display scrollable content. */ + export class dxScrollView extends dxScrollable { + constructor(element: JQuery, options?: dxScrollViewOptions); + constructor(element: Element, options?: dxScrollViewOptions); /** Returns a value indicating if the scrollView content is larger then the widget container. */ isFull(): boolean; /** Locks the widget until the release(preventScrollBottom) method is called and executes the function passed to the onPullDown option and the handler assigned to the pullDown event. */ @@ -1139,11 +1156,6 @@ declare module DevExpress.ui { /** Toggles the loading state of the widget. */ toggleLoading(showOrHide: boolean): void; } - /** A widget used to display scrollable content. */ - export class dxScrollView extends dxScrollable { - constructor(element: JQuery, options?: dxScrollViewOptions); - constructor(element: Element, options?: dxScrollViewOptions); - } export interface dxScrollableLocation { top?: number; left?: number; @@ -1211,8 +1223,27 @@ declare module DevExpress.ui { constructor(element: JQuery, options?: dxRadioGroupOptions); constructor(element: Element, options?: dxRadioGroupOptions); } + export interface dxPopupButtonOptions { + /** Specifies whether or not a toolbar item must be displayed disabled. */ + disabled?: boolean; + /** Specifies html code inserted into the toolbar item element. */ + html?: string; + /** Specifies a location for the item on the toolbar. */ + location?: string; + /** Specifies a configuration object for the widget that presents a toolbar item. */ + options?: Object; + /** Specifies an item template that should be used to render this item only. */ + template?: any; + /** Specifies text displayed for the toolbar item. */ + text?: string; + /** Specifies whether the item is displayed on a top or bottom toolbar. */ + toolbar?: string; + /** Specifies whether or not a widget item must be displayed. */ + visible?: boolean; + /** A widget that presents a toolbar item. */ + widget?: string; + } export interface dxPopupOptions extends dxOverlayOptions { - animation?: fx.AnimationOptions; /** Specifies whether or not to allow a user to drag the popup window. */ dragEnabled?: boolean; /** A Boolean value specifying whether or not to display the widget in full-screen mode. */ @@ -1226,7 +1257,7 @@ declare module DevExpress.ui { titleTemplate?: any; width?: any; /** Specifies items displayed on the top or bottom toolbar of the popup window. */ - buttons?: Array; + buttons?: Array; /** Specifies whether or not the widget displays the Close button. */ showCloseButton?: boolean; /** A handler for the titleRendered event. */ @@ -1238,8 +1269,13 @@ declare module DevExpress.ui { constructor(element: Element, options?: dxPopupOptions); } export interface dxPopoverOptions extends dxPopupOptions { - /** An object defining animation options of the widget. */ - animation?: fx.AnimationOptions; + /** An object that defines the animation options of the widget. */ + animation?: { + /** An object that defines the animation options used when the widget is being shown. */ + show?: fx.AnimationOptions; + /** An object that defines the animation options used when the widget is being hidden. */ + hide?: fx.AnimationOptions; + }; /** Specifies the height of the widget. */ height?: any; /** An object defining widget positioning options. */ @@ -1261,7 +1297,12 @@ declare module DevExpress.ui { } export interface dxOverlayOptions extends WidgetOptions { /** An object that defines the animation options of the widget. */ - animation?: fx.AnimationOptions; + animation?: { + /** An object that defines the animation options used when the widget is being shown. */ + show?: fx.AnimationOptions; + /** An object that defines the animation options used when the widget is being hidden. */ + hide?: fx.AnimationOptions; + }; /** A Boolean value specifying whether or not the widget is closed if a user presses the Back hardware button. */ closeOnBackButton?: boolean; /** A Boolean value specifying whether or not the widget is closed if a user clicks outside of the overlapping window. */ @@ -1435,8 +1476,14 @@ declare module DevExpress.ui { removeRoute(route: any): JQueryPromise; } export interface dxLookupOptions extends dxDropDownListOptions { - /** An object defining widget animation options. */ - animation?: fx.AnimationOptions; + applyValueMode?: string; + /** An object that defines widget animation options. */ + animation?: { + /** An object that defines the animation options used when the widget is being shown. */ + show?: fx.AnimationOptions; + /** An object that defines the animation options used when the widget is being hidden. */ + hide?: fx.AnimationOptions; + }; /** The text displayed on the Cancel button. */ cancelButtonText?: string; /** The text displayed on the Clear button. */ @@ -1492,7 +1539,7 @@ declare module DevExpress.ui { showCancelButton?: boolean; /** * A Boolean value specifying whether the widget loads the next page automatically when you reach the bottom of the list or when a button is clicked. - * @deprecated pageLoadMode.md + * @deprecated Use the pageLoadMode option instead. */ showNextButton?: boolean; /** The title of the lookup window. */ @@ -1516,7 +1563,6 @@ declare module DevExpress.ui { export class dxLookup extends dxDropDownList { constructor(element: JQuery, options?: dxLookupOptions); constructor(element: Element, options?: dxLookupOptions); - /** This section lists the data source fields that are used in a default template for lookup drop-down items. */ } export interface dxLoadPanelOptions extends dxOverlayOptions { /** An object defining the animation options of the widget. */ @@ -1550,6 +1596,13 @@ declare module DevExpress.ui { constructor(element: JQuery, options?: dxLoadIndicatorOptions); constructor(element: Element, options?: dxLoadIndicatorOptions); } + /** An object containing items for a context menu called for a list item. */ + export interface ListOptionsMenuItem { + /** Specifies the menu item text. */ + text?: string; + /** Specifies the function called when the menu item is clicked. */ + action?: (itemElement: Element, itemData: any) => void; + } export interface dxListOptions extends CollectionWidgetOptions { /** A Boolean value specifying whether or not to display a grouped list. */ grouped?: boolean; @@ -1609,7 +1662,7 @@ declare module DevExpress.ui { selectAllText?: string; onSelectAllChanged?: Function; /** Specifies the array of items for a context menu called for a list item. */ - menuItems?: Array; + menuItems?: Array; /** Specifies whether an item context menu is shown when a user holds or swipes an item. */ menuMode?: string; /** Specifies whether or not an end user can delete list items. */ @@ -1751,14 +1804,14 @@ declare module DevExpress.ui { placeholder?: string; /** * Specifies whether or not a user can pick out a date using the drop-down calendar. - * @deprecated Use 'pickerType' option instead. + * @deprecated Use the pickerType option instead. */ useCalendar?: boolean; /** An object or a value, specifying the date and time currently selected using the date box. */ value?: any; /** * Specifies whether or not the widget uses the native HTML input element. - * @deprecated Use 'pickerType' option instead. + * @deprecated Use the pickerType option instead. */ useNative?: boolean; /** Specifies the interval between neighboring values in the popup list in minutes. */ @@ -1801,10 +1854,12 @@ declare module DevExpress.ui { currentDate?: Date; /** Specifies the first day of a week. */ firstDayOfWeek?: number; + /** An object or a value, specifying the date and time currently selected in the calendar. */ + value?: any; /** The latest date the widget allows to select. */ - max?: Date; + max?: any; /** The earliest date the widget allows to select. */ - min?: Date; + min?: any; /** Specifies whether or not the widget displays a button that selects the current date. */ showTodayButton?: boolean; /** Specifies the current calendar zoom level. */ @@ -1843,7 +1898,7 @@ declare module DevExpress.ui { constructor(element: JQuery, options?: dxButtonOptions); constructor(element: Element, options?: dxButtonOptions); } - export interface dxBoxOptions extends CollectionWidget { + export interface dxBoxOptions extends CollectionWidgetOptions { /** Specifies how widget items are aligned along the main direction. */ align?: string; /** Specifies the direction of item positioning in the widget. */ @@ -2189,6 +2244,8 @@ declare module DevExpress.ui { updateDimensions(): JQueryPromise; /** Validates the values of all editors on the form against the list of the validation rules specified for each form item. */ validate(): Object; + /** Resets the editor's value to undefined. */ + resetValues(): void; } } interface JQuery { @@ -2577,7 +2634,6 @@ declare module DevExpress.ui { export class dxDropDownMenu extends Widget { constructor(element: JQuery, options?: dxDropDownEditorOptions); constructor(element: Element, options?: dxDropDownEditorOptions); - /** This section lists the data source fields that are used in a default template for drop-down menu items. */ /** Opens the drop-down menu. */ open(): void; /** Closes the drop-down menu. */ @@ -2850,7 +2906,7 @@ declare module DevExpress.data { declare module DevExpress.ui { export interface dxSchedulerOptions extends WidgetOptions { /** Specifies a date displayed on the current scheduler view by default. */ - currentDate?: Date; + currentDate?: any; /** The earliest date the widget allows you to select. */ min?: Date; /** The latest date the widget allows you to select. */ @@ -2898,7 +2954,7 @@ declare module DevExpress.ui { allowMultiple?: boolean; /** * Indicates whether or not resources of this kind have priority in the color identification of the appointments that have resources of different kinds assigned. - * @deprecated Use the 'useColorAsDefault' property instead + * @deprecated Use the useColorAsDefault option instead. */ mainColor?: boolean; /** Indicates whether or not resources of this kind have priority in the color identification of the appointments that have resources of different kinds assigned. */ @@ -3017,7 +3073,7 @@ declare module DevExpress.ui { expandAllEnabled?: boolean; /** * Specifies whether or not a check box is displayed at each tree view item. - * @deprecated Use the showCheckBoxesMode option instead. + * @deprecated Use the showCheckBoxesMode options instead. */ showCheckBoxes?: boolean; /** Specifies the current check boxes display mode. */ @@ -3028,7 +3084,7 @@ declare module DevExpress.ui { expandNodesRecursive?: boolean; /** * Specifies whether the "Select All" check box is displayed over the tree view. - * @deprecated Use the showCheckBoxesMode option instead. + * @deprecated Use the showCheckBoxesMode options instead. */ selectAllEnabled?: boolean; /** Specifies the text displayed at the "Select All" check box. */ @@ -3077,7 +3133,12 @@ declare module DevExpress.ui { } export interface dxMenuBaseOptions extends HierarchicalCollectionWidgetOptions { /** An object that defines the animation options of the widget. */ - animation?: fx.AnimationOptions; + animation?: { + /** An object that defines the animation options used when the widget is being shown. */ + show?: fx.AnimationOptions; + /** An object that defines the animation options used when the widget is being hidden. */ + hide?: fx.AnimationOptions; + }; /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ activeStateEnabled?: boolean; /** Specifies the name of the CSS class associated with the menu. */ @@ -3927,7 +3988,7 @@ declare module DevExpress.ui { deleteRow(rowIndex: number): void; /** * Removes a specific row from a grid. - * @deprecated Use the deleteRow() method instead. + * @deprecated Use the deleteRow(rowIndex) method instead. */ removeRow(rowIndex: number): void; /** Saves changes made in a grid. */ @@ -5196,7 +5257,7 @@ declare module DevExpress.viz.charts { }; /** * Specifies the fraction of the inner radius relative to the total radius in the series of the 'doughnut' type. - * @deprecated use the 'innerRadius' option instead + * @deprecated Use the innerRadius option instead. */ innerRadius?: number; /** An object defining the label configuration options. */ @@ -5207,7 +5268,7 @@ declare module DevExpress.viz.charts { minSegmentSize?: number; /** * Specifies the direction in which the dxPieChart series points are located. - * @deprecated use the 'segmentsDirection' option instead + * @deprecated Use the segmentsDirection option instead. */ segmentsDirection?: string; /**

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

      */ @@ -5234,7 +5295,7 @@ declare module DevExpress.viz.charts { }; /** * Specifies a start angle for a pie chart in arc degrees. - * @deprecated use the 'startAngle' option instead + * @deprecated Use the startAngle option instead. */ startAngle?: number; /**

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

      */ @@ -5245,14 +5306,14 @@ declare module DevExpress.viz.charts { export interface CommonPieSeriesSettings extends CommonPieSeriesConfig { /** * Specifies the type of the pie chart series. - * @deprecated use the 'type' option instead + * @deprecated Use the type option instead. */ type?: string; } export interface PieSeriesConfig extends CommonPieSeriesConfig { /** * Sets the series type. - * @deprecated use the 'type' option instead + * @deprecated Use the type option instead. */ type?: string; /** Specifies the name that identifies the series. */ @@ -5525,7 +5586,7 @@ declare module DevExpress.viz.charts { /** Specifies the position of the value axis on a chart. */ position?: string; /** Specifies the title for a value axis. */ - title?: AxisTitle; + title?: any; } export interface PolarAxis extends PolarCommonAxisSettings, Axis { /** Defines an array of the value axis constant lines. */ @@ -5952,7 +6013,7 @@ declare module DevExpress.viz.charts { constructor(element: Element, options?: dxPieChartOptions); /** * Provides access to the dxPieChart series. - * @deprecated ..\..\BaseChart\3 Methods\getAllSeries().md + * @deprecated Use the getAllSeries() method instead. */ getSeries(): PieSeries; } @@ -5990,19 +6051,19 @@ declare module DevExpress.viz.gauges { color?: string; /** * Specifies an array of custom minor ticks. - * @deprecated ..\customMinorTicks.md + * @deprecated Use the scale | customMinorTicks option instead. */ customTickValues?: Array; /** Specifies the length of the scale's minor ticks. */ length?: number; /** * Indicates whether automatically calculated minor ticks are visible or not. - * @deprecated This functionality in not more available + * @deprecated This feature is no longer available. */ showCalculatedTicks?: boolean; /** * Specifies an interval between minor ticks. - * @deprecated ..\minorTickInterval.md + * @deprecated Use the scale | minorTickInterval option instead. */ tickInterval?: number; /** Indicates whether scale minor ticks are visible or not. */ @@ -6013,7 +6074,7 @@ declare module DevExpress.viz.gauges { export interface ScaleMajorTick extends ScaleTick { /** * Specifies whether or not to expand the current major tick interval if labels overlap each other. - * @deprecated ..\label\overlappingBehavior\useAutoArrangement.md + * @deprecated Use the overlappingBehavior | useAutoArrangement option instead. */ useTicksAutoArrangement?: boolean; } @@ -6047,22 +6108,22 @@ declare module DevExpress.viz.gauges { endValue?: number; /** * Specifies whether or not to hide the first scale label. - * @deprecated This functionality in not more available + * @deprecated This feature is no longer available. */ hideFirstLabel?: boolean; /** * Specifies whether or not to hide the first major tick on the scale. - * @deprecated This functionality in not more available + * @deprecated This feature is no longer available. */ hideFirstTick?: boolean; /** * Specifies whether or not to hide the last scale label. - * @deprecated This functionality in not more available + * @deprecated This feature is no longer available. */ hideLastLabel?: boolean; /** * Specifies whether or not to hide the last major tick on the scale. - * @deprecated This functionality in not more available + * @deprecated This feature is no longer available. */ hideLastTick?: boolean; /** Specifies an interval between major ticks. */ @@ -6077,7 +6138,7 @@ declare module DevExpress.viz.gauges { label?: BaseScaleLabel; /** * Specifies options of the gauge's major ticks. - * @deprecated ..\tick\tick.md + * @deprecated Use the tick option instead. */ majorTick?: ScaleMajorTick; /** Specifies options of the gauge's major ticks. */ @@ -6153,17 +6214,17 @@ declare module DevExpress.viz.gauges { size?: viz.core.Size; /** * Specifies a subtitle for the widget. - * @deprecated ..\..\..\BaseGauge\1 Configuration\title\subtitle\subtitle.md + * @deprecated Use the title | subtitle option instead. */ subtitle?: { /** * Specifies font options for the subtitle. - * @deprecated ..\..\title\subtitle\font\font.md + * @deprecated Use the title | subtitle | font option instead. */ font?: viz.core.Font; /** * Specifies a text for the subtitle. - * @deprecated ..\title\subtitle\text.md + * @deprecated Use the title | subtitle | text option instead. */ text?: string; }; @@ -6173,7 +6234,7 @@ declare module DevExpress.viz.gauges { font?: viz.core.Font; /** * Specifies a title's position on the gauge. - * @deprecated basegaugeoptions_title_verticalAlignment and basegaugeoptions_title_horizontalAlignment + * @deprecated Use the horizontalAlignment and verticalAlignment options instead. */ position?: string; /** Specifies the distance between the title and surrounding gauge elements in pixels. */ @@ -6350,7 +6411,7 @@ declare module DevExpress.viz.gauges { visible?: boolean; }; /** Sets the name of the palette or an array of colors to be used for coloring the gauge range container. */ - palette?: string; + palette?: any; /** Defines the radius of the bar that is closest to the center relatively to the radius of the topmost bar. */ relativeInnerRadius?: number; /** Specifies a start value for the gauge's invisible scale. */ @@ -6500,7 +6561,7 @@ declare module DevExpress.viz.rangeSelector { logarithmBase?: number; /** * Specifies an interval between major ticks. - * @deprecated ..\tickInterval\tickInterval.md + * @deprecated Use the tickInterval option instead. */ majorTickInterval?: any; /** Specifies an interval between axis ticks. */ @@ -6541,7 +6602,7 @@ declare module DevExpress.viz.rangeSelector { showCustomBoundaryTicks?: boolean; /** * Indicates whether or not to show minor ticks on the scale. - * @deprecated minorTick\visible.md + * @deprecated Use the minorTick | visible option instead. */ showMinorTicks?: boolean; /** Specifies the scale's start value. */ @@ -6630,7 +6691,7 @@ declare module DevExpress.viz.rangeSelector { invalidRangeColor?: string; /** * Specifies the empty space between the marker's border and the marker’s text. - * @deprecated Use the 'paddingTopBottom' and 'paddingLeftRight' options instead + * @deprecated Use the paddingTopBottom and paddingLeftRight options instead. */ padding?: number; /** Specifies the empty space between the marker's top and bottom borders and the marker's text. */ @@ -6641,7 +6702,7 @@ declare module DevExpress.viz.rangeSelector { placeholderHeight?: number; /** * Specifies in pixels the height and width of the space reserved for the range selector slider markers. - * @deprecated Use the 'placeholderHeight' and 'indent' options instead + * @deprecated Use the placeholderHeight and indent options instead. */ placeholderSize?: { /** Specifies the height of the placeholder for the left and right slider markers. */ @@ -6716,88 +6777,88 @@ declare module DevExpress.viz.map { } /** * This section describes the fields and methods that can be used in code to manipulate the Area object. - * @deprecated Use the "Layer Element" instead + * @deprecated Use the Layer Element instead. */ export interface Area { /** * Contains the element type. - * @deprecated ..\..\Layer\2 Fields\type.md + * @deprecated Use the Layer | type instead. */ type: string; /** * Return the value of an attribute. - * @deprecated ..\..\Layer Element\3 Methods\attribute(name_value).md + * @deprecated Use the Layer Element | attribute(name, value) method instead. */ attribute(name: string): any; /** * Provides information about the selection state of an area. - * @deprecated Use the "selected()" method of the Layer Element + * @deprecated Use the Layer Element | selected() method instead. */ selected(): boolean; /** * Sets a new selection state for an area. - * @deprecated Use the "selected(state)" method of the Layer Element + * @deprecated Use the Layer Element | selected(state) method instead. */ selected(state: boolean): void; /** * Applies the area settings specified as a parameter and updates the area appearance. - * @deprecated ..\..\Layer Element\3 Methods\applySettings(settings).md + * @deprecated Use the Layer Element | applySettings(settings) method instead. */ applySettings(settings: any): void; } /** * This section describes the fields and methods that can be used in code to manipulate the Markers object. - * @deprecated Use the "Layer Element" instead + * @deprecated Use the Layer Element instead. */ export interface Marker { /** * Contains the descriptive text accompanying the map marker. - * @deprecated Get the text with the "attribute" method (using the "layers.label.dataField" value) + * @deprecated Get the text using the Layer Element | attribute(name) method. The name parameter value for text is set at the dataField option. */ text: string; /** * Contains the type of the element. - * @deprecated ..\..\Layer\2 Fields\type.md + * @deprecated Use the Layer | type instead. */ type: string; /** * Contains the URL of an image map marker. - * @deprecated Get the url with the "attribute" method (using the "layers.dataField" value) + * @deprecated Get the image URL using the Layer Element | attribute(name) method. The name parameter value for the image URL is set at the dataField option. */ url: string; /** * Contains the value of a bubble map marker. - * @deprecated Get the value with the "attribute" method (using the "layers.dataField" value) + * @deprecated Get the bubble value using the Layer Element | attribute(name) method. The name parameter for the bubble value is set at the dataField option. */ value: number; /** * Contains the values of a pie map marker. - * @deprecated Get the values with the "attribute" method (using the "layers.dataField" value) + * @deprecated Get the pie values using the Layer Element | attribute(name) method. The name parameter for pie values is set at the dataField option. */ values: Array; /** * Returns the value of an attribute. - * @deprecated ..\..\Layer Element\3 Methods\attribute(name_value).md + * @deprecated Use the Layer Element | attribute(name, value) method instead. */ attribute(name: string): any; /** * Returns the coordinates of a specific marker. - * @deprecated ..\..\Layer Element\3 Methods\coordinates().md + * @deprecated Use the Layer Element | coordinates() method instead. */ coordinates(): Array; /** * Provides information about the selection state of a marker. - * @deprecated Use the "selected()" method of the Layer Element + * @deprecated Use the Layer Element | selected() method instead. */ selected(): boolean; /** * Sets a new selection state for a marker. - * @deprecated Use the "selected(state)" method of the Layer Element + * @deprecated Use the Layer Element | selected(state) method instead. */ selected(state: boolean): void; /** * Applies the marker settings specified as a parameter and updates marker appearance. - * @deprecated ..\..\Layer Element\3 Methods\applySettings(settings).md + * @deprecated Use the Layer Element | applySettings(settings) method instead. */ applySettings(settings: any): void; } @@ -6809,7 +6870,7 @@ declare module DevExpress.viz.map { /** Specifies the type of a marker element. Setting this option makes sense only if the layer type is "marker". */ elementType?: string; /** Specifies a data source for the layer. */ - data?: any; + dataSource?: any; /** Specifies the line width (for layers of a line type) or width of the layer elements border in pixels. */ borderWidth?: number; /** Specifies a color for the border of the layer elements. */ @@ -6858,7 +6919,7 @@ declare module DevExpress.viz.map { customize?: (eleemnts: Array) => void; /** Specifies marker label options. */ label?: { - /** The name of the data attribute containing marker texts. */ + /** The name of the dataSource attribute containing marker texts. */ dataField?: string; /** Enables marker labels. */ enabled?: boolean; @@ -6869,238 +6930,238 @@ declare module DevExpress.viz.map { export interface AreaSettings { /** * Specifies the width of the area border in pixels. - * @deprecated ..\layers\borderWidth.md + * @deprecated Use the layers | borderWidth option instead. */ borderWidth?: number; /** * Specifies a color for the area border. - * @deprecated ..\layers\borderColor.md + * @deprecated Use the layers | borderColor option instead. */ borderColor?: string; /** * Specifies a color for an area. - * @deprecated ..\layers\color.md + * @deprecated Use the layers | color option instead. */ color?: string; /** * Specifies the function that customizes each area individually. - * @deprecated ..\layers\customize.md + * @deprecated Use the layers | customize option instead. */ customize?: (areaInfo: Area) => AreaSettings; /** * Specifies a color for the area border when the area is hovered over. - * @deprecated ..\layers\hoveredBorderColor.md + * @deprecated Use the layers | hoveredBorderColor option instead. */ hoveredBorderColor?: string; /** * Specifies the pixel-measured width of the area border when the area is hovered over. - * @deprecated ..\layers\hoveredBorderWidth.md + * @deprecated Use the layers | hoveredBorderWidth option instead. */ hoveredBorderWidth?: number; /** * Specifies a color for an area when this area is hovered over. - * @deprecated ..\layers\hoveredColor.md + * @deprecated Use the layers | hoveredColor option instead. */ hoveredColor?: string; /** * Specifies whether or not to change the appearance of an area when it is hovered over. - * @deprecated ..\layers\hoverEnabled.md + * @deprecated Use the layers | hoverEnabled option instead. */ hoverEnabled?: boolean; /** * Configures area labels. - * @deprecated ..\..\layers\label\label.md + * @deprecated Use the layers | label option instead. */ label?: { /** * Specifies the data field that provides data for area labels. - * @deprecated ..\..\layers\label\dataField.md + * @deprecated Use the layers | label | dataField option instead. */ dataField?: string; /** * Enables area labels. - * @deprecated ..\..\layers\label\enabled.md + * @deprecated Use the layers | label | enabled option instead. */ enabled?: boolean; /** * Specifies font options for area labels. - * @deprecated ..\..\..\layers\label\font\font.md + * @deprecated Use the layers | label | font option instead. */ font?: viz.core.Font; }; /** * Specifies the name of the palette or a custom range of colors to be used for coloring a map. - * @deprecated ..\layers\palette.md + * @deprecated Use the layers | palette option instead. */ palette?: any; /** * Specifies the number of colors in a palette. - * @deprecated ..\layers\paletteSize.md + * @deprecated Use the layers | paletteSize option instead. */ paletteSize?: number; /** * Allows you to paint areas with similar attributes in the same color. - * @deprecated ..\layers\colorGroups.md + * @deprecated Use the layers | colorGroups option instead. */ colorGroups?: Array; /** * Specifies the field that provides data to be used for coloring areas. - * @deprecated ..\layers\colorGroupingField.md + * @deprecated Use the layers | colorGroupingField option instead. */ colorGroupingField?: string; /** * Specifies a color for the area border when the area is selected. - * @deprecated ..\layers\selectedBorderColor.md + * @deprecated Use the layers | selectedBorderColor option instead. */ selectedBorderColor?: string; /** * Specifies a color for an area when this area is selected. - * @deprecated ..\layers\selectedColor.md + * @deprecated Use the layers | selectedColor option instead. */ selectedColor?: string; /** * Specifies the pixel-measured width of the area border when the area is selected. - * @deprecated ..\layers\selectedBorderWidth.md + * @deprecated Use the layers | selectedBorderWidth option instead. */ selectedBorderWidth?: number; /** * Specifies whether single or multiple areas can be selected on a vector map. - * @deprecated ..\layers\selectionMode.md + * @deprecated Use the layers | selectionMode option instead. */ selectionMode?: string; } export interface MarkerSettings { /** * Specifies a color for the marker border. - * @deprecated ..\layers\borderColor.md + * @deprecated Use the layers | borderColor option instead. */ borderColor?: string; /** * Specifies the width of the marker border in pixels. - * @deprecated ..\layers\borderWidth.md + * @deprecated Use the layers | borderWidth option instead. */ borderWidth?: number; /** * Specifies a color for a marker of the dot or bubble type. - * @deprecated ..\layers\color.md + * @deprecated Use the layers | color option instead. */ color?: string; /** * Specifies the function that customizes each marker individually. - * @deprecated ..\layers\customize.md + * @deprecated Use the layers | customize option instead. */ customize?: (markerInfo: Marker) => MarkerSettings; /** * Specifies the pixel-measured width of the marker border when the marker is hovered over. - * @deprecated ..\layers\hoveredBorderWidth.md + * @deprecated Use the layers | hoveredBorderWidth option instead. */ hoveredBorderWidth?: number; /** * Specifies a color for the marker border when the marker is hovered over. - * @deprecated ..\layers\hoveredBorderColor.md + * @deprecated Use the layers | hoveredBorderColor option instead. */ hoveredBorderColor?: string; /** * Specifies a color for a marker of the dot or bubble type when this marker is hovered over. - * @deprecated ..\layers\hoveredColor.md + * @deprecated Use the layers | hoveredColor option instead. */ hoveredColor?: string; /** * Specifies whether or not to change the appearance of a marker when it is hovered over. - * @deprecated ..\layers\hoverEnabled.md + * @deprecated Use the layers | hoverEnabled option instead. */ hoverEnabled?: boolean; /** * Specifies marker label options. - * @deprecated ..\..\layers\label\label.md + * @deprecated Use the layers | label option instead. */ label?: { /** * Enables marker labels. - * @deprecated ..\..\layers\label\enabled.md + * @deprecated Use the layers | label | enabled option instead. */ enabled?: boolean; /** * Specifies font options for marker labels. - * @deprecated ..\..\..\layers\label\font\font.md + * @deprecated Use the layers | label | font option instead. */ font?: viz.core.Font; }; /** * Specifies the pixel-measured diameter of the marker that represents the biggest value. Setting this option makes sense only if you use markers of the bubble type. - * @deprecated ..\layers\maxSize.md + * @deprecated Use the layers | maxSize option instead. */ maxSize?: number; /** * Specifies the pixel-measured diameter of the marker that represents the smallest value. Setting this option makes sense only if you use markers of the bubble type. - * @deprecated ..\layers\minSize.md + * @deprecated Use the layers | minSize option instead. */ minSize?: number; /** * Specifies the opacity of markers. Setting this option makes sense only if you use markers of the bubble type. - * @deprecated ..\layers\opacity.md + * @deprecated Use the layers | opacity option instead. */ opacity?: number; /** * Specifies the pixel-measured width of the marker border when the marker is selected. - * @deprecated ..\layers\selectedBorderWidth.md + * @deprecated Use the layers | selectedBorderWidth option instead. */ selectedBorderWidth?: number; /** * Specifies a color for the marker border when the marker is selected. - * @deprecated ..\layers\selectedBorderColor.md + * @deprecated Use the layers | selectedBorderColor option instead. */ selectedBorderColor?: string; /** * Specifies a color for a marker of the dot or bubble type when this marker is selected. - * @deprecated ..\layers\selectedColor.md + * @deprecated Use the layers | selectedColor option instead. */ selectedColor?: string; /** * Specifies whether a single or multiple markers can be selected on a vector map. - * @deprecated ..\layers\selectionMode.md + * @deprecated Use the layers | selectionMode option instead. */ selectionMode?: string; /** * Specifies the size of markers. Setting this option makes sense for any type of marker except bubble. - * @deprecated ..\layers\size.md + * @deprecated Use the layers | size option instead. */ size?: number; /** * Specifies the type of markers to be used on the map. - * @deprecated ..\layers\elementType.md + * @deprecated Use the layers | elementType option instead. */ type?: string; /** * Specifies the name of a palette or a custom set of colors to be used for coloring markers of the pie type. - * @deprecated ..\layers\palette.md + * @deprecated Use the layers | palette option instead. */ palette?: any; /** * Allows you to paint markers with similar attributes in the same color. - * @deprecated ..\layers\colorGroups.md + * @deprecated Use the layers | colorGroups option instead. */ colorGroups?: Array; /** * Specifies the field that provides data to be used for coloring markers. - * @deprecated ..\layers\colorGroupingField.md + * @deprecated Use the layers | colorGroupingField option instead. */ colorGroupingField?: string; /** * Allows you to display bubbles with similar attributes in the same size. - * @deprecated ..\layers\sizeGroups.md + * @deprecated Use the layers | sizeGroups option instead. */ sizeGroups?: Array; /** * Specifies the field that provides data to be used for sizing bubble markers. - * @deprecated ..\layers\sizeGroupingField.md + * @deprecated Use the layers | sizeGroupingField option instead. */ sizeGroupingField?: string; } export interface dxVectorMapOptions extends viz.core.BaseWidgetOptions { /** * An object specifying options for the map areas. - * @deprecated Use the 'layers' option instead + * @deprecated Use the "area" type element of the layers array. */ areaSettings?: AreaSettings; /** Specifies the options for the map background. */ @@ -7130,24 +7191,24 @@ declare module DevExpress.viz.map { horizontalAlignment?: string; /** Specifies the position of the control bar. */ verticalAlignment?: string; - /** Specifies the opacity of the Control_Bar. */ + /** Specifies the opacity of the control bar. */ opacity?: number; }; /** Specifies the appearance of the loading indicator. */ loadingIndicator?: viz.core.LoadingIndicator; /** * Specifies a data source for the map area. - * @deprecated Use the 'layers.data' option instead + * @deprecated Use the layers | dataSource option instead. */ mapData?: any; /** * Specifies a data source for the map markers. - * @deprecated Use the 'layers.data' option instead + * @deprecated Use the layers | dataSource option instead. */ markers?: any; /** * An object specifying options for the map markers. - * @deprecated Use the 'layers' option instead + * @deprecated Use the "marker" type element of the layers array. */ markerSettings?: MarkerSettings; /** Specifies the size of the dxVectorMap widget. */ @@ -7204,12 +7265,12 @@ declare module DevExpress.viz.map { }) => void; /** * A handler for the areaClick event. - * @deprecated Use the 'onClick' option instead + * @deprecated Use the onClick option instead. */ onAreaClick?: any; /** * A handler for the areaSelectionChanged event. - * @deprecated Use the 'onSelectionChanged' option instead + * @deprecated Use the onSelectionChanged option instead. */ onAreaSelectionChanged?: (e: { target: Area; @@ -7218,12 +7279,12 @@ declare module DevExpress.viz.map { }) => void; /** * A handler for the markerClick event. - * @deprecated Use the 'onClick' option instead + * @deprecated Use the onClick option instead. */ onMarkerClick?: any; /** * A handler for the markerSelectionChanged event. - * @deprecated Use the 'onSelecitonChanged' option instead + * @deprecated Use the onSelecitonChanged option instead. */ onMarkerSelectionChanged?: (e: { target: Marker; @@ -7264,12 +7325,12 @@ declare module DevExpress.viz.map { center(centerCoordinates: Array): void; /** * Deselects all the selected areas on a map. The areas are displayed in their initial style after. - * @deprecated Use the 'clearSelection' method on a layer instead + * @deprecated Use the layer's clearSelection() method instead. */ clearAreaSelection(): void; /** * Deselects all the selected markers on a map. The markers are displayed in their initial style after. - * @deprecated Use the 'clearSelection' method on a layer instead + * @deprecated Use the layer's clearSelection() method instead. */ clearMarkerSelection(): void; /** Deselects all the selected area and markers on a map at once. The areas and markers are displayed in their initial style after. */ @@ -7284,12 +7345,12 @@ declare module DevExpress.viz.map { getLayerByName(name: string): MapLayer; /** * Returns an array with all the map areas. - * @deprecated Use the 'getElements' method on a layer instead + * @deprecated Use the layer's getElements() method instead. */ getAreas(): Array; /** * Returns an array with all the map markers. - * @deprecated Use the 'getElements' method on a layer instead + * @deprecated Use the layer's getElements() method instead. */ getMarkers(): Array; /** Gets the current coordinates of the map viewport. */ @@ -7324,12 +7385,12 @@ declare module DevExpress.viz.sparklines { export interface SparklineTooltip extends viz.core.Tooltip { /** * Specifies how a tooltip is horizontally aligned relative to the graph. - * @deprecated Tooltip alignment is no more available. + * @deprecated Tooltip alignment is no longer useful because the tooltips are aligned automatically. */ horizontalAlignment?: string; /** * Specifies how a tooltip is vertically aligned relative to the graph. - * @deprecated Tooltip alignment is no more available. + * @deprecated Tooltip alignment is no longer useful because the tooltips are aligned automatically. */ verticalAlignment?: string; } @@ -7389,7 +7450,7 @@ declare module DevExpress.viz.sparklines { /** Sets a color for the bars indicating positive values. Available for a sparkline of the bar type only. */ barPositiveColor?: string; /** Specifies a data source for the sparkline. */ - dataSource?: Array; + dataSource?: any; /** Sets a color for the boundary of both the first and last points on a sparkline. */ firstLastColor?: string; /** Specifies whether a sparkline ignores null data points or not. */ @@ -7440,4 +7501,4 @@ interface JQuery { dxSparkline(options?: DevExpress.viz.sparklines.dxSparklineOptions): JQuery; dxSparkline(methodName: string, ...params: any[]): any; dxSparkline(methodName: "instance"): DevExpress.viz.sparklines.dxSparkline; -} +} \ No newline at end of file diff --git a/devtools-detect/devtools-detect-tests.ts b/devtools-detect/devtools-detect-tests.ts new file mode 100644 index 0000000000..9cd1d2f7a7 --- /dev/null +++ b/devtools-detect/devtools-detect-tests.ts @@ -0,0 +1,12 @@ +/// + +// check if it's open +console.log('is DevTools open?', window.devtools.open); +// check it's orientation, null if not open +console.log('and DevTools orientation?', window.devtools.orientation); + +// get notified when it's opened/closed or orientation changes +window.addEventListener('devtoolschange', function (e) { + console.log('is DevTools open?', e.detail.open); + console.log('and DevTools orientation?', e.detail.orientation); +}); diff --git a/devtools-detect/devtools-detect.d.ts b/devtools-detect/devtools-detect.d.ts new file mode 100644 index 0000000000..c66d63f0fa --- /dev/null +++ b/devtools-detect/devtools-detect.d.ts @@ -0,0 +1,16 @@ +// Type definitions for ajv +// Project: https://github.com/sindresorhus/devtools-detect +// Definitions by: York Yao +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +type DevTools = { + open: boolean; + orientation: "vertical" | "horizontal"; +} +interface DevToolsEvent extends Event { + detail: DevTools; +} +interface Window { + devtools: DevTools; + addEventListener(type: "devtoolschange", listener: (ev: DevToolsEvent) => any, useCapture?: boolean): void; +} diff --git a/dexie/dexie.d.ts b/dexie/dexie.d.ts index f31ec0db52..720d38fb29 100644 --- a/dexie/dexie.d.ts +++ b/dexie/dexie.d.ts @@ -39,6 +39,10 @@ declare class Dexie { static shallowClone(obj: Object): Object; static deepClone(obj: Object): Object; + + static delete(databaseName : string): Dexie.Promise; + + static exists(databaseName : string): Dexie.Promise; version(versionNumber: Number): Dexie.Version diff --git a/df-visible/df-visible-tests.ts b/df-visible/df-visible-tests.ts new file mode 100644 index 0000000000..c5a8f1bf2b --- /dev/null +++ b/df-visible/df-visible-tests.ts @@ -0,0 +1,35 @@ +/// + +// https://github.com/customd/jquery-visible/blob/master/examples/demo-basic.html +$(function(){ + + // Add the spans to the container element. + $('#container dt').each(function(){ $(this).append(''); }); + + // Trigger the + $('#detect').on('click',function(){ + + // Select the detection type. + var detectPartial = $('#detect_type').val() == 'partial'; + + // Loop over each container, and check if it's visible. + $('#container dt').each(function(){ + + // Is this element visible onscreen? + var visible = $(this).visible( detectPartial ); + + // Set the visible status into the span. + $(this).find('span').text( visible ? 'Onscreen' : 'Offscreen' ).toggleClass('visible',visible); + }); + }); +}); + +// https://www.customd.com/articles/13/checking-if-an-element-is-visible-on-screen-using-jquery +// Check both vertical, and horizontal at once +$('#element').visible(true, false, 'both'); + +// Check only horizontal +$('#element').visible(true, false, 'horizontal'); + +// Check only vertical +$('#element').visible(true, false, 'vertical'); diff --git a/df-visible/df-visible.d.ts b/df-visible/df-visible.d.ts new file mode 100644 index 0000000000..b8d05fe360 --- /dev/null +++ b/df-visible/df-visible.d.ts @@ -0,0 +1,18 @@ +// Type definitions for jquery-visible +// Project: https://github.com/customd/jquery-visible +// Definitions by: Andrey Lipatkin +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +type Direction = "horizontal" | "vertical" | "both"; + +interface JQuery { + /** + * Gets the value of a setting. + * @param details Which setting to consider. + * @param callback The callback parameter should be a function that looks like this: + * function(object details) {...}; + */ + visible(partial?: boolean, hidden?: boolean, direction?: Direction): boolean; +} diff --git a/dhtmlxgantt/dhtmlxgantt-tests.ts b/dhtmlxgantt/dhtmlxgantt-tests.ts index 1bfc7a089f..dd05b50bff 100644 --- a/dhtmlxgantt/dhtmlxgantt-tests.ts +++ b/dhtmlxgantt/dhtmlxgantt-tests.ts @@ -30,4 +30,8 @@ gantt.load("/data/events"); //events gantt.attachEvent("onBeforeLightbox", function (id?: string) { gantt.showTask(id); -}); \ No newline at end of file +}); + +//gantt enterprise +var gantt2 = Gantt.getGanttInstance(); +gantt2.config.api_date = "format"; \ No newline at end of file diff --git a/dhtmlxgantt/dhtmlxgantt.d.ts b/dhtmlxgantt/dhtmlxgantt.d.ts index f9ec6808cd..a9542cc00f 100644 --- a/dhtmlxgantt/dhtmlxgantt.d.ts +++ b/dhtmlxgantt/dhtmlxgantt.d.ts @@ -1,9 +1,12 @@ -// Type definitions for dhtmlxGantt 2.0 +// Type definitions for dhtmlxGantt 4.0.0 // Project: http://dhtmlx.com/docs/products/dhtmlxGantt // Definitions by: Maksim Kozhukh // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +interface GanttCallback { (...args: any[]) : any } +type GanttEventName ='onAfterAutoSchedule'|'onAfterBatchUpdate'|'onAfterLightbox'|'onAfterLinkAdd'|'onAfterLinkDelete'|'onAfterLinkUpdate'|'onAfterRedo'|'onAfterTaskAdd'|'onAfterTaskAutoSchedule'|'onAfterTaskDelete'|'onAfterTaskDrag'|'onAfterTaskMove'|'onAfterTaskUpdate'|'onAfterUndo'|'onAjaxError'|'onBeforeAutoSchedule'|'onBeforeBatchUpdate'|'onBeforeCollapse'|'onBeforeDataRender'|'onBeforeExpand'|'onBeforeGanttReady'|'onBeforeGanttRender'|'onBeforeLightbox'|'onBeforeLinkAdd'|'onBeforeLinkDelete'|'onBeforeLinkDisplay'|'onBeforeLinkUpdate'|'onBeforeParse'|'onBeforeRedo'|'onBeforeRowDragEnd'|'onBeforeTaskAdd'|'onBeforeTaskAutoSchedule'|'onBeforeTaskChanged'|'onBeforeTaskDelete'|'onBeforeTaskDisplay'|'onBeforeTaskDrag'|'onBeforeTaskMove'|'onBeforeTaskSelected'|'onBeforeTaskUpdate'|'onBeforeUndo'|'onCircularLinkError'|'onClear'|'onCollapse'|'onColumnResize'|'onColumnResizeEnd'|'onColumnResizeStart'|'onContextMenu'|'onDataRender'|'onEmptyClick'|'onError'|'onExpand'|'onGanttReady'|'onGanttRender'|'onGanttScroll'|'onGridHeaderClick'|'onGridResize'|'onGridResizeEnd'|'onGridResizeStart'|'onLightbox'|'onLightboxButton'|'onLightboxCancel'|'onLightboxChange'|'onLightboxDelete'|'onLightboxSave'|'onLinkClick'|'onLinkDblClick'|'onLinkIdChange'|'onLinkValidation'|'onLoadEnd'|'onLoadStart'|'onMouseMove'|'onOptionsLoad'|'onParse'|'onRowDragEnd'|'onRowDragStart'|'onScaleAdjusted'|'onScaleClick'|'onTaskClick'|'onTaskClosed'|'onTaskCreated'|'onTaskDblClick'|'onTaskDrag'|'onTaskIdChange'|'onTaskLoading'|'onTaskOpened'|'onTaskRowClick'|'onTaskSelected'|'onTaskUnselected'|'onTemplatesReady'; + interface GanttTemplates{ /** * specifies the format of dates that are set by means of API methods. Used to parse incoming dates @@ -12,10 +15,11 @@ interface GanttTemplates{ api_date(date: Date): string; /** - * specifies the format of dates in the "Start time" column + * specifies the content of start date or end date columns in grid * @param date the date which needs formatting + * @param task the task object */ - date_grid(date: Date): string; + date_grid(date: Date, task: any): string; /** * specifies the date format of the time scale (X-Axis) @@ -30,7 +34,7 @@ interface GanttTemplates{ * @param to the id of the target task( 'null' or 'undefined', if the target task isn't specified yet) * @param to_start true, if the link is being dragged to the start of the target task, false - if
      to the end of the task */ - drag_link(from: any, from_start: boolean, to: any, to_start: boolean): string; + drag_link(from: string|number, from_start: boolean, to: string|number, to_start: boolean): string; /** * specifies the CSS class that will be applied to the link receiver (pop-up circle near the task bar) @@ -39,7 +43,7 @@ interface GanttTemplates{ * @param to the id of the target task( 'null' or 'undefined', if the target task isn't specified yet) * @param to_start true, if the link is being dragged to the start of the target task, false - if
      to the end of the task */ - drag_link_class(from: any, from_start: boolean, to: any, to_start: boolean): string; + drag_link_class(from: string|number, from_start: boolean, to: string|number, to_start: boolean): string; /** * specifies the custom content inserted before the labels of child items in the tree column @@ -47,6 +51,12 @@ interface GanttTemplates{ */ grid_blank(task: any): string; + /** + * specifies the format of dates in the "Start time" column + * @param date the date which needs formatting + */ + grid_date_format(date: Date): string; + /** * specifies the icon of child items in the tree column * @param task the task object @@ -61,10 +71,10 @@ interface GanttTemplates{ /** * specifies the CSS class that will be applied to the headers of the table's columns - * @param column the column's configuration object - * @param config the column's id ('name' attribute) + * @param columnName the column's name (as specified in the "name" property of the column object) + * @param column column object (as specified in the gantt.config.columns config) */ - grid_header_class(column: any, config: string): string; + grid_header_class(columnName: string, column: any): string; /** * specifies the indent of the child items in a branch (in the tree column) @@ -106,6 +116,14 @@ interface GanttTemplates{ */ progress_text(start: Date, end: Date, task: any): string; + /** + * specifies the CSS class that will be applied to the pop-up edit form + * @param start the date when a task is scheduled to begin + * @param end the date when a task is scheduled to be completed + * @param task the task object + */ + quick_info_class(start: Date, end: Date, task: any): void; + /** * specifies the content of the pop-up edit form * @param start the date when a task is scheduled to begin @@ -131,11 +149,17 @@ interface GanttTemplates{ quick_info_title(start: Date, end: Date, task: any): string; /** - * specifies the CSS class that will be applied to the time scale of the timeline area + * specifies the CSS class that will be applied to cells of the time scale of the timeline area * @param date the date of a cell */ scale_cell_class(date: Date): string; + /** + * specifies the CSS class that will be applied to the time scale + * @param scale the scale's configuration object + */ + scale_row_class(scale: any): string; + /** * specifies the CSS class that will be applied to the cells of the timeline area * @param item the task object assigned to the row @@ -181,6 +205,12 @@ interface GanttTemplates{ */ task_time(start: Date, end: Date, task: any): string; + /** + * specifies the dates of unscheduled tasks + * @param task the task object + */ + task_unscheduled_time(task: any): void; + /** * specifies the format of the drop-down time selector in the lightbox * @param date the date which needs formatting @@ -227,35 +257,83 @@ interface GanttTemplates{ * @param end the date when a task is scheduled to be completed * @param task the task object */ - leftside_text(start: Date, end: Date, task: any): string; + leftside_text(start: Date, end: Date, task: any): string; + + /** + * specifies the lightbox's header + * @param start_date the date when a task is scheduled to begin + * @param end_date the date when a task is scheduled to be completed + * @param task the task's object + */ + lightbox_header(start_date: Date, end_date: Date, task: any): string; + } interface GanttConfigOptions{ /** - * sets the date format that will be used by the addTask() method to -parse the start_date, end_date properties in case they are specified as strings + * sets the date format for addTask() method to */ api_date: string; + /** + * enables auto scheduling + */ + auto_scheduling: boolean; + + /** + * allows or forbids creation of links from parent tasks (projects) to their children + */ + auto_scheduling_descendant_links: boolean; + + /** + * defines whether gantt will do autoscheduling on data loading + */ + auto_scheduling_initial: boolean; + + /** + * enables the auto scheduling mode, in which tasks will always be rescheduled to the earliest possible date + */ + auto_scheduling_strict: boolean; + /** * enables automatic adjusting of the grid's columns to the grid's width */ autofit: boolean; + /** + * forces the Gantt chart to automatically change its size to show all tasks without scrolling + */ + autosize: boolean|string; + + /** + * sets the minimum width (in pixels) that the Gantt chart can take in the horizontal 'autosize' mode + */ + autosize_min_width: number; + + /** + * enables the dynamic loading in the Gantt chart + */ + branch_loading: boolean; + /** * stores a collection of buttons resided in the left bottom corner of the lightbox */ - buttons_left: any; + buttons_left: any[]; /** * stores a collection of buttons resided in the right bottom corner of the lightbox */ - buttons_right: any; + buttons_right: any[]; /** * configures the columns of the table */ - columns: any; + columns: any[]; + + /** + * enables adjusting the task's start and end dates to the work time (while dragging) + */ + correct_work_time: boolean; /** * sets the format of dates in the "Start time" column of the table @@ -313,12 +391,17 @@ parse the start_date, end_date properties in case they are specified as strings duration_step: number; /** - * sets the duration unit in milliseconds + * sets the duration unit */ - duration_unit: number; + duration_unit: string; /** - * sets the end value of the time scale (X–Axis) + * changes the name of a property that affects the editing ability of tasks/links in the read-only Gantt chart + */ + editable_property: string; + + /** + * sets the end value of the time scale */ end_date: Date; @@ -327,16 +410,51 @@ parse the start_date, end_date properties in case they are specified as strings */ fit_tasks: boolean; + /** + * makes the grid resizable by dragging the right grid's border + */ + grid_resize: boolean; + + /** + * sets the name of the attribute of the grid resizer's DOM element + */ + grid_resizer_attribute: string; + + /** + * sets the name of the attribute of the column resizer's DOM element. The attribute presents the column's index + */ + grid_resizer_column_attribute: string; + /** * sets the maximum width of the grid */ grid_width: number; + /** + * shows the critical path in the chart + */ + highlight_critical_path: boolean; + + /** + * specifies whether sub-scales shall use the scale_cell_class template by default + */ + inherit_scale_class: boolean; + /** * sets whether the timeline area will be initially scrolled to display the earliest task */ initial_scroll: boolean; + /** + * 'says' to preserve the initial grid's width during resizing the columns within + */ + keep_grid_width: boolean; + + /** + * sets the name of the attribute of the task layer's DOM element + */ + layer_attribute: string; + /** * specifies the lightbox object */ @@ -373,7 +491,7 @@ parse the start_date, end_date properties in case they are specified as strings links: any; /** - * sets the minimum width for a column + * sets the minimum width for a column in the timeline area */ min_column_width: number; @@ -382,26 +500,76 @@ parse the start_date, end_date properties in case they are specified as strings */ min_duration: number; + /** + * sets the minumum width for the grid (in pixels) while being resized + */ + min_grid_column_width: number; + + /** + * enables/disables multi-task selection in the Gantt chart + */ + multiselect: boolean; + + /** + * specifies whether multi-task selection will be available within one or any level + */ + multiselect_one_level: boolean; + + /** + * openes all branches initially + */ + open_tree_initially: boolean; + /** * activates the 'branch' mode that allows dragging tasks only within the parent branch */ order_branch: boolean; + /** + * activates the 'branch' mode that allows dragging tasks within the whole gantt + */ + order_branch_free: boolean; + + /** + * preserves the current position of the vertical and horizontal scrolls while re-drawing the gantt chart + */ + preserve_scroll: boolean; + + /** + * specifies whether the gantt container should block the mousewheel event, or should it be propagated up to the window element + */ + prevent_default_scroll: boolean; + /** * defines whether the task form will appear from the left/right side of the screen or near the selected task */ quick_info_detached: boolean; /** - * stores a collection of buttons resided in the pop-up edit form + * stores a collection of buttons resided in the pop-up task's details form */ - quickinfo_buttons: any; + quickinfo_buttons: any[]; /** * activates the read-only mode for the Gantt chart */ readonly: boolean; + /** + * changes the name of a property that affects the read-only behaviour of tasks/links + */ + readonly_property: string; + + /** + * enables the Redo functionality for the gantt + */ + redo: boolean; + + /** + * sets the id of the virtual root element + */ + root_id: string|number; + /** * enables rounding the task's start and end dates to the nearest scale marks */ @@ -417,11 +585,21 @@ parse the start_date, end_date properties in case they are specified as strings */ scale_height: number; + /** + * sets the minimal scale unit (in case multiple scales are used) as the interval of leading/closing empty space + */ + scale_offset_minimal: boolean; + /** * sets the unit of the time scale (X-Axis) */ scale_unit: string; + /** + * specifies whether the timeline area shall be scrolled while selecting to display the selected task + */ + scroll_on_click: boolean; + /** * enables selection of tasks in the Gantt chart */ @@ -433,17 +611,67 @@ parse the start_date, end_date properties in case they are specified as strings server_utc: boolean; /** - * enables showing a progress/spinner while data is loading + * shows the chart (timeline) area of the Gantt chart + */ + show_chart: boolean; + + /** + * enables showing error alerts in case of unexpected behavior + */ + show_errors: boolean; + + /** + * shows the grid area of the Gantt chart + */ + show_grid: boolean; + + /** + * enables/disables displaying links in the Gantt chart + */ + show_links: boolean; + + /** + * shows/hides markers on the page + */ + show_markers: boolean; + + /** + * enables displaying of the progress inside the task bars */ show_progress: boolean; + /** + * activates/disables the 'quick_info' extension (pop-up task's details form) + */ + show_quick_info: boolean; + + /** + * enables/disables displaying column borders in the chart area + */ + show_task_cells: boolean; + + /** + * enables showing unscheduled tasks + */ + show_unscheduled: boolean; + + /** + * hides non-working time from the time scale + */ + skip_off_time: boolean; + + /** + * enables the smart rendering mode for gantt's tasks and links rendering + */ + smart_rendering: boolean; + /** * enables sorting in the table */ sort: boolean; /** - * sets the start value of the time scale (X–Axis) + * sets the start value of the time scale */ start_date: Date; @@ -452,6 +680,11 @@ parse the start_date, end_date properties in case they are specified as strings */ start_on_monday: boolean; + /** + * generates a background image for the timeline area instead of rendering actual columns' and rows' lines + */ + static_background: boolean; + /** * sets the step of the time scale (X-Axis) */ @@ -460,7 +693,7 @@ parse the start_date, end_date properties in case they are specified as strings /** * specifies the second time scale(s) */ - subscales: any; + subscales: any[]; /** * sets the name of the attribute that will specify the id of the task's HTML element @@ -492,6 +725,21 @@ parse the start_date, end_date properties in case they are specified as strings */ time_step: number; + /** + * sets the length of time, in milliseconds, before the tooltip hides + */ + tooltip_hide_timeout: number; + + /** + * sets the the right (if positive) offset of the tooltip's position + */ + tooltip_offset_x: number; + + /** + * sets the the top (if positive) offset of the tooltip's position + */ + tooltip_offset_y: number; + /** * sets the timeout in milliseconds before the tooltip is displayed for a task */ @@ -500,19 +748,59 @@ parse the start_date, end_date properties in case they are specified as strings /** * enables/disables the touch support for the Gantt chart */ - touch: any; + touch: boolean|string; /** * defines the time period in milliseconds that is used to differ the long touch gesture from the scroll gesture */ - touch_drag: any; + touch_drag: number|boolean; + + /** + * enables/disables vibration while moving tasks on touch devices + */ + touch_feedback: boolean; + + /** + * redefines functions responsible for displaying different types of tasks + */ + type_renderers: any; + + /** + * stores the names of lightbox's structures (used for different types of tasks) + */ + types: any; + + /** + * enables the Undo functionality for the gantt + */ + undo: boolean; + + /** + * sets the actions that the Undo operation will revert + */ + undo_actions: any; + + /** + * sets the number of steps that should be reverted by the undo method + */ + undo_steps: number; + + /** + * sets the types of entities for which the Undo operation will be applied + */ + undo_types: any; + + /** + * enables calculating the duration of tasks in working time instead of calendar time + */ + work_time: boolean; /** * sets the date format that is used to parse data from the data set */ - xml_date: string; -} + xml_date: string; +} interface GanttDateHelpers{ add(origin: Date, count: number, unit: string): Date; @@ -578,6 +866,13 @@ interface GanttLocale{ labels: GanttLocaleLabels; } +interface GanttEnterprise{ + /** + * Creates a new instance of Gantt + */ + getGanttInstance(): GanttStatic; +} + interface GanttStatic{ templates: GanttTemplates; config: GanttConfigOptions; @@ -592,109 +887,289 @@ interface GanttStatic{ * adds a new dependency link * @param link the link object */ - addLink(link: any): any; + addLink(link: any): string|number; + + /** + * displayes an additional layer with custom elements for a link in the timeline area + * @param func a render function or a config object + */ + addLinkLayer(func: GanttCallback|any): string; + + /** + * adds a marker to the timeline area + * @param marker the marker's configuration object + */ + addMarker(marker: any): string; /** * adds a new task * @param task the task object * @param parent the parent's id + * @param index optional, the position the task will be added into (0 or greater) */ - addTask(task: any, parent: string): any; + addTask(task: any, parent: string, index?: number): string|number; + + /** + * displayes an additional layer with custom elements for a task in the timeline area + * @param func a render function or a config object + */ + addTaskLayer(func: GanttCallback|any): string; + + /** + * calls an alert message box + * @param config the alert box's configuration + */ + alert(config: any): void; + + /** + * if the specified expression is false, an errorMessage is shown in the red popup at the top right corner of the screen + * @param expression true to assert the expression, false - if assertion fails + * @param errorMessage an error message that will be shown in the red popup + */ + assert(expression: boolean, errorMessage: string): void; /** * attaches the handler to an inner event of dhtmlxGantt * @param name the event's name, case-insensitive * @param handler the handler function */ - attachEvent(name: string, handler: (...args: any[])=>any): any; + attachEvent(name: GanttEventName, handler: GanttCallback): string; + + /** + * recalculates the schedule of the project + */ + autoSchedule(): void; + + /** + * updates multiple tasks/links at once + * @param callback the callback function + */ + batchUpdate(callback: GanttCallback): void; + + /** + * creates a new function that, when called, has its this keyword set to the provided value + * @param method the target function + * @param thisArg the value to be passed as the this parameter to the target function when the bound function is called + */ + bind(method: GanttCallback, thisArg: any): GanttCallback; + + /** + * calculates the duration of a task + * @param start the date when a task is scheduled to begin + * @param end the date when a task is scheduled to be completed + */ + calculateDuration(start: Date, end: Date): number; + + /** + * calculates the end date of a task + * @param start the date when a task is scheduled to begin + * @param duration the duration of a task + * @param unit the time unit of the duration + */ + calculateEndDate(start: Date, duration: number, unit: string): Date; + + /** + * calculates the level of a task + * @param task the task's object + */ + calculateTaskLevel(task: any): number; /** * calls an inner event * @param name the event's name, case-insensitive * @param params an array of the event-related data */ - callEvent(name: string, params: any): boolean; + callEvent(name: string, params: any[]): boolean; + + /** + * changes the name of the lighbox's structure defined for of the task + * @param id the task id + */ + changeLightboxType(id: string|number): void; /** * changes the link's id * @param id the current link's id * @param new_id the new link's id */ - changeLinkId(id: any, new_id: any); + changeLinkId(id: string|number, new_id: string|number): void; /** * changes the task's id * @param id the current task's id * @param new_id the new task's id */ - changeTaskId(id: any, new_id: any); + changeTaskId(id: string|number, new_id: string|number): void; /** * checks whether an event has some handler(s) specified * @param name the event's name */ - checkEvent(name: string): boolean; + checkEvent(name: GanttEventName): boolean; /** * removes all tasks from the Gantt chart */ - clearAll(); + clearAll(): void; /** * closes the branch with the specified id - * @param id the branch id + * @param id the branch id */ - close(id : any); + close(id: string|number): void; + + /** + * collapses gantt from the full screen mode to the normal mode + */ + collapse(): void; + + /** + * calls a confirm message box + * @param config the confirm box's configuration + */ + confirm(config: any): void; + + /** + * creates a deep copy of provided object + * @param task the object that needs to be copied + */ + copy(task: any): any; + + /** + * recalculates the task duration in the work time + * @param task the task's object + */ + correctTaskWorkTime(task: any): void; + + /** + * adds a new task and opens the lightbox to confirm + * @param task the task object + * @param parent the parent's id + * @param index optional, the position the task will be added into (0 or greater) + */ + createTask(task: any, parent: string, index?: number): string|number; + + /** + * dataProcessor constructor + * @param url url to the data feed + */ + dataProcessor(url: string): void; + + /** + * gets the date of the specified horizontal position in the chart area + * @param pos the relative horizontal position you want to know the date of + */ + dateFromPos(pos: number): void; + + /** + * returns false if the provided argument is undefined, otherwise true + * @param task the object that should be checked + */ + defined(task: any): boolean; /** * deletes the specified dependency link * @param id the dependency link's id */ - deleteLink(id: any); + deleteLink(id: string|number): void; + + /** + * deletes the specified marker + * @param markerId the marker's id + */ + deleteMarker(markerId: string): void; /** * deletes the specified task * @param id the task's id */ - deleteTask(id: string); + deleteTask(id: string): void; /** - * detaches all handlers from events (which were attached before by the attachEvent() method) + * detaches all events from dhtmlxGantt (both custom and inner) */ - detachAllEvents(); + detachAllEvents(): void; /** * detaches a handler from an event (which was attached before by the attachEvent() method) * @param id the event's id */ - detachEvent(id: string); + detachEvent(id: string): void; /** - * iterates over specified tasks of the Gantt chart - * @param code a function that will iterate over tasks. Takes a task object as a parameter + * iterates over all selected tasks in the Gantt chart + * @param code a function that will iterate over tasks. Takes a task id as a parameter + */ + eachSelectedTask(code: GanttCallback): void; + + /** + * iterates over specified tasks in the Gantt chart + * @param code a function that will iterate over tasks. Takes a task object as a parameter * @param parent the parent id. If specified, the function will iterate over childs of the
      specified parent * @param master the object, that 'this' will refer to */ - eachTask(code : (...args: any[])=>any, parent?: any, master?: any); + eachTask(code: GanttCallback, parent?: string|number, master?: any): void; + + /** + * attaches an event handler to an HTML element + * @param node the HTML node or its id + * @param event the name of an HTML event (without the 'on' prefix) + * @param handler the event handler + * @param master an object that the this keyword refers to + */ + event(node: HTMLElement|string, event: string, handler: GanttCallback, master?: any): string; + + /** + * removes an event handler from an HTML element + * @param id the id of an event handler + */ + eventRemove(id: string): void; + + /** + * expands gantt to the full screen mode + */ + expand(): void; /** * returns the 1st-level child tasks of the specified parent branch * @param id the parent branch's id */ - getChildren(id: any): any; + getChildren(id: string|number): any[]; + + /** + * returns the closest working time + * @param config the configuration object + */ + getClosestWorkTime(config: any): Date; /** * get the index of a task in the tree * @param id the task id */ - getGlobalTaskIndex(id: any); + getGlobalTaskIndex(id: string|number): void; + + /** + * gets the configuration object of a column + * @param name the column's name + */ + getGridColumn(name: string): any; + + /** + * gets columns of the Gantt chart + */ + getGridColumns(): any[]; /** * gets the label of a select control in the lightbox * @param property the name of a data property that the control is mapped to * @param key the option's id. This parameter is compared with the task's data property to
      assign the select's option to the task */ - getLabel(property: string, key: any); + getLabel(property: string, key: string|number): void; + + /** + * returns the id of the last selected task + */ + getLastSelectedTask(): string|number; /** * gets the lightbox's HTML object element @@ -707,6 +1182,11 @@ interface GanttStatic{ */ getLightboxSection(name: string): any; + /** + * returns the name of the active lighbox's structure + */ + getLightboxType(): string; + /** * returns values of the lightbox's sections */ @@ -716,25 +1196,64 @@ interface GanttStatic{ * returns the dependency link object by the specified id * @param id the link id */ - getLink(id: any): any; + getLink(id: string|number): any; + + /** + * returns the number of all dependency links presented in the Gantt chart + */ + getLinkCount(): number; /** * returns the HTML element of the specified dependency link * @param id the link id */ - getLinkNode(id: any): HTMLElement; + getLinkNode(id: string|number): HTMLElement; + + /** + * returns all links presented in the Gantt chart + */ + getLinks(): any[]; + + /** + * gets the marker's object + * @param markerId the marker's id + */ + getMarker(markerId: string): any; /** * returns the id of the next item (no matter what the level of nesting is: the same or different) * @param id the task id */ - getNext(id: any): any; + getNext(id: string|number): string|number; + + /** + * returns the id of the next task of the same level + * @param id the task id + */ + getNextSibling(id: string|number): string|number; + + /** + * returns the id of the parent task + * @param id the task id + */ + getParent(id: string|number): string|number; /** * returns the id of the previous item (no matter what the level of nesting is: the same or different) * @param id the task id */ - getPrev(id: any): any; + getPrev(id: string|number): string|number; + + /** + * returns the id of the previous task of the same level + * @param id the task id + */ + getPrevSibling(id: string|number): string|number; + + /** + * returns the stack of stored redo commands + */ + getRedoStack(): any[]; /** * returns the scroll position @@ -744,65 +1263,130 @@ interface GanttStatic{ /** * returns the id of the selected task */ - getSelectedId(): any; + getSelectedId(): string|number; + + /** + * returns an array of the currently selected tasks + */ + getSelectedTasks(): any[]; + + /** + * returns siblings of the specified task (including itself) + * @param id the task id + */ + getSiblings(id: string|number): any[]; + + /** + * checks how much time (in the current duration unit) a task has before it starts to affect other tasks + * @param task1 the object of the 1st task to check the slack for + * @param task2 the object of the 2nd task to check the slack for + */ + getSlack(task1: any, task2: any): number|string; /** * gets the current state of the Gantt chart */ getState(): any; + /** + * calculates the combined start/end dates of tasks nested in a project or another task + * @param task_id the task's id, api/gantt_root_id_config.md will be used if not specified + */ + getSubtaskDates(task_id?: string|number): any; + /** * returns the task object * @param id the task id */ - getTask(id: any): any; + getTask(id: string|number): any; /** * returns a collection of tasks which occur during the specified period * @param from the start date of the period * @param to the end date of the period */ - getTaskByTime(from?: Date, to?: Date): any; + getTaskByTime(from?: Date, to?: Date): any[]; + + /** + * gets the number of tasks that are currently loaded in the gantt + */ + getTaskCount(): number; /** * get the index of a task in the branch * @param id the task id */ - getTaskIndex(id: any): number; + getTaskIndex(id: string|number): number; /** * returns the HTML element of the task bar * @param id the task id */ - getTaskNode(id: any): HTMLElement; + getTaskNode(id: string|number): HTMLElement; + + /** + * calculates the position and size of the task's DOM element in the timeline area + * @param task the task object + * @param from the start date of the item + * @param to the end date of the item + */ + getTaskPosition(task: any, from: Date, to: Date): any; /** * returns the HTML element of the task row in the table * @param id the task id */ - getTaskRowNode(id: any): HTMLElement; + getTaskRowNode(id: string|number): HTMLElement; + + /** + * gets the top position of the task's DOM element in the timeline area + * @param id the task's id + */ + getTaskTop(id: number|string): number; + + /** + * returns the stack of stored undo commands + */ + getUndoStack(): any[]; + + /** + * gets the number of tasks visible on the screen (those that are not collapsed) + */ + getVisibleTaskCount(): number; + + /** + * returns the working hours of the specified date + * @param date a date to check + */ + getWorkHours(date: Date): any[]; + + /** + * groups tasks by the specified task's attribute + * @param config the grouping configuration object + */ + groupBy(config: any): void; /** * checks whether the specified item has child tasks * @param id the task id */ - hasChild(id: any): boolean; + hasChild(id: string|number): boolean; /** * hides the lightbox modal overlay that blocks interactions with the remaining screen * @param box an element to hide */ - hideCover(box?: HTMLElement); + hideCover(box?: HTMLElement): void; /** * closes the lightbox if it's currently active */ - hideLightbox(); + hideLightbox(): void; /** * hides the pop-up task form (if it's currently active) */ - hideQuickInfo(); + hideQuickInfo(): void; /** * constructor. Initializes a dhtmlxGantt object @@ -810,7 +1394,26 @@ interface GanttStatic{ * @param from the start value of the time scale (X–Axis) * @param to the end value of the time scale (X–Axis) */ - init(container: any, from?: Date, to?: Date); + init(container: string|HTMLElement, from?: Date, to?: Date): void; + + /** + * checks whether a task is a child of other task + * @param childId the id of a task that you want to check as a child + * @param parentId the id of a task that you want to check as a parent + */ + isChildOf(childId: string|number, parentId: string|number): boolean; + + /** + * checks whether the specified link is critical + * @param link the link's object + */ + isCriticalLink(link: any): boolean; + + /** + * checks whether the specified task is critical + * @param task the task's object + */ + isCriticalTask(task: any): boolean; /** * checks whether the specified link is correct @@ -822,19 +1425,38 @@ interface GanttStatic{ * checks whether the specified link exists * @param id the link id */ - isLinkExists(id: any): boolean; + isLinkExists(id: string|number): boolean; + + /** + * checks whether the specified task is currently selected + * @param task the task's id + */ + isSelectedTask(task: string|number): boolean; /** * checks whether the specified task exists * @param id the task id */ - isTaskExists(id: any): boolean; + isTaskExists(id: string|number): boolean; /** * checks whether the specifies task is currently rendered in the Gantt chart * @param id the task's id */ - isTaskVisible(id: any): boolean; + isTaskVisible(id: string|number): boolean; + + /** + * checks if the task is unscheduled + * @param task the task's object + */ + isUnscheduledTask(task: any): boolean; + + /** + * checks whether the specified date is working or not + * @param date a date to check + * @param timeunit a time unit: 'hour' or 'day'.
      If not specified, the value of 'gantt.config.duration_unit' is used + */ + isWorkTime(date: Date, timeunit: string): boolean; /** * loads data to the gantt from an external data source @@ -842,148 +1464,270 @@ interface GanttStatic{ * @param type ('json', 'xml', 'oldxml') the data type. The default value - 'json' * @param callback the callback function */ - load(url: string, type?: string, callback?: (...args: any[])=>any); + load(url: string, type?: string, callback?: GanttCallback): void; /** * gets the id of a task from the specified HTML event * @param e a native event */ - locate(e: Event): string; + locate(e: Event): string|number; + + /** + * calls a message box of the specified type + * @param config the message box's configuration + */ + message(config: any): void; + + /** + * adds properties of the 'source' object into the 'target' object + * @param target the target object + * @param source the source object + * @param force if true, properties of the 'source' will overwrite matching properties of the 'target', if there are any. If false, properties that already exist in the 'target' will be omitted + */ + mixin(target: any, source: any, force: boolean): void; + + /** + * calls a modalbox + * @param config the modal box' configuration + */ + modalbox(config: any): void; /** * moves a task to a new position * @param sid the id of the task to move - * @param tindex the index of the position that the task will be moved to
      (the index in the whole tree) + * @param tindex the index of the position that the task will be moved to
      (the index within a branch) * @param parent the parent id. If specified, the tindex will refer to the index in the
      'parent' branch */ - moveTask(sid: any, tindex: number, parent?: any); + moveTask(sid: string|number, tindex: number, parent?: string|number): void; /** * opens the branch with the specified id * @param id the branch id */ - open(id: any); + open(id: string|number): void; /** * loads data from a client-side resource * @param url a string or object which represents data * @param type ( 'json', 'xml' ) the data type. The default value - 'json' */ - parse(url: any, type?: string); + parse(url: string|any, type?: string): void; + + /** + * gets the relative horizontal position of the specified date in the chart area + * @param date a date you want to know the position of + */ + posFromDate(date: Date): void; + + /** + * applies the reverted changes to the gantt once again + */ + redo(): void; /** * refreshes data in the Gantt chart */ - refreshData(); + refreshData(): void; /** * refreshes the specifies link * @param id the link id */ - refreshLink(id: any); + refreshLink(id: string|number): void; /** * refreshes the task and its related links * @param id the task id */ - refreshTask(id: any); + refreshTask(id: string|number): void; + + /** + * removes the specified layer related to a link + * @param layerId a DOM element that will be displayed in the layer + */ + removeLinkLayer(layerId: string): void; + + /** + * removes the specified layer related to a task + * @param layerId a DOM element that will be displayed in the layer + */ + removeTaskLayer(layerId: string): void; /** * renders the whole Gantt chart */ - render(); + render(): void; + + /** + * updates all markers on the page + */ + renderMarkers(): void; /** * removes the current lightbox's HTML object element */ - resetLightbox(); + resetLightbox(): void; + + /** + * re-calculates the duration of a project task depending on dates its childs + * @param task the task's object + */ + resetProjectDates(task: any): void; + + /** + * re-calculates the skin's settings from the related attached skin CSS file + */ + resetSkin(): void; /** * forces the lightbox to resize */ - resizeLightbox(); + resizeLightbox(): void; + + /** + * rounds the specified date to the nearest date in the time scale + * @param date the Date object to round + */ + roundDate(date: Date): Date; + + /** + * rounds the start and end task's dates to the nearest dates in the time scale + * @param task the task object + */ + roundTaskDates(task: any): void; /** * scrolls the Gantt container to the specified position - * @param x the value of the horizontal scroll - * @param y the value of the vertical scroll + * @param x the value of the horizontal scroll or 'null' (to not display the horizontal scroll) + * @param y the value of the vertical scroll or 'null' (to not display the vertical scroll) */ - scrollTo(x: number, y: number); + scrollTo(x: number, y: number): void; /** * selects the specified task * @param id the task id */ - selectTask(id: any): any; + selectTask(id: string|number): string|number; /** - * serializes the data into JSON or XML format. + * serializes the data into JSON or XML format * @param type the format that the data will be serialized into.
      Possible values: 'json' (default ), 'xml'. */ - serialize(type?: string); + serialize(type?: string): void; /** * returns a list of options * @param list_name the name of a list * @param options an array of options */ - serverList(list_name: string, options?: any); + serverList(list_name: string, options?: any[]): void; + + /** + * set the parent for a task + * @param task the task id + * @param pid the parent task id + */ + setParent(task: number|string, pid: number|string): void; /** * resizes the Gantt chart */ - setSizes(); + setSizes(): void; + + /** + * sets the working time for the Gantt chart + * @param config the configuration object of a time span + */ + setWorkTime(config: any): void; /** * shows the lightbox modal overlay that blocks interactions with the remaining screen * @param box an element to hide */ - showCover(box?: HTMLElement); + showCover(box?: HTMLElement): void; + + /** + * scrolls the chart area to makes the specified date visible + * @param date the date to show in the chart + */ + showDate(date: Date): void; /** * opens the lightbox for the specified task - * @param id the task id + * @param id the task id */ - showLightbox(id : any); + showLightbox(id: string|number): void; /** * displays the pop-up task form for the specified task * @param id the task id */ - showQuickInfo(id: any); + showQuickInfo(id: string|number): void; /** * makes the specified task visible on the screen * @param id the task id */ - showTask(id: any); + showTask(id: string|number): void; /** * sorts the tasks in the grid * @param field the name of the column that the grid will be sorted by or a custom
      sorting function * @param desc specifies the sorting direction: true - descending sort and false - ascending
      sort. By default, false * @param parent the id of the parent task. Specify the parameter if you want to sort tasks only in
      the branch of the specified parent. + * @param silent specifies whether rendering shall be invoked after reordering items */ - sort(field: any, desc?: boolean, parent?: any); + sort(field: string|GanttCallback, desc?: boolean, parent?: string|number, silent?: boolean): void; + + /** + * selects the specified task if it was unselected and vice versa + * @param task the task's id + */ + toggleTaskSelection(task: string|number): void; + + /** + * returns a unique id + */ + uid(): number; + + /** + * reverts the changes made in the gantt + */ + undo(): void; /** * removes selection from the selected task */ - unselectTask(); + unselectTask(): void; + + /** + * updates the specified collection with new options + * @param collection the name of the collection to update + * @param options the new values of the collection + */ + updateCollection(collection: string, options: any[]): boolean; /** * updates the specified dependency link * @param id the task id */ - updateLink(id: string); + updateLink(id: string): void; + + /** + * updates the specified marker + * @param markerId the marker's id + */ + updateMarker(markerId: string): void; /** * updates the specified task * @param id the task id */ - updateTask(id: string); + updateTask(id: string): void; + } -declare var gantt: GanttStatic; \ No newline at end of file +declare var gantt: GanttStatic; +declare var Gantt: GanttEnterprise; \ No newline at end of file diff --git a/dhtmlxscheduler/dhtmlxscheduler-tests.ts b/dhtmlxscheduler/dhtmlxscheduler-tests.ts index 2f1f2d9ce8..f3e864ffca 100644 --- a/dhtmlxscheduler/dhtmlxscheduler-tests.ts +++ b/dhtmlxscheduler/dhtmlxscheduler-tests.ts @@ -30,4 +30,11 @@ scheduler.load("/data/events"); //events scheduler.attachEvent("onEmptyClick", function (ev?: Event) { var date: Date = scheduler.getActionData(ev).date; -}); \ No newline at end of file +}); + +//filters +scheduler.filter_week = (id: string, e: Event) => true; + +//enterprise version +var scheduler2 = Scheduler.getSchedulerInstance(); +scheduler2.addEvent({ some: 1 }); \ No newline at end of file diff --git a/dhtmlxscheduler/dhtmlxscheduler.d.ts b/dhtmlxscheduler/dhtmlxscheduler.d.ts index 42bd819e4c..40123827ca 100644 --- a/dhtmlxscheduler/dhtmlxscheduler.d.ts +++ b/dhtmlxscheduler/dhtmlxscheduler.d.ts @@ -1,16 +1,20 @@ -// Type definitions for dhtmlxScheduler 4.0 +// Type definitions for dhtmlxScheduler 4.3.0 // Project: http://dhtmlx.com/docs/products/dhtmlxScheduler // Definitions by: Maksim Kozhukh // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +interface SchedulerCallback { (...args: any[]) : any } +interface SchedulerFilterCallback { (id: string | number, event: any): boolean } + +type SchedulerEventName ='onAfterEventDisplay'|'onAfterFolderToggle'|'onAfterLightbox'|'onAfterSchedulerResize'|'onBeforeCollapse'|'onBeforeDrag'|'onBeforeEventChanged'|'onBeforeEventCreated'|'onBeforeEventDelete'|'onBeforeEventDisplay'|'onBeforeEventDragIn'|'onBeforeEventDragOut'|'onBeforeExpand'|'onBeforeExternalDragIn'|'onBeforeFolderToggle'|'onBeforeLightbox'|'onBeforeSectionRender'|'onBeforeTodayDisplayed'|'onBeforeTooltip'|'onBeforeViewChange'|'onCellClick'|'onCellDblClick'|'onClearAll'|'onClick'|'onCollapse'|'onConfirmedBeforeEventDelete'|'onContextMenu'|'onDblClick'|'onDragEnd'|'onEmptyClick'|'onEventAdded'|'onEventCancel'|'onEventChanged'|'onEventCollision'|'onEventCopied'|'onEventCreated'|'onEventCut'|'onEventDeleted'|'onEventDrag'|'onEventDragIn'|'onEventDragOut'|'onEventDropOut'|'onEventIdChange'|'onEventLoading'|'onEventPasted'|'onEventSave'|'onExpand'|'onExternalDragIn'|'onLightbox'|'onLightboxButton'|'onLimitViolation'|'onLoadError'|'onLocationError'|'onMouseDown'|'onMouseMove'|'onOptionsLoad'|'onOptionsLoadFinal'|'onOptionsLoadStart'|'onSaveError'|'onScaleAdd'|'onScaleDblClick'|'onSchedulerReady'|'onSchedulerResize'|'onTemplatesReady'|'onTimelineCreated'|'onViewChange'|'onViewMoreClick'|'onXLE'|'onXLS'|'onXScaleClick'|'onXScaleDblClick'|'onYScaleClick'|'onYScaleDblClick'; interface SchedulerTemplates{ /** * specifies the date in the header of the view - * @param start the start date of the view - * @param end the end date of the view + * @param start the start date of the view + * @param end the end date of the view */ - agenda_date(start : Date, end : Date): string; + agenda_date(start: Date, end: Date): string; /** * specifies the text in the second column of the Agenda view @@ -29,14 +33,14 @@ interface SchedulerTemplates{ agenda_time(start: Date, end: Date, event: any): string; /** - * specifies the format for dates that are set by means of API methods. Used to parse incoming dates + * specifies the format of dates that are set by means of API methods. Used to parse incoming dates * @param date the date which needs formatting */ api_date(date: Date): string; /** - * specifies the format of the day in a cell - * @param date the cell date + * specifies the format of the date in a cell + * @param date the cell's date */ calendar_date(date: Date): string; @@ -53,7 +57,7 @@ interface SchedulerTemplates{ calendar_scale_date(date: Date): string; /** - * specifies the date format of the lightbox start and end date inputs + * specifies the date format of the lightbox's start and end date inputs * @param date the date which needs formatting */ calendar_time(date: Date): string; @@ -70,6 +74,22 @@ interface SchedulerTemplates{ */ day_scale_date(date: Date): string; + /** + * specifies the CSS class that will be applied to the highlighted event's duration on the time scale + * @param start the date when an event is scheduled to begin + * @param end the date when an event is scheduled to be completed + * @param ev the event's object + */ + drag_marker_class(start: Date, end: Date, ev: any): void; + + /** + * specifies the content of the highlighted block on the time scale + * @param start the date when an event is scheduled to begin + * @param end the date when an event is scheduled to be completed + * @param ev the event's object + */ + drag_marker_content(start: Date, end: Date, ev: any): void; + /** * specifies the date of an event. Applied to one-day events only * @param start the date when an event is scheduled to begin @@ -79,20 +99,20 @@ interface SchedulerTemplates{ event_bar_date(start: Date, end: Date, event: any): string; /** - * specifies the event text. Applied to all events + * specifies the event's text. Applied to multi-day events only * @param start the date when an event is scheduled to begin * @param end the date when an event is scheduled to be completed - * @param event the event object + * @param event the event's object */ event_bar_text(start: Date, end: Date, event: any): string; /** - * specifies the css style for the event container + * specifies the CSS class that will be applied to the event's container * @param start the date when an event is scheduled to begin * @param end the date when an event is scheduled to be completed - * @param event the event object + * @param ev the event's object */ - event_class(start: Date, end: Date, event: any): string; + event_class(start: Date, end: Date, ev: any): string; /** * specifies the time part of the start and end dates of the event. Mostly used by other templates for presenting time periods @@ -101,15 +121,15 @@ interface SchedulerTemplates{ event_date(date: Date): string; /** - * specifies the event header + * specifies the event's header * @param start the date when an event is scheduled to begin * @param end the date when an event is scheduled to be completed - * @param event the event object + * @param event the event's object */ event_header(start: Date, end: Date, event: any): string; /** - * specifies the event text + * specifies the event's text * @param start the date when an event is scheduled to begin * @param end the date when an event is scheduled to be completed * @param event the event object @@ -129,11 +149,11 @@ interface SchedulerTemplates{ load_format(date: Date): string; /** - * specified the date in the header of the view - * @param start the start date of the view - * @param end the end date of the view + * specifies the date in the header of the view + * @param start the start date of the view + * @param end the end date of the view */ - map_date(start : Date, end : Date): string; + map_date(start: Date, end: Date): string; /** * specifies the text in the second column of the view @@ -174,12 +194,10 @@ interface SchedulerTemplates{ month_date(date: Date): string; /** - * specifies the css class that will be applied to a day cell - * @param start the date when an event is scheduled to begin - * @param end the date when an event is scheduled to be completed - * @param event the event object + * specifies the CSS class that will be applied to a day cell + * @param date the date which needs formatting */ - month_date_class(start: Date, end: Date, event: any): string; + month_date_class(date: Date): string; /** * specifies the format of the day in a cell @@ -244,12 +262,12 @@ interface SchedulerTemplates{ tooltip_text(start: Date, end: Date, event: any): string; /** - * specifies the event text + * specifies the event's text * @param start the date when an event is scheduled to begin * @param end the date when an event is scheduled to be completed * @param event the event object - * @param cellDate the date of a day cell that an one-day event or a single occurrence of the recurring event displayes in - * @param pos the position a single occurrence in the recurring event: 'start' - the first occurrence, 'end' - the last occurrence, 'middle' - for remaining occurrences + * @param cellDate the date of a day cell that a one-day event or a single occurrence of
      the recurring event displays in + * @param pos the position of a single occurrence in the recurring event: 'start' - the first occurrence, 'end' - the last occurrence, 'middle' - for remaining occurrences */ week_agenda_event_text(start: Date, end: Date, event: any, cellDate: Date, pos: string): string; @@ -260,14 +278,14 @@ interface SchedulerTemplates{ week_agenda_scale_date(date: Date): string; /** - * specified the date in the header of the view - * @param start the start date of the view - * @param end the end date of the view + * specifies the date in the header of the view + * @param start the start date of the view + * @param end the end date of the view */ - week_date(start : Date, end : Date): string; + week_date(start: Date, end: Date): string; /** - * specifies the css class that will be applied to a day cell + * specifies the CSS class that will be applied to a day cell * @param start the date when an event is scheduled to begin * @param end the date when an event is scheduled to be completed * @param event the event object @@ -299,13 +317,13 @@ interface SchedulerTemplates{ year_date(date: Date): string; /** - * specifies the month name in the header of a month block of the view. + * specifies the month's name in the header of a month block of the view. * @param date the date which needs formatting */ year_month(date: Date): string; /** - * specifies the day name in the sub-header of a month block of the view + * specifies the day's name in the sub-header of a month block of the view * @param date the date which needs formatting */ year_scale_date(date: Date): string; @@ -319,7 +337,7 @@ interface SchedulerTemplates{ year_tooltip(start: Date, end: Date, event: any): string; /** - * specifies the lightbox header + * specifies the lightbox's header * @param start the date when an event is scheduled to begin * @param end the date when an event is scheduled to be completed * @param event the event object @@ -328,10 +346,10 @@ interface SchedulerTemplates{ /** * specifies the date in the header of the view - * @param start the start date of the view - * @param end the end date of the view + * @param start the start date of the view + * @param end the end date of the view */ - grid_date(start : Date, end : Date): string; + grid_date(start: Date, end: Date): string; /** * specifies the format of dates in columns with id='date' @@ -349,7 +367,7 @@ interface SchedulerTemplates{ /** * specifies the text in the columns - * @param field_name the column id + * @param field_name the column's id * @param event the event object */ grid_field(field_name: string, event: any): string; @@ -357,16 +375,17 @@ interface SchedulerTemplates{ /** * specifies the number of scheduled events in a cell of the view * @param evs an array of objects of events contained in a cell + * @param date the date of a cell */ - timeline_cell_value(evs: any): string; + timeline_cell_value(evs: any[], date: Date): string; /** - * specifies the css style for a cell of the view + * specifies the CSS class that will be applied to a cell of the view * @param evs an array of objects of events contained in a cell (defined only in the 'cell' mode) - * @param date the date of a column + * @param date the date of a column * @param section the section object */ - timeline_cell_class(evs: any, date : Date, section: any): string; + timeline_cell_class(evs: any[], date: Date, section: any): string; /** * specifies the name of a CSS class that will be applied to items of the X-Axis @@ -382,19 +401,19 @@ interface SchedulerTemplates{ /** * specifies the name of a CSS class that will be applied to items of the Y-Axis - * @param key the section id - * @param label the section label - * @param section the section object that contains the key and label properties + * @param key the section's id + * @param label the section's label + * @param section the section object that contains the 'key' and 'label' properties */ - timeline_scaley_class(key: string, label : string, section: any): string; + timeline_scaley_class(key: string, label: string, section: any): string; /** * specifies items of the Y-Axis - * @param key the section id (key) - * @param label the section label - * @param section the section object containing the key and label properties + * @param key the section's id (key) + * @param label the section's label + * @param section the section object containing the 'key' and 'label' properties */ - timeline_scale_label(key : string, label : string, section : any): string; + timeline_scale_label(key: string, label: string, section: any): string; /** * specifies the tooltip over a day cell containing some scheduled event(s) @@ -406,10 +425,10 @@ interface SchedulerTemplates{ /** * specifies the date in the header of the view - * @param date1 the date when an event is scheduled to begin - * @param date2 the date when an event is scheduled to be completed + * @param date1 the date when an event is scheduled to begin + * @param date2 the date when an event is scheduled to be completed */ - timeline_date(date1 : Date, date2 : Date): string; + timeline_date(date1: Date, date2: Date): string; /** * specifies items of the X-Axis @@ -431,11 +450,12 @@ interface SchedulerTemplates{ /** * specifies items of the X-Axis - * @param key the unit id (key) - * @param label the unit label - * @param unit the unit object containing the key and label properties + * @param key the unit's id (key) + * @param label the unit's label + * @param unit the unit object containing the 'key' and 'label' properties */ - units_scale_text(key : string, label : string, unit : any): string; + units_scale_text(key: string, label: string, unit: any): string; + } interface SchedulerConfigOptions{ @@ -454,10 +474,15 @@ interface SchedulerConfigOptions{ */ agenda_start: Date; + /** + * specifies how to display the default error notification in case the XML data loading failed + */ + ajax_error: string|boolean; + /** * 'says' to show multi-day events in the regular way (as one-day events are displayed) */ - all_timed: any; + all_timed: boolean|string; /** * sets the date format that will be used by the addEvent() method to parse the start_date, end_date properties in case they are specified as strings @@ -472,12 +497,12 @@ interface SchedulerConfigOptions{ /** * stores a collection of buttons resided in the left bottom corner of the lightbox */ - buttons_left: any; + buttons_left: any[]; /** * stores a collection of buttons resided in the right bottom corner of the lightbox */ - buttons_right: any; + buttons_right: any[]; /** * sets the maximum number of events in a cascade @@ -510,7 +535,7 @@ interface SchedulerConfigOptions{ container_autoresize: boolean; /** - * sets the format for the date in the header of the Week and Units views + * sets the date format for the X-Axis of the Week and Units views */ day_date: string; @@ -524,13 +549,18 @@ interface SchedulerConfigOptions{ */ default_date: string; + /** + * sets a timeout (in milliseconds) that wraps the api/scheduler_updateview.md and api/scheduler_setcurrentview.md calls ( that cause re-drawing of the scheduler ) + */ + delay_render: number; + /** * 'says' to use the extended form while creating new events by drag or double click */ details_on_create: boolean; /** - * 'says' to open the extended form after double clicking on an event + * 'says' to open the lightbox after double clicking on an event */ details_on_dblclick: boolean; @@ -554,6 +584,16 @@ interface SchedulerConfigOptions{ */ drag_create: boolean; + /** + * highlights the event's duration on the time scale when you drags an event over the scheduler + */ + drag_highlight: boolean; + + /** + * restrict dragging events to the calling scheduler from any other scheduler(s) + */ + drag_in: boolean; + /** * enables the possibility to drag the lightbox by the header */ @@ -564,6 +604,11 @@ interface SchedulerConfigOptions{ */ drag_move: boolean; + /** + * restrict dragging events from the calling scheduler to any other scheduler(s) + */ + drag_out: boolean; + /** * enables the possibility to resize events by drag-and-drop */ @@ -590,7 +635,7 @@ interface SchedulerConfigOptions{ fix_tab_position: boolean; /** - * enables setting of the event duration to the full day + * enables setting of the event's duration to the full day */ full_day: boolean; @@ -600,7 +645,7 @@ interface SchedulerConfigOptions{ highlight_displayed_event: boolean; /** - * sets the format of Y-Axis items + * sets the time format of Y-Axis. Also used in the default event and lighbox templates for setting the time part. */ hour_date: string; @@ -610,20 +655,25 @@ interface SchedulerConfigOptions{ hour_size_px: number; /** - * stores a collection of icons visible in the side edit menu of the event box + * stores a collection of icons visible in the side edit menu of the event's box */ - icons_edit: any; + icons_edit: any[]; /** - * stores a collection of icons visible in the side selection menu of the event box + * stores a collection of icons visible in the side selection menu of the event's box */ - icons_select: any; + icons_select: any[]; /** * defines whether the date specified in the 'End by' field should be exclusive or inclusive */ include_end_by: boolean; + /** + * disables the keyboard navigation in the scheduler + */ + key_nav: boolean; + /** * sets the maximum value of the hour scale (Y-Axis) */ @@ -640,10 +690,15 @@ interface SchedulerConfigOptions{ lightbox: any; /** - * defines the lightbox behavior while opening in the edit mode + * defines the lightbox's behavior, when the user opens the lightbox to edit a recurring event */ lightbox_recurring: string; + /** + * denies to drag events out of the visible area of the scheduler + */ + limit_drag_out: boolean; + /** * sets the right border of the allowable date range */ @@ -660,7 +715,7 @@ interface SchedulerConfigOptions{ limit_time_select: boolean; /** - * limits viewing events + * limits the date period during which the user can view the events */ limit_view: boolean; @@ -675,7 +730,7 @@ interface SchedulerConfigOptions{ map_end: Date; /** - * sets the position that will be displayed on the map in case the event location can't be identified + * sets the position that will be displayed on the map in case the event's location can't be identified */ map_error_position: any; @@ -695,7 +750,7 @@ interface SchedulerConfigOptions{ map_initial_zoom: number; /** - * activates attempts to resolve the event location if the database doesn't have the event's coordinates stored + * activates attempts to resolve the event's location, if the database doesn't have the event's coordinates stored */ map_resolve_event_location: boolean; @@ -715,7 +770,7 @@ interface SchedulerConfigOptions{ map_type: any; /** - * sets the zoom that will be used to show the user's location if he agrees to the browser offer to show it + * sets the zoom that will be used to show the user's location, if the user agrees to the browser's offer to show it */ map_zoom_after_resolve: number; @@ -725,12 +780,12 @@ interface SchedulerConfigOptions{ mark_now: boolean; /** - * sets the maximum number of displayable in a cell events + * sets the maximum number of events displayable in a cell */ max_month_events: number; /** - * specifies the minicalendar object + * specifies the mini calendar object */ minicalendar: any; @@ -740,7 +795,7 @@ interface SchedulerConfigOptions{ month_date: string; /** - * sets the format for the day in a cell of the Month and Year views + * sets the format for the day in the cells of the Month and Year views */ month_day: string; @@ -757,7 +812,22 @@ interface SchedulerConfigOptions{ /** * sets the height of the area that displays multi-day events */ - multi_day_height_limit: any; + multi_day_height_limit: number|boolean; + + /** + * enables the possibility to render the same events in several sections of the Timeline or Units view + */ + multisection: boolean; + + /** + * specifies whether while dragging events that assigned to several sections of the Timeline or Units view, all instances should be dragged at once ('true') or just the selected one ('false') + */ + multisection_shift_all: boolean; + + /** + * sets the date for the current-time marker in the Limit extension (enabled by the configuration - mark_now) + */ + now_date: Date; /** * allows working with recurring events independently of time zones @@ -765,12 +835,12 @@ interface SchedulerConfigOptions{ occurrence_timestamp_in_utc: boolean; /** - * defines the 'saving' behaviour for the case when the user edits the event text directly in the event box + * defines the 'saving' behaviour for the case, when the user edits the event's text directly in the event's box */ positive_closing: boolean; /** - * fixes dnd in case of non-linear time scale + * preserves the visible length of an event while dragging along a non-linear time scale */ preserve_length: boolean; @@ -800,7 +870,12 @@ interface SchedulerConfigOptions{ readonly_form: boolean; /** - * sets the date format of the 'End by' field in the 'recurring' lighbox + * specifies working days that will affect the recurring event when the user selects the ""Every workday" option in the lightbox + */ + recurring_workdays: any[]; + + /** + * sets the date format of the 'End by' field in the 'recurring' lightbox */ repeat_date: string; @@ -810,12 +885,27 @@ interface SchedulerConfigOptions{ repeat_precise: boolean; /** - * sets the initial position of the vertical scroll in the scheduler (an hour in the 24h format) + * enables the possibility to resize multi-day events in the Month view by drag-and-drop + */ + resize_month_events: boolean; + + /** + * enables the possibility to resize single-day events in the Month view by drag-n-drop + */ + resize_month_timed: boolean; + + /** + * sets the initial position of the vertical scroll in the scheduler (an hour in the 24-hour clock format) */ scroll_hour: number; /** - * shows/hides the select bar in the event box + * specifies the delimeter that will be used to separate several sections/units in the related data property of the event + */ + section_delemiter: string; + + /** + * shows/hides the select bar in the event's box */ select: boolean; @@ -825,7 +915,7 @@ interface SchedulerConfigOptions{ separate_short_events: boolean; /** - * enables converting server-side dates from UTC to a local time zone (and backward) during sending data to the server + * enables converting server-side dates from UTC to a local time zone (and backward) while sending data to the server */ server_utc: boolean; @@ -834,6 +924,11 @@ interface SchedulerConfigOptions{ */ show_loading: boolean; + /** + * activates/disables the 'quick_info' extension (pop-up task's details form) + */ + show_quick_info: boolean; + /** * sets the start day of weeks */ @@ -847,25 +942,35 @@ interface SchedulerConfigOptions{ /** * enables/disables the touch support in the scheduler */ - touch: any; + touch: boolean|string; /** * defines the time period in milliseconds that is used to differ the long touch gesture from the scroll gesture */ - touch_drag: any; + touch_drag: number|boolean; /** - * enables/disables prompting messages in the right up corner of the screen + * enables/disables prompting messages in the right top corner of the screen */ touch_tip: boolean; + /** + * disables dhtmxlScheduler's tooltips on the touch devices + */ + touch_tooltip: boolean; + + /** + * updates the mode when the scheduler fully repaints itself on any action + */ + update_render: boolean; + /** * 'says' events to occupy the whole width of the cell */ use_select_menu_space: boolean; /** - * sets the format for the date in the sub-header of the Month view + * sets the format of the date in the sub-header of the Month view */ week_date: string; @@ -887,9 +992,9 @@ interface SchedulerConfigOptions{ /** * sets the number of columns in the Year view */ - year_y: number; -} + year_y: number; +} interface SchedulerDateHelpers{ add(origin: Date, count: number, unit: string): Date; @@ -917,8 +1022,6 @@ interface SchedulerHotkeys{ edit_cancel: number; } -//scheduler.locale - interface SchedulerLocaleDate{ month_full: string[]; month_short: string[]; @@ -948,6 +1051,7 @@ interface SchedulerLocale{ labels: SchedulerLocaleLabels; } + interface SchedulerSizes{ /** * the height of day cells in the month view @@ -1020,6 +1124,13 @@ interface SchedulerSizes{ scroll_width: number; } +interface SchedulerEnterprise{ + /** + * Creates a new instance of Scheduler + */ + getSchedulerInstance(): SchedulerStatic; +} + interface SchedulerStatic{ templates: SchedulerTemplates; config: SchedulerConfigOptions; @@ -1030,6 +1141,59 @@ interface SchedulerStatic{ xy: SchedulerSizes; locale: SchedulerLocale; + /** + * filter events that will be displayed on the day view + */ + filter_day: SchedulerFilterCallback; + + /** + * filter events that will be displayed on the week view + */ + filter_week: SchedulerFilterCallback; + + /** + * filter events that will be displayed on the month view + */ + filter_month: SchedulerFilterCallback; + + /** + * filter events that will be displayed on the year view + */ + filter_year: SchedulerFilterCallback; + + /** + * filter events that will be displayed on the agenda view + */ + filter_agenda: SchedulerFilterCallback; + + /** + * filter events that will be displayed on the timeline view + */ + filter_timeline: SchedulerFilterCallback; + + /** + * filter events that will be displayed on the units view + */ + filter_units: SchedulerFilterCallback; + + /** + * filter events that will be displayed on the grid view + */ + filter_grid: SchedulerFilterCallback; + + + /** + * removes all blocking sets from the scheduler + */ + deleteMarkedTimespan(); + + /** + * removes marking/blocking set by the addMarkedTimespan() and blockTime() methods + * @param configuration for deleting + */ + deleteMarkedTimespan(config: any); + + /** * adds a new event * @param event the event object @@ -1043,10 +1207,10 @@ interface SchedulerStatic{ addEventNow(event: any): string; /** - * marks dates but with certain settings makes blocking (unlike blockTime() allows setting custom styling for the limit) + * marks dates, but with certain settings makes blocking (unlike blockTime() allows setting custom styling for the limit) * @param config the configuration object of the timespan to mark/block */ - addMarkedTimespan(config: any); + addMarkedTimespan(config: any): number; /** * adds a section to the currently active view (if the opened view isn't Timeline in the 'Tree' mode - the method will be ignored) @@ -1057,55 +1221,55 @@ interface SchedulerStatic{ /** * attaches the handler to an inner event of dhtmlxScheduler - * @param name the event name, case-insensitive + * @param name the event's name, case-insensitive * @param handler the handler function */ - attachEvent(name: string, handler: (...args: any[])=>any): string; + attachEvent(name: SchedulerEventName, handler: SchedulerCallback): string; /** * makes the scheduler reflect all data changes in the Backbone model and vice versa * @param events the Backbone data collection */ - backbone(events: any); + backbone(events: any): void; /** * blocks the specified date and applies the default 'dimmed' style to it. - * @param date a date to block ( if a number is provided, the parameter will be treated as a week day: '0' index refers to Sunday, '6' - to Saturday) - * @param time_points an array [start_minute,end_minute,..,start_minute_N,end_minute_N] where each pair sets a certain limit range. The array can have any number of such pairs + * @param date a date to block ( if a number is provided, the parameter will be treated as a week
      day: '0' index refers to Sunday,'6' - to Saturday ) + * @param time_points an array [start_minute,end_minute,..,start_minute_N,end_minute_N],
      where each pair sets a certain limit range. The array can have any number of
      such pairs * @param items defines specific items of view(s) to block */ - blockTime(date: any, time_points: any, items?: any); + blockTime(date: Date|number, time_points: any[], items?: any): void; /** * calls an inner event - * @param name the event name, case-insensitive - * @param params an array of the event related data + * @param name the event's name, case-insensitive + * @param params an array of the event-related data */ - callEvent(name: string, params: any): boolean; + callEvent(name: string, params: any[]): boolean; /** - * changes the event id - * @param id the current event id - * @param new_id the new event id + * changes the event's id + * @param id the current event's id + * @param new_id the new event's id */ - changeEventId(id: string, new_id: string); + changeEventId(id: string, new_id: string): void; /** - * checks whether the specified event occurs at the time that has been already occupied with another event(s) + * checks whether the specified event occurs at the time that has already been occupied by another event(s) * @param event the event object */ checkCollision(event: any): boolean; /** * checks whether an event has some handler(s) specified - * @param name the event name + * @param name the event's name */ - checkEvent(name: string): boolean; + checkEvent(name: SchedulerEventName): boolean; /** - * checks whether an event resides in a specific timespan + * checks whether an event resides in a timespan of a specific type * @param event the event object - * @param timespan the timespan type + * @param timespan the timespan's type */ checkInMarkedTimespan(event: any, timespan: string): boolean; @@ -1118,118 +1282,100 @@ interface SchedulerStatic{ /** * removes all events from the scheduler */ - clearAll(); + clearAll(): void; /** * closes all sections in the currently active view (if the opened view isn't Timeline in the 'Tree' mode - the method will be ignored) */ - closeAllSections(); + closeAllSections(): void; /** * closes the specified section in the currently active view (if the opened view isn't Timeline in the 'Tree' mode - the method will be ignored) - * @param section_id the section id + * @param section_id the section's id */ - closeSection(section_id: string); + closeSection(section_id: string): void; /** * collapses the expanded scheduler back to the normal size */ - collapse(); + collapse(): void; /** * creates the Grid view in the scheduler * @param config the configuration object of the Grid view */ - createGridView(config: any); + createGridView(config: any): void; /** * creates the Timeline view in the scheduler * @param config the configuration object of the Timeline view */ - createTimelineView(config: any); + createTimelineView(config: any): void; /** * creates the Units view in the scheduler * @param config the configuration object of the Units view */ - createUnitsView(config: any); + createUnitsView(config: any): void; /** * deletes all sections from the currently active view (if the opened view isn't Timeline in the 'Tree' mode - the method will be ignored) */ - deleteAllSections(); + deleteAllSections(): void; /** * deletes the specified event - * @param id the event id + * @param id the event's id */ - deleteEvent(id: any); - - /** - * removes all blocking sets from the scheduler - */ - deleteMarkedTimespan(); + deleteEvent(id: string|number): void; /** * removes marking/blocking set by the addMarkedTimespan() and blockTime() methods - * @param id the timespan id + * @param id the timespan's id */ - deleteMarkedTimespan(id: string); - - /** - * removes marking/blocking set by the addMarkedTimespan() and blockTime() methods - * @param configuration for deleting - */ - deleteMarkedTimespan(config: any); + deleteMarkedTimespan(id: string): void; /** * deletes a section from the currently active view (if the opened view isn't Timeline in the 'Tree' mode - the method will be ignored) - * @param section_id the section id + * @param section_id the section's id */ deleteSection(section_id: string): boolean; /** * destroys previously created mini-calendar - * @param name the mini-calendar's object (if not specified, the scheduler attempts to destroy the last created mini calendar) + * @param name the mini-calendar's object (if not specified, the scheduler attempts
      to destroy the last created mini calendar) */ - destroyCalendar(name?: any); + destroyCalendar(name?: any): void; /** * detaches a handler from an event (which was attached before by the attachEvent method) - * @param id the event id + * @param id the event's id */ - detachEvent(id: string); + detachEvent(id: string): void; /** - * opens the inline editor to alter the event text (the editor in the event box) - * @param id the event id + * opens the inline editor to alter the event's text (the editor in the event's box) + * @param id the event's id */ - edit(id: string); + edit(id: string): void; /** - * closes the inline event edotor if it's currently open - * @param id the event id + * closes the inline event editor, if it's currently open + * @param id the event's id */ - editStop(id: string); + editStop(id: string): void; /** * closes the lightbox - * @param mode if set to true, the changes made in the lightbox will be saved before closing. If - false, the changes will be cancelled. + * @param mode if set to true, the changes, made in the lightbox, will be saved before closing.
      If - false, the changes will be cancelled. * @param box the HTML container for the lightbox */ - endLightbox(mode: boolean, box: HTMLElement); + endLightbox(mode: boolean, box?: HTMLElement): void; /** * expands the scheduler to the full screen view */ - expand(); - - /** - * filter events that will be displayed on the week view - * @param id event-id - * @param event event-object - */ - filter_week(id: any, event: any); + expand(): void; /** * gives access to the objects of lightbox's sections @@ -1244,26 +1390,26 @@ interface SchedulerStatic{ getActionData(e: Event): any; /** - * return the event object by its id - * @param event_id event_id + * returns the event object by its id + * @param event_id the event's id */ - getEvent(event_id: any): T; + getEvent(event_id: string|number): void; /** * gets the event's end date - * @param id the event id + * @param id the event's id */ getEventEndDate(id: string): Date; /** * gets the event's start date - * @param id the event id + * @param id the event's id */ getEventStartDate(id: string): Date; /** * gets the event's text - * @param id the event id + * @param id the event's id */ getEventText(id: string): string; @@ -1272,14 +1418,14 @@ interface SchedulerStatic{ * @param from the start date of the period * @param to the end date of the period */ - getEvents(from?: Date, to?: Date); + getEvents(from?: Date, to?: Date): void; /** - * gets the label of a select control in the lighbox + * gets the label of a select control in the lightbox * @param property the name of a data property that the control is mapped to - * @param key the option id. This parameter is compared with the event data property to assign the select's option to an event + * @param key the option's id. This parameter is compared with the event's data property
      to assign the select's option to an event */ - getLabel(property: string, key: any); + getLabel(property: string, key: string|number): void; /** * gets the lightbox's HTML object element @@ -1294,14 +1440,14 @@ interface SchedulerStatic{ getRecDates(id: string, number: number): any; /** - * gets the object of the currently displayable event - * @param id the event id + * gets the object of the currently displayed event + * @param id the event's id */ getRenderedEvent(id: string): HTMLElement; /** * gets the object of the specified section in the currently active view (if the opened view isn't Timeline in the 'Tree' mode - the method will be ignored) - * @param section_id the section id + * @param section_id the section's id */ getSection(section_id: string): any; @@ -1312,7 +1458,7 @@ interface SchedulerStatic{ /** * gets the user data associated with the specified event - * @param id the event id + * @param id the event's id * @param name the user data name */ getUserData(id: string, name: string): any; @@ -1321,31 +1467,37 @@ interface SchedulerStatic{ * hides the lightbox modal overlay that blocks interactions with the remaining screen * @param box an element to hide */ - hideCover(box?: HTMLElement); + hideCover(box?: HTMLElement): void; /** * hides the pop-up event form (if it's currently active) */ - hideQuickInfo(); + hideQuickInfo(): void; /** - * initializes an instance of dhtmlxScheduler - * @param container the id or object of the HTML container that the scheduler will be created inside + * highlights the event's duration on the time scale + * @param event the event object + */ + highlightEventPosition(event: any): void; + + /** + * constructor. Initializes a dhtmlxScheduler object + * @param container an HTML container ( or its id) where a dhtmlxScheduler object will be initialized * @param date the initial date of the scheduler (by default, the current date) * @param view the name of the initial view (by default, "week") */ - init(container: any, date?: Date, view?: string); + init(container: string|HTMLElement, date?: Date, view?: string): void; /** * inverts the specified time zones - * @param zones an array [start_minute,end_minute,..,start_minute_N,end_minute_N] where each pair sets a certain limit range (in minutes). The array can have any number of such pairs + * @param zones an array **[start_minute,end_minute,..,start_minute_N,end_minute_N]**
      where each pair sets a certain limit range (in minutes). The array can have any
      number of such pairs */ - invertZones(zones: any); + invertZones(zones: any[]): void; /** - * checks whether the calendar is currently open in the scheduler + * checks whether the calendar is currently opened in the scheduler */ - isCalendarVisible(): any; + isCalendarVisible(): boolean|HTMLElement; /** * checks whether the specified event one-day or multi-day @@ -1354,19 +1506,25 @@ interface SchedulerStatic{ isOneDayEvent(event: any): boolean; /** - * 'says' to change the active date in the mini calendar each time the active date in the scheduler is changed - * @param calendar the mini calendar object - * @param shift a function that defines the difference between active dates in the mini-calendar and the scheduler. The function takes the scheduler's date as a parameter and returns the date that should be displayed in the mini calendar + * checks whether a view with the specified name exists + * @param name the view name */ - linkCalendar(calendar: any, shift: (...args: any[])=>any); + isViewExists(name: string): boolean; + + /** + * 'says' to change the active date in the mini calendar each time, the active date in the scheduler is changed + * @param calendar the mini calendar object + * @param shift a function that defines the difference between active dates in the mini-calendar
      and the scheduler. The function takes the scheduler's date as a parameter and
      returns the date that should be displayed in the mini calendar + */ + linkCalendar(calendar: any, shift: SchedulerCallback): void; /** * loads data to the scheduler from an external data source - * @param url the server side url (may be a static file or a server side script which outputs data as XML) + * @param url the server side url (may be a static file or a server side script which outputs data
      as XML) * @param type ('json', 'xml', 'ical') the data type. The default value - 'xml' * @param callback the callback function */ - load(url: string, type?: string, callback?: (...args: any[])=>any); + load(url: string, type?: string, callback?: SchedulerCallback): void; /** * applies a css class to the specified date @@ -1374,40 +1532,40 @@ interface SchedulerStatic{ * @param date the date to mark * @param css the name of a css class */ - markCalendar(calendar: any, date: Date, css: string); + markCalendar(calendar: any, date: Date, css: string): void; /** * marks and/or blocks date(s) by applying the default or a custom style to them. Marking is cancelled right after any internal update in the app. Can be used for highlighting * @param config the configuration object of the timespan to mark/block */ - markTimespan(config: any); + markTimespan(config: any): void; /** * opens all sections in the currently active view (if the opened view isn't Timeline in the 'Tree' mode - the method will be ignored) */ - openAllSections(); + openAllSections(): void; /** * opens the specified section in the currently active view (if the opened view isn't Timeline in the 'Tree' mode - the method will be ignored) - * @param section_id the section id + * @param section_id the section's id */ - openSection(section_id: string); + openSection(section_id: string): void; /** * loads data from a client-side resource * @param data a string or object which represents data * @param type ('json', 'xml', 'ical') the data type. The default value - 'xml' */ - parse(data: any, type?: string); + parse(data: any, type?: string): void; /** * creates a mini calendar * @param config the calendar configuration object */ - renderCalendar(config: any); + renderCalendar(config: any): void; /** - * generates the HTML content for a custom event box + * generates HTML content for a custom event's box * @param container the event container * @param event the event object */ @@ -1416,116 +1574,116 @@ interface SchedulerStatic{ /** * removes the current lightbox's HTML object element */ - resetLightbox(); + resetLightbox(): void; /** * scrolls the specified number of units in the Units view - * @param step the number of units to scroll (set the positive value to scroll units in the right direction, the negative value - in the left direction). + * @param step the number of units to scroll (set the positive value to scroll units to the right
      side, the negative value - to the left side
      ). */ - scrollUnit(step: number); + scrollUnit(step: number): void; /** * selects the specified event - * @param id the event id + * @param id the event's id */ - select(id: string); + select(id: string): void; /** * returns a list of options * @param list_name the name of a list * @param options an array of options */ - serverList(list_name: string, options?: any); + serverList(list_name: string, options?: any[]): void; /** * displays the specified view and date * @param date the date to display * @param view the name of a view to display */ - setCurrentView(date?: Date, view?: string); + setCurrentView(date?: Date, view?: string): void; /** * adds a new event to the scheduler's data pool - * @param id the event id + * @param id the event's id * @param event the event object */ - setEvent(id: any, event: any); + setEvent(id: string|number, event: any): void; /** * sets the event's end date - * @param id the event id + * @param id the event's id * @param date the new end date of the event */ - setEventEndDate(id: string, date: Date); + setEventEndDate(id: string, date: Date): void; /** - * set the event's start date - * @param id the event id + * sets the event's start date + * @param id the event's id * @param date the new start date of the event */ - setEventStartDate(id: string, date: Date); + setEventStartDate(id: string, date: Date): void; /** - * set the event's text - * @param id the event id + * sets the event's text + * @param id the event's id * @param text the new text of the event */ - setEventText(id: string, text: string); + setEventText(id: string, text: string): void; /** * forces the lightbox to resize */ - setLightboxSize(); + setLightboxSize(): void; /** * sets the mode that allows loading data by parts (enables the dynamic loading) * @param mode the loading mode */ - setLoadMode(mode: string); + setLoadMode(mode: string): void; /** * sets the user data associated with the specified event - * @param id the event id + * @param id the event's id * @param name the user data name * @param value the user data value */ - setUserData(id: string, name: string, value: any); + setUserData(id: string, name: string, value: any): void; /** * shows the lightbox modal overlay that blocks interactions with the remaining screen * @param box an element to hide */ - showCover(box?: HTMLElement); + showCover(box?: HTMLElement): void; /** * shows and highlights the specified event in the current or specified view - * @param id the event id + * @param id the event's id * @param view the view name */ - showEvent(id: string, view?: string); + showEvent(id: string, view?: string): void; /** * opens the lightbox for the specified event - * @param id the event id + * @param id the event's id */ - showLightbox(id: string); + showLightbox(id: string): void; /** * displays the pop-up event form for the specified event - * @param id the event id + * @param id the event's id */ - showQuickInfo(id: string); + showQuickInfo(id: string): void; /** * shows a custom lightbox in the specified HTML container centered on the screen - * @param id the event id + * @param id the event's id * @param box the lightbox's HTML container */ - startLightbox(id : string, box: HTMLElement); + startLightbox(id: string, box: HTMLElement): void; /** - * convers scheduler's data to the ICal format - * @param header sets the value for the content header field + * converts scheduler's data to the ICal format + * @param header sets the value for the content's header field */ toICal(header?: string): string; @@ -1539,7 +1697,7 @@ interface SchedulerStatic{ * @param url the path to the server-side PDF converter * @param mode the color map of the resulting PDF document */ - toPDF(url: string, mode?: string); + toPDF(url: string, mode?: string): void; /** * exports several scheduler's views to a PDF document (can be used for printing) @@ -1549,7 +1707,7 @@ interface SchedulerStatic{ * @param path the path to the php file which generates a PDF file (details) * @param color the color map in use */ - toPDFRange(from: Date, to: Date, view: string, path: string, color: string); + toPDFRange(from: Date, to: Date, view: string, path: string, color: string): void; /** * converts scheduler's data into the XML format @@ -1557,17 +1715,17 @@ interface SchedulerStatic{ toXML(): string; /** - * generates an unique ID (unique inside the current scheduler, not GUID) + * generates a unique ID (unique inside the current scheduler, not GUID) */ - uid(); + uid(): void; /** * removes blocking set by the blockTime() method * @param days (Date, number,array, string) days that should be limited - * @param zones the period in minutes that should be limited. Can be set to 'fullday' value to limit the entire day + * @param zones the period in minutes that should be limited. Can be set to 'fullday' value
      to limit the entire day * @param sections allows blocking date(s) just for specific items of specific views. BTW, the specified date(s) will be blocked just in the related view(s) */ - unblockTime(days: any, zones?: any, sections?: any); + unblockTime(days: any, zones?: any[], sections?: any): void; /** * removes a css class from the specified date @@ -1575,48 +1733,50 @@ interface SchedulerStatic{ * @param date the date to unmark * @param css the name of a css class to remove */ - unmarkCalendar(calendar: any, date: Date, css: string); + unmarkCalendar(calendar: any, date: Date, css: string): void; /** * removes marking/blocking set by the markTimespan() method * @param divs a timespan to remove marking/blocking from (or an array of timespans) */ - unmarkTimespan(divs: any); + unmarkTimespan(divs: HTMLElement|any[]): void; /** * unselects the specified event - * @param id the event id (if not specified, the currently selected event will be unselected) + * @param id the event's id (if not specified, the currently selected event will be unselected) */ - unselect(id?: string); + unselect(id?: string): void; /** * displays the specified date in the mini calendar * @param calendar the mini calendar object * @param new_date a new date to display in the mini calendar */ - updateCalendar(calendar: any, new_date: Date); + updateCalendar(calendar: any, new_date: Date): void; /** - * updates tht specified collection with new options + * updates the specified collection with new options * @param collection the name of the collection to update * @param options the new values of the collection */ - updateCollection(collection: string, options: any): boolean; + updateCollection(collection: string, options: any[]): boolean; /** * updates the specified event - * @param id the event id + * @param id the event's id */ - updateEvent(id: string); + updateEvent(id: string): void; /** - * displays the specified view and date (doesn't invokes any events) + * displays the specified view and date (doesn't invoke any events) * @param date the date to set * @param view the view name */ - updateView(date: Date, view: string); + updateView(date: Date, view: string): void; + } declare var scheduler: SchedulerStatic; +declare var Scheduler: SchedulerEnterprise; \ No newline at end of file diff --git a/diff/diff-tests.ts b/diff/diff-tests.ts index 46d367bf68..20d75b38ea 100644 --- a/diff/diff-tests.ts +++ b/diff/diff-tests.ts @@ -49,5 +49,44 @@ function printDiff(diff:jsdiff.IDiffResult[]) { console.log(addLineHeader(" ", part.value)); } }); +} -} \ No newline at end of file +function verifyPatchMethods(oldStr: string, newStr: string, uniDiff: jsdiff.IUniDiff) { + var verifyPatch = jsdiff.parsePatch( + jsdiff.createTwoFilesPatch("oldFile.ts", "newFile.ts", oldStr, newStr, + "old", "new", { context: 1 })); + if (JSON.stringify(verifyPatch) !== JSON.stringify(uniDiff)) { + console.error("Patch did not match uniDiff"); + } +} + +function verifyApplyMethods(oldStr: string, newStr: string, uniDiff: jsdiff.IUniDiff) { + var verifyApply = [ + jsdiff.applyPatch(oldStr, uniDiff), + jsdiff.applyPatch(oldStr, [uniDiff]) + ]; + jsdiff.applyPatches([uniDiff], { + loadFile: (index: number, callback: (err: Error, data: string) => void) => { + callback(undefined, one); + }, + patched: (index: number, content: string) => { + verifyApply.push(content); + }, + complete: (err?: Error) => { + if (err) { + console.error(err); + } + + verifyApply.forEach(result => { + if (result !== newStr) { + console.error("Result did not match newStr"); + } + }); + } + }); +} + +verifyPatchMethods(one, other, uniDiff); +var uniDiff = jsdiff.structuredPatch("oldFile.ts", "newFile.ts", one, other, + "old", "new", { context: 1 }); +verifyApplyMethods(one, other, uniDiff); diff --git a/diff/diff.d.ts b/diff/diff.d.ts index b1f947300b..fc4708c2a1 100644 --- a/diff/diff.d.ts +++ b/diff/diff.d.ts @@ -16,6 +16,22 @@ declare namespace JsDiff { componenets: IDiffResult[]; } + interface IHunk { + oldStart: number; + oldLines: number; + newStart: number; + newLines: number; + lines: string[]; + } + + interface IUniDiff { + oldFileName: string; + newFileName: string; + oldHeader: string; + newHeader: string; + hunks: IHunk[]; + } + class Diff { ignoreWhitespace:boolean; @@ -46,9 +62,21 @@ declare namespace JsDiff { function diffCss(oldStr:string, newStr:string):IDiffResult[]; - function createPatch(fileName:string, oldStr:string, newStr:string, oldHeader:string, newHeader:string):string; + function createPatch(fileName: string, oldStr: string, newStr: string, oldHeader: string, newHeader: string, options?: {context: number}): string; - function applyPatch(oldStr:string, uniDiff:string):string; + function createTwoFilesPatch(oldFileName: string, newFileName: string, oldStr: string, newStr: string, oldHeader: string, newHeader: string, options?: {context: number}): string; + + function structuredPatch(oldFileName: string, newFileName: string, oldStr: string, newStr: string, oldHeader: string, newHeader: string, options?: {context: number}): IUniDiff; + + function applyPatch(oldStr: string, uniDiff: string | IUniDiff | IUniDiff[]): string; + + function applyPatches(uniDiff: IUniDiff[], options: { + loadFile: (index: number, callback: (err: Error, data: string) => void) => void, + patched: (index: number, content: string) => void, + complete: (err?: Error) => void + }): void; + + function parsePatch(diffStr: string, options?: {strict: boolean}): IUniDiff[]; function convertChangesToXML(changes:IDiffResult[]):string; diff --git a/documentdb/documentdb.d.ts b/documentdb/documentdb.d.ts index 1d901179a6..c4aefe470f 100644 --- a/documentdb/documentdb.d.ts +++ b/documentdb/documentdb.d.ts @@ -93,7 +93,12 @@ declare module 'documentdb' { /** Represents the result returned from a query. */ interface QueryIterator { - + current(): TResultRow; + executeNext(callback: (error: QueryError, result: TResultRow[]) => void): void; + forEach(iteratorFunction : (error: QueryError, element: TResultRow) => void): void; + hasMoreResults(): boolean; + nextItem(callback: (error : QueryError, item : TResultRow) => void): void; + reset() : void; toArray(callback: (error: QueryError, result: TResultRow[]) => void): void; } diff --git a/dojo/dijit.d.ts b/dojo/dijit.d.ts index 8d3e99b6b5..29abf02211 100644 --- a/dojo/dijit.d.ts +++ b/dojo/dijit.d.ts @@ -1606,7 +1606,7 @@ declare module dijit { * already removed/destroyed manually. * */ - own(): any; + own(...args: any[]): any[]; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. diff --git a/dojo/dojo.d.ts b/dojo/dojo.d.ts index 455ffc8fe3..bca5721240 100644 --- a/dojo/dojo.d.ts +++ b/dojo/dojo.d.ts @@ -649,7 +649,7 @@ declare namespace dojo { * @param url URL to request * @param options OptionalOptions for the request. */ - interface xhr { (url: String, options?: dojo.request.xhr.__Options): void } + interface xhr { (url: String, options?: dojo.request.xhr.__Options): dojo.request.__Promise } interface xhr { /** * Send an HTTP DELETE request using XMLHttpRequest with the given URL and options. @@ -5617,7 +5617,7 @@ declare namespace dojo { * @param scope The scope to use when method executes. If method is a string,scope is also the object containing method. * @param method A function to be hitched to scope, or the name of the method inscope to be hitched. */ - hitch(scope: Object, method: Function): any; + hitch(scope: Object, method: (...args: any[]) => any, ...args: any[]): any; /** * Returns a function that will only ever execute in the a given scope. * This allows for easy use of object member functions @@ -5631,7 +5631,7 @@ declare namespace dojo { * @param scope The scope to use when method executes. If method is a string,scope is also the object containing method. * @param method A function to be hitched to scope, or the name of the method inscope to be hitched. */ - hitch(scope: Object, method: String[]): any; + hitch(scope: Object, method: string, ...args: any[]): any; /** * Returns true if it is a built-in function or some other kind of * oddball that should report as a function but doesn't @@ -5686,7 +5686,7 @@ declare namespace dojo { * @param dest The object to which to copy/add all properties contained in source. If dest is falsy, thena new object is manufactured before copying/adding properties begins. * @param sources One of more objects from which to draw all properties to copy into dest. sources are processedleft-to-right and if more than one of these objects contain the same property name, the right-mostvalue "wins". */ - mixin(dest: Object, sources: Object[]): Object; + mixin(dest: Object, source: Object, sources?: Object[]): Object; /** * similar to hitch() except that the scope object is left to be * whatever the execution context eventually becomes. diff --git a/domurl/domurl-tests.ts b/domurl/domurl-tests.ts new file mode 100644 index 0000000000..825dcdd7d0 --- /dev/null +++ b/domurl/domurl-tests.ts @@ -0,0 +1,81 @@ +/// + +interface UModel extends QueryString { + a: any; + b: string; +} + +interface U2Model extends QueryString { + a: any; +} + +interface U3Model extends QueryString { + foo: string; +} + +var u = new Url(); // current document URL will be used +// or we can instantiate as +var u2 = new Url("http://example.com/some/path?a=b&c=d#someAnchor"); +// it should support relative URLs also +var u3 = new Url("/my/site/doc/path?foo=bar#baz"); + +// get the value of some query string parameter +console.log(u2.query.a); +// or +console.log(u3.query["foo"]); + +// Manipulating query string parameters +u.query.a = [1, 2, 3]; // adds/replaces in query string params a=1&a=2&a=3 +u.query.b = 'woohoo'; // adds/replaces in query string param b=woohoo + +if (u.query.a instanceof Array) { // the way to add a parameter + u.query.a.push(4); // now it's "a=1&a=2&a=3&a=4&b=woohoo" +} + +else { // if not an array but scalar value here is a way how to convert to array + u.query.a = [u.query.a]; + u.query.a.push(8) +} + + +// The way to remove the parameter: +delete u.query.a; +// or: +delete u.query["a"]; + +// If you need to remove all query string params: +console.log(u.clearQuery()); +console.log(u.queryLength()); +console.log(u.isEmptyQuery()); + +// Lookup URL parts: +console.log( + 'protocol = ' + u.protocol + '\n' + + 'user = ' + u.user + '\n' + + 'pass = ' + u.pass + '\n' + + 'host = ' + u.host + '\n' + + 'port = ' + u.port + '\n' + + 'path = ' + u.path + '\n' + + 'query = ' + u.query + '\n' + + 'hash = ' + u.hash +); + +// Manipulating URL parts +u.path = '/some/new/path'; // the way to change URL path +u.protocol = 'https'; // the way to force https protocol on the source URL + +// inject into string +var str = 'My Cool Link'; + +// or use in DOM context +var a = document.createElement('a'); +a.href = u.toString(); +a.innerHTML = 'test'; +document.body.appendChild(a); + +// Stringify +var su1 = u + ''; +var su2 = String(u); +var su3 = u.toString(); +// NOTE, that usually it will be done automatically, so only in special +// cases direct stringify is required diff --git a/domurl/domurl.d.ts b/domurl/domurl.d.ts new file mode 100644 index 0000000000..8c418c75cc --- /dev/null +++ b/domurl/domurl.d.ts @@ -0,0 +1,30 @@ +// Type definitions for domurl +// Project: https://github.com/Mikhus/domurl +// Definitions by: Mikhus +// Definitions: https://github.com/Mikhus/DefinitelyTyped + +declare class QueryString { + constructor(qs?: string); + toString: () => string; +} + +declare class Url { + constructor(url?: string); + query: T; + protocol: string; + user: string; + pass: string; + host: string; + port: string; + path: string; + hash: string; + href: string; + toString: () => string; + encode: (s: string) => string; + decode: (s: string) => string; + isAbsolute: () => boolean; + paths: (paths?: [string]) => [string]; + isEmptyQuery: () => boolean; + queryLength: () => number; + clearQuery: () => Url; +} diff --git a/dot-object/dot-object-tests.ts b/dot-object/dot-object-tests.ts new file mode 100644 index 0000000000..ca7aa3f676 --- /dev/null +++ b/dot-object/dot-object-tests.ts @@ -0,0 +1,67 @@ +/// + +var obj = { + 'first_name': 'John', + 'last_name': 'Doe' +}; + +dot.move('first_name', 'contact.firstname', obj); +dot.move('last_name', 'contact.lastname', obj); + +var src = { + name: 'John', + stuff: { + phone: { + brand: 'iphone', + version: 6 + } + } +}; + +var tgt = {name: 'Brandon'}; + +dot.copy('stuff.phone', 'wanna.haves.phone', src, tgt, [(arg: any) => { + return arg; +}]); + +dot.transfer('stuff.phone', 'wanna.haves.phone', src, tgt); + +var row = { + 'id': 2, + 'contact.name.first': 'John', + 'contact.name.last': 'Doe', + 'contact.email': 'example@gmail.com', + 'contact.info.about.me': 'classified', + 'devices[0]': 'mobile', + 'devices[1]': 'laptop', + 'some.other.things.0': 'this', + 'some.other.things.1': 'that' +}; + +dot.object(row, (arg: any) => { + return arg; +}); + +dot.str('this.is.my.string', 'value', tgt); + +var newObj = { + some: { + nested: { + value: 'Hi there!' + } + } +}; + +var val = dot.pick('some.nested.value', newObj); +console.log(val); + +// Pick & Remove the value +val = dot.pick('some.nested.value', newObj, true); + +// shorthand +val = dot.remove('some.nested.value', newObj); + +// or use the alias `del` +val = dot.del('some.nested.value', newObj); + +var dotWithArrow = new dot('=>'); \ No newline at end of file diff --git a/dot-object/dot-object.d.ts b/dot-object/dot-object.d.ts new file mode 100644 index 0000000000..953291c631 --- /dev/null +++ b/dot-object/dot-object.d.ts @@ -0,0 +1,169 @@ +// Type definitions for Dot-Object v1.4.1 +// Project: https://github.com/rhalff/dot-object +// Definitions by: Niko Kovačič +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + + +declare namespace DotObject { + interface DotConstructor extends Dot { + new(separator: string): Dot; + } + + interface ModifierFunctionWrapper { + (arg: any): any; + } + + interface Dot { + /** + * + * Copy a property from one object to another object. + * + * If the source path does not exist (undefined) + * the property on the other object will not be set. + * + * @param {String} source + * @param {String} target + * @param {Object} obj1 + * @param {Object} obj2 + * @param {Function|Array} mods + * @param {Boolean} merge + */ + copy(source: string, target: string, obj1: any, obj2: any, mods?: ModifierFunctionWrapper | Array, merge?: boolean): void; + /** + * + * Convert object to dotted-key/value pair + * + * Usage: + * + * var tgt = dot.dot(obj) + * + * or + * + * var tgt = {} + * dot.dot(obj, tgt) + * + * @param {Object} obj source object + * @param {Object} tgt target object + */ + dot(obj: any, tgt: any): void + /** + * + * Remove value from an object using dot notation. + * + * @param {String} path + * @param {Object} obj + * @return {Mixed} The removed value + */ + del(path: string, obj: any): any; + /** + * + * Move a property from one place to the other. + * + * If the source path does not exist (undefined) + * the target property will not be set. + * + * @param {String} source + * @param {String} target + * @param {Object} obj + * @param {Function|Array} mods + * @param {Boolean} merge + */ + move(source: string, target: string, obj: any, mods?: ModifierFunctionWrapper | Array, merge?: boolean): void; + /** + * + * Converts an object with dotted-key/value pairs to it's expanded version + * + * Optionally transformed by a set of modifiers. + * + * Usage: + * + * var row = { + * 'nr': 200, + * 'doc.name': ' My Document ' + * } + * + * var mods = { + * 'doc.name': [_s.trim, _s.underscored] + * } + * + * dot.object(row, mods) + * + * @param {Object} obj + * @param {Object} mods + */ + object(obj: any, mods?: ModifierFunctionWrapper | Array): void; + /** + * + * Pick a value from an object using dot notation. + * + * Optionally remove the value + * + * @param {String} path + * @param {Object} obj + * @param {Boolean} remove + */ + pick(path: string, obj: any, remove?: boolean): void; + /** + * + * Remove value from an object using dot notation. + * + * @param {String} path + * @param {Object} obj + * @return {Mixed} The removed value + */ + remove(path: string, obj: any): any; + /** + * @param {String} path dotted path + * @param {String} v value to be set + * @param {Object} obj object to be modified + * @param {Function|Array} mods optional modifier + */ + str(path: string, v: any, obj: Object, mods?: ModifierFunctionWrapper | Array): void; + /** + * + * Transfer a property from one object to another object. + * + * If the source path does not exist (undefined) + * the property on the other object will not be set. + * + * @param {String} source + * @param {String} target + * @param {Object} obj1 + * @param {Object} obj2 + * @param {Function|Array} mods + * @param {Boolean} merge + */ + transfer(source: string, target: string, obj1: any, obj2: any, mods?: ModifierFunctionWrapper | Array, merge?: boolean): void; + /** + * + * Transform an object + * + * Usage: + * + * var obj = { + * "id": 1, + * "some": { + * "thing": "else" + * } + * } + * + * var transform = { + * "id": "nr", + * "some.thing": "name" + * } + * + * var tgt = dot.transform(transform, obj) + * + * @param {Object} recipe Transform recipe + * @param {Object} obj Object to be transformed + * @param {Array} mods modifiers for the target + */ + transform(recipe: any, obj: any, mods?: ModifierFunctionWrapper | Array): void; + } +} + +declare var dot: DotObject.DotConstructor; + +declare module 'dot-object' { + export = dot; +} \ No newline at end of file diff --git a/dotdotdot/dotdotdot-tests.ts b/dotdotdot/dotdotdot-tests.ts index 95fe346745..6920d3c2c0 100644 --- a/dotdotdot/dotdotdot-tests.ts +++ b/dotdotdot/dotdotdot-tests.ts @@ -4,6 +4,7 @@ $("span").dotdotdot({ ellipsis: ":::" }); $("span").dotdotdot({ wrap: "letter" }); $("span").dotdotdot({ fallbackToLetter: false }); +$("span").dotdotdot({ after: "a.after" }); $("span").dotdotdot({ after: $("#after") }); $("span").dotdotdot({ watch: true }); $("span").dotdotdot({ height: 42 }); diff --git a/dotdotdot/dotdotdot.d.ts b/dotdotdot/dotdotdot.d.ts index 6219340ba6..bedd6cecac 100644 --- a/dotdotdot/dotdotdot.d.ts +++ b/dotdotdot/dotdotdot.d.ts @@ -31,7 +31,7 @@ declare namespace JQueryDotDotDot { /** jQuery-selector for the element to keep and put after the ellipsis. * Default: null */ - after?: JQuery; + after?: string | JQuery; /** Whether to update the ellipsis: true/'window' * Default: false diff --git a/draft-js/draft-js-0.2.2.d.ts b/draft-js/draft-js-0.2.2.d.ts new file mode 100644 index 0000000000..ac5eb21f33 --- /dev/null +++ b/draft-js/draft-js-0.2.2.d.ts @@ -0,0 +1,277 @@ +// Type definitions for draft-js 0.2.2 +// Project: https://github.com/facebook/draft-js +// Definitions by: Pavel Evsegneev +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +declare module "draft-js" { + namespace Draft { + interface IEditor { + new(): Editor + } + + interface EditorState { + getCurrentContent(): ContentState, + getSelection(): SelectionState, + getCurrentInlineStyle(): any, + getBlockTree(): any, + + createEmpty(decorator?: any): EditorState, + createWithContent(contentState: ContentState, decorator?: any): EditorState, + create(config: any): EditorState, + push(editorState: EditorState, contentState: ContentState, actionType: string): EditorState, + undo(editorState: EditorState): EditorState, + redo(editorState: EditorState): EditorState, + acceptSelection(editorState: EditorState, selectionState: SelectionState): EditorState, + forceSelection(editorState: EditorState, selectionState: SelectionState): EditorState, + + moveFocusToEnd(editorState: EditorState): EditorState + } + + interface CompositeDecorator { + getDecorations(): Array, + getComponentForKey(): any, + getPropsForKey(): any + } + + interface Entity { + create(type: string, mutability: string, data?: Object): EntityInstance, + add(instance: EntityInstance): string, + get(key: string): EntityInstance, + mergeData(key: string, toMerge: any): EntityInstance, + replaceData(key: string, newData: any): EntityInstance + } + + interface EntityInstance { + getData(): any, + getKey(): string, + getMutability(): string + } + + interface BlockMapBuilder { + createFromArray(blocks: Array): BlockMap + } + + interface CharacterMetadata { + create(config?: any): CharacterMetadata, + + applyStyle(record: CharacterMetadata, + style: string): CharacterMetadata, + + removeStyle(record: CharacterMetadata, + style: string): CharacterMetadata, + + applyEntity(record: CharacterMetadata, + entityKey?: string): CharacterMetadata, + + getStyle(): any, + hasStyle(style: string): boolean, + + getEntity(): string + } + + interface IContentBlock { + new(draftContentBlock: any): ContentBlock; + } + interface ContentBlock { + key: string, + type: string, + text: string, + characterList: any, + depth: number, + + getKey(): string, + getType(): string, + getText(): string, + getCharacterList(): any, + getLength(): number, + getDepth(): number, + getInlineStyleAt(offset: number): any, + getEntityAt(offset: number): string, + findStyleRanges(filterFn: Function, callback: Function): void, + findEntityRanges(filterFn: Function, callback: Function): void + + } + + interface ContentState { + createFromText(text: string): ContentState, + createFromBlockArray(blocks: Array): ContentState, + + getBlockMap(): BlockMap, + getSelectionBefore(): SelectionState, + getSelectionAfter(): SelectionState, + + getBlockForKey(key: string): ContentBlock, + getKeyBefore(key: string): string, + getKeyAfter(key: string): string, + + getBlockBefore(key: string): ContentBlock, + getBlockAfter(key: string): ContentBlock, + + getBlocksAsArray(): Array, + + getPlainText(): string, + hasText(): boolean, + + set(key: string, value: any): ContentState, + toJS(): any + } + + interface ISelectionState { + new(draftSelectionState: any): SelectionState; + createEmpty(blockKey: string): SelectionState; + } + + interface SelectionState { + getStartKey(): string, + getStartOffset(): number, + getEndKey(): string, + getEndOffset(): number, + getAnchorKey(): string, + getAnchorOffset(): number, + getFocusKey(): string, + getFocusOffset(): number, + + getIsBackward(): boolean, + getHasFocus(): boolean, + isCollapsed(): boolean, + + hasEdgeWithin(blockKey: string, start: number, end: number): boolean, + serialize(): string, + + get(key: string): any, + set(key: string, value: any): SelectionState + } + + interface BlockMap { + get(key: string): ContentBlock, + set(key: string, value: any): BlockMap, + delete(key: string): BlockMap, + find(cb: any): ContentBlock + } + + interface Modifier { + replaceText(contentState: ContentState, + rangeToReplace: SelectionState, + text: string, + inlineStyle?: any, + entityKey?: string): ContentState, + + insertText(contentState: ContentState, + targetRange: SelectionState, + text: string, + inlineStyle?: any, + entityKey?: string): ContentState, + + moveText(contentState: ContentState, + removalRange: SelectionState, + targetRange: SelectionState): ContentState, + + replaceWithFragment(contentState: ContentState, + targetRange: SelectionState, + fragment: BlockMap): ContentState, + + removeRange(contentState: ContentState, + rangeToRemove: SelectionState, + removalDirection: string): ContentState, + + splitBlock(contentState: ContentState, + selectionState: SelectionState): ContentState, + + applyInlineStyle(contentState: ContentState, + selectionState: SelectionState, + inlineStyle: string): ContentState, + + removeInlineStyle(contentState: ContentState, + selectionState: SelectionState, + inlineStyle: string): ContentState, + + setBlockType(contentState: ContentState, + selectionState: SelectionState, + blockType: string): ContentState, + + applyEntity(contentState: ContentState, + selectionState: SelectionState, + entityKey: string): ContentState + } + + interface RichUtils { + currentBlockContainsLink(editorState: EditorState): boolean, + getCurrentBlockType(editor: EditorState): string, + handleKeyCommand(editorState: EditorState, command: string): any, + insertSoftNewline(editorState: EditorState): EditorState, + onBackspace(editorState: EditorState): EditorState, + onDelete(editorState: EditorState): EditorState, + onTab(event: Event, editorState: EditorState, maxDepth: number): EditorState, + toggleBlockType(editorState: EditorState, blockType: string): EditorState, + toggleCode(editorState: EditorState): EditorState, + toggleLink(editorState: EditorState, targetSelection: SelectionState, entityKey: string): EditorState, + tryToRemoveBlockStyle(editorState: EditorState): EditorState + } + + interface EditorProps { + editorState: EditorState, + onChange(editorState: EditorState): void, + + placeholder?: string, + textAlignment?: any, + blockRendererFn?: (ContentBlock: ContentBlock) => any, + blockStyleFn?: (ContentBlock: ContentBlock) => string, + customStyleMap?: any, + + readOnly?: boolean, + spellCheck?: boolean, + stripPastedStyles?: boolean, + + handleReturn?: (e: any) => boolean, + handleKeyCommand?: (command: string) => boolean, + handleBeforeInput?: (chars: string) => boolean, + handlePastedFiles?: (files: Array) => boolean, + handleDroppedFiles?: (selection: SelectionState, files: Array) => boolean, + handleDrop?: (selection: SelectionState, dataTransfer: any, isInternal: any) => boolean, + + onEscape?: (e: any) => void, + onTab?: (e: any) => void, + onUpArrow?: (e: any) => void, + onDownArrow?: (e: any) => void, + + suppressContentEditableWarning?: any, + + onBlur?: (e: any) => void, + onFocus?: (e: any) => void + } + + interface Editor { + props: EditorProps + state: any, + refs: any, + context: any, + setState(): any, + render(): any, + forceUpdate(): any + } + + var Editor: IEditor; + var EditorState: EditorState; + + var CompositeDecorator: CompositeDecorator; + var Entity: Entity; + var EntityInstance: EntityInstance; + + var BlockMapBuilder: BlockMapBuilder; + var CharacterMetadata: CharacterMetadata; + var ContentBlock: IContentBlock; + var ContentState: ContentState; + var SelectionState: ISelectionState; + + var Modifier: Modifier; + var RichUtils: RichUtils; + + function convertFromRaw(rawState: any): Array; + + function convertToRaw(contentState: ContentState): any; + + function genKey(): string + } + + export = Draft; + +} diff --git a/draft-js/draft-js-tests-0.2.2.tsx b/draft-js/draft-js-tests-0.2.2.tsx new file mode 100644 index 0000000000..88271465f5 --- /dev/null +++ b/draft-js/draft-js-tests-0.2.2.tsx @@ -0,0 +1,183 @@ +/// +/// +/// + +import * as React from "react"; + +import { + Editor, + EditorState, + Entity, + CharacterMetadata, + ContentBlock, + Modifier, + SelectionState, + genKey +} from "draft-js"; + +export class Tag extends React.Component { + constructor(props: any) { + super(props); + } + + remove = (): void => { + this.props.blockProps.removeBlock(this.props.block.getKey()); + } + + render () { + const {block} = this.props; + if (block.getEntityAt(0)) { + const data = Entity.get(block.getEntityAt(0)).getData(); + + return ( +
      + {data.content.name} + + clear + +
      + ); + } + } +} + +export class Hint extends React.Component { + constructor(props: any) { + super(props); + } + + render () { + const {block} = this.props; + if (block.getEntityAt(0)) { + const data = Entity.get(block.getEntityAt(0)).getData(); + + return ( +
      + {this.props.blockProps.autocomplete} + {data.content.text} +
      + ); + } + } +} + +export function removeBlock(editorState: EditorState, blockKey: string) { + const content = editorState.getCurrentContent(); + + const targetRange = new SelectionState({ + anchorKey: blockKey, + anchorOffset: 0, + focusKey: blockKey, + focusOffset: 1 + }); + + const withoutTag = Modifier.removeRange(content, targetRange, "backward"); + const resetBlock = Modifier.setBlockType( + withoutTag, + withoutTag.getSelectionAfter(), + "unstyled" + ); + + const newState = EditorState.push(editorState, resetBlock, "remove-range"); + return EditorState.forceSelection(newState, resetBlock.getSelectionAfter()); +} + +export function applyEntity(editorState: EditorState, blockKey: string, entityKey: string) { + const content = editorState.getCurrentContent(); + + const targetRange = new SelectionState({ + anchorKey: blockKey, + anchorOffset: 0, + focusKey: blockKey, + focusOffset: 1 + }); + + const withNewEntity = Modifier.applyEntity( + content, + targetRange, + entityKey + ) + + const newState = EditorState.push(editorState, withNewEntity, "change-entity"); + return EditorState.forceSelection(newState, withNewEntity.getSelectionAfter()); +} + +export function addTagBlock(content: any, editorState: EditorState): any { + const contentState = editorState.getCurrentContent(); + + const entityKey = Entity.create( + "TOKEN", + "IMMUTABLE", + {content} + ); + + const charData = CharacterMetadata.create({entity: entityKey}); + const tag = new ContentBlock({ + key: genKey(), + type: "tag", + text: "", + characterList: [], + }); + + const withTag = contentState.set("blockMap", contentState.getBlockMap().set(tag.key, tag)); + + const withRemovedPreviousBlock = withTag.set("blockMap", withTag.getBlockMap().delete(contentState.getSelectionBefore().getAnchorKey())) + + const withTagBlock = EditorState.push(editorState, withRemovedPreviousBlock, "insert-fragment"); + + return withTagBlock; +} + +export function addHintBlock(content: any, editorState: EditorState): any { + const contentState = editorState.getCurrentContent(); + const selectionState = editorState.getSelection(); + + const entityKey = Entity.create( + "TOKEN", + "IMMUTABLE", + {content} + ); + + const charData = CharacterMetadata.create({entity: entityKey}); + const hint = new ContentBlock({ + key: genKey(), + type: "hint", + text: "", + characterList: [], + }); + const empty = new ContentBlock({ + key: genKey(), + type: "unstyled", + text: "", + characterList: [], + }); + + const withEmpty = contentState.set("blockMap", contentState.getBlockMap().set(empty.key, empty)); + const withHint = withEmpty.set("blockMap", withEmpty.getBlockMap().set(hint.key, hint)); + return { + editorState: EditorState.forceSelection(EditorState.push(editorState, withHint, "insert-fragment"), selectionState), + blockKey: hint.key + } + +} + +export class SearchField extends React.Component { + public onChange: any; + + constructor(props: any) { + super(props); + this.onChange = (editorState: EditorState) => { + this.setState({editorState}) + }; + } + + render() { + const {editorState} = this.state; + return ( + + ) + } +} diff --git a/draft-js/draft-js-tests.tsx b/draft-js/draft-js-tests.tsx index 91706cd7e0..eb3aaa4012 100644 --- a/draft-js/draft-js-tests.tsx +++ b/draft-js/draft-js-tests.tsx @@ -1,183 +1,184 @@ -/// -/// -/// +/// +/// +/// + +// Using Rich text editor example as a test: https://github.com/facebook/draft-js/tree/master/examples/rich import * as React from "react"; +import * as ReactDOM from "react-dom"; +import {Map} from "immutable"; -import { -Editor, - EditorState, - Entity, - CharacterMetadata, - ContentBlock, - Modifier, - SelectionState, - genKey -} from "draft-js"; +import {Editor, EditorState, RichUtils, DefaultDraftBlockRenderMap, ContentBlock} from 'draft-js'; -export class Tag extends React.Component { - constructor(props: any) { - super(props); +class RichEditorExample extends React.Component<{}, { editorState: EditorState }> { + constructor() { + super(); + + this.state = { editorState: EditorState.createEmpty() }; + } + + onChange: (editorState: EditorState) => void = (editorState: EditorState) => this.setState({ editorState }); + + handleKeyCommand: (command: string) => boolean = (command: string) => { + const {editorState} = this.state; + const newState = RichUtils.handleKeyCommand(editorState, command); + if (newState) { + this.onChange(newState); + return true; } - remove = (): void => { - this.props.blockProps.removeBlock(this.props.block.getKey()); + return false; + } + + toggleBlockType: (blockType: string) => void = (blockType: string) => { + this.onChange(RichUtils.toggleBlockType(this.state.editorState, blockType)); + } + + toggleInlineStyle: (inlineStyle: string) => void = (inlineStyle: string) => { + this.onChange(RichUtils.toggleInlineStyle(this.state.editorState, inlineStyle)); + } + + render(): React.ReactElement<{}> { + // If the user changes block type before entering any text, we can + // either style the placeholder or hide it. Let's just hide it now. + let className = 'RichEditor-editor'; + var contentState = this.state.editorState.getCurrentContent(); + if (!contentState.hasText()) { + if (contentState.getBlockMap().first().getType() !== 'unstyled') { + className += ' RichEditor-hidePlaceholder'; + } } - render () { - const {block} = this.props; - if (block.getEntityAt(0)) { - const data = Entity.get(block.getEntityAt(0)).getData(); - - return ( -
      - {data.content.name} - - clear - -
      - ); - } - } -} - -export class Hint extends React.Component { - constructor(props: any) { - super(props); - } - - render () { - const {block} = this.props; - if (block.getEntityAt(0)) { - const data = Entity.get(block.getEntityAt(0)).getData(); - - return ( -
      - {this.props.blockProps.autocomplete} - {data.content.text} -
      - ); - } - } -} - -export function removeBlock(editorState: EditorState, blockKey: string) { - const content = editorState.getCurrentContent(); - - const targetRange = new SelectionState({ - anchorKey: blockKey, - anchorOffset: 0, - focusKey: blockKey, - focusOffset: 1 - }); - - const withoutTag = Modifier.removeRange(content, targetRange, "backward"); - const resetBlock = Modifier.setBlockType( - withoutTag, - withoutTag.getSelectionAfter(), - "unstyled" + return ( +
      + + +
      + +
      +
      ); - - const newState = EditorState.push(editorState, resetBlock, "remove-range"); - return EditorState.forceSelection(newState, resetBlock.getSelectionAfter()); + } } -export function applyEntity(editorState: EditorState, blockKey: string, entityKey: string) { - const content = editorState.getCurrentContent(); +// Custom overrides for "code" style. +const styleMap = { + CODE: { + backgroundColor: 'rgba(0, 0, 0, 0.05)', + fontFamily: '"Inconsolata", "Menlo", "Consolas", monospace', + fontSize: 16, + padding: 2, + }, +}; - const targetRange = new SelectionState({ - anchorKey: blockKey, - anchorOffset: 0, - focusKey: blockKey, - focusOffset: 1 - }); - - const withNewEntity = Modifier.applyEntity( - content, - targetRange, - entityKey - ) - - const newState = EditorState.push(editorState, withNewEntity, "change-entity"); - return EditorState.forceSelection(newState, withNewEntity.getSelectionAfter()); +function getBlockStyle(block: ContentBlock) { + switch (block.getType()) { + case 'blockquote': return 'RichEditor-blockquote'; + default: return null; + } } -export function addTagBlock(content: any, editorState: EditorState): any { - const contentState = editorState.getCurrentContent(); +class StyleButton extends React.Component<{key: string, active: boolean, label: string, onToggle: (blockType: string) => void, style: string}, {}> { + constructor() { + super(); + } - const entityKey = Entity.create( - "TOKEN", - "IMMUTABLE", - {content} + onToggle: (event: Event) => void = (event: Event) => { + event.preventDefault(); + this.props.onToggle(this.props.style); + }; + + render(): React.ReactElement<{}> { + let className = 'RichEditor-styleButton'; + + if (this.props.active) { + className += ' RichEditor-activeButton'; + } + + return ( + + {this.props.label} + ); - - const charData = CharacterMetadata.create({entity: entityKey}); - const tag = new ContentBlock({ - key: genKey(), - type: "tag", - text: "", - characterList: [], - }); - - const withTag = contentState.set("blockMap", contentState.getBlockMap().set(tag.key, tag)); - - const withRemovedPreviousBlock = withTag.set("blockMap", withTag.getBlockMap().delete(contentState.getSelectionBefore().getAnchorKey())) - - const withTagBlock = EditorState.push(editorState, withRemovedPreviousBlock, "insert-fragment"); - - return withTagBlock; + } } -export function addHintBlock(content: any, editorState: EditorState): any { - const contentState = editorState.getCurrentContent(); - const selectionState = editorState.getSelection(); +const BLOCK_TYPES = [ + { label: 'H1', style: 'header-one' }, + { label: 'H2', style: 'header-two' }, + { label: 'H3', style: 'header-three' }, + { label: 'H4', style: 'header-four' }, + { label: 'H5', style: 'header-five' }, + { label: 'H6', style: 'header-six' }, + { label: 'Blockquote', style: 'blockquote' }, + { label: 'UL', style: 'unordered-list-item' }, + { label: 'OL', style: 'ordered-list-item' }, + { label: 'Code Block', style: 'code-block' }, +]; - const entityKey = Entity.create( - "TOKEN", - "IMMUTABLE", - {content} - ); +const BlockStyleControls = (props: {editorState: EditorState, onToggle: (blockType: string) => void}) => { + const {editorState} = props; + const selection = editorState.getSelection(); + const blockType = editorState + .getCurrentContent() + .getBlockForKey(selection.getStartKey()) + .getType(); - const charData = CharacterMetadata.create({entity: entityKey}); - const hint = new ContentBlock({ - key: genKey(), - type: "hint", - text: "", - characterList: [], - }); - const empty = new ContentBlock({ - key: genKey(), - type: "unstyled", - text: "", - characterList: [], - }); + return ( +
      + {BLOCK_TYPES.map((type) => + + ) } +
      + ); +}; - const withEmpty = contentState.set("blockMap", contentState.getBlockMap().set(empty.key, empty)); - const withHint = withEmpty.set("blockMap", withEmpty.getBlockMap().set(hint.key, hint)); - return { - editorState: EditorState.forceSelection(EditorState.push(editorState, withHint, "insert-fragment"), selectionState), - blockKey: hint.key - } +var INLINE_STYLES = [ + { label: 'Bold', style: 'BOLD' }, + { label: 'Italic', style: 'ITALIC' }, + { label: 'Underline', style: 'UNDERLINE' }, + { label: 'Monospace', style: 'CODE' }, +]; -} +const InlineStyleControls = (props: {editorState: EditorState, onToggle: (blockType: string) => void}) => { + var currentStyle = props.editorState.getCurrentInlineStyle(); + return ( +
      + {INLINE_STYLES.map(type => + + ) } +
      + ); +}; -export class SearchField extends React.Component { - public onChange: any; - - constructor(props: any) { - super(props); - this.onChange = (editorState: EditorState) => { - this.setState({editorState}) - }; - } - - render() { - const {editorState} = this.state; - return ( - - ) - } -} +ReactDOM.render( + , + document.getElementById('target') +); \ No newline at end of file diff --git a/draft-js/draft-js.d.ts b/draft-js/draft-js.d.ts index ac5eb21f33..bf10cd22c4 100644 --- a/draft-js/draft-js.d.ts +++ b/draft-js/draft-js.d.ts @@ -1,277 +1,939 @@ -// Type definitions for draft-js 0.2.2 -// Project: https://github.com/facebook/draft-js -// Definitions by: Pavel Evsegneev +// Type definitions for Draft.js v0.7.0 +// Project: https://facebook.github.io/draft-js/ +// Definitions by: Dmitry Rogozhny // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare module "draft-js" { - namespace Draft { - interface IEditor { - new(): Editor + +/// +/// + +import SyntheticKeyboardEvent = React.KeyboardEvent; +import SyntheticEvent = React.SyntheticEvent; + +import React = __React; + +declare namespace Draft { + namespace Component { + namespace Base { + import DraftEditorCommand = Draft.Model.Constants.DraftEditorCommand; + import DraftBlockType = Draft.Model.Constants.DraftBlockType; + import DraftDragType = Draft.Model.Constants.DraftDragType; + + import EditorState = Draft.Model.ImmutableData.EditorState; + import ContentBlock = Draft.Model.ImmutableData.ContentBlock; + import SelectionState = Draft.Model.ImmutableData.SelectionState; + + import DraftBlockRenderConfig = Draft.Model.ImmutableData.DraftBlockRenderConfig; + + type DraftBlockRenderMap = Immutable.Map; + + /** + * `DraftEditor` is the root editor component. It composes a `contentEditable` + * div, and provides a wide variety of useful function props for managing the + * state of the editor. See `DraftEditorProps` for details. + */ + class DraftEditor extends React.Component { + // Force focus back onto the editor node. + focus(): void; + // Remove focus from the editor node. + blur(): void; + } + + /** + * The two most critical props are `editorState` and `onChange`. + * + * The `editorState` prop defines the entire state of the editor, while the + * `onChange` prop is the method in which all state changes are propagated + * upward to higher-level components. + * + * These props are analagous to `value` and `onChange` in controlled React + * text inputs. + */ + interface DraftEditorProps { + editorState: EditorState; + onChange(editorState: EditorState): void; + + placeholder?: string; + + // Specify whether text alignment should be forced in a direction + // regardless of input characters. + textAlignment?: DraftTextAlignment; + + // For a given `ContentBlock` object, return an object that specifies + // a custom block component and/or props. If no object is returned, + // the default `TextEditorBlock` is used. + blockRendererFn?(block: ContentBlock): any; + + // Function that allows to define class names to apply to the given block when it is rendered. + blockStyleFn?(block: ContentBlock): string; + + // Provide a map of inline style names corresponding to CSS style objects + // that will be rendered for matching ranges. + customStyleMap?: any, + + // A function that accepts a synthetic key event and returns + // the matching DraftEditorCommand constant, or null if no command should + // be invoked. + keyBindingFn?(e: SyntheticKeyboardEvent): DraftEditorCommand; + keyBindingFn?(e: SyntheticKeyboardEvent): string; + + // Set whether the `DraftEditor` component should be editable. Useful for + // temporarily disabling edit behavior or allowing `DraftEditor` rendering + // to be used for consumption purposes. + readOnly?: boolean, + + // Note: spellcheck is always disabled for IE. If enabled in Safari, OSX + // autocorrect is enabled as well. + spellCheck?: boolean, + + // Set whether to remove all style information from pasted content. If your + // use case should not have any block or inline styles, it is recommended + // that you set this to `true`. + stripPastedStyles?: boolean, + + tabIndex?: number, + + ariaActiveDescendantID?: string, + ariaAutoComplete?: string, + ariaDescribedBy?: string, + ariaExpanded?: boolean, + ariaHasPopup?: boolean, + ariaLabel?: string, + ariaOwneeID?: string, + + webDriverTestID?: string, + + /** + * Cancelable event handlers, handled from the top level down. A handler + * that returns true will be the last handler to execute for that event. + */ + + // Useful for managing special behavior for pressing the `Return` key. E.g. + // removing the style from an empty list item. + handleReturn?(e: SyntheticKeyboardEvent): boolean, + + // Map a key command string provided by your key binding function to a + // specified behavior. + handleKeyCommand?(command: DraftEditorCommand): boolean, + handleKeyCommand?(command: string): boolean, + + + // Handle intended text insertion before the insertion occurs. This may be + // useful in cases where the user has entered characters that you would like + // to trigger some special behavior. E.g. immediately converting `:)` to an + // emoji Unicode character, or replacing ASCII quote characters with smart + // quotes. + handleBeforeInput?(chars: string): boolean, + + handlePastedText?(text: string, html?: string): boolean, + + handlePastedFiles?(files: Array): boolean, + + // Handle dropped files + handleDroppedFiles?(selection: SelectionState, files: Array): boolean, + + // Handle other drops to prevent default text movement/insertion behaviour + handleDrop?(selection: SelectionState, dataTransfer: Object, isInternal: DraftDragType): boolean, + + /** + * Non-cancelable event triggers. + */ + onEscape?(e: SyntheticKeyboardEvent): void, + onTab?(e: SyntheticKeyboardEvent): void, + onUpArrow?(e: SyntheticKeyboardEvent): void, + onDownArrow?(e: SyntheticKeyboardEvent): void, + + onBlur?(e: SyntheticEvent): void, + onFocus?(e: SyntheticEvent): void, + + // Provide a map of block rendering configurations. Each block type maps to + // an element tag and an optional react element wrapper. This configuration + // is used for both rendering and paste processing. + blockRenderMap?: DraftBlockRenderMap + } + + type DraftTextAlignment = "left" | "center" | "right"; } - interface EditorState { - getCurrentContent(): ContentState, - getSelection(): SelectionState, - getCurrentInlineStyle(): any, - getBlockTree(): any, - - createEmpty(decorator?: any): EditorState, - createWithContent(contentState: ContentState, decorator?: any): EditorState, - create(config: any): EditorState, - push(editorState: EditorState, contentState: ContentState, actionType: string): EditorState, - undo(editorState: EditorState): EditorState, - redo(editorState: EditorState): EditorState, - acceptSelection(editorState: EditorState, selectionState: SelectionState): EditorState, - forceSelection(editorState: EditorState, selectionState: SelectionState): EditorState, - - moveFocusToEnd(editorState: EditorState): EditorState + namespace Components { + class DraftEditorBlock extends React.Component { + } } - interface CompositeDecorator { - getDecorations(): Array, - getComponentForKey(): any, - getPropsForKey(): any + namespace Selection { + interface FakeClientRect { + left: number, + width: number, + right: number, + top: number, + bottom: number, + height: number, + } + + /** + * Return the bounding ClientRect for the visible DOM selection, if any. + * In cases where there are no selected ranges or the bounding rect is + * temporarily invalid, return null. + */ + function getVisibleSelectionRect(global: any): FakeClientRect; } - interface Entity { - create(type: string, mutability: string, data?: Object): EntityInstance, - add(instance: EntityInstance): string, - get(key: string): EntityInstance, - mergeData(key: string, toMerge: any): EntityInstance, - replaceData(key: string, newData: any): EntityInstance + namespace Utils { + import DraftEditorCommand = Draft.Model.Constants.DraftEditorCommand; + + class KeyBindingUtil { + /** + * Check whether the ctrlKey modifier is *not* being used in conjunction with + * the altKey modifier. If they are combined, the result is an `altGraph` + * key modifier, which should not be handled by this set of key bindings. + */ + static isCtrlKeyCommand(e: SyntheticKeyboardEvent): boolean; + + static isOptionKeyCommand(e: SyntheticKeyboardEvent): boolean; + + static hasCommandModifier(e: SyntheticKeyboardEvent): boolean; + } + + /** + * Retrieve a bound key command for the given event. + */ + function getDefaultKeyBinding(e: SyntheticKeyboardEvent): DraftEditorCommand; + function getDefaultKeyBinding(e: SyntheticKeyboardEvent): string; } - - interface EntityInstance { - getData(): any, - getKey(): string, - getMutability(): string - } - - interface BlockMapBuilder { - createFromArray(blocks: Array): BlockMap - } - - interface CharacterMetadata { - create(config?: any): CharacterMetadata, - - applyStyle(record: CharacterMetadata, - style: string): CharacterMetadata, - - removeStyle(record: CharacterMetadata, - style: string): CharacterMetadata, - - applyEntity(record: CharacterMetadata, - entityKey?: string): CharacterMetadata, - - getStyle(): any, - hasStyle(style: string): boolean, - - getEntity(): string - } - - interface IContentBlock { - new(draftContentBlock: any): ContentBlock; - } - interface ContentBlock { - key: string, - type: string, - text: string, - characterList: any, - depth: number, - - getKey(): string, - getType(): string, - getText(): string, - getCharacterList(): any, - getLength(): number, - getDepth(): number, - getInlineStyleAt(offset: number): any, - getEntityAt(offset: number): string, - findStyleRanges(filterFn: Function, callback: Function): void, - findEntityRanges(filterFn: Function, callback: Function): void - - } - - interface ContentState { - createFromText(text: string): ContentState, - createFromBlockArray(blocks: Array): ContentState, - - getBlockMap(): BlockMap, - getSelectionBefore(): SelectionState, - getSelectionAfter(): SelectionState, - - getBlockForKey(key: string): ContentBlock, - getKeyBefore(key: string): string, - getKeyAfter(key: string): string, - - getBlockBefore(key: string): ContentBlock, - getBlockAfter(key: string): ContentBlock, - - getBlocksAsArray(): Array, - - getPlainText(): string, - hasText(): boolean, - - set(key: string, value: any): ContentState, - toJS(): any - } - - interface ISelectionState { - new(draftSelectionState: any): SelectionState; - createEmpty(blockKey: string): SelectionState; - } - - interface SelectionState { - getStartKey(): string, - getStartOffset(): number, - getEndKey(): string, - getEndOffset(): number, - getAnchorKey(): string, - getAnchorOffset(): number, - getFocusKey(): string, - getFocusOffset(): number, - - getIsBackward(): boolean, - getHasFocus(): boolean, - isCollapsed(): boolean, - - hasEdgeWithin(blockKey: string, start: number, end: number): boolean, - serialize(): string, - - get(key: string): any, - set(key: string, value: any): SelectionState - } - - interface BlockMap { - get(key: string): ContentBlock, - set(key: string, value: any): BlockMap, - delete(key: string): BlockMap, - find(cb: any): ContentBlock - } - - interface Modifier { - replaceText(contentState: ContentState, - rangeToReplace: SelectionState, - text: string, - inlineStyle?: any, - entityKey?: string): ContentState, - - insertText(contentState: ContentState, - targetRange: SelectionState, - text: string, - inlineStyle?: any, - entityKey?: string): ContentState, - - moveText(contentState: ContentState, - removalRange: SelectionState, - targetRange: SelectionState): ContentState, - - replaceWithFragment(contentState: ContentState, - targetRange: SelectionState, - fragment: BlockMap): ContentState, - - removeRange(contentState: ContentState, - rangeToRemove: SelectionState, - removalDirection: string): ContentState, - - splitBlock(contentState: ContentState, - selectionState: SelectionState): ContentState, - - applyInlineStyle(contentState: ContentState, - selectionState: SelectionState, - inlineStyle: string): ContentState, - - removeInlineStyle(contentState: ContentState, - selectionState: SelectionState, - inlineStyle: string): ContentState, - - setBlockType(contentState: ContentState, - selectionState: SelectionState, - blockType: string): ContentState, - - applyEntity(contentState: ContentState, - selectionState: SelectionState, - entityKey: string): ContentState - } - - interface RichUtils { - currentBlockContainsLink(editorState: EditorState): boolean, - getCurrentBlockType(editor: EditorState): string, - handleKeyCommand(editorState: EditorState, command: string): any, - insertSoftNewline(editorState: EditorState): EditorState, - onBackspace(editorState: EditorState): EditorState, - onDelete(editorState: EditorState): EditorState, - onTab(event: Event, editorState: EditorState, maxDepth: number): EditorState, - toggleBlockType(editorState: EditorState, blockType: string): EditorState, - toggleCode(editorState: EditorState): EditorState, - toggleLink(editorState: EditorState, targetSelection: SelectionState, entityKey: string): EditorState, - tryToRemoveBlockStyle(editorState: EditorState): EditorState - } - - interface EditorProps { - editorState: EditorState, - onChange(editorState: EditorState): void, - - placeholder?: string, - textAlignment?: any, - blockRendererFn?: (ContentBlock: ContentBlock) => any, - blockStyleFn?: (ContentBlock: ContentBlock) => string, - customStyleMap?: any, - - readOnly?: boolean, - spellCheck?: boolean, - stripPastedStyles?: boolean, - - handleReturn?: (e: any) => boolean, - handleKeyCommand?: (command: string) => boolean, - handleBeforeInput?: (chars: string) => boolean, - handlePastedFiles?: (files: Array) => boolean, - handleDroppedFiles?: (selection: SelectionState, files: Array) => boolean, - handleDrop?: (selection: SelectionState, dataTransfer: any, isInternal: any) => boolean, - - onEscape?: (e: any) => void, - onTab?: (e: any) => void, - onUpArrow?: (e: any) => void, - onDownArrow?: (e: any) => void, - - suppressContentEditableWarning?: any, - - onBlur?: (e: any) => void, - onFocus?: (e: any) => void - } - - interface Editor { - props: EditorProps - state: any, - refs: any, - context: any, - setState(): any, - render(): any, - forceUpdate(): any - } - - var Editor: IEditor; - var EditorState: EditorState; - - var CompositeDecorator: CompositeDecorator; - var Entity: Entity; - var EntityInstance: EntityInstance; - - var BlockMapBuilder: BlockMapBuilder; - var CharacterMetadata: CharacterMetadata; - var ContentBlock: IContentBlock; - var ContentState: ContentState; - var SelectionState: ISelectionState; - - var Modifier: Modifier; - var RichUtils: RichUtils; - - function convertFromRaw(rawState: any): Array; - - function convertToRaw(contentState: ContentState): any; - - function genKey(): string } - export = Draft; + namespace Model { + namespace Constants { + /** + * A set of editor commands that may be invoked by keyboard commands or UI + * controls. These commands should map to operations that modify content or + * selection state and update the editor state accordingly. + */ + type DraftEditorCommand = ( + /** + * Self-explanatory. + */ + "undo" | + "redo" | + /** + * Perform a forward deletion. + */ + "delete" | + + /** + * Perform a forward deletion to the next word boundary after the selection. + */ + "delete-word" | + + /** + * Perform a backward deletion. + */ + "backspace" | + + /** + * Perform a backward deletion to the previous word boundary before the + * selection. + */ + "backspace-word" | + + /** + * Perform a backward deletion to the beginning of the current line. + */ + "backspace-to-start-of-line" | + + /** + * Toggle styles. Commands may be intepreted to modify inline text ranges + * or block types. + */ + "bold" | + "italic" | + "underline" | + "code" | + + /** + * Split a block in two. + */ + "split-block" | + + /** + * Self-explanatory. + */ + "transpose-characters" | + "move-selection-to-start-of-block" | + "move-selection-to-end-of-block" | + + /** + * Commands to support the "secondary" clipboard provided by certain + * browsers and operating systems. + */ + "secondary-cut" | + "secondary-paste" + ); + + /** + * A type that allows us to avoid passing boolean arguments + * around to indicate whether a drag type is internal or external. + */ + type DraftDragType = "internal" | "external"; + + /** + * The list of default valid block types. + */ + type DraftBlockType = ( + "unstyled" | + "paragraph" | + "header-one" | + "header-two" | + "header-three" | + "header-four" | + "header-five" | + "header-six" | + "unordered-list-item" | + "ordered-list-item" | + "blockquote" | + "code-block" | + "atomic" + ); + + /** + * A type that allows us to avoid passing boolean arguments + * around to indicate whether a deletion is forward or backward. + */ + type DraftRemovalDirection = "backward" | "forward"; + } + + namespace Decorators { + import ContentBlock = Draft.Model.ImmutableData.ContentBlock; + + /** + * An interface for document decorator classes, allowing the creation of + * custom decorator classes. + * + * See `CompositeDraftDecorator` for the most common use case. + */ + interface DraftDecoratorType { + /** + * Given a `ContentBlock`, return an immutable List of decorator keys. + */ + getDecorations(block: ContentBlock): Immutable.List; + + /** + * Given a decorator key, return the component to use when rendering + * this decorated range. + */ + getComponentForKey(key: string): Function; + + /** + * Given a decorator key, optionally return the props to use when rendering + * this decorated range. + */ + getPropsForKey(key: string): any; + } + + /** + * A DraftDecorator is a strategy-component pair intended for use when + * rendering content. + * + * - A "strategy": A function that accepts a ContentBlock object and + * continuously executes a callback with start/end values corresponding to + * relevant matches in the document text. For example, getHashtagMatches + * uses a hashtag regex to find hashtag strings in the block, and + * for each hashtag match, executes the callback with start/end pairs. + * + * - A "component": A React component that will be used to render the + * "decorated" section of text. + * + * - "props": Props to be passed into the React component that will be used. + */ + interface DraftDecorator { + strategy: (block: ContentBlock, callback: (start: number, end: number) => void) => void; + component: Function; + props?: Object; + } + + /** + * A CompositeDraftDecorator traverses through a list of DraftDecorator + * instances to identify sections of a ContentBlock that should be rendered + * in a "decorated" manner. For example, hashtags, mentions, and links may + * be intended to stand out visually, be rendered as anchors, etc. + * + * The list of decorators supplied to the constructor will be used in the + * order they are provided. This allows the caller to specify a priority for + * string matching, in case of match collisions among decorators. + * + * For instance, I may have a link with a `#` in its text. Though this section + * of text may match our hashtag decorator, it should not be treated as a + * hashtag. I should therefore list my link DraftDecorator + * before my hashtag DraftDecorator when constructing this composite + * decorator instance. + * + * Thus, when a collision like this is encountered, the earlier match is + * preserved and the new match is discarded. + */ + class CompositeDraftDecorator { + constructor(decorators: Array); + + getDecorations(block: ContentBlock): Immutable.List; + getComponentForKey(key: string): Function; + getPropsForKey(key: string): Object; + } + } + + namespace Encoding { + import ContentBlock = Draft.Model.ImmutableData.ContentBlock; + import ContentState = Draft.Model.ImmutableData.ContentState; + + import DraftBlockRenderMap = Draft.Component.Base.DraftBlockRenderMap; + import DraftBlockType = Draft.Model.Constants.DraftBlockType; + + import DraftEntityType = Draft.Model.Entity.DraftEntityType; + import DraftEntityMutability = Draft.Model.Entity.DraftEntityMutability; + + /** + * A plain object representation of an entity attribution. + * + * The `key` value corresponds to the key of the entity in the `entityMap` of + * a `ComposedText` object, not for use with `DraftEntity.get()`. + */ + interface EntityRange { + key: number, + offset: number, + length: number, + } + + /** + * A plain object representation of an inline style range. + */ + interface InlineStyleRange { + style: string; + offset: number; + length: number; + } + + /** + * A plain object representation of an EntityInstance. + */ + interface RawDraftEntity { + type: DraftEntityType; + mutability: DraftEntityMutability; + data: { [key: string]: any }; + } + + /** + * A plain object representation of a ContentBlock, with all style and entity + * attribution repackaged as range objects. + */ + interface RawDraftContentBlock { + key: string; + type: DraftBlockType; + text: string; + depth: number; + inlineStyleRanges: Array; + entityRanges: Array; + data?: Object; + } + + /** + * A type that represents a composed document as vanilla JavaScript objects, + * with all styles and entities represented as ranges. Corresponding entity + * objects are packaged as objects as well. + * + * This object is especially useful when sending the document state to the + * server for storage, as its representation is more concise than our + * immutable objects. + */ + interface RawDraftContentState { + blocks: Array; + entityMap: { [key: string]: RawDraftEntity }; + } + + function convertFromHTMLtoContentBlocks(html: string, DOMBuilder: Function, blockRenderMap?: DraftBlockRenderMap): Array; + function convertFromRawToDraftState(rawState: RawDraftContentState): ContentState; + function convertFromDraftStateToRaw(contentState: ContentState): RawDraftContentState; + } + + namespace Entity { + type ComposedEntityType = "LINK" | "TOKEN" | "PHOTO"; + type DraftEntityType = string | ComposedEntityType; + + /** + * An enum representing the possible "mutability" options for an entity. + * This refers to the behavior that should occur when inserting or removing + * characters in a text range with an entity applied to it. + * + * `MUTABLE`: + * The text range can be modified freely. Generally used in cases where + * the text content and the entity do not necessarily have a direct + * relationship. For instance, the text and URI for a link may be completely + * different. The user is allowed to edit the text as needed, and the entity + * is preserved and applied to any characters added within the range. + * + * `IMMUTABLE`: + * Not to be confused with immutable data structures used to represent the + * state of the editor. Immutable entity ranges cannot be modified in any + * way. Adding characters within the range will remove the entity from the + * entire range. Deleting characters will delete the entire range. Example: + * Facebook Page mentions. + * + * `SEGMENTED`: + * Segmented entities allow the removal of partial ranges of text, as + * separated by a delimiter. Adding characters wihin the range will remove + * the entity from the entire range. Deleting characters within a segmented + * entity will delete only the segments affected by the deletion. Example: + * Facebook User mentions. + */ + type DraftEntityMutability = "MUTABLE" | "IMMUTABLE" | "SEGMENTED"; + + /** + * A "document entity" is an object containing metadata associated with a + * piece of text in a ContentBlock. + * + * For example, a `link` entity might include a `uri` property. When a + * ContentBlock is rendered in the browser, text that refers to that link + * entity may be rendered as an anchor, with the `uri` as the href value. + * + * In a ContentBlock, every position in the text may correspond to zero + * or one entities. This correspondence is tracked using a key string, + * generated via DraftEntity.create() and used to obtain entity metadata + * via DraftEntity.get(). + */ + class DraftEntity { + /** + * Create a DraftEntityInstance and store it for later retrieval. + * + * A random key string will be generated and returned. This key may + * be used to track the entity's usage in a ContentBlock, and for + * retrieving data about the entity at render time. + */ + static create(type: DraftEntityType, mutability: DraftEntityMutability, data?: Object): string; + + /** + * Add an existing DraftEntityInstance to the DraftEntity map. This is + * useful when restoring instances from the server. + */ + static add(instance: DraftEntityInstance): string; + + /** + * Retrieve the entity corresponding to the supplied key string. + */ + static get(key: string): DraftEntityInstance; + + /** + * Entity instances are immutable. If you need to update the data for an + * instance, this method will merge your data updates and return a new + * instance. + */ + static mergeData(key: string, toMerge: { [key: string]: any }): DraftEntityInstance; + + /** + * Completely replace the data for a given instance. + */ + static replaceData(key: string, newData: { [key: string]: any }): DraftEntityInstance; + } + + /** + * An instance of a document entity, consisting of a `type` and relevant + * `data`, metadata about the entity. + * + * For instance, a "link" entity might provide a URI, and a "mention" + * entity might provide the mentioned user's ID. These pieces of data + * may be used when rendering the entity as part of a ContentBlock DOM + * representation. For a link, the data would be used as an href for + * the rendered anchor. For a mention, the ID could be used to retrieve + * a hovercard. + */ + interface DraftEntityInstance { + getType(): DraftEntityType; + getMutability(): DraftEntityMutability; + getData(): any; + } + } + + namespace ImmutableData { + import DraftBlockType = Draft.Model.Constants.DraftBlockType; + import DraftDecoratorType = Draft.Model.Decorators.DraftDecoratorType; + + type DraftInlineStyle = Immutable.OrderedSet; + type BlockMap = Immutable.OrderedMap; + + var Record: Immutable.Record.Class; + + interface DraftBlockRenderConfig { + element: string; + wrapper?: React.ReactElement; + } + + class EditorState extends Record { + static createEmpty(decorator?: DraftDecoratorType): EditorState; + static createWithContent(contentState: ContentState, decorator?: DraftDecoratorType): EditorState; + static create(config: Object): EditorState; + static set(editorState: EditorState, put: Object): EditorState; + + /** + * Incorporate native DOM selection changes into the EditorState. This + * method can be used when we simply want to accept whatever the DOM + * has given us to represent selection, and we do not need to re-render + * the editor. + * + * To forcibly move the DOM selection, see `EditorState.forceSelection`. + */ + static acceptSelection(editorState: EditorState, selection: SelectionState): EditorState; + + /** + * At times, we need to force the DOM selection to be where we + * need it to be. This can occur when the anchor or focus nodes + * are non-text nodes, for instance. In this case, we want to trigger + * a re-render of the editor, which in turn forces selection into + * the correct place in the DOM. The `forceSelection` method + * accomplishes this. + * + * This method should be used in cases where you need to explicitly + * move the DOM selection from one place to another without a change + * in ContentState. + */ + static forceSelection(editorState: EditorState, selection: SelectionState): EditorState; + + /** + * Move selection to the end of the editor without forcing focus. + */ + static moveSelectionToEnd(editorState: EditorState): EditorState; + + /** + * Force focus to the end of the editor. This is useful in scenarios + * where we want to programmatically focus the input and it makes sense + * to allow the user to continue working seamlessly. + */ + static moveFocusToEnd(editorState: EditorState): EditorState; + + /** + * Push the current ContentState onto the undo stack if it should be + * considered a boundary state, and set the provided ContentState as the + * new current content. + */ + static push(editorState: EditorState, contentState: ContentState, changeType: EditorChangeType): EditorState; + + /** + * Make the top ContentState in the undo stack the new current content and + * push the current content onto the redo stack. + */ + static undo(editorState: EditorState): EditorState; + + /** + * Make the top ContentState in the redo stack the new current content and + * push the current content onto the undo stack. + */ + static redo(editorState: EditorState): EditorState; + + toJS(): Object; + getAllowUndo(): boolean; + getCurrentContent(): ContentState; + getUndoStack(): Immutable.Stack; + getRedoStack(): Immutable.Stack; + getSelection(): SelectionState; + getDecorator(): DraftDecoratorType; + isInCompositionMode(): boolean; + mustForceSelection(): boolean; + getNativelyRenderedContent(): ContentState; + getLastChangeType(): EditorChangeType; + + /** + * While editing, the user may apply inline style commands with a collapsed + * cursor, intending to type text that adopts the specified style. In this + * case, we track the specified style as an "override" that takes precedence + * over the inline style of the text adjacent to the cursor. + * + * If null, there is no override in place. + */ + getInlineStyleOverride(): DraftInlineStyle; + + static setInlineStyleOverride(editorState: EditorState, inlineStyleOverride: DraftInlineStyle): EditorState; + + /** + * Get the appropriate inline style for the editor state. If an + * override is in place, use it. Otherwise, the current style is + * based on the location of the selection state. + */ + getCurrentInlineStyle(): DraftInlineStyle; + + getBlockTree(blockKey: string): Immutable.List; + isSelectionAtStartOfContent(): boolean; + isSelectionAtEndOfContent(): boolean; + getDirectionMap(): Immutable.OrderedMap; + } + + class ContentBlock extends Record { + getKey(): string; + + getType(): DraftBlockType; + getType(): string; + + getText(): string; + getCharacterList(): Immutable.List; + getLength(): number; + getDepth(): number; + getData(): Immutable.Map; + getInlineStyleAt(offset: number): DraftInlineStyle; + getEntityAt(offset: number): string; + + /** + * Execute a callback for every contiguous range of styles within the block. + */ + findStyleRanges(filterFn: (value: CharacterMetadata) => boolean, callback: (start: number, end: number) => void): void; + + /** + * Execute a callback for every contiguous range of entities within the block. + */ + findEntityRanges(filterFn: (value: CharacterMetadata) => boolean, callback: (start: number, end: number) => void): void; + } + + class ContentState extends Record { + static createFromBlockArray(blocks: Array): ContentState; + static createFromText(text: string, delimiter?: string): ContentState; + + getBlockMap(): BlockMap; + getSelectionBefore(): SelectionState; + getSelectionAfter(): SelectionState; + getBlockForKey(key: string): ContentBlock; + + getKeyBefore(key: string): string; + getKeyAfter(key: string): string; + getBlockAfter(key: string): ContentBlock; + getBlockBefore(key: string): ContentBlock; + + getBlocksAsArray(): Array; + getFirstBlock(): ContentBlock; + getLastBlock(): ContentBlock; + getPlainText(delimiter?: string): string; + hasText(): boolean; + } + + class SelectionState extends Record { + static createEmpty(key: string): SelectionState; + + serialize(): string; + getAnchorKey(): string; + getAnchorOffset(): number; + getFocusKey(): string; + getFocusOffset(): number; + getIsBackward(): boolean; + getHasFocus(): boolean; + /** + * Return whether the specified range overlaps with an edge of the + * SelectionState. + */ + hasEdgeWithin(blockKey: string, start: number, end: number): boolean; + isCollapsed(): boolean; + getStartKey(): string; + getStartOffset(): number; + getEndKey(): string; + getEndOffset(): number; + } + + class CharacterMetadata { + static applyStyle(record: CharacterMetadata, style: string): CharacterMetadata; + static removeStyle(record: CharacterMetadata, style: string): CharacterMetadata; + static applyEntity(record: CharacterMetadata, entityKey: string): CharacterMetadata; + static applyEntity(record: CharacterMetadata): CharacterMetadata; + /** + * Use this function instead of the `CharacterMetadata` constructor. + * Since most content generally uses only a very small number of + * style/entity permutations, we can reuse these objects as often as + * possible. + */ + static create(config?: CharacterMetadataConfig): CharacterMetadata; + static create(): CharacterMetadata; + + getStyle(): DraftInlineStyle; + getEntity(): string; + hasStyle(style: string): boolean; + } + + interface CharacterMetadataConfig { + style?: DraftInlineStyle; + entity?: string; + } + + type EditorChangeType = ( + "adjust-depth" | + "apply-entity" | + "backspace-character" | + "change-block-data" | + "change-block-type" | + "change-inline-style" | + "delete-character" | + "insert-characters" | + "insert-fragment" | + "redo" | + "remove-range" | + "spellcheck-change" | + "split-block" | + "undo" + ) + + interface BlockMapBuilder { + createFromArray(blocks: Array): BlockMap; + } + + const DefaultDraftBlockRenderMap: Immutable.Map; + const DefaultDraftInlineStyle: Immutable.Map; + } + + namespace Keys { + function generateRandomKey(): string; + } + + namespace Modifier { + import EditorState = Draft.Model.ImmutableData.EditorState; + import ContentState = Draft.Model.ImmutableData.ContentState; + import SelectionState = Draft.Model.ImmutableData.SelectionState; + + import BlockMap = Draft.Model.ImmutableData.BlockMap; + import DraftInlineStyle = Draft.Model.ImmutableData.DraftInlineStyle; + + import DraftRemovalDirection = Draft.Model.Constants.DraftRemovalDirection; + import DraftBlockType = Draft.Model.Constants.DraftBlockType; + + import DraftEditorCommand = Draft.Model.Constants.DraftEditorCommand; + + type URI = any; + + class AtomicBlockUtils { + static insertAtomicBlock(editorState: EditorState, entityKey: string, character: string): EditorState; + } + + /** + * `DraftModifier` provides a set of convenience methods that apply + * modifications to a `ContentState` object based on a target `SelectionState`. + * + * Any change to a `ContentState` should be decomposable into a series of + * transaction functions that apply the required changes and return output + * `ContentState` objects. + * + * These functions encapsulate some of the most common transaction sequences. + */ + class DraftModifier { + static replaceText(contentState: ContentState, rangeToReplace: SelectionState, text: string, inlineStyle?: DraftInlineStyle, entityKey?: string): ContentState; + static insertText(contentState: ContentState, targetRange: SelectionState, text: string, inlineStyle?: DraftInlineStyle, entityKey?: string): ContentState; + static moveText(contentState: ContentState, removalRange: SelectionState, targetRange: SelectionState): ContentState; + static replaceWithFragment(contentState: ContentState, targetRange: SelectionState, fragment: BlockMap): ContentState; + + static removeRange(contentState: ContentState, rangeToRemove: SelectionState, removalDirection: DraftRemovalDirection): ContentState; + + static splitBlock(contentState: ContentState, selectionState: SelectionState): ContentState; + static applyInlineStyle(contentState: ContentState, selectionState: SelectionState, inlineStyle: string): ContentState; + static removeInlineStyle(contentState: ContentState, selectionState: SelectionState, inlineStyle: string): ContentState; + + static setBlockType(contentState: ContentState, selectionState: SelectionState, blockType: DraftBlockType): ContentState; + static setBlockType(contentState: ContentState, selectionState: SelectionState, blockType: string): ContentState; + + static setBlockData(contentState: ContentState, selectionState: SelectionState, blockData: Immutable.Map): ContentState; + static mergeBlockData(contentState: ContentState, selectionState: SelectionState, blockData: Immutable.Map): ContentState; + static applyEntity(contentState: ContentState, selectionState: SelectionState, entityKey: string): ContentState; + } + + class RichTextEditorUtil { + static currentBlockContainsLink(editorState: EditorState): boolean; + static getCurrentBlockType(editorState: EditorState): DraftBlockType; + static getCurrentBlockType(editorState: EditorState): string; + static getDataObjectForLinkURL(uri: URI): Object; + + static handleKeyCommand(editorState: EditorState, command: DraftEditorCommand): EditorState; + static handleKeyCommand(editorState: EditorState, command: string): EditorState; + + static insertSoftNewline(editorState: EditorState): EditorState; + + /** + * For collapsed selections at the start of styled blocks, backspace should + * just remove the existing style. + */ + static onBackspace(editorState: EditorState): EditorState; + static onDelete(editorState: EditorState): EditorState; + static onTab(event: SyntheticKeyboardEvent, editorState: EditorState, maxDepth: number): EditorState; + + static toggleBlockType(editorState: EditorState, blockType: DraftBlockType): EditorState; + static toggleBlockType(editorState: EditorState, blockType: string): EditorState; + + static toggleCode(editorState: EditorState): EditorState; + + /** + * Toggle the specified inline style for the selection. If the + * user's selection is collapsed, apply or remove the style for the + * internal state. If it is not collapsed, apply the change directly + * to the document state. + */ + static toggleInlineStyle(editorState: EditorState, inlineStyle: string): EditorState; + + static toggleLink(editorState: EditorState, targetSelection: SelectionState, entityKey: string): EditorState; + + /** + * When a collapsed cursor is at the start of an empty styled block, allow + * certain key commands (newline, backspace) to simply change the + * style of the block instead of the default behavior. + */ + static tryToRemoveBlockStyle(editorState: EditorState): ContentState; + } + } + } } + +declare module "draft-js" { + import Editor = Draft.Component.Base.DraftEditor; + import EditorBlock = Draft.Component.Components.DraftEditorBlock; + import EditorState = Draft.Model.ImmutableData.EditorState; + + import CompositeDecorator = Draft.Model.Decorators.CompositeDraftDecorator; + import Entity = Draft.Model.Entity.DraftEntity; + import EntityInstance = Draft.Model.Entity.DraftEntityInstance; + + import BlockMapBuilder = Draft.Model.ImmutableData.BlockMapBuilder; + import CharacterMetadata = Draft.Model.ImmutableData.CharacterMetadata; + import ContentBlock = Draft.Model.ImmutableData.ContentBlock; + import ContentState = Draft.Model.ImmutableData.ContentState; + import SelectionState = Draft.Model.ImmutableData.SelectionState; + + import AtomicBlockUtils = Draft.Model.Modifier.AtomicBlockUtils; + import KeyBindingUtil = Draft.Component.Utils.KeyBindingUtil; + import Modifier = Draft.Model.Modifier.DraftModifier; + import RichUtils = Draft.Model.Modifier.RichTextEditorUtil; + + import DefaultDraftBlockRenderMap = Draft.Model.ImmutableData.DefaultDraftBlockRenderMap; + import DefaultDraftInlineStyle = Draft.Model.ImmutableData.DefaultDraftInlineStyle; + + import convertFromHTML = Draft.Model.Encoding.convertFromHTMLtoContentBlocks; + import convertFromRaw = Draft.Model.Encoding.convertFromRawToDraftState; + import convertToRaw = Draft.Model.Encoding.convertFromDraftStateToRaw; + import genKey = Draft.Model.Keys.generateRandomKey; + import getDefaultKeyBinding = Draft.Component.Utils.getDefaultKeyBinding; + import getVisibleSelectionRect = Draft.Component.Selection.getVisibleSelectionRect; + + export { + Editor, + EditorBlock, + EditorState, + + CompositeDecorator, + Entity, + EntityInstance, + + BlockMapBuilder, + CharacterMetadata, + ContentBlock, + ContentState, + SelectionState, + + AtomicBlockUtils, + KeyBindingUtil, + Modifier, + RichUtils, + + DefaultDraftBlockRenderMap, + DefaultDraftInlineStyle, + + convertFromHTML, + convertFromRaw, + convertToRaw, + genKey, + getDefaultKeyBinding, + getVisibleSelectionRect + }; +} \ No newline at end of file diff --git a/durandal/durandal.d.ts b/durandal/durandal.d.ts index c5ec79ae61..97e1307a0b 100644 --- a/durandal/durandal.d.ts +++ b/durandal/durandal.d.ts @@ -693,6 +693,7 @@ declare module 'plugins/dialog' { } interface Dialog { + host: HTMLElement; owner: any; context: DialogContext; activator: DurandalActivator; diff --git a/easeljs/easeljs.d.ts b/easeljs/easeljs.d.ts index a76e72b350..3ddeabdef9 100644 --- a/easeljs/easeljs.d.ts +++ b/easeljs/easeljs.d.ts @@ -43,7 +43,7 @@ declare namespace createjs { export class Bitmap extends DisplayObject { - constructor(imageOrUrl: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | string); + constructor(imageOrUrl: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | Object | string); // properties image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement; diff --git a/echarts/echarts.d.ts b/echarts/echarts.d.ts new file mode 100644 index 0000000000..f460a9eaca --- /dev/null +++ b/echarts/echarts.d.ts @@ -0,0 +1,133 @@ +// Type definitions for echarts +// Project: http://echarts.baidu.com/ +// Definitions by: Xie Jingyang +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace ECharts { + function init(dom:HTMLDivElement|HTMLCanvasElement, theme?:Object|string, opts?:{ + devicePixelRatio?: number + renderer?: string + }):ECharts; + + function connect(group:string|Array):void; + + function disConnect(group:string):void; + + function dispose(target:ECharts|HTMLDivElement|HTMLCanvasElement):void; + + function getInstanceByDom(target:HTMLDivElement|HTMLCanvasElement):void; + + function registerMap(mapName:string, geoJson:Object, specialAreas?:Object):void; + + function registerTheme(themeName:string, theme:Object):void; + + class ECharts { + group:string; + + setOption(option:EChartOption, notMerge?:boolean, notRefreshImmediately?:boolean):void + + getWidth():number + + getHeight():number + + getDom():HTMLCanvasElement|HTMLDivElement + + getOption():Object + + resize():void + + dispatchAction(payload:Object):void + + on(eventName:string, handler:Function, context?:Object):void + + off(eventName:string, handler?:Function):void + + showLoading(type?:string, opts?:Object):void + + hideLoading():void + + getDataURL(opts:{ + // 导出的格式,可选 png, jpeg + type?: string, + // 导出的图片分辨率比例,默认为 1。 + pixelRatio?: number, + // 导出的图片背景色,默认使用 option 里的 backgroundColor + backgroundColor?: string + }):string + + getConnectedDataURL(opts:{ + // 导出的格式,可选 png, jpeg + type: string, + // 导出的图片分辨率比例,默认为 1。 + pixelRatio: number, + // 导出的图片背景色,默认使用 option 里的 backgroundColor + backgroundColor: string + }):string + + clear():void + + isDisposed():boolean + + dispose():void + } + + interface EChartOption { + title?: EChartTitleOption + legend?: Object, + grid?: Object, + xAxis?: Object, + yAxis?: Object, + polar?: Object, + radiusAxis?: Object, + angleAxis?: Object, + radar?: Object, + dataZoom?: Array, + visualMap?: Array, + tooltip?: Object, + toolbox?: Object, + geo?: Object, + parallel?: Object, + parallelAxis?: Object, + timeline?: Object, + series?: Array, + color?: Array, + backgroundColor?: string, + textStyle?: Object, + animation?: boolean, + animationDuration?: number, + animationEasing?: string, + animationDurationUpdate?: number, + animationEasingUpdate?: string + } + + interface EChartTitleOption { + show?: boolean; + text?: string; + link?: string, + target?: string, + textStyle?: Object, + subtext?: string, + sublink?: string, + subtarget?: string, + subtextStyle?: Object, + padding?: number, + itemGap?: number, + zlevel?: number, + z?: number, + left?: string, + top?: string, + right?: string, + bottom?: string, + backgroundColor?: string, + borderColor?: string, + borderWidth?: number, + shadowBlur?: number, + shadowColor?: number, + shadowOffsetX?: number, + shadowOffsetY?: number, + } +} + +declare module "echarts" { + export = ECharts; +} diff --git a/ej.widgets.all/ej.mobile.all-tests.ts b/ej.widgets.all/ej.mobile.all-tests.ts new file mode 100644 index 0000000000..86381d522a --- /dev/null +++ b/ej.widgets.all/ej.mobile.all-tests.ts @@ -0,0 +1,336 @@ +/// +/// + +$(document).ready(function () { + + $("#CoreLinearGauge").ejLinearGauge({ + labelColor: "#8c8c8c", width: 500, + scales: [{ + width: 4, border: { color: "transparent",width:0 }, showBarPointers: false, showRanges: true, length: 310, + position: { x: 52, y: 50 }, markerPointers: [{ + value: 50, length: 10, width: 10, backgroundColor: "#4D4D4D", border: { color: "#4D4D4D" } + }], + labels: [{ font: { size: "11px", fontFamily: "Segoe UI", fontStyle: "bold" }, distanceFromScale:{x: -13} }], + ticks: [{ type: "majorinterval", width: 1, color: "#8c8c8c" }], + ranges: [{ + endValue: 60, + startValue: 0, + backgroundColor: "#F6B53F", + border: { color: "#F6B53F" }, startWidth: 4, endWidth: 4 + }, { + endValue: 100, + startValue: 60, + backgroundColor: "#E94649", + border: { color: "#E94649" }, startWidth: 4, endWidth: 4 + }] + }], + init:onLinearGaugeinit, + mouseClick:onLinearGaugemouseClick + }); +}); + +function onLinearGaugeinit() +{ + console.log("init"); +} +function onLinearGaugemouseClick() +{ + console.log("mouseClick"); +} + +$(document).ready(function () { + + $("#CoreCircularGauge").ejCircularGauge({ + backgroundColor: "transparent", width: 500, + scales: [{ + showRanges: true, + startAngle: 122, sweepAngle: 296, radius: 130, showScaleBar: true, size: 1, maximum: 120, majorIntervalValue: 20, minorIntervalValue: 10, + border: { + width: 0.5, + }, + pointers: [{ + value: 60, + showBackNeedle: true, + backNeedleLength: 20, + length: 95, + width: 7, + pointerCap: { radius: 12 } + }], + ticks: [{ + type: "major", + distanceFromScale: 2, + height: 16, + width: 1, color: "#8c8c8c" + }, { type: "minor", height: 8, width: 1, distanceFromScale: 2, color: "#8c8c8c" }], + labels: [{ + color: "#8c8c8c" + }], + ranges: [{ + distanceFromScale: -30, + startValue: 0, + endValue: 70 + }, { + distanceFromScale: -30, + startValue: 70, + endValue: 110, + backgroundColor: "#fc0606", + border: { color: "#fc0606" } + }, + { + distanceFromScale: -30, + startValue: 110, + endValue: 120, + backgroundColor: "#f5b43f", + border: { color: "#f5b43f" } + }] + }], + mouseClick:onCircularMouseClick + }); + +}); + +function onCircularMouseClick() +{ + console.log("Mouse click.."); +} + +$(document).ready(function () { + + $("#DigitalCore").ejDigitalGauge({ + width: 525, + height: 305, + items: [{ + segmentSettings: { + width: 1, + spacing: 0, + color: "#8c8c8c" + }, + characterSettings: { + opacity: 0.8, + }, + value: "123456789", + position: { x: 52, y: 52 } + }], + init:onDigitalGaugeinit, + itemRendering:onDigitalGaugeItemRendering + }); +}); + +function onDigitalGaugeinit() +{ + console.log("init"); +} +function onDigitalGaugeItemRendering() +{ + console.log("itemRendering"); +} + +$(document).ready(function () { + + $("#container").ejChart( + { + + + + //Initializing Common Properties for all the series + commonSeriesOptions: + { + type: 'line', enableAnimation: true, + tooltip:{ visible :true, template:'Tooltip'}, + marker: + { + shape: 'circle', + size: + { + height: 10, width: 10 + }, + visible: true + }, + border : {width: 2} + }, + + + + title :{text: 'Efficiency of oil-fired power production'}, + size: { height: "600" }, + legend: { visible: true}, + create:onChartCreate + }); + +}); + +function onChartCreate() +{ + console.log("create"); +} + +$(document).ready(function () { + + $("#scrollcontent").ejRangeNavigator({ + + enableDeferredUpdate: true, + padding: "15", + allowSnapping:true, + selectedRangeSettings: { + start:"2015/5/25", end:"2016/5/25" + }, + + }) +}); + +$(document).ready(function () { + $("#BulletGraph1").ejBulletGraph({ + qualitativeRangeSize: 32, + quantitativeScaleLength: 475, tooltipSettings: {template: "Tooltip", visible: true}, orientation: ej.datavisualization.BulletGraph.Orientation.Horizontal, + flowDirection: ej.datavisualization.BulletGraph.FlowDirection.Forward, + quantitativeScaleSettings: { + location: { x: 110, y: 10 }, + minimum: 0, + maximum: 10, + interval: 1, + minorTicksPerInterval: 4, + majorTickSettings:{ size: 13, width: 1, stroke: 'gray'}, + minorTickSettings:{ size: 5, width: 1, stroke: 'gray'}, + + labelSettings: { + position: ej.datavisualization.BulletGraph.LabelPosition.Below, offset: 14, size: 10 + }, + featuredMeasureSettings: { width: 6 }, + comparativeMeasureSettings:{ + width: 5 + }, + featureMeasures: [{ value: 8, comparativeMeasureValue: 6.7, category: ""}] + }, + qualitativeRanges: [{ + rangeEnd: 4.3 + }, { + rangeEnd: 7.3 + }, { + rangeEnd: 10 + }], + captionSettings: { textAngle: 0, + location: { x: 17, y: 20 }, text: "Revenue YTD", font: { color: null, fontFamily: 'Segoe UI', fontStyle: ej.datavisualization.BulletGraph.FontStyle.Normal, size: '12px', fontWeight: ej.datavisualization.BulletGraph.FontWeight.Normal, opacity: 1 }, //'#707070' + subTitle: { textAngle: 0, + text: "$ in Thousands", location: { x: 10, y: 35 }, font: { color: null, fontFamily: 'Segoe UI', fontStyle: ej.datavisualization.BulletGraph.FontStyle.Normal, size: '12px', fontWeight: ej.datavisualization.BulletGraph.FontWeight.Normal, opacity: 1} //'#707070' + } + } + + + + }); + + $("#BulletGraph2").ejBulletGraph({ qualitativeRangeSize: 32, height:140, + quantitativeScaleLength: 475, orientation: ej.datavisualization.BulletGraph.Orientation.Horizontal, + flowDirection: ej.datavisualization.BulletGraph.FlowDirection.Forward, + quantitativeScaleSettings: { + location: { x: 110, y: 10 }, + minimum: -10, + maximum: 10, + interval: 2, + minorTicksPerInterval: 4, + majorTickSettings:{ size: 13, width: 1}, + minorTickSettings:{ size: 5, width: 1}, + + labelSettings: { + position: ej.datavisualization.BulletGraph.LabelPosition.Below, offset: 14, size: 10, labelSuffix: ' %' + }, + featuredMeasureSettings: { width: 6 }, + comparativeMeasureSettings:{ width: 5 }, + featureMeasures: [{ value: 8, comparativeMeasureValue: 6.7}] + }, + qualitativeRanges: [{ + rangeEnd: -4, rangeStroke: "#61a301" + }, { + rangeEnd: 3, rangeStroke: "#fcda21" + }, { + rangeEnd: 10, rangeStroke: "#d61e3f" + }], + captionSettings: { textAngle: 0, + location: { x: 60, y: 25 }, text: "Profit", font: { color: null, fontFamily: 'Segoe UI', fontStyle: ej.datavisualization.BulletGraph.FontStyle.Normal, size: '13px', fontWeight: ej.datavisualization.BulletGraph.FontWeight.Normal, opacity: 1 }, //'#707070' + //subTitle: { textAngle: 0, + // text: "profit in %", location: { x: 35, y: 35 }, font: { color: null, fontFamily: 'Segoe UI', fontStyle: ej.datavisualization.BulletGraph.FontStyle.Normal, size: '12px', fontWeight: ej.datavisualization.BulletGraph.FontWeight.Normal, opacity: 1} //'#707070' + //} + }, + drawLabels:onBulletDrawLabel + }); + +}); + + function onBulletDrawLabel() + { + console.log("drawLabel"); + } + + +$(document).ready(function () { + + $("#barcode").ejBarcode({ text: "HTTP://WWW.SYNCFUSION.COM", symbologyType: "qrbarcode", xDimension: 8, displayText: true, load:onBarcodeLoad }); + +}); + +function onBarcodeLoad() + { + console.log("load"); + } + + jQuery(function ($) { + $("#container").ejMap({ + mouseover:MapMouseOver, + onRenderComplete:MapOnRenderComplete, + navigationControl:{enableNavigation:true,orientation:'vertical',absolutePosition:{x:5,y:15},dockPosition: 'none'}, + background:'white', + enableAnimation: true, + layers: [ + { + layerType: "geometry", + enableSelection: false, + enableMouseHover:false, + + showMapItems: false, + markerTemplate: 'template', + shapeSettings: { + fill: "#626171", + strokeThickness: "1", + stroke: "#6F6F79", + highlightStroke:"#6F6F79", + valuePath: "name", + highlightColor: "gray" + + }, + + } + ] + + }); + }); + function MapMouseOver() { + console.log("mouseover"); + } + function MapOnRenderComplete() { + console.log("onRenderComplete"); + } + + + jQuery(function ($) { + $("#treemapContainer").ejTreeMap({ + treeMapItemSelected:onTreeMapItemSelected, + + levels: [ + { groupPath: "Continent", groupGap: 5} + ], + colorValuePath: "Growth", + rangeColorMapping: [ + { color: "#DC562D", from: "0", to: "1" }, + { color: "#FED124", from: "1", to: "1.5" }, + { color: "#487FC1", from: "1.5", to: "2" }, + { color: "#0E9F49", from: "2", to: "3" } + ], + showTooltip:true, + leafItemSettings: { labelPath: "Region" } + }); + }); + function onTreeMapItemSelected() { + console.log("TreeMapItemSelected"); + } + + \ No newline at end of file diff --git a/ej.widgets.all/ej.mobile.all.d.ts b/ej.widgets.all/ej.mobile.all.d.ts new file mode 100644 index 0000000000..cdf403f36c --- /dev/null +++ b/ej.widgets.all/ej.mobile.all.d.ts @@ -0,0 +1,19908 @@ +// Type definitions for ej.mobile.all v14.1.0.41 +// Project: http://help.syncfusion.com/js/typescript +// Definitions by: Syncfusion +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + + +/*! +* filename: ej.mobile.all.d.ts +* version : 14.1.0.41 +* Copyright Syncfusion Inc. 2001 - 2016. All rights reserved. +* Use of this code is subject to the terms of our license. +* A copy of the current license can be obtained at any time by e-mailing +* licensing@syncfusion.com. Any infringement will be prosecuted under +* applicable laws. +*/ +declare module ej { + + var dataUtil: dataUtil; + function isMobile(): boolean; + function isIOS(): boolean; + function isAndroid(): boolean; + function isFlat(): boolean; + function isWindows(): boolean; + function isCssCalc(): boolean; + function getCurrentPage(): JQuery; + function isLowerResolution(): boolean; + function browserInfo(): browserInfoOptions; + function isTouchDevice(): boolean; + function addPrefix(style: string): string; + function animationEndEvent(): string; + function blockDefaultActions(e: Object): void; + function buildTag(tag: string, innerHtml: string, styles: Object, attrs: Object): JQuery; + function cancelEvent(): string; + function copyObject(): string; + function createObject(nameSpace: string, value: Object, initIn: string): JQuery; + function defineClass(className: string, constructor:any, proto: Object, replace: boolean): Object; + function destroyWidgets(element: Object): void; + function endEvent(): string; + function event(type: string, data: any, eventProp: Object): Object; + function getAndroidVersion(): Object; + function getAttrVal(ele: Object, val: string, option: Object): Object; + function getBooleanVal(ele: Object, val: string, option: Object): Object; + function getClearString(): string; + function getDimension(element: Object, method: string): Object; + function getFontString(fontObj: Object): string; + function getFontStyle(style: string): string; + function getMaxZindex(): number; + function getNameSpace(className: string): string; + function getObject(nameSpace: string): Object; + function getOffset(ele: string): Object; + function getRenderMode(): string; + function getScrollableParents(element: Object): void; + function getTheme(): string; + function getZindexPartial(element: Object, popupEle: string): number; + function hasRenderMode(element: string): void; + function hasStyle(prop: string): boolean; + function hasTheme(element: string): string; + function hexFromRGB(color: string): string; + function ieClearRemover(element: string): void; + function isAndroidWebView(): string; + function isDevice(): boolean; + function isIOS7(): boolean; + function isIOSWebView(): boolean; + function isLowerAndroid(): boolean; + function isNullOrUndefined(value: Object): boolean; + function isPlainObject(): JQuery; + function isPortrait(): any; + function isTablet(): boolean; + function isWindowsWebView(): string; + function listenEvents(selectors:any, eventTypes: any, handlers: any, remove?: any, pluginObj?: any, disableMouse?: boolean): void; + function listenTouchEvent(selectors:any, eventTypes: any, handlers: any, remove?: any, pluginObj?: any, disableMouse?: boolean): void; + function logBase(val: string, base: string): number; + function measureText(text: string, maxwidth: number, font: string): string; + function moveEvent(): string; + function print(element: string): void; + function proxy(fn: Object, context: string, arg: string): boolean; + function round(value: string, div: string, up: string): any; + function sendAjaxRequest(ajaxOptions: Object): void; + function setCaretToPos(nput: string, pos1: string, pos2: string): void; + function setRenderMode(element: string): void; + function setTheme(): Object; + function startEvent(): string; + function tapEvent(): string; + function tapHoldEvent(): string; + function throwError(): Object; + function transitionEndEvent(): Object; + function userAgent(): boolean; + function widget(pluginName: string, className: string, proto: Object): Object; + function avg(json: Object, filedName: string): any; + function getGuid(prefix: string): number; + function group(jsonArray: any, field: string, agg: string, level: number, groupDs: string): Object; + function isJson(jsonData: string): string; + function max(jsonArray: any, fieldName: string, comparer: string): any; + function min(jsonArray: any, fieldName: string, comparer: string): any; + function merge(first: string, second: string): any; + function mergeshort(jsonArray: any, fieldName: string, comparer: string): any; + function parseJson(jsonText: string): string; + function parseTable(table: number, headerOption: string, headerRowIndex: string): Object; + function select(jsonArray: any, fields: string): any; + function setTransition(): boolean; + function sum(json: string, fieldName: string): string; + function swap(array: any, x: string, y: string): any; + var cssUA: string; + var serverTimezoneOffset: number; + var transform: string; + var transformOrigin: string; + var transformStyle: string; + var transition: string; + var transitionDelay: string; + var transitionDuration: string; + var transitionProperty: string; + var transitionTimingFunction: string; + export module device { + function isAndroid(): boolean; + function isIOS(): boolean; + function isFlat(): boolean; + function isIOS7(): boolean; + function isWindows(): boolean; + } + export module widget { + var autoInit: boolean; + var registeredInstances: Array; + var registeredWidgets: Array; + function register(pluginName: string, className: string, prototype: any): void; + function destroyAll(elements: Element): void; + function init(element: Element): void; + function registerInstance(element: Element, pluginName: string, className: string, prototype: any):void; + } + + interface browserInfoOptions { + name: string; + version: string; + culture: Object; + isMSPointerEnabled: boolean; + } + class WidgetBase { + destroy(): void; + element: JQuery; + setModel(options: Object, forceSet?: boolean):any; + option(prop?: Object, value?: Object, forceSet?: boolean): any; + persistState(): void; + restoreState(silent: boolean): void; + } + + class Widget extends WidgetBase { + constructor(pluginName: string, className: string, proto: any); + static fn: Widget; + static extend(widget: Widget): any; + register(pluginName: string, className: string, prototype: any): void; + destroyAll(elements: Element): void; + model: any; + } + + + interface BaseEvent { + cancel: boolean; + type: string; + } + class DataManager { + constructor(dataSource?: any, query?: ej.Query, adaptor?: any); + setDefaultQuery(query: ej.Query): void; + executeQuery(query?: ej.Query, done?: any, fail?: any, always?: any): JQueryPromise; + executeLocal(query?: ej.Query): ej.DataManager; + saveChanges(changes?: Changes, key?: string, tableName?: string): JQueryDeferred; + insert(data: Object, tableName: string): JQueryPromise; + remove(keyField: string, value: any, tableName: string): Object; + update(keyField: string, value: any, tableName: string): Object; + } + + class Query { + constructor(); + static fn: Query; + static extend(prototype: Object): Query; + key(field: string): ej.Query; + using(dataManager: ej.DataManager): ej.Query; + execute(dataManager: ej.DataManager, done: any, fail?: string, always?: string): any; + executeLocal(dataManager: ej.DataManager): ej.DataManager; + clone(): ej.Query; + from(tableName: any): ej.Query; + addParams(key: string, value: string): ej.Query; + expand(tables: any): ej.Query; + where(fieldName: string, operator: ej.FilterOperators, value: string, ignoreCase?: boolean): ej.Query; + where(predicate:ej.Predicate):ej.Query; + search(searchKey: any, fieldNames?: any, operator?: string, ignoreCase?: boolean): ej.Query; + sortBy(fieldName: string, comparer?: ej.SortOrder, isFromGroup?: boolean): ej.Query; + sortByDesc(fieldName: string): ej.Query; + group(fieldName: string): ej.Query; + page(pageIndex: number, pageSize: number): ej.Query; + take(nos: number): ej.Query; + skip(nos: number): ej.Query; + select(fieldNames: any): ej.Query; + hierarchy(query: ej.Query, selectorFn: any): ej.Query; + foreignKey(key: string): ej.Query; + requiresCount(): ej.Query; + range(start:number, end:number): ej.Query; + } + + class Adaptor { + constructor(ds: any); + pvt: Object; + type: ej.Adaptor; + options: AdaptorOptions; + extend(overrides: any): ej.Adaptor; + processQuery(dm: ej.DataManager, query: ej.Query):any; + processResponse(data: Object, ds: any, query: ej.Query, xhr: JQueryXHR, request?: Object, changes?: Changes): Object; + convertToQueryString(req: any, query: ej.Query, dm: ej.DataManager): JQueryParam; + } + + interface AdaptorOptions { + from?: string; + requestType?: string; + sortBy?: string; + select?: string; + skip?: string; + group?: string; + take?: string; + search?: string; + count?: string; + where?: string; + aggregates?: string; + } + + class UrlAdaptor extends ej.Adaptor { + constructor(); + processQuery(dm: ej.DataManager, query: ej.Query, hierarchyFilters?: Object): { + type: string; url: string; ejPvtData: Object; contentType?: string; data?: Object; + } + convertToQueryString(req: Object, query: ej.Query, dm: ej.DataManager): JQueryParam; + processResponse(data: Object, ds: any, query: ej.Query, xhr: JQueryXHR, request?: Object, changes?: Changes): Object; + onGroup(e: any): void; + batchRequest(dm: ej.DataManager, changes: Changes, e: any): void; + beforeSend(dm: ej.DataManager, request: any, settings?:any): void; + insert(dm: ej.DataManager, data: Object, tableName: string): { url: string; data: any }; + remove(dm: ej.DataManager, keyField: string, value: any, tableName: string): { type: string; url: string; data?: any }; + update(dm: ej.DataManager, keyField: string, value: any, tableName: string): { type: string; url: string; data: any }; + getFiltersFrom(data: Object, query: ej.Query): ej.Predicate; + } + + class ODataAdaptor extends ej.UrlAdaptor { + constructor(); + options: UrlAdaptorOptions; + onEachWhere(filter: any, requiresCast: boolean): any; + onPredicate(pred: ej.Predicate, query: ej.Query, requiresCast: boolean): string; + onComplexPredicate(pred: ej.Predicate, requiresCast: boolean): string; + onWhere(filters: Array): string; + onEachSearch(e: Object): void; + onSearch(e: Object): string; + onEachSort(e: Object): string; + onSortBy(e: Object): string; + onGroup(e: Object): string; + onSelect(e: Object): string; + onCount(e: Object): string; + beforeSend(dm: ej.DataManager, request: any, settings?: any): void; + processResponse(data: Object, ds: Object, query: ej.Query, xhr:any, request: any, changes: Changes): { + result: Object; count: number + }; + convertToQueryString(req: Object, query: ej.Query, dm: ej.DataManager): JQueryParam; + insert(dm: ej.DataManager, data: Object, tableName: string): { url: string; data: Object; } + remove(dm: ej.DataManager, keyField: string, value: any, tableName: string): { url: string; type: string; } + update(dm: ej.DataManager, keyField: string, value: any, tableName: string): { url: string; type: string; data: Object; accept: string; } + batchRequest(dm: ej.DataManager, changes: Changes, e: any): { url: string; type: string; data: Object; contentType: string; } + generateDeleteRequest(arr: Array, e: any): string; + generateInsertRequest(arr: Array, e: any): string; + generateUpdateRequest(arr: Array, e: any): string; + } + interface UrlAdaptorOptions { + requestType?: string; + accept?: string; + multipartAccept?: string; + sortBy?: string; + select?: string; + skip?: string; + take?: string; + count?: string; + where?: string; + expand?: string; + batch?: string; + changeSet?: string; + batchPre?: string; + contentId?: string; + batchContent?: string; + changeSetContent?: string; + batchChangeSetContentType?: string; + } + + class ODataV4Adaptor extends ej.ODataAdaptor { + constructor(); + options: ODataAdaptorOptions; + onCount(e: Object): string; + onEachSearch(e: Object): void; + onSearch(e: Object): string; + beforeSend(dm: ej.DataManager, request: any, settings?: any): void; + processResponse(data: Object, ds: Object, query: ej.Query, xhr:any, request: any, changes: Changes): { + result: Object; count: number + }; + + } + interface ODataAdaptorOptions { + requestType?: string; + accept?: string; + multipartAccept?: string; + sortBy?: string; + select?: string; + skip?: string; + take?: string; + count?: string; + search?: string; + where?: string; + expand?: string; + batch?: string; + changeSet?: string; + batchPre?: string; + contentId?: string; + batchContent?: string; + changeSetContent?: string; + batchChangeSetContentType?: string; + } + + class JsonAdaptor extends ej.Adaptor { + constructor(); + processQuery(ds: Object, query: ej.Query): string; + batchRequest(dm: ej.DataManager, changes: Changes, e:any): Changes; + onWhere(ds: Object, e: any): any; + onSearch(ds: Object, e: any): any + onSortBy(ds: Object, e: any, query: ej.Query): Object; + onGroup(ds: Object, e: any, query: ej.Query): Object; + onPage(ds: Object, e: any, query: ej.Query): Object; + onRange(ds: Object, e: any): Object; + onTake(ds: Object, e: any): Object; + onSkip(ds: Object, e: any): Object; + onSelect(ds: Object, e: any): Object; + insert(dm: ej.DataManager, data: any): Object; + remove(dm: ej.DataManager, keyField: string, value:any, tableName: string): Object; + update(dm: ej.DataManager, keyField: string, value:any, tableName: string): Object; + } + class TableModel { + constructor(name: string, jsonArray: Array, dataManager: ej.DataManager, modelComputed: any); + on(eventName: string, handler: any): void; + off(eventName: string, handler: any): void; + setDataManager(dataManager: DataManager): void; + saveChanges(): void; + rejectChanges(): void; + insert(json: any): void; + update(value: any): void; + remove(key: string): void; + isDirty(): boolean; + getChanges(): Changes; + toArray(): Array; + setDirty(dirty:any, model:any): void; + get(index: number): void; + length(): number; + bindTo(element: any): void; + } + class Model { + constructor(json: any, table: string, name: string); + formElements: Array; + computes(value: any): void; + on(eventName: string, handler: any): void; + off(eventName: string, handler: any): void; + set(field: string, value: any): void; + get(field: string): any; + revert(suspendEvent: any): void; + save(dm: ej.DataManager, key: string): void; + markCommit(): void; + markDelete(): void; + changeState(state: boolean, args: any): void; + properties(): any; + bindTo(element: any): void; + unbind(element: any): void; + } + interface Changes { + changed?: Array; + added?: Array; + deleted?: Array; + } + class Predicate { + constructor(field: string, operator: ej.FilterOperators, value: any, ignoreCase: boolean); + and(field: string, operator: any, value:any, ignoreCase:boolean): void; + or(field: string, operator: any, value: any, ignoreCase: boolean): void; + validate(record: Object): boolean; + toJSON(): { + isComplex: boolean; + field: string; + operator: string; + value: any; + ignoreCase: boolean; + condition: string; + predicates: any; + }; + } + interface dataUtil { + swap(array: Array, x: number, y: number): void; + mergeSort(jsonArray: Array, fieldName: string, comparer:any): Array; + max(jsonArray: Array, fieldName: string, comparer: string): Array; + min(jsonArray: Array, fieldName: string, comparer: string): Array; + distinct(jsonArray: Array, fieldName: string, requiresCompleteRecord:any): Array; + sum(json:any, fieldName: string): number; + avg(json:any, fieldName: string): number; + select(jsonArray: Array, fieldName: string, fields:string): Array; + group(jsonArray: Array, field: string, /* internal */ level: number): Array; + parseTable(table: string, headerOption: ej.headerOption, headerRowIndex: number): Object; + } + interface AjaxSettings { + type?: string; + cache: boolean; + data?: any; + dataType?: string; + contentType?: any; + async?: boolean; + } + enum FilterOperators { + contains, + endsWith, + equal, + greaterThan, + greaterThanOrEqual, + lessThan, + lessThanOrEqual, + notEqual, + startsWith + } + + enum MatrixDefaults { + m11, + m12, + m21, + m22, + offsetX, + offsetY, + type + } + enum MatrixTypes { + Identity, + Scaling, + Translation, + Unknown + } + + enum Orientation { + Horizontal, + Vertical + } + + enum SliderType { + Default, + MinRange, + Range + } + + enum eventType { + click, + mouseDown, + mouseLeave, + mouseMove, + mouseUp + } + enum headerOption { + row, + tHead + } + + enum filterType{ + StartsWith, + Contains, + EndsWith, + LessThan, + GreaterThan, + LessThanOrEqual , + GreaterThanOrEqual, + Equal, + NotEqual + } + enum Animation{ + Fade, + None, + Slide + } + enum Type{ + Overlay, + Slide + } + enum SortOrder + { + Ascending, + Descending + } + + var globalize:globalize; + var cultures:culture; + function addCulture(name: string, culture ?: any): void; + function preferredCulture(culture ?: string): culture; + function format(value: any, format: string, culture ?: string): string; + function parseInt(value: string, radix?: any, culture ?: string): number; + function parseFloat(value: string, radix?: any, culture ?: string): number; + function parseDate(value: string, format: string, culture ?: string): Date; + function getLocalizedConstants(controlName: string, culture ?: string): any; + +interface globalize { + addCulture(name: string, culture?: any): void; + preferredCulture(culture?: string): culture; + format(value: any, format: string, culture?: string): string; + parseInt(value: string, radix?: any, culture?: string): number; + parseFloat(value: string, radix?: any, culture?: string): number; + parseDate(value: string, format: string, culture?: string): Date; + getLocalizedConstants(controlName: string, culture?: string): any; + } + interface culture { + name?: string; + englishName?: string; + namtiveName?: string; + language?: string; + isRTL: boolean; + numberFormat?: formatSettings; + calendars?: calendarsSettings; + } + interface formatSettings { + pattern: Array; + decimals: number; + groupSizes: Array; + percent: percentSettings; + currency: currencySettings; + } + interface percentSettings { + pattern: Array; + decimals: number; + groupSizes: Array; + symbol: string; + } + interface currencySettings { + pattern: Array; + decimals: number; + groupSizes: Array; + symbol: string; + } + interface calendarsSettings { + standard: standardSettings; + } + interface standardSettings { + firstDay: number; + days: daySettings; + months: monthSettings; + AM: Array; + PM: Array; + twoDigitYearMax: number; + patterns: patternSettings; + } + interface daySettings { + names: Array; + namesAbbr: Array; + namesShort: Array; + } + interface monthSettings { + names: Array; + namesAbbr: Array; + } + interface patternSettings { + d: string; + D: string; + t: string; + T: string; + f: string; + F: string; + M: string; + Y: string; + S: string; + } +} +declare module App { + +var addMetaTags: boolean; + var allowPopState: boolean; + var allowPushState: boolean; + var activePage: JQuery; + var waitingPopUp: JQuery; + var hashMonitoring: boolean; + var pageTransition: string; + var renderEJMControlByDef: boolean; + function createPage(element: JQuery): void; + function getLoaction(): string; + function initPage(): void; + function loadView(url: string): void; + function transferPage(fromPage: Object, toPage: Object, options?: any, isFromAjax?: boolean): void; + function userAgent(): void; + + var pageHistory: { + activeHistory(): string; + add(url: string, options?: PageOption): void; + clearForward(): void; + find(url: string): number; + lastHistory(): string; + nextHistory(): string; + prevHistory(): string; + makeUrlAbsolute(hashString: string): void; + } + //Pageoption type for appview page + interface PageOption { + title?: string; + href?: string; + hash?: string; + } + var route: { + convertToRelativeUrl(): void; + hasProtocol(url: string): boolean; + setPageRenderMode(element: JQuery): void; + splitUrl(url: string): any; + } +} +declare module ej.mobile { + + //Global Interface + interface windowsOption { + renderDefault?: boolean; + } + enum RenderMode{ + Auto, + IOS7, + Android, + Windows, + Flat + } + enum Theme{ + Auto, + Dark, + Light + } +class Accordion extends ej.Widget { + static fn: Accordion; + constructor(element: JQuery, options?: AccordionOptions); + model: AccordionOptions; + validTags: Array; + defaults: AccordionOptions; + collapseAll(): void; + disableItems(itemIndexes: Array): void; + enableItems(itemIndexes: Array): void; + selectItems(activeList: Array): void; + deselectItems(activeList: Array): void; + expandAll(): void; + hide(): void; + show(): void; + destroy(): void; + getItemsCount(): number; +} +//ejmAccordion Option +interface AccordionOptions { + theme?: ej.mobile.Theme; + renderMode?: ej.mobile.RenderMode; + cssClass?: string; + enableCache?: boolean; + allowMultipleOpen?: boolean; + collapsible?: boolean; + enabled?: boolean; + enableMultipleOpen?: boolean; + heightAdjustMode?: ej.mobile.Accordion.HeightAdjustMode; + windows?: windowsOption; + enablePersistence?: boolean; + selectedItems?: Array; + disabledItems?: Array; + showHeaderIcon?: boolean; + spinnerText?: string; + items?: Array; + active? (e: AccordionActiveEventArgs): void; + ajaxBeforeLoad? (e: AccordionAjaxBeforeLoadEventArgs): void; + ajaxError? (e: AccordionAjaxErrorEventArgs): void; + ajaxLoad? (e: AccordionAjaxLoadEventArgs): void; + ajaxSuccess? (e: AccordionAjaxSuccessEventArgs): void; + beforeActive? (e: AccordionBeforeActiveEventArgs): void; + destroy? (e: AccordionEventArgs): void; + create? (e: AccordionEventArgs): void; +} + +interface itemCollection { + ajaxUrl?: string; + logoClass?: string; +} +//ejmejmAccordionEvent Arugument +interface AccordionEventArgs { + cancel: boolean; + type: string; + model: AccordionOptions; +} +interface AccordionActiveEventArgs extends AccordionEventArgs { + items: string; + lastSelectedItemIndices: number; + selectedItemIndices: number; +} +interface AccordionAjaxBeforeLoadEventArgs extends AccordionEventArgs { + url: string; +} +interface AccordionAjaxErrorEventArgs extends AccordionEventArgs { + title: string; + data: Object; + url: string; +} +interface AccordionAjaxLoadEventArgs extends AccordionEventArgs { +} +interface AccordionAjaxSuccessEventArgs extends AccordionEventArgs { + content: Object; + data: Object; + url: string; +} +interface AccordionBeforeActiveEventArgs extends AccordionEventArgs { + activeItemIndex?: number; +} +export module Accordion { + enum HeightAdjustMode { + Content, + Auto, + Fill + } +} +class Autocomplete extends ej.Widget { + static fn: Autocomplete; + element: JQuery; + constructor(element: JQuery, options?: AutocompleteOptions); + model: AutocompleteOptions; + defaults: AutocompleteOptions; + disable(): void; + enable(): void; + destroy(): void; + clearText(): void; + getSelectedItems(): Array; + getValue(): string; + +} +interface AutocompleteOptions { + allowScrolling?: boolean; + filterType?: ej.mobile.Autocomplete.FilterType; + caseSensitiveSearch?: boolean; + cssClass?: string; + enableAutoFill?: boolean; + delimiterChar?: string; + enableMultiSelect?: boolean; + enableCheckbox?: boolean; + dataSource?: any; + filterMode?: string; + itemsCount?: string|number; + templateId?: string; + fields?: fieldOptions; + imageField?: string; + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + mapper?: string; + watermarkText?: string; + imageClass?: string; + allowSorting?: boolean; + value?: string; + sortOrder?: ej.mobile.Autocomplete.SortOrder; + emptyResultText?: string; + showEmptyResultText?: boolean; + minCharacter?: number; + enableDistinct?: boolean; + enablePersistence?: boolean; + enabled?: boolean; + mode?: ej.mobile.Autocomplete.Mode; + selectedKeys?: string; + windows?: windowsOption; + touchEnd? (e: AutocompleteTouchEndEventArgs): void; + keyPress? (e: AutocompleteKeyPressEventArgs): void; + select? (e: AutocompleteSelectEventArgs): void; + change? (e: AutocompleteChangeEventArgs): void; + focusIn? (e: AutocompleteFocusInEventArgs): void; + focusOut? (e: AutocompleteFocusOutEventArgs): void; + destroy? (e: AutocompleteEventArgs): void; + create? (e: AutocompleteEventArgs): void; +} +interface fieldOptions { + text?: string; + key?: string; +} +interface AutocompleteEventArgs { + cancel: boolean; + model: AutocompleteOptions; + type: string; +} +interface AutocompleteTouchEndEventArgs extends AutocompleteEventArgs { + text: string; + isChecked: boolean; + checkedItemsText: Object; + value: string; +} +interface AutocompleteKeyPressEventArgs extends AutocompleteEventArgs { + value: string; +} +interface AutocompleteSelectEventArgs extends AutocompleteEventArgs { + text: string; + isChecked: boolean; + checkedItemsText: Object; + value: string; +} +interface AutocompleteChangeEventArgs extends AutocompleteEventArgs { + text: string; + isChecked: boolean; + checkedItemsText: Object; + value: string; +} +interface AutocompleteFocusInEventArgs extends AutocompleteEventArgs { + value: string; +} +interface AutocompleteFocusOutEventArgs extends AutocompleteEventArgs { + value: string; +} +export module Autocomplete { + enum FilterType { + StartsWith, + Contains + } + enum Mode { + Search, + Default + } + enum SortOrder { + Ascending, + Descending + } +} +class Button extends ej.Widget { + static fn: Button; + element: JQuery; + constructor(element: JQuery, options?: ButtonOptions); + model: ButtonOptions; + validTags: Array; + defaults: ButtonOptions; + disable(): void; + enable(): void; +} +class Actionlink extends ej.Widget { + static fn: Actionlink; + element: JQuery; + constructor(element: Element, options?: ButtonOptions); + model: Object; + validTags: Array; + defaults: ButtonOptions; + disable(): void; + enable(): void; +} +interface ButtonOptions { + touchStart?(e: ButtonEventArgs): void; + touchEnd?(e: ButtonEventArgs): void; + cssClass?: string; + enabled?: (boolean | string); + inline?: (boolean | string); + renderMode?: (ej.mobile.RenderMode | string); + text?: string; + theme?: (ej.mobile.Theme | string); + imageClass?: string; + imagePosition?: (ej.mobile.Button.ImagePosition | string); + contentType?: (ej.mobile.Button.ContentType | string); + ios7?: ios7ButtonOptions; + android?: androidButtonOption; + windows?: windowsButtonOptions; + flat?: flatButtonOption; +} +interface ButtonEventArgs { + element: Object; + text: string; +} +interface ios7ButtonOptions { + style?: (ej.mobile.Button.IOS7.Style | string); + color?: (ej.mobile.Button.IOS7.Color | string); +} +interface androidButtonOption { + style?: (ej.mobile.Button.Android.Style | string); +} +interface windowsButtonOptions extends windowsOption { + style?: (ej.mobile.Button.Windows.Style | string); +} +interface flatButtonOption { + style?: (ej.mobile.Button.Flat.Style | string); +} +export module Button{ +export module IOS7{ + enum Style{ + Normal, + Back, + Header, + Dialog + } + enum Color{ + Gray, + Black, + Blue, + Green, + Red + } + } +export module Android{ + enum Style{ + Normal, + Small, + Dialog + } + +} +export module Windows{ + enum Style{ + Normal, + Back + } +} +export module Flat{ + enum Style{ + Normal, + Back, + Header + } +} + enum ImagePosition{ + Left, + Right + } + enum ContentType{ + Text, + Image, + Both + } +} +class DatePicker extends ej.Widget { + static fn: DatePicker; + static Locale:any; + element: JQuery; + constructor(element: JQuery, options?: DatePickerOptions); + model: DatePickerOptions; + defaults: DatePickerOptions; + disable(): void; + enable(): void; + hide(): void; + show(): void; + setCurrentDate(date:string): void; + getValue(): string; + destroy(): void; +} + +//ejmDatePicker Options +interface DatePickerOptions { + cssClass?: string; + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + culture?: string; + dateFormat?: string; + value?: string; + enabled?: boolean; + enablePersistence?: boolean; + ios7?: ios7Option; + windows?: windowsOption; + maxDate?: string; + minDate?: string; + load? (e: DatePickerEventArgs): void; + select? (e: DatePickerEventArgs): void; + focusIn? (e: DatePickerEventArgs): void; + focusOut? (e: DatePickerEventArgs): void; + open? (e: DatePickerEventArgs): void; + close? (e: DatePickerEventArgs): void; + change? (e: DatePickerEventArgs): void; + destroy? (e: DatePickerArgs): void; + create? (e: DatePickerArgs): void; +} + +interface DatePickerArgs { + type: string; + model: DatePickerOptions; + value: string; +} +//ejmDatePickerEvent Arugument +interface DatePickerEventArgs extends DatePickerArgs { + cancel: boolean; + +} + +interface ios7Option { + renderDefault: boolean; +} + + +//Class ejmDropDownList +class DropDownList extends ej.Widget { + static fn: DropDownList; + constructor(element: JQuery, options?: DropDownListOptions); + model: DropDownListOptions; + defaults: DropDownListOptions; + show(): void; + hide(): void; + getValue():string; + selectItemByIndex(index:(number|string)): void; + unselectItemByIndex(index:(number|string)): void; + selectItemByIndices(indices:Array): void; + unselectItemByIndices(indices: Array): void; + destroy(): void; + getSelectedItemsValue(): Array; + getSelectedItemValue(): string; +} + +//ejmDropDownList WindowsOption +interface windowsDropDownListOption extends windowsOption { + type?: ej.mobile.DropDownList.WindowsType; +} + +interface androidDropDownListOption { + popUpHeight?: number|string; +} + +interface fieldsDropDownListOption { + text?: string; + groupBy?: string; + imageClass?: string; + imageUrl?: string; + checkBy?: string; + enableTemplate?: string; + templateID?: string; + value?: string; +} + +//ejmDropDownList Option +interface DropDownListOptions { + theme?: ej.mobile.Theme; + renderMode?: ej.mobile.RenderMode; + cssClass?: string; + readOnly?: boolean; + targetID?: string; + selectedItemIndex?: number|string; + dataSource?: any; + fields?: fieldsDropDownListOption; + query?: string; + allowVirtualScrolling?: boolean; + virtualScrollMode?: ej.mobile.DropDownList.VirtualScrollingMode; + itemRequestCount?: number|string; + enabled?: boolean; + enableMultiSelect?: boolean; + delimiterChar?: string; + enableGrouping?: boolean; + mode?: ej.mobile.DropDownList.Mode; + enableTemplate?: boolean; + enablePersistence?: boolean; + windows?: windowsDropDownListOption; + android?: androidDropDownListOption; + items?: Array; + focusIn? (e: DropDownArgs): void; + focusOut? (e: DropDownArgs): void; + select? (e: DropDownSelectArgs): void; + change? (e: DropDownSelectArgs): void; + checkChange? (e: DropDownListEventArgs): void; +} + +interface DropDownArgs { + cancel: boolean; + type: string; + model: DropDownListOptions; +} +//ejmDropDownListEvent Arugument +interface DropDownListEventArgs extends DropDownArgs { + checked: boolean; +} + +interface DropDownSelectArgs extends DropDownArgs { + selectedText: string; + value: string; + selectedItem: Object; +} + +export module DropDownList{ + enum VirtualScrollingMode{ + Continuous, + Normal + } + enum WindowsType{ + ComboBox, + List + } + enum Mode { + Normal, + Native + } +} + +class Numeric extends ej.Widget { + static fn: Numeric; + element: JQuery; + constructor(element: JQuery, options?: EditorOptions); + model: EditorOptions; + ValidTags: Array; + defaults: EditorOptions; + disable(): void; + enable(): void; + getValue(): any; + setValue(value:number): void; + +} + +interface EditorOptions { + cssClass?: string; + enableStrictMode?: boolean; + enabled?: boolean; + showBorder?: boolean; + showSpinButton?: boolean; + incrementStep?: number; + maxValue?: number; + minValue?: number; + name?: string; + enablePersistence?: boolean; + readOnly?: boolean; + renderMode?: ej.mobile.RenderMode; + decimalPlaces?: number; + theme?: ej.mobile.Theme; + value?: number; + watermarkText?: string; + windows?: windowsOption; + change? (e: EditorEventArgs): void; + focusIn? (e: EditorEventArgs): void; + focusOut? (e: EditorEventArgs): void; + destroy?(e:EditorBaseArgs):void; + create?(e:EditorBaseArgs):void; +} + +interface EditorBaseArgs{ + cancel: boolean; + type: string; + model: EditorOptions; +} + +interface EditorEventArgs extends EditorBaseArgs { + value: number; + element: Object; +} + + +class Grid extends ej.Widget { + static fn: Grid; + element: JQuery; + constructor(element: JQuery, options?: GridOptions); + model: GridOptions; + validTags: Array; + defaults: GridOptions; + disable(): void; + enable(): void; + destroy(): void; + getColumnByField(field:string): void; + getColumnByHeaderText(headerText:string): void; + getColumnByIndex(index:number): void; + getColumnFieldNames(): void; + getColumnIndexByField(field:string): void; + getColumnMemberByIndex(colIdx:number): void; + hideColumns(col:string): void; + refreshContent(requestType:string): void; + showColumns(col:string): void; +} +interface GridOptions { + cssClass?: string; + allowPaging?: boolean; + allowSorting?: boolean; + allowFiltering?: boolean; + allowScrolling?: boolean; + allowSelection?: boolean; + dataSource: any; + caption?: string; + enablePersistence?: boolean; + selectedRowIndex?: number; + showCaption?: boolean; + allowColumnSelector?: boolean; + transition?: string; + columns?: Array; + theme?: ej.mobile.Theme; + renderMode?: ej.mobile.RenderMode; + rowSelecting? (e: GridEventArgs): void; + rowSelected? (e: GridEventArgs): void; + actionBegin? (e: GridEventArgs): void; + actionComplete? (e: GridEventArgs): void; + actionSuccess? (e: GridEventArgs): void; + actionFailure? (e: GridEventArgs): void; + queryCellInfo? (e: GridEventArgs): void; + rowDataBound? (e: GridEventArgs): void; + modelChange? (e: GridEventArgs): void; + load? (e: GridEventArgs): void; + pageSettings?: PageSettings; + scrollSettings?: ScrollSettings; + sortSettings?: SortSettings; + filterSettings?: FilterSettings; +} + +interface PageSettings { + pageSize?: number; + currentPage?: number; + display?: ej.mobile.Grid.PagerDisplay; + type?: ej.mobile.Grid.PagerType; + totalRecordsCount?: number; +} +interface ScrollSettings { + enableColumnScrolling?: boolean; + height?: any; + width?: any; + enableRowScrolling?: boolean; + enableNativeScrolling?: boolean; +} +interface SortSettings { + allowMultiSorting?: boolean; + sortedColumns?: Array; +} +interface FilterSettings { + isCaseSensitive?: boolean; + filterBarMode?: ej.mobile.Grid.FilterBarMode; + interval?: number; + filteredColumns?: Array; +} + +//ejmGridEvent Arugument +interface GridEventArgs { + cancel: boolean; + type: string; + model: GridOptions; +} + +export module Grid +{ +enum PagerDisplay +{ +Normal, +Fixed +} + +enum PagerType +{ +Normal, +Scrollable +} + +enum FilterBarMode +{ +Immediate, +OnEnter +} +enum Actions +{ +Paging, +Sorting, +Filtering, +Refresh +} +} +class Header extends ej.Widget { + static fn: Header; + element: JQuery; + constructor(element: JQuery, options?: HeaderOptions); + model: HeaderOptions; + defaults: HeaderOptions; + getTitle(): string; + destroy(): void; +} + +interface HeaderOptions { + hideForUnSupportedDevice?: boolean; + leftButtonNavigationUrl?: string; + leftButtonImageClass: string; + leftButtonImageUrl: string; + rightButtonNavigationUrl?: string; + rightButtonImageClass?:string; + rightButtonImageUrl?:string; + cssClass?: string; + title?: string; + showTitle?: boolean; + position?: ej.mobile.Header.Position; + leftButtonCaption?: string; + rightButtonCaption?: string; + leftButtonStyle?:ej.mobile.Header.HeaderLeftButtonStyle; + rightButtonStyle?:ej.mobile.Header.HeaderRightButtonStyle; + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + showLeftButton?: boolean; + showRightButton?: boolean; + enablePersistence?:boolean; + templateId?: string; + ios7?: Headerios7Options; + flat?: HeaderFlatOptions; + windows?: HeaderWindowsOptions; + android?: HeaderAndroidOptions; + leftButtonTap? (e: HeaderLeftButtonTapEventArgs): void; + rightButtonTap? (e: HeaderRightButtonTapEventArgs): void; + destroy?(e:HeaderBaseArgs):void; + create?(e:HeaderBaseArgs):void; +} +interface HeaderWindowsOptions extends windowsOption { + enableCustomText?: boolean; + renderDefault?: boolean; + rightButtonStyle?: ej.mobile.Header.Windows.HeaderRightButtonStyle; + leftButtonStyle?: ej.mobile.Header.Windows.HeaderLeftButtonStyle; + showLeftButton?: boolean; + showRightButton?: boolean; +} +interface HeaderAndroidOptions { + backButtonImageClass?: string; + rightButtonStyle?: ej.mobile.Header.Android.HeaderRightButtonStyle; + leftButtonStyle?: ej.mobile.Header.Android.HeaderLeftButtonStyle; + showLeftButton?: boolean; + showRightButton?: boolean; +} +interface Headerios7Options { + rightButtonStyle?: ej.mobile.Header.IOS7.HeaderRightButtonStyle; + leftButtonStyle?: ej.mobile.Header.IOS7.HeaderLeftButtonStyle; + showLeftButton?: boolean; + showRightButton?: boolean; +} +interface HeaderFlatOptions { + rightButtonStyle?: ej.mobile.Header.Flat.HeaderRightButtonStyle; + leftButtonStyle?: ej.mobile.Header.Flat.HeaderLeftButtonStyle; + showLeftButton?: boolean; + showRightButton?: boolean; +} + +interface HeaderBaseArgs{ + cancel: boolean; + type: string; + model: FooterOptions; +} +interface HeaderLeftButtonTapEventArgs { + text: string; + cancel: boolean; + model: Object; + type: string; + status: boolean; +} +interface HeaderRightButtonTapEventArgs { + text: string; + cancel: boolean; + model: Object; + type: string; + status: boolean; +} + +export module Header +{ +enum Position +{ + Normal, + Fixed +} +enum HeaderLeftButtonStyle +{ + Back, + Header, + Normal + +} +enum HeaderRightButtonStyle +{ + Header, + Normal +} + +export module IOS7 +{ +enum HeaderLeftButtonStyle +{ + Auto, + Back, + Header, + Normal +} +enum HeaderRightButtonStyle +{ + Auto, + Header, + Normal +} +} + +export module Flat +{ +enum HeaderLeftButtonStyle +{ + Auto, + Back, + Normal, + Header +} +enum HeaderRightButtonStyle +{ + Auto, + Header, + Normal +} +} + +export module Android +{ +enum HeaderLeftButtonStyle +{ + Auto, + Back, + Normal, + Header +} +enum HeaderRightButtonStyle +{ + Auto, + Normal, + Header +} +} + +export module Windows +{ +enum HeaderLeftButtonStyle +{ + Auto, + Back, + Normal, + Header +} +enum HeaderRightButtonStyle +{ + Auto, + Normal, + Header +} +} +} + + + +/* ListView - Start*/ +interface ajaxSettingsOptions { + type?: string; + cache?: boolean; + async?: boolean; + dataType?: string; + contentType?: string; + url?: string; + data?: Array; +} +//Class ejmListView +class ListView extends ej.Widget { + static fn: ListView; + constructor(element: JQuery, options?: ListViewOptions); + model: ListViewOptions; + defaults: ListViewOptions; + addItem(list?:Object, index?:number,groupid?:any): void; + checkAllItem(): void; + checkItem(index:number,childId?:any): void; + deActive(index:number,childId?:any): void; + disableItem(index:number,childId?:any): void; + enableItem(index:number,childId?:any): void; + getActiveItem(): void; + getActiveItemText(): void; + getCheckedItems(): void; + getCheckedItemsText(): void; + getItemsCount(): void; + getItemText(index:number,childId?:any): void; + hasChild(index:number,childId?:any): boolean; + hide(): void; + hideItem(index:number,childId?:any): void; + isChecked(index:number,childId?:any): boolean; + loadAjaxContent(): void; + removeCheckMark(index:number,childId?:any): void; + removeItem(index:number,childId?:any): void; + selectItem(index:number,childId?:any): void; + setActive(index:number,childId?:any): void; + show(): void; + showItem(index:number,childId?:any): void; + unCheckAllItem(): void; + unCheckItem(index: number, childId?: any): void; + clear(): void; + append(data: Object): void; + getActiveItemData(): void; + getSelectedItemValue(): void; + getSelectedItemsValue(): void; + destroy(): void; +} +//ejmListView IOS7Option +interface Ios7Option { + inline?: boolean; +} +//ejmListView IOS7Option +interface windowsListViewOption extends windowsOption { + preventSkew?: boolean; + enableHeaderCustomText?: boolean; +} + +//ejmListView Option +interface ListViewOptions { + theme?: ej.mobile.Theme; + renderMode?: ej.mobile.RenderMode; + enablePullToRefresh?: boolean; + refreshThreshold?: number; + pullToRefreshSettings?: pullToRefreshSettings; + mode?: ej.mobile.ListView.Mode + cssClass?: string; + ios7?: Ios7Option; + windows?: windowsListViewOption; + adjustFixedPosition?: boolean; + ajaxSettings?: ajaxSettingsOptions; + enableCache?: boolean; + allowScrolling?: boolean; + checkDOMChanges?: boolean; + dataBinding?: boolean; + dataSource?: any; + enableAjax?: boolean; + enableCheckMark?: boolean; + enableFiltering?: boolean; + showHeader?: boolean; + showHeaderBackButton?: boolean; + enableNativeScrolling?: boolean; + showScrollbars?: boolean; + fieldSettings?: fieldSettings; + enableGroupList?: boolean; + headerBackButtonText?: string; + hideHeaderForUnSupportedDevice?: boolean; + headerTitle?: string; + height?: number; + persistSelection?: boolean; + preventSelection?: boolean; + query?: string; + renderTemplate?: boolean; + selectedItemIndex?: number; + autoAdjustHeight?: boolean; + autoAdjustScrollHeight?: boolean; + templateId?: string; + transition?: string; + width?: number; + items?: Array; + enablePersistence?: boolean; + create? (e: ListViewBaseEventArgs): void; + destroy? (e: ListViewBaseEventArgs): void; + ajaxComplete? (e: ListViewEventArgs): void; + ajaxError? (e: ListViewEventArgs): void; + ajaxSuccess? (e: ListViewEventArgs): void; + headerBackButtonTap? (e: ListViewEventArgs): void; + load? (e: ListViewBaseEventArgs): void; + loadComplete? (e: ListViewBaseEventArgs): void; + touchEnd? (e: ListViewEventArgs): void; + touchStart? (e: ListViewEventArgs): void; + refreshBegin? (e: ListViewBaseEventArgs): void; + refreshSuccess? (e: ListViewEventArgs): void; + refreshError? (e: ListViewBaseEventArgs): void; + refreshComplete? (e: ListViewBaseEventArgs): void; + ajaxBeforeLoad? (e: ListViewEventArgs): void; +} +interface pullToRefreshSettings{ + pullText?:string; + releaseText?:string; + refreshText?:string; + errorText?:string; + appendData?:boolean; + appendPosition?:ej.mobile.ListView.AppendPosition; +} +interface fieldSettings{ + navigateUrl?:string; + href?:string; + enableAjax?:string; + preventSelection?:string; + persistSelection?:string; + text?:string; + enableCheckMark?:string; + checked?:string; + primaryKey?:string; + parentPrimaryKey?:string; + imageClass?:string; + imageUrl?:string; + childHeaderTitle?:string; + childId?:string; + childHeaderBackButtonText?:string; + renderTemplate?:string; + templateId?:string; + touchStart?:string; + touchEnd?:string; + attributes?:string; + groupID?:string; + id?:string; + value?: string; +} +//ejmListViewEvent Arugument +interface ListViewBaseEventArgs { + cancel: boolean; + type: string; + model: ListViewOptions; +} +interface ListViewEventArgs extends ListViewBaseEventArgs { + ajaxData?: Object; + data?: Object; + errorData?: Object; + successData?: Object; + text?: string; + element?: Object; + id?: string; + hasChild?: boolean; + currentItem?: string; + currentText?: string; + currentItemIndex?: number; + isChecked?: boolean; + checkedItems?: number; + checkedItemsText?: string; +} +export module ListView{ + enum AppendPosition{ + Bottom, + Top + } + enum Mode { + Page, + Container + } +} + +class Menu extends ej.Widget { + static fn: Menu; + element: JQuery; + constructor(element: JQuery, options?: MenuOptions); + model: MenuOptions; + defaults: MenuOptions; + addItem(menu: any, index: number): void; + disable(): void; + disableItem(index: number): void; + disableOverFlow(): void; + disableOverFlowItem(index: number): void; + enable(): void; + enableItem(index: number): void; + enableOverFlow(): void; + enableOverFlowItem(index: number): void; + hide(): void; + removeItem(index: number): void; + show(e: any, existing?: boolean): void; + destroy(): void; +} +//ejmMenu Option +interface MenuOptions { + theme?: ej.mobile.Theme; + renderMode?: ej.mobile.RenderMode; + cssClass?: string; + allowScrolling?: boolean; + showScrollbars?: boolean; + height?: (number|string); + renderTemplate?: boolean; + showOn?: ej.mobile.Menu.ShowOn; + targetId?: string; + target?: any; + enablePersistence?: boolean; + templateId?: string; + width?: (number|string); + items?: Array; + android?: AndroidOptions; + ios7?: Ios7Options; + windows?: WindowsOptions; + hide? (e: MenuEvent): void; + load? (e: MenuEvent): void; + loadComplete? (e: MenuEvent): void; + show? (e: MenuEvent): void; + touchStart? (e: MenuTouchEventArgs): void; + touchEnd? (e: MenuTouchEventArgs): void; + create? (e: MenuEvent): void; + destroy? (e: MenuEvent): void; +} +//ejmMenu IOS7 Option +interface Ios7Options { + cancelButtonColor?: ej.mobile.Menu.IOS7.CancelButtonColor; + cancelButtonText?: string; + cancelButtonTouchEnd? (e: MenuCancelButtonTouchEndEventArgs): void; + type?: ej.mobile.Menu.IOS7.Type; + title?: string; + showTitle?: boolean; + showCancelButton?: boolean; +} + +//ejmMenu Android Option +interface AndroidOptions { + type?: ej.mobile.Menu.Android.Type; +} +interface WindowsOptions { + type?: ej.mobile.Menu.Windows.Type; + renderDefault?: boolean; +} +//ejmMenu Event Arugument +interface MenuEvent { + cancel: boolean; + type: string; + model: MenuOptions; +} +interface MenuTouchEventArgs { + item: Object; + text: string; +} +interface MenuCancelButtonTouchEndEventArgs extends MenuEvent { + item: Object; + text: string; +} + +export module Menu { + export module IOS7 { + enum Type { + Auto, + Animate, + Normal + } + enum CancelButtonColor { + Blue, + Gray, + Black, + Green, + Red + } + } + + export module Android { + enum Type { + Contextual, + Popup, + OptionsList, + OptionsMenu + } + } + export module Windows { + enum Type { + Contextual, + Popup + } + } + enum ShowOn { + Tap, + TapHold + } +} + + + +//Class ejmProgress +class Progress extends ej.Widget { + static fn: Progress; + element: JQuery; + constructor(element: JQuery, options?: ProgressOptions); + model: ProgressOptions; + defaults: ProgressOptions; + getValue(): number; + getPercentage(): number; + setCustomText(text: string): void; + destroy(): void; +} + +//ejmProgressbar Option +interface ProgressOptions { + theme?: ej.mobile.Theme; + renderMode?: ej.mobile.RenderMode; + enableCustomText?: boolean; + enabled?: boolean; + height?: number; + incrementStep?: number; + maxValue?: number; + minValue?: number; + orientation?: ej.mobile.Progress.Orientation; + percentage?: number; + enablePersistence?: boolean; + text?: string; + value?: number; + width?: number; + create? (e: ProgressEvent): void; + destroy? (e: ProgressEvent): void; + start? (e: ProgressStartEventArgs): void; + change? (e: ProgressChangeEvent): void; + complete? (e: ProgressCompleteEvent): void; +} +//ejmProgressbarEvent Arugument +interface ProgressEvent { + cancel: boolean; + type: string; + model: ProgressOptions; +} +interface ProgressStartEventArgs extends ProgressEvent { + value: number; + percentage: number; +} +interface ProgressChangeEvent extends ProgressEvent { + value: number; + element: Object; + text: string; + percentage: number; +} +interface ProgressCompleteEvent extends ProgressEvent { + value: number; + text: string; + percentage: number; +} +export module Progress { + enum Orientation { + Horizontal, + Vertical + } +} + +//Class ejmRadioButton +class RadioButton extends ej.Widget { + static fn: RadioButton; + element: JQuery; + constructor(element: JQuery, options?: RadioButtonOptions); + model: RadioButtonOptions; + defaults: RadioButtonOptions; + destroy(): void; + enable(): void; + disable(): void; +} + +//ejmRadioButton Options +interface RadioButtonOptions { + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + cssClass?: string; + checked?: boolean; + text?: string; + enabled?: boolean; + enablePersistence?: boolean; + create? (e: RadioButtonBaseEventArgs): void; + destroy? (e: RadioButtonBaseEventArgs): void; + touchStart? (e: RadioButtonEventArgs): void; + touchEnd? (e: RadioButtonEventArgs): void; + change? (e: RadioButtonEventArgs): void; +} +//ejmRadioButtonEvent Arugument +interface RadioButtonBaseEventArgs { + model: RadioButtonOptions; + cancel: boolean; + type: string; +} +interface RadioButtonEventArgs extends RadioButtonBaseEventArgs { + value: string; + isChecked: boolean; +} + class Rating extends ej.Widget { + static fn: Rating; + element: JQuery; + constructor(element?: JQuery, options?: RatingOptions); + model: RatingOptions; + defaults: RatingOptions; + show(): void; + hide(): void; + getValue(): void + reset(): void; + enable(): void; + disable(): void; + setValue(value: number): void; + destroy(): void; + } + + interface RatingOptions { + maxValue?: number; + minValue?: number; + value?: number; + incrementStep?: number; + precision?: ej.mobile.Rating.Precision; + enabled?: boolean; + theme?: ej.mobile.Theme; + renderMode?: ej.mobile.RenderMode; + shape?: ej.mobile.Rating.Shape; + shapeWidth?: number; + shapeHeight?: number; + spaceBetweenShapes?: number; + orientation?: ej.mobile.Rating.Orientation; + readOnly?: boolean; + backgroundColor?: any; + selectionColor?: any; + borderColor?: any; + hoverColor?: any; + enablePersistence?: boolean; + create? (e: RatingBaseEventArgs): void; + destroy? (e: RatingBaseEventArgs): void; + tap? (e: RatingEventArgs): void; + change? (e: RatingEventArgs): void; + touchMove? (e: RatingEventArgs): void; + } + interface RatingBaseEventArgs { + cancel: boolean; + type: string; + model: RatingOptions; + } + interface RatingEventArgs extends RatingBaseEventArgs { + value: number; + } +export module Rating{ + enum Precision{ + Full, + Exact, + Half + } + enum Shape{ + Star, + Circle, + Diamond, + Heart, + Pentagon, + Square, + Triangle + } + enum Orientation{ + Horizontal, + Vertical + } + +} + class Rotator extends ej.Widget { + static fn: Rotator; + element: JQuery; + constructor(element: JQuery, options?: RotatorOptions); + model: RotatorOptions; + validTags: Array; + defaults: RotatorOptions; + renderDatasource(data: any): void; + destroy(): void; + } + interface RotatorOptions { + create? (e: RotatorBaseEventArgs): void; + destroy? (e: RotatorBaseEventArgs): void; + swipeLeft? (e: RotatorEventArgs): void; + swipeRight? (e: RotatorEventArgs): void; + swipeUp? (e: RotatorEventArgs): void; + swipeDown? (e: RotatorEventArgs): void; + change? (e: RotatorEventArgs): void; + pagerSelect? (e: RotatorEventArgs): void; + adjustFixedPosition?: boolean; + targetId?: string; + cssClass?:string; + windows?:windowsOption; + items?:Array; + renderMode?: ej.mobile.RenderMode; + targetHeight?: (number|string); + targetWidth?: (number|string); + enablePersistence?:boolean; + theme?: ej.mobile.Theme; + currentItemIndex?: number; + showPager?: boolean; + showHeader?: boolean; + headerTitle?: string; + dataBinding?: boolean; + dataSource?: any; + orientation?: ej.mobile.Rotator.Orientation; + pagerPosition?: PagerPosition; + } + interface PagerPosition { + horizontal?: ej.mobile.Rotator.PagerPositionHorizontal; + vertical?: ej.mobile.Rotator.PagerPositionVertical; + } + interface RotatorBaseEventArgs { + cancel: boolean; + model: RotatorOptions; + type: string; + } + interface RotatorEventArgs extends RotatorBaseEventArgs { + targetElement: Object; + element: number; + } +export module Rotator{ + enum Orientation{ + Horizontal, + Vertical + } + enum PagerPositionHorizontal{ + Bottom, + Top, + } + enum PagerPositionVertical{ + Right, + Left + } + +} + class Slider extends ej.Widget { + static fn: Slider; + element: JQuery; + constructor(element: JQuery, options?: SliderOptions); + model: SliderOptions; + defaults: SliderOptions; + getValue(): void; + dispose(): void; + destroy(): void; + } + //ejmSlider Option + interface SliderOptions { + theme?: ej.mobile.Theme; + renderMode?: ej.mobile.RenderMode; + minValue?: number; + maxValue?: number; + value?: number; + values?: Array; + orientation?: ej.mobile.Slider.Orientation; + enableRange?: boolean; + readOnly?: boolean; + incrementStep?: number; + enablePersistence?: boolean; + enabled?: boolean; + enableAnimation?: boolean; + animationSpeed?: number; + ios7?: Ios7Option; + windows?: windowsOption; + create? (e: SliderBaseEventArgs): void; + destroy? (e: SliderBaseEventArgs): void; + touchStart? (e: SliderEventArgs): void; + touchEnd? (e: SliderEventArgs): void; + load? (e: SliderEventArgs): void; + change? (e: SliderEventArgs): void; + slide? (e: SliderEventArgs): void; + } + + //ejmSlider IOS7 Option + interface Ios7Option { + thumbStyle?: ej.mobile.Slider.ThumbStyle; + } + //ejmSlider Slide Event Arugument + interface SliderBaseEventArgs { + cancel: boolean; + model: SliderOptions; + type: string; + } + interface SliderEventArgs extends SliderBaseEventArgs { + value?: number; + values?: Array; + } +export module Slider{ + enum Orientation{ + Horizontal, + Vertical + } + enum ThumbStyle{ + Normal, + Small + + } + +} +class Tab extends ej.Widget { + static fn: Tab; + constructor(element: JQuery, options?: TabOptions); + model:TabOptions; + defaults: TabOptions; + showBadge(index: (number|string)): void; + hideBadge(index: (number|string)): void; + updateBadgeValue(index: (number|string), value: (number|string)): void; + selectItem(index?: (number|string)): void; + enableItem(index?: (number|string)): void; + disableItem(index?: (number|string)): void; + enableContent(index?: (number|string)): void; + disableContent(index?: (number|string)): void; + addItem(tab: Object, index: (number|string)): void; + addOverflowItem(tab: Object, index: (number|string)): void; + removeItem(index: (number|string)): void; + removeOverflowItem(index: (number|string)): void; + getItemsCount(): number; + getOverflowItemCount(): number; + getActiveItemText(): string; + getActiveItem(): Object; + destroy(): void; +} + +interface TabOptions { + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + cssClass?: string; + allowScrolling?: boolean; + enableNativeScrolling?: boolean; + showScrollbars?: boolean; + enableAjax?: boolean; + showAjaxPopup?: boolean; + badge?: badgeTabOptions; + ios7?: ios7TabOptions; + enableCache?: boolean; + selectedItemIndex?: (number|string); + enabled?: boolean; + enablePersistence?: boolean; + prefetchAjaxContent?: boolean; + items?: Array; + overflowBadge?: overflowBadgeTabOptions; + android?: androidTabOptions; + windows?: windowsTabOptions; + flat?: flatTabOptions; + ajaxSettings?: ajaxSettingsTabOptions; + prefetchContentLoaded? (e: TabPrefetchEventArgs): void; + load? (e: TabEventArgs): void; + loadComplete? (e: TabLoadCompleteEventArgs): void; + touchStart? (e: TabEventArgs): void; + touchEnd? (e: TabEventArgs): void; + ajaxSuccess? (e: TabAjaxLoadSuccessEventArgs): void; + ajaxError? (e: TabAjaxLoadErrorEventArgs): void; + ajaxComplete? (e: TabEventArgs): void; + create? (e: TabEventArgs): void; + destroy? (e: TabEventArgs): void; + ajaxBeforeLoad? (e: TabAjaxBeforeLoadEventArgs): void; +} + +interface TabItemOptions { + text?: string; + href?: string; + enableAjax?: boolean; + badge?: badgeTabOptions; + touchStart? (e: TabEventArgs): void; + touchEnd? (e: TabEventArgs): void; + ios7?: ios7TabOptions; + android?: ios7TabOptions; +} + +interface TabEventArgs { + cancel: boolean; + type: string; + model: TabOptions; +} +interface TabAjaxBeforeLoadEventArgs extends TabEventArgs { + content?: any; + item?: any; + index?: number; + text?: string; + url?: string; +} +interface TabLoadCompleteEventArgs extends TabEventArgs { + element: Object; + id: string; +} +interface TabPrefetchEventArgs extends TabEventArgs { + item: Object; + content: string; + text: string; + url: string; + index: number; +} +interface TabAjaxLoadSuccessEventArgs extends TabEventArgs { + element: Object; + currentContent: string; +} + +interface TabAjaxLoadErrorEventArgs extends TabEventArgs { + status: boolean; + error: string; +} +interface badgeTabOptions { + enabled?: boolean; + value?: (number|string); + maxValue?: (number|string); + minValue?: (number|string); +} +interface ios7TabOptions { + imageClass?: string; +} +interface overflowBadgeTabOptions { + enabled?: boolean; + value?: (number|string); + maxValue?: (number|string); + minValue?: (number|string); +} +interface androidTabOptions { + contentType?: ej.mobile.Tab.Android.ContentType; + imageClass?: string; + position?: ej.mobile.Tab.Position; +} +interface windowsTabOptions extends windowsOption { + enableCustomText?: boolean; + position?: ej.mobile.Tab.Position; + enableTouchMove?: boolean; + preventContentSwipe?: boolean; +} +interface flatTabOptions { + position?: ej.mobile.Tab.Position; +} +interface ajaxSettingsTabOptions { + type?: string; + cache?: boolean; + async?: boolean; + dataType?: string; + contentType?: string; + url?: string; + data?: {}; +} + +export module Tab{ +export module Android{ +enum ContentType{ +Text, +Image, +Both +} +} +enum Position{ +Fixed, +Normal +} +} + +class Tile extends ej.Widget { + static fn: Tile; + constructor(element: JQuery, options?: TileOptions); + model: TileOptions; + defaults: TileOptions; + updateTemplate(id: string, index: (number|string)): void; + destroy(): void; +} + +interface TileOptions { + android?: androidTileOptions; + badge?: tileBadgeOptions; + cssClass?: string; + captionTemplateId?: string; + enablePersistence?: boolean; + imageClass?: string; + imagePath?: string; + imagePosition?: ej.mobile.Tile.ImagePosition; + imageTemplateId?: string; + imageUrl?: string; + backgroundColor?: string; + ios7?: ios7TileOptions; + liveTile?: liveTileOptions; + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + showText?: boolean; + text?: string; + textAlignment?: ej.mobile.Tile.TextAlignment; + tileSize?: ej.mobile.Tile.TileSize; + width?: (number|string); + height?: (number|string); + touchEnd? (e: tileTouchEventArgs): void; + touchStart? (e: tileTouchEventArgs): void; + create? (e: TileEventArgs): void; + destroy? (e: TileEventArgs): void; +} +interface TileEventArgs { + cancel?: boolean; + model?: TileOptions; + type?: string; +} +interface tileBadgeOptions { + enabled?: boolean; + value?: (number|string); + maxValue?: (number|string); + minValue?: (number|string); + text?: string; +} + +interface liveTileOptions { + enabled?: boolean; + imageClass?: string; + imageTemplateId?: string; + imageUrl?: string[]; + type?: string; + updateInterval?: number; +} + +interface ios7TileOptions { + textPosition?: ej.mobile.Tile.TextPosition; +} + +interface androidTileOptions { + textPosition?: ej.mobile.Tile.TextPosition; +} + +interface tileTouchEventArgs extends TileEventArgs { + text?: string; +} + +export module Tile +{ +enum TextPosition +{ + Inner, + Outer +} +enum TileSize +{ + Medium, + Small, + Large, + Wide +} +enum TextAlignment +{ + + Normal, + Left, + Right, + Center +} +enum ImagePosition +{ + Center, + Top, + Bottom, + Right, + Left, + TopLeft, + TopRight, + BottomRight, + BottomLeft, + Fill +} +} + + +class RadialSlider extends ej.Widget { + static fn: RadialSlider; + constructor(element: JQuery, options?: RadialSliderOptions); + constructor(element: Element, options?: RadialSliderOptions); + model:RadialSliderOptions; + defaults:RadialSliderOptions; + show(): void; + hide(): void; + destroy(): void; +} + +interface RadialSliderOptions { + radius?: number; + endAngle?: number; + startAngle?: number; + ticks?: Array; + enableRoundOff?: boolean; + value?: number|string; + strokeWidth?: number; + autoOpen?: boolean; + enableAnimation?: boolean; + cssClass?: string; + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + position?: ej.mobile.RadialSlider.Position; + labelSpace?: string|number; + innerCircleImageClass?: string; + innerCircleImageUrl?: string; + showInnerCircle?: boolean; + inline?: boolean; + stop? (e: RadialSliderStopEventArgs): void; + start? (e: RadialSliderStartEventArgs): void; + slide? (e: RadialSliderSlideEventArgs): void; + change? (e: RadialSliderChangeEventArgs): void; + mouseover? (e: RadialSliderMouseOverEventArgs): void; + create? (e: RadialSliderCreateEventArgs): void; + destroy? (e: RadialSliderCreateEventArgs): void; +} +interface RadialSliderCreateEventArgs { + cancel: boolean; + model: RadialSliderOptions; + type: string; +} +interface RadialSliderStopEventArgs extends RadialSliderCreateEventArgs { + value: number; +} + +interface RadialSliderStartEventArgs extends RadialSliderCreateEventArgs { + value: number; +} +interface RadialSliderSlideEventArgs extends RadialSliderCreateEventArgs { + value: number; + selectedValue: number; +} +interface RadialSliderChangeEventArgs extends RadialSliderCreateEventArgs { + value: number; + oldValue: number; +} +interface RadialSliderMouseOverEventArgs extends RadialSliderCreateEventArgs { + value: number; + selectedValue: number; +} +export module RadialSlider { + enum Position { + RightCenter, + RightTop, + RightBottom, + LeftCenter, + LeftTop, + LeftBottom, + TopLeft, + TopRight, + TopCenter, + BottomLeft, + BottomRight, + BottomCenter + } +} +class TimePicker extends ej.Widget { + static fn: TimePicker; + static Locale:any; + constructor(element: JQuery, options?: TimePickerOptions); + model: TimePickerOptions; + defaults: TimePickerOptions; + show(e?:any): void; + hide(e?:any): void; + enable(): void; + disable(): void; + getValue(): string; + setCurrentTime(time: any): void; + destroy(): void; +} +interface TimePickerOptions { + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + cssClass?: string; + hourFormat?: ej.mobile.TimePicker.HourFormat; + value?: string; + culture?: string; + timeFormat?: string; + enabled?: boolean; + enablePersistence?:boolean; + ios7?: ios7TimepickerOptions; + windows?: windowsOption; + select? (e: TimepickerEventArgs): void; + load? (e: TimepickerEventArgs): void; + focusIn? (e: TimepickerEventArgs): void; + focusOut? (e: TimepickerEventArgs): void; + open? (e: TimepickerEventArgs): void; + close? (e: TimepickerEventArgs): void; + change? (e: TimepickerEventArgs): void; + create? (e: TimePickerCommonEventArgs): void; + destroy? (e: TimePickerCommonEventArgs): void; +} +interface TimePickerCommonEventArgs { + cancel: boolean; + type: string; + model: TimePickerOptions; +} +interface TimepickerEventArgs extends TimePickerCommonEventArgs { + value: string; +} +interface ios7TimepickerOptions { + renderDefault?: boolean; +} + +export module TimePicker{ +enum HourFormat{ + TwentyFour, + Twelve +} +} + +//Class ejmToggleButton +class ToggleButton extends ej.Widget { + static fn: ToggleButton; + constructor(element: JQuery, options?: ToggleButtonOptions); + model: ToggleButtonOptions; + defaults: ToggleButtonOptions; + enable(): void; + disable(): void; + destroy(): void; +} + +//ejmToggleButton Option +interface ToggleButtonOptions { + theme?: ej.mobile.Theme; + renderMode?: ej.mobile.RenderMode; + cssClass?: string; + animate?: boolean; + toggleState?: boolean; + windows?: windowsOption; + enablePersistence?: boolean; + enabled?: boolean; + change? (e: ToggleButtonEventArgs): void; + touchStart? (e: ToggleButtonEventArgs): void; + touchEnd? (e: ToggleButtonEventArgs): void; + create? (e: ToggleButtonCommonEventArgs): void; + destroy? (e: ToggleButtonCommonEventArgs): void; +} + +interface ToggleButtonCommonEventArgs { + cancel: boolean; + type: string; + model: ToggleButtonOptions; +} +//ToggleButtonEvent Arugument +interface ToggleButtonEventArgs extends ToggleButtonCommonEventArgs { + state: boolean; +} +//Class ejmToolbar +class Toolbar extends ej.Widget { + static fn: Toolbar; + constructor(element: JQuery, options?: ToolbarOptions); + model: ToolbarOptions; + validTags: Array; + defaults: ToolbarOptions; + removeItem(index:number): void; + addItem(newitem:string): void; + showEllipsis(): void; + disableItem(disableIcon:string): void; + enableItem(enableIcon:string): void; + hideItem(iconName:string): void; + hideEllipsis(): void; + showItem(iconName:string): void; + hideMenu(): void; + showMenu(): void; + destroy(): void; +} + +//ejmToolbar Android Options +interface ToolbarAndroidOptions { + title?: string; + titleIconUrl?: string; + showBackNavigator?: boolean; + showTitleIcon?: boolean; + enableSplitView?: boolean; + showEllipsis?: boolean; + position?: ej.mobile.Toolbar.Position; + +} +//ejmToolbar IOS7 Options +interface ToolbarIOS7Options { + position?: ej.mobile.Toolbar.Position; +} +//ejmToolbar Flat Options +interface ToolbarFlatOptions { + position?: ej.mobile.Toolbar.Position; +} +//ejmToolbar Windows Options +interface ToolbarWindowsOptions { + position?: ej.mobile.Toolbar.Position; +} +//ejmToolbar Option +interface ToolbarOptions { + theme?: ej.mobile.Theme; + renderMode?: ej.mobile.RenderMode; + cssClass?: string; + items?: Array; + enabled?: boolean; + enablePersistence?:boolean; + hide?: boolean; + position?: ej.mobile.Toolbar.Position; + android?: ToolbarAndroidOptions; + windows?: windowsOption; + ios7?: ToolbarIOS7Options; + Flat?: ToolbarFlatOptions; + templateId?: any; + titleIconUrl?: any; + touchStart? (e: ToolbarEventArgs): void; + touchEnd? (e: ToolbarEventArgs): void; + create? (e: ToolbarEventArgs): void; + destroy? (e: ToolbarEventArgs): void; + +} +interface ToolbarItems{ + iconName?: ej.mobile.Toolbar.IconName; + iconUrl?: string; +} +//ejmToolbarEvent Arugument +interface ToolbarEventArgs { + cancel: boolean; + type: string; + model: ToolbarOptions; +} + +export module Toolbar{ + enum Position{ + Normal, + Fixed + } + enum IconName{ + Add, + Back, + Bookmark, + Close, + Compose, + Copy, + Cut, + Delete, + Done, + Edit, + Mail, + Next, + Refresh, + Overflow, + Paste, + Reply, + Save, + Search, + Settings, + Share + } +} +/*Group button*/ +class GroupButton extends ej.Widget { + static fn: GroupButton; + element: JQuery; + constructor(element?: JQuery, options?: GroupButtonOptions); + model: GroupButtonOptions; + defaults: GroupButtonOptions; + destroy(): void; + //add public functions +} +interface GroupButtonOptions { + selectedItemIndex?: (number|string); + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + cssClass?: string; + enablePersistence?: boolean; + items?: Array; + windows?: windowsOption; + touchStart? (e: GroupButtonEventArgs): void; + touchEnd? (e: GroupButtonEventArgs): void; + destroy? (e: GroupButtonEventArgs): void; + create? (e: GroupButtonEventArgs): void; +} +interface GroupButtonItemsOptions { + text?: string; + type?: string; + imageClass?: string; + imageUrl?: string; +} +interface GroupButtonEventArgs { + cancel: boolean; + type: string; + model: GroupButtonOptions; +} +/* SplitPane */ +class SplitPane extends ej.Widget { + static fn: SplitPane; + constructor(element: JQuery, options?: SplitPaneOptions); + model:SplitPaneOptions; + defaults: SplitPaneOptions; + loadContent(toPage: string, options?: any): void; + transferPage(toPage: any, options: any, existing: any, newPage: any): void; + refreshRightScroller(): void; + refreshLeftScroller(): void; + destroy(): void; +} +interface SplitPaneOptions { + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + cssClass?: string; + allowLeftPaneScrolling?: boolean; + allowRightPaneScrolling?: boolean; + android?: SplitPaneAndroidOptions; + windows?: SplitPaneWindowsOptions; + ios7?: SplitPaneIOS7Options; + flat?: SplitPaneFlatOptions; + enablePersistence?: boolean; + enableSwipe?: boolean; + overlayLeftPane?: boolean; + overlayDirection?: ej.mobile.SplitPane.OverlayDirection; + leftPaneScrollSettings?: Object; + rightPaneScrollSettings?: Object; + leftHeaderSettings?: Object; + rightHeaderSettings?: Object; + toolbarSettings?: Object; + create? (e: SplitPaneBaseEventArgs): void; + destroy? (e: SplitPaneBaseEventArgs): void; + beforeTransfer? (e: SplitPaneEventArgs): void; + afterLoadSuccess? (e: SplitPaneEventArgs): void; +} +interface SplitPaneBaseEventArgs { + cancel: boolean; + type: string; + model: SplitPaneOptions; +} +interface SplitPaneEventArgs extends SplitPaneBaseEventArgs { + element: Object; + toPage: Object; + leftPaneheader: Object; + rightPaneheader: Object; + toolbar: Object; +} +interface SplitPaneAndroidOptions { + showToolbar?: boolean; +} +interface SplitPaneWindowsOptions { + showLeftPaneHeader?: boolean; + showRightPaneHeader?: boolean; +} +interface SplitPaneIOS7Options { + showLeftPaneHeader?: boolean; + showRightPaneHeader?: boolean; +} +interface SplitPaneFlatOptions { + showLeftPaneHeader?: boolean; + showRightPaneHeader?: boolean; +} + +export module SplitPane{ +enum OverlayDirection{ +Left, +Right +} +} + +class Dialog extends ej.Widget { + static fn: Dialog; + element: JQuery; + constructor(element: JQuery, options?: DialogOptions); + model: DialogOptions; + defaults: DialogOptions; + open(): void; + close(): void; + isOpened(): boolean; + destroy(): void; +} +interface DialogOptions { + cssClass?: string; + enableAutoOpen?: boolean; + title?: string; + beforeClose? (e: DialogBeforeClose): void; + open? (e: DialogOpen): void; + close? (e: DialogClose): void; + buttonTap? (e: DialogButtonTap): void; + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + enableModal?: boolean; + showButtons?: boolean; + allowScrolling?: boolean; + enableNativeScrolling?: boolean; + mode?: ej.mobile.Dialog.Mode; + leftButtonCaption?: string; + rightButtonCaption?: string; + checkDOMChanges?: boolean; + templateId?: string; + targetHeight?: string|number; + enablePersistence?: boolean; + enableAnimation?: boolean; + windows?: windowsOption; + destroy? (e: DialogEventArgs): void; + create? (e: DialogEventArgs): void; +} +interface DialogEventArgs { + cancel: boolean; + type: string; + model: DialogOptions; +} +interface DialogBeforeClose extends DialogEventArgs{ + title: string; +} +interface DialogOpen extends DialogEventArgs { + element: Object; + title: string; +} +interface DialogClose extends DialogEventArgs { + title: string; + element: Object; +} +interface DialogButtonTap extends DialogEventArgs { + text: string; +} + +export module Dialog{ +enum Mode{ + Alert, + Confirm, + Normal, + FullView +} +} + +class TextboxCommon extends ej.Widget { + model: TextBoxOptions; + disable(): void; + enable(): void; + getStrippedValue(): string; + getUnstrippedValue(): string; + getValue(): string; + getWatermarkText(): string; + refresh(): void; + destroy(): void; +} +class TextBox extends TextboxCommon { + static fn: TextBox; + constructor(element: JQuery, options?: TextBoxOptions); + defaults: TextBoxOptions; +} +/* Password */ +class Password extends TextboxCommon { + static fn: Password; + constructor(element: JQuery, options?: TextBoxOptions); + defaults: TextBoxOptions; +} +/* MaskEdit */ +class MaskEdit extends TextboxCommon { + static fn: MaskEdit; + constructor(element: JQuery, options?: MaskEditOptions); + defaults: MaskEditOptions; + +} +/* TextArea */ +class TextArea extends TextboxCommon { + static fn: TextArea; + constructor(element: JQuery, options?: TextBoxOptions); + defaults: TextBoxOptions; + +} +interface TextBoxOptions { + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + cssClass?: string; + showBorder?: boolean; + windows?: WindowsTextBoxOptions; + value?: string; + watermarkText?: string; + change? (e: TextBoxChangeEventArgs): void; + create? (e: TextBoxEventArgs): void; + destroy? (e: TextBoxEventArgs): void; + enabled?: boolean; + enablePersistence?: boolean; + readOnly?: boolean; +} +interface TextBoxEventArgs { + cancel: boolean; + type: string; + model: TextBoxOptions; +} +interface MaskEditOptions extends TextBoxOptions { + mask?: string; +} +interface WindowsTextBoxOptions extends windowsOption { + allowReset?: boolean; +} +interface TextBoxChangeEventArgs extends TextBoxEventArgs { + element: Object; + value: string; + isChecked: boolean; +} +class Footer extends ej.Widget { + static fn: Footer; + element: JQuery; + constructor(element: JQuery, options?: FooterOptions); + model: FooterOptions; + defaults: FooterOptions; + getTitle(): string; + destroy(): void; + +} + +interface FooterOptions { + hideForUnSupportedDevice?: boolean; + leftButtonNavigationUrl?: string; + rightButtonNavigationUrl?: string; + title?: string; + cssClass?: string; + showTitle?: boolean; + position?: ej.mobile.Footer.Position; + leftButtonCaption?: string; + rightButtonCaption?: string; + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + showLeftButton?: boolean; + showRightButton?: boolean; + enablePersistence?:boolean; + leftButtonStyle?:ej.mobile.Footer.FooterLeftButtonStyle; + rightButtonStyle?:ej.mobile.Footer.FooterRightButtonStyle; + ios7?: Footerios7Options; + flat?: FooterFlatOptions; + android?: FooterAndroidOptions; + templateId?: string; + windows?: FooterWindowsOptions; + leftButtonTap? (e: FooterLeftButtonTapEventArgs): void; + rightButtonTap? (e: FooterRightButtonTapEventArgs): void; + destroy?(e:FooterBaseArgs):void; + create?(e:FooterBaseArgs):void; +} + +interface FooterWindowsOptions extends windowsOption { + renderDefault?: boolean; + rightButtonStyle?: ej.mobile.Footer.Windows.FooterRightButtonStyle; + leftButtonStyle?: ej.mobile.Footer.Windows.FooterLeftButtonStyle; + showLeftButton?: boolean; + showRightButton?: boolean; +} +interface Footerios7Options { + rightButtonStyle?: ej.mobile.Footer.IOS7.FooterRightButtonStyle; + leftButtonStyle?: ej.mobile.Footer.IOS7.FooterLeftButtonStyle; + showLeftButton?: boolean; + showRightButton?: boolean; +} +interface FooterFlatOptions { + rightButtonStyle?: ej.mobile.Footer.Flat.FooterRightButtonStyle; + leftButtonStyle?: ej.mobile.Footer.Flat.FooterLeftButtonStyle; + showLeftButton?: boolean; + showRightButton?: boolean; +} +interface FooterAndroidOptions { + rightButtonStyle?: ej.mobile.Footer.Android.FooterRightButtonStyle; + leftButtonStyle?: ej.mobile.Footer.Android.FooterLeftButtonStyle; + showLeftButton?: boolean; + showRightButton?: boolean; +} + +interface FooterBaseArgs{ + cancel: boolean; + type: string; + model: FooterOptions; +} + +interface FooterLeftButtonTapEventArgs { + text: string; + cancel: boolean; + model: Object; + type: string; + status: boolean; +} +interface FooterRightButtonTapEventArgs { + text: string; + cancel: boolean; + model: Object; + type: string; + status: boolean; +} + +export module Footer{ +export module IOS7 +{ +enum FooterLeftButtonStyle +{ + Auto, + Back, + Header, + Normal +} +enum FooterRightButtonStyle +{ + Auto, + Header, + Normal +} +} + +export module Flat +{ +enum FooterLeftButtonStyle +{ + Auto, + Back, + Normal, + Header +} +enum FooterRightButtonStyle +{ + Auto, + Header, + Normal +} +} + +export module Android +{ +enum FooterLeftButtonStyle +{ + Auto, + Back, + Normal, + Header +} +enum FooterRightButtonStyle +{ + Auto, + Normal, + Header +} +} + +export module Windows +{ +enum FooterLeftButtonStyle +{ + Auto, + Back, + Normal, + Header +} +enum FooterRightButtonStyle +{ + Auto, + Normal, + Header +} +} +enum Position{ + Normal, + Fixed +} +enum FooterLeftButtonStyle{ +Back, +Header, +Normal +} +enum FooterRightButtonStyle{ +Header, +Normal +} +} + +class CheckBox extends ej.Widget { + static fn: CheckBox; + constructor(element: JQuery, options?: CheckBoxOptions); + model: CheckBoxOptions; + defaults: CheckBoxOptions; + isChecked(): boolean; + destroy(): void; + +} +interface CheckBoxOptions { + touchStart? (e: CheckBoxTouchStart): void; + touchEnd? (e: CheckBoxTouchEnd): void; + renderMode?: ej.mobile.RenderMode; + cssClass?: string; + preventDefault?: boolean; + theme?: ej.mobile.Theme; + enabled?: boolean; + checked?: boolean; + enableTriState?: boolean; + checkState?: ej.mobile.CheckBox.CheckState; + windows?: windowsOption; + enablePersistence?: boolean; + text?: string; + destroy? (e: checkBoxEventArgs): void; + create? (e: checkBoxEventArgs): void; +} +interface checkBoxEventArgs { + cancel: boolean; + type: string; + model: CheckBoxOptions; +} +interface CheckBoxTouchStart extends checkBoxEventArgs{ + element: Object; + value: string; + isChecked: boolean; +} +interface CheckBoxTouchEnd extends checkBoxEventArgs{ + element: Object; + value: string; + isChecked: boolean; +} +export module CheckBox{ + enum CheckState{ + Uncheck, + Check, + Indeterminate + } +} +class ScrollPanel extends ej.Widget { + static fn: ScrollPanel; + constructor(element: JQuery, target: any, options?: ScrollPanelOptions); + model: ScrollPanelOptions; + defaults: ScrollPanelOptions; + refresh(): void; + disable(): void; + enable(): void; + getComputedPosition(): void; + stop(): void; + getScrollPosition(): void; + destroy(): void; + } + interface ScrollPanelOptions { + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + enableResize?: boolean; + targetHeight?: number; + targetWidth?: number; + scrollHeight?: number; + scrollWidth?: number; + target: any; + enableFade?: boolean; + enableShrink?: (boolean|string); + autoAdjustHeight?: boolean; + isRelative?: boolean; + wheelSpeed?: number; + enableInteraction?: boolean; + enabled?: boolean; + eventPassthrough?:any; + translateZ?:string; + mode?:ej.mobile.ScrollPanel.Mode; + checkDOMChanges?: boolean; + enableHrScroll?: boolean; + enableVrScroll?: boolean; + zoomMin?: number; + zoomMax?: number; + adjustFixedPosition?: boolean; + startZoom?: number; + startX?: number; + startY?: number; + bounceEasing?:string; + enableDisplacement?:boolean; + displacementValue?:number; + displacementTime?:number; + preventDefaultException?:{tagName?:any} + deceleration?:any; + disablePointer?: boolean; + disableMouse?: boolean; + disableTouch?: boolean; + directionLockThreshold?: number; + momentum?: boolean; + enableBounce?: boolean; + bounceTime?: number; + preventDefault?: boolean; + enableTransform?: boolean; + enableTransition?: boolean; + showScrollbars?: boolean; + enableMouseWheel?: boolean; + enableKeys?: boolean; + enableZoom?: boolean; + enableNativeScrolling?: boolean; + invertWheel?: boolean; + enablePersistence?: boolean; + create? (e: ScrollPanelBaseEventArgs): void; + destroy? (e: ScrollPanelBaseEventArgs): void; + scrollStart? (e: ScrollPanelEventArgs): void; + scroll? (e: ScrollPanelEventArgs): void; + scrollEnd? (e: ScrollPanelEventArgs): void; + zoomStart? (e: ScrollPanelEventArgs): void; + zoomEnd? (e: ScrollPanelEventArgs): void; + } +interface ScrollPanelBaseEventArgs { + cancel: boolean; + type: string; + model: ScrollPanelOptions; +} +interface ScrollPanelEventArgs extends ScrollPanelBaseEventArgs { + x: number; + y: number; + object: Object; +} +export module ScrollPanel{ + enum Mode{ + Page, + Container + } +} +class NavigationDrawer extends ej.Widget { + static fn: NavigationDrawer; + element: JQuery; + constructor(element: JQuery, options?: NavigationDrawerOptions); + model: NavigationDrawerOptions; + defaults: NavigationDrawerOptions; + open(e: any): void; + close(e: any): void; + toggle(e: any): void; + destroy(): void; +} +//ejmNavigationDrawer Option +interface NavigationDrawerOptions { + theme?: ej.mobile.Theme; + renderMode?: ej.mobile.RenderMode; + cssClass?: string; + contentId?: string; + allowScrolling?: boolean; + scrollSettings?: {}; + considerSubPage?: boolean; + direction?: ej.mobile.NavigationDrawer.Direction; + showScrollbars?: boolean; + targetId?: string; + position?: ej.mobile.NavigationDrawer.Position; + enableListView?: boolean; + listViewSettings?: {}; + type?: ej.mobile.NavigationDrawer.Type; + width?: string; + items?: Array; + swipe? (e: NavigationDrawerSwipeEventArgs): void; + open? (e: NavigationDrawerOpenBeforeCloseEventArgs): void; + beforeClose? (e: NavigationDrawerOpenBeforeCloseEventArgs): void; + create? (e: NavigationDrawerEvent): void; + destroy? (e: NavigationDrawerEvent): void; +} + +interface NavigationDrawerEvent { + type: string; + cancel: boolean; + model: NavigationDrawerOptions; +} + +//ejmNavigationDrawer Swipe Event Arugument +interface NavigationDrawerSwipeEventArgs extends NavigationDrawerEvent { + element: Object; + targetElement: Object; + direction: string; +} +//ejmNavigationDrawer Open and BeforeClose Event Arugument +interface NavigationDrawerOpenBeforeCloseEventArgs extends NavigationDrawerEvent { + element: Object; +} + +export module NavigationDrawer { + enum Direction { + Left, + Right + } + enum Position { + Normal, + Fixed + } + enum Type { + Overlay, + Slide + } +} + + +class RadialMenu extends ej.Widget { + static fn: RadialMenu; + constructor(element: JQuery, options?: RadialMenuOptions); + model: RadialMenuOptions; + defaults: RadialMenuOptions; + show(): void; + hide(): void; + menuHide(): void; + hideMenu(): void; + showMenu(): void; + enableItemByIndex(index: number): void; + enableItemsByIndices(itemIndices: Array): void; + disableItemByIndex(itemIndex: number): void; + disableItemsByIndices(itemIndices: Array): void; + updateBadgeValue(index: number, value: number): void; + showBadge(index: number): void; + hideBadge(index: number): void; +} + +interface RadialMenuOptions { + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + radius?: number; + cssClass?: string; + imageClass?: string; + backImageClass?: string; + position?: ej.mobile.RadialMenu.Position; + enableAnimation?: boolean; + windows?: windowsOption; + items?: any; + touch? (e: RadialMenuEventArgs): void; + open? (e: RadialMenuEventArgs): void; + close? (e: RadialMenuEventArgs): void; + select? (e: RadialMenuEventArgs): void; +} +interface RadialMenuEventArgs { + cancel: boolean; + model: RadialMenuOptions; + type: string; + index: number; + childIndex: number; +} +export module RadialMenu{ + enum Position{ + RightCenter, + RightTop, + RightBottom, + LeftCenter, + LeftTop, + LeftBottom + } +} + + +} +declare module ej.datavisualization { + +class LinearGauge extends ej.Widget { + static fn: LinearGauge; + constructor(element: JQuery, options?: LinearGauge.Model); + constructor(element: Element, options?: LinearGauge.Model); + model:LinearGauge.Model; + defaults:LinearGauge.Model; + + /** destroy the linear gauge all events bound using this._on will be unbind automatically and bring the control to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** To export Image + * @returns {void} + */ + exportImage(): void; + + /** To get Bar Distance From Scale in number + * @returns {void} + */ + getBarDistanceFromScale(): void; + + /** To get Bar Pointer Value in number + * @returns {void} + */ + getBarPointerValue(): void; + + /** To get Bar Width in number + * @returns {void} + */ + getBarWidth(): void; + + /** To get CustomLabel Angle in number + * @returns {void} + */ + getCustomLabelAngle(): void; + + /** To get CustomLabel Value in string + * @returns {void} + */ + getCustomLabelValue(): void; + + /** To get Label Angle in number + * @returns {void} + */ + getLabelAngle(): void; + + /** To get LabelPlacement in number + * @returns {void} + */ + getLabelPlacement(): void; + + /** To get LabelStyle in number + * @returns {void} + */ + getLabelStyle(): void; + + /** To get Label XDistance From Scale in number + * @returns {void} + */ + getLabelXDistanceFromScale(): void; + + /** To get PointerValue in number + * @returns {void} + */ + getLabelYDistanceFromScale(): void; + + /** To get Major Interval Value in number + * @returns {void} + */ + getMajorIntervalValue(): void; + + /** To get MarkerStyle in number + * @returns {void} + */ + getMarkerStyle(): void; + + /** To get Maximum Value in number + * @returns {void} + */ + getMaximumValue(): void; + + /** To get PointerValue in number + * @returns {void} + */ + getMinimumValue(): void; + + /** To get Minor Interval Value in number + * @returns {void} + */ + getMinorIntervalValue(): void; + + /** To get Pointer Distance From Scale in number + * @returns {void} + */ + getPointerDistanceFromScale(): void; + + /** To get PointerHeight in number + * @returns {void} + */ + getPointerHeight(): void; + + /** To get Pointer Placement in String + * @returns {void} + */ + getPointerPlacement(): void; + + /** To get PointerValue in number + * @returns {void} + */ + getPointerValue(): void; + + /** To get PointerWidth in number + * @returns {void} + */ + getPointerWidth(): void; + + /** To get Range Border Width in number + * @returns {void} + */ + getRangeBorderWidth(): void; + + /** To get Range Distance From Scale in number + * @returns {void} + */ + getRangeDistanceFromScale(): void; + + /** To get Range End Value in number + * @returns {void} + */ + getRangeEndValue(): void; + + /** To get Range End Width in number + * @returns {void} + */ + getRangeEndWidth(): void; + + /** To get Range Position in number + * @returns {void} + */ + getRangePosition(): void; + + /** To get Range Start Value in number + * @returns {void} + */ + getRangeStartValue(): void; + + /** To get Range Start Width in number + * @returns {void} + */ + getRangeStartWidth(): void; + + /** To get ScaleBarLength in number + * @returns {void} + */ + getScaleBarLength(): void; + + /** To get Scale Bar Size in number + * @returns {void} + */ + getScaleBarSize(): void; + + /** To get Scale Border Width in number + * @returns {void} + */ + getScaleBorderWidth(): void; + + /** To get Scale Direction in number + * @returns {void} + */ + getScaleDirection(): void; + + /** To get Scale Location in object + * @returns {void} + */ + getScaleLocation(): void; + + /** To get Scale Style in string + * @returns {void} + */ + getScaleStyle(): void; + + /** To get Tick Angle in number + * @returns {void} + */ + getTickAngle(): void; + + /** To get Tick Height in number + * @returns {void} + */ + getTickHeight(): void; + + /** To get getTickPlacement in number + * @returns {void} + */ + getTickPlacement(): void; + + /** To get Tick Style in string + * @returns {void} + */ + getTickStyle(): void; + + /** To get Tick Width in number + * @returns {void} + */ + getTickWidth(): void; + + /** To get get Tick XDistance From Scale in number + * @returns {void} + */ + getTickXDistanceFromScale(): void; + + /** To get Tick YDistance From Scale in number + * @returns {void} + */ + getTickYDistanceFromScale(): void; + + /** Specifies the scales. + * @returns {void} + */ + scales(): void; + + /** To set setBarDistanceFromScale + * @returns {void} + */ + setBarDistanceFromScale(): void; + + /** To set setBarPointerValue + * @returns {void} + */ + setBarPointerValue(): void; + + /** To set setBarWidth + * @returns {void} + */ + setBarWidth(): void; + + /** To set setCustomLabelAngle + * @returns {void} + */ + setCustomLabelAngle(): void; + + /** To set setCustomLabelValue + * @returns {void} + */ + setCustomLabelValue(): void; + + /** To set setLabelAngle + * @returns {void} + */ + setLabelAngle(): void; + + /** To set setLabelPlacement + * @returns {void} + */ + setLabelPlacement(): void; + + /** To set setLabelStyle + * @returns {void} + */ + setLabelStyle(): void; + + /** To set setLabelXDistanceFromScale + * @returns {void} + */ + setLabelXDistanceFromScale(): void; + + /** To set setLabelYDistanceFromScale + * @returns {void} + */ + setLabelYDistanceFromScale(): void; + + /** To set setMajorIntervalValue + * @returns {void} + */ + setMajorIntervalValue(): void; + + /** To set setMarkerStyle + * @returns {void} + */ + setMarkerStyle(): void; + + /** To set setMaximumValue + * @returns {void} + */ + setMaximumValue(): void; + + /** To set setMinimumValue + * @returns {void} + */ + setMinimumValue(): void; + + /** To set setMinorIntervalValue + * @returns {void} + */ + setMinorIntervalValue(): void; + + /** To set setPointerDistanceFromScale + * @returns {void} + */ + setPointerDistanceFromScale(): void; + + /** To set PointerHeight + * @returns {void} + */ + setPointerHeight(): void; + + /** To set setPointerPlacement + * @returns {void} + */ + setPointerPlacement(): void; + + /** To set PointerValue + * @returns {void} + */ + setPointerValue(): void; + + /** To set PointerWidth + * @returns {void} + */ + setPointerWidth(): void; + + /** To set setRangeBorderWidth + * @returns {void} + */ + setRangeBorderWidth(): void; + + /** To set setRangeDistanceFromScale + * @returns {void} + */ + setRangeDistanceFromScale(): void; + + /** To set setRangeEndValue + * @returns {void} + */ + setRangeEndValue(): void; + + /** To set setRangeEndWidth + * @returns {void} + */ + setRangeEndWidth(): void; + + /** To set setRangePosition + * @returns {void} + */ + setRangePosition(): void; + + /** To set setRangeStartValue + * @returns {void} + */ + setRangeStartValue(): void; + + /** To set setRangeStartWidth + * @returns {void} + */ + setRangeStartWidth(): void; + + /** To set setScaleBarLength + * @returns {void} + */ + setScaleBarLength(): void; + + /** To set setScaleBarSize + * @returns {void} + */ + setScaleBarSize(): void; + + /** To set setScaleBorderWidth + * @returns {void} + */ + setScaleBorderWidth(): void; + + /** To set setScaleDirection + * @returns {void} + */ + setScaleDirection(): void; + + /** To set setScaleLocation + * @returns {void} + */ + setScaleLocation(): void; + + /** To set setScaleStyle + * @returns {void} + */ + setScaleStyle(): void; + + /** To set setTickAngle + * @returns {void} + */ + setTickAngle(): void; + + /** To set setTickHeight + * @returns {void} + */ + setTickHeight(): void; + + /** To set setTickPlacement + * @returns {void} + */ + setTickPlacement(): void; + + /** To set setTickStyle + * @returns {void} + */ + setTickStyle(): void; + + /** To set setTickWidth + * @returns {void} + */ + setTickWidth(): void; + + /** To set setTickXDistanceFromScale + * @returns {void} + */ + setTickXDistanceFromScale(): void; + + /** To set setTickYDistanceFromScale + * @returns {void} + */ + setTickYDistanceFromScale(): void; +} +export module LinearGauge{ + +export interface Model { + + /**Specifies the animationSpeed + * @Default {500} + */ + animationSpeed?: number; + + /**Specifies the backgroundColor for Linear gauge. + * @Default {null} + */ + backgroundColor?: string; + + /**Specifies the borderColor for Linear gauge. + * @Default {null} + */ + borderColor?: string; + + /**Specifies the animate state + * @Default {true} + */ + enableAnimation?: boolean; + + /**Specifies the animate state for marker pointer + * @Default {true} + */ + enableMarkerPointerAnimation?: boolean; + + /**Specifies the can resize state. + * @Default {false} + */ + enableResize?: boolean; + + /**Specify frame of linear gauge + * @Default {null} + */ + frame?: Frame; + + /**Specifies the height of Linear gauge. + * @Default {400} + */ + height?: number; + + /**Specifies the labelColor for Linear gauge. + * @Default {null} + */ + labelColor?: string; + + /**Specifies the maximum value of Linear gauge. + * @Default {100} + */ + maximum?: number; + + /**Specifies the minimum value of Linear gauge. + * @Default {0} + */ + minimum?: number; + + /**Specifies the orientation for Linear gauge. + * @Default {Vertical} + */ + orientation?: string; + + /**Specify labelPosition value of Linear gauge See OuterCustomLabelPosition + * @Default {bottom} + */ + outerCustomLabelPosition?: ej.datavisualization.LinearGauge.OuterCustomLabelPosition|string; + + /**Specifies the pointerGradient1 for Linear gauge. + * @Default {null} + */ + pointerGradient1?: any; + + /**Specifies the pointerGradient2 for Linear gauge. + * @Default {null} + */ + pointerGradient2?: any; + + /**Specifies the read only state. + * @Default {true} + */ + readOnly?: boolean; + + /**Specifies the scales + * @Default {null} + */ + scales?: Scales; + + /**Specifies the theme for Linear gauge. See LinearGauge.Themes + * @Default {flatlight} + */ + theme?: ej.datavisualization.LinearGauge.Themes|string; + + /**Specifies the tick Color for Linear gauge. + * @Default {null} + */ + tickColor?: string; + + /**Specify tooltip options of linear gauge + * @Default {false} + */ + tooltip?: Tooltip; + + /**Specifies the value of the Gauge. + * @Default {0} + */ + value?: number; + + /**Specifies the width of Linear gauge. + * @Default {150} + */ + width?: number; + + /**Triggers while the bar pointer are being drawn on the gauge.*/ + drawBarPointers? (e: DrawBarPointersEventArgs): void; + + /**Triggers while the customLabel are being drawn on the gauge.*/ + drawCustomLabel? (e: DrawCustomLabelEventArgs): void; + + /**Triggers while the Indicator are being drawn on the gauge.*/ + drawIndicators? (e: DrawIndicatorsEventArgs): void; + + /**Triggers while the label are being drawn on the gauge.*/ + drawLabels? (e: DrawLabelsEventArgs): void; + + /**Triggers while the marker are being drawn on the gauge.*/ + drawMarkerPointers? (e: DrawMarkerPointersEventArgs): void; + + /**Triggers while the range are being drawn on the gauge.*/ + drawRange? (e: DrawRangeEventArgs): void; + + /**Triggers while the ticks are being drawn on the gauge.*/ + drawTicks? (e: DrawTicksEventArgs): void; + + /**Triggers when the gauge is initialized.*/ + init? (e: InitEventArgs): void; + + /**Triggers while the gauge start to Load.*/ + load? (e: LoadEventArgs): void; + + /**Triggers when the left mouse button is clicked.*/ + mouseClick? (e: MouseClickEventArgs): void; + + /**Triggers when clicking and dragging the mouse pointer over the gauge pointer.*/ + mouseClickMove? (e: MouseClickMoveEventArgs): void; + + /**Triggers when the mouse click is released.*/ + mouseClickUp? (e: MouseClickUpEventArgs): void; + + /**Triggers while the rendering of the gauge completed.*/ + renderComplete? (e: RenderCompleteEventArgs): void; +} + +export interface DrawBarPointersEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the pointer + */ + position?: any; + + /**returns the gauge model + */ + Model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the pointer style + */ + style?: string; + + /**returns the current Bar pointer element. + */ + barElement?: any; + + /**returns the index of the bar pointer. + */ + barPointerIndex?: number; + + /**returns the value of the bar pointer. + */ + PointerValue?: number; + + /**returns the name of the event + */ + type?: any; +} + +export interface DrawCustomLabelEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the customLabel + */ + position?: any; + + /**returns the gauge model + */ + Model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the customLabel style + */ + style?: any; + + /**returns the current customLabel element. + */ + customLabelElement?: any; + + /**returns the index of the customLabel. + */ + customLabelIndex?: number; + + /**returns the name of the event + */ + type?: any; +} + +export interface DrawIndicatorsEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the Indicator + */ + position?: any; + + /**returns the gauge model + */ + Model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the Indicator style + */ + style?: string; + + /**returns the current Indicator element. + */ + IndicatorElement?: any; + + /**returns the index of the Indicator. + */ + IndicatorIndex?: number; + + /**returns the name of the event + */ + type?: any; +} + +export interface DrawLabelsEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the label + */ + position?: any; + + /**returns the gauge model + */ + Model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the label belongs. + */ + scaleIndex?: number; + + /**returns the label style + */ + style?: string; + + /**returns the angle of the label. + */ + angle?: number; + + /**returns the current label element. + */ + element?: any; + + /**returns the index of the label. + */ + index?: number; + + /**returns the label value of the label. + */ + value?: number; + + /**returns the name of the event + */ + type?: any; +} + +export interface DrawMarkerPointersEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the pointer + */ + position?: any; + + /**returns the gauge model + */ + Model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the ticks style + */ + style?: string; + + /**returns the current marker pointer element. + */ + markerElement?: any; + + /**returns the index of the marker pointer. + */ + markerPointerIndex?: number; + + /**returns the value of the marker pointer. + */ + pointerValue?: number; + + /**returns the angle of the marker pointer. + */ + pointerAngle?: number; + + /**returns the name of the event + */ + type?: any; +} + +export interface DrawRangeEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the range + */ + position?: any; + + /**returns the gauge model + */ + Model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the range style + */ + style?: string; + + /**returns the current range element. + */ + rangeElement?: any; + + /**returns the index of the range. + */ + rangeIndex?: number; + + /**returns the name of the event + */ + type?: any; +} + +export interface DrawTicksEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the ticks + */ + position?: any; + + /**returns the gauge model + */ + Model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the tick belongs. + */ + scaleIndex?: number; + + /**returns the ticks style + */ + style?: string; + + /**returns the angle of the tick. + */ + angle?: number; + + /**returns the current tick element. + */ + element?: any; + + /**returns the index of the tick. + */ + index?: number; + + /**returns the tick value of the tick. + */ + value?: number; + + /**returns the name of the event + */ + type?: any; +} + +export interface InitEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + Model?: any; + + /**returns the entire scale element. + */ + scaleElement?: any; + + /**returns the context element + */ + context?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface LoadEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + Model?: any; + + /**returns the entire scale element. + */ + scaleElement?: any; + + /**returns the context element + */ + context?: any; + + /**returns the name of the event + */ + type?: any; +} + +export interface MouseClickEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: any; + + /**returns the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the context element* @param {Object} args.markerpointer returns the context element + */ + context?: any; + + /**returns the pointer Index + */ + markerpointerindex?: number; + + /**returns the pointer element. + */ + markerpointerelement?: any; + + /**returns the value of the pointer. + */ + markerpointervalue?: number; + + /**returns the pointer style + */ + style?: string; + + /**returns the startX and startY of the pointer. + */ + position?: any; +} + +export interface MouseClickMoveEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: any; + + /**returns the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the context element + */ + context?: any; + + /**returns the pointer Index + */ + index?: number; + + /**returns the pointer element. + */ + element?: any; + + /**returns the value of the pointer. + */ + value?: number; + + /**returns the pointer style + */ + style?: string; + + /**returns the startX and startY of the pointer. + */ + position?: any; +} + +export interface MouseClickUpEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: any; + + /**returns the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the context element* @param {Object} args.markerpointer returns the context element + */ + context?: any; + + /**returns the pointer Index + */ + markerpointerIndex?: number; + + /**returns the pointer element. + */ + markerpointerElement?: any; + + /**returns the value of the pointer. + */ + markerpointerValue?: number; + + /**returns the pointer style + */ + style?: string; + + /**returns the startX and startY of the pointer. + */ + position?: any; +} + +export interface RenderCompleteEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + Model?: any; + + /**returns the entire scale element. + */ + scaleElement?: any; + + /**returns the context element + */ + context?: any; + + /**returns the name of the event + */ + type?: any; +} + +export interface Frame { + + /**Specifies the frame background image url of linear gauge + * @Default {null} + */ + backgroundImageUrl?: string; + + /**Specifies the frame InnerWidth + * @Default {8} + */ + innerWidth?: number; + + /**Specifies the frame OuterWidth + * @Default {12} + */ + outerWidth?: number; +} + +export interface ScalesBarPointersBorder { + + /**Specifies the border Color of bar pointer + * @Default {null} + */ + color?: string; + + /**Specifies the border Width of bar pointer + * @Default {1.5} + */ + width?: number; +} + +export interface ScalesBarPointers { + + /**Specifies the backgroundColor of bar pointer + * @Default {null} + */ + backgroundColor?: string; + + /**Specifies the border of bar pointer + * @Default {null} + */ + border?: ScalesBarPointersBorder; + + /**Specifies the distanceFromScale of bar pointer + * @Default {0} + */ + distanceFromScale?: number; + + /**Specifies the scaleBar Gradient of bar pointer + * @Default {null} + */ + gradients?: any; + + /**Specifies the opacity of bar pointer + * @Default {1} + */ + opacity?: number; + + /**Specifies the value of bar pointer + * @Default {null} + */ + value?: number; + + /**Specifies the pointer Width of bar pointer + * @Default {width=30} + */ + width?: number; +} + +export interface ScalesBorder { + + /**Specifies the border color of the Scale. + * @Default {null} + */ + color?: string; + + /**Specifies the border width of the Scale. + * @Default {1.5} + */ + width?: number; +} + +export interface ScalesCustomLabelsFont { + + /**Specifies the fontFamily in customLabels + * @Default {Arial} + */ + fontFamily?: string; + + /**Specifies the fontStyle in customLabels. See FontStyle + * @Default {Bold} + */ + fontStyle?: ej.datavisualization.LinearGauge.FontStyle|string; + + /**Specifies the font size in customLabels + * @Default {11px} + */ + size?: string; +} + +export interface ScalesCustomLabelsPosition { + + /**Specifies the position x in customLabels + * @Default {0} + */ + x?: number; + + /**Specifies the y in customLabels + * @Default {0} + */ + y?: number; +} + +export interface ScalesCustomLabels { + + /**Specifies the label Color in customLabels + * @Default {null} + */ + color?: number; + + /**Specifies the font in customLabels + * @Default {null} + */ + font?: ScalesCustomLabelsFont; + + /**Specifies the opacity in customLabels + * @Default {0} + */ + opacity?: string; + + /**Specifies the position in customLabels + * @Default {null} + */ + position?: ScalesCustomLabelsPosition; + + /**Specifies the positionType in customLabels.See CustomLabelPositionType + * @Default {null} + */ + positionType?: any; + + /**Specifies the textAngle in customLabels + * @Default {0} + */ + textAngle?: number; + + /**Specifies the label Value in customLabels + */ + value?: string; +} + +export interface ScalesIndicatorsBorder { + + /**Specifies the border Color in bar indicators + * @Default {null} + */ + color?: string; + + /**Specifies the border Width in bar indicators + * @Default {1.5} + */ + width?: number; +} + +export interface ScalesIndicatorsFont { + + /**Specifies the fontFamily of font in bar indicators + * @Default {Arial} + */ + fontFamily?: string; + + /**Specifies the fontStyle of font in bar indicators. See FontStyle + * @Default {ej.datavisualization.LinearGauge.FontStyle.Bold} + */ + fontStyle?: ej.datavisualization.LinearGauge.FontStyle|string; + + /**Specifies the size of font in bar indicators + * @Default {11px} + */ + size?: string; +} + +export interface ScalesIndicatorsPosition { + + /**Specifies the x position in bar indicators + * @Default {0} + */ + x?: number; + + /**Specifies the y position in bar indicators + * @Default {0} + */ + y?: number; +} + +export interface ScalesIndicatorsStateRanges { + + /**Specifies the backgroundColor in bar indicators state ranges + * @Default {null} + */ + backgroundColor?: string; + + /**Specifies the borderColor in bar indicators state ranges + * @Default {null} + */ + borderColor?: string; + + /**Specifies the endValue in bar indicators state ranges + * @Default {60} + */ + endValue?: number; + + /**Specifies the startValue in bar indicators state ranges + * @Default {50} + */ + startValue?: number; + + /**Specifies the text in bar indicators state ranges + */ + text?: string; + + /**Specifies the textColor in bar indicators state ranges + * @Default {null} + */ + textColor?: string; +} + +export interface ScalesIndicatorsTextLocation { + + /**Specifies the textLocation position in bar indicators + * @Default {0} + */ + x?: number; + + /**Specifies the Y position in bar indicators + * @Default {0} + */ + y?: number; +} + +export interface ScalesIndicators { + + /**Specifies the backgroundColor in bar indicators + * @Default {null} + */ + backgroundColor?: string; + + /**Specifies the border in bar indicators + * @Default {null} + */ + border?: ScalesIndicatorsBorder; + + /**Specifies the font of bar indicators + * @Default {null} + */ + font?: ScalesIndicatorsFont; + + /**Specifies the indicator Height of bar indicators + * @Default {30} + */ + height?: number; + + /**Specifies the opacity in bar indicators + * @Default {NaN} + */ + opacity?: number; + + /**Specifies the position in bar indicators + * @Default {null} + */ + position?: ScalesIndicatorsPosition; + + /**Specifies the state ranges in bar indicators + * @Default {Array} + */ + stateRanges?: Array; + + /**Specifies the textLocation in bar indicators + * @Default {null} + */ + textLocation?: ScalesIndicatorsTextLocation; + + /**Specifies the indicator Style of font in bar indicators + * @Default {ej.datavisualization.LinearGauge.IndicatorType.Rectangle} + */ + type?: ej.datavisualization.LinearGauge.IndicatorTypes|string; + + /**Specifies the indicator Width in bar indicators + * @Default {30} + */ + width?: number; +} + +export interface ScalesLabelsDistanceFromScale { + + /**Specifies the xDistanceFromScale of labels. + * @Default {-10} + */ + x?: number; + + /**Specifies the yDistanceFromScale of labels. + * @Default {0} + */ + y?: number; +} + +export interface ScalesLabelsFont { + + /**Specifies the fontFamily of font. + * @Default {Arial} + */ + fontFamily?: string; + + /**Specifies the fontStyle of font.See FontStyle + * @Default {ej.datavisualization.LinearGauge.FontStyle.Bold} + */ + fontStyle?: ej.datavisualization.LinearGauge.FontStyle|string; + + /**Specifies the size of font. + * @Default {11px} + */ + size?: string; +} + +export interface ScalesLabels { + + /**Specifies the angle of labels. + * @Default {0} + */ + angle?: number; + + /**Specifies the DistanceFromScale of labels. + * @Default {null} + */ + distanceFromScale?: ScalesLabelsDistanceFromScale; + + /**Specifies the font of labels. + * @Default {null} + */ + font?: ScalesLabelsFont; + + /**need to includeFirstValue. + * @Default {true} + */ + includeFirstValue?: boolean; + + /**Specifies the opacity of label. + * @Default {0} + */ + opacity?: number; + + /**Specifies the label Placement of label. See LabelPlacement + * @Default {Near} + */ + placement?: ej.datavisualization.LinearGauge.PointerPlacement|string; + + /**Specifies the textColor of font. + * @Default {null} + */ + textColor?: string; + + /**Specifies the label Style of label. See LabelType + * @Default {ej.datavisualization.LinearGauge.LabelType.Major} + */ + type?: ej.datavisualization.LinearGauge.ScaleType|string; + + /**Specifies the unitText of label. + */ + unitText?: string; + + /**Specifies the unitText Position of label.See UnitTextPlacement + * @Default {Back} + */ + unitTextPlacement?: ej.datavisualization.LinearGauge.UnitTextPlacement|string; +} + +export interface ScalesMarkerPointersBorder { + + /**Specifies the border color of marker pointer + * @Default {null} + */ + color?: string; + + /**Specifies the border of marker pointer + * @Default {number} + */ + width?: number; +} + +export interface ScalesMarkerPointers { + + /**Specifies the backgroundColor of marker pointer + * @Default {null} + */ + backgroundColor?: string; + + /**Specifies the border of marker pointer + * @Default {null} + */ + border?: ScalesMarkerPointersBorder; + + /**Specifies the distanceFromScale of marker pointer + * @Default {0} + */ + distanceFromScale?: number; + + /**Specifies the pointer Gradient of marker pointer + * @Default {null} + */ + gradients?: any; + + /**Specifies the pointer Length of marker pointer + * @Default {30} + */ + length?: number; + + /**Specifies the opacity of marker pointer + * @Default {1} + */ + opacity?: number; + + /**Specifies the pointer Placement of marker pointer See PointerPlacement + * @Default {Far} + */ + placement?: ej.datavisualization.LinearGauge.PointerPlacement|string; + + /**Specifies the marker Style of marker pointerSee MarkerType + * @Default {Triangle} + */ + type?: ej.datavisualization.LinearGauge.MarkerType|string; + + /**Specifies the value of marker pointer + * @Default {null} + */ + value?: number; + + /**Specifies the pointer Width of marker pointer + * @Default {30} + */ + width?: number; +} + +export interface ScalesPosition { + + /**Specifies the Horizontal position + * @Default {50} + */ + x?: number; + + /**Specifies the vertical position + * @Default {50} + */ + y?: number; +} + +export interface ScalesRangesBorder { + + /**Specifies the border color in the ranges. + * @Default {null} + */ + color?: string; + + /**Specifies the border width in the ranges. + * @Default {1.5} + */ + width?: number; +} + +export interface ScalesRanges { + + /**Specifies the backgroundColor in the ranges. + * @Default {null} + */ + backgroundColor?: string; + + /**Specifies the border in the ranges. + * @Default {null} + */ + border?: ScalesRangesBorder; + + /**Specifies the distanceFromScale in the ranges. + * @Default {0} + */ + distanceFromScale?: number; + + /**Specifies the endValue in the ranges. + * @Default {60} + */ + endValue?: number; + + /**Specifies the endWidth in the ranges. + * @Default {10} + */ + endWidth?: number; + + /**Specifies the range Gradient in the ranges. + * @Default {null} + */ + gradients?: any; + + /**Specifies the opacity in the ranges. + * @Default {null} + */ + opacity?: number; + + /**Specifies the range Position in the ranges. See RangePlacement + * @Default {Center} + */ + placement?: ej.datavisualization.LinearGauge.PointerPlacement|string; + + /**Specifies the startValue in the ranges. + * @Default {20} + */ + startValue?: number; + + /**Specifies the startWidth in the ranges. + * @Default {10} + */ + startWidth?: number; +} + +export interface ScalesTicksDistanceFromScale { + + /**Specifies the xDistanceFromScale in the tick. + * @Default {0} + */ + x?: number; + + /**Specifies the yDistanceFromScale in the tick. + * @Default {0} + */ + y?: number; +} + +export interface ScalesTicks { + + /**Specifies the angle in the tick. + * @Default {0} + */ + angle?: number; + + /**Specifies the tick Color in the tick. + * @Default {null} + */ + color?: string; + + /**Specifies the DistanceFromScale in the tick. + * @Default {null} + */ + distanceFromScale?: ScalesTicksDistanceFromScale; + + /**Specifies the tick Height in the tick. + * @Default {10} + */ + height?: number; + + /**Specifies the opacity in the tick. + * @Default {0} + */ + opacity?: number; + + /**Specifies the tick Placement in the tick. See TickPlacement + * @Default {Near} + */ + placement?: ej.datavisualization.LinearGauge.PointerPlacement|string; + + /**Specifies the tick Style in the tick. See TickType + * @Default {MajorInterval} + */ + type?: ej.datavisualization.LinearGauge.TicksType|string; + + /**Specifies the tick Width in the tick. + * @Default {3} + */ + width?: number; +} + +export interface Scales { + + /**Specifies the backgroundColor of the Scale. + * @Default {null} + */ + backgroundColor?: string; + + /**Specifies the scaleBar Gradient of bar pointer + * @Default {Array} + */ + barPointers?: Array; + + /**Specifies the border of the Scale. + * @Default {null} + */ + border?: ScalesBorder; + + /**Specifies the customLabel + * @Default {Array} + */ + customLabels?: Array; + + /**Specifies the scale Direction of the Scale. See Directions + * @Default {CounterClockwise} + */ + direction?: ej.datavisualization.LinearGauge.Direction|string; + + /**Specifies the indicator + * @Default {Array} + */ + indicators?: Array; + + /**Specifies the labels. + * @Default {Array} + */ + labels?: Array; + + /**Specifies the scaleBar Length. + * @Default {290} + */ + length?: number; + + /**Specifies the majorIntervalValue of the Scale. + * @Default {10} + */ + majorIntervalValue?: number; + + /**Specifies the markerPointers + * @Default {Array} + */ + markerPointers?: Array; + + /**Specifies the maximum of the Scale. + * @Default {null} + */ + maximum?: number; + + /**Specifies the minimum of the Scale. + * @Default {null} + */ + minimum?: number; + + /**Specifies the minorIntervalValue of the Scale. + * @Default {2} + */ + minorIntervalValue?: number; + + /**Specifies the opacity of the Scale. + * @Default {NaN} + */ + opacity?: number; + + /**Specifies the position + * @Default {null} + */ + position?: ScalesPosition; + + /**Specifies the ranges in the tick. + * @Default {Array} + */ + ranges?: Array; + + /**Specifies the shadowOffset. + * @Default {0} + */ + shadowOffset?: number; + + /**Specifies the showBarPointers state. + * @Default {true} + */ + showBarPointers?: boolean; + + /**Specifies the showCustomLabels state. + * @Default {false} + */ + showCustomLabels?: boolean; + + /**Specifies the showIndicators state. + * @Default {false} + */ + showIndicators?: boolean; + + /**Specifies the showLabels state. + * @Default {true} + */ + showLabels?: boolean; + + /**Specifies the showMarkerPointers state. + * @Default {true} + */ + showMarkerPointers?: boolean; + + /**Specifies the showRanges state. + * @Default {false} + */ + showRanges?: boolean; + + /**Specifies the showTicks state. + * @Default {true} + */ + showTicks?: boolean; + + /**Specifies the ticks in the scale. + * @Default {Array} + */ + ticks?: Array; + + /**Specifies the scaleBar type .See ScaleType + * @Default {Rectangle} + */ + type?: ej.datavisualization.LinearGauge.ScaleType|string; + + /**Specifies the scaleBar width. + * @Default {30} + */ + width?: number; +} + +export interface Tooltip { + + /**Specify showCustomLabelTooltip value of linear gauge + * @Default {false} + */ + showCustomLabelTooltip?: boolean; + + /**Specify showLabelTooltip value of linear gauge + * @Default {false} + */ + showLabelTooltip?: boolean; + + /**Specify templateID value of linear gauge + * @Default {false} + */ + templateID?: string; +} +} +module LinearGauge +{ +enum OuterCustomLabelPosition +{ +//string +Left, +//string +Right, +//string +Top, +//string +Bottom, +} +} +module LinearGauge +{ +enum FontStyle +{ +//string +Bold, +//string +Italic, +//string +Regular, +//string +Strikeout, +//string +Underline, +} +} +module LinearGauge +{ +enum Direction +{ +//string +Clockwise, +//string +CounterClockwise, +} +} +module LinearGauge +{ +enum IndicatorTypes +{ +//string +Rectangle, +//string +Circle, +//string +RoundedRectangle, +//string +Text, +} +} +module LinearGauge +{ +enum PointerPlacement +{ +//string +Near, +//string +Far, +//string +Center, +} +} +module LinearGauge +{ +enum ScaleType +{ +//string +Major, +//string +Minor, +} +} +module LinearGauge +{ +enum UnitTextPlacement +{ +//string +Back, +//string +From, +} +} +module LinearGauge +{ +enum MarkerType +{ +//string +Rectangle, +//string +Triangle, +//string +Ellipse, +//string +Diamond, +//string +Pentagon, +//string +Circle, +//string +Star, +//string +Slider, +//string +Pointer, +//string +Wedge, +//string +Trapezoid, +//string +RoundedRectangle, +} +} +module LinearGauge +{ +enum TicksType +{ +//string +Majorinterval, +//string +Minorinterval, +} +} +module LinearGauge +{ +enum Themes +{ +//string +FlatLight, +//string +FlatDark, +} +} + +class CircularGauge extends ej.Widget { + static fn: CircularGauge; + constructor(element: JQuery, options?: CircularGauge.Model); + constructor(element: Element, options?: CircularGauge.Model); + model:CircularGauge.Model; + defaults:CircularGauge.Model; + + /** destroy the circular gauge widget. all events bound using this._on will be unbind automatically and bring the control to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** To export Image + * @returns {void} + */ + exportImage(): void; + + /** To get BackNeedleLength + * @returns {void} + */ + getBackNeedleLength(): void; + + /** To get CustomLabelAngle + * @returns {void} + */ + getCustomLabelAngle(): void; + + /** To get CustomLabelValue + * @returns {void} + */ + getCustomLabelValue(): void; + + /** To get LabelAngle + * @returns {void} + */ + getLabelAngle(): void; + + /** To get LabelDistanceFromScale + * @returns {void} + */ + getLabelDistanceFromScale(): void; + + /** To get LabelPlacement + * @returns {void} + */ + getLabelPlacement(): void; + + /** To get LabelStyle + * @returns {void} + */ + getLabelStyle(): void; + + /** To get MajorIntervalValue + * @returns {void} + */ + getMajorIntervalValue(): void; + + /** To get MarkerDistanceFromScale + * @returns {void} + */ + getMarkerDistanceFromScale(): void; + + /** To get MarkerStyle + * @returns {void} + */ + getMarkerStyle(): void; + + /** To get MaximumValue + * @returns {void} + */ + getMaximumValue(): void; + + /** To get MinimumValue + * @returns {void} + */ + getMinimumValue(): void; + + /** To get MinorIntervalValue + * @returns {void} + */ + getMinorIntervalValue(): void; + + /** To get NeedleStyle + * @returns {void} + */ + getNeedleStyle(): void; + + /** To get PointerCapBorderWidth + * @returns {void} + */ + getPointerCapBorderWidth(): void; + + /** To get PointerCapRadius + * @returns {void} + */ + getPointerCapRadius(): void; + + /** To get PointerLength + * @returns {void} + */ + getPointerLength(): void; + + /** To get PointerNeedleType + * @returns {void} + */ + getPointerNeedleType(): void; + + /** To get PointerPlacement + * @returns {void} + */ + getPointerPlacement(): void; + + /** To get PointerValue + * @returns {void} + */ + getPointerValue(): void; + + /** To get PointerWidth + * @returns {void} + */ + getPointerWidth(): void; + + /** To get RangeBorderWidth + * @returns {void} + */ + getRangeBorderWidth(): void; + + /** To get RangeDistanceFromScale + * @returns {void} + */ + getRangeDistanceFromScale(): void; + + /** To get RangeEndValue + * @returns {void} + */ + getRangeEndValue(): void; + + /** To get RangePosition + * @returns {void} + */ + getRangePosition(): void; + + /** To get RangeSize + * @returns {void} + */ + getRangeSize(): void; + + /** To get RangeStartValue + * @returns {void} + */ + getRangeStartValue(): void; + + /** To get ScaleBarSize + * @returns {void} + */ + getScaleBarSize(): void; + + /** To get ScaleBorderWidth + * @returns {void} + */ + getScaleBorderWidth(): void; + + /** To get ScaleDirection + * @returns {void} + */ + getScaleDirection(): void; + + /** To get ScaleRadius + * @returns {void} + */ + getScaleRadius(): void; + + /** To get StartAngle + * @returns {void} + */ + getStartAngle(): void; + + /** To get SubGaugeLocation + * @returns {void} + */ + getSubGaugeLocation(): void; + + /** To get SweepAngle + * @returns {void} + */ + getSweepAngle(): void; + + /** To get TickAngle + * @returns {void} + */ + getTickAngle(): void; + + /** To get TickDistanceFromScale + * @returns {void} + */ + getTickDistanceFromScale(): void; + + /** To get TickHeight + * @returns {void} + */ + getTickHeight(): void; + + /** To get TickPlacement + * @returns {void} + */ + getTickPlacement(): void; + + /** To get TickStyle + * @returns {void} + */ + getTickStyle(): void; + + /** To get TickWidth + * @returns {void} + */ + getTickWidth(): void; + + /** To set includeFirstValue + * @returns {void} + */ + includeFirstValue(): void; + + /** Switching the redraw option for the gauge + * @returns {void} + */ + redraw(): void; + + /** To set BackNeedleLength + * @returns {void} + */ + setBackNeedleLength(): void; + + /** To set CustomLabelAngle + * @returns {void} + */ + setCustomLabelAngle(): void; + + /** To set CustomLabelValue + * @returns {void} + */ + setCustomLabelValue(): void; + + /** To set LabelAngle + * @returns {void} + */ + setLabelAngle(): void; + + /** To set LabelDistanceFromScale + * @returns {void} + */ + setLabelDistanceFromScale(): void; + + /** To set LabelPlacement + * @returns {void} + */ + setLabelPlacement(): void; + + /** To set LabelStyle + * @returns {void} + */ + setLabelStyle(): void; + + /** To set MajorIntervalValue + * @returns {void} + */ + setMajorIntervalValue(): void; + + /** To set MarkerDistanceFromScale + * @returns {void} + */ + setMarkerDistanceFromScale(): void; + + /** To set MarkerStyle + * @returns {void} + */ + setMarkerStyle(): void; + + /** To set MaximumValue + * @returns {void} + */ + setMaximumValue(): void; + + /** To set MinimumValue + * @returns {void} + */ + setMinimumValue(): void; + + /** To set MinorIntervalValue + * @returns {void} + */ + setMinorIntervalValue(): void; + + /** To set NeedleStyle + * @returns {void} + */ + setNeedleStyle(): void; + + /** To set PointerCapBorderWidth + * @returns {void} + */ + setPointerCapBorderWidth(): void; + + /** To set PointerCapRadius + * @returns {void} + */ + setPointerCapRadius(): void; + + /** To set PointerLength + * @returns {void} + */ + setPointerLength(): void; + + /** To set PointerNeedleType + * @returns {void} + */ + setPointerNeedleType(): void; + + /** To set PointerPlacement + * @returns {void} + */ + setPointerPlacement(): void; + + /** To set PointerValue + * @returns {void} + */ + setPointerValue(): void; + + /** To set PointerWidth + * @returns {void} + */ + setPointerWidth(): void; + + /** To set RangeBorderWidth + * @returns {void} + */ + setRangeBorderWidth(): void; + + /** To set RangeDistanceFromScale + * @returns {void} + */ + setRangeDistanceFromScale(): void; + + /** To set RangeEndValue + * @returns {void} + */ + setRangeEndValue(): void; + + /** To set RangePosition + * @returns {void} + */ + setRangePosition(): void; + + /** To set RangeSize + * @returns {void} + */ + setRangeSize(): void; + + /** To set RangeStartValue + * @returns {void} + */ + setRangeStartValue(): void; + + /** To set ScaleBarSize + * @returns {void} + */ + setScaleBarSize(): void; + + /** To set ScaleBorderWidth + * @returns {void} + */ + setScaleBorderWidth(): void; + + /** To set ScaleDirection + * @returns {void} + */ + setScaleDirection(): void; + + /** To set ScaleRadius + * @returns {void} + */ + setScaleRadius(): void; + + /** To set StartAngle + * @returns {void} + */ + setStartAngle(): void; + + /** To set SubGaugeLocation + * @returns {void} + */ + setSubGaugeLocation(): void; + + /** To set SweepAngle + * @returns {void} + */ + setSweepAngle(): void; + + /** To set TickAngle + * @returns {void} + */ + setTickAngle(): void; + + /** To set TickDistanceFromScale + * @returns {void} + */ + setTickDistanceFromScale(): void; + + /** To set TickHeight + * @returns {void} + */ + setTickHeight(): void; + + /** To set TickPlacement + * @returns {void} + */ + setTickPlacement(): void; + + /** To set TickStyle + * @returns {void} + */ + setTickStyle(): void; + + /** To set TickWidth + * @returns {void} + */ + setTickWidth(): void; +} +export module CircularGauge{ + +export interface Model { + + /**Specifies animationSpeed of circular gauge + * @Default {500} + */ + animationSpeed?: number; + + /**Specifies the background color of circular gauge. + * @Default {null} + */ + backgroundColor?: string; + + /**Specify distanceFromCorner value of circular gauge + * @Default {center} + */ + distanceFromCorner?: number; + + /**Specify animate value of circular gauge + * @Default {true} + */ + enableAnimation?: boolean; + + /**Specify enableResize value of circular gauge + * @Default {false} + */ + enableResize?: boolean; + + /**Specify the frame of circular gauge + * @Default {Object} + */ + frame?: Frame; + + /**Specify gaugePosition value of circular gauge See GaugePosition + * @Default {center} + */ + gaugePosition?: ej.datavisualization.CircularGauge.gaugePosition|string; + + /**Specifies the height of circular gauge. + * @Default {360} + */ + height?: number; + + /**Specifies the interiorGradient of circular gauge. + * @Default {null} + */ + interiorGradient?: any; + + /**Specify isRadialGradient value of circular gauge + * @Default {false} + */ + isRadialGradient?: boolean; + + /**Specifies the maximum value of circular gauge. + * @Default {100} + */ + maximum?: number; + + /**Specifies the minimum value of circular gauge. + * @Default {0} + */ + minimum?: number; + + /**Specify outerCustomLabelPosition value of circular gauge See OuterCustomLabelPosition + * @Default {bottom} + */ + outerCustomLabelPosition?: ej.datavisualization.CircularGauge.CustomLabelPositionType|string; + + /**Specifies the radius of circular gauge. + * @Default {180} + */ + radius?: number; + + /**Specify readonly value of circular gauge + * @Default {true} + */ + readOnly?: boolean; + + /**Specify the pointers, ticks, labels, indicators, ranges of circular gauge + * @Default {null} + */ + scales?: Scales; + + /**Specify the theme of circular gauge. + * @Default {flatlight} + */ + theme?: string; + + /**Specify tooltip option of circular gauge + * @Default {object} + */ + tooltip?: Tooltip; + + /**Specifies the value of circular gauge. + * @Default {0} + */ + value?: number; + + /**Specifies the width of circular gauge. + * @Default {360} + */ + width?: number; + + /**Triggers while the custom labels are being drawn on the gauge.*/ + drawCustomLabel? (e: DrawCustomLabelEventArgs): void; + + /**Triggers while the indicators are being started to drawn on the gauge.*/ + drawIndicators? (e: DrawIndicatorsEventArgs): void; + + /**Triggers while the labels are being drawn on the gauge.*/ + drawLabels? (e: DrawLabelsEventArgs): void; + + /**Triggers while the pointer cap is being drawn on the gauge.*/ + drawPointerCap? (e: DrawPointerCapEventArgs): void; + + /**Triggers while the pointers are being drawn on the gauge.*/ + drawPointers? (e: DrawPointersEventArgs): void; + + /**Triggers when the ranges begin to be getting drawn on the gauge.*/ + drawRange? (e: DrawRangeEventArgs): void; + + /**Triggers while the ticks are being drawn on the gauge.*/ + drawTicks? (e: DrawTicksEventArgs): void; + + /**Triggers while the gauge start to Load.*/ + load? (e: LoadEventArgs): void; + + /**Triggers when the left mouse button is clicked.*/ + mouseClick? (e: MouseClickEventArgs): void; + + /**Triggers when clicking and dragging the mouse pointer over the gauge pointer.*/ + mouseClickMove? (e: MouseClickMoveEventArgs): void; + + /**Triggers when the mouse click is released.*/ + mouseClickUp? (e: MouseClickUpEventArgs): void; + + /**Triggers when the rendering of the gauge is completed.*/ + renderComplete? (e: RenderCompleteEventArgs): void; +} + +export interface DrawCustomLabelEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the custom label + */ + position?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the custom label belongs. + */ + scaleIndex?: number; + + /**returns the custom label style + */ + style?: string; + + /**returns the current custom label element. + */ + customLabelElement?: any; + + /**returns the index of the custom label. + */ + customLabelIndex?: number; + + /**returns the name of the event + */ + type?: string; +} + +export interface DrawIndicatorsEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the indicator + */ + position?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the indicator belongs. + */ + scaleIndex?: number; + + /**returns the indicator style + */ + style?: string; + + /**returns the current indicator element. + */ + indicatorElement?: any; + + /**returns the index of the indicator. + */ + indicatorIndex?: number; + + /**returns the name of the event + */ + type?: string; +} + +export interface DrawLabelsEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the labels + */ + position?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the label belongs. + */ + scaleIndex?: number; + + /**returns the label style + */ + style?: string; + + /**returns the angle of the labels. + */ + angle?: number; + + /**returns the current label element. + */ + element?: any; + + /**returns the index of the label. + */ + index?: number; + + /**returns the value of the label. + */ + pointerValue?: number; + + /**returns the name of the event + */ + type?: string; +} + +export interface DrawPointerCapEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the startX and startY of the pointer cap. + */ + position?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the pointer cap style + */ + style?: string; + + /**returns the name of the event + */ + type?: string; +} + +export interface DrawPointersEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the pointer + */ + position?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the pointer style + */ + style?: string; + + /**returns the angle of the pointer. + */ + angle?: number; + + /**returns the current pointer element. + */ + element?: any; + + /**returns the index of the pointer. + */ + index?: number; + + /**returns the value of the pointer. + */ + value?: number; + + /**returns the name of the event + */ + type?: string; +} + +export interface DrawRangeEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the range + */ + position?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the range belongs. + */ + scaleIndex?: number; + + /**returns the range style + */ + style?: string; + + /**returns the current range element. + */ + rangeElement?: any; + + /**returns the index of the range. + */ + rangeIndex?: number; + + /**returns the name of the event + */ + type?: string; +} + +export interface DrawTicksEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the ticks + */ + position?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the tick belongs. + */ + scaleIndex?: number; + + /**returns the ticks style + */ + style?: string; + + /**returns the angle of the tick. + */ + angle?: number; + + /**returns the current tick element. + */ + element?: any; + + /**returns the index of the tick. + */ + index?: number; + + /**returns the label value of the tick. + */ + pointerValue?: number; + + /**returns the name of the event + */ + type?: string; +} + +export interface LoadEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + Model?: any; + + /**returns the entire scale element. + */ + scaleElement?: any; + + /**returns the context element + */ + context?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface MouseClickEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: any; + + /**returns the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the context element + */ + context?: any; + + /**returns the pointer Index + */ + index?: number; + + /**returns the pointer element. + */ + element?: any; + + /**returns the value of the pointer. + */ + value?: number; + + /**returns the angle of the pointer. + */ + angle?: number; + + /**returns the pointer style + */ + style?: string; + + /**returns the startX and startY of the pointer. + */ + position?: any; +} + +export interface MouseClickMoveEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: any; + + /**returns the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the context element + */ + context?: any; + + /**returns the pointer Index + */ + index?: number; + + /**returns the pointer element. + */ + element?: any; + + /**returns the value of the pointer. + */ + value?: number; + + /**returns the angle of the pointer. + */ + angle?: number; + + /**returns the pointer style + */ + style?: string; + + /**returns the startX and startY of the pointer. + */ + position?: any; +} + +export interface MouseClickUpEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: any; + + /**returns the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the context element + */ + context?: any; + + /**returns the pointer Index + */ + index?: number; + + /**returns the pointer element. + */ + element?: any; + + /**returns the value of the pointer. + */ + value?: number; + + /**returns the angle of the pointer. + */ + angle?: number; + + /**returns the pointer style + */ + style?: string; + + /**returns the startX and startY of the pointer. + */ + position?: any; +} + +export interface RenderCompleteEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the entire scale element. + */ + scaleElement?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface Frame { + + /**Specify the url of the frame background image for circular gauge + * @Default {null} + */ + backgroundImageUrl?: string; + + /**Specifies the frameType of circular gauge. See Frame + * @Default {FullCircle} + */ + frameType?: ej.datavisualization.CircularGauge.FrameType|string; + + /**Specifies the end angle for the half circular frame. + * @Default {360} + */ + halfCircleFrameEndAngle?: number; + + /**Specifies the start angle for the half circular frame. + * @Default {180} + */ + halfCircleFrameStartAngle?: number; +} + +export interface ScalesBorder { + + /**Specify border color for scales of circular gauge + * @Default {null} + */ + color?: string; + + /**Specify border width of circular gauge + * @Default {1.5} + */ + width?: number; +} + +export interface ScalesIndicatorsPosition { + + /**Specify x-axis of position of circular gauge + * @Default {0} + */ + x?: number; + + /**Specify y-axis of position of circular gauge + * @Default {0} + */ + y?: number; +} + +export interface ScalesIndicatorsStateRanges { + + /**Specify backgroundColor for indicator of circular gauge + * @Default {null} + */ + backgroundColor?: string; + + /**Specify borderColor for indicator of circular gauge + * @Default {null} + */ + borderColor?: string; + + /**Specify end value for each specified state of circular gauge + * @Default {0} + */ + endValue?: number; + + /**Specify value of the font as the indicator when the indicator style is set with the value "text" of circular gauge + * @Default {null} + */ + font?: any; + + /**Specify start value for each specified state of circular gauge + * @Default {0} + */ + startValue?: number; + + /**Specify value of the text as the indicator when the indicator style is set with the value "text" of circular gauge + */ + text?: string; + + /**Specify value of the textColor as the indicator when the indicator style is set with the value "text" of circular gauge + * @Default {null} + */ + textColor?: string; +} + +export interface ScalesIndicators { + + /**Specify indicator height of circular gauge + * @Default {15} + */ + height?: number; + + /**Specify imageUrl of circular gauge + * @Default {null} + */ + imageUrl?: string; + + /**Specify position of circular gauge + * @Default {Object} + */ + position?: ScalesIndicatorsPosition; + + /**Specify the various states of circular gauge + * @Default {Array} + */ + stateRanges?: Array; + + /**Specify indicator style of circular gauge. See IndicatorType + * @Default {Circle} + */ + type?: ej.datavisualization.CircularGauge.IndicatorTypes|string; + + /**Specify indicator width of circular gauge + * @Default {15} + */ + width?: number; +} + +export interface ScalesLabelsFont { + + /**Specify font fontFamily for labels of circular gauge + * @Default {Arial} + */ + fontFamily?: string; + + /**Specify font Style for labels of circular gauge + * @Default {Bold} + */ + fontStyle?: string; + + /**Specify font size for labels of circular gauge + * @Default {11px} + */ + size?: string; +} + +export interface ScalesLabels { + + /**Specify the angle for the labels of circular gauge + * @Default {0} + */ + angle?: number; + + /**Specify labels autoAngle value of circular gauge + * @Default {false} + */ + autoAngle?: boolean; + + /**Specify label color of circular gauge + * @Default {null} + */ + color?: string; + + /**Specify distanceFromScale value for labels of circular gauge + * @Default {0} + */ + distanceFromScale?: number; + + /**Specify font for labels of circular gauge + * @Default {Object} + */ + font?: ScalesLabelsFont; + + /**Specify includeFirstValue of circular gauge + * @Default {true} + */ + includeFirstValue?: boolean; + + /**Specify opacity value for labels of circular gauge + * @Default {null} + */ + opacity?: number; + + /**Specify label placement of circular gauge. See LabelPlacement + * @Default {Near} + */ + placement?: ej.datavisualization.CircularGauge.Placement|string; + + /**Specify label Style of circular gauge. See LabelType + * @Default {Major} + */ + type?: ej.datavisualization.CircularGauge.LabelType|string; + + /**Specify unitText of circular gauge + */ + unitText?: string; + + /**Specify unitTextPosition of circular gauge. See UnitTextPosition + * @Default {Back} + */ + unitTextPosition?: ej.datavisualization.CircularGauge.UnitTextPlacement|string; +} + +export interface ScalesPointerCap { + + /**Specify cap backgroundColor of circular gauge + * @Default {null} + */ + backgroundColor?: string; + + /**Specify cap borderColor of circular gauge + * @Default {null} + */ + borderColor?: string; + + /**Specify pointerCap borderWidth value of circular gauge + * @Default {3} + */ + borderWidth?: number; + + /**Specify cap interiorGradient value of circular gauge + * @Default {null} + */ + interiorGradient?: any; + + /**Specify pointerCap Radius value of circular gauge + * @Default {7} + */ + radius?: number; +} + +export interface ScalesPointersBorder { + + /**Specify border color for pointer of circular gauge + * @Default {null} + */ + color?: string; + + /**Specify border width for pointers of circular gauge + * @Default {1.5} + */ + width?: number; +} + +export interface ScalesPointersPointerValueTextFont { + + /**Specify pointer value text font family of circular gauge. + * @Default {Arial} + */ + fontFamily?: string; + + /**Specify pointer value text font style of circular gauge. + * @Default {Bold} + */ + fontStyle?: string; + + /**Specify pointer value text size of circular gauge. + * @Default {11px} + */ + size?: string; +} + +export interface ScalesPointersPointerValueText { + + /**Specify pointer text angle of circular gauge. + * @Default {0} + */ + angle?: number; + + /**Specify pointer text auto angle of circular gauge. + * @Default {false} + */ + autoAngle?: boolean; + + /**Specify pointer value text color of circular gauge. + * @Default {#8c8c8c} + */ + color?: string; + + /**Specify pointer value text distance from pointer of circular gauge. + * @Default {20} + */ + distance?: number; + + /**Specify pointer value text font option of circular gauge. + * @Default {object} + */ + font?: ScalesPointersPointerValueTextFont; + + /**Specify pointer value text opacity of circular gauge. + * @Default {1} + */ + opacity?: number; + + /**enable pointer value text visibility of circular gauge. + * @Default {false} + */ + showValue?: boolean; +} + +export interface ScalesPointers { + + /**Specify backgroundColor for the pointer of circular gauge + * @Default {null} + */ + backgroundColor?: string; + + /**Specify backNeedleLength of circular gauge + * @Default {10} + */ + backNeedleLength?: number; + + /**Specify the border for pointers of circular gauge + * @Default {Object} + */ + border?: ScalesPointersBorder; + + /**Specify distanceFromScale value for pointers of circular gauge + * @Default {0} + */ + distanceFromScale?: number; + + /**Specify pointer gradients of circular gauge + * @Default {null} + */ + gradients?: any; + + /**Specify pointer image of circular gauge.It is applicable for both marker as well as needle type pointers. + * @Default {NULL} + */ + imageUrl?: string; + + /**Specify pointer length of circular gauge + * @Default {150} + */ + length?: number; + + /**Specify marker Style value of circular gauge. See MarkerType + * @Default {Rectangle} + */ + markerType?: ej.datavisualization.CircularGauge.MarkerType|string; + + /**Specify needle Style value of circular gauge. See NeedleType + * @Default {Triangle} + */ + needleType?: ej.datavisualization.CircularGauge.NeedleType|string; + + /**Specify opacity value for pointer of circular gauge + * @Default {1} + */ + opacity?: number; + + /**Specify pointer Placement value of circular gauge. See PointerPlacement + * @Default {Near} + */ + placement?: ej.datavisualization.CircularGauge.Placement|string; + + /**Specify pointer value text of circular gauge. + * @Default {Object} + */ + pointerValueText?: ScalesPointersPointerValueText; + + /**Specify showBackNeedle value of circular gauge + * @Default {false} + */ + showBackNeedle?: boolean; + + /**Specify pointer type value of circular gauge. See PointerType + * @Default {Needle} + */ + type?: ej.datavisualization.CircularGauge.PointerType|string; + + /**Specify value of the pointer of circular gauge + * @Default {null} + */ + value?: number; + + /**Specify pointer width of circular gauge + * @Default {7} + */ + width?: number; +} + +export interface ScalesRangesBorder { + + /**Specify border color for ranges of circular gauge + * @Default {#32b3c6} + */ + color?: string; + + /**Specify border width for ranges of circular gauge + * @Default {1.5} + */ + width?: number; +} + +export interface ScalesRanges { + + /**Specify backgroundColor for the ranges of circular gauge + * @Default {#32b3c6} + */ + backgroundColor?: string; + + /**Specify border for ranges of circular gauge + * @Default {Object} + */ + border?: ScalesRangesBorder; + + /**Specify distanceFromScale value for ranges of circular gauge + * @Default {25} + */ + distanceFromScale?: number; + + /**Specify endValue for ranges of circular gauge + * @Default {null} + */ + endValue?: number; + + /**Specify endWidth for ranges of circular gauge + * @Default {10} + */ + endWidth?: number; + + /**Specify range gradients of circular gauge + * @Default {null} + */ + gradients?: any; + + /**Specify opacity value for ranges of circular gauge + * @Default {null} + */ + opacity?: number; + + /**Specify placement of circular gauge. See RangePlacement + * @Default {Near} + */ + placement?: ej.datavisualization.CircularGauge.Placement|string; + + /**Specify size of the range value of circular gauge + * @Default {5} + */ + size?: number; + + /**Specify startValue for ranges of circular gauge + * @Default {null} + */ + startValue?: number; + + /**Specify startWidth of circular gauge + * @Default {[Array.number] scale.ranges.startWidth = 10} + */ + startWidth?: number; +} + +export interface ScalesSubGaugesPosition { + + /**Specify x-axis position for sub-gauge of circular gauge + * @Default {0} + */ + x?: number; + + /**Specify y-axis position for sub-gauge of circular gauge + * @Default {0} + */ + y?: number; +} + +export interface ScalesSubGauges { + + /**Specify subGauge Height of circular gauge + * @Default {150} + */ + height?: number; + + /**Specify position for sub-gauge of circular gauge + * @Default {Object} + */ + position?: ScalesSubGaugesPosition; + + /**Specify subGauge Width of circular gauge + * @Default {150} + */ + width?: number; +} + +export interface ScalesTicks { + + /**Specify the angle for the ticks of circular gauge + * @Default {0} + */ + angle?: number; + + /**Specify tick color of circular gauge + * @Default {null} + */ + color?: string; + + /**Specify distanceFromScale value for ticks of circular gauge + * @Default {0} + */ + distanceFromScale?: number; + + /**Specify tick height of circular gauge + * @Default {16} + */ + height?: number; + + /**Specify tick placement of circular gauge. See TickPlacement + * @Default {Near} + */ + placement?: ej.datavisualization.CircularGauge.Placement|string; + + /**Specify tick Style of circular gauge. See TickType + * @Default {Major} + */ + type?: ej.datavisualization.CircularGauge.LabelType|string; + + /**Specify tick width of circular gauge + * @Default {3} + */ + width?: number; +} + +export interface Scales { + + /**Specify backgroundColor for the scale of circular gauge + * @Default {null} + */ + backgroundColor?: string; + + /**Specify border for scales of circular gauge + * @Default {Object} + */ + border?: ScalesBorder; + + /**Specify scale direction of circular gauge. See Directions + * @Default {Clockwise} + */ + direction?: ej.datavisualization.CircularGauge.Direction|string; + + /**Specify representing state of circular gauge + * @Default {Array} + */ + indicators?: Array; + + /**Specify the text values displayed in a meaningful manner alongside the ticks of circular gauge + * @Default {Array} + */ + labels?: Array; + + /**Specify majorIntervalValue of circular gauge + * @Default {10} + */ + majorIntervalValue?: number; + + /**Specify maximum scale value of circular gauge + * @Default {null} + */ + maximum?: number; + + /**Specify minimum scale value of circular gauge + * @Default {null} + */ + minimum?: number; + + /**Specify minorIntervalValue of circular gauge + * @Default {2} + */ + minorIntervalValue?: number; + + /**Specify opacity value of circular gauge + * @Default {1} + */ + opacity?: number; + + /**Specify pointer cap of circular gauge + * @Default {Object} + */ + pointerCap?: ScalesPointerCap; + + /**Specify pointers value of circular gauge + * @Default {Array} + */ + pointers?: Array; + + /**Specify scale radius of circular gauge + * @Default {170} + */ + radius?: number; + + /**Specify ranges value of circular gauge + * @Default {Array} + */ + ranges?: Array; + + /**Specify shadowOffset value of circular gauge + * @Default {0} + */ + shadowOffset?: number; + + /**Specify showIndicators of circular gauge + * @Default {false} + */ + showIndicators?: boolean; + + /**Specify showLabels of circular gauge + * @Default {true} + */ + showLabels?: boolean; + + /**Specify showPointers of circular gauge + * @Default {true} + */ + showPointers?: boolean; + + /**Specify showRanges of circular gauge + * @Default {false} + */ + showRanges?: boolean; + + /**Specify showScaleBar of circular gauge + * @Default {false} + */ + showScaleBar?: boolean; + + /**Specify showTicks of circular gauge + * @Default {true} + */ + showTicks?: boolean; + + /**Specify scaleBar size of circular gauge + * @Default {6} + */ + size?: number; + + /**Specify startAngle of circular gauge + * @Default {115} + */ + startAngle?: number; + + /**Specify subGauge of circular gauge + * @Default {Array} + */ + subGauges?: Array; + + /**Specify sweepAngle of circular gauge + * @Default {310} + */ + sweepAngle?: number; + + /**Specify ticks of circular gauge + * @Default {Array} + */ + ticks?: Array; +} + +export interface Tooltip { + + /**enable showCustomLabelTooltip of circular gauge + * @Default {false} + */ + showCustomLabelTooltip?: boolean; + + /**enable showLabelTooltip of circular gauge + * @Default {false} + */ + showLabelTooltip?: boolean; + + /**Specify tooltip templateID of circular gauge + * @Default {false} + */ + templateID?: string; +} +} +module CircularGauge +{ +enum FrameType +{ +//string +FullCircle, +//string +HalfCircle, +} +} +module CircularGauge +{ +enum gaugePosition +{ +//string +TopLeft, +//string +TopRight, +//string +TopCenter, +//string +MiddleLeft, +//string +MiddleRight, +//string +Center, +//string +BottomLeft, +//string +BottomRight, +//string +BottomCenter, +} +} +module CircularGauge +{ +enum CustomLabelPositionType +{ +//string +Top, +//string +Bottom, +//string +Right, +//string +Left, +} +} +module CircularGauge +{ +enum Direction +{ +//string +Clockwise, +//string +CounterClockwise, +} +} +module CircularGauge +{ +enum IndicatorTypes +{ +//string +Rectangle, +//string +Circle, +//string +Text, +//string +RoundedRectangle, +//string +Image, +} +} +module CircularGauge +{ +enum Placement +{ +//string +Near, +//string +Far, +} +} +module CircularGauge +{ +enum LabelType +{ +//string +Major, +//string +Minor, +} +} +module CircularGauge +{ +enum UnitTextPlacement +{ +//string +Back, +//string +Front, +} +} +module CircularGauge +{ +enum MarkerType +{ +//string +Rectangle, +//string +Circle, +//string +Triangle, +//string +Ellipse, +//string +Diamond, +//string +Pentagon, +//string +Slider, +//string +Pointer, +//string +Wedge, +//string +Trapezoid, +//string +RoundedRectangle, +//string +Image, +} +} +module CircularGauge +{ +enum NeedleType +{ +//string +Triangle, +//string +Rectangle, +//string +Arrow, +//string +Image, +//string +Trapezoid, +} +} +module CircularGauge +{ +enum PointerType +{ +//string +Needle, +//string +Marker, +} +} + +class DigitalGauge extends ej.Widget { + static fn: DigitalGauge; + constructor(element: JQuery, options?: DigitalGauge.Model); + constructor(element: Element, options?: DigitalGauge.Model); + model:DigitalGauge.Model; + defaults:DigitalGauge.Model; + + /** To destroy the digital gauge + * @returns {void} + */ + destroy(): void; + + /** To export Digital Gauge as Image + * @param {string} fileName for the Image + * @param {string} fileType for the Image + * @returns {void} + */ + exportImage(fileName: string, fileType: string): void; + + /** Gets the location of an item that is displayed on the gauge. + * @param {number} Position value of an item that is displayed on the gauge. + * @returns {void} + */ + getPosition(itemIndex: number): void; + + /** ClientSideMethod getValue Gets the value of an item that is displayed on the gauge + * @param {number} Index value of an item that displayed on the gauge + * @returns {void} + */ + getValue(itemIndex: number): void; + + /** Refresh the digital gauge widget + * @returns {void} + */ + refresh(): void; + + /** ClientSideMethod Set Position Sets the location of an item to be displayed in the gauge + * @param {number} Index value of the digital gauge item + * @param {any} Location value of the digital gauge + * @returns {void} + */ + setPosition(itemIndex: number, value: any): void; + + /** ClientSideMethod SetValue Sets the value of an item to be displayed in the gauge. + * @param {number} Index value of the digital gauge item + * @param {string} Text value to be displayed in the gaugeS + * @returns {void} + */ + setValue(itemIndex: number, value: string): void; +} +export module DigitalGauge{ + +export interface Model { + + /**Specifies the resize option of the DigitalGauge. + * @Default {false} + */ + enableResize?: boolean; + + /**Specifies the frame of the Digital gauge. + * @Default {{backgroundImageUrl: null, innerWidth: 6, outerWidth: 10}} + */ + frame?: Frame; + + /**Specifies the height of the DigitalGauge. + * @Default {150} + */ + height?: number; + + /**Specifies the items for the DigitalGauge. + * @Default {null} + */ + items?: Items; + + /**Specifies the matrixSegmentData for the DigitalGauge. + */ + matrixSegmentData?: any; + + /**Specifies the segmentData for the DigitalGauge. + */ + segmentData?: any; + + /**Specifies the themes for the Digital gauge. See Themes + * @Default {flatlight} + */ + themes?: string; + + /**Specifies the value to the DigitalGauge. + * @Default {text} + */ + value?: string; + + /**Specifies the width for the Digital gauge. + * @Default {400} + */ + width?: number; + + /**Triggers when the gauge is initialized.*/ + init? (e: InitEventArgs): void; + + /**Triggers when the gauge item rendering.*/ + itemRendering? (e: ItemRenderingEventArgs): void; + + /**Triggers when the gauge is start to load.*/ + load? (e: LoadEventArgs): void; + + /**Triggers when the gauge render is completed.*/ + renderComplete? (e: RenderCompleteEventArgs): void; +} + +export interface InitEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the all the options of the items. + */ + items?: any; + + /**returns the context element + */ + context?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface ItemRenderingEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the all the options of the items. + */ + items?: any; + + /**returns the context element + */ + context?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface LoadEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the all the options of the items. + */ + items?: any; + + /**returns the context element + */ + context?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface RenderCompleteEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the all the options of the items. + */ + items?: any; + + /**returns the context element + */ + context?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface Frame { + + /**Specifies the url of an image to be displayed as background of the Digital gauge. + * @Default {null} + */ + backgroundImageUrl?: string; + + /**Specifies the inner width for the frame, when the background image has been set for the Digital gauge.. + * @Default {6} + */ + innerWidth?: number; + + /**Specifies the outer width of the frame, when the background image has been set for the Digital gauge. + * @Default {10} + */ + outerWidth?: number; +} + +export interface ItemsCharacterSettings { + + /**Specifies the CharacterCount value for the DigitalGauge. + * @Default {4} + */ + count?: number; + + /**Specifies the opacity value for the DigitalGauge. + * @Default {1} + */ + opacity?: number; + + /**Specifies the value for spacing between the characters + * @Default {2} + */ + spacing?: number; + + /**Specifies the character type for the text to be displayed. + * @Default {ej.datavisualization.DigitalGauge.CharacterType.EightCrossEightDotMatrix} + */ + type?: ej.datavisualization.DigitalGauge.CharacterType|string; +} + +export interface ItemsFont { + + /**Set the font family value + * @Default {Arial} + */ + fontFamily?: string; + + /**Set the font style for the font + * @Default {italic} + */ + fontStyle?: ej.datavisualization.DigitalGauge.FontStyle|string; + + /**Set the font size value + * @Default {11px} + */ + size?: string; +} + +export interface ItemsPosition { + + /**Set the horizontal location for the text, where it needs to be placed within the gauge. + * @Default {0} + */ + x?: number; + + /**Set the vertical location for the text, where it needs to be placed within the gauge. + * @Default {0} + */ + y?: number; +} + +export interface ItemsSegmentSettings { + + /**Set the color for the text segments. + * @Default {null} + */ + color?: string; + + /**Set the gradient for the text segments. + * @Default {null} + */ + gradient?: any; + + /**Set the length for the text segments. + * @Default {2} + */ + length?: number; + + /**Set the opacity for the text segments. + * @Default {0} + */ + opacity?: number; + + /**Set the spacing for the text segments. + * @Default {1} + */ + spacing?: number; + + /**Set the width for the text segments. + * @Default {1} + */ + width?: number; +} + +export interface Items { + + /**Specifies the Character settings for the DigitalGauge. + * @Default {null} + */ + characterSettings?: ItemsCharacterSettings; + + /**Enable/Disable the custom font to be applied to the text in the gauge. + * @Default {false} + */ + enableCustomFont?: boolean; + + /**Set the specific font for the text, when the enableCustomFont is set to true + * @Default {null} + */ + font?: ItemsFont; + + /**Set the location for the text, where it needs to be placed within the gauge. + * @Default {null} + */ + position?: ItemsPosition; + + /**Set the segment settings for the digital gauge. + * @Default {null} + */ + segmentSettings?: ItemsSegmentSettings; + + /**Set the value for enabling/disabling the blurring effect for the shadows of the text + * @Default {0} + */ + shadowBlur?: number; + + /**Specifies the color of the text shadow. + * @Default {null} + */ + shadowColor?: string; + + /**Set the x offset value for the shadow of the text, indicating the location where it needs to be displayed. + * @Default {1} + */ + shadowOffsetX?: number; + + /**Set the y offset value for the shadow of the text, indicating the location where it needs to be displayed. + * @Default {1} + */ + shadowOffsetY?: number; + + /**Set the alignment of the text that is displayed within the gauge.See TextAlign + * @Default {left} + */ + textAlign?: string; + + /**Specifies the color of the text. + * @Default {null} + */ + textColor?: string; + + /**Specifies the text value. + * @Default {null} + */ + value?: string; +} +} +module DigitalGauge +{ +enum CharacterType +{ +//string +SevenSegment, +//string +FourteenSegment, +//string +SixteenSegment, +//string +EightCrossEightDotMatrix, +//string +EightCrossEightSquareMatrix, +} +} +module DigitalGauge +{ +enum FontStyle +{ +//string +Normal, +//string +Bold, +//string +Italic, +//string +Underline, +//string +Strikeout, +} +} + +class Chart extends ej.Widget { + static fn: Chart; + constructor(element: JQuery, options?: Chart.Model); + constructor(element: Element, options?: Chart.Model); + model:Chart.Model; + defaults:Chart.Model; + + /** Animates the series and/or indicators in Chart. When parameter is not passed to this method, then all the series and indicators present in Chart are animated. + * @param {Array} Series and indicator objects passed in the array collection are animated.Example + * @param {any} Series or indicator object passed to this method are animated.Example, + * @returns {void} + */ + animate(options: Array, option: any): void; + + /** Exports chart as an image or to an excel file. Chart can be exported as an image only when exportCanvasRendering option is set to true. + * @param {string} Type of the export operation to be performed. Following are the two export types that are supported now,1. 'image'2. 'excel'Example + * @param {string} URL of the service, where the chart will be exported to excel.Example, + * @param {boolean} When this parameter is true, all the chart objects initialized to the same document are exported to a single excel file. This is an optional parameter. By default, it is false.Example, + * @returns {void} + */ + export(type: string, url: string, exportMultipleChart: boolean): void; + + /** Redraws the entire chart. You can call this method whenever you update, add or remove points from the data source or whenever you want to refresh the UI. + * @returns {void} + */ + redraw(): void; +} +export module Chart{ + +export interface Model { + + /**Options for adding and customizing annotations in Chart. + */ + annotations?: Array; + + /**Url of the image to be used as chart background. + * @Default {null} + */ + backGroundImageUrl?: string; + + /**Options for customizing the color, opacity and width of the chart border. + */ + border?: Border; + + /**Controls whether Chart has to be responsive or not. + * @Default {false} + */ + canResize?: boolean; + + /**Options for configuring the border and background of the plot area. + */ + chartArea?: ChartArea; + + /**Options to split Chart into multiple plotting areas vertically. Each object in the collection represents a plotting area in Chart. + */ + columnDefinitions?: Array; + + /**Options for configuring the properties of all the series. You can also override the options for specific series by using series collection. + */ + commonSeriesOptions?: CommonSeriesOptions; + + /**Options for displaying and customizing the crosshair. + */ + crosshair?: Crosshair; + + /**Depth of the 3D Chart from front view of series to background wall. This property is applicable only for 3D view. + * @Default {100} + */ + depth?: number; + + /**Controls whether 3D view has to be enabled or not. 3D view is supported only for column, bar. Stacking column, stacking bar, pie and doughnut series types. + * @Default {false} + */ + enable3D?: boolean; + + /**Controls whether Chart has to be rendered as Canvas or SVG. Canvas rendering supports all functionalities in SVG rendering except 3D Charts. + * @Default {false} + */ + enableCanvasRendering?: boolean; + + /**Controls whether 3D view has to be rotated on dragging. This property is applicable only for 3D view. + * @Default {false} + */ + enableRotation?: boolean; + + /**Options to customize the technical indicators. + */ + indicators?: Array; + + /**Options to customize the legend items and legend title. + */ + legend?: Legend; + + /**Name of the culture based on which chart should be localized. Number and date time values are localized with respect to the culture name.String type properties like title text are not localized automatically. Provide localized text as value to string type properties. + * @Default {en-US} + */ + locale?: string; + + /**Palette is used to store the series fill color in array and apply the color to series collection in the order of series index. + * @Default {null} + */ + palette?: Array; + + /**Options to customize the left, right, top and bottom margins of chart area. + */ + Margin?: any; + + /**Perspective angle of the 3D view. Chart appears closer when perspective angle is decreased, and distant when perspective angle is increased.This property is applicable only when 3D view is enabled + * @Default {90} + */ + perspectiveAngle?: number; + + /**This is a horizontal axis that contains options to configure axis and it is the primary x axis for all the series in series array. To override x axis for particular series, create an axis object by providing unique name by using name property and add it to axes array. Then, assign the name to the series’s xAxisName property to link both axis and series. + */ + primaryXAxis?: PrimaryXAxis; + + /**This is a vertical axis that contains options to configure axis. This is the primary y axis for all the series in series array. To override y axis for particular series, create an axis object by providing unique name by using name property and add it to axes array. Then, assign the name to the series’s yAxisName property to link both axis and series. + */ + primaryYAxis?: PrimaryYAxis; + + /**Rotation angle of the 3D view. This property is applicable only when 3D view is enabled. + * @Default {0} + */ + rotation?: number; + + /**Options to split Chart into multiple plotting areas horizontally. Each object in the collection represents a plotting area in Chart. + */ + rowDefinitions?: Array; + + /**Specifies the properties used for customizing the series. + */ + series?: Array; + + /**Controls whether data points has to be displayed side by side or along the depth of the axis. + * @Default {false} + */ + sideBySideSeriesPlacement?: boolean; + + /**Options to customize the Chart size. + */ + size?: Size; + + /**Specifies the theme for Chart. + * @Default {Flatlight. See Theme} + */ + theme?: ej.datavisualization.Chart.Theme|string; + + /**Slope angle of 3D Chart. This property is applicable only when 3D view is enabled. + * @Default {0} + */ + tilt?: number; + + /**Options for customizing the title and subtitle of Chart. + */ + title?: Title; + + /**Width of the wall used in 3D Chart. Wall is present only in Cartesian type 3D series and not in 3D pie or Doughnut series. This property is applicable only when 3D view is enabled. + * @Default {2} + */ + wallSize?: number; + + /**Options for enabling zooming feature of chart. + */ + zooming?: Zooming; + + /**Fires after the series animation is completed. This event will be triggered for each series when animation is enabled.*/ + animationComplete? (e: AnimationCompleteEventArgs): void; + + /**Fires before rendering the labels. This event is fired for each label in axis. You can use this event to add custom text to axis labels.*/ + axesLabelRendering? (e: AxesLabelRenderingEventArgs): void; + + /**Fires during the initialization of axis labels.*/ + axesLabelsInitialize? (e: AxesLabelsInitializeEventArgs): void; + + /**Fires during axes range calculation. This event is fired for each axis present in Chart. You can use this event to customize axis range as required.*/ + axesRangeCalculate? (e: AxesRangeCalculateEventArgs): void; + + /**Fires before rendering the axis title. This event is triggered for each axis with title. You can use this event to add custom text to axis title.*/ + axesTitleRendering? (e: AxesTitleRenderingEventArgs): void; + + /**Fires during the calculation of chart area bounds. You can use this event to customize the bounds of chart area.*/ + chartAreaBoundsCalculate? (e: ChartAreaBoundsCalculateEventArgs): void; + + /**Fires after chart is created.*/ + create? (e: CreateEventArgs): void; + + /**Fires when chart is destroyed completely.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires before rendering the data labels. This event is triggered for each data label in the series. You can use this event to add custom text in data labels.*/ + displayTextRendering? (e: DisplayTextRenderingEventArgs): void; + + /**Fires during the calculation of legend bounds. You can use this event to customize the bounds of legend.*/ + legendBoundsCalculate? (e: LegendBoundsCalculateEventArgs): void; + + /**Fires on clicking the legend item.*/ + legendItemClick? (e: LegendItemClickEventArgs): void; + + /**Fires when moving mouse over legend item. You can use this event for hit testing on legend items.*/ + legendItemMouseMove? (e: LegendItemMouseMoveEventArgs): void; + + /**Fires before rendering the legend item. This event is fired for each legend item in Chart. You can use this event to customize legend item shape or add custom text to legend item.*/ + legendItemRendering? (e: LegendItemRenderingEventArgs): void; + + /**Fires before loading the chart.*/ + load? (e: LoadEventArgs): void; + + /**Fires on clicking a point in chart. You can use this event to handle clicks made on points.*/ + pointRegionClick? (e: PointRegionClickEventArgs): void; + + /**Fires when mouse is moved over a point.*/ + pointRegionMouseMove? (e: PointRegionMouseMoveEventArgs): void; + + /**Fires before rendering chart.*/ + preRender? (e: PreRenderEventArgs): void; + + /**Fires after selecting a series. This event is triggered after selecting a series only if selection mode is series.*/ + seriesRegionClick? (e: SeriesRegionClickEventArgs): void; + + /**Fires before rendering a series. This event is fired for each series in Chart.*/ + seriesRendering? (e: SeriesRenderingEventArgs): void; + + /**Fires before rendering the marker symbols. This event is triggered for each marker in Chart.*/ + symbolRendering? (e: SymbolRenderingEventArgs): void; + + /**Fires before rendering the Chart title. You can use this event to add custom text in Chart title.*/ + titleRendering? (e: TitleRenderingEventArgs): void; + + /**Fires before rendering the tooltip. This event is fired when tooltip is enabled and mouse is hovered on a Chart point. You can use this event to customize tooltip before rendering.*/ + toolTipInitialize? (e: ToolTipInitializeEventArgs): void; + + /**Fires before rendering crosshair tooltip in axis. This event is fired for each axis with crosshair label enabled. You can use this event to customize crosshair label before rendering*/ + trackAxisToolTip? (e: TrackAxisToolTipEventArgs): void; + + /**Fires before rendering trackball tooltip. This event is fired for each series in Chart because trackball tooltip is displayed for all the series. You can use this event to customize the text displayed in trackball tooltip.*/ + trackToolTip? (e: TrackToolTipEventArgs): void; + + /**Fires, on clicking the axis label.*/ + axisLabelClick? (e: AxisLabelClickEventArgs): void; + + /**Fires on moving mouse over the axis label.*/ + axisLabelMouseMove? (e: AxisLabelMouseMoveEventArgs): void; + + /**Fires, on the clicking the chart.*/ + chartClick? (e: ChartClickEventArgs): void; + + /**Fires on moving mouse over the chart.*/ + chartMouseMove? (e: ChartMouseMoveEventArgs): void; + + /**Fires, on double clicking the chart.*/ + chartDoubleClick? (e: ChartDoubleClickEventArgs): void; + + /**Fires on clicking the annotation.*/ + annotationClick? (e: AnnotationClickEventArgs): void; + + /**Fires, after the chart is resized.*/ + afterResize? (e: AfterResizeEventArgs): void; + + /**Fires, when chart size is changing.*/ + beforeResize? (e: BeforeResizeEventArgs): void; + + /**Fires, when error bar is rendering.*/ + errorBarRendering? (e: ErrorBarRenderingEventArgs): void; +} + +export interface AnimationCompleteEventArgs { + + /**Instance of the series that completed has animation. + */ + series?: any; + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface AxesLabelRenderingEventArgs { + + /**Instance of the corresponding axis. + */ + Axis?: any; + + /**Formatted text of the respective label. You can also add custom text to the label. + */ + LabelText?: string; + + /**Actual value of the label. + */ + LabelValue?: string; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the chart model object. + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface AxesLabelsInitializeEventArgs { + + /**Collection of axes in Chart + */ + dataAxes?: any; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the chart model object. + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface AxesRangeCalculateEventArgs { + + /**Difference between minimum and maximum value of axis range. + */ + delta?: number; + + /**Interval value of axis range. Grid lines, tick lines and axis labels are drawn based on this interval value. + */ + interval?: number; + + /**Maximum value of axis range. + */ + max?: number; + + /**Minimum value of axis range. + */ + min?: number; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the chart model object. + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface AxesTitleRenderingEventArgs { + + /**Instance of the axis whose title is being rendered + */ + axes?: any; + + /**X-coordinate of title location + */ + locationX?: number; + + /**Y-coordinate of title location + */ + locationY?: number; + + /**Axis title text. You can add custom text to the title. + */ + title?: string; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the chart model object. + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface ChartAreaBoundsCalculateEventArgs { + + /**Height of the chart area. + */ + areaBoundsHeight?: number; + + /**Width of the chart area. + */ + areaBoundsWidth?: number; + + /**X-coordinate of the chart area. + */ + areaBoundsX?: number; + + /**Y-coordinate of the chart area. + */ + areaBoundsY?: number; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the chart model object. + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface CreateEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the chart model object. + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the chart model object. + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface DisplayTextRenderingEventArgs { + + /**Text displayed in data label. You can add custom text to the data label + */ + text?: string; + + /**X-coordinate of data label location + */ + locationX?: number; + + /**Y-coordinate of data label location + */ + locationY?: number; + + /**Index of the series in series Collection whose data label is being rendered + */ + seriesIndex?: number; + + /**Index of the point in series whose data label is being rendered + */ + pointIndex?: number; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the chart model object. + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface LegendBoundsCalculateEventArgs { + + /**Height of the legend. + */ + legendBoundsHeight?: number; + + /**Width of the legend. + */ + legendBoundsWidth?: number; + + /**Number of rows to display the legend items + */ + legendBoundsRows?: number; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the chart model object. + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface LegendItemClickEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X-coordinate of legend item in pixel + */ + startX?: number; + + /**Y-coordinate of legend item in pixel + */ + startY?: number; + + /**Instance of the legend item object that is about to be rendered + */ + LegendItem?: any; + + /**Options to customize the legend item styles such as border, color, size, etc…, + */ + style?: any; + + /**Instance that holds information about legend bounds and legend item bounds. + */ + Bounds?: any; + + /**Name of the legend item shape. Use this option to customize legend item shape before rendering + */ + symbolShape?: string; + + /**Instance of the series object corresponding to the legend item + */ + series?: any; +} + +export interface LegendItemMouseMoveEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X-coordinate of legend item in pixel + */ + startX?: number; + + /**Y-coordinate of legend item in pixel + */ + startY?: number; + + /**Instance of the legend item object that is about to be rendered + */ + LegendItem?: any; + + /**Options to customize the legend item styles such as border, color, size, etc…, + */ + style?: any; + + /**Options to customize the legend item styles such as border, color, size, etc…, + */ + Bounds?: any; + + /**Name of the legend item shape. Use this option to customize legend item shape before rendering + */ + symbolShape?: string; + + /**Instance of the series object corresponding to the legend item + */ + series?: any; +} + +export interface LegendItemRenderingEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X-coordinate of legend item in pixel + */ + startX?: number; + + /**Y-coordinate of legend item in pixel + */ + startY?: number; + + /**Instance of the legend item object that is about to be rendered + */ + legendItem?: any; + + /**Options to customize the legend item styles such as border, color, size, etc. + */ + style?: any; + + /**Name of the legend item shape. Use this option to customize legend item shape before rendering + */ + symbolShape?: string; +} + +export interface LoadEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface PointRegionClickEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X-coordinate of point in pixel + */ + locationX?: number; + + /**Y-coordinate of point in pixel + */ + locationY?: number; + + /**Index of the point in series + */ + pointIndex?: number; + + /**Index of the series in series collection to which the point belongs + */ + seriesIndex?: number; +} + +export interface PointRegionMouseMoveEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X-coordinate of point in pixel + */ + locationX?: number; + + /**Y-coordinate of point in pixel + */ + locationY?: number; + + /**Index of the point in series + */ + pointIndex?: number; + + /**Index of the series in series collection to which the point belongs + */ + seriesIndex?: number; +} + +export interface PreRenderEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface SeriesRegionClickEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Instance of the selected series + */ + series?: any; + + /**Index of the selected series + */ + seriesIndex?: number; +} + +export interface SeriesRenderingEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Instance of the series which is about to get rendered + */ + series?: any; +} + +export interface SymbolRenderingEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Instance that holds the location of marker symbol + */ + location?: any; + + /**Options to customize the marker style such as color, border and size + */ + style?: any; +} + +export interface TitleRenderingEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Option to customize the title location in pixels + */ + location?: any; + + /**Read-only option to find the size of the title + */ + size?: any; + + /**Use this option to add custom text in title + */ + title?: string; +} + +export interface ToolTipInitializeEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Text to be displayed in tooltip. Set this option to customize the text displayed in tooltip + */ + currentText?: string; + + /**Index of the point on which mouse is hovered + */ + pointIndex?: number; + + /**Index of the series in series collection whose point is hovered by mouse + */ + seriesIndex?: number; +} + +export interface TrackAxisToolTipEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Location of the crosshair label in pixels + */ + location?: any; + + /**Index of the axis for which crosshair label is displayed + */ + axisIndex?: number; + + /**Instance of the chart axis object for which cross hair label is displayed + */ + crossAxis?: number; + + /**Text to be displayed in crosshair label. Use this option to add custom text in crosshair label + */ + currentTrackText?: string; +} + +export interface TrackToolTipEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Location of the trackball tooltip in pixels + */ + location?: any; + + /**Index of the point for which trackball tooltip is displayed + */ + pointIndex?: number; + + /**Index of the series in series collection + */ + seriesIndex?: number; + + /**Text to be displayed in trackball tooltip. Use this option to add custom text in trackball tooltip + */ + currentText?: string; + + /**Instance of the series object for which trackball tooltip is displayed. + */ + series?: any; +} + +export interface AxisLabelClickEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X and Y co-ordinate of the labels in chart area. + */ + location?: any; + + /**Index of the label. + */ + index?: number; + + /**Instance of the corresponding axis. + */ + axis?: any; + + /**Label that is clicked. + */ + text?: string; +} + +export interface AxisLabelMouseMoveEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X and Y co-ordinate of the labels in chart area. + */ + location?: any; + + /**Index of the label. + */ + index?: number; + + /**Instance of the corresponding axis. + */ + axis?: any; + + /**Label that is hovered. + */ + text?: string; +} + +export interface ChartClickEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X and Y co-ordinate of the points with respect to chart area. + */ + location?: any; + + /**ID of the target element. + */ + id?: string; + + /**Width and height of the chart. + */ + size?: any; + + /**x-coordinate of the pointer, relative to the page + */ + pageX?: number; + + /**y-coordinate of the pointer, relative to the page + */ + pageY?: number; +} + +export interface ChartMouseMoveEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X and Y co-ordinate of the points with respect to chart area. + */ + location?: any; + + /**ID of the target element. + */ + id?: string; + + /**Width and height of the chart. + */ + size?: any; + + /**x-coordinate of the pointer, relative to the page + */ + pageX?: number; + + /**y-coordinate of the pointer, relative to the page + */ + pageY?: number; +} + +export interface ChartDoubleClickEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X and Y co-ordinate of the points with respect to chart area. + */ + location?: any; + + /**ID of the target element. + */ + id?: string; + + /**Width and height of the chart. + */ + size?: any; + + /**x-coordinate of the pointer, relative to the page + */ + pageX?: number; + + /**y-coordinate of the pointer, relative to the page + */ + pageY?: number; +} + +export interface AnnotationClickEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X and Y co-ordinate of the annotation in chart area. + */ + location?: any; + + /**Information about the annotation, like Coordinate unit, Region, content + */ + contentData?: any; + + /**x-coordinate of the pointer, relative to the page + */ + pageX?: number; + + /**y-coordinate of the pointer, relative to the page + */ + pageY?: number; +} + +export interface AfterResizeEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Chart width, after resize + */ + width?: number; + + /**Chart height, after resize + */ + height?: number; + + /**Chart width, before resize + */ + prevWidth?: number; + + /**Chart height, before resize + */ + prevHeight?: number; + + /**Chart width, when the chart was first rendered + */ + originalWidth?: number; + + /**Chart height, when the chart was first rendered + */ + originalHeight?: number; +} + +export interface BeforeResizeEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Chart width, before resize + */ + currentWidth?: number; + + /**Chart height, before resize + */ + currentHeight?: number; + + /**Chart width, after resize + */ + newWidth?: number; + + /**Chart height, after resize + */ + newHeight?: number; +} + +export interface ErrorBarRenderingEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Error bar Object + */ + errorbar?: any; +} + +export interface AnnotationsMargin { + + /**Annotation is placed at the specified value above its original position. + * @Default {0} + */ + bottom?: number; + + /**Annotation is placed at the specified value from left side of its original position. + * @Default {0} + */ + left?: number; + + /**Annotation is placed at the specified value from the right side of its original position. + * @Default {0} + */ + right?: number; + + /**Annotation is placed at the specified value under its original position. + * @Default {0} + */ + top?: number; +} + +export interface Annotations { + + /**Angle to rotate the annotation in degrees. + * @Default {'0'} + */ + angle?: number; + + /**Text content or id of a HTML element to be displayed as annotation. + */ + content?: string; + + /**Specifies how annotations have to be placed in Chart. + * @Default {none. See CoordinateUnit} + */ + coordinateUnit?: ej.datavisualization.Chart.CoordinateUnit|string; + + /**Specifies the horizontal alignment of the annotation. + * @Default {middle. See HorizontalAlignment} + */ + horizontalAlignment?: ej.datavisualization.Chart.HorizontalAlignment|string; + + /**Options to customize the margin of annotation. + */ + margin?: AnnotationsMargin; + + /**Controls the opacity of the annotation. + * @Default {1} + */ + opacity?: number; + + /**Specifies whether annotation has to be placed with respect to chart or series. + * @Default {chart. See Region} + */ + region?: ej.datavisualization.Chart.Region|string; + + /**Specifies the vertical alignment of the annotation. + * @Default {middle. See VerticalAlignment} + */ + verticalAlignment?: ej.datavisualization.Chart.VerticalAlignment|string; + + /**Controls the visibility of the annotation. + * @Default {false} + */ + visible?: boolean; + + /**Represents the horizontal offset when coordinateUnit is pixels.when coordinateUnit is points, it represents the x-coordinate of axis bounded with xAxisName property or primary X axis when xAxisName is not provided.This property is not applicable when coordinateUnit is none. + * @Default {0} + */ + x?: number; + + /**Name of the horizontal axis to be used for positioning the annotation. This property is applicable only when coordinateUnit is points. + */ + xAxisName?: string; + + /**Represents the vertical offset when coordinateUnit is pixels.When coordinateUnit is points, it represents the y-coordinate of axis bounded with yAxisName property or primary Y axis when yAxisName is not provided.This property is not applicable when coordinateUnit is none. + * @Default {0} + */ + y?: number; + + /**Name of the vertical axis to be used for positioning the annotation.This property is applicable only when coordinateUnit is points. + */ + yAxisName?: string; +} + +export interface Border { + + /**Border color of the chart. + * @Default {null} + */ + color?: string; + + /**Opacity of the chart border. + * @Default {0.3} + */ + opacity?: number; + + /**Width of the Chart border. + * @Default {0} + */ + width?: number; +} + +export interface ChartAreaBorder { + + /**Border color of the plot area. + * @Default {Gray} + */ + color?: string; + + /**Opacity of the plot area border. + * @Default {0.3} + */ + opacity?: number; + + /**Border width of the plot area. + * @Default {0.5} + */ + width?: number; +} + +export interface ChartArea { + + /**Background color of the plot area. + * @Default {transparent} + */ + background?: string; + + /**Options for customizing the border of the plot area. + */ + border?: ChartAreaBorder; +} + +export interface ColumnDefinitions { + + /**Specifies the unit to measure the width of the column in plotting area. + * @Default {'pixel'. See Unit} + */ + unit?: ej.datavisualization.Chart.Unit|string; + + /**Width of the column in plotting area. Width is measured in either pixel or percentage based on the value of unit property. + * @Default {50} + */ + columnWidth?: number; + + /**Color of the line that indicates the starting point of the column in plotting area. + * @Default {transparent} + */ + lineColor?: string; + + /**Width of the line that indicates the starting point of the column in plot area. + * @Default {1} + */ + lineWidth?: number; +} + +export interface CommonSeriesOptionsBorder { + + /**Border color of all series. + * @Default {transparent} + */ + color?: string; + + /**DashArray for border of the series. + * @Default {null} + */ + dashArray?: string; + + /**Border width of all series. + * @Default {1} + */ + width?: number; +} + +export interface CommonSeriesOptionsFont { + + /**Font color of the text in all series. + * @Default {#707070} + */ + color?: string; + + /**Font Family for all the series. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Specifies the font Style for all the series. + * @Default {normal} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Specifies the font weight for all the series. + * @Default {regular} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity for text in all the series. + * @Default {1} + */ + opacity?: number; + + /**Font size for text in all the series. + * @Default {12px} + */ + size?: string; +} + +export interface CommonSeriesOptionsMarkerBorder { + + /**Border color of the marker shape. + * @Default {white} + */ + color?: string; + + /**Border width of the marker shape. + * @Default {3} + */ + width?: number; +} + +export interface CommonSeriesOptionsMarkerDataLabelBorder { + + /**Border color of the data label. + * @Default {null} + */ + color?: string; + + /**Border width of the data label. + * @Default {0.1} + */ + width?: number; +} + +export interface CommonSeriesOptionsMarkerDataLabelConnectorLine { + + /**Specifies when the connector has to be drawn as Bezier curve or straight line. This is applicable only for Pie and Doughnut chart types. + * @Default {line. See ConnectorLineType} + */ + type?: ej.datavisualization.Chart.ConnectorLineType|string; + + /**Width of the connector. + * @Default {0.5} + */ + width?: number; +} + +export interface CommonSeriesOptionsMarkerDataLabelFont { + + /**Font family of the data label. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style of the data label. + * @Default {normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the data label. + * @Default {regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of the text. + * @Default {1} + */ + opacity?: number; + + /**Font size of the data label. + * @Default {12px} + */ + size?: string; +} + +export interface CommonSeriesOptionsMarkerDataLabelMargin { + + /**Bottom margin of the text. + * @Default {5} + */ + bottom?: number; + + /**Left margin of the text. + * @Default {5} + */ + left?: number; + + /**Right margin of the text. + * @Default {5} + */ + right?: number; + + /**Top margin of the text. + * @Default {5} + */ + top?: number; +} + +export interface CommonSeriesOptionsMarkerDataLabel { + + /**Angle of the data label in degrees. Only the text gets rotated, whereas the background and border does not rotate. + * @Default {null} + */ + angle?: number; + + /**Options for customizing the border of the data label. + */ + border?: CommonSeriesOptionsMarkerDataLabelBorder; + + /**Options for displaying and customizing the line that connects point and data label. + */ + connectorLine?: CommonSeriesOptionsMarkerDataLabelConnectorLine; + + /**Background color of the data label. + * @Default {null} + */ + fill?: string; + + /**Options for customizing the data label font. + */ + font?: CommonSeriesOptionsMarkerDataLabelFont; + + /**Horizontal alignment of the data label. + * @Default {center} + */ + horizontalTextAlignment?: ej.datavisualization.Chart.HorizontalTextAlignment|string; + + /**Margin of the text to its background shape. The size of the background shape increases based on the margin applied to its text. + */ + margin?: CommonSeriesOptionsMarkerDataLabelMargin; + + /**Opacity of the data label. + * @Default {1} + */ + opacity?: number; + + /**Background shape of the data label. + * @Default {none. See Shape} + */ + shape?: ej.datavisualization.Chart.Shape|string; + + /**Name of a field in data source, where datalabel text is displayed. + */ + textMappingName?: string; + + /**Specifies the position of the data label. This property can be used only for the series such as column, bar, stacked column, stacked bar, 100% stacked column, 100% stacked bar, candle and OHLC. + * @Default {top. See TextPosition} + */ + textPosition?: ej.datavisualization.Chart.TextPosition|string; + + /**Vertical alignment of the data label. + * @Default {center} + */ + verticalTextAlignment?: ej.datavisualization.Chart.VerticalTextAlignment|string; + + /**Controls the visibility of the data labels. + * @Default {false} + */ + visible?: boolean; +} + +export interface CommonSeriesOptionsMarkerSize { + + /**Height of the marker. + * @Default {6} + */ + height?: number; + + /**Width of the marker. + * @Default {6} + */ + width?: number; +} + +export interface CommonSeriesOptionsMarker { + + /**Options for customizing the border of the marker shape. + */ + border?: CommonSeriesOptionsMarkerBorder; + + /**Options for displaying and customizing data labels. + */ + dataLabel?: CommonSeriesOptionsMarkerDataLabel; + + /**Color of the marker shape. + * @Default {null} + */ + fill?: string; + + /**The URL for the Image to be displayed as marker. In order to display image as marker, set series.marker.shape as ‘image’. + */ + imageUrl?: string; + + /**Opacity of the marker. + * @Default {1} + */ + opacity?: number; + + /**Specifies the shape of the marker. + * @Default {circle. See Shape} + */ + shape?: ej.datavisualization.Chart.Shape|string; + + /**Options for customizing the size of the marker shape. + */ + size?: CommonSeriesOptionsMarkerSize; + + /**Controls the visibility of the marker shape. + * @Default {false} + */ + visible?: boolean; +} + +export interface CommonSeriesOptionsTooltipBorder { + + /**Border color of the tooltip. + * @Default {null} + */ + color?: string; + + /**Border width of the tooltip. + * @Default {1} + */ + width?: number; +} + +export interface CommonSeriesOptionsTooltip { + + /**Options for customizing the border of the tooltip. + */ + border?: CommonSeriesOptionsTooltipBorder; + + /**Customize the corner radius of the tooltip rectangle. + * @Default {0} + */ + rx?: number; + + /**Customize the corner radius of the tooltip rectangle. + * @Default {0} + */ + ry?: number; + + /**Specifies the duration, the tooltip has to be displayed. + * @Default {500ms} + */ + duration?: string; + + /**Enables/disables the animation of the tooltip when moving from one point to other. + * @Default {true} + */ + enableAnimation?: boolean; + + /**Background color of the tooltip. + * @Default {null} + */ + fill?: string; + + /**Format of the tooltip content. + * @Default {#point.x# : #point.y#} + */ + format?: string; + + /**Opacity of the tooltip. + * @Default {0.5} + */ + opacity?: number; + + /**Custom template to format the tooltip content. Use “point.x” and “point.y” as a placeholder text to display the corresponding data point’s x and y value. + * @Default {null} + */ + template?: string; + + /**Controls the visibility of the tooltip. + * @Default {false} + */ + visible?: boolean; +} + +export interface CommonSeriesOptionsEmptyPointSettingsStyleBorder { + + /**Border color of the empty point. + */ + color?: string; + + /**Border width of the empty point. + * @Default {1} + */ + width?: number; +} + +export interface CommonSeriesOptionsEmptyPointSettingsStyle { + + /**Color of the empty point. + */ + color?: string; + + /**Options for customizing border of the empty point in the series. + */ + border?: CommonSeriesOptionsEmptyPointSettingsStyleBorder; +} + +export interface CommonSeriesOptionsEmptyPointSettings { + + /**Controls the visibility of the empty point. + * @Default {true} + */ + visible?: boolean; + + /**Specifies the mode of empty point. + * @Default {gap} + */ + displayMode?: ej.datavisualization.Chart.EmptyPointMode|string; + + /**Options for customizing the color and border of the empty point in the series. + */ + style?: CommonSeriesOptionsEmptyPointSettingsStyle; +} + +export interface CommonSeriesOptionsConnectorLine { + + /**Width of the connector line. + * @Default {1} + */ + width?: number; + + /**Color of the connector line. + * @Default {#565656} + */ + color?: string; + + /**DashArray of the connector line. + * @Default {null} + */ + dashArray?: string; + + /**DashArray of the connector line. + * @Default {1} + */ + opacity?: number; +} + +export interface CommonSeriesOptionsErrorBarCap { + + /**Show/Hides the error bar cap. + * @Default {true} + */ + visible?: boolean; + + /**Width of the error bar cap. + * @Default {1} + */ + width?: number; + + /**Length of the error bar cap. + * @Default {1} + */ + length?: number; + + /**Color of the error bar cap. + * @Default {“#000000”} + */ + fill?: string; +} + +export interface CommonSeriesOptionsErrorBar { + + /**Show/hides the error bar + * @Default {visible} + */ + visibility?: boolean; + + /**Specifies the type of error bar. + * @Default {FixedValue} + */ + type?: ej.datavisualization.Chart.ErrorBarType|string; + + /**Specifies the mode of error bar. + * @Default {vertical} + */ + mode?: ej.datavisualization.Chart.ErrorBarMode|string; + + /**Specifies the direction of error bar. + * @Default {both} + */ + direction?: ej.datavisualization.Chart.ErrorBarDirection|string; + + /**Value of vertical error bar. + * @Default {3} + */ + verticalErrorValue?: number; + + /**Value of horizontal error bar. + * @Default {1} + */ + horizontalErrorValue?: number; + + /**Value of positive horizontal error bar. + * @Default {1} + */ + horizontalPositiveErrorValue?: number; + + /**Value of negative horizontal error bar. + * @Default {1} + */ + horizontalNegativeErrorValue?: number; + + /**Value of positive vertical error bar. + * @Default {5} + */ + verticalPositiveErrorValue?: number; + + /**Value of negative vertical error bar. + * @Default {5} + */ + verticalNegativeErrorValue?: number; + + /**Fill color of the error bar. + * @Default {#000000} + */ + fill?: string; + + /**Width of the error bar. + * @Default {1} + */ + width?: number; + + /**Options for customizing the error bar cap. + */ + cap?: CommonSeriesOptionsErrorBarCap; +} + +export interface CommonSeriesOptionsTrendlines { + + /**Show/hides the trendline. + */ + visibility?: boolean; + + /**Specifies the type of the trendline for the series. + * @Default {linear. See TrendlinesType} + */ + type?: string; + + /**Name for the trendlines that is to be displayed in the legend text. + * @Default {trendline} + */ + name?: string; + + /**Fill color of the trendlines. + * @Default {#0000FF} + */ + fill?: string; + + /**Width of the trendlines. + * @Default {1} + */ + width?: number; + + /**Opacity of the trendline. + * @Default {1} + */ + opacity?: number; + + /**Pattern of dashes and gaps used to stroke the trendline. + */ + dashArray?: string; + + /**Future trends of the current series. + * @Default {0} + */ + forwardForecast?: number; + + /**Past trends of the current series. + * @Default {0} + */ + backwardForecast?: number; + + /**Specifies the order of the polynomial trendlines. + * @Default {0} + */ + polynomialOrder?: number; + + /**Specifies the moving average starting period value. + * @Default {2} + */ + period?: number; +} + +export interface CommonSeriesOptionsHighlightSettingsBorder { + + /**Border color of the series/point on highlight. + */ + color?: string; + + /**Border width of the series/point on highlight. + * @Default {2} + */ + width?: string; +} + +export interface CommonSeriesOptionsHighlightSettings { + + /**Enables/disables the ability to highlight the series or data point interactively. + * @Default {false} + */ + enable?: boolean; + + /**Specifies whether the series or data point has to be highlighted. + * @Default {series. See Mode} + */ + mode?: ej.datavisualization.Chart.Mode|string; + + /**Color of the series/point on highlight. + */ + color?: string; + + /**Opacity of the series/point on highlight. + * @Default {0.6} + */ + opacity?: number; + + /**Options for customizing the border of series on highlight. + */ + border?: CommonSeriesOptionsHighlightSettingsBorder; + + /**Specifies the pattern for the series/point on highlight. + * @Default {none. See Pattern} + */ + pattern?: string; + + /**Custom pattern for the series on highlight. + */ + customPattern?: string; +} + +export interface CommonSeriesOptionsSelectionSettingsBorder { + + /**Border color of the series/point on selection. + */ + color?: string; + + /**Border width of the series/point on selection. + * @Default {2} + */ + width?: string; +} + +export interface CommonSeriesOptionsSelectionSettings { + + /**Enables/disables the ability to select a series/data point interactively. + * @Default {false} + */ + enable?: boolean; + + /**Specifies the type of selection. + * @Default {single} + */ + type?: ej.datavisualization.Chart.SelectionType|string; + + /**Specifies whether the series or data point has to be selected. + * @Default {series. See Mode} + */ + mode?: ej.datavisualization.Chart.Mode|string; + + /**Color of the series/point on selection. + */ + color?: string; + + /**Opacity of the series/point on selection. + * @Default {0.6} + */ + opacity?: number; + + /**Options for customizing the border of the series on selection. + */ + border?: CommonSeriesOptionsSelectionSettingsBorder; + + /**Specifies the pattern for the series/point on selection. + * @Default {none. See Pattern} + */ + pattern?: string; + + /**Custom pattern for the series on selection. + */ + customPattern?: string; +} + +export interface CommonSeriesOptions { + + /**Options to customize the border of all the series. + */ + border?: CommonSeriesOptionsBorder; + + /**Pattern of dashes and gaps used to stroke all the line type series. + */ + dashArray?: string; + + /**Set the dataSource for all series. It can be an array of JSON objects or an instance of ej.DataManager. + * @Default {null} + */ + dataSource?: any; + + /**Controls the size of the hole in doughnut series. Value ranges from 0 to 1 + * @Default {0.4} + */ + doughnutCoefficient?: number; + + /**Controls the size of the doughnut series. Value ranges from 0 to 1. + * @Default {0.8} + */ + doughnutSize?: number; + + /**Specifies the type of series to be drawn in radar or polar series. + * @Default {line. See DrawType} + */ + drawType?: ej.datavisualization.Chart.DrawType|string; + + /**Enable/disable the animation for all the series. + * @Default {true} + */ + enableAnimation?: boolean; + + /**To avoid overlapping of data labels smartly. + * @Default {true} + */ + enableSmartLabels?: boolean; + + /**Start angle of pie/doughnut series. + * @Default {null} + */ + endAngle?: number; + + /**Explodes the pie/doughnut slices on mouse move. + * @Default {false} + */ + explode?: boolean; + + /**Explodes all the slice of pie/doughnut on render. + * @Default {false} + */ + explodeAll?: boolean; + + /**Index of the point to be exploded from pie/doughnut/pyramid/funnel. + * @Default {null} + */ + explodeIndex?: number; + + /**Specifies the distance of the slice from the center, when it is exploded. + * @Default {0.4} + */ + explodeOffset?: number; + + /**Fill color for all the series. + * @Default {null} + */ + fill?: string; + + /**Options for customizing the font of all the series. + */ + font?: CommonSeriesOptionsFont; + + /**Sets the height of the funnel in funnel series. Values can be either pixel or percentage. + * @Default {32.7%} + */ + funnelHeight?: string; + + /**Sets the width of the funnel in funnel series. Values can be either pixel or percentage. + * @Default {11.6%} + */ + funnelWidth?: string; + + /**Gap between the slices in pyramid and funnel series. + * @Default {0} + */ + gapRatio?: number; + + /**Specifies whether to join start and end point of a line/area series used in polar/radar chart to form a closed path. + * @Default {true} + */ + isClosed?: boolean; + + /**Specifies whether to stack the column series in polar/radar charts. + * @Default {false} + */ + isStacking?: boolean; + + /**Renders the chart vertically. This is applicable only for cartesian type series. + * @Default {false} + */ + isTransposed?: boolean; + + /**Position of the data label in pie/doughnut/pyramid/funnel series. OutsideExtended position is not applicable for pyramid/funnel. + * @Default {inside. See LabelPosition} + */ + labelPosition?: ej.datavisualization.Chart.LabelPosition|string; + + /**Specifies the line cap of the series. + * @Default {butt. See LineCap} + */ + lineCap?: ej.datavisualization.Chart.LineCap|string; + + /**Specifies the type of shape to be used where two lines meet. + * @Default {round. See LineJoin} + */ + lineJoin?: ej.datavisualization.Chart.LineJoin|string; + + /**Options for displaying and customizing marker for individual point in a series. Marker contains shapes and/or data labels. + */ + marker?: CommonSeriesOptionsMarker; + + /**Opacity of the series. + * @Default {1} + */ + opacity?: number; + + /**Name of a field in data source, where the fill color for all the data points is generated. + */ + palette?: string; + + /**Controls the size of pie series. Value ranges from 0 to 1. + * @Default {0.8} + */ + pieCoefficient?: number; + + /**Specifies the mode of the pyramid series. + * @Default {linear. See PyramidMode} + */ + pyramidMode?: ej.datavisualization.Chart.PyramidMode|string; + + /**Start angle from where the pie/doughnut series renders. By default it starts from 0. + * @Default {null} + */ + startAngle?: number; + + /**Options for customizing the tooltip of chart. + */ + tooltip?: CommonSeriesOptionsTooltip; + + /**Specifies the type of the series to render in chart. + * @Default {column. See Type} + */ + type?: ej.datavisualization.Chart.Type|string; + + /**Specifies the name of the x-axis that has to be associated with this series. Add an axis instance with this name to axes collection. + * @Default {null} + */ + xAxisName?: string; + + /**Name of the property in the datasource that contains x value for the series. + * @Default {null} + */ + xName?: string; + + /**Specifies the name of the y-axis that has to be associated with this series. Add an axis instance with this name to axes collection. + * @Default {null} + */ + yAxisName?: string; + + /**Name of the property in the datasource that contains y value for the series. + * @Default {null} + */ + yName?: string; + + /**Name of the property in the datasource that contains high value for the series. + * @Default {null} + */ + high?: string; + + /**Name of the property in the datasource that contains low value for the series. + * @Default {null} + */ + low?: string; + + /**Name of the property in the datasource that contains open value for the series. + * @Default {null} + */ + open?: string; + + /**Name of the property in the datasource that contains close value for the series. + * @Default {null} + */ + close?: string; + + /**Name of the property in the datasource that contains the size value for the bubble series. + * @Default {null} + */ + size?: string; + + /**Options for customizing the empty point in the series. + */ + emptyPointSettings?: CommonSeriesOptionsEmptyPointSettings; + + /**Fill color for the positive column of the waterfall. + * @Default {null} + */ + positiveFill?: string; + + /**Options for customizing the waterfall connector line. + */ + connectorLine?: CommonSeriesOptionsConnectorLine; + + /**Options to customize the error bar in series. + */ + errorBar?: CommonSeriesOptionsErrorBar; + + /**Option to add the trendlines to chart. + */ + trendlines?: Array; + + /**Options for customizing the appearance of the series or data point while highlighting. + */ + highlightSettings?: CommonSeriesOptionsHighlightSettings; + + /**Options for customizing the appearance of the series/data point on selection. + */ + selectionSettings?: CommonSeriesOptionsSelectionSettings; +} + +export interface CrosshairMarkerBorder { + + /**Border width of the marker. + * @Default {3} + */ + width?: number; +} + +export interface CrosshairMarkerSize { + + /**Height of the marker. + * @Default {10} + */ + height?: number; + + /**Width of the marker. + * @Default {10} + */ + width?: number; +} + +export interface CrosshairMarker { + + /**Options for customizing the border. + */ + border?: CrosshairMarkerBorder; + + /**Opacity of the marker. + * @Default {true} + */ + opacity?: boolean; + + /**Options for customizing the size of the marker. + */ + size?: CrosshairMarkerSize; + + /**Show/hides the marker. + * @Default {true} + */ + visible?: boolean; +} + +export interface Crosshair { + + /**Options for customizing the marker in crosshair. + */ + marker?: CrosshairMarker; + + /**Specifies the type of the crosshair. It can be trackball or crosshair + * @Default {crosshair. See CrosshairType} + */ + type?: ej.datavisualization.Chart.CrosshairType|string; + + /**Show/hides the crosshair/trackball visibility. + * @Default {false} + */ + visible?: boolean; +} + +export interface IndicatorsHistogramBorder { + + /**Color of the histogram border in MACD indicator. + * @Default {#9999ff} + */ + color?: string; + + /**Controls the width of histogram border line in MACD indicator. + * @Default {1} + */ + width?: number; +} + +export interface IndicatorsHistogram { + + /**Options to customize the histogram border in MACD indicator. + */ + border?: IndicatorsHistogramBorder; + + /**Color of histogram columns in MACD indicator. + * @Default {#ccccff} + */ + fill?: string; + + /**Opacity of histogram columns in MACD indicator. + * @Default {1} + */ + opacity?: number; +} + +export interface IndicatorsLowerLine { + + /**Color of lower line. + * @Default {#008000} + */ + fill?: string; + + /**Width of the lower line. + * @Default {2} + */ + width?: number; +} + +export interface IndicatorsMacdLine { + + /**Color of MACD line. + * @Default {#ff9933} + */ + fill?: string; + + /**Width of the MACD line. + * @Default {2} + */ + width?: number; +} + +export interface IndicatorsPeriodLine { + + /**Color of period line in indicator. + * @Default {blue} + */ + fill?: string; + + /**Width of the period line in indicators. + * @Default {2} + */ + width?: number; +} + +export interface IndicatorsTooltipBorder { + + /**Border color of indicator tooltip. + * @Default {null} + */ + color?: string; + + /**Border width of indicator tooltip. + * @Default {1} + */ + width?: number; +} + +export interface IndicatorsTooltip { + + /**Option to customize the border of indicator tooltip. + */ + border?: IndicatorsTooltipBorder; + + /**Specifies the animation duration of indicator tooltip. + * @Default {500ms} + */ + duration?: string; + + /**Enables/disables the tooltip animation. + * @Default {true} + */ + enableAnimation?: boolean; + + /**Format of indicator tooltip. Use “point.x” and “point.y” as a placeholder text to display the corresponding data point’s x and y value. + * @Default {#point.x# : #point.y#} + */ + format?: string; + + /**Background color of indicator tooltip. + * @Default {null} + */ + fill?: string; + + /**Opacity of indicator tooltip. + * @Default {0.95} + */ + opacity?: number; + + /**Controls the visibility of indicator tooltip. + * @Default {false} + */ + visible?: boolean; +} + +export interface IndicatorsUpperLine { + + /**Fill color of the upper line in indicators + * @Default {#ff9933} + */ + fill?: string; + + /**Width of the upper line in indicators. + * @Default {2} + */ + width?: number; +} + +export interface Indicators { + + /**The dPeriod value for stochastic indicator. + * @Default {3} + */ + dPeriod?: number; + + /**Enables/disables the animation. + * @Default {false} + */ + enableAnimation?: boolean; + + /**Color of the technical indicator. + * @Default {#00008B} + */ + fill?: string; + + /**Options to customize the histogram in MACD indicator. + */ + histogram?: IndicatorsHistogram; + + /**Specifies the k period in stochastic indicator. + * @Default {3} + */ + kPeriod?: number; + + /**Specifies the long period in MACD indicator. + * @Default {26} + */ + longPeriod?: number; + + /**Options to customize the lower line in indicators. + */ + lowerLine?: IndicatorsLowerLine; + + /**Options to customize the MACD line. + */ + macdLine?: IndicatorsMacdLine; + + /**Specifies the type of the MACD indicator. + * @Default {line. See MACDType} + */ + macdType?: string; + + /**Specifies period value in indicator. + * @Default {14} + */ + period?: number; + + /**Options to customize the period line in indicators. + */ + periodLine?: IndicatorsPeriodLine; + + /**Name of the series for which indicator has to be drawn. + */ + seriesName?: string; + + /**Specifies the short period in MACD indicator. + * @Default {13} + */ + shortPeriod?: number; + + /**Specifies the standard deviation value for Bollinger band indicator. + * @Default {2} + */ + standardDeviations?: number; + + /**Options to customize the tooltip. + */ + tooltip?: IndicatorsTooltip; + + /**Trigger value of MACD indicator. + * @Default {9} + */ + trigger?: number; + + /**Specifies the visibility of indicator. + * @Default {visible} + */ + visibility?: string; + + /**Specifies the type of indicator that has to be rendered. + * @Default {sma. See IndicatorsType} + */ + type?: string; + + /**Options to customize the upper line in indicators + */ + upperLine?: IndicatorsUpperLine; + + /**Width of the indicator line. + * @Default {2} + */ + width?: number; + + /**Name of the horizontal axis used for indicator. Primary X axis is used when x axis name is not specified. + */ + xAxisName?: string; + + /**Name of the vertical axis used for indicator. Primary Y axis is used when y axis name is not specified + */ + yAxisName?: string; +} + +export interface LegendBorder { + + /**Border color of the legend. + * @Default {transparent} + */ + color?: string; + + /**Border width of the legend. + * @Default {1} + */ + width?: number; +} + +export interface LegendFont { + + /**Font family for legend item text. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style for legend item text. + * @Default {Normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight for legend item text. + * @Default {Regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Font size for legend item text. + * @Default {12px} + */ + size?: string; +} + +export interface LegendItemStyleBorder { + + /**Border color of the legend items. + * @Default {transparent} + */ + color?: string; + + /**Border width of the legend items. + * @Default {1} + */ + width?: number; +} + +export interface LegendItemStyle { + + /**Options for customizing the border of legend items. + */ + border?: LegendItemStyleBorder; + + /**Height of the shape in legend items. + * @Default {10} + */ + height?: number; + + /**Width of the shape in legend items. + * @Default {10} + */ + width?: number; +} + +export interface LegendLocation { + + /**X value or horizontal offset to position the legend in chart. + * @Default {0} + */ + x?: number; + + /**Y value or vertical offset to position the legend. + * @Default {0} + */ + y?: number; +} + +export interface LegendSize { + + /**Height of the legend. Height can be specified in either pixel or percentage. + * @Default {null} + */ + height?: string; + + /**Width of the legend. Width can be specified in either pixel or percentage. + * @Default {null} + */ + width?: string; +} + +export interface LegendTitleFont { + + /**Font family for the text in legend title. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style for legend title. + * @Default {normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight for legend title. + * @Default {normal. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Font size for legend title. + * @Default {12px} + */ + size?: string; +} + +export interface LegendTitle { + + /**Options to customize the font used for legend title + */ + font?: LegendTitleFont; + + /**Text to be displayed in legend title. + */ + text?: string; + + /**Alignment of the legend title. + * @Default {center. See Alignment} + */ + textAlignment?: ej.datavisualization.Chart.Alignment|string; +} + +export interface Legend { + + /**Horizontal alignment of the legend. + * @Default {Center. See Alignment} + */ + alignment?: ej.datavisualization.Chart.Alignment|string; + + /**Background for the legend. Use this property to add a background image or background color for the legend. + */ + background?: string; + + /**Options for customizing the legend border. + */ + border?: LegendBorder; + + /**Number of columns to arrange the legend items. + * @Default {null} + */ + columnCount?: number; + + /**Controls whether legend has to use scrollbar or not. When enabled, scroll bar appears depending upon size and position properties of legend. + * @Default {true} + */ + enableScrollbar?: boolean; + + /**Fill color for the legend items. By using this property, it displays all legend item shapes in same color.Legend items representing invisible series is displayed in gray color. + * @Default {null} + */ + fill?: string; + + /**Options to customize the font used for legend item text. + */ + font?: LegendFont; + + /**Gap or padding between the legend items. + * @Default {10} + */ + itemPadding?: number; + + /**Options to customize the style of legend items. + */ + itemStyle?: LegendItemStyle; + + /**Options to customize the location of chart legend. Legend is placed in provided location only when value of position property is custom + */ + location?: LegendLocation; + + /**Opacity of the legend. + * @Default {1} + */ + opacity?: number; + + /**Places the legend at specified position. Legend can be placed at left, right, top or bottom of the chart area.To manually specify the location of legend, set custom as value to this property. + * @Default {Bottom. See Position} + */ + position?: ej.datavisualization.Chart.Position|string; + + /**Number of rows to arrange the legend items. + * @Default {null} + */ + rowCount?: number; + + /**Shape of the legend items. Default shape for pie and doughnut series is circle and all other series uses rectangle. + * @Default {None. See Shape} + */ + shape?: ej.datavisualization.Chart.Shape|string; + + /**Options to customize the size of the legend. + */ + size?: LegendSize; + + /**Options to customize the legend title. + */ + title?: LegendTitle; + + /**Specifies the action taken when the legend width is more than the textWidth. + * @Default {none. See textOverflow} + */ + textOverflow?: ej.datavisualization.Chart.TextOverflow|string; + + /**Text width for legend item. + * @Default {34} + */ + textWidth?: number; + + /**Controls the visibility of the legend. + * @Default {true} + */ + visible?: boolean; +} + +export interface PrimaryXAxisAlternateGridBandEven { + + /**Fill color for the even grid bands. + * @Default {transparent} + */ + fill?: string; + + /**Opacity of the even grid band. + * @Default {1} + */ + opacity?: number; +} + +export interface PrimaryXAxisAlternateGridBandOdd { + + /**Fill color of the odd grid bands + * @Default {transparent} + */ + fill?: string; + + /**Opacity of odd grid band + * @Default {1} + */ + opacity?: number; +} + +export interface PrimaryXAxisAlternateGridBand { + + /**Options for customizing even grid band. + */ + even?: PrimaryXAxisAlternateGridBandEven; + + /**Options for customizing odd grid band. + */ + odd?: PrimaryXAxisAlternateGridBandOdd; +} + +export interface PrimaryXAxisAxisLine { + + /**Pattern of dashes and gaps to be applied to the axis line. + * @Default {null} + */ + dashArray?: string; + + /**Padding for axis line. Normally, it is used along with plotOffset to pad the plot area. + * @Default {null} + */ + offset?: number; + + /**Show/hides the axis line. + * @Default {true} + */ + visible?: boolean; + + /**Width of axis line. + * @Default {1} + */ + width?: number; +} + +export interface PrimaryXAxisCrosshairLabel { + + /**Show/hides the crosshair label associated with this axis. + * @Default {false} + */ + visible?: boolean; +} + +export interface PrimaryXAxisFont { + + /**Font family of labels. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style of labels. + * @Default {ej.datavisualization.Chart.FontStyle.Normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the label. + * @Default {ej.datavisualization.Chart.FontWeight.Regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of the axis labels. + * @Default {1} + */ + opacity?: number; + + /**Font size of the axis labels. + * @Default {13px} + */ + size?: string; +} + +export interface PrimaryXAxisMajorGridLines { + + /**Pattern of dashes and gaps used to stroke the major grid lines. + * @Default {null} + */ + dashArray?: string; + + /**Opacity of major grid lines. + * @Default {1} + */ + opacity?: number; + + /**Show/hides the major grid lines. + * @Default {true} + */ + visible?: boolean; + + /**Width of the major grid lines. + * @Default {1} + */ + width?: number; +} + +export interface PrimaryXAxisMajorTickLines { + + /**Length of the major tick lines. + * @Default {5} + */ + size?: number; + + /**Show/hides the major tick lines. + * @Default {true} + */ + visible?: boolean; + + /**Width of the major tick lines. + * @Default {1} + */ + width?: number; +} + +export interface PrimaryXAxisMinorGridLines { + + /**Patterns of dashes and gaps used to stroke the minor grid lines. + * @Default {null} + */ + dashArray?: string; + + /**Show/hides the minor grid lines. + * @Default {true} + */ + visible?: boolean; + + /**Width of the minorGridLines. + * @Default {1} + */ + width?: number; +} + +export interface PrimaryXAxisMinorTickLines { + + /**Length of the minor tick lines. + * @Default {5} + */ + size?: number; + + /**Show/hides the minor tick lines. + * @Default {true} + */ + visible?: boolean; + + /**Width of the minor tick line. + * @Default {1} + */ + width?: number; +} + +export interface PrimaryXAxisRange { + + /**Minimum value of the axis range. + * @Default {null} + */ + minimum?: number; + + /**Maximum value of the axis range. + * @Default {null} + */ + maximum?: number; + + /**Interval of the axis range. + * @Default {null} + */ + interval?: number; +} + +export interface PrimaryXAxisStripLineFont { + + /**Font color of the strip line text. + * @Default {black} + */ + color?: string; + + /**Font family of the strip line text. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style of the strip line text. + * @Default {Normal} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the strip line text. + * @Default {regular} + */ + fontWeight?: string; + + /**Opacity of the strip line text. + * @Default {1} + */ + opacity?: number; + + /**Font size of the strip line text. + * @Default {12px} + */ + size?: string; +} + +export interface PrimaryXAxisStripLine { + + /**Border color of the strip line. + * @Default {gray} + */ + borderColor?: string; + + /**Background color of the strip line. + * @Default {gray} + */ + color?: string; + + /**End value of the strip line. + * @Default {null} + */ + end?: number; + + /**Options for customizing the font of the text. + */ + font?: PrimaryXAxisStripLineFont; + + /**Start value of the strip line. + * @Default {null} + */ + start?: number; + + /**Indicates whether to render the strip line from the minimum/start value of the axis. This property does not work when start property is set. + * @Default {false} + */ + startFromAxis?: boolean; + + /**Specifies text to be displayed inside the strip line. + * @Default {stripLine} + */ + text?: string; + + /**Specifies the alignment of the text inside the strip line. + * @Default {middlecenter. See TextAlignment} + */ + textAlignment?: ej.datavisualization.Chart.TextAlignment|string; + + /**Show/hides the strip line. + * @Default {false} + */ + visible?: boolean; + + /**Width of the strip line. + * @Default {0} + */ + width?: number; + + /**Specifies the order where the strip line and the series have to be rendered. When zOrder is “behind”, strip line is rendered under the series and when it is “over”, it is rendered above the series. + * @Default {over. See ZIndex} + */ + zIndex?: ej.datavisualization.Chart.ZIndex|string; +} + +export interface PrimaryXAxisTitleFont { + + /**Font family of the title text. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style of the title text. + * @Default {ej.datavisualization.Chart.FontStyle.Normal} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the title text. + * @Default {ej.datavisualization.Chart.FontWeight.Regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of the axis title text. + * @Default {1} + */ + opacity?: number; + + /**Font size of the axis title. + * @Default {16px} + */ + size?: string; +} + +export interface PrimaryXAxisTitle { + + /**Specifies whether to trim the axis title when it exceeds the chart area or the maximum width of the title. + * @Default {false} + */ + enableTrim?: boolean; + + /**Options for customizing the title font. + */ + font?: PrimaryXAxisTitleFont; + + /**Maximum width of the title, when the title exceeds this width, the title gets trimmed, when enableTrim is true. + * @Default {34} + */ + maximumTitleWidth?: number; + + /**Title for the axis. + */ + text?: string; + + /**Controls the visibility of axis title. + * @Default {true} + */ + visible?: boolean; +} + +export interface PrimaryXAxis { + + /**Options for customizing horizontal axis alternate grid band. + */ + alternateGridBand?: PrimaryXAxisAlternateGridBand; + + /**Options for customizing the axis line. + */ + axisLine?: PrimaryXAxisAxisLine; + + /**Specifies the index of the column where the axis is associated, when the chart area is divided into multiple plot areas by using columnDefinitions. + * @Default {null} + */ + columnIndex?: number; + + /**Specifies the number of columns or plot areas an axis has to span horizontally. + * @Default {null} + */ + columnSpan?: number; + + /**Options to customize the crosshair label. + */ + crosshairLabel?: PrimaryXAxisCrosshairLabel; + + /**With this setting, you can request axis to calculate intervals approximately equal to your desired interval. + * @Default {null} + */ + desiredIntervals?: number; + + /**Specifies the position of labels at the edge of the axis. + * @Default {ej.datavisualization.Chart.EdgeLabelPlacement.None. See EdgeLabelPlacement} + */ + edgeLabelPlacement?: ej.datavisualization.Chart.EdgeLabelPlacement|string; + + /**Specifies whether to trim the axis label when the width of the label exceeds the maximumLabelWidth. + * @Default {false} + */ + enableTrim?: boolean; + + /**Options for customizing the font of the axis Labels. + */ + font?: PrimaryXAxisFont; + + /**Specifies the type of interval in date time axis. + * @Default {null. See IntervalType} + */ + intervalType?: ej.datavisualization.Chart.IntervalType|string; + + /**Specifies whether to inverse the axis. + * @Default {false} + */ + isInversed?: boolean; + + /**Custom formatting for axis label and supports all standard formatting type of numerical and date time values. + * @Default {null} + */ + labelFormat?: string; + + /**Specifies the action to take when the axis labels are overlapping with each other. + * @Default {ej.datavisualization.Chart.LabelIntersectAction.None. See LabelIntersectAction} + */ + labelIntersectAction?: ej.datavisualization.Chart.LabelIntersectAction|string; + + /**Specifies the position of the axis labels. + * @Default {outside. See LabelPosition} + */ + labelPosition?: ej.datavisualization.Chart.LabelPosition|string; + + /**Angle in degrees to rotate the axis labels. + * @Default {null} + */ + labelRotation?: number; + + /**Logarithmic base value. This is applicable only for logarithmic axis. + * @Default {10} + */ + logBase?: number; + + /**Options for customizing major gird lines. + */ + majorGridLines?: PrimaryXAxisMajorGridLines; + + /**Options for customizing the major tick lines. + */ + majorTickLines?: PrimaryXAxisMajorTickLines; + + /**Maximum number of labels to be displayed in every 100 pixels. + * @Default {3} + */ + maximumLabels?: number; + + /**Maximum width of the axis label. When the label exceeds the width, the label gets trimmed when the enableTrim is set to true. + * @Default {34} + */ + maximumLabelWidth?: number; + + /**Options for customizing the minor grid lines. + */ + minorGridLines?: PrimaryXAxisMinorGridLines; + + /**Options for customizing the minor tick lines. + */ + minorTickLines?: PrimaryXAxisMinorTickLines; + + /**Specifies the number of minor ticks per interval. + * @Default {null} + */ + minorTicksPerInterval?: number; + + /**Unique name of the axis. To associate an axis with the series, you have to set this name to the xAxisName/yAxisName property of the series. + * @Default {null} + */ + name?: string; + + /**Specifies whether to render the axis at the opposite side of its default position. + * @Default {false} + */ + opposedPosition?: boolean; + + /**Specifies the padding for the plot area. + * @Default {10} + */ + plotOffset?: number; + + /**Options to customize the range of the axis. + */ + range?: PrimaryXAxisRange; + + /**Specifies the padding for the axis range. + * @Default {None. See RangePadding} + */ + rangePadding?: ej.datavisualization.Chart.RangePadding|string; + + /**Rounds the number to the given number of decimals. + * @Default {null} + */ + roundingPlaces?: number; + + /**Options for customizing the strip lines. + * @Default {[ ]} + */ + stripLine?: Array; + + /**Specifies the position of the axis tick lines. + * @Default {outside. See TickLinesPosition} + */ + tickLinesPosition?: ej.datavisualization.Chart.TickLinesPosition|string; + + /**Options for customizing the axis title. + */ + title?: PrimaryXAxisTitle; + + /**Specifies the type of data the axis is handling. + * @Default {null. See ValueType} + */ + valueType?: ej.datavisualization.Chart.ValueType|string; + + /**Show/hides the axis. + * @Default {true} + */ + visible?: boolean; + + /**The axis is scaled by this factor. When zoomFactor is 0.5, the chart is scaled by 200% along this axis. Value ranges from 0 to 1. + * @Default {1} + */ + zoomFactor?: number; + + /**Position of the zoomed axis. Value ranges from 0 to 1. + * @Default {0} + */ + zoomPosition?: number; +} + +export interface PrimaryYAxisAlternateGridBandEven { + + /**Fill color for the even grid bands. + * @Default {transparent} + */ + fill?: string; + + /**Opacity of the even grid band. + * @Default {1} + */ + opacity?: number; +} + +export interface PrimaryYAxisAlternateGridBandOdd { + + /**Fill color of the odd grid bands. + * @Default {transparent} + */ + fill?: string; + + /**Opacity of odd grid band. + * @Default {1} + */ + opacity?: number; +} + +export interface PrimaryYAxisAlternateGridBand { + + /**Options for customizing even grid band. + */ + even?: PrimaryYAxisAlternateGridBandEven; + + /**Options for customizing odd grid band. + */ + odd?: PrimaryYAxisAlternateGridBandOdd; +} + +export interface PrimaryYAxisAxisLine { + + /**Pattern of dashes and gaps to be applied to the axis line. + * @Default {null} + */ + dashArray?: string; + + /**Padding for axis line. Normally, it is used along with plotOffset to pad the plot area. + * @Default {null} + */ + offset?: number; + + /**Show/hides the axis line. + * @Default {true} + */ + visible?: boolean; + + /**Width of axis line. + * @Default {1} + */ + width?: number; +} + +export interface PrimaryYAxisCrosshairLabel { + + /**Show/hides the crosshair label associated with this axis. + * @Default {false} + */ + visible?: boolean; +} + +export interface PrimaryYAxisFont { + + /**Font family of labels. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style of labels. + * @Default {ej.datavisualization.Chart.FontStyle.Normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the label. + * @Default {ej.datavisualization.Chart.FontWeight.Regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of the axis labels. + * @Default {1} + */ + opacity?: number; + + /**Font size of the axis labels. + * @Default {13px} + */ + size?: string; +} + +export interface PrimaryYAxisMajorGridLines { + + /**Pattern of dashes and gaps used to stroke the major grid lines. + * @Default {null} + */ + dashArray?: string; + + /**Opacity of major grid lines. + * @Default {1} + */ + opacity?: number; + + /**Show/hides the major grid lines. + * @Default {true} + */ + visible?: boolean; + + /**Width of the major grid lines. + * @Default {1} + */ + width?: number; +} + +export interface PrimaryYAxisMajorTickLines { + + /**Length of the major tick lines. + * @Default {5} + */ + size?: number; + + /**Show/hides the major tick lines. + * @Default {true} + */ + visible?: boolean; + + /**Width of the major tick lines. + * @Default {1} + */ + width?: number; +} + +export interface PrimaryYAxisMinorGridLines { + + /**Patterns of dashes and gaps used to stroke the minor grid lines. + * @Default {null} + */ + dashArray?: string; + + /**Show/hides the minor grid lines. + * @Default {true} + */ + visible?: boolean; + + /**Width of the minorGridLines. + * @Default {1} + */ + width?: number; +} + +export interface PrimaryYAxisMinorTickLines { + + /**Length of the minor tick lines. + * @Default {5} + */ + size?: number; + + /**Show/hides the minor tick lines. + * @Default {true} + */ + visible?: boolean; + + /**Width of the minor tick line + * @Default {1} + */ + width?: number; +} + +export interface PrimaryYAxisStripLineFont { + + /**Font color of the strip line text. + * @Default {black} + */ + color?: string; + + /**Font family of the strip line text. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style of the strip line text. + * @Default {Normal} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the strip line text. + * @Default {regular} + */ + fontWeight?: string; + + /**Opacity of the strip line text. + * @Default {1} + */ + opacity?: number; + + /**Font size of the strip line text. + * @Default {12px} + */ + size?: string; +} + +export interface PrimaryYAxisStripLine { + + /**Border color of the strip line. + * @Default {gray} + */ + borderColor?: string; + + /**Background color of the strip line. + * @Default {gray} + */ + color?: string; + + /**End value of the strip line. + * @Default {null} + */ + end?: number; + + /**Options for customizing the font of the text. + */ + font?: PrimaryYAxisStripLineFont; + + /**Start value of the strip line. + * @Default {null} + */ + start?: number; + + /**Indicates whether to render the strip line from the minimum/start value of the axis. This property won’t work when start property is set. + * @Default {false} + */ + startFromAxis?: boolean; + + /**Specifies text to be displayed inside the strip line. + * @Default {stripLine} + */ + text?: string; + + /**Specifies the alignment of the text inside the strip line. + * @Default {middlecenter. See TextAlignment} + */ + textAlignment?: ej.datavisualization.Chart.TextAlignment|string; + + /**Show/hides the strip line. + * @Default {false} + */ + visible?: boolean; + + /**Width of the strip line. + * @Default {0} + */ + width?: number; + + /**Specifies the order in which strip line and the series have to be rendered. When zOrder is “behind”, strip line is rendered below the series and when it is “over”, it is rendered above the series. + * @Default {over. See ZIndex} + */ + zIndex?: ej.datavisualization.Chart.ZIndex|string; +} + +export interface PrimaryYAxisTitleFont { + + /**Font family of the title text. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style of the title text. + * @Default {ej.datavisualization.Chart.FontStyle.Normal} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the title text. + * @Default {ej.datavisualization.Chart.FontWeight.Regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of the axis title text. + * @Default {1} + */ + opacity?: number; + + /**Font size of the axis title. + * @Default {16px} + */ + size?: string; +} + +export interface PrimaryYAxisTitle { + + /**Specifies whether to trim the axis title when it exceeds the chart area or the maximum width of the title. + * @Default {ej.datavisualization.Chart.enableTrim} + */ + enableTrim?: boolean; + + /**Options for customizing the title font. + */ + font?: PrimaryYAxisTitleFont; + + /**Maximum width of the title, when the title exceeds this width, the title gets trimmed, when enableTrim is true. + * @Default {ej.datavisualization.Chart.maximumTitleWidth.null} + */ + maximumTitleWidth?: number; + + /**Title for the axis. + */ + text?: string; + + /**Controls the visibility of axis title. + * @Default {true} + */ + visible?: boolean; +} + +export interface PrimaryYAxis { + + /**Options for customizing vertical axis alternate grid band. + */ + alternateGridBand?: PrimaryYAxisAlternateGridBand; + + /**Options for customizing the axis line. + */ + axisLine?: PrimaryYAxisAxisLine; + + /**Options to customize the crosshair label. + */ + crosshairLabel?: PrimaryYAxisCrosshairLabel; + + /**With this setting, you can request axis to calculate intervals approximately equal to your desired interval. + * @Default {null} + */ + desiredIntervals?: number; + + /**Specifies the position of labels at the edge of the axis. + * @Default {ej.datavisualization.Chart.EdgeLabelPlacement.None. See EdgeLabelPlacement} + */ + edgeLabelPlacement?: ej.datavisualization.Chart.EdgeLabelPlacement|string; + + /**Specifies whether to trim the axis label when the width of the label exceeds the maximumLabelWidth. + * @Default {false} + */ + enableTrim?: boolean; + + /**Options for customizing the font of the axis Labels. + */ + font?: PrimaryYAxisFont; + + /**Specifies the type of interval in date time axis. + * @Default {null. See IntervalType} + */ + intervalType?: ej.datavisualization.Chart.IntervalType|string; + + /**Specifies whether to inverse the axis. + * @Default {false} + */ + isInversed?: boolean; + + /**Custom formatting for axis label and supports all standard formatting type of numerical and date time values. + * @Default {null} + */ + labelFormat?: string; + + /**Specifies the action to take when the axis labels are overlapping with each other. + * @Default {ej.datavisualization.Chart.LabelIntersectAction.None} + */ + labelIntersectAction?: ej.datavisualization.Chart.LabelIntersectAction|string; + + /**Default Value + * @Default {outside. See LabelPosition} + */ + labelPosition?: ej.datavisualization.Chart.LabelPosition|string; + + /**Logarithmic base value. This is applicable only for logarithmic axis. + * @Default {10} + */ + logBase?: number; + + /**Options for customizing major gird lines. + */ + majorGridLines?: PrimaryYAxisMajorGridLines; + + /**Options for customizing the major tick lines. + */ + majorTickLines?: PrimaryYAxisMajorTickLines; + + /**Maximum number of labels to be displayed in every 100 pixels. + * @Default {3} + */ + maximumLabels?: number; + + /**Maximum width of the axis label. When the label exceeds the width, the label gets trimmed when the enableTrim is set to true. + * @Default {ej.datavisualization.Chart.maximumLabelWidth type {int}} + */ + maximumLabelWidth?: number; + + /**Options for customizing the minor grid lines. + */ + minorGridLines?: PrimaryYAxisMinorGridLines; + + /**Options for customizing the minor tick lines. + */ + minorTickLines?: PrimaryYAxisMinorTickLines; + + /**Specifies the number of minor ticks per interval. + * @Default {null} + */ + minorTicksPerInterval?: number; + + /**Unique name of the axis. To associate an axis with the series, you have to set this name to the xAxisName/yAxisName property of the series. + * @Default {null} + */ + name?: string; + + /**Specifies whether to render the axis at the opposite side of its default position. + * @Default {false} + */ + opposedPosition?: boolean; + + /**Specifies the padding for the plot area. + * @Default {10} + */ + plotOffset?: number; + + /**Specifies the padding for the axis range. + * @Default {ej.datavisualization.Chart.RangePadding.None. See RangePadding} + */ + rangePadding?: ej.datavisualization.Chart.RangePadding|string; + + /**Rounds the number to the given number of decimals. + * @Default {null} + */ + roundingPlaces?: number; + + /**Specifies the index of the row to which the axis is associated, when the chart area is divided into multiple plot areas by using rowDefinitions. + * @Default {null} + */ + rowIndex?: number; + + /**Specifies the number of row or plot areas an axis has to span vertically. + * @Default {null} + */ + rowSpan?: number; + + /**Options for customizing the strip lines. + * @Default {[ ]} + */ + stripLine?: Array; + + /**Specifies the position of the axis tick lines. + * @Default {outside. See TickLinesPosition} + */ + tickLinesPosition?: ej.datavisualization.Chart.TickLinesPosition|string; + + /**Options for customizing the axis title. + */ + title?: PrimaryYAxisTitle; + + /**Specifies the type of data the axis is handling. + * @Default {null. See ValueType} + */ + valueType?: ej.datavisualization.Chart.ValueType|string; + + /**Show/hides the axis. + * @Default {true} + */ + visible?: boolean; + + /**The axis is scaled by this factor. When zoomFactor is 0.5, the chart is scaled by 200% along this axis. Values ranges from 0 to 1. + * @Default {1} + */ + zoomFactor?: number; + + /**Position of the zoomed axis. Value ranges from 0 to 1 + * @Default {0} + */ + zoomPosition?: number; +} + +export interface RowDefinitions { + + /**Specifies the unit to measure the height of the row in plotting area. + * @Default {'pixel'. See Unit} + */ + unit?: ej.datavisualization.Chart.Unit|string; + + /**Height of the row in plotting area. Height is measured in either pixel or percentage based on the value of unit property. + * @Default {50} + */ + rowHeight?: number; + + /**Color of the line that indicates the starting point of the row in plotting area. + * @Default {transparent} + */ + lineColor?: string; + + /**Width of the line that indicates the starting point of the row in plot area. + * @Default {1} + */ + lineWidth?: number; +} + +export interface SeriesBorder { + + /**Border color of the series. + * @Default {transparent} + */ + color?: string; + + /**Border width of the series. + * @Default {1} + */ + width?: number; + + /**DashArray for border of the series. + * @Default {null} + */ + dashArray?: string; +} + +export interface SeriesFont { + + /**Font color of the series text. + * @Default {#707070} + */ + color?: string; + + /**Font Family of the series. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font Style of the series. + * @Default {Normal} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the series. + * @Default {Regular} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of series text. + * @Default {1} + */ + opacity?: number; + + /**Size of the series text. + * @Default {12px} + */ + size?: string; +} + +export interface SeriesMarkerBorder { + + /**Border color of the marker shape. + * @Default {white} + */ + color?: string; + + /**Border width of the marker shape. + * @Default {3} + */ + width?: number; +} + +export interface SeriesMarkerDataLabelBorder { + + /**Border color of the data label. + * @Default {null} + */ + color?: string; + + /**Border width of the data label. + * @Default {0.1} + */ + width?: number; +} + +export interface SeriesMarkerDataLabelConnectorLine { + + /**Specifies when the connector has to be drawn as Bezier curve or straight line. This is applicable only for Pie and Doughnut chart types. + * @Default {line. See ConnectorLineType} + */ + type?: ej.datavisualization.Chart.Type|string; + + /**Width of the connector. + * @Default {0.5} + */ + width?: number; +} + +export interface SeriesMarkerDataLabelFont { + + /**Font family of the data label. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style of the data label. + * @Default {normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the data label. + * @Default {regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of the text. + * @Default {1} + */ + opacity?: number; + + /**Font size of the data label. + * @Default {12px} + */ + size?: string; +} + +export interface SeriesMarkerDataLabelMargin { + + /**Bottom margin of the text. + * @Default {5} + */ + bottom?: number; + + /**Left margin of the text. + * @Default {5} + */ + left?: number; + + /**Right margin of the text. + * @Default {5} + */ + right?: number; + + /**Top margin of the text. + * @Default {5} + */ + top?: number; +} + +export interface SeriesMarkerDataLabel { + + /**Angle of the data label in degrees. Only the text gets rotated, whereas the background and border does not rotate. + * @Default {null} + */ + angle?: number; + + /**Options for customizing the border of the data label. + */ + border?: SeriesMarkerDataLabelBorder; + + /**Options for displaying and customizing the line that connects point and data label. + */ + connectorLine?: SeriesMarkerDataLabelConnectorLine; + + /**Background color of the data label. + * @Default {null} + */ + fill?: string; + + /**Options for customizing the data label font. + */ + font?: SeriesMarkerDataLabelFont; + + /**Horizontal alignment of the data label. + * @Default {center} + */ + horizontalTextAlignment?: ej.datavisualization.Chart.HorizontalTextAlignment|string; + + /**Margin of the text to its background shape. The size of the background shape increases based on the margin applied to its text. + */ + margin?: SeriesMarkerDataLabelMargin; + + /**Opacity of the data label. + * @Default {1} + */ + opacity?: number; + + /**Background shape of the data label. + * @Default {No shape is rendered by default, so its value is ‘none’. See Shape} + */ + shape?: ej.datavisualization.Chart.Shape|string; + + /**Name of a field in data source where datalabel text is displayed. + */ + textMappingName?: string; + + /**Specifies the position of the data label. This property can be used only for the series such as column, bar, stacked column, stacked bar, 100% stacked column, 100% stacked bar, candle and OHLC. + * @Default {top. See TextPosition} + */ + textPosition?: ej.datavisualization.Chart.TextPosition|string; + + /**Vertical alignment of the data label. + * @Default {'center'} + */ + verticalTextAlignment?: ej.datavisualization.Chart.VerticalTextAlignment|string; + + /**Controls the visibility of the data labels. + * @Default {false} + */ + visible?: boolean; + + /**Custom template to format the data label content. Use “point.x” and “point.y” as a placeholder text to display the corresponding data point’s x and y value. + */ + template?: string; + + /**Moves the label vertically by some offset. + * @Default {0} + */ + offset?: number; +} + +export interface SeriesMarkerSize { + + /**Height of the marker. + * @Default {6} + */ + height?: number; + + /**Width of the marker. + * @Default {6} + */ + width?: number; +} + +export interface SeriesMarker { + + /**Options for customizing the border of the marker shape. + */ + border?: SeriesMarkerBorder; + + /**Options for displaying and customizing data labels. + */ + dataLabel?: SeriesMarkerDataLabel; + + /**Color of the marker shape. + * @Default {null} + */ + fill?: string; + + /**The URL for the Image that is to be displayed as marker. In order to display image as marker, set series.marker.shape as ‘image’. + */ + imageUrl?: string; + + /**Opacity of the marker. + * @Default {1} + */ + opacity?: number; + + /**Specifies the shape of the marker. + * @Default {circle. See Shape} + */ + shape?: ej.datavisualization.Chart.Shape|string; + + /**Options for customizing the size of the marker shape. + */ + size?: SeriesMarkerSize; + + /**Controls the visibility of the marker shape. + * @Default {false} + */ + visible?: boolean; +} + +export interface SeriesEmptyPointSettingsStyleBorder { + + /**Border color of the empty point. + */ + color?: string; + + /**Border width of the empty point. + * @Default {1} + */ + width?: number; +} + +export interface SeriesEmptyPointSettingsStyle { + + /**Color of the empty point. + */ + color?: string; + + /**Options for customizing border of the empty point in the series. + */ + border?: SeriesEmptyPointSettingsStyleBorder; +} + +export interface SeriesEmptyPointSettings { + + /**Controls the visibility of the empty point. + * @Default {true} + */ + visible?: boolean; + + /**Specifies the mode of empty point. + * @Default {gap} + */ + displayMode?: ej.datavisualization.Chart.EmptyPointMode|string; + + /**Options for customizing the color and border of the empty point in the series. + */ + style?: SeriesEmptyPointSettingsStyle; +} + +export interface SeriesConnectorLine { + + /**Width of the connector line. + * @Default {1} + */ + width?: number; + + /**Color of the connector line. + * @Default {#565656} + */ + color?: string; + + /**DashArray of the connector line. + * @Default {null} + */ + dashArray?: string; + + /**DashArray of the connector line. + * @Default {1} + */ + opacity?: number; +} + +export interface SeriesErrorBarCap { + + /**Show/Hides the error bar cap. + * @Default {true} + */ + visible?: boolean; + + /**Width of the error bar cap. + * @Default {1} + */ + width?: number; + + /**Length of the error bar cap. + * @Default {1} + */ + length?: number; + + /**Color of the error bar cap. + * @Default {#000000} + */ + fill?: string; +} + +export interface SeriesErrorBar { + + /**Show/hides the error bar + * @Default {visible} + */ + visibility?: boolean; + + /**Specifies the type of error bar. + * @Default {FixedValue} + */ + type?: ej.datavisualization.Chart.ErrorBarType|string; + + /**Specifies the mode of error bar. + * @Default {vertical} + */ + mode?: ej.datavisualization.Chart.ErrorBarMode|string; + + /**Specifies the direction of error bar. + * @Default {both} + */ + direction?: ej.datavisualization.Chart.ErrorBarDirection|string; + + /**Value of vertical error bar. + * @Default {3} + */ + verticalErrorValue?: number; + + /**Value of horizontal error bar. + * @Default {1} + */ + horizontalErrorValue?: number; + + /**Value of positive horizontal error bar. + * @Default {1} + */ + horizontalPositiveErrorValue?: number; + + /**Value of negative horizontal error bar. + * @Default {1} + */ + horizontalNegativeErrorValue?: number; + + /**Value of positive vertical error bar. + * @Default {5} + */ + verticalPositiveErrorValue?: number; + + /**Value of negative vertical error bar. + * @Default {5} + */ + verticalNegativeErrorValue?: number; + + /**Fill color of the error bar. + * @Default {#000000} + */ + fill?: string; + + /**Width of the error bar. + * @Default {1} + */ + width?: number; + + /**Options for customizing the error bar cap. + */ + cap?: SeriesErrorBarCap; +} + +export interface SeriesPointsBorder { + + /**Border color of the point. + * @Default {null} + */ + color?: string; + + /**Border width of the point. + * @Default {null} + */ + width?: number; +} + +export interface SeriesPointsMarkerBorder { + + /**Border color of the marker shape. + * @Default {white} + */ + color?: string; + + /**Border width of the marker shape. + * @Default {3} + */ + width?: number; +} + +export interface SeriesPointsMarkerDataLabelBorder { + + /**Border color of the data label. + * @Default {null} + */ + color?: string; + + /**Border width of the data label. + * @Default {0.1} + */ + width?: number; +} + +export interface SeriesPointsMarkerDataLabelConnectorLine { + + /**Specifies when the connector has to be drawn as Bezier curve or straight line. This is applicable only for Pie and Doughnut chart types. + * @Default {line. See ConnectorLineType} + */ + type?: ej.datavisualization.Chart.ConnectorLineType|string; + + /**Width of the connector. + * @Default {0.5} + */ + width?: number; +} + +export interface SeriesPointsMarkerDataLabelFont { + + /**Font family of the data label. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style of the data label. + * @Default {normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the data label. + * @Default {regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of the text. + * @Default {1} + */ + opacity?: number; + + /**Font size of the data label. + * @Default {12px} + */ + size?: string; +} + +export interface SeriesPointsMarkerDataLabelMargin { + + /**Bottom margin of the text. + * @Default {5} + */ + bottom?: number; + + /**Left margin of the text. + * @Default {5} + */ + left?: number; + + /**Right margin of the text. + * @Default {5} + */ + right?: number; + + /**Top margin of the text. + * @Default {5} + */ + top?: number; +} + +export interface SeriesPointsMarkerDataLabel { + + /**Angle of the data label in degrees. Only the text gets rotated, whereas the background and border does not rotate. + * @Default {null} + */ + angle?: number; + + /**Options for customizing the border of the data label. + */ + border?: SeriesPointsMarkerDataLabelBorder; + + /**Options for displaying and customizing the line that connects point and data label. + */ + connectorLine?: SeriesPointsMarkerDataLabelConnectorLine; + + /**Background color of the data label. + * @Default {null} + */ + fill?: string; + + /**Options for customizing the data label font. + */ + font?: SeriesPointsMarkerDataLabelFont; + + /**Horizontal alignment of the data label. + * @Default {center} + */ + horizontalTextAlignment?: ej.datavisualization.Chart.HorizontalTextAlignment|string; + + /**Margin of the text to its background shape. The size of the background shape increases based on the margin applied to its text. + */ + margin?: SeriesPointsMarkerDataLabelMargin; + + /**Opacity of the data label. + * @Default {1} + */ + opacity?: number; + + /**Background shape of the data label. + * @Default {No shape is rendered by default, so its value is ‘none’. See Shape} + */ + shape?: ej.datavisualization.Chart.Shape|string; + + /**Specifies the position of the data label. This property can be used only for the series such as column, bar, stacked column, stacked bar, 100% stacked column, 100% stacked bar, candle and OHLC. + * @Default {top. See TextPosition} + */ + textPosition?: ej.datavisualization.Chart.TextPosition|string; + + /**Vertical alignment of the data label. + * @Default {'center'} + */ + verticalTextAlignment?: ej.datavisualization.Chart.VerticalTextAlignment|string; + + /**Controls the visibility of the data labels. + * @Default {false} + */ + visible?: boolean; + + /**Custom template to format the data label content. Use “point.x” and “point.y” as a placeholder text to display the corresponding data point’s x and y value. + */ + template?: string; + + /**Moves the label vertically by specified offset. + * @Default {0} + */ + offset?: number; +} + +export interface SeriesPointsMarkerSize { + + /**Height of the marker. + * @Default {6} + */ + height?: number; + + /**Width of the marker. + * @Default {6} + */ + width?: number; +} + +export interface SeriesPointsMarker { + + /**Options for customizing the border of the marker shape. + */ + border?: SeriesPointsMarkerBorder; + + /**Options for displaying and customizing data label. + */ + dataLabel?: SeriesPointsMarkerDataLabel; + + /**Color of the marker shape. + * @Default {null} + */ + fill?: string; + + /**The URL for the Image that is to be displayed as marker. In order to display image as marker, set series.marker.shape as ‘image’. + */ + imageUrl?: string; + + /**Opacity of the marker. + * @Default {1} + */ + opacity?: number; + + /**Specifies the shape of the marker. + * @Default {circle. See Shape} + */ + shape?: ej.datavisualization.Chart.Shape|string; + + /**Options for customizing the size of the marker shape. + */ + size?: SeriesPointsMarkerSize; + + /**Controls the visibility of the marker shape. + * @Default {false} + */ + visible?: boolean; +} + +export interface SeriesPoints { + + /**Options for customizing the border of a point. This is applicable only for column type series and accumulation type series. + */ + border?: SeriesPointsBorder; + + /**To show/hide the intermediate summary from the last intermediate point. + * @Default {false} + */ + showIntermediateSum?: boolean; + + /**To show/hide the total summary of the waterfall series. + * @Default {false} + */ + showTotalSum?: boolean; + + /**Close value of the point. Close value is applicable only for financial type series. + * @Default {null} + */ + close?: number; + + /**Size of a bubble in the bubble series. This is applicable only for the bubble series. + * @Default {null} + */ + size?: number; + + /**Background color of the point. This is applicable only for column type series and accumulation type series. + * @Default {null} + */ + fill?: string; + + /**High value of the point. High value is applicable only for financial type series, range area series and range column series. + * @Default {null} + */ + high?: number; + + /**Low value of the point. Low value is applicable only for financial type series, range area series and range column series. + * @Default {null} + */ + low?: number; + + /**Options for displaying and customizing marker for a data point. Marker contains shapes and/or data labels. + */ + marker?: SeriesPointsMarker; + + /**Open value of the point. This is applicable only for financial type series. + * @Default {null} + */ + open?: number; + + /**Datalabel text for the point. + * @Default {null} + */ + text?: string; + + /**X value of the point. + * @Default {null} + */ + x?: number; + + /**Y value of the point. + * @Default {null} + */ + y?: number; +} + +export interface SeriesTooltipBorder { + + /**Border Color of the tooltip. + * @Default {null} + */ + color?: string; + + /**Border Width of the tooltip. + * @Default {1} + */ + width?: number; +} + +export interface SeriesTooltip { + + /**Options for customizing the border of the tooltip. + */ + border?: SeriesTooltipBorder; + + /**Customize the corner radius of the tooltip rectangle. + * @Default {0} + */ + rx?: number; + + /**Customize the corner radius of the tooltip rectangle. + * @Default {0} + */ + ry?: number; + + /**Specifies the duration, the tooltip has to be displayed. + * @Default {500ms} + */ + duration?: string; + + /**Enables/disables the animation of the tooltip when moving from one point to another. + * @Default {true} + */ + enableAnimation?: boolean; + + /**Background color of the tooltip. + * @Default {null} + */ + fill?: string; + + /**Format of the tooltip content. + * @Default {#point.x# : #point.y#} + */ + format?: string; + + /**Opacity of the tooltip. + * @Default {0.95} + */ + opacity?: number; + + /**Custom template to format the tooltip content. Use “point.x” and “point.y” as a placeholder text to display the corresponding data point’s x and y value. + * @Default {null} + */ + template?: string; + + /**Controls the visibility of the tooltip. + * @Default {false} + */ + visible?: boolean; +} + +export interface SeriesTrendlines { + + /**Show/hides the trendline. + */ + visibility?: boolean; + + /**Specifies the type of trendline for the series. + * @Default {linear. See TrendlinesType} + */ + type?: string; + + /**Name for the trendlines that is to be displayed in legend text. + * @Default {Trendline} + */ + name?: string; + + /**Fill color of the trendlines. + * @Default {#0000FF} + */ + fill?: string; + + /**Width of the trendlines. + * @Default {1} + */ + width?: number; + + /**Opacity of the trendline. + * @Default {1} + */ + opacity?: number; + + /**Pattern of dashes and gaps used to stroke the trendline. + */ + dashArray?: string; + + /**Future trends of the current series. + * @Default {0} + */ + forwardForecast?: number; + + /**Past trends of the current series. + * @Default {0} + */ + backwardForecast?: number; + + /**Specifies the order of polynomial trendlines. + * @Default {0} + */ + polynomialOrder?: number; + + /**Specifies the moving average starting period value. + * @Default {2} + */ + period?: number; +} + +export interface SeriesHighlightSettingsBorder { + + /**Border color of the series/point on highlight. + */ + color?: string; + + /**Border width of the series/point on highlight. + * @Default {2} + */ + width?: string; +} + +export interface SeriesHighlightSettings { + + /**Enables/disables the ability to highlight series or data point interactively. + * @Default {false} + */ + enable?: boolean; + + /**Specifies whether series or data point has to be highlighted. + * @Default {series. See Mode} + */ + mode?: ej.datavisualization.Chart.Mode|string; + + /**Color of the series/point on highlight. + */ + color?: string; + + /**Opacity of the series/point on highlight. + * @Default {0.6} + */ + opacity?: number; + + /**Options for customizing the border of series on highlight. + */ + border?: SeriesHighlightSettingsBorder; + + /**Specifies the pattern for the series/point on highlight. + * @Default {none. See Pattern} + */ + pattern?: string; + + /**Custom pattern for the series on highlight. + */ + customPattern?: string; +} + +export interface SeriesSelectionSettingsBorder { + + /**Border color of the series/point on selection. + */ + color?: string; + + /**Border width of the series/point on selection. + * @Default {2} + */ + width?: string; +} + +export interface SeriesSelectionSettings { + + /**Enables/disables the ability to select a series/data point interactively. + * @Default {false} + */ + enable?: boolean; + + /**Specifies whether series or data point has to be selected. + * @Default {series. See Mode} + */ + mode?: ej.datavisualization.Chart.Mode|string; + + /**Specifies the type of selection. + * @Default {single} + */ + type?: ej.datavisualization.Chart.SelectionType|string; + + /**Color of the series/point on selection. + */ + color?: string; + + /**Opacity of the series/point on selection. + * @Default {0.6} + */ + opacity?: number; + + /**Options for customizing the border of series on selection. + */ + border?: SeriesSelectionSettingsBorder; + + /**Specifies the pattern for the series/point on selection. + * @Default {none. See Pattern} + */ + pattern?: string; + + /**Custom pattern for the series on selection. + */ + customPattern?: string; +} + +export interface Series { + + /**Color of the point, where the close is up in financial chart. + * @Default {null} + */ + bearFillColor?: string; + + /**Options for customizing the border of the series. + */ + border?: SeriesBorder; + + /**Color of the point, where the close is down in financial chart. + * @Default {null} + */ + bullFillColor?: string; + + /**Pattern of dashes and gaps used to stroke the line type series. + */ + dashArray?: string; + + /**Specifies the dataSource for the series. It can be an array of JSON objects or an instance of ej.DataManager. + * @Default {null} + */ + dataSource?: any; + + /**Controls the size of the hole in doughnut series. Value ranges from 0 to 1. + * @Default {0.4} + */ + doughnutCoefficient?: number; + + /**Controls the size of the doughnut series. Value ranges from 0 to 1. + * @Default {0.8} + */ + doughnutSize?: number; + + /**Type of series to be drawn in radar or polar series. + * @Default {line. See DrawType} + */ + drawType?: boolean; + + /**Enable/disable the animation of series. + * @Default {false} + */ + enableAnimation?: boolean; + + /**To avoid overlapping of data labels smartly. + * @Default {null} + */ + enableSmartLabels?: number; + + /**End angle of pie/doughnut series. For a complete circle, it has to be 360, by default. + * @Default {null} + */ + endAngle?: number; + + /**Explodes the pie/doughnut slices on mouse move. + * @Default {false} + */ + explode?: boolean; + + /**Explodes all the slice of pie/doughnut on render. + * @Default {null} + */ + explodeAll?: boolean; + + /**Index of the point to be exploded from pie/doughnut/pyramid/funnel. + * @Default {null} + */ + explodeIndex?: number; + + /**Specifies the distance of the slice from the center, when it is exploded. + * @Default {25} + */ + explodeOffset?: number; + + /**Fill color of the series. + * @Default {null} + */ + fill?: string; + + /**Options for customizing the series font. + */ + font?: SeriesFont; + + /**Specifies the height of the funnel in funnel series. Values can be in both pixel and percentage. + * @Default {32.7%} + */ + funnelHeight?: string; + + /**Specifies the width of the funnel in funnel series. Values can be in both pixel and percentage. + * @Default {11.6%} + */ + funnelWidth?: string; + + /**Gap between the slices of pyramid/funnel series. + * @Default {0} + */ + gapRatio?: number; + + /**Specifies whether to join start and end point of a line/area series used in polar/radar chart to form a closed path. + * @Default {true} + */ + isClosed?: boolean; + + /**Specifies whether to stack the column series in polar/radar charts. + * @Default {true} + */ + isStacking?: boolean; + + /**Renders the chart vertically. This is applicable only for cartesian type series. + * @Default {false} + */ + isTransposed?: boolean; + + /**Position of the data label in pie/doughnut/pyramid/funnel series. OutsideExtended position is not applicable for pyramid/funnel. + * @Default {inside. See LabelPosition} + */ + labelPosition?: ej.datavisualization.Chart.LabelPosition|string; + + /**Specifies the line cap of the series. + * @Default {Butt. See LineCap} + */ + lineCap?: ej.datavisualization.Chart.LineCap|string; + + /**Specifies the type of shape to be used where two lines meet. + * @Default {Round. See LineJoin} + */ + lineJoin?: ej.datavisualization.Chart.LineJoin|string; + + /**Options for displaying and customizing marker for individual point in a series. Marker contains shapes and/or data labels. + */ + marker?: SeriesMarker; + + /**Opacity of the series. + * @Default {1} + */ + opacity?: number; + + /**Name of a field in data source where fill color for all the data points is generated. + */ + palette?: string; + + /**Controls the size of pie series. Value ranges from 0 to 1. + * @Default {0.8} + */ + pieCoefficient?: number; + + /**Options for customizing the empty point in the series. + */ + emptyPointSettings?: SeriesEmptyPointSettings; + + /**Fill color for the positive column of the waterfall. + * @Default {null} + */ + positiveFill?: string; + + /**Options for customizing the waterfall connector line. + */ + connectorLine?: SeriesConnectorLine; + + /**Options to customize the error bar in series. + */ + errorBar?: SeriesErrorBar; + + /**Option to add data points; each point should have x and y property. Also, optionally, you can customize the points color, border, marker by using fill, border and marker options. + */ + points?: Array; + + /**Specifies the mode of the pyramid series. + * @Default {linear} + */ + pyramidMode?: ej.datavisualization.Chart.PyramidMode|string; + + /**Specifies ej.Query to select data from dataSource. This property is applicable only when the dataSource is ej.DataManager. + * @Default {null} + */ + query?: any; + + /**Start angle from where the pie/doughnut series renders. It starts from 0, by default. + * @Default {null} + */ + startAngle?: number; + + /**Options for customizing the tooltip of chart. + */ + tooltip?: SeriesTooltip; + + /**Specifies the type of the series to render in chart. + * @Default {column. see Type} + */ + type?: ej.datavisualization.Chart.Type|string; + + /**Controls the visibility of the series. + * @Default {visible} + */ + visibility?: string; + + /**Specifies the name of the x-axis that has to be associated with this series. Add an axis instance with this name to axes collection. + * @Default {null} + */ + xAxisName?: string; + + /**Name of the property in the datasource that contains x value for the series. + * @Default {null} + */ + xName?: string; + + /**Specifies the name of the y-axis that has to be associated with this series. Add an axis instance with this name to axes collection. + * @Default {null} + */ + yAxisName?: string; + + /**Name of the property in the datasource that contains y value for the series. + * @Default {null} + */ + yName?: string; + + /**Name of the property in the datasource that contains high value for the series. + * @Default {null} + */ + high?: string; + + /**Name of the property in the datasource that contains low value for the series. + * @Default {null} + */ + low?: string; + + /**Name of the property in the datasource that contains open value for the series. + * @Default {null} + */ + open?: string; + + /**Name of the property in the datasource that contains close value for the series. + * @Default {null} + */ + close?: string; + + /**Name of the property in the datasource that contains the size value for the bubble series. + * @Default {null} + */ + size?: string; + + /**Option to add trendlines to chart. + */ + trendlines?: Array; + + /**Options for customizing the appearance of the series or data point while highlighting. + */ + highlightSettings?: SeriesHighlightSettings; + + /**Options for customizing the appearance of the series/data point on selection. + */ + selectionSettings?: SeriesSelectionSettings; +} + +export interface Size { + + /**Height of the Chart. Height can be specified in either pixel or percentage. + * @Default {'450'} + */ + height?: string; + + /**Width of the Chart. Width can be specified in either pixel or percentage. + * @Default {'450'} + */ + width?: string; +} + +export interface TitleBorder { + + /**Width of the title border. + * @Default {1} + */ + width?: number; + + /**color of the title border. + * @Default {transparent} + */ + color?: string; + + /**opacity of the title border. + * @Default {0.8} + */ + opacity?: number; + + /**opacity of the title border. + * @Default {0.8} + */ + cornerRadius?: number; +} + +export interface TitleFont { + + /**Font family for Chart title. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style for Chart title. + * @Default {Normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight for Chart title. + * @Default {Regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of the Chart title. + * @Default {0.5} + */ + opacity?: number; + + /**Font size for Chart title. + * @Default {20px} + */ + size?: string; +} + +export interface TitleSubTitleFont { + + /**Font family of sub title. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style for sub title. + * @Default {Normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight for sub title. + * @Default {Regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of the sub title. + * @Default {1} + */ + opacity?: number; + + /**Font size for sub title. + * @Default {12px} + */ + size?: string; +} + +export interface TitleSubTitleBorder { + + /**Width of the subtitle border. + * @Default {1} + */ + width?: number; + + /**color of the subtitle border. + * @Default {transparent} + */ + color?: string; + + /**opacity of the subtitle border. + * @Default {0.8} + */ + opacity?: number; + + /**opacity of the subtitle border. + * @Default {0.8} + */ + cornerRadius?: number; +} + +export interface TitleSubTitle { + + /**Options for customizing the font of sub title. + */ + font?: TitleSubTitleFont; + + /**Background color for the chart subtitle. + * @Default {transparent} + */ + background?: string; + + /**Options to customize the border of the title. + */ + border?: TitleSubTitleBorder; + + /**Text to be displayed in sub title. + */ + text?: string; + + /**Alignment of sub title text. + * @Default {far. See TextAlignment} + */ + textAlignment?: ej.datavisualization.Chart.Alignment|string; +} + +export interface Title { + + /**Background color for the chart title. + * @Default {transparent} + */ + background?: string; + + /**Options to customize the border of the title. + */ + border?: TitleBorder; + + /**Options for customizing the font of Chart title. + */ + font?: TitleFont; + + /**Options to customize the sub title of Chart. + */ + subTitle?: TitleSubTitle; + + /**Text to be displayed in Chart title. + */ + text?: string; + + /**Alignment of the title text. + * @Default {Center. See TextAlignment} + */ + textAlignment?: ej.datavisualization.Chart.Alignment|string; +} + +export interface Zooming { + + /**Enables or disables zooming. + * @Default {false} + */ + enable?: boolean; + + /**Enable or disables the differed zooming. When it is enabled, chart is updated only on mouse up action while zooming and panning. + * @Default {false} + */ + enableDeferredZoom?: boolean; + + /**Enables/disables the ability to zoom the chart on moving the mouse wheel. + * @Default {false} + */ + enableMouseWheel?: boolean; + + /**Specifies whether to allow zooming the chart vertically or horizontally or in both ways. + * @Default {'x,y'} + */ + type?: string; + + /**To display user specified buttons in zooming toolbar. + * @Default {[zoomIn, zoomOut, zoom, pan, reset]} + */ + toolbarItems?: Array; +} +} +module Chart +{ +enum CoordinateUnit +{ +//string +None, +//string +Pixels, +//string +Points, +} +} +module Chart +{ +enum HorizontalAlignment +{ +//string +Left, +//string +Right, +//string +Middle, +} +} +module Chart +{ +enum Region +{ +//string +Chart, +//string +Series, +} +} +module Chart +{ +enum VerticalAlignment +{ +//string +Top, +//string +Bottom, +//string +Middle, +} +} +module Chart +{ +enum Unit +{ +//string +Percentage, +//string +Pixel, +} +} +module Chart +{ +enum DrawType +{ +//string +Line, +//string +Area, +//string +Column, +} +} +module Chart +{ +enum FontStyle +{ +//string +Normal, +//string +Italic, +} +} +module Chart +{ +enum FontWeight +{ +//string +Regular, +//string +Bold, +//string +Lighter, +} +} +module Chart +{ +enum LabelPosition +{ +//string +Inside, +//string +Outside, +//string +OutsideExtended, +} +} +module Chart +{ +enum LineCap +{ +//string +Butt, +//string +Round, +//string +Square, +} +} +module Chart +{ +enum LineJoin +{ +//string +Round, +//string +Bevel, +//string +Miter, +} +} +module Chart +{ +enum ConnectorLineType +{ +//string +Line, +//string +Bezier, +} +} +module Chart +{ +enum HorizontalTextAlignment +{ +//string +Center, +//string +Near, +//string +Far, +} +} +module Chart +{ +enum Shape +{ +//string +None, +//string +LeftArrow, +//string +RightArrow, +//string +Circle, +//string +Cross, +//string +HorizLine, +//string +VertLine, +//string +Diamond, +//string +Rectangle, +//string +Triangle, +//string +Hexagon, +//string +Pentagon, +//string +Star, +//string +Ellipse, +//string +Trapezoid, +//string +UpArrow, +//string +DownArrow, +//string +Image, +//string +SeriesType, +} +} +module Chart +{ +enum TextPosition +{ +//string +Top, +//string +Bottom, +//string +Middle, +} +} +module Chart +{ +enum VerticalTextAlignment +{ +//string +Center, +//string +Near, +//string +Far, +} +} +module Chart +{ +enum PyramidMode +{ +//string +Linear, +//string +Surface, +} +} +module Chart +{ +enum Type +{ +//string +Area, +//string +Line, +//string +Spline, +//string +Column, +//string +Scatter, +//string +Bubble, +//string +SplineArea, +//string +StepArea, +//string +StepLine, +//string +Pie, +//string +Hilo, +//string +HiloOpenClose, +//string +Candle, +//string +Bar, +//string +StackingArea, +//string +StackingArea100, +//string +RangeColumn, +//string +StackingColumn, +//string +StackingColumn100, +//string +StackingBar, +//string +StackingBar100, +//string +Pyramid, +//string +Funnel, +//string +Doughnut, +//string +Polar, +//string +Radar, +//string +RangeArea, +} +} +module Chart +{ +enum EmptyPointMode +{ +//string +Gap, +//string +Zero, +//string +Average, +} +} +module Chart +{ +enum ErrorBarType +{ +//string +FixedValue, +//string +Percentage, +//string +StandardDeviation, +//string +StandardError, +} +} +module Chart +{ +enum ErrorBarMode +{ +//string +Both, +//string +Vertical, +//string +Horizontal, +} +} +module Chart +{ +enum ErrorBarDirection +{ +//string +Both, +//string +Plus, +//string +Minus, +} +} +module Chart +{ +enum Mode +{ +//string +Series, +//string +Point, +//string +Cluster, +} +} +module Chart +{ +enum SelectionType +{ +//string +Single, +//string +Multiple, +} +} +module Chart +{ +enum CrosshairType +{ +//string +Crosshair, +//string +Trackball, +} +} +module Chart +{ +enum Alignment +{ +//string +Center, +//string +Near, +//string +Far, +} +} +module Chart +{ +enum Position +{ +//string +Left, +//string +Right, +//string +Top, +//string +Bottom, +} +} +module Chart +{ +enum TextOverflow +{ +//string +None, +//string +Trim, +//string +Wrap, +//string +WrapAndTrim, +} +} +module Chart +{ +enum EdgeLabelPlacement +{ +//string +None, +//string +Shift, +//string +Hide, +} +} +module Chart +{ +enum IntervalType +{ +//string +Days, +//string +Hours, +//string +Seconds, +//string +Milliseconds, +//string +Minutes, +//string +Months, +//string +Years, +} +} +module Chart +{ +enum LabelIntersectAction +{ +//string +None, +//string +Rotate90, +//string +Rotate45, +//string +Wrap, +//string +WrapByword, +//string +Trim, +//string +Hide, +//string +MultipleRows, +} +} +module Chart +{ +enum RangePadding +{ +//string +Additional, +//string +Normal, +//string +None, +//string +Round, +} +} +module Chart +{ +enum TextAlignment +{ +//string +MiddleTop, +//string +MiddleCenter, +//string +MiddleBottom, +} +} +module Chart +{ +enum ZIndex +{ +//string +Inside, +//string +Over, +} +} +module Chart +{ +enum TickLinesPosition +{ +//string +Inside, +//string +Outside, +} +} +module Chart +{ +enum ValueType +{ +//string +Double, +//string +Category, +//string +DateTime, +//string +Logarithmic, +} +} +module Chart +{ +enum Theme +{ +//string +Azure, +//string +FlatLight, +//string +FlatDark, +//string +Azuredark, +//string +Lime, +//string +LimeDark, +//string +Saffron, +//string +SaffronDark, +//string +GradientLight, +//string +GradientDark, +} +} + +class RangeNavigator extends ej.Widget { + static fn: RangeNavigator; + constructor(element: JQuery, options?: RangeNavigator.Model); + constructor(element: Element, options?: RangeNavigator.Model); + model:RangeNavigator.Model; + defaults:RangeNavigator.Model; + + /** destroy the range navigator widget + * @returns {void} + */ + _destroy (): void; +} +export module RangeNavigator{ + +export interface Model { + + /**Toggles the placement of slider exactly on the place it left or on the nearest interval. + * @Default {false} + */ + allowSnapping?: boolean; + + /**Specifies the data source for range navigator. + */ + dataSource?: any; + + /**Sets a value whether to make the range navigator responsive on resize. + * @Default {false} + */ + enableAutoResizing?: boolean; + + /**Toggles the redrawing of chart on moving the sliders. + * @Default {true} + */ + enableDeferredUpdate?: boolean; + + /**Toggles the direction of rendering the range navigator control. + * @Default {false} + */ + enableRTL?: boolean; + + /**Options for customizing the labels colors, font, style, size, horizontalAlignment and opacity. + */ + labelSettings?: LabelSettings; + + /**This property is to specify the localization of range navigator. + * @Default {en-US} + */ + locale?: string; + + /**Options for customizing the range navigator. + */ + navigatorStyleSettings?: NavigatorStyleSettings; + + /**Padding specifies the gap between the container and the range navigator. + * @Default {0} + */ + padding?: string; + + /**If the range is not given explicitly, range will be calculated automatically. + * @Default {none} + */ + rangePadding?: ej.datavisualization.RangeNavigator.RangePadding|string; + + /**Options for customizing the starting and ending ranges. + */ + rangeSettings?: RangeSettings; + + /**selectedData is for getting the data when the "rangeChanged" event trigger from client side. + */ + selectedData?: any; + + /**Options for customizing the start and end range values. + */ + selectedRangeSettings?: SelectedRangeSettings; + + /**Contains property to customize the hight and width of range navigator. + */ + sizeSettings?: SizeSettings; + + /**By specifying this property the user can change the theme of the range navigator. + * @Default {null} + */ + theme?: string; + + /**Options for customizing the tooltip in range navigator. + */ + tooltipSettings?: TooltipSettings; + + /**Options for configuring minor grid lines, major grid lines, axis line of axis. + */ + valueAxisSettings?: ValueAxisSettings; + + /**You can plot data of type date time or numeric. This property determines the type of data that this axis will handle. + * @Default {datetime} + */ + valueType?: ej.datavisualization.RangeNavigator.ValueType|string; + + /**Specifies the xName for dataSource. This is used to take the x values from dataSource + */ + xName?: any; + + /**Specifies the yName for dataSource. This is used to take the y values from dataSource + */ + yName?: any; + + /**Fires on load of range navigator.*/ + load? (e: LoadEventArgs): void; + + /**Fires after range navigator is loaded.*/ + loaded? (e: LoadedEventArgs): void; + + /**Fires on changing the range of range navigator.*/ + rangeChanged? (e: RangeChangedEventArgs): void; +} + +export interface LoadEventArgs { + + /**parameters from range navigator + */ + Data?: any; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the range navigator model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface LoadedEventArgs { + + /**parameters from range navigator + */ + Data?: any; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the range navigator model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface RangeChangedEventArgs { + + /**parameters from range navigator + */ + Data?: any; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the range navigator model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface LabelSettingsHigherLevelBorder { + + /**Specifies the border color of grid lines. + * @Default {transparent} + */ + color?: string; + + /**Specifies the border width of grid lines. + * @Default {0.5} + */ + width?: string; +} + +export interface LabelSettingsHigherLevelGridLineStyle { + + /**Specifies the color of grid lines in higher level. + * @Default {#B5B5B5} + */ + color?: string; + + /**Specifies the dashArray of grid lines in higher level. + * @Default {20 5 0} + */ + dashArray?: string; + + /**Specifies the width of grid lines in higher level. + * @Default {#B5B5B5} + */ + width?: string; +} + +export interface LabelSettingsHigherLevelStyleFont { + + /**Specifies the label font color. Labels render with the specified font color. + * @Default {black} + */ + color?: string; + + /**Specifies the label font family. Labels render with the specified font family. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Specifies the label font style. Labels render with the specified font style. + * @Default {Normal} + */ + fontStyle?: string; + + /**Specifies the label font weight. Labels render with the specified font weight. + * @Default {regular} + */ + fontWeight?: string; + + /**Specifies the label opacity. Labels render with the specified opacity. + * @Default {1} + */ + opacity?: number; + + /**Specifies the label font size. Labels render with the specified font size. + * @Default {12px} + */ + size?: string; +} + +export interface LabelSettingsHigherLevelStyle { + + /**Options for customizing the font properties. + */ + font?: LabelSettingsHigherLevelStyleFont; + + /**Specifies the horizontal text alignment of the text in label. + * @Default {middle} + */ + horizontalAlignment?: string; +} + +export interface LabelSettingsHigherLevel { + + /**Options for customizing the border of grid lines in higher level. + */ + border?: LabelSettingsHigherLevelBorder; + + /**Specifies the fill color of higher level labels. + * @Default {transparent} + */ + fill?: string; + + /**Options for customizing the grid line colors, width, dashArray, border. + */ + gridLineStyle?: LabelSettingsHigherLevelGridLineStyle; + + /**Specifies the intervalType for higher level labels. See IntervalType + * @Default {years} + */ + intervalType?: ej.datavisualization.RangeNavigator.IntervalType|string; + + /**Specifies the position of the labels to render either inside or outside of plot area + * @Default {outside} + */ + labelPlacement?: ej.datavisualization.RangeNavigator.LabelPlacement|string; + + /**Specifies the position of the labels in higher level + * @Default {top} + */ + position?: ej.datavisualization.RangeNavigator.Position|string; + + /**Options for customizing the style of higher level labels. + */ + style?: LabelSettingsHigherLevelStyle; + + /**Toggles the visibility of higher level labels. + * @Default {true} + */ + visible?: boolean; +} + +export interface LabelSettingsLowerLevelBorder { + + /**Specifies the border color of grid lines. + * @Default {transparent} + */ + color?: string; + + /**Specifies the border width of grid lines. + * @Default {0.5} + */ + width?: string; +} + +export interface LabelSettingsLowerLevelGridLineStyle { + + /**Specifies the color of grid lines in lower level. + * @Default {#B5B5B5} + */ + color?: string; + + /**Specifies the dashArray of gridLines in lowerLevel. + * @Default {20 5 0} + */ + dashArray?: string; + + /**Specifies the width of grid lines in lower level. + * @Default {#B5B5B5} + */ + width?: string; +} + +export interface LabelSettingsLowerLevelStyleFont { + + /**Specifies the color of labels. Label text render in this specified color. + * @Default {black} + */ + color?: string; + + /**Specifies the font family of labels. Label text render in this specified font family. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Specifies the font style of labels. Label text render in this specified font style. + * @Default {Normal} + */ + fontStyle?: string; + + /**Specifies the font weight of labels. Label text render in this specified font weight. + * @Default {regular} + */ + fontWeight?: string; + + /**Specifies the opacity of labels. Label text render in this specified opacity. + * @Default {12px} + */ + opacity?: string; + + /**Specifies the size of labels. Label text render in this specified size. + * @Default {12px} + */ + size?: string; +} + +export interface LabelSettingsLowerLevelStyle { + + /**Options for customizing the font of labels. + */ + font?: LabelSettingsLowerLevelStyleFont; + + /**Specifies the horizontal text alignment of the text in label. + * @Default {middle} + */ + horizontalAlignment?: string; +} + +export interface LabelSettingsLowerLevel { + + /**Options for customizing the border of grid lines in lower level. + */ + border?: LabelSettingsLowerLevelBorder; + + /**Specifies the fill color of labels in lower level. + * @Default {transparent} + */ + fill?: string; + + /**Options for customizing the grid lines in lower level. + */ + gridLineStyle?: LabelSettingsLowerLevelGridLineStyle; + + /**Specifies the intervalType of the labels in lower level.See IntervalType + * @Default {years} + */ + intervalType?: ej.datavisualization.RangeNavigator.IntervalType|string; + + /**Specifies the position of the labels to render either inside or outside of plot area. See LabelPlacement + * @Default {outside} + */ + labelPlacement?: ej.datavisualization.RangeNavigator.LabelPlacement|string; + + /**Specifies the position of the labels in lower level.See Position + * @Default {bottom} + */ + position?: ej.datavisualization.RangeNavigator.Position|string; + + /**Options for customizing the style of labels. + */ + style?: LabelSettingsLowerLevelStyle; + + /**Toggles the visibility of labels in lower level. + * @Default {true} + */ + visible?: boolean; +} + +export interface LabelSettingsStyleFont { + + /**Specifies the label color. This color is applied to the labels in range navigator. + * @Default {#FFFFFF} + */ + color?: string; + + /**Specifies the label font family. Labels render with the specified font family. + * @Default {Segoe UI} + */ + family?: string; + + /**Specifies the label font opacity. Labels render with the specified font opacity. + * @Default {1} + */ + opacity?: number; + + /**Specifies the label font size. Labels render with the specified font size. + * @Default {1px} + */ + size?: string; + + /**Specifies the label font style. Labels render with the specified font style.. + * @Default {Normal} + */ + style?: ej.datavisualization.RangeNavigator.FontStyle|string; + + /**Specifies the lable font weight + * @Default {regular} + */ + weight?: ej.datavisualization.RangeNavigator.FontWeight|string; +} + +export interface LabelSettingsStyle { + + /**Options for customizing the font of labels in range navigator. + */ + font?: LabelSettingsStyleFont; + + /**Specifies the horizontalAlignment of the label in RangeNavigator + * @Default {middle} + */ + horizontalAlignment?: ej.datavisualization.RangeNavigator.HorizontalAlignment|string; +} + +export interface LabelSettings { + + /**Options for customizing the higher level labels in range navigator. + */ + higherLevel?: LabelSettingsHigherLevel; + + /**Options for customizing the labels in lower level. + */ + lowerLevel?: LabelSettingsLowerLevel; + + /**Options for customizing the style of labels in range navigator. + */ + style?: LabelSettingsStyle; +} + +export interface NavigatorStyleSettingsBorder { + + /**Specifies the border color of range navigator. + * @Default {transparent} + */ + color?: string; + + /**Specifies the dash array of range navigator. + * @Default {null} + */ + dashArray?: string; + + /**Specifies the border width of range navigator. + * @Default {0.5} + */ + width?: number; +} + +export interface NavigatorStyleSettingsMajorGridLineStyle { + + /**Specifies the color of major grid lines in range navigator. + * @Default {#B5B5B5} + */ + color?: string; + + /**Toggles the visibility of major grid lines. + * @Default {true} + */ + visible?: boolean; +} + +export interface NavigatorStyleSettingsMinorGridLineStyle { + + /**Specifies the color of minor grid lines in range navigator. + * @Default {#B5B5B5} + */ + color?: string; + + /**Toggles the visibility of minor grid lines. + * @Default {true} + */ + visible?: boolean; +} + +export interface NavigatorStyleSettings { + + /**Specifies the background color of range navigator. + * @Default {#dddddd} + */ + background?: string; + + /**Options for customizing the border color and width of range navigator. + */ + border?: NavigatorStyleSettingsBorder; + + /**Specifies the left side thumb template in range navigator we can give either div id or html string + * @Default {null} + */ + leftThumbTemplate?: string; + + /**Options for customizing the major grid lines. + */ + majorGridLineStyle?: NavigatorStyleSettingsMajorGridLineStyle; + + /**Options for customizing the minor grid lines. + */ + minorGridLineStyle?: NavigatorStyleSettingsMinorGridLineStyle; + + /**Specifies the opacity of RangeNavigator. + * @Default {1} + */ + opacity?: number; + + /**Specifies the right side thumb template in range navigator we can give either div id or html string + * @Default {null} + */ + rightThumbTemplate?: string; + + /**Specifies the color of the selected region in range navigator. + * @Default {#EFEFEF} + */ + selectedRegionColor?: string; + + /**Specifies the opacity of Selected Region. + * @Default {0} + */ + selectedRegionOpacity?: number; + + /**Specifies the color of the thumb in range navigator. + * @Default {#2382C3} + */ + thumbColor?: string; + + /**Specifies the radius of the thumb in range navigator. + * @Default {10} + */ + thumbRadius?: number; + + /**Specifies the stroke color of the thumb in range navigator. + * @Default {#303030} + */ + thumbStroke?: string; + + /**Specifies the color of the unselected region in range navigator. + * @Default {#5EABDE} + */ + unselectedRegionColor?: string; + + /**Specifies the opacity of Unselected Region. + * @Default {0.3} + */ + unselectedRegionOpacity?: number; +} + +export interface RangeSettings { + + /**Specifies the ending range of range navigator. + * @Default {null} + */ + end?: string; + + /**Specifies the starting range of range navigator. + * @Default {null} + */ + start?: string; +} + +export interface SelectedRangeSettings { + + /**Specifies the ending range of range navigator. + * @Default {null} + */ + end?: string; + + /**Specifies the starting range of range navigator. + * @Default {null} + */ + start?: string; +} + +export interface SizeSettings { + + /**Specifies height of the range navigator. + * @Default {null} + */ + height?: string; + + /**Specifies width of the range navigator. + * @Default {null} + */ + width?: string; +} + +export interface TooltipSettingsFont { + + /**Specifies the color of text in tooltip. Tooltip text render in the specified color. + * @Default {#FFFFFF} + */ + color?: string; + + /**Specifies the font family of text in tooltip. Tooltip text render in the specified font family. + * @Default {Segoe UI} + */ + family?: string; + + /**Specifies the font style of text in tooltip. Tooltip text render in the specified font style. + * @Default {ej.datavisualization.RangeNavigator.fontStyle.Normal} + */ + fontStyle?: string; + + /**Specifies the opacity of text in tooltip. Tooltip text render in the specified opacity. + * @Default {1} + */ + opacity?: number; + + /**Specifies the size of text in tooltip. Tooltip text render in the specified size. + * @Default {10px} + */ + size?: string; + + /**Specifies the weight of text in tooltip. Tooltip text render in the specified weight. + * @Default {ej.datavisualization.RangeNavigator.weight.Regular} + */ + weight?: string; +} + +export interface TooltipSettings { + + /**Specifies the background color of tooltip. + * @Default {#303030} + */ + backgroundColor?: string; + + /**Options for customizing the font in tooltip. + */ + font?: TooltipSettingsFont; + + /**Specifies the format of text to be displayed in tooltip. + * @Default {MM/dd/yyyy} + */ + labelFormat?: string; + + /**Specifies the mode of displaying the tooltip. Neither to display the tooltip always nor on demand. + * @Default {null} + */ + tooltipDisplayMode?: string; + + /**Toggles the visibility of tooltip. + * @Default {true} + */ + visible?: boolean; +} + +export interface ValueAxisSettingsAxisLine { + + /**Toggles the visibility of axis line. + * @Default {none} + */ + visible?: string; +} + +export interface ValueAxisSettingsFont { + + /**Text in axis render with the specified size. + * @Default {0px} + */ + size?: string; +} + +export interface ValueAxisSettingsMajorGridLines { + + /**Toggles the visibility of major grid lines. + * @Default {false} + */ + visible?: boolean; +} + +export interface ValueAxisSettingsMajorTickLines { + + /**Specifies the size of the majorTickLines in range navigator + * @Default {0} + */ + size?: number; + + /**Toggles the visibility of major tick lines. + * @Default {true} + */ + visible?: boolean; + + /**Specifies width of the major tick lines. + * @Default {0} + */ + width?: number; +} + +export interface ValueAxisSettings { + + /**Options for customizing the axis line. + */ + axisLine?: ValueAxisSettingsAxisLine; + + /**Options for customizing the font of the axis. + */ + font?: ValueAxisSettingsFont; + + /**Options for customizing the major grid lines. + */ + majorGridLines?: ValueAxisSettingsMajorGridLines; + + /**Options for customizing the major tick lines in axis. + */ + majorTickLines?: ValueAxisSettingsMajorTickLines; + + /**If the range is not given explicitly, range will be calculated automatically. You can customize the automatic range calculation using rangePadding. + * @Default {none} + */ + rangePadding?: string; + + /**Toggles the visibility of axis in range navigator. + * @Default {false} + */ + visible?: boolean; +} +} +module RangeNavigator +{ +enum IntervalType +{ +//string +Years, +//string +Quarters, +//string +Months, +//string +Weeks, +//string +Days, +//string +Hours, +} +} +module RangeNavigator +{ +enum LabelPlacement +{ +//string +Inside, +//string +Outside, +} +} +module RangeNavigator +{ +enum Position +{ +//string +Top, +//string +Bottom, +} +} +module RangeNavigator +{ +enum FontStyle +{ +//string +Normal, +//string +Bold, +//string +Italic, +} +} +module RangeNavigator +{ +enum FontWeight +{ +//string +Regular, +//string +Lighter, +} +} +module RangeNavigator +{ +enum HorizontalAlignment +{ +//string +Middle, +//string +Left, +//string +Right, +} +} +module RangeNavigator +{ +enum RangePadding +{ +//string +Additional, +//string +Normal, +//string +None, +//string +Round, +} +} +module RangeNavigator +{ +enum ValueType +{ +//string +Numeric, +//string +DateTime, +} +} + +class BulletGraph extends ej.Widget { + static fn: BulletGraph; + constructor(element: JQuery, options?: BulletGraph.Model); + constructor(element: Element, options?: BulletGraph.Model); + model:BulletGraph.Model; + defaults:BulletGraph.Model; + + /** To destroy the bullet graph + * @returns {void} + */ + destroy (): void; + + /** To redraw the bulet graph + * @returns {void} + */ + redraw(): void; + + /** To set the value for comparative measure in bullet graph. + * @returns {void} + */ + setComparativeMeasureSymbol(): void; + + /** To set the value for feature measure bar. + * @returns {void} + */ + setFeatureMeasureBarValue(): void; +} +export module BulletGraph{ + +export interface Model { + + /**Toggles the visibility of the range stroke color of the labels. + * @Default {false} + */ + applyRangeStrokeToLabels?: boolean; + + /**Toggles the visibility of the range stroke color of the ticks. + * @Default {false} + */ + applyRangeStrokeToTicks?: boolean; + + /**Contains property to customize the caption in bullet graph. + */ + captionSettings?: CaptionSettings; + + /**Comparative measure bar in bullet graph render till the specified value. + * @Default {0} + */ + comparativeMeasureValue?: number; + + /**Toggles the animation of bullet graph. + * @Default {true} + */ + enableAnimation?: boolean; + + /**Sets a value whether to make the bullet graph responsive on resize. + * @Default {true} + */ + enableResizing?: boolean; + + /**Specifies the direction of flow in bullet graph. Neither it may be backward nor forward. + * @Default {forward} + */ + flowDirection?: ej.datavisualization.BulletGraph.FlowDirection|string; + + /**Specifies the height of the bullet graph. + * @Default {90} + */ + height?: number; + + /**Bullet graph will render in the specified orientation. + * @Default {horizontal} + */ + orientation?: ej.datavisualization.BulletGraph.Orientation|string; + + /**Contains property to customize the qualitative ranges. + */ + qualitativeRanges?: Array; + + /**Size of the qualitative range depends up on the specified value. + * @Default {32} + */ + qualitativeRangeSize?: number; + + /**Length of the quantitative range depends up on the specified value. + * @Default {475} + */ + quantitativeScaleLength?: number; + + /**Contains all the properties to customize quantitative scale. + */ + quantitativeScaleSettings?: QuantitativeScaleSettings; + + /**By specifying this property the user can change the theme of the bullet graph. + * @Default {flatlight} + */ + theme?: string; + + /**Contains all the properties to customize tooltip. + */ + tooltipSettings?: TooltipSettings; + + /**Feature measure bar in bullet graph render till the specified value. + * @Default {0} + */ + value?: number; + + /**Specifies the width of the bullet graph. + * @Default {595} + */ + width?: number; + + /**Fires on rendering the caption of bullet graph.*/ + drawCaption? (e: DrawCaptionEventArgs): void; + + /**Fires on rendering the category.*/ + drawCategory? (e: DrawCategoryEventArgs): void; + + /**Fires on rendering the comparative measure symbol.*/ + drawComparativeMeasureSymbol? (e: DrawComparativeMeasureSymbolEventArgs): void; + + /**Fires on rednering the feature measure bar.*/ + drawFeatureMeasureBar? (e: DrawFeatureMeasureBarEventArgs): void; + + /**Fires on rendering the indicator of bullet graph.*/ + drawIndicator? (e: DrawIndicatorEventArgs): void; + + /**Fires on rendering the labels.*/ + drawLabels? (e: DrawLabelsEventArgs): void; + + /**Fires on rendering the qualitative ranges.*/ + drawQualitativeRanges? (e: DrawQualitativeRangesEventArgs): void; + + /**Fires on loading bullet graph.*/ + load? (e: LoadEventArgs): void; +} + +export interface DrawCaptionEventArgs { + + /**returns the object of the bullet graph. + */ + Object?: any; + + /**returns the options of the scale element. + */ + scaleElement?: HTMLElement; + + /**returns the current captionSettings element. + */ + captionElement?: HTMLElement; + + /**returns the type of the captionSettings. + */ + captionType?: string; +} + +export interface DrawCategoryEventArgs { + + /**returns the object of the bullet graph. + */ + Object?: any; + + /**returns the options of the scale element. + */ + scaleElement?: HTMLElement; + + /**returns the options of category element. + */ + categoryElement?: HTMLElement; + + /**returns the text value of the category that is drawn. + */ + Value?: string; +} + +export interface DrawComparativeMeasureSymbolEventArgs { + + /**returns the object of the bullet graph. + */ + Object?: any; + + /**returns the options of the scale element. + */ + scaleElement?: HTMLElement; + + /**returns the options of comparative measure element. + */ + targetElement?: HTMLElement; + + /**returns the value of the comparative measure symbol. + */ + Value?: number; +} + +export interface DrawFeatureMeasureBarEventArgs { + + /**returns the object of the bullet graph. + */ + Object?: any; + + /**returns the options of the scale element. + */ + scaleElement?: HTMLElement; + + /**returns the options of feature measure element. + */ + currentElement?: HTMLElement; + + /**returns the value of the feature measure bar. + */ + Value?: number; +} + +export interface DrawIndicatorEventArgs { + + /**returns an object to customize bullet graph indicator text and symbol before rendering it. + */ + indicatorSettings?: any; + + /**returns the object of bullet graph. + */ + model?: any; + + /**returns the type of event. + */ + type?: string; + + /**for cancelling the event. + */ + cancel?: boolean; +} + +export interface DrawLabelsEventArgs { + + /**returns the object of the bullet graph. + */ + Object?: any; + + /**returns the options of the scale element. + */ + scaleElement?: HTMLElement; + + /**returns the current label element. + */ + tickElement?: HTMLElement; + + /**returns the label type. + */ + labelType?: string; +} + +export interface DrawQualitativeRangesEventArgs { + + /**returns the object of the bullet graph. + */ + Object?: any; + + /**returns the index of current range. + */ + rangeIndex?: number; + + /**returns the settings for current range. + */ + rangeOptions?: any; + + /**returns the end value of current range. + */ + rangeEndValue?: number; +} + +export interface LoadEventArgs { +} + +export interface CaptionSettingsFont { + + /**Specifies the color of the text in caption. + * @Default {null} + */ + color?: string; + + /**Specifies the fontFamily of caption. Caption text render with this fontFamily + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Specifies the fontStyle of caption + * @Default {Normal} + */ + fontStyle?: ej.datavisualization.BulletGraph.FontStyle|string; + + /**Specifies the fontWeight of caption + * @Default {regular} + */ + fontWeight?: ej.datavisualization.BulletGraph.FontWeight|string; + + /**Specifies the opacity of caption. Caption text render with this opacity. + * @Default {1} + */ + opacity?: number; + + /**Specifies the size of caption. Caption text render with this size + * @Default {12px} + */ + size?: string; +} + +export interface CaptionSettingsIndicatorFont { + + /**Specifies the color of the indicator's text. + * @Default {null} + */ + color?: string; + + /**Specifies the fontFamily of indicator. Indicator text render with this fontFamily. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Specifies the fontStyle of indicator. Indicator text render with this fontStyle. See FontStyle + * @Default {Normal} + */ + fontStyle?: ej.datavisualization.BulletGraph.FontStyle|string; + + /**Specifies the fontWeight of indicator. Indicator text render with this fontWeight. See FontWeight + * @Default {regular} + */ + fontWeight?: ej.datavisualization.BulletGraph.FontWeight|string; + + /**Specifies the opacity of indicator text. Indicator text render with this Opacity. + * @Default {1} + */ + opacity?: number; + + /**Specifies the size of indicator. Indicator text render with this size. + * @Default {12px} + */ + size?: string; +} + +export interface CaptionSettingsIndicatorLocation { + + /**Specifies the horizontal position of the indicator. + * @Default {10} + */ + x?: number; + + /**Specifies the vertical position of the indicator. + * @Default {60} + */ + y?: number; +} + +export interface CaptionSettingsIndicatorSymbolBorder { + + /**Specifies the border color of indicator symbol. + * @Default {null} + */ + color?: string; + + /**Specifies the border width of indicator symbol. + * @Default {1} + */ + width?: number; +} + +export interface CaptionSettingsIndicatorSymbolSize { + + /**Specifies the height of indicator symbol. + * @Default {10} + */ + height?: number; + + /**Specifies the width of indicator symbol. + * @Default {10} + */ + width?: number; +} + +export interface CaptionSettingsIndicatorSymbol { + + /**Contains property to customize the border of indicator symbol. + */ + border?: CaptionSettingsIndicatorSymbolBorder; + + /**Specifies the color of indicator symbol. + * @Default {null} + */ + color?: string; + + /**Specifies the url of image that represents indicator symbol. + */ + imageURL?: string; + + /**Specifies the opacity of indicator symbol. + * @Default {1} + */ + opacity?: number; + + /**Specifies the shape of indicator symbol. + */ + shape?: string; + + /**Contains property to customize the size of indicator symbol. + */ + size?: CaptionSettingsIndicatorSymbolSize; +} + +export interface CaptionSettingsIndicator { + + /**Contains property to customize the font of indicator. + */ + font?: CaptionSettingsIndicatorFont; + + /**Contains property to customize the location of indicator. + */ + location?: CaptionSettingsIndicatorLocation; + + /**Specifies the padding to be applied when text position is used. + * @Default {2} + */ + padding?: number; + + /**Contains property to customize the symbol of indicator. + */ + symbol?: CaptionSettingsIndicatorSymbol; + + /**Specifies the text to be displayed as indicator text. By default difference between current value and target will be displayed + */ + text?: string; + + /**Specifies the alignement of indicator with respect to scale based on text position + * @Default {'Near'} + */ + textAlignment?: ej.datavisualization.BulletGraph.TextAlignment|string; + + /**Specifies where indicator text should be anchored when indicator overlaps with other caption group text. Text will be anchored when overlapping caption group text are at same position. Anchoring is not applicable for float position. + * @Default {'start'} + */ + textAnchor?: ej.datavisualization.BulletGraph.TextAnchor|string; + + /**indicator text render in the specified angle. + * @Default {0} + */ + textAngle?: number; + + /**Specifies where indicator should be placed + * @Default {'float'} + */ + textPosition?: ej.datavisualization.BulletGraph.TextPosition|string; + + /**Specifies the space between indicator symbol and text. + * @Default {3} + */ + textSpacing?: number; + + /**Specifies whether indicator will be visible or not. + * @Default {false} + */ + visibile?: boolean; +} + +export interface CaptionSettingsLocation { + + /**Specifies the position in horizontal direction + * @Default {17} + */ + x?: number; + + /**Specifies the position in horizontal direction + * @Default {30} + */ + y?: number; +} + +export interface CaptionSettingsSubTitleFont { + + /**Specifies the color of the subtitle's text. + * @Default {null} + */ + color?: string; + + /**Specifies the fontFamily of subtitle. Subtitle text render with this fontFamily. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Specifies the fontStyle of subtitle. Subtitle text render with this fontStyle. See FontStyle + * @Default {Normal} + */ + fontStyle?: ej.datavisualization.BulletGraph.FontStyle|string; + + /**Specifies the fontWeight of subtitle. Subtitle text render with this fontWeight. See FontWeight + * @Default {regular} + */ + fontWeight?: ej.datavisualization.BulletGraph.FontWeight|string; + + /**Specifies the opacity of subtitle. Subtitle text render with this opacity. + * @Default {1} + */ + opacity?: number; + + /**Specifies the size of subtitle. Subtitle text render with this size. + * @Default {12px} + */ + size?: string; +} + +export interface CaptionSettingsSubTitleLocation { + + /**Specifies the horizontal position of the subtitle. + * @Default {10} + */ + x?: number; + + /**Specifies the vertical position of the subtitle. + * @Default {45} + */ + y?: number; +} + +export interface CaptionSettingsSubTitle { + + /**Contains property to customize the font of subtitle. + */ + font?: CaptionSettingsSubTitleFont; + + /**Contains property to customize the location of subtitle. + */ + location?: CaptionSettingsSubTitleLocation; + + /**Specifies the padding to be applied when text position is used. + * @Default {5} + */ + padding?: number; + + /**Specifies the text to be displayed as subtitle. + */ + text?: string; + + /**Specifies the alignment of sub title text with respect to scale. Alignment will not be applied in float position. + * @Default {'Near'} + */ + textAlignment?: ej.datavisualization.BulletGraph.TextAlignment|string; + + /**Specifies where subtitle text should be anchored when sub title text overlaps with other caption group text. Text will be anchored when overlapping caption group text are at same position. Anchoring is not applicable for float position. + * @Default {'start'} + */ + textAnchor?: ej.datavisualization.BulletGraph.TextAnchor|string; + + /**Subtitle render in the specified angle. + * @Default {0} + */ + textAngle?: number; + + /**Specifies where sub title text should be placed. + * @Default {'float'} + */ + textPosition?: ej.datavisualization.BulletGraph.TextPosition|string; +} + +export interface CaptionSettings { + + /**Specifies whether trim the labels will be true or false. + * @Default {true} + */ + enableTrim?: boolean; + + /**Contains property to customize the font of caption. + */ + font?: CaptionSettingsFont; + + /**Contains property to customize the indicator. + */ + indicator?: CaptionSettingsIndicator; + + /**Contains property to customize the location. + */ + location?: CaptionSettingsLocation; + + /**Specifies the padding to be applied when text position is used. + * @Default {5} + */ + padding?: number; + + /**Contains property to customize the subtitle. + */ + subTitle?: CaptionSettingsSubTitle; + + /**Specifies the text to be displayed on bullet graph. + */ + text?: string; + + /**Specifies the alignment of caption text with respect to scale. This property will not be applied when text position is float. + * @Default {'Near'} + */ + textAlignment?: ej.datavisualization.BulletGraph.TextAlignment|string; + + /**Specifies caption text anchoring when caption text overlaps with other caption group text. Text will be anchored when overlapping caption group text are at same position. Anchoring is not applicable for float position. + * @Default {'start'} + */ + textAnchor?: ej.datavisualization.BulletGraph.TextAnchor|string; + + /**Specifies the angel in which the caption is rendered. + * @Default {0} + */ + textAngle?: number; + + /**Specifies how caption text should be placed. + * @Default {'float'} + */ + textPosition?: ej.datavisualization.BulletGraph.TextPosition|string; +} + +export interface QualitativeRanges { + + /**Specifies the ending range to which the qualitative ranges will render. + * @Default {3} + */ + rangeEnd?: number; + + /**Specifies the opacity for the qualitative ranges. + * @Default {1} + */ + rangeOpacity?: number; + + /**Specifies the stroke for the qualitative ranges. + * @Default {null} + */ + rangeStroke?: string; +} + +export interface QuantitativeScaleSettingsComparativeMeasureSettings { + + /**Specifies the stroke of the comparative measure. + * @Default {null} + */ + stroke?: number; + + /**Specifies the width of the comparative measure. + * @Default {5} + */ + width?: number; +} + +export interface QuantitativeScaleSettingsFeaturedMeasureSettings { + + /**Specifies the Stroke of the featured measure in bullet graph. + * @Default {null} + */ + stroke?: number; + + /**Specifies the width of the featured measure in bullet graph. + * @Default {2} + */ + width?: number; +} + +export interface QuantitativeScaleSettingsFeatureMeasures { + + /**Specifies the category of feature measure. + * @Default {null} + */ + category?: string; + + /**Comparative measure render till the specified value. + * @Default {null} + */ + comparativeMeasureValue?: number; + + /**Feature measure render till the specified value. + * @Default {null} + */ + value?: number; +} + +export interface QuantitativeScaleSettingsFields { + + /**Specifies the category of the bullet graph. + * @Default {null} + */ + category?: string; + + /**Comparative measure render based on the values in the specified field. + * @Default {null} + */ + comparativeMeasure?: string; + + /**Specifies the dataSource for the bullet graph. + * @Default {null} + */ + dataSource?: any; + + /**Feature measure render based on the values in the specified field. + * @Default {null} + */ + featureMeasures?: string; + + /**Specifies the query for fetching the values form data source to render the bullet graph. + * @Default {null} + */ + query?: string; + + /**Specifies the name of the table. + * @Default {null} + */ + tableName?: string; +} + +export interface QuantitativeScaleSettingsLabelSettingsFont { + + /**Specifies the fontFamily of labels in bullet graph. Labels render with this fontFamily. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Specifies the fontStyle of labels in bullet graph. Labels render with this fontStyle. See FontStyle + * @Default {Normal} + */ + fontStyle?: ej.datavisualization.BulletGraph.FontStyle|string; + + /**Specifies the fontWeight of labels in bullet graph. Labels render with this fontWeight. See FontWeight + * @Default {regular} + */ + fontWeight?: ej.datavisualization.BulletGraph.FontWeight|string; + + /**Specifies the opacity of labels in bullet graph. Labels render with this opacity + * @Default {1} + */ + opacity?: number; +} + +export interface QuantitativeScaleSettingsLabelSettings { + + /**Contains property to customize the font of the labels in bullet graph. + */ + font?: QuantitativeScaleSettingsLabelSettingsFont; + + /**Specifies the placement of labels in bullet graph scale. + * @Default {outside} + */ + labelPlacement?: ej.datavisualization.BulletGraph.LabelPlacement|string; + + /**Specifies the prefix to be added with labels in bullet graph. + * @Default {Empty string} + */ + labelPrefix?: string; + + /**Specifies the suffix to be added after labels in bullet graph. + * @Default {Empty string} + */ + labelSuffix?: string; + + /**Specifies the horizontal/vertical padding of labels. + * @Default {15} + */ + offset?: number; + + /**Specifies the position of the labels to render either above or below the graph. See Position + * @Default {below} + */ + position?: ej.datavisualization.BulletGraph.LabelPosition|string; + + /**Specifies the Size of the labels. + * @Default {12} + */ + size?: number; + + /**Specifies the stroke color of the labels in bullet graph. + * @Default {null} + */ + stroke?: string; +} + +export interface QuantitativeScaleSettingsLocation { + + /**This property specifies the x position for rendering quantitative scale. + * @Default {10} + */ + x?: number; + + /**This property specifies the y position for rendering quantitative scale. + * @Default {10} + */ + y?: number; +} + +export interface QuantitativeScaleSettingsMajorTickSettings { + + /**Specifies the size of the major ticks. + * @Default {13} + */ + size?: number; + + /**Specifies the stroke color of the major tick lines. + * @Default {null} + */ + stroke?: string; + + /**Specifies the width of the major tick lines. + * @Default {2} + */ + width?: number; +} + +export interface QuantitativeScaleSettingsMinorTickSettings { + + /**Specifies the size of minor ticks. + * @Default {7} + */ + size?: number; + + /**Specifies the stroke color of minor ticks in bullet graph. + * @Default {null} + */ + stroke?: string; + + /**Specifies the width of the minor ticks in bullet graph. + * @Default {2} + */ + width?: number; +} + +export interface QuantitativeScaleSettings { + + /**Contains property to customize the comparative measure. + */ + comparativeMeasureSettings?: QuantitativeScaleSettingsComparativeMeasureSettings; + + /**Contains property to customize the featured measure. + */ + featuredMeasureSettings?: QuantitativeScaleSettingsFeaturedMeasureSettings; + + /**Contains property to customize the featured measure. + */ + featureMeasures?: Array; + + /**Contains property to customize the fields. + */ + fields?: QuantitativeScaleSettingsFields; + + /**Specifies the interval for the Graph. + * @Default {1} + */ + interval?: number; + + /**Contains property to customize the labels. + */ + labelSettings?: QuantitativeScaleSettingsLabelSettings; + + /**Contains property to customize the position of the quantitative scale + */ + location?: QuantitativeScaleSettingsLocation; + + /**Contains property to customize the major tick lines. + */ + majorTickSettings?: QuantitativeScaleSettingsMajorTickSettings; + + /**Specifies the maximum value of the Graph. + * @Default {10} + */ + maximum?: number; + + /**Specifies the minimum value of the Graph. + * @Default {0} + */ + minimum?: number; + + /**Contains property to customize the minor ticks. + */ + minorTickSettings?: QuantitativeScaleSettingsMinorTickSettings; + + /**The specified number of minor ticks will be rendered per interval. + * @Default {4} + */ + minorTicksPerInterval?: number; + + /**Specifies the placement of ticks to render either inside or outside the scale. + * @Default {ej.datavisualization.BulletGraph.TickPlacement.Outside} + */ + tickPlacement?: ej.datavisualization.BulletGraph.TickPlacement|string; + + /**Specifies the position of the ticks to render either above,below or inside + * @Default {ej.datavisualization.BulletGraph.TickPosition.Far} + */ + tickPosition?: ej.datavisualization.BulletGraph.TickPosition|string; +} + +export interface TooltipSettings { + + /**Specifies template for caption tooltip + * @Default {null} + */ + captionTemplate?: string; + + /**Toggles the visibility of caption tooltip + * @Default {false} + */ + enableCaptionTooltip?: boolean; + + /**Specifies the ID of a div, which is to be displayed as tooltip. + * @Default {null} + */ + template?: string; + + /**Toggles the visibility of tooltip + * @Default {true} + */ + visible?: boolean; +} +} +module BulletGraph +{ +enum FontStyle +{ +//string +Normal, +//string +Italic, +//string +Oblique, +} +} +module BulletGraph +{ +enum FontWeight +{ +//string +Normal, +//string +Bold, +//string +Bolder, +//string +Lighter, +} +} +module BulletGraph +{ +enum TextAlignment +{ +//string +Near, +//string +Far, +//string +Center, +} +} +module BulletGraph +{ +enum TextAnchor +{ +//string +Start, +//string +Middle, +//string +End, +} +} +module BulletGraph +{ +enum TextPosition +{ +//string +Top, +//string +Right, +//string +Left, +//string +Bottom, +//string +Float, +} +} +module BulletGraph +{ +enum FlowDirection +{ +//string +Forward, +//string +Backward, +} +} +module BulletGraph +{ +enum Orientation +{ +//string +Horizontal, +//string +Vertical, +} +} +module BulletGraph +{ +enum LabelPlacement +{ +//string +Inside, +//string +Outside, +} +} +module BulletGraph +{ +enum LabelPosition +{ +//string +Above, +//string +Below, +} +} +module BulletGraph +{ +enum TickPlacement +{ +//string +Inside, +//string +Outside, +} +} +module BulletGraph +{ +enum TickPosition +{ +//string +Below, +//string +Above, +//string +Cross, +} +} + +class Barcode extends ej.Widget { + static fn: Barcode; + constructor(element: JQuery, options?: Barcode.Model); + constructor(element: Element, options?: Barcode.Model); + model:Barcode.Model; + defaults:Barcode.Model; + + /** To disable the barcode + * @returns {void} + */ + disable(): void; + + /** To enable the barcode + * @returns {void} + */ + enable(): void; +} +export module Barcode{ + +export interface Model { + + /**Specifies the distance between the barcode and text below it. + */ + barcodeToTextGapHeight?: number; + + /**Specifies the height of bars in the Barcode. By modifying the barHeight, the entire barcode height can be customized. Please refer to xDimension for two dimensional barcode height customization. + */ + barHeight?: number; + + /**Specifies the dark bar color of the Barcode. One dimensional barcode contains a series of dark and light bars which are usually colored as black and white respectively. + */ + darkBarColor?: any; + + /**Specifies whether the text below the barcode is visible or hidden. + */ + displayText?: boolean; + + /**Specifies whether the control is enabled. + */ + enabled?: boolean; + + /**Specifies the start and stop encode symbol in the Barcode. In one dimensional barcodes, an additional character is added as start and stop delimiters. These symbols are optional and the unique of the symbol allows the reader to determine the direction of the barcode being scanned. + */ + encodeStartStopSymbol?: number; + + /**Specifies the light bar color of the Barcode. One dimensional barcode contains a series of dark and light bars which are usually colored as black and white respectively. + */ + lightBarColor?: any; + + /**Specifies the width of the narrow bars in the barcode. The dark bars in the one dimensional barcode contains random narrow and wide bars based on the provided input which can be specified during initialization. + */ + narrowBarWidth?: number; + + /**Specifies the width of the quiet zone. In barcode, a quiet zone is the blank margin on either side of a barcode which informs the reader where a barcode's symbology starts and stops. The purpose of a quiet zone is to prevent the reader from picking up unrelated information. + */ + quietZone?: QuietZone; + + /**Specifies the type of the Barcode. See SymbologyType + */ + symbologyType?: ej.datavisualization.Barcode.SymbologyType|string; + + /**Specifies the text to be encoded in the barcode. + */ + text?: string; + + /**Specifies the color of the text/data at the bottom of the barcode. + */ + textColor?: any; + + /**Specifies the width of the wide bars in the barcode. One dimensional barcode usually contains random narrow and wide bars based on the provided which can be customized during initialization. + */ + wideBarWidth?: number; + + /**Specifies the width of the narrowest element(bar or space) in a barcode. The greater the x dimension, the more easily a barcode reader will scan. + */ + xDimension?: number; + + /**Fires after Barcode control is loaded.*/ + load? (e: LoadEventArgs): void; +} + +export interface LoadEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the barcode model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; + + /**return the barcode state + */ + status?: boolean; +} + +export interface QuietZone { + + /**Specifies the quiet zone around the Barcode. + */ + all?: number; + + /**Specifies the bottom quiet zone of the Barcode. + */ + bottom?: number; + + /**Specifies the left quiet zone of the Barcode. + */ + left?: number; + + /**Specifies the right quiet zone of the Barcode. + */ + right?: number; + + /**Specifies the top quiet zone of the Barcode. + */ + top?: number; +} +} +module Barcode +{ +enum SymbologyType +{ +//Represents the QR code +QRBarcode, +//Represents the Data Matrix barcode +DataMatrix, +//Represents the Code 39 barcode +Code39, +//Represents the Code 39 Extended barcode +Code39Extended, +//Represents the Code 11 barcode +Code11, +//Represents the Codabar barcode +Codabar, +//Represents the Code 32 barcode +Code32, +//Represents the Code 93 barcode +Code93, +//Represents the Code 93 Extended barcode +Code93Extended, +//Represents the Code 128 A barcode +Code128A, +//Represents the Code 128 B barcode +Code128B, +//Represents the Code 128 C barcode +Code128C, +} +} + +class Map extends ej.Widget { + static fn: Map; + constructor(element: JQuery, options?: Map.Model); + constructor(element: Element, options?: Map.Model); + model:Map.Model; + defaults:Map.Model; + + /** Method for navigating to specific shape based on latitude, longitude and zoomlevel. + * @param {number} Pass the latitude value for map + * @param {number} Pass the longitude value for map + * @param {number} Pass the zoom level for map + * @returns {void} + */ + navigateTo(latitude: number, longitude: number, level: number): void; + + /** Method to perform map panning + * @param {string} Pass the direction in which map should be panned + * @returns {void} + */ + pan(direction: string): void; + + /** Method to reload the map. + * @returns {void} + */ + refresh(): void; + + /** Method to reload the shapeLayers with updated values + * @returns {void} + */ + refreshLayers(): void; + + /** Method to reload the navigation control with updated values. + * @param {any} Pass the navigation control instance + * @returns {void} + */ + refreshNavigationControl(navigation: any): void; + + /** Method to perform map zooming. + * @param {number} Pass the zoom level for map to be zoomed + * @param {boolean} Pass the boolean value to enable or disable animation while zooming + * @returns {void} + */ + zoom(level: number, isAnimate: boolean): void; +} +export module Map{ + +export interface Model { + + /**Specifies the background color for map + * @Default {white} + */ + background?: string; + + /**Specifies the base map-index of the map to determine the shapelayer to be displayed + * @Default {0} + */ + baseMapIndex?: number; + + /**Specify the center position where map should be displayed + * @Default {[0,0]} + */ + centerPosition?: any; + + /**Enables or Disables the map animation + * @Default {false} + */ + enableAnimation?: boolean; + + /**Enables or Disables the animation for layer change in map + * @Default {false} + */ + enableLayerChangeAnimation?: boolean; + + /**Enables or Disables the map panning + * @Default {true} + */ + enablePan?: boolean; + + /**Determines whether map need to resize when container is resized + * @Default {true} + */ + enableResize?: boolean; + + /**Enables or Disables the zooming of map + * @Default {true} + */ + enableZoom?: boolean; + + /**Enables or Disables the zoom on selecting the map shape + * @Default {false} + */ + enableZoomOnSelection?: boolean; + + /**Specifies the zoom factor for map zoom value. + * @Default {1} + */ + factor?: number; + + /**Hold the shapelayers to be displayed in map + * @Default {[]} + */ + layers?: Array; + + /**Specifies the zoom level value for which map to be zoomed + * @Default {1} + */ + level?: number; + + /**Specifies the maximum zoom level of the map + * @Default {100} + */ + maxValue?: number; + + /**Specifies the minimum zoomSettings level of the map + * @Default {1} + */ + minValue?: number; + + /**Enables or Disables the navigation control for map to perform zooming and panning on map shapes. + */ + navigationControl?: any; + + /**Layer for holding the map shapes + */ + shapeLayer?: ShapeLayer; + + /**Enables or Disables the Zooming for map. + */ + zoomSettings?: any; + + /**Triggered on selecting the map markers.*/ + markerSelected? (e: MarkerSelectedEventArgs): void; + + /**Triggers while leaving the hovered map shape*/ + mouseleave? (e: MouseleaveEventArgs): void; + + /**Triggers while hovering the map shape.*/ + mouseover? (e: MouseoverEventArgs): void; + + /**Triggers once map render completed.*/ + onRenderComplete? (e: OnRenderCompleteEventArgs): void; + + /**Triggers when map panning ends.*/ + panned? (e: PannedEventArgs): void; + + /**Triggered on selecting the map shapes.*/ + shapeSelected? (e: ShapeSelectedEventArgs): void; + + /**Triggered when map is zoomed-in.*/ + zoomedIn? (e: ZoomedInEventArgs): void; + + /**Triggers when map is zoomed out.*/ + zoomedOut? (e: ZoomedOutEventArgs): void; +} + +export interface MarkerSelectedEventArgs { + + /**Returns marker object. + */ + originalEvent?: any; +} + +export interface MouseleaveEventArgs { + + /**Returns hovered map shape object. + */ + originalEvent?: any; +} + +export interface MouseoverEventArgs { + + /**Returns hovered map shape object. + */ + originalEvent?: any; +} + +export interface OnRenderCompleteEventArgs { + + /**Event parameters from map + */ + originalEvent?: any; +} + +export interface PannedEventArgs { + + /**Event parameters from map + */ + originalEvent?: any; +} + +export interface ShapeSelectedEventArgs { + + /**Returns selected shape object. + */ + originalEvent?: any; +} + +export interface ZoomedInEventArgs { + + /**Event parameters from map + */ + originalEvent?: any; + + /**Returns zoom level value for which the map is zoomed. + */ + zoomLevel?: any; +} + +export interface ZoomedOutEventArgs { + + /**Event parameters from map + */ + originalEvent?: any; + + /**Returns zoom level value for which the map is zoomed. + */ + zoomLevel?: any; +} + +export interface ShapeLayerBubbleSettings { + + /**Specifies the bubble Opacity value of bubbles for shape layer in map + * @Default {0.9} + */ + bubbleOpacity?: number; + + /**Specifies the mouse hover color of the shape layer in map + * @Default {gray} + */ + color?: string; + + /**Specifies the colorMappings of the shape layer in map + * @Default {null} + */ + colorMappings?: any; + + /**Specifies the bubble color valuePath of the shape layer in map + * @Default {null} + */ + colorValuePath?: string; + + /**Specifies the maximum size value of bubbles for shape layer in map + * @Default {20} + */ + maxValue?: number; + + /**Specifies the minimum size value of bubbles for shape layer in map + * @Default {10} + */ + minValue?: number; + + /**Specifies the showBubble visibility status map + * @Default {true} + */ + showBubble?: boolean; + + /**Specifies the tooltip visibility status of the shape layer in map + * @Default {false} + */ + showTooltip?: boolean; + + /**Specifies the bubble tooltip template of the shape layer in map + * @Default {null} + */ + tooltipTemplate?: string; + + /**Specifies the bubble valuePath of the shape layer in map + * @Default {null} + */ + valuePath?: string; +} + +export interface ShapeLayerLabelSettings { + + /**enable or disable the enableSmartLabel property + * @Default {false} + */ + enableSmartLabel?: boolean; + + /**set the labelLength property + * @Default {'2'} + */ + labelLength?: number; + + /**set the labelPath property + * @Default {null} + */ + labelPath?: string; + + /**enable or disable the showlabel property + * @Default {false} + */ + showLabels?: boolean; + + /**set the smartLabelSize property + * @Default {fixed} + */ + smartLabelSize?: ej.datavisualization.Map.LabelSize|string; +} + +export interface ShapeLayerLegendSettings { + + /**Determines whether the legend should be placed outside or inside the map bounds + * @Default {false} + */ + dockOnMap?: boolean; + + /**Determines the legend placement and it is valid only when dockOnMap is true + * @Default {top} + */ + dockPosition?: ej.datavisualization.Map.DockPosition|string; + + /**height value for legend setting + * @Default {0} + */ + height?: number; + + /**to get icon value for legend setting + * @Default {rectangle} + */ + icon?: ej.datavisualization.Map.LegendIcons|string; + + /**icon height value for legend setting + * @Default {20} + */ + iconHeight?: number; + + /**icon Width value for legend setting + * @Default {20} + */ + iconWidth?: number; + + /**set the orientation of legend labels + * @Default {vertical} + */ + labelOrientation?: ej.datavisualization.Map.LabelOrientation|string; + + /**to get leftLabel value for legend setting + * @Default {null} + */ + leftLabel?: string; + + /**to get mode of legend setting + * @Default {default} + */ + mode?: ej.datavisualization.Map.LegendMode|string; + + /**set the position of legend settings + * @Default {topleft} + */ + position?: ej.datavisualization.Map.Position|string; + + /**x position value for legend setting + * @Default {0} + */ + positionX?: number; + + /**y position value for legend setting + * @Default {0} + */ + positionY?: number; + + /**to get rightLabel value for legend setting + * @Default {null} + */ + rightLabel?: string; + + /**Enables or Disables the showLabels + * @Default {false} + */ + showLabels?: boolean; + + /**Enables or Disables the showLegend + * @Default {false} + */ + showLegend?: boolean; + + /**to get title of legend setting + * @Default {null} + */ + title?: string; + + /**to get type of legend setting + * @Default {layers} + */ + type?: ej.datavisualization.Map.LegendType|string; + + /**width value for legend setting + * @Default {0} + */ + width?: number; +} + +export interface ShapeLayerShapeSettings { + + /**Enables or Disables the auto fill colors for shape layer in map. When this property value set to true, shapes will be filled with palette colors. + * @Default {false} + */ + autoFill?: boolean; + + /**Specifies the colorMappings of the shape layer in map + * @Default {null} + */ + colorMappings?: any; + + /**Specifies the shape color palette value of the shape layer in map. Accepted colorPalette values are palette1, palette2, palette3 and custompalette. + * @Default {palette1} + */ + colorPalette?: string; + + /**Specifies the shape color valuePath of the shape layer in map + * @Default {null} + */ + colorValuePath?: string; + + /**Enables or Disables the gradient colors for map shapes. + * @Default {false} + */ + enableGradient?: boolean; + + /**Specifies the shape fill color of the shape layer in map + * @Default {#E5E5E5} + */ + fill?: string; + + /**Specifies the mouse over width of the shape layer in map + * @Default {1} + */ + highlightBorderWidth?: number; + + /**Specifies the mouse hover color of the shape layer in map + * @Default {gray} + */ + highlightColor?: string; + + /**Specifies the mouse over stroke color of the shape layer in map + * @Default {#C1C1C1} + */ + highlightStroke?: string; + + /**Specifies the shape selection color of the shape layer in map + * @Default {gray} + */ + selectionColor?: string; + + /**Specifies the shape selection stroke color of the shape layer in map + * @Default {#C1C1C1} + */ + selectionStroke?: string; + + /**Specifies the shape selection stroke width of the shape layer in map + * @Default {1} + */ + selectionStrokeWidth?: number; + + /**Specifies the shape stroke color of the shape layer in map + * @Default {#C1C1C1} + */ + stroke?: string; + + /**Specifies the shape stroke thickness value of the shape layer in map + * @Default {0.2} + */ + strokeThickness?: number; + + /**Specifies the shape valuePath of the shape layer in map + * @Default {null} + */ + valuePath?: string; +} + +export interface ShapeLayer { + + /**to get the type of bing map. + * @Default {aerial} + */ + bingMapType?: ej.datavisualization.Map.BingMapType|string; + + /**Specifies the bubble settings for map + */ + bubbleSettings?: ShapeLayerBubbleSettings; + + /**Specifies the datasource for the shape layer + */ + dataSource?: any; + + /**Enables or disables the animation + * @Default {false} + */ + enableAnimation?: boolean; + + /**Enables or disables the shape mouse hover + * @Default {false} + */ + enableMouseHover?: boolean; + + /**Enables or disables the shape selection + * @Default {true} + */ + enableSelection?: boolean; + + /**to get the key of bing map + * @Default {null} + */ + key?: string; + + /**Options for enabling and configuring labelSettings labelPath, smartLabelSize, labelLength etc., + */ + labelSettings?: ShapeLayerLabelSettings; + + /**Specifies the map type. + * @Default {'geometry'} + */ + layerType?: ej.datavisualization.Map.LayerType|string; + + /**Options for enabling and configuring legendSettings position, height, width, mode, type etc., + */ + legendSettings?: ShapeLayerLegendSettings; + + /**Specifies the map items template for shapes. + */ + mapItemsTemplate?: string; + + /**Specify markers for shape layer. + * @Default {[]} + */ + markers?: Array; + + /**Specifies the map marker template for map layer. + * @Default {null} + */ + markerTemplate?: string; + + /**Specify selectedMapShapes for shape layer + * @Default {[]} + */ + selectedMapShapes?: Array; + + /**Specifies the selection mode of the map. Accepted selection mode values are Default and Multiple. + * @Default {default} + */ + selectionMode?: ej.datavisualization.Map.SelectionMode|string; + + /**Specifies the shape data for the shape layer + */ + shapeDataobject?: any; + + /**Specifies the shape settings of map layer + */ + shapeSettings?: ShapeLayerShapeSettings; + + /**Shows or hides the map items. + * @Default {false} + */ + showMapItems?: boolean; + + /**Shows or hides the tooltip for shapes + * @Default {false} + */ + showTooltip?: boolean; + + /**Specifies the sub shape layers + * @Default {[]} + */ + subLayers?: Array; + + /**Specifies the tooltip template for shapes. + */ + tooltipTemplate?: string; + + /**Specifies the url template for the OSM type map. + * @Default {'http://a.tile.openstreetmap.org/level/tileX/tileY.png'} + */ + urlTemplate?: string; +} +} +module Map +{ +enum Position +{ +//specifies the none position +None, +//specifies the topleft position +Topleft, +//specifies the topcenter position +Topcenter, +//specifies the topright position +Topright, +//specifies the centerleft position +Centerleft, +//specifies the center position +Center, +//specifies the centerright position +Centerright, +//specifies the bottomleft position +Bottomleft, +//specifies the bottomcenter position +Bottomcenter, +//specifies the bottomright position +Bottomright, +} +} +module Map +{ +enum Orientation +{ +//specifies the horizontal position +Horizontal, +//specifies the vertical position +Vertical, +} +} +module Map +{ +enum BingMapType +{ +//specifies the aerial type +Aerial, +//specifies the aerialwithlabel type +Aerialwithlabel, +//specifies the road type +Road, +} +} +module Map +{ +enum LabelSize +{ +//specifies the fixed size +Fixed, +//specifies the default size +Default, +} +} +module Map +{ +enum LayerType +{ +//specifies the geometry type +Geometry, +//specifies the osm type +Osm, +//specifies the bing type +Bing, +} +} +module Map +{ +enum DockPosition +{ +//specifies the top position +Top, +//specifies the bottom position +Bottom, +//specifies the bottom position +Right, +//specifies the left position +Left, +} +} +module Map +{ +enum LegendIcons +{ +//specifies the rectangle position +Rectangle, +//specifies the circle position +Circle, +} +} +module Map +{ +enum LabelOrientation +{ +//specifies the horizontal position +Horizontal, +//specifies the vertical position +Vertical, +} +} +module Map +{ +enum LegendMode +{ +//specifies the default mode +Default, +//specifies the interactive mode +Interactive, +} +} +module Map +{ +enum LegendType +{ +//specifies the layers type +Layers, +//specifies the bubbles type +Bubbles, +} +} +module Map +{ +enum SelectionMode +{ +//specifies the default position +Default, +//specifies the multiple position +Multiple, +} +} + +class TreeMap extends ej.Widget { + static fn: TreeMap; + constructor(element: JQuery, options?: TreeMap.Model); + constructor(element: Element, options?: TreeMap.Model); + model:TreeMap.Model; + defaults:TreeMap.Model; + + /** Method to reload treemap with updated values. + * @returns {void} + */ + refresh(): void; +} +export module TreeMap{ + +export interface Model { + + /**Specifies the border brush color of the treemap + * @Default {white} + */ + borderBrush?: string; + + /**Specifies the border thickness of the treemap + * @Default {1} + */ + borderThickness?: number; + + /**Specifies the colors of the paletteColorMapping + * @Default {[]} + */ + colors?: Array; + + /**Specifies the color valuepath of the treemap + * @Default {null} + */ + colorValuePath?: string; + + /**Specifies the datasource of the treemap + * @Default {null} + */ + dataSource?: any; + + /**Specifies the desaturationColorMapping settings of the treemap + */ + desaturationColorMapping?: any; + + /**Specifies the dockPosition for legend + * @Default {top} + */ + dockPosition?: ej.datavisualization.TreeMap.DockPosition|string; + + /**specifies the drillDown header color + * @Default {'null'} + */ + drillDownHeaderColor?: string; + + /**specifies the drillDown selection color + * @Default {'#000000'} + */ + drillDownSelectionColor?: string; + + /**Enable/Disable the drillDown for treemap + * @Default {false} + */ + enableDrillDown?: boolean; + + /**Specifies whether treemap need to resize when container is resized + * @Default {true} + */ + enableResize?: boolean; + + /**Specifies the from value for desaturation color mapping + * @Default {0} + */ + from?: number; + + /**Specifies the group color mapping of the treemap + * @Default {[]} + */ + groupColorMapping?: Array; + + /**Specifies the height for legend + * @Default {30} + */ + height?: number; + + /**Specifies the highlight border brush of treemap + * @Default {gray} + */ + highlightBorderBrush?: string; + + /**Specifies the border thickness when treemap items is highlighted in the treemap + * @Default {5} + */ + highlightBorderThickness?: number; + + /**Specifies the highlight border brush of treemap + * @Default {gray} + */ + highlightGroupBorderBrush?: string; + + /**Specifies the border thickness when treemap items is highlighted in the treemap + * @Default {5} + */ + highlightGroupBorderThickness?: number; + + /**Specifies whether treemap item need to highlighted on selection + * @Default {false} + */ + highlightGroupOnSelection?: boolean; + + /**Specifies whether treemap item need to highlighted on selection + * @Default {false} + */ + highlightOnSelection?: boolean; + + /**Specifies the iconHeight for legend + * @Default {15} + */ + iconHeight?: number; + + /**Specifies the iconWidth for legend + * @Default {15} + */ + iconWidth?: number; + + /**Specifies the items layout mode of the treemap. Accepted itemsLayoutMode values are Squarified, SliceAndDiceHorizontal, SliceAndDiceVertical and SliceAndDiceAuto + * @Default {Squarified} + */ + itemsLayoutMode?: ej.datavisualization.TreeMap.ItemsLayoutMode|string; + + /**Specifies the leaf settings of the treemap + */ + leafItemSettings?: LeafItemSettings; + + /**Specifies the legend settings of the treemap + */ + legendSettings?: any; + + /**Specify levels of treemap for grouped visualization of datas + * @Default {[]} + */ + levels?: Array; + + /**Specifies the paletteColorMapping of the treemap + */ + paletteColorMapping?: any; + + /**Specifies the rangeColorMapping settings of the treemap + */ + rangeColorMapping?: Array; + + /**Specifies the rangeMaximum value for desaturation color mapping + * @Default {0} + */ + rangeMaximum?: number; + + /**Specifies the rangeMinimum value for desaturation color mapping + * @Default {0} + */ + rangeMinimum?: number; + + /**Specifies the legend visibility status of the treemap + * @Default {false} + */ + showLegend?: boolean; + + /**Specifies whether treemap tooltip need to be visible + * @Default {false} + */ + showTooltip?: boolean; + + /**Specifies the template for legendSettings + * @Default {null} + */ + template?: string; + + /**Specifies the to value for desaturation color mapping + * @Default {0} + */ + to?: number; + + /**Specifies the tooltip template of the treemap + * @Default {null} + */ + tooltipTemplate?: string; + + /**Hold the treeMapItems to be displayed in treemap + * @Default {[]} + */ + treeMapItems?: Array; + + /**Hold the Level settings of TreeMap + */ + treeMapLevel?: TreeMapLevel; + + /**Specifies the uniColorMapping settings of the treemap + */ + uniColorMapping?: any; + + /**Specifies the weight valuepath of the treemap + * @Default {null} + */ + weightValuePath?: string; + + /**Specifies the width for legend + * @Default {100} + */ + width?: number; + + /**Triggers on treemap item selected.*/ + treeMapItemSelected? (e: TreeMapItemSelectedEventArgs): void; +} + +export interface TreeMapItemSelectedEventArgs { + + /**Returns selected treeMapItem object. + */ + originalEvent?: any; +} + +export interface LeafItemSettings { + + /**Specifies the border bruch color of the leaf item. + * @Default {white} + */ + borderBrush?: string; + + /**Specifies the border thickness of the leaf item. + * @Default {1} + */ + borderThickness?: number; + + /**Specifies the label template of the leaf item. + * @Default {null} + */ + itemTemplate?: string; + + /**Specifies the label path of the leaf item. + * @Default {null} + */ + labelPath?: string; + + /**Specifies the position of the leaf labels. + * @Default {center} + */ + labelPosition?: ej.datavisualization.TreeMap.Position|string; + + /**Specifies the mode of label visibility + * @Default {visible} + */ + labelVisibilityMode?: ej.datavisualization.TreeMap.VisibilityMode|string; + + /**Shows or hides the label of the leaf item. + * @Default {false} + */ + showLabels?: boolean; +} + +export interface TreeMapLevel { + + /**specifies the group background + * @Default {null} + */ + groupBackground?: string; + + /**Specifies the group border color for tree map level. + * @Default {null} + */ + groupBorderColor?: string; + + /**Specifies the group border thickness for tree map level. + * @Default {1} + */ + groupBorderThickness?: number; + + /**Specifies the group gap for tree map level. + * @Default {1} + */ + groupGap?: number; + + /**Specifies the group padding for tree map level. + * @Default {4} + */ + groupPadding?: number; + + /**Specifies the group path for tree map level. + */ + groupPath?: string; + + /**Specifies the header height for tree map level. + * @Default {0} + */ + headerHeight?: number; + + /**Specifies the header template for tree map level. + * @Default {null} + */ + headerTemplate?: string; + + /**Specifies the mode of header visibility + * @Default {visible} + */ + headerVisibilityMode?: ej.datavisualization.TreeMap.VisibilityMode|string; + + /**Specifies the position of the labels. + * @Default {center} + */ + labelPosition?: ej.datavisualization.TreeMap.Position|string; + + /**Specifies the label template for tree map level. + * @Default {null} + */ + labelTemplate?: string; + + /**Specifies the mode of label visibility + * @Default {visible} + */ + labelVisibilityMode?: ej.datavisualization.TreeMap.VisibilityMode|string; + + /**Shows or hides the header for tree map level. + * @Default {false} + */ + showHeader?: boolean; + + /**Shows or hides the labels for tree map level. + * @Default {false} + */ + showLabels?: boolean; +} +} +module TreeMap +{ +enum DockPosition +{ +//specifies the top position +Top, +//specifies the bottom position +Bottom, +//specifies the bottom position +Right, +//specifies the left position +Left, +} +} +module TreeMap +{ +enum ItemsLayoutMode +{ +//specifies the squarified as layout type position +Squarified, +//specifies the sliceanddicehorizontal as layout type position +Sliceanddicehorizontal, +//specifies the sliceanddicevertical as layout type position +Sliceanddicevertical, +//specifies the sliceanddiceauto as layout type position +Sliceanddiceauto, +} +} +module TreeMap +{ +enum Position +{ +//specifies the none position +None, +//specifies the topleft position +Topleft, +//specifies the topcenter position +Topcenter, +//specifies the topright position +Topright, +//specifies the centerleft position +Centerleft, +//specifies the center position +Center, +//specifies the centerright position +Centerright, +//specifies the bottomleft position +Bottomleft, +//specifies the bottomcenter position +Bottomcenter, +//specifies the bottomright position +Bottomright, +} +} +module TreeMap +{ +enum VisibilityMode +{ +//specifies the visible mode +Top, +//specifies the hideonexceededlength mode +Hideonexceededlength, +} +} +module TreeMap +{ +enum groupSelectionMode +{ +//specifies the default mode +Default, +//specifies the multiple mode +Multiple, +} +} + +class Diagram extends ej.Widget { + static fn: Diagram; + constructor(element: JQuery, options?: Diagram.Model); + constructor(element: Element, options?: Diagram.Model); + model:Diagram.Model; + defaults:Diagram.Model; + + /** Add nodes and connectors to diagram at runtime + * @param {any} a JSON to define a node/connector or an array of nodes and connector + * @returns {void} + */ + add(node: any): void; + + /** Add a label to a node at runtime + * @param {string} name of the node to which label will be added + * @param {any} JSON for the new label to be added + * @returns {void} + */ + addLabel(nodeName: string, newLabel: any): void; + + /** Add a phase to a swimlane at runtime + * @param {string} name of the swimlane to which the phase will be added + * @param {any} JSON object to define the phase to be added + * @returns {void} + */ + addPhase(name: string, options: any): void; + + /** Add a collection of ports to the node specified by name + * @param {string} name of the node to which the ports have to be added + * @param {Array} a collection of ports to be added to the specified node + * @returns {void} + */ + addPorts(name: string, ports: Array): void; + + /** Add the specified node to selection list + * @param {any} the node to be selected + * @param {boolean} to define whether to clear the existing selection or not + * @returns {void} + */ + addSelection(node: any, clearSelection: boolean): void; + + /** Align the selected objects based on the reference object and direction + * @param {string} to specify the direction towards which the selected objects are to be aligned("left","right",top","bottom") + * @returns {void} + */ + align(direction: string): void; + + /** Bring the specified portion of the diagram content to the diagram viewport + * @param {any} the rectangular region that is to be brought into diagram viewport + * @returns {void} + */ + bringIntoView(rect: any): void; + + /** Bring the specified portion of the diagram content to the center of the diagram viewport + * @param {any} the rectangular region that is to be brought to the center of diagram viewport + * @returns {void} + */ + bringToCenter(rect: any): void; + + /** Visually move the selected object over all other intersected objects + * @returns {void} + */ + bringToFront(): void; + + /** Remove all the elements from diagram + * @returns {void} + */ + clear(): void; + + /** Remove the current selection in diagram + * @returns {void} + */ + clearSelection(): void; + + /** Copy the selected object to internal clipboard and get the copied object + * @returns {any} + */ + copy(): any; + + /** Cut the selected object from diagram to diagram internal clipboard + * @returns {void} + */ + cut(): void; + + /** Export the diagram as downloadable files or as data + * @param {Diagram.Options} options to export the desired region of diagram to the desired formats.NameTypeDescriptionfileNamestringname of the file to be downloaded.formatstringformat of the exported file/data. See [File Formats](/js/api/global#fileformats).modestringto set whether to export diagram as a file or as raw data. See [Export Modes](/js/api/global#exportmodes).regionstringto set the region of the diagram to be exported. See [Region](/js/api/global#region).boundsobjectto export any custom region of diagram.marginobjectto set margin to the exported data. + * @returns {string} + */ + exportDiagram(options: Diagram.Options): string; + + /** Read a node/connector object by its name + * @param {string} name of the node/connector that is to be identified + * @returns {any} + */ + findNode(name: string): any; + + /** Fit the diagram content into diagram viewport + * @param {string} to set the mode of fit to command. See [Fit Mode](/js/api/global#fitmode) + * @param {string} to set whether the region to be fit will be based on diagram elements or page settings [Region](/js/api/global#region) + * @param {any} to set the required margin + * @returns {void} + */ + fitToPage(mode: string, region: string, margin: any): void; + + /** Group the selected nodes and connectors + * @returns {void} + */ + group(): void; + + /** Insert a label into a node's label collection at runtime + * @param {string} name of the node to which the label has to be inserted + * @param {any} JSON to define the new label + * @param {number} index to insert the label into the node + * @returns {void} + */ + insertLabel(name: string, label: any, index: number): void; + + /** Refresh the diagram with the specified layout + * @returns {void} + */ + layout(): void; + + /** Load the diagram + * @param {any} JSON data to load the diagram + * @returns {void} + */ + load(data: any): void; + + /** Visually move the selected object over its closest intersected object + * @returns {void} + */ + moveForward(): void; + + /** Move the selected objects by either one pixel or by the pixels specified through argument + * @param {string} specifies the direction to move the selected objects ("left","right",top","bottom") + * @param {number} specifies the number of pixels by which the selected objects have to be moved + * @returns {void} + */ + nudge(direction: string, delta: number): void; + + /** Paste the selected object from internal clipboard to diagram + * @param {any} object to be added to diagram + * @param {boolean} to define whether the specified object is to be renamed or not + * @returns {void} + */ + paste(object: any, rename: boolean): void; + + /** Print the diagram as image + * @returns {void} + */ + print(): void; + + /** Restore the last action that was reverted + * @returns {void} + */ + redo(): void; + + /** Refresh the diagram at runtime + * @returns {void} + */ + refresh(): void; + + /** Remove either the given node/connector or the selected element from diagram + * @param {any} the node/connector to be removed from diagram + * @returns {void} + */ + remove(node: any): void; + + /** Remove a particular object from selection list + * @param {any} the node/connector to be removed from selection list + * @returns {void} + */ + removeSelection(node: any): void; + + /** Scale the selected objects to the height of the first selected object + * @returns {void} + */ + sameHeight(): void; + + /** Scale the selected objects to the size of the first selected object + * @returns {void} + */ + sameSize(): void; + + /** Scale the selected objects to the width of the first selected object + * @returns {void} + */ + sameWidth(): void; + + /** Returns the diagram as serialized JSON + * @returns {any} + */ + save(): any; + + /** Bring the node into view + * @param {any} the node/connector to be brought into view + * @returns {void} + */ + scrollToNode(node: any): void; + + /** Select all nodes and connector in diagram + * @returns {void} + */ + selectAll(): void; + + /** Visually move the selected object behind its closest intersected object + * @returns {void} + */ + sendBackward(): void; + + /** Visually move the selected object behind all other intersected objects + * @returns {void} + */ + sendToBack(): void; + + /** Update the horizontal space between the selected objects as equal and within the selection boundary + * @returns {void} + */ + spaceAcross(): void; + + /** Update the vertical space between the selected objects as equal and within the selection boundary + * @returns {void} + */ + spaceDown(): void; + + /** Move the specified label to edit mode + * @param {any} node/connector that contains the label to be edited + * @param {any} to be edited + * @returns {void} + */ + startLabelEdit(node: any, label: any): void; + + /** Reverse the last action that was performed + * @returns {void} + */ + undo(): void; + + /** Ungroup the selected group + * @returns {void} + */ + ungroup(): void; + + /** Update diagram at runtime + * @param {any} JSON to specify the diagram properties that have to be modified + * @returns {void} + */ + update(options: any): void; + + /** Update Connectors at runtime + * @param {string} name of the connector to be updated + * @param {any} JSON to specify the connector properties that have to be updated + * @returns {void} + */ + updateConnector(name: string, options: any): void; + + /** Update the given label at runtime + * @param {string} the name of node/connector which contains the label to be updated + * @param {any} the label to be modified + * @param {any} JSON to specify the label properties that have to be updated + * @returns {any} + */ + updateLabel(nodeName: string, label: any, options: any): any; + + /** Update nodes at runtime + * @param {string} name of the node that is to be updated + * @param {any} JSON to specify the properties of node that have to be updated + * @returns {void} + */ + updateNode(name: string, options: any): void; + + /** Update a port with its modified properties at runtime + * @param {string} the name of node which contains the port to be updated + * @param {any} the port to be updated + * @param {any} JSON to specify the properties of the port that have to be updated + * @returns {void} + */ + updatePort(nodeName: string, port: any, options: any): void; + + /** Update the specified node as selected object + * @param {string} name of the node to be updated as selected object + * @returns {void} + */ + updateSelectedObject(name: string): void; + + /** Update the selection at runtime + * @param {boolean} to specify whether to show the user handles or not + * @returns {void} + */ + updateSelection(showUserHandles: boolean): void; + + /** Update userhandles with respect to the given node + * @param {any} node/connector with respect to which, the user handles have to be updated + * @returns {void} + */ + updateUserHandles(node: any): void; + + /** Update the diagram viewport at runtime + * @returns {void} + */ + updateViewPort(): void; + + /** Upgrade the diagram from old version + * @param {any} to be upgraded + * @returns {void} + */ + upgrade(data: any): void; + + /** Used to zoomIn/zoomOut diagram + * @param {any} options to zoom the diagram(zoom factor, zoomIn/zoomOut) + * @returns {void} + */ + zoomTo(zoom: any): void; +} +export module Diagram{ + +export interface Options { + + /**name of the file to be downloaded. + */ + fileName?: string; + + /**format of the exported file/data. See [File Formats](/js/api/global#fileformats). + */ + format?: string; + + /**to set whether to export diagram as a file or as raw data. See [Export Modes](/js/api/global#exportmodes). + */ + mode?: string; + + /**to set the region of the diagram to be exported. See [Region](/js/api/global#region). + */ + region?: string; + + /**to export any custom region of diagram. + */ + bounds?: any; + + /**to set margin to the exported data. + */ + margin?: any; +} + +export interface Model { + + /**Defines the background color of diagram elements + * @Default {transparent} + */ + backgroundColor?: string; + + /**Defines the path of the background image of diagram elements + * @Default {null} + */ + backgroundImage?: string; + + /**Sets the direction of line bridges. + * @Default {ej.datavisualization.Diagram.BridgeDirection.Top} + */ + bridgeDirection?: ej.datavisualization.Diagram.BridgeDirection|string; + + /**Defines a set of custom commands and binds them with a set of desired key gestures. + */ + commandManager?: CommandManager; + + /**A collection of JSON objects where each object represents a connector + * @Default {[]} + */ + connectors?: Array; + + /**Binds the custom JSON data with connector properties + * @Default {null} + */ + connectorTemplate?: any; + + /**Enables/Disables the default behaviors of the diagram. + * @Default {ej.datavisualization.Diagram.DiagramConstraints.All} + */ + constraints?: ej.datavisualization.Diagram.DiagramConstraints|string; + + /**An object to customize the context menu of diagram + */ + contextMenu?: ContextMenu; + + /**Configures the data source that is to be bound with diagram + */ + dataSourceSettings?: DataSourceSettings; + + /**Initializes the default values for nodes and connectors + * @Default {{}} + */ + defaultSettings?: DefaultSettings; + + /**Sets the type of Json object to be drawn through drawing tool + * @Default {{}} + */ + drawType?: any; + + /**Enables or disables auto scroll in diagram + * @Default {true} + */ + enableAutoScroll?: boolean; + + /**Enables or disables diagram context menu + * @Default {true} + */ + enableContextMenu?: boolean; + + /**Specifies the height of the diagram + * @Default {null} + */ + height?: string; + + /**Customizes the undo redo functionality + */ + historyManager?: HistoryManager; + + /**Automatically arranges the nodes and connectors in a predefined manner + */ + layout?: Layout; + + /**Defines the current culture of diagram + * @Default {en-US} + */ + locale?: string; + + /**Array of JSON objects where each object represents a node + * @Default {[]} + */ + nodes?: Array; + + /**Binds the custom JSON data with node properties + * @Default {null} + */ + nodeTemplate?: any; + + /**Defines the size and appearance of diagram page + */ + pageSettings?: PageSettings; + + /**Defines the zoom value, zoom factor, scroll status and view port size of the diagram + */ + scrollSettings?: ScrollSettings; + + /**Defines the size and position of selected items and defines the appearance of selector + */ + selectedItems?: SelectedItems; + + /**Enables or disables tooltip of diagram + * @Default {true} + */ + showTooltip?: boolean; + + /**Defines the gridlines and defines how and when the objects have to be snapped + */ + snapSettings?: SnapSettings; + + /**Enables/Disables the interactive behaviors of diagram. + * @Default {ej.datavisualization.Diagram.Tool.All} + */ + tool?: ej.datavisualization.Diagram.Tool|string; + + /**An object that defines the description, appearance and alignments of tooltips + * @Default {null} + */ + tooltip?: Tooltip; + + /**Specifies the width of the diagram + * @Default {null} + */ + width?: string; + + /**Sets the factor by which we can zoom in or zoom out + * @Default {0.2} + */ + zoomFactor?: number; + + /**Triggers When auto scroll is changed*/ + autoScrollChange? (e: AutoScrollChangeEventArgs): void; + + /**Triggers when a node, connector or diagram is clicked*/ + click? (e: ClickEventArgs): void; + + /**Triggers when the connection is changed*/ + connectionChange? (e: ConnectionChangeEventArgs): void; + + /**Triggers when the connector collection is changed*/ + connectorCollectionChange? (e: ConnectorCollectionChangeEventArgs): void; + + /**Triggers when the connectors' source point is changed*/ + connectorSourceChange? (e: ConnectorSourceChangeEventArgs): void; + + /**Triggers when the connectors' target point is changed*/ + connectorTargetChange? (e: ConnectorTargetChangeEventArgs): void; + + /**Triggers before opening the context menu*/ + contextMenuBeforeOpen? (e: ContextMenuBeforeOpenEventArgs): void; + + /**Triggers when a context menu item is clicked*/ + contextMenuClick? (e: ContextMenuClickEventArgs): void; + + /**Triggers when a node, connector or diagram model is clicked twice*/ + doubleClick? (e: DoubleClickEventArgs): void; + + /**Triggers while dragging the elements in diagram*/ + drag? (e: DragEventArgs): void; + + /**Triggers when a symbol is dragged into diagram from symbol palette*/ + dragEnter? (e: DragEnterEventArgs): void; + + /**Triggers when a symbol is dragged outside of the diagram.*/ + dragLeave? (e: DragLeaveEventArgs): void; + + /**Triggers when a symbol is dragged over diagram*/ + dragOver? (e: DragOverEventArgs): void; + + /**Triggers when a symbol is dragged and dropped from symbol palette to drawing area*/ + drop? (e: DropEventArgs): void; + + /**Triggers when a child is added to or removed from a group*/ + groupChange? (e: GroupChangeEventArgs): void; + + /**Triggers when a diagram element is clicked*/ + itemClick? (e: ItemClickEventArgs): void; + + /**Triggers when mouse enters a node/connector*/ + mouseEnter? (e: MouseEnterEventArgs): void; + + /**Triggers when mouse leaves node/connector*/ + mouseLeave? (e: MouseLeaveEventArgs): void; + + /**Triggers when mouse hovers over a node/connector*/ + mouseOver? (e: MouseOverEventArgs): void; + + /**Triggers when node collection is changed*/ + nodeCollectionChange? (e: NodeCollectionChangeEventArgs): void; + + /**Triggers when the node properties(x, y,width and height alone) are changed using nudge commands or updateNode API.*/ + propertyChange? (e: PropertyChangeEventArgs): void; + + /**Triggers when the diagram elements are rotated*/ + rotationChange? (e: RotationChangeEventArgs): void; + + /**Triggers when the diagram is zoomed or panned*/ + scrollChange? (e: ScrollChangeEventArgs): void; + + /**Triggers when a connector segment is edited*/ + segmentChange? (e: SegmentChangeEventArgs): void; + + /**Triggers when the selection is changed in diagram*/ + selectionChange? (e: SelectionChangeEventArgs): void; + + /**Triggers when a node is resized*/ + sizeChange? (e: SizeChangeEventArgs): void; + + /**Triggers when label editing is ended*/ + textChange? (e: TextChangeEventArgs): void; +} + +export interface AutoScrollChangeEventArgs { + + /**Returns the delay between subsequent auto scrolls + */ + delay?: string; +} + +export interface ClickEventArgs { + + /**parameter returns the clicked node, connector or diagram + */ + element?: any; + + /**parameter returns the object that is actually clicked + */ + actualObject?: number; + + /**parameter returns the horizontal coordinate of the mouse pointer, relative to the diagram + */ + offsetX?: number; + + /**parameter returns the vertical coordinate of the mouse pointer, relative to the diagram + */ + offsetY?: number; + + /**parameter returns the count of how many times the mouse button is pressed + */ + count?: number; + + /**parameter returns the actual click event arguments that explains which button is clicked + */ + event?: any; +} + +export interface ConnectionChangeEventArgs { + + /**parameter returns the connection that is changed between nodes, ports or points + */ + element?: any; + + /**parameter returns the new source node or target node of the connector + */ + connection?: string; + + /**parameter returns the new source port or target port of the connector + */ + port?: any; + + /**parameter defines whether to cancel the change or not + */ + cancel?: boolean; +} + +export interface ConnectorCollectionChangeEventArgs { + + /**parameter returns whether the connector is inserted or removed + */ + changeType?: string; + + /**parameter returns the connector that is to be added or deleted + */ + element?: any; + + /**parameter defines whether to cancel the collection change or not + */ + cancel?: boolean; +} + +export interface ConnectorSourceChangeEventArgs { + + /**returns the connector, the source point of which is being dragged + */ + element?: any; + + /**returns the source node of the element + */ + node?: any; + + /**returns the source point of the element + */ + point?: any; + + /**returns the source port of the element + */ + port?: any; + + /**returns the state of connection end point dragging(starting, dragging, completed) + */ + dragState?: string; + + /**parameter defines whether to cancel the change or not + */ + cancel?: boolean; +} + +export interface ConnectorTargetChangeEventArgs { + + /**parameter returns the connector, the target point of which is being dragged + */ + element?: any; + + /**returns the target node of the element + */ + node?: any; + + /**returns the target point of the element + */ + point?: any; + + /**returns the target port of the element + */ + port?: any; + + /**returns the state of connection end point dragging(starting, dragging, completed) + */ + dragState?: string; + + /**parameter defines whether to cancel the change or not + */ + cancel?: boolean; +} + +export interface ContextMenuBeforeOpenEventArgs { + + /**parameter returns the diagram object + */ + diagram?: any; + + /**parameter returns the actual arguments from context menu + */ + contextmenu?: any; + + /**parameter returns the object that was clicked + */ + target?: any; +} + +export interface ContextMenuClickEventArgs { + + /**parameter returns the id of the selected context menu item + */ + id?: string; + + /**parameter returns the text of the selected context menu item + */ + text?: string; + + /**parameter returns the parent id of the selected context menu item + */ + parentId?: string; + + /**parameter returns the parent text of the selected context menu item + */ + parentText?: string; + + /**parameter returns the object that was clicked + */ + target?: any; + + /**parameter defines whether to execute the click event or not + */ + canExecute?: boolean; +} + +export interface DoubleClickEventArgs { + + /**parameter returns the object that is actually clicked + */ + actualObject?: any; + + /**parameter returns the selected object + */ + element?: any; +} + +export interface DragEventArgs { + + /**parameter returns the node or connector that is being dragged + */ + element?: any; + + /**parameter returns the previous position of the node/connector + */ + oldValue?: any; + + /**parameter returns the new position of the node/connector + */ + newValue?: any; + + /**parameter returns the state of drag event (Starting, dragging, completed) + */ + dragState?: string; + + /**parameter returns whether or not to cancel the drag event + */ + cancel?: boolean; +} + +export interface DragEnterEventArgs { + + /**parameter returns the node or connector that is dragged into diagram + */ + element?: any; + + /**parameter returns whether to add or remove the symbol from diagram + */ + cancel?: boolean; +} + +export interface DragLeaveEventArgs { + + /**parameter returns the node or connector that is dragged outside of the diagram + */ + element?: any; +} + +export interface DragOverEventArgs { + + /**parameter returns the node or connector that is dragged over diagram + */ + element?: any; + + /**parameter defines whether the symbol can be dropped at the current mouse position + */ + allowDrop?: boolean; + + /**parameter returns the node/connector over which the symbol is dragged + */ + target?: any; + + /**parameter returns the previous position of the node/connector + */ + oldValue?: any; + + /**parameter returns the new position of the node/connector + */ + newValue?: any; + + /**parameter returns whether or not to cancel the dragOver event + */ + cancel?: boolean; +} + +export interface DropEventArgs { + + /**parameter returns node or connector that is being dropped + */ + element?: any; + + /**parameter returns whether or not to cancel the drop event + */ + cancel?: boolean; + + /**parameter returns the object from where the element is dragged + */ + source?: any; + + /**parameter returns the object over which the object will be dropped + */ + target?: any; + + /**parameter returns the enum which defines the type of the source + */ + sourceType?: string; +} + +export interface GroupChangeEventArgs { + + /**parameter returns the object that is added to/removed from a group + */ + element?: any; + + /**parameter returns the old parent group(if any) of the object + */ + oldParent?: any; + + /**parameter returns the new parent group(if any) of the object + */ + newParent?: any; + + /**parameter returns the cause of group change("group", unGroup") + */ + cause?: string; +} + +export interface ItemClickEventArgs { + + /**parameter returns the object that was actually clicked + */ + actualObject?: any; + + /**parameter returns the object that is selected + */ + selectedObject?: any; + + /**parameter returns whether or not to cancel the drop event + */ + cancel?: boolean; + + /**parameter returns the actual click event arguments that explains which button is clicked + */ + event?: any; +} + +export interface MouseEnterEventArgs { + + /**parameter returns the target node or connector + */ + element?: any; + + /**parameter returns the object from where the selected object is dragged + */ + source?: any; + + /**parameter returns the target object over which the selected object is dragged + */ + target?: any; +} + +export interface MouseLeaveEventArgs { + + /**parameter returns the target node or connector + */ + element?: any; + + /**parameter returns the object from where the selected object is dragged + */ + source?: any; + + /**parameter returns the target object over which the selected object is dragged + */ + target?: any; +} + +export interface MouseOverEventArgs { + + /**parameter returns the target node or connector + */ + element?: any; + + /**parameter returns the object from where the element is dragged + */ + source?: any; + + /**parameter returns the object over which the element is being dragged. + */ + target?: any; +} + +export interface NodeCollectionChangeEventArgs { + + /**parameter returns whether the node is to be added or removed + */ + changeType?: string; + + /**parameter returns the node which needs to be added or deleted + */ + element?: any; + + /**parameter defines whether to cancel the collection change or not + */ + cancel?: boolean; +} + +export interface PropertyChangeEventArgs { + + /**parameter returns the selected element + */ + element?: any; + + /**parameter returns the action is nudge or not + */ + cause?: string; + + /**parameter returns the new value of the node property that is being changed + */ + newValue?: any; + + /**parameter returns the old value of the property that is being changed + */ + oldValue?: any; + + /**parameter returns the name of the property that is changed + */ + propertyName?: string; +} + +export interface RotationChangeEventArgs { + + /**parameter returns the node that is rotated + */ + element?: any; + + /**parameter returns the previous rotation angle + */ + oldValue?: any; + + /**parameter returns the new rotation angle + */ + newValue?: any; + + /**parameter to specify whether or not to cancel the event + */ + cancel?: boolean; +} + +export interface ScrollChangeEventArgs { + + /**Parameter returns the new zoom value, horizontal and vertical scroll offsets. + */ + newValues?: any; + + /**parameter returns the previous zoom value, horizontal and vertical scroll offsets. + */ + oldValues?: any; +} + +export interface SegmentChangeEventArgs { + + /**Parameter returns the connector that is being edited + */ + element?: any; + + /**parameter returns the state of editing (starting, dragging, completed) + */ + dragState?: string; + + /**parameter returns the current mouse position + */ + point?: any; + + /**parameter to specify whether or not to cancel the event + */ + cancel?: boolean; +} + +export interface SelectionChangeEventArgs { + + /**parameter returns whether the item is selected or removed selection + */ + changeType?: string; + + /**parameter returns the item which is selected or to be selected + */ + element?: any; + + /**parameter returns the collection of nodes and connectors that have to be removed from selection list + */ + oldItems?: Array; + + /**parameter returns the collection of nodes and connectors that have to be added to selection list + */ + newItems?: Array; + + /**parameter returns the collection of nodes and connectors that will be selected after selection change + */ + selectedItems?: Array; + + /**parameter to specify whether or not to cancel the selection change event + */ + cancel?: boolean; +} + +export interface SizeChangeEventArgs { + + /**parameter returns node that was resized + */ + element?: any; + + /**parameter to cancel the size change + */ + cancel?: boolean; + + /**parameter returns the new width, height, offsetX and offsetY values of the element that is being resized + */ + newValue?: any; + + /**parameter returns the previous width,height,offsetX and offsetY values of the element that is being resized + */ + oldValue?: any; + + /**parameter returns the state of resizing(starting,resizing,completed) + */ + resizeState?: string; + + /**parameter returns the difference between new and old value + */ + offset?: any; +} + +export interface TextChangeEventArgs { + + /**parameter returns the node that contains the text being edited + */ + element?: any; + + /**parameter returns the new text + */ + value?: string; + + /**parameter returns the keyCode of the key entered + */ + keyCode?: string; +} + +export interface CommandManagerCommandsGesture { + + /**Sets the key value, on recognition of which the command will be executed. + * @Default {ej.datavisualization.Diagram.Keys.None} + */ + key?: ej.datavisualization.Diagram.Keys|string; + + /**Sets a combination of key modifiers, on recognition of which the command will be executed. + * @Default {ej.datavisualization.Diagram.KeyModifiers.None} + */ + keyModifiers?: ej.datavisualization.Diagram.KeyModifiers|string; +} + +export interface CommandManagerCommands { + + /**A method that defines whether the command is executable at the moment or not. + */ + canExecute?: Function; + + /**A method that defines what to be executed when the key combination is recognized. + */ + execute?: Function; + + /**Defines a combination of keys and key modifiers, on recognition of which the command will be executed + */ + gesture?: CommandManagerCommandsGesture; + + /**Defines any additional parameters that are required at runtime + * @Default {null} + */ + parameter?: any; +} + +export interface CommandManager { + + /**An object that maps a set of command names with the corresponding command objects + * @Default {{}} + */ + commands?: CommandManagerCommands; +} + +export interface ConnectorsSegments { + + /**Sets the direction of orthogonal segment + */ + direction?: string; + + /**Describes the length of orthogonal segment + * @Default {undefined} + */ + length?: number; + + /**Describes the end point of bezier/straight segment + * @Default {Diagram.Point()} + */ + point?: ej.datavisualization.Diagram.ConnectorsSourcePoint|string; + + /**Defines the first control point of the bezier segment + * @Default {null} + */ + point1?: ej.datavisualization.Diagram.ConnectorsSourcePoint|string; + + /**Defines the second control point of bezier segment + * @Default {null} + */ + point2?: ej.datavisualization.Diagram.ConnectorsSourcePoint|string; + + /**Sets the type of the segment. + * @Default {ej.datavisualization.Diagram.Segments.Straight} + */ + type?: ej.datavisualization.Diagram.Segments|string; + + /**Describes the length and angle between the first control point and the start point of bezier segment + * @Default {null} + */ + vector1?: any; + + /**Describes the length and angle between the second control point and end point of bezier segment + * @Default {null} + */ + vector2?: any; +} + +export interface ConnectorsSourceDecorator { + + /**Sets the border color of the source decorator + * @Default {black} + */ + borderColor?: string; + + /**Sets the border width of the decorator + * @Default {1} + */ + borderWidth?: number; + + /**Sets the fill color of the source decorator + * @Default {black} + */ + fillColor?: string; + + /**Sets the height of the source decorator + * @Default {8} + */ + height?: number; + + /**Defines the custom shape of the source decorator + */ + pathData?: string; + + /**Defines the shape of the source decorator. + * @Default {ej.datavisualization.Diagram.DecoratorShapes.Arrow} + */ + shape?: ej.datavisualization.Diagram.DecoratorShapes|string; + + /**Defines the width of the source decorator + * @Default {8} + */ + width?: number; +} + +export interface ConnectorsSourcePoint { + + /**Defines the x-coordinate of a position + * @Default {0} + */ + x?: number; + + /**Defines the y-coordinate of a position + * @Default {0} + */ + y?: number; +} + +export interface ConnectorsTargetDecorator { + + /**Sets the border color of the decorator + * @Default {black} + */ + borderColor?: string; + + /**Sets the color with which the decorator will be filled + * @Default {black} + */ + fillColor?: string; + + /**Defines the height of the target decorator + * @Default {8} + */ + height?: number; + + /**Defines the custom shape of the target decorator + */ + pathData?: string; + + /**Defines the shape of the target decorator. + * @Default {ej.datavisualization.Diagram.DecoratorShapes.Arrow} + */ + shape?: ej.datavisualization.Diagram.DecoratorShapes|string; + + /**Defines the width of the target decorator + * @Default {8} + */ + width?: number; +} + +export interface Connectors { + + /**To maintain additional information about connectors + * @Default {null} + */ + addInfo?: any; + + /**Defines the width of the line bridges + * @Default {10} + */ + bridgeSpace?: number; + + /**Enables or disables the behaviors of connectors. + * @Default {ej.datavisualization.Diagram.ConnectorConstraints.Default} + */ + constraints?: ej.datavisualization.Diagram.ConnectorConstraints|string; + + /**Defines the radius of the rounded corner + * @Default {0} + */ + cornerRadius?: number; + + /**Configures the styles of shapes + */ + cssClass?: string; + + /**Sets the horizontal alignment of the connector. Applicable, if the parent of the connector is a container. + * @Default {ej.datavisualization.Diagram.HorizontalAlignment.Left} + */ + horizontalAlign?: ej.datavisualization.Diagram.HorizontalAlignment|string; + + /**A collection of JSON objects where each object represents a label. For label properties, refer Labels + * @Default {[]} + */ + labels?: Array; + + /**Sets the stroke color of the connector + * @Default {black} + */ + lineColor?: string; + + /**Sets the pattern of dashes and gaps used to stroke the path of the connector + */ + lineDashArray?: string; + + /**Defines the padding value to ease the interaction with connectors + * @Default {10} + */ + lineHitPadding?: number; + + /**Sets the width of the line + * @Default {1} + */ + lineWidth?: number; + + /**Defines the minimum space to be left between the bottom of parent bounds and the connector. Applicable, if the parent is a container. + * @Default {0} + */ + marginBottom?: number; + + /**Defines the minimum space to be left between the left of parent bounds and the connector. Applicable, if the parent is a container. + * @Default {0} + */ + marginLeft?: number; + + /**Defines the minimum space to be left between the right of parent bounds and the connector. Applicable, if the parent is a container. + * @Default {0} + */ + marginRight?: number; + + /**Defines the minimum space to be left between the top of parent bounds and the connector. Applicable, if the parent is a container. + * @Default {0} + */ + marginTop?: number; + + /**Sets a unique name for the connector + */ + name?: string; + + /**Defines the transparency of the connector + * @Default {1} + */ + opacity?: number; + + /**Defines the size and preview size of the node to add that to symbol palette. To explore palette item, refer Palette Item + * @Default {null} + */ + paletteItem?: any; + + /**Sets the parent name of the connector. + */ + parent?: string; + + /**An array of JSON objects where each object represents a segment + * @Default {[ { type:straight } ]} + */ + segments?: Array; + + /**Defines the source decorator of the connector + * @Default {{ shape:arrow, width: 8, height:8, borderColor:black, fillColor:black }} + */ + sourceDecorator?: ConnectorsSourceDecorator; + + /**Sets the source node of the connector + */ + sourceNode?: string; + + /**Defines the space to be left between the source node and the source point of a connector + * @Default {0} + */ + sourcePadding?: number; + + /**Describes the start point of the connector + * @Default {ej.datavisualization.Diagram.Point()} + */ + sourcePoint?: ConnectorsSourcePoint; + + /**Sets the source port of the connector + */ + sourcePort?: string; + + /**Defines the target decorator of the connector + * @Default {{ shape:arrow, width: 8, height:8, borderColor:black, fillColor:black }} + */ + targetDecorator?: ConnectorsTargetDecorator; + + /**Sets the target node of the connector + */ + targetNode?: string; + + /**Defines the space to be left between the target node and the target point of the connector + * @Default {0} + */ + targetPadding?: number; + + /**Describes the end point of the connector + * @Default {ej.datavisualization.Diagram.Point()} + */ + targetPoint?: ej.datavisualization.Diagram.ConnectorsSourcePoint|string; + + /**Sets the targetPort of the connector + */ + targetPort?: string; + + /**Defines the tooltip that should be shown when the mouse hovers over connector. For tooltip properties, refer Tooltip + * @Default {null} + */ + tooltip?: any; + + /**To set the vertical alignment of connector (Applicable,if the parent is group). + * @Default {ej.datavisualization.Diagram.VerticalAlignment.Top} + */ + verticalAlign?: ej.datavisualization.Diagram.VerticalAlignment|string; + + /**Enables or disables the visibility of connector + * @Default {true} + */ + visible?: boolean; + + /**Sets the z-index of the connector + * @Default {0} + */ + zOrder?: number; +} + +export interface ContextMenu { + + /**Defines the collection of context menu items + * @Default {[]} + */ + items?: Array; + + /**To set whether to display the default context menu items or not + * @Default {false} + */ + showCustomMenuItemsOnly?: boolean; +} + +export interface DataSourceSettings { + + /**Defines the data source either as a collection of objects or as an instance of ej.DataManager + * @Default {null} + */ + dataSource?: any; + + /**Sets the unique id of the data source items + */ + id?: string; + + /**Defines the parent id of the data source item + * @Default {''} + */ + parent?: string; + + /**Describes query to retrieve a set of data from the specified datasource + * @Default {null} + */ + query?: string; + + /**Sets the unique id of the root data source item + */ + root?: string; + + /**Describes the name of the table on which the specified query has to be executed + * @Default {null} + */ + tableName?: string; +} + +export interface DefaultSettings { + + /**Initializes the default connector properties + * @Default {null} + */ + connector?: any; + + /**Initializes the default properties of groups + * @Default {null} + */ + group?: any; + + /**Initializes the default properties for nodes + * @Default {null} + */ + node?: any; +} + +export interface HistoryManager { + + /**A method that takes a history entry as argument and returns whether the specific entry can be popped or not + */ + canPop?: Function; + + /**A method that ends grouping the changes + */ + closeGroupAction?: Function; + + /**A method that removes the history of a recent change made in diagram + */ + pop?: Function; + + /**A method that allows to track the custom changes made in diagram + */ + push?: Function; + + /**Defines what should be happened while trying to restore a custom change + * @Default {null} + */ + redo?: Function; + + /**A method that starts to group the changes to revert/restore them in a single undo or redo + */ + startGroupAction?: Function; + + /**Defines what should be happened while trying to revert a custom change + */ + undo?: Function; +} + +export interface Layout { + + /**Defines the fixed node with reference to which, the layout will be arranged and fixed node will not be repositioned + */ + fixedNode?: string; + + /**Customizes the orientation of trees/sub trees. For orientations, see Chart Orientations. For chart types, see Chart Types + * @Default {null} + */ + getLayoutInfo?: any; + + /**Sets the space to be horizontally left between nodes + * @Default {30} + */ + horizontalSpacing?: number; + + /**Sets the margin value to be horizontally left between the layout and diagram + * @Default {0} + */ + marginX?: number; + + /**Sets the margin value to be vertically left between layout and diagram + * @Default {0} + */ + marginY?: number; + + /**Sets the orientation/direction to arrange the diagram elements. + * @Default {ej.datavisualization.Diagram.LayoutOrientations.TopToBottom} + */ + orientation?: ej.datavisualization.Diagram.LayoutOrientations|string; + + /**Sets the type of the layout based on which the elements will be arranged. + * @Default {ej.datavisualization.Diagram.LayoutTypes.None} + */ + type?: ej.datavisualization.Diagram.LayoutTypes|string; + + /**Sets the space to be vertically left between nodes + * @Default {30} + */ + verticalSpacing?: number; +} + +export interface NodesContainer { + + /**Defines the orientation of the container. Applicable, if the group is a container. + * @Default {vertical} + */ + orientation?: string; + + /**Sets the type of the container. Applicable if the group is a container. + * @Default {ej.datavisualization.Diagram.ContainerType.Canvas} + */ + type?: ej.datavisualization.Diagram.ContainerType|string; +} + +export interface NodesGradientLinearGradient { + + /**Defines the different colors and the region of color transitions + * @Default {[]} + */ + stops?: Array; + + /**Defines the left most position(relative to node) of the rectangular region that needs to be painted + * @Default {0} + */ + x1?: number; + + /**Defines the right most position(relative to node) of the rectangular region that needs to be painted + * @Default {0} + */ + x2?: number; + + /**Defines the top most position(relative to node) of the rectangular region that needs to be painted + * @Default {0} + */ + y1?: number; + + /**Defines the bottom most position(relative to node) of the rectangular region that needs to be painted + * @Default {0} + */ + y2?: number; +} + +export interface NodesGradientRadialGradient { + + /**Defines the position of the outermost circle + * @Default {0} + */ + cx?: number; + + /**Defines the outer most circle of the radial gradient + * @Default {0} + */ + cy?: number; + + /**Defines the innermost circle of the radial gradient + * @Default {0} + */ + fx?: number; + + /**Defines the innermost circle of the radial gradient + * @Default {0} + */ + fy?: number; + + /**Defines the different colors and the region of color transitions. + * @Default {[]} + */ + stops?: Array; +} + +export interface NodesGradientStop { + + /**Sets the color to be filled over the specified region + */ + color?: string; + + /**Sets the position where the previous color transition ends and a new color transition starts + * @Default {0} + */ + offset?: number; + + /**Describes the transparency level of the region + * @Default {1} + */ + opacity?: number; +} + +export interface NodesGradient { + + /**Paints the node with linear color transitions + */ + LinearGradient?: NodesGradientLinearGradient; + + /**Paints the node with radial color transitions. A focal point defines the beginning of the gradient, and a circle defines the end point of the gradient. + */ + RadialGradient?: NodesGradientRadialGradient; + + /**Defines the color and a position where the previous color transition ends and a new color transition starts + */ + Stop?: NodesGradientStop; +} + +export interface NodesLabels { + + /**Enables/disables the bold style + * @Default {false} + */ + bold?: boolean; + + /**Sets the border color of the label + * @Default {transparent} + */ + borderColor?: string; + + /**Sets the border width of the label + * @Default {0} + */ + borderWidth?: number; + + /**Sets the fill color of the text area + * @Default {transparent} + */ + fillColor?: string; + + /**Sets the font color of the text + * @Default {black} + */ + fontColor?: string; + + /**Sets the font family of the text + * @Default {Arial} + */ + fontFamily?: string; + + /**Defines the font size of the text + * @Default {12} + */ + fontSize?: number; + + /**Sets the horizontal alignment of the label. + * @Default {ej.datavisualization.Diagram.HorizontalAlignment.Center} + */ + horizontalAlignment?: ej.datavisualization.Diagram.HorizontalAlignment|string; + + /**Enables/disables the italic style + * @Default {false} + */ + italic?: boolean; + + /**To set the margin of the label + * @Default {ej.datavisualization.Diagram.Margin()} + */ + margin?: any; + + /**Gets whether the label is currently being edited or not. + * @Default {ej.datavisualization.Diagram.LabelEditMode.Edit} + */ + mode?: ej.datavisualization.Diagram.LabelEditMode|string; + + /**Sets the unique identifier of the label + */ + name?: string; + + /**Sets the fraction/ratio(relative to node) that defines the position of the label + * @Default {ej.datavisualization.Diagram.Point(0.5, 0.5)} + */ + offset?: any; + + /**Defines whether the label is editable or not + * @Default {false} + */ + readOnly?: boolean; + + /**Defines the angle to which the label needs to be rotated + * @Default {0} + */ + rotateAngle?: number; + + /**Defines the label text + */ + text?: string; + + /**Defines how to align the text inside the label. + * @Default {ej.datavisualization.Diagram.TextAlign.Center} + */ + textAlign?: ej.datavisualization.Diagram.TextAlign|string; + + /**Sets how to decorate the label text. + * @Default {ej.datavisualization.Diagram.TextDecorations.None} + */ + textDecoration?: ej.datavisualization.Diagram.TextDecorations|string; + + /**Sets the vertical alignment of the label. + * @Default {ej.datavisualization.Diagram.VerticalAlignment.Center} + */ + verticalAlignment?: ej.datavisualization.Diagram.VerticalAlignment|string; + + /**Enables or disables the visibility of the label + * @Default {true} + */ + visible?: boolean; + + /**Sets the width of the label(the maximum value of label width and the node width will be considered as label width) + * @Default {50} + */ + width?: number; + + /**Defines how the label text needs to be wrapped. + * @Default {ej.datavisualization.Diagram.TextWrapping.WrapWithOverflow} + */ + wrapping?: ej.datavisualization.Diagram.TextWrapping|string; +} + +export interface NodesLanes { + + /**Allows to maintain additional information about lane + * @Default {{}} + */ + addInfo?: any; + + /**An array of objects where each object represents a child node of the lane + * @Default {[]} + */ + children?: Array; + + /**Defines the fill color of the lane + * @Default {white} + */ + fillColor?: string; + + /**Defines the header of the lane + * @Default {{ text: Function, fontSize: 11 }} + */ + header?: any; + + /**Defines the object as a lane + * @Default {false} + */ + isLane?: boolean; + + /**Sets the unique identifier of the lane + */ + name?: string; + + /**Sets the orientation of the lane. + * @Default {vertical} + */ + orientation?: string; +} + +export interface NodesPaletteItem { + + /**Defines whether the symbol should be drawn at its actual size regardless of precedence factors or not + * @Default {true} + */ + enableScale?: boolean; + + /**Defines the height of the symbol + * @Default {0} + */ + height?: number; + + /**Defines the margin of the symbol item + * @Default {{ left: 4, right: 4, top: 4, bottom: 4 }} + */ + margin?: any; + + /**Defines the preview height of the symbol + * @Default {undefined} + */ + previewHeight?: number; + + /**Defines the preview width of the symbol + * @Default {undefined} + */ + previewWidth?: number; + + /**Defines the width of the symbol + * @Default {0} + */ + width?: number; +} + +export interface NodesPhases { + + /**Defines the header of the smaller regions + * @Default {null} + */ + label?: any; + + /**Defines the line color of the splitter that splits adjacent phases. + * @Default {#606060} + */ + lineColor?: string; + + /**Sets the dash array that used to stroke the phase splitter + * @Default {3,3} + */ + lineDashArray?: string; + + /**Sets the lineWidth of the phase + * @Default {1} + */ + lineWidth?: number; + + /**Sets the unique identifier of the phase + */ + name?: string; + + /**Sets the length of the smaller region(phase) of a swimlane + * @Default {100} + */ + offset?: number; + + /**Sets the orientation of the phase + * @Default {horizontal} + */ + orientation?: string; + + /**Sets the type of the object as phase + * @Default {phase} + */ + type?: string; +} + +export interface NodesPorts { + + /**Sets the border color of the port + * @Default {#1a1a1a} + */ + borderColor?: string; + + /**Sets the stroke width of the port + * @Default {1} + */ + borderWidth?: number; + + /**Defines the space to be left between the port bounds and its incoming and outgoing connections. + * @Default {0} + */ + connectorPadding?: number; + + /**Defines whether connections can be created with the port + * @Default {ej.datavisualization.Diagram.PortConstraints.Connect} + */ + constraints?: ej.datavisualization.Diagram.PortConstraints|string; + + /**Sets the fill color of the port + * @Default {white} + */ + fillColor?: string; + + /**Sets the unique identifier of the port + */ + name?: string; + + /**Defines the position of the port as fraction/ ratio relative to node + * @Default {ej.datavisualization.Diagram.Point(0, 0)} + */ + offset?: any; + + /**Defines the path data to draw the port. Applicable, if the port shape is path. + */ + pathData?: string; + + /**Defines the shape of the port. + * @Default {ej.datavisualization.Diagram.PortShapes.Square} + */ + shape?: ej.datavisualization.Diagram.PortShapes|string; + + /**Defines the size of the port + * @Default {8} + */ + size?: number; + + /**Defines when the port should be visible. + * @Default {ej.datavisualization.Diagram.PortVisibility.Default} + */ + visibility?: ej.datavisualization.Diagram.PortVisibility|string; +} + +export interface NodesShadow { + + /**Defines the angle of the shadow relative to node + * @Default {45} + */ + angle?: number; + + /**Sets the distance to move the shadow relative to node + * @Default {5} + */ + distance?: number; + + /**Defines the opaque of the shadow + * @Default {0.7} + */ + opacity?: number; +} + +export interface NodesSubProcess { + + /**Defines whether the bpmn sub process is without any prescribed order or not + * @Default {false} + */ + adhoc?: boolean; + + /**Sets the boundary of the BPMN process + * @Default {ej.datavisualization.Diagram.BPMNBoundary.Default} + */ + boundary?: ej.datavisualization.Diagram.BPMNBoundary|string; + + /**Sets whether the bpmn subprocess is triggered as a compensation of a specific activity + * @Default {false} + */ + compensation?: boolean; + + /**Defines the loop type of a sub process. + * @Default {ej.datavisualization.Diagram.BPMNLoops.None} + */ + loop?: ej.datavisualization.Diagram.BPMNLoops|string; +} + +export interface NodesTask { + + /**To set whether the task is a global task or not + * @Default {false} + */ + call?: boolean; + + /**Sets whether the task is triggered as a compensation of another specific activity + * @Default {false} + */ + compensation?: boolean; + + /**Sets the loop type of a bpmn task. + * @Default {ej.datavisualization.Diagram.BPMNLoops.None} + */ + loop?: ej.datavisualization.Diagram.BPMNLoops|string; + + /**Sets the type of the BPMN task. + * @Default {ej.datavisualization.Diagram.BPMNTasks.None} + */ + type?: ej.datavisualization.Diagram.BPMNTasks|string; +} + +export interface Nodes { + + /**Defines the type of BPMN Activity. Applicable, if the node is a bpmn activity. + * @Default {ej.datavisualization.Diagram.BPMNActivity.Task} + */ + activity?: ej.datavisualization.Diagram.BPMNActivity|string; + + /**To maintain additional information about nodes + * @Default {{}} + */ + addInfo?: any; + + /**Sets the border color of node + * @Default {black} + */ + borderColor?: string; + + /**Sets the pattern of dashes and gaps to stroke the border + */ + borderDashArray?: string; + + /**Sets the border width of the node + * @Default {1} + */ + borderWidth?: number; + + /**Defines whether the group can be ungrouped or not + * @Default {true} + */ + canUngroup?: boolean; + + /**Array of JSON objects where each object represents a child node/connector + * @Default {[]} + */ + children?: Array; + + /**Defines whether the BPMN data object is a collection or not + * @Default {false} + */ + collection?: boolean; + + /**Defines the distance to be left between a node and its connections(In coming and out going connections). + * @Default {0} + */ + connectorPadding?: number; + + /**Enables or disables the default behaviors of the node. + * @Default {ej.datavisualization.Diagram.NodeConstraints.Default} + */ + constraints?: ej.datavisualization.Diagram.NodeConstraints|string; + + /**Defines how the child objects need to be arranged(Either in any predefined manner or automatically). Applicable, if the node is a group. + * @Default {null} + */ + container?: NodesContainer; + + /**Defines the corner radius of rectangular shapes. + * @Default {0} + */ + cornerRadius?: number; + + /**Configures the styles of shapes + */ + cssClass?: string; + + /**Sets the type of the BPMN Events. Applicable, if the node is a bpmn event. + * @Default {ej.datavisualization.Diagram.BPMNEvents.Start} + */ + event?: ej.datavisualization.Diagram.BPMNEvents|string; + + /**Defines whether the node can be automatically arranged using layout or not + * @Default {false} + */ + excludeFromLayout?: boolean; + + /**Defines the fill color of the node + * @Default {white} + */ + fillColor?: string; + + /**Sets the type of the BPMN Gateway. Applicable, if the node is a bpmn gateway. + * @Default {ej.datavisualization.Diagram.BPMNGateways.None} + */ + gateway?: ej.datavisualization.Diagram.BPMNGateways|string; + + /**Paints the node with a smooth transition from one color to another color + */ + gradient?: NodesGradient; + + /**Defines the header of a swimlane/lane + * @Default {{ text: Title, fontSize: 11 }} + */ + header?: any; + + /**Defines the height of the node + * @Default {0} + */ + height?: number; + + /**Sets the horizontal alignment of the node. Applicable, if the parent of the node is a container. + * @Default {ej.datavisualization.Diagram.HorizontalAlignment.Left} + */ + horizontalAlign?: ej.datavisualization.Diagram.HorizontalAlignment|string; + + /**A read only collection of the incoming connectors/edges of the node + * @Default {[]} + */ + inEdges?: Array; + + /**Defines whether the sub tree of the node is expanded or collapsed + * @Default {true} + */ + isExpanded?: boolean; + + /**Sets the node as a swimlane + * @Default {false} + */ + isSwimlane?: boolean; + + /**A collection of objects where each object represents a label + * @Default {[]} + */ + labels?: Array; + + /**An array of objects where each object represents a lane. Applicable, if the node is a swimlane. + * @Default {[]} + */ + lanes?: Array; + + /**Defines the minimum space to be left between the bottom of parent bounds and the node. Applicable, if the parent is a container. + * @Default {0} + */ + marginBottom?: number; + + /**Defines the minimum space to be left between the left of parent bounds and the node. Applicable, if the parent is a container. + * @Default {0} + */ + marginLeft?: number; + + /**Defines the minimum space to be left between the right of the parent bounds and the node. Applicable, if the parent is a container. + * @Default {0} + */ + marginRight?: number; + + /**Defines the minimum space to be left between the top of parent bounds and the node. Applicable, if the parent is a container. + * @Default {0} + */ + marginTop?: number; + + /**Defines the maximum height limit of the node + * @Default {0} + */ + maxHeight?: number; + + /**Defines the maximum width limit of the node + * @Default {0} + */ + maxWidth?: number; + + /**Defines the minimum height limit of the node + * @Default {0} + */ + minHeight?: number; + + /**Defines the minimum width limit of the node + * @Default {0} + */ + minWidth?: number; + + /**Sets the unique identifier of the node + */ + name?: string; + + /**Defines the position of the node on X-Axis + * @Default {0} + */ + offsetX?: number; + + /**Defines the position of the node on Y-Axis + * @Default {0} + */ + offsetY?: number; + + /**Defines the opaque of the node + * @Default {1} + */ + opacity?: number; + + /**Defines the orientation of nodes. Applicable, if the node is a swimlane. + * @Default {vertical} + */ + orientation?: string; + + /**A read only collection of outgoing connectors/edges of the node + * @Default {[]} + */ + outEdges?: Array; + + /**Defines the minimum padding value to be left between the bottom most position of a group and its children. Applicable, if the group is a container. + * @Default {0} + */ + paddingBottom?: number; + + /**Defines the minimum padding value to be left between the left most position of a group and its children. Applicable, if the group is a container. + * @Default {0} + */ + paddingLeft?: number; + + /**Defines the minimum padding value to be left between the right most position of a group and its children. Applicable, if the group is a container. + * @Default {0} + */ + paddingRight?: number; + + /**Defines the minimum padding value to be left between the top most position of a group and its children. Applicable, if the group is a container. + * @Default {0} + */ + paddingTop?: number; + + /**Defines the size and preview size of the node to add that to symbol palette + * @Default {null} + */ + paletteItem?: NodesPaletteItem; + + /**Sets the name of the parent group + */ + parent?: string; + + /**Sets the path geometry that defines the shape of a path node + */ + pathData?: string; + + /**An array of objects, where each object represents a smaller region(phase) of a swimlane. + * @Default {[]} + */ + phases?: Array; + + /**Sets the height of the phase headers + * @Default {0} + */ + phaseSize?: number; + + /**Sets the ratio/ fractional value relative to node, based on which the node will be transformed(positioning, scaling and rotation) + * @Default {ej.datavisualization.Diagram.Points(0.5,0.5)} + */ + pivot?: any; + + /**Defines a collection of points to draw a polygon. Applicable, if the shape is a polygon. + * @Default {[]} + */ + points?: Array; + + /**An array of objects where each object represents a port + * @Default {[]} + */ + ports?: Array; + + /**Sets the angle to which the node should be rotated + * @Default {0} + */ + rotateAngle?: number; + + /**Defines the opacity and the position of shadow + * @Default {ej.datavisualization.Diagram.Shadow()} + */ + shadow?: NodesShadow; + + /**Sets the shape of the node. It depends upon the type of node. + * @Default {ej.datavisualization.Diagram.BasicShapes.Rectangle} + */ + shape?: ej.datavisualization.Diagram.BasicShapes|string; + + /**Sets the source path of the image. Applicable, if the type of the node is image. + */ + source?: string; + + /**Defines the sub process of a BPMN Activity. Applicable, if the type of the bpmn activity is sub process. + * @Default {ej.datavisualization.Diagram.BPMNSubProcess()} + */ + subProcess?: NodesSubProcess; + + /**Defines the task of the bpmn activity. Applicable, if the type of activity is set as task. + * @Default {ej.datavisualization.Diagram.BPMNTask()} + */ + task?: NodesTask; + + /**Sets the id of svg/html templates. Applicable, if the node is html or native. + */ + templateId?: string; + + /**Defines the textBlock of a text node + * @Default {null} + */ + textBlock?: any; + + /**Defines the tooltip that should be shown when the mouse hovers over node. For tooltip properties, refer Tooltip + * @Default {null} + */ + tooltip?: any; + + /**Sets the type of BPMN Event Triggers. + * @Default {ej.datavisualization.Diagram.BPMNTriggers.None} + */ + trigger?: ej.datavisualization.Diagram.BPMNTriggers|string; + + /**Defines the type of the node. + * @Default {ej.datavisualization.Diagram.Shapes.Basic} + */ + type?: ej.datavisualization.Diagram.Shapes|string; + + /**Sets the vertical alignment of a node. Applicable, if the parent of a node is a container. + * @Default {ej.datavisualization.Diagram.VerticalAlignment.Top} + */ + verticalAlign?: ej.datavisualization.Diagram.VerticalAlignment|string; + + /**Defines the visibility of the node + * @Default {true} + */ + visible?: boolean; + + /**Defines the width of the node + * @Default {0} + */ + width?: number; + + /**Defines the z-index of the node + * @Default {0} + */ + zOrder?: number; +} + +export interface PageSettings { + + /**Defines the maximum distance to be left between the object and the scroll bar to trigger auto scrolling + * @Default {{ left: 15, top: 15, right: 15, bottom: 15 }} + */ + autoScrollBorder?: any; + + /**Sets whether multiple pages can be created to fit all nodes and connectors + * @Default {false} + */ + multiplePage?: boolean; + + /**Defines the background color of diagram pages + * @Default {#ffffff} + */ + pageBackgroundColor?: string; + + /**Defines the page border color + * @Default {#565656} + */ + pageBorderColor?: string; + + /**Sets the border width of diagram pages + * @Default {0} + */ + pageBorderWidth?: number; + + /**Defines the height of a page + * @Default {null} + */ + pageHeight?: number; + + /**Defines the page margin + * @Default {24} + */ + pageMargin?: number; + + /**Sets the orientation of the page. + * @Default {ej.datavisualization.Diagram.PageOrientations.Portrait} + */ + pageOrientation?: ej.datavisualization.Diagram.PageOrientations|string; + + /**Defines the height of a diagram page + * @Default {null} + */ + pageWidth?: number; + + /**Defines the scrollable area of diagram. Applicable, if the scroll limit is "limited". + * @Default {null} + */ + scrollableArea?: any; + + /**Defines the scrollable region of diagram. + * @Default {ej.datavisualization.Diagram.ScrollLimit.Infinite} + */ + scrollLimit?: ej.datavisualization.Diagram.ScrollLimit|string; + + /**Enables or disables the page breaks + * @Default {false} + */ + showPageBreak?: boolean; +} + +export interface ScrollSettings { + + /**Allows to read the zoom value of diagram + * @Default {0} + */ + currentZoom?: number; + + /**Sets the horizontal scroll offset + * @Default {0} + */ + horizontalOffset?: number; + + /**Allows to extend the scrollable region that is based on the scroll limit + * @Default {{left: 0, right: 0, top:0, bottom: 0}} + */ + padding?: any; + + /**Sets the vertical scroll offset + * @Default {0} + */ + verticalOffset?: number; + + /**Allows to read the view port height of the diagram + * @Default {0} + */ + viewPortHeight?: number; + + /**Allows to read the view port width of the diagram + * @Default {0} + */ + viewPortWidth?: number; +} + +export interface SelectedItems { + + /**A read only collection of the selected items + * @Default {[]} + */ + children?: Array; + + /**Controls the visibility of selector. + * @Default {ej.datavisualization.Diagram.SelectorConstraints.All} + */ + constraints?: ej.datavisualization.Diagram.SelectorConstraints|string; + + /**Defines a method that dynamically enables/ disables the interaction with multiple selection. + * @Default {null} + */ + getConstraints?: any; + + /**Sets the height of the selected items + * @Default {0} + */ + height?: number; + + /**Sets the x position of the selector + * @Default {0} + */ + offsetX?: number; + + /**Sets the y position of the selector + * @Default {0} + */ + offsetY?: number; + + /**Sets the angle to rotate the selected items + * @Default {0} + */ + rotateAngle?: number; + + /**Sets the angle to rotate the selected items. For tooltip properties, refer Tooltip + * @Default {ej.datavisualization.Diagram.Tooltip()} + */ + tooltip?: any; + + /**A collection of frequently using commands that have to be added around the selector. + * @Default {[]} + */ + userHandles?: Array; + + /**Sets the width of the selected items + * @Default {0} + */ + width?: number; +} + +export interface SnapSettingsHorizontalGridLines { + + /**Defines the line color of horizontal grid lines + * @Default {lightgray} + */ + lineColor?: string; + + /**Specifies the pattern of dashes and gaps used to stroke horizontal grid lines + */ + lineDashArray?: string; + + /**A pattern of lines and gaps that defines a set of horizontal gridlines + * @Default {[1.25, 18.75, 0.25, 19.75, 0.25, 19.75, 0.25, 19.75, 0.25, 19.75]} + */ + linesInterval?: Array; + + /**Specifies a set of intervals to snap the objects + * @Default {[20]} + */ + snapInterval?: Array; +} + +export interface SnapSettingsVerticalGridLines { + + /**Defines the line color of horizontal grid lines + * @Default {lightgray} + */ + lineColor?: string; + + /**Specifies the pattern of dashes and gaps used to stroke horizontal grid lines + */ + lineDashArray?: string; + + /**A pattern of lines and gaps that defines a set of horizontal gridlines + * @Default {[1.25, 18.75, 0.25, 19.75, 0.25, 19.75, 0.25, 19.75, 0.25, 19.75]} + */ + linesInterval?: Array; + + /**Specifies a set of intervals to snap the objects + * @Default {[20]} + */ + snapInterval?: Array; +} + +export interface SnapSettings { + + /**Enables or disables snapping nodes/connectors to objects + * @Default {true} + */ + enableSnapToObject?: boolean; + + /**Defines the appearance of horizontal gridlines + */ + horizontalGridLines?: SnapSettingsHorizontalGridLines; + + /**Defines the angle by which the object needs to be snapped + * @Default {5} + */ + snapAngle?: number; + + /**Defines the minimum distance between the selected object and the nearest object + * @Default {5} + */ + snapObjectDistance?: number; + + /**Defines the appearance of horizontal gridlines + */ + verticalGridLines?: SnapSettingsVerticalGridLines; +} + +export interface TooltipAlignment { + + /**Defines the horizontal alignment of tooltip. + * @Default {ej.datavisualization.Diagram.HorizontalAlignment.Center} + */ + horizontal?: ej.datavisualization.Diagram.HorizontalAlignment|string; + + /**Defines the vertical alignment of tooltip. + * @Default {ej.datavisualization.Diagram.VerticalAlignment.Bottom} + */ + vertical?: ej.datavisualization.Diagram.VerticalAlignment|string; +} + +export interface Tooltip { + + /**Aligns the tooltip around nodes/connectors + */ + alignment?: TooltipAlignment; + + /**Sets the margin of the tooltip + * @Default {{ left: 5, right: 5, top: 5, bottom: 5 }} + */ + margin?: any; + + /**Defines whether the tooltip should be shown at the mouse position or around node. + * @Default {ej.datavisualization.Diagram.RelativeMode.Object} + */ + relativeMode?: ej.datavisualization.Diagram.RelativeMode|string; + + /**Sets the svg/html template to be bound with tooltip + */ + templateId?: string; +} +} +module Diagram +{ +enum BridgeDirection +{ +//Used to set the direction of line bridges as left +Left, +//Used to set the direction of line bridges as right +Right, +//Used to set the direction of line bridges as top +Top, +//Used to set the direction of line bridges as bottom +Bottom, +} +} +module Diagram +{ +enum Keys +{ +//No key pressed. +None, +//The A key. +A, +//The B key. +B, +//The C key. +C, +//The D Key. +D, +//The E key. +E, +//The F key. +F, +//The G key. +G, +//The H Key. +H, +//The I key. +I, +//The J key. +J, +//The K key. +K, +//The L Key. +L, +//The M key. +M, +//The N key. +N, +//The O key. +O, +//The P Key. +P, +//The Q key. +Q, +//The R key. +R, +//The S key. +S, +//The T Key. +T, +//The U key. +U, +//The V key. +V, +//The W key. +W, +//The X key. +X, +//The Y key. +Y, +//The Z key. +Z, +//The 0 key. +Number0, +//The 1 key. +Number1, +//The 2 key. +Number2, +//The 3 key. +Number3, +//The 4 key. +Number4, +//The 5 key. +Number5, +//The 6 key. +Number6, +//The 7 key. +Number7, +//The 8 key. +Number8, +//The 9 key. +Number9, +//The LEFT ARROW key. +Left, +//The UP ARROW key. +Up, +//The RIGHT ARROW key. +Right, +//The DOWN ARROW key. +Down, +//The ESC key. +Escape, +//The DEL key. +Delete, +//The TAB key. +Tab, +//The ENTER key. +Enter, +} +} +module Diagram +{ +enum KeyModifiers +{ +//No modifiers are pressed. +None, +//The ALT key. +Alt, +//The CTRL key. +Control, +//The SHIFT key. +Shift, +} +} +module Diagram +{ +enum ConnectorConstraints +{ +//Disable all connector Constraints +None, +//Enables connector to be selected +Select, +//Enables connector to be Deleted +Delete, +//Enables connector to be Dragged +Drag, +//Enables connectors source end to be selected +DragSourceEnd, +//Enables connectors target end to be selected +DragTargetEnd, +//Enables control point and end point of every segment in a connector for editing +DragSegmentThumb, +//Enables bridging to the connector +Bridging, +//Enables label of node to be Dragged +DragLabel, +//Enables bridging to the connector +InheritBridging, +//Enables all constraints +Default, +} +} +module Diagram +{ +enum HorizontalAlignment +{ +//Used to align text horizontally on left side of node/connector +Left, +//Used to align text horizontally on center of node/connector +Center, +//Used to align text horizontally on right side of node/connector +Right, +} +} +module Diagram +{ +enum Segments +{ +//Used to specify the lines as Straight +Straight, +//Used to specify the lines as Orthogonal +Orthogonal, +//Used to specify the lines as Bezier +Bezier, +} +} +module Diagram +{ +enum DecoratorShapes +{ +//Used to set decorator shape as none +None, +//Used to set decorator shape as Arrow +Arrow, +//Used to set decorator shape as Open Arrow +OpenArrow, +//Used to set decorator shape as Circle +Circle, +//Used to set decorator shape as Diamond +Diamond, +//Used to set decorator shape as path +Path, +} +} +module Diagram +{ +enum VerticalAlignment +{ +//Used to align text Vertically on left side of node/connector +Top, +//Used to align text Vertically on center of node/connector +Center, +//Used to align text Vertically on bottom of node/connector +Bottom, +} +} +module Diagram +{ +enum DiagramConstraints +{ +//Disables all DiagramConstraints +None, +//Enables/Disables PageEditing +PageEditable, +//Enables/Disables Bridging +Bridging, +//Enables/Disables Zooming +Zoomable, +//Enables/Disables panning on horizontal axis +PannableX, +//Enables/Disables panning on vertical axis +PannableY, +//Enables/Disables Panning +Pannable, +//Enables/Disables undo actions +Undoable, +//Enables all Constraints +Default, +} +} +module Diagram +{ +enum LayoutOrientations +{ +//Used to set LayoutOrientation from top to bottom +TopToBottom, +//Used to set LayoutOrientation from bottom to top +BottomToTop, +//Used to set LayoutOrientation from left to right +LeftToRight, +//Used to set LayoutOrientation from right to left +RightToLeft, +} +} +module Diagram +{ +enum LayoutTypes +{ +//Used not to set any specific layout +None, +//Used to set layout type as hierarchical layout +HierarchicalTree, +//Used to set layout type as organnizational chart +OrganizationalChart, +} +} +module Diagram +{ +enum BPMNActivity +{ +//Used to set BPMN Activity as None +None, +//Used to set BPMN Activity as Task +Task, +//Used to set BPMN Activity as SubProcess +SubProcess, +} +} +module Diagram +{ +enum NodeConstraints +{ +//Disable all node Constraints +None, +//Enables node to be selected +Select, +//Enables node to be Deleted +Delete, +//Enables node to be Dragged +Drag, +//Enables node to be Rotated +Rotate, +//Enables node to be connected +Connect, +//Enables node to be resize north east +ResizeNorthEast, +//Enables node to be resize east +ResizeEast, +//Enables node to be resize south east +ResizeSouthEast, +//Enables node to be resize south +ResizeSouth, +//Enables node to be resize south west +ResizeSouthWest, +//Enables node to be resize west +ResizeWest, +//Enables node to be resize north west +ResizeNorthWest, +//Enables node to be resize north +ResizeNorth, +//Enables node to be Resized +Resize, +//Enables shadow +Shadow, +//Enables label of node to be Dragged +DragLabel, +//Enables panning should be done while node dragging +AllowPan, +//Enables Proportional resize for node +AspectRatio, +//Enables all node constraints +Default, +} +} +module Diagram +{ +enum ContainerType +{ +//Sets the container type as Canvas +Canvas, +//Sets the container type as Stack +Stack, +} +} +module Diagram +{ +enum BPMNEvents +{ +//Used to set BPMN Event as Start +Start, +//Used to set BPMN Event as Intermediate +Intermediate, +//Used to set BPMN Event as End +End, +//Used to set BPMN Event as NonInterruptingStart +NonInterruptingStart, +//Used to set BPMN Event as NonInterruptingIntermediate +NonInterruptingIntermediate, +} +} +module Diagram +{ +enum BPMNGateways +{ +//Used to set BPMN Gateway as None +None, +//Used to set BPMN Gateway as Exclusive +Exclusive, +//Used to set BPMN Gateway as Inclusive +Inclusive, +//Used to set BPMN Gateway as Parallel +Parallel, +//Used to set BPMN Gateway as Complex +Complex, +//Used to set BPMN Gateway as EventBased +EventBased, +} +} +module Diagram +{ +enum LabelEditMode +{ +//Used to set label edit mode as edit +Edit, +//Used to set label edit mode as view +View, +} +} +module Diagram +{ +enum TextAlign +{ +//Used to align text on left side of node/connector +Left, +//Used to align text on center of node/connector +Center, +//Used to align text on Right side of node/connector +Right, +} +} +module Diagram +{ +enum TextDecorations +{ +//Used to set text decoration of the label as Underline +Underline, +//Used to set text decoration of the label as Overline +Overline, +//Used to set text decoration of the label as LineThrough +LineThrough, +//Used to set text decoration of the label as None +None, +} +} +module Diagram +{ +enum TextWrapping +{ +//Disables wrapping +NoWrap, +//Enables Line-break at normal word break points +Wrap, +//Enables Line-break at normal word break points with longer word overflows +WrapWithOverflow, +} +} +module Diagram +{ +enum PortConstraints +{ +//Disable all constraints +None, +//Enables connections with connector +Connect, +} +} +module Diagram +{ +enum PortShapes +{ +//Used to set port shape as X +X, +//Used to set port shape as Circle +Circle, +//Used to set port shape as Square +Square, +//Used to set port shape as Path +Path, +} +} +module Diagram +{ +enum PortVisibility +{ +//Set the port visibility as Visible +Visible, +//Set the port visibility as Hidden +Hidden, +//Port get visible when hover connector on node +Hover, +//Port gets visible when connect connector to node +Connect, +//Specifies the port visibility as default +Default, +} +} +module Diagram +{ +enum BasicShapes +{ +//Used to specify node Shape as Rectangle +Rectangle, +//Used to specify node Shape as Ellipse +Ellipse, +//Used to specify node Shape as Path +Path, +//Used to specify node Shape as Polygon +Polygon, +//Used to specify node Shape as Triangle +Triangle, +//Used to specify node Shape as Plus +Plus, +//Used to specify node Shape as Star +Star, +//Used to specify node Shape as Pentagon +Pentagon, +//Used to specify node Shape as Heptagon +Heptagon, +//Used to specify node Shape as Octagon +Octagon, +//Used to specify node Shape as Trapezoid +Trapezoid, +//Used to specify node Shape as Decagon +Decagon, +//Used to specify node Shape as RightTriangle +RightTriangle, +//Used to specify node Shape as Cylinder +Cylinder, +} +} +module Diagram +{ +enum BPMNBoundary +{ +//Used to set BPMN SubProcess's Boundary as Default +Default, +//Used to set BPMN SubProcess's Boundary as Call +Call, +//Used to set BPMN SubProcess's Boundary as Event +Event, +} +} +module Diagram +{ +enum BPMNLoops +{ +//Used to set BPMN Activity's Loop as None +None, +//Used to set BPMN Activity's Loop as Standard +Standard, +//Used to set BPMN Activity's Loop as ParallelMultiInstance +ParallelMultiInstance, +//Used to set BPMN Activity's Loop as SequenceMultiInstance +SequenceMultiInstance, +} +} +module Diagram +{ +enum BPMNTasks +{ +//Used to set BPMN Task Type as None +None, +//Used to set BPMN Task Type as Service +Service, +//Used to set BPMN Task Type as Receive +Receive, +//Used to set BPMN Task Type as Send +Send, +//Used to set BPMN Task Type as InstantiatingReceive +InstantiatingReceive, +//Used to set BPMN Task Type as Manual +Manual, +//Used to set BPMN Task Type as BusinessRule +BusinessRule, +//Used to set BPMN Task Type as User +User, +//Used to set BPMN Task Type as Script +Script, +//Used to set BPMN Task Type as Parallel +Parallel, +} +} +module Diagram +{ +enum BPMNTriggers +{ +//Used to set Event Trigger as None +None, +//Used to set Event Trigger as Message +Message, +//Used to set Event Trigger as Timer +Timer, +//Used to set Event Trigger as Escalation +Escalation, +//Used to set Event Trigger as Link +Link, +//Used to set Event Trigger as Error +Error, +//Used to set Event Trigger as Compensation +Compensation, +//Used to set Event Trigger as Signal +Signal, +//Used to set Event Trigger as Multiple +Multiple, +//Used to set Event Trigger as Parallel +Parallel, +} +} +module Diagram +{ +enum Shapes +{ +//Used to set decorator shape as none +None, +//Used to set decorator shape as Arrow +Arrow, +//Used to set decorator shape as Open Arrow +OpenArrow, +//Used to set decorator shape as Circle +Circle, +//Used to set decorator shape as Diamond +Diamond, +//Used to set decorator shape as path +Path, +} +} +module Diagram +{ +enum PageOrientations +{ +//Used to set orientation as Landscape +Landscape, +//Used to set orientation as portrait +Portrait, +} +} +module Diagram +{ +enum ScrollLimit +{ +//Used to set scrollLimit as Infinite +Infinite, +//Used to set scrollLimit as Diagram +Diagram, +//Used to set scrollLimit as Limited +Limited, +} +} +module Diagram +{ +enum SelectorConstraints +{ +//Hides the selector +None, +//Sets the visibility of rotation handle as visible +Rotator, +//Sets the visibility of resize handles as visible +Resizer, +//Sets the visibility of user handles as visible +UserHandles, +//Sets the visibility of all selection handles as visible +All, +} +} +module Diagram +{ +enum Tool +{ +//Disables all Tools +None, +//Enables/Disables SingleSelect tool +SingleSelect, +//Enables/Disables MultiSelect tool +MultipleSelect, +//Enables/Disables ZoomPan tool +ZoomPan, +//Enables/Disables DrawOnce tool +DrawOnce, +//Enables/Disables ContinuousDraw tool +ContinuesDraw, +} +} +module Diagram +{ +enum RelativeMode +{ +//Shows tooltip around the node +Object, +//Shows tooltip at the mouse position +Mouse, +} +} + +} + +interface JQueryXHR { +} +interface JQueryPromise { +} +interface JQueryDeferred extends JQueryPromise { +} +interface JQueryParam { +} +interface JQuery { + data(key: any): any; +} +interface JQuery { + + /*Accordion*/ + ejmAccordion(): JQuery; + ejmAccordion(options?: ej.mobile.AccordionOptions): JQuery; + data(key: "ejmAccordion"): ej.mobile.Accordion; + /*Accordion*/ + + /*AutoComplete*/ + ejmAutocomplete(): JQuery; + ejmAutocomplete(options?: ej.mobile.AutocompleteOptions): JQuery; + data(key: "ejmAutocomplete"): ej.mobile.Autocomplete; + /*AutoComplete*/ + + /*Button*/ + ejmButton(): JQuery; + ejmButton(options?: ej.mobile.ButtonOptions): JQuery; + data(key: "ejmButton"): ej.mobile.Button; + + ejmActionlink(): JQuery; + ejmActionlink(options?: ej.mobile.ButtonOptions): JQuery; + data(key: "ejmActionlink"): ej.mobile.Button; + /*Button*/ + + /* DatePicker */ + ejmDatePicker(): JQuery; + ejmDatePicker(options?: ej.mobile.DatePickerOptions): JQuery; + data(key: "ejmDatePicker"): ej.mobile.DatePicker; + /* DatePicker */ + + /*Editor*/ + ejmNumeric(): JQuery; + ejmNumeric(options?: ej.mobile.EditorOptions): JQuery; + data(key: "ejmNumeric"): ej.mobile.Numeric; + /*Editor*/ + + /* Grid Start */ + ejmGrid(): JQuery; + ejmGrid(options?: ej.mobile.GridOptions): JQuery; + data(key: "ejmGrid"): ej.mobile.Grid; + /* Grid End */ + + /*Header*/ + ejmHeader(): JQuery; + ejmHeader(options?: ej.mobile.HeaderOptions): JQuery; + data(key: "ejmHeader"): ej.mobile.Header; + /*Header*/ + + /*ListView*/ + ejmListView(): JQuery; + ejmListView(options?: ej.mobile.ListViewOptions): JQuery; + data(key: "ejmListView"): ej.mobile.ListView; + /*ListView*/ + + /*Menu*/ + ejmMenu(): JQuery; + ejmMenu(options?: ej.mobile.MenuOptions): JQuery; + data(key: "ejmMenu"): ej.mobile.Menu; + /*Menu*/ + + /* ProgressBar */ + ejmProgress(): JQuery; + ejmProgress(options?: ej.mobile.ProgressOptions): JQuery; + data(key: "ejmProgress"): ej.mobile.Progress; + /* ProgressBar */ + + /*Radio Button*/ + ejmRadioButton(): JQuery; + ejmRadioButton(options?: ej.mobile.RadioButtonOptions): JQuery; + data(key: "ejmRadioButton"): ej.mobile.RadioButton; + /*Radio Button*/ + + /*Rating*/ + ejmRating(): JQuery; + ejmRating(options?: ej.mobile.RatingOptions): JQuery; + data(key: "ejmRating"): ej.mobile.Rating; + /*Rating*/ + + + /*Rotator*/ + ejmRotator(): JQuery; + ejmRotator(options?: ej.mobile.RotatorOptions): JQuery; + data(key: "ejmRotator"): ej.mobile.Rotator; + /*Rotator*/ + + /*Slider*/ + ejmSlider(): JQuery; + ejmSlider(options?: ej.mobile.SliderOptions): JQuery; + data(key: "ejmSlider"): ej.mobile.Slider; + /*Slider*/ + + /* Tab */ + ejmTab(): JQuery; + ejmTab(options?: ej.mobile.TabOptions): JQuery; + data(key: "ejmTab"): ej.mobile.Tab; + /* Tab */ + + /*Tile*/ + ejmTile(): JQuery; + ejmTile(options?: ej.mobile.TileOptions): JQuery; + data(key: "ejmTile"): ej.mobile.Tile; + /*Tile*/ + + /* TimePicker */ + ejmTimePicker(): JQuery; + ejmTimePicker(options?: ej.mobile.TimePickerOptions): JQuery; + data(key: "ejmTimePicker"): ej.mobile.TimePicker; + /* TimePicker */ + + /*ToggleButton*/ + ejmToggleButton(): JQuery; + ejmToggleButton(options?: ej.mobile.ToggleButtonOptions): JQuery; + data(key: "ejmToggleButton"): ej.mobile.ToggleButton; + /*ToggleButton*/ + + /*Toolbar*/ + ejmToolbar(): JQuery; + ejmToolbar(options?: ej.mobile.ToolbarOptions): JQuery; + data(key: "ejmToolbar"): ej.mobile.Toolbar; + /*Toolbar*/ + + /*GroupButton*/ + ejmGroupButton(): JQuery; + ejmGroupButton(options?: ej.mobile.GroupButtonOptions): JQuery; + data(key: "ejmGroupButton"): ej.mobile.GroupButton; + /*GroupButton*/ + + /* SplitPane */ + ejmSplitPane(): JQuery; + ejmSplitPane(options?: ej.mobile.SplitPaneOptions): JQuery; + data(key: "ejmSplitPane"): ej.mobile.SplitPane; + /* SplitPane */ + + /* Dialog */ + ejmDialog(): JQuery; + ejmDialog(options?: ej.mobile.DialogOptions): JQuery; + data(key: "ejmDialog"): ej.mobile.Dialog; + /* Dialog */ + + /* TextBox */ + ejmTextBox(): JQuery; + ejmTextBox(options?: ej.mobile.TextBoxOptions): JQuery; + data(key: "ejmTextBox"): ej.mobile.TextBox; + /* TextBox */ + + /* Password */ + ejmPassword(): JQuery; + ejmPassword(options?: ej.mobile.TextBoxOptions): JQuery; + data(key: "ejmPassword"): ej.mobile.TextBox; + /* Password */ + + /* MaskEdit */ + ejmMaskEdit(): JQuery; + ejmMaskEdit(options?: ej.mobile.MaskEditOptions): JQuery; + data(key: "ejmMaskEdit"): ej.mobile.MaskEdit; + /* MaskEdit */ + + /* TextArea */ + ejmTextArea(): JQuery; + ejmTextArea(options?: ej.mobile.TextBoxOptions): JQuery; + data(key: "ejmTextArea"): ej.mobile.TextBox; + /* MaskEdit */ + + /* Footer */ + ejmFooter(): JQuery; + ejmFooter(options?: ej.mobile.FooterOptions): JQuery; + data(key: "ejmFooter"): ej.mobile.Footer; + /* Footer */ + + /* CheckBox */ + ejmCheckBox(): JQuery; + ejmCheckBox(options?: ej.mobile.CheckBoxOptions): JQuery; + data(key: "ejmCheckBox"): ej.mobile.CheckBox; + /* CheckBox */ + + /* ScrollPanel */ + ejmScrollPanel(): JQuery; + ejmScrollPanel(options: ej.mobile.ScrollPanelOptions): JQuery; + data(key: "ejmScrollPanel"): ej.mobile.ScrollPanel; + /* ScrollPanel */ + + /* NavigationDrawer */ + ejmNavigationDrawer(): JQuery; + ejmNavigationDrawer(options: ej.mobile.NavigationDrawerOptions): JQuery; + data(key: "ejmNavigationDrawer"): ej.mobile.NavigationDrawer; + /* NavigationDrawer */ + + /* RadialMenu */ + ejmRadialMenu(): JQuery; + ejmRadialMenu(options?: ej.mobile.RadialMenuOptions): JQuery; + data(key: "ejmRadialMenu"): ej.mobile.RadialMenu; + /* RadialMenu */ + + ejLinearGauge(): JQuery; + ejLinearGauge(options?: ej.datavisualization.LinearGauge.Model): JQuery; + data(key: "ejLinearGauge"): ej.datavisualization.LinearGauge; + + ejDigitalGauge(): JQuery; + ejDigitalGauge(options?: ej.datavisualization.DigitalGauge.Model): JQuery; + data(key: "ejDigitalGauge"): ej.datavisualization.DigitalGauge; + + ejCircularGauge(): JQuery; + ejCircularGauge(options?: ej.datavisualization.CircularGauge.Model): JQuery; + data(key: "ejCircularGauge"): ej.datavisualization.CircularGauge; + + ejChart(): JQuery; + ejChart(options?: ej.datavisualization.Chart.Model): JQuery; + data(key: "ejChart"): ej.datavisualization.Chart; + + ejRangeNavigator(): JQuery; + ejRangeNavigator(options?: ej.datavisualization.RangeNavigator.Model): JQuery; + data(key: "ejRangeNavigator"): ej.datavisualization.RangeNavigator; + + ejBulletGraph(): JQuery; + ejBulletGraph(options?: ej.datavisualization.BulletGraph.Model): JQuery; + data(key: "ejBulletGraph"): ej.datavisualization.BulletGraph; + + ejMap(): JQuery; + ejMap(options?: ej.datavisualization.Map.Model): JQuery; + data(key: "ejMap"): ej.datavisualization.Map; + + ejTreeMap(): JQuery; + ejTreeMap(options?: ej.datavisualization.TreeMap.Model): JQuery; + data(key: "ejTreeMap"): ej.datavisualization.TreeMap; + + ejBarcode(): JQuery; + ejBarcode(options?: ej.datavisualization.Barcode.Model): JQuery; + data(key: "ejBarcode"): ej.datavisualization.Barcode; + + ejDiagram(): JQuery; + ejDiagram(options?: ej.datavisualization.Diagram.Model): JQuery; + data(key: "ejDiagram"): ej.datavisualization.Diagram; + +} \ No newline at end of file diff --git a/ej.widgets.all/ej.web.all-tests.ts b/ej.widgets.all/ej.web.all-tests.ts new file mode 100644 index 0000000000..091359c821 --- /dev/null +++ b/ej.widgets.all/ej.web.all-tests.ts @@ -0,0 +1,1260 @@ +/// +/// + +$(document).ready(function () { + + //Properties + $("#draggable1").ejDraggable({ + drag: ondrag1, dragStart: ondragstart1, dragStop: ondragstop1 + }); + $("#droppable1").ejDroppable(); + +}); +//Events + +function ondrag1() { + console.log("The mouse is moved during the dragging."); +} +function ondragstart1() { + console.log("To handle the drag start event as an init option."); +} +function ondragstop1() { + console.log("The mouse is moved during the dragging.."); +} + + + + + +$(document).ready(function () { + + //Properties + $("#draggable1").ejDraggable({ + drag: ondrag2, dragStart: ondragstart2, dragStop: ondragstop2 + }); + $("#droppable1").ejDroppable(); + +}); +//Events + +function ondrag2() { + console.log("The mouse is moved during the dragging."); +} +function ondragstart2() { + console.log("To handle the drag start event as an init option."); +} +function ondragstop2() { + console.log("The mouse is moved during the dragging.."); +} + + + + + +$(document).ready(function () { + + //Properties + $("#resizable1").ejResizable({resizeStart: onresizestart , resizeStop: onresizestop }); + +}); +//Events +function onresizestart() { + console.log("The resizing is start"); +} +function onresizestop() { + console.log("The resizing is stop"); +} + + + + + +$(document).ready(function () { + + //Properties + $("#scroller1").ejScroller({ height: 300, width: 500, create: onScrollCreate }); + $("#scroller2").ejScroller({ height: 300, width: 500,scrollTop:40 }); + +}); +//Events +function onScrollCreate() { + console.log("control created"); +} + +$(document).ready(function () { + + $("#accordion1").ejAccordion({cssClass: "gradient-lime" , create: AccordionCreate }); + $("#accordion2").ejAccordion({ enabled: true , activate: AccordionActivate }); + +}); + +function AccordionCreate() { + console.log("create"); +} +function AccordionActivate(){ + console.log("activate") +} + +$(document).ready(function () { + + $("#Text1").ejButton({ text: "Button", enabled: false , create: onButtoncreate }); + $("#Text2").ejButton({ text: "Button", cssClass: "customclass" , click: onButtonclick }); +}); + +function onButtoncreate() { + console.log("create"); +} +function onButtonclick(){ + console.log("click") +} +$(document).ready(function () { + + //Properties + $("#listbox1").ejListBox({ allowMultiSelection: true, create: onlistBoxcreate }); + $("#listbox2").ejListBox({ showCheckbox: true,checkChange: onlistBoxcheckchange }); + +}); +//Events +function onlistBoxcreate() { + console.log("control created"); +} +function onlistBoxcheckchange() { + console.log("list item is checked or unchecked"); +} + + + + + +$(document).ready(function () { + + $("#checkbox1").ejCheckBox({ enableTriState: true, create: onCheckboxcreate }); + $("#checkbox2").ejCheckBox({ checked: true , change: onCheckboxchange }); + +}); + +function onCheckboxcreate() { + console.log("create"); +} +function onCheckboxchange(){ + console.log("change") +} + + + +$(document).ready(function () { + + $("#colorpicker1").ejColorPicker({ value: "#278787" , open: oncolorPickeropen }); + $("#colorpicker2").ejColorPicker({ enabled: true, create: oncolorPickercreate }); + +}); +function oncolorPickeropen() { + console.log("open"); +} +function oncolorPickercreate(){ + console.log("create") +} + + +$(document).ready(function () { + + $("#fileExplorer").ejFileExplorer({ + isResponsive: true, + fileTypes: "*.png, *.gif, *.jpg, *.jpeg, *.docx", + layout: "largeicons", + path: "http://mvc.syncfusion.com/ODataServices/FileBrowser/", + ajaxAction: "http://mvc.syncfusion.com/OdataServices/fileExplorer/fileoperation/doJSONPAction", + ajaxDataType: "jsonp", + }); +}); + + +$(document).ready(function () { + + $("#datepicker1").ejDatePicker({dateFormat: "dd/MM/yyyy" ,open: ondatePickeropen }); + $("#datepicker3").ejDatePicker({value: "21/2/2010" , select: ondatePickerselect }); + +}); +function ondatePickeropen() { + console.log("open"); +} +function ondatePickerselect(){ + console.log("select") +} + + +$(document).ready(function () { + + $("#datetimepicker1").ejDateTimePicker({width:"100%" , create: ondatetimePickercreate }); + $("#datetimepicker2").ejDateTimePicker({enableRTL: true , open: ondatetimePickeropen }); +}); +function ondatetimePickercreate() { + console.log("create"); +} +function ondatetimePickeropen(){ + console.log("open") +} + + +$(document).ready(function () { + $("#Div1").ejDialog({ enabled: true , open : ondialogOpen }); + $("#Div2").ejDialog({ title: "Low battery" , beforeClose : ondialogbeforeClose }); +}); +function ondialogbeforeClose() { + console.log("beforeClose"); +} +function ondialogOpen() { + console.log("open"); +} +$(document).ready(function () { + + $("#dropdownlist1").ejDropDownList({ targetID: "carsList", create: ondropDowncreate }); + $("#dropdownlist2").ejDropDownList({ watermarkText: "Select a car", change: ondropDownchange }); +}); + +function ondropDowncreate() { + console.log("create"); +} +function ondropDownchange(){ + console.log("change") +} +$(document).ready(function () { + $("#num1").ejNumericTextbox({ value:"35" ,create: onEditorcreate }); + $("#num2").ejNumericTextbox({ width:"100%" , change: onEditorchange }); + + $("#num3").ejPercentageTextbox({ value:"3" ,create: onEditorcreate }); + $("#num4").ejPercentageTextbox({ width:"100%" , change: onEditorchange }); + + $("#num5").ejCurrencyTextbox({ value:"555" ,create: onEditorcreate }); + $("#num6").ejCurrencyTextbox({ width:"100%" , change: onEditorchange }); + +}); + +function onEditorcreate() { + console.log("create"); +} +function onEditorchange(){ + console.log("change") +} + +$(document).ready(function () { + + //Properties + $("#listview1").ejListView({ width: 200,mouseUP: onlistViewmouseup }); + $("#listview2").ejListView({ height: 300, mouseDown: onlistViewmousedown }); + +}); +//Events +function onlistViewmouseup() { + console.log("mouse up happens on the item."); +} +function onlistViewmousedown() { + console.log("mouse down happens on the item."); +} + + + + + + + + + +$(document).ready(function () { + $("#num1").ejMaskEdit({ maskFormat: "99-999-99999" ,create: onmaskEditcreate }); + $("#num2").ejMaskEdit({ watermarkText: "99-999-99999", width:"100%" , change: onmaskEditchange }); +}); + +function onmaskEditcreate() { + console.log("create"); +} +function onmaskEditchange(){ + console.log("change") +} +$(document).ready(function () { + + //Properties + $("#menu1").ejMenu({ enabled: false ,create: onMenucreate }); + $("#menu2").ejMenu({ width: "800px",click: onMenuclick }); + +}); +//Events +function onMenucreate() { + console.log("control created"); +} +function onMenuclick() { + console.log("mouse click on menu items"); +} + + + + + +$(document).ready(function () { + $("#pager1").ejPager({ click : onclickpager }); + $("#pager2").ejPager({ enableRTL: true }); +}); + +function onclickpager(){ + console.log("click") +} +$(document).ready(function () { + + $("#progress1").ejProgressBar({ text: 'loading...' , value: 50 , create: ProgressBarCreate }); + $("#progress2").ejProgressBar({ width: 200, value: 50 , change: ProgressBarChange }); + +}); + +function ProgressBarCreate() { + console.log("create"); +} +function ProgressBarChange(){ + console.log("change"); +} + +$(document).ready(function () { + $("#r1").ejRadioButton({ create: onradioButtoncreate }); + $("#r2").ejRadioButton({ text: "RadioButton",change: onradioButtonchange }); + $("#r3").ejRadioButton({ text: "RadioButton1", enabled: false }); +}); + +function onradioButtonchange() { + console.log("Change triggered"); +} +function onradioButtoncreate() { + console.log("Create triggered"); +} +$(document).ready(function () { + $("#Div1").ejRating({ enabled: true, click: onRatingclick }); + $("#Div2").ejRating({ incrementStep: 1, change: RatingvalueChanged }); +}); + +function RatingvalueChanged() { + console.log("Value changed"); +} +function onRatingclick() { + console.log("Entered"); +} +$(document).ready(function () { + + + $("#test1").ejRibbon({ + allowResizing:true,applicationTab: { + menuSettings: { + openOnClick: false + } + }, + tabs: [{ + id: "home", + text: "HOME", + groups: [{ + text: "New", + type: "custom", + contentID: "btn" + }] + }], + }); + $("#test2").ejRibbon({ + width: "100%", + applicationTab: { + menuSettings: { + openOnClick: false + } + }, + tabs: [{ + id: "home", + text: "HOME", + groups: [{ + text: "New", + type: "custom", + contentID: "btn" + }] + }], tabClick: onRibbonTabClick + }); +}); + +function onRibbonTabClick() { + console.log("Tab Clicked.."); +} + +$(function() { + $("#Kanban").ejKanban( + { + enableRTL: true, + columns: [ + { headerText: "Backlog", key: "Open" }, + { headerText: "In Progress", key: "InProgress" }, + { headerText: "Testing", key: "Testing" }, + { headerText: "Done", key: "Close" } + ], + keyField: "Status", + + + }); + }); + +$(document).ready(function () { + var imageData = [ + { + "imageurl": "../themes/images/rose.jpg", + }, + { + "imageurl": "../themes/images/rose.jpg", + } + + ]; + $("#test1").ejRotator({ + dataSource:imageData, allowKeyboardNavigation : false,create: onRotatorCreate + }); + $("#test2").ejRotator({ + dataSource:imageData, displayItemsCount : "1",pagerClick: onRotatorpagerClick + + }); + + +}); + +function onRotatorCreate() { + console.log("created"); +} +function onRotatorpagerClick() { + console.log("page clicked.."); +} + + +$(document).ready(function () { + $("#rteSample").ejRTE({ allowEditing: false , enableRTL: true }); + $("#rteSample").ejRTE({ change: onRtechange , execute: onRteExecute }); +}); + +function onRtechange() { + console.log("Change triggered"); +} +function onRteExecute() { + console.log("Executed"); +} +$(document).ready(function() { + $("#test1").ejSlider({ showRoundedCorner: true }); + $("#test2").ejSlider({ orientation: ej.Orientation.Vertical }); + $("#test3").ejSlider({ minValue: 20, maxValue: 80 }); + $("#test4").ejSlider({ start: Sliderstart }); + $("#test5").ejSlider({ enabled: false }); + $("#test6").ejSlider({ slide: onSliderslide }); +}); +function Sliderstart() { + console.log("Slider Started"); +} +function onSliderslide() { + console.log("Moving"); +} + +$(document).ready(function () { + $("#sbutton").ejSplitButton({ + width: "120px", + height: "50px", + buttonMode: ej.ButtonMode.Dropdown, + create: splitButtonopen, + targetID: "target", + }); +}); + +function splitButtonopen() +{ +alert("Opened"); +} + + + +$(document).ready(function () { + + $("#splitter1").ejSplitter({ enableRTL: true , create: onSplitterCreate }); + $("#splitter2").ejSplitter({allowKeyboardNavigation: false , expandCollapse: onSplitterExpandCollapse }); + +}); +function onSplitterCreate() { + console.log("Created"); +} +function onSplitterExpandCollapse(){ + console.log("expand and collapsed") +} + +$(document).ready(function () { + + $("#tab1").ejTab({ enableRTL: true , create: onTabCreate }); + $("#tab2").ejTab({ showRoundedCorner: true , ajaxSuccess: onTabAjaxSuccess }); + +}); +function onTabCreate() { + console.log("created"); +} + +function onTabAjaxSuccess() { + console.log("ajaxsuccess"); +} + + +$(function () { + // declaration + var websiteCollection = [ + { text: "Google", url: "http://www.google.com", frequency: 12 }, + { text: "All Things Digital", url: "http://allthingsd.com/", frequency: 3 }, + + ]; + $("#tagtest").ejTagCloud({ + titleText: "Tech Sites", + dataSource: websiteCollection, + enableRTL: true, mouseout: onTagMouseout + }); + $("#tagtest1").ejTagCloud({ + titleText: "Tech Sites", + dataSource: websiteCollection, + maxFontSize: "10px", create: onTagCreate + }); + function onTagCreate() { + console.log("created"); + } + function onTagMouseout() { + console.log("mouseout"); + } +}); + + + + $(function () { + $("#time").ejTimePicker({ enabled : true, height : "35",close: TimeClose,create: TimeCreate}); + }); + + function TimeClose() { + console.log("close"); + } + function TimeCreate() { + console.log("create"); + } + + + $(function () { + $("#tbutton").ejToggleButton({ + size: "large", + height: "28px", + click:ToggleClick, + create:ToggleCreate + }); + }); + + function ToggleClick() { + console.log("click"); + } + function ToggleCreate() { + console.log("create"); + } + +$(function () {// document ready + // Toolbar control creation + $("#ToolbarItem").ejToolbar({ + width: "auto", // width of the Toolbar + height: "33px", // height of the Toolbar + create:ToolBarCreate, + click:ToolBarClick + }); + }); + +function ToolBarCreate() { + console.log("click"); +} +function ToolBarClick() { + console.log("create"); +} + +$(document).ready(function () { + + $("#treeView").ejTreeView({ width: 300 , cssClass: 'customclass' , create: TreeViewCreate }); + + $("#treeView1").ejTreeView({ height: 300 , enabled: true , nodeClick: TreeViewClick }); +}); + + +function TreeViewCreate() { + console.log("create"); +} +function TreeViewClick(){ + console.log("click"); +} + +$(document).ready(function () { + + //Properties + $("#uploadbbox1").ejUploadbox({ height: "60px", create: onuploadBoxcreate }); + $("#uploadbbox2").ejUploadbox({ enableRTL: true, fileSelect: onuploadBoxfileselect }); + +}); +//Events +function onuploadBoxcreate() { + console.log("control created"); +} +function onuploadBoxfileselect() { + console.log("file has been selected"); +} + + + + + + + + + +$(document).ready(function () { + + //Properties + $("#waitingpopup1").ejWaitingPopup({ showOnInit: true, create: onwaitingPopupcreate }); + $("#waitingpopup2").ejWaitingPopup({ showOnInit: true, showImage: false }); + +}); +//Events +function onwaitingPopupcreate() { + console.log("control created"); +} + + + + + +$(function () { + $("#Grid").ejGrid({ + allowPaging: true, + allowSorting: true, + rowSelected: onGridRowSelect, + columnSelected: onGridColumnSelect, + rightClick: onGridRightClick, + columns: [ + { field: "OrderID", headerText: "Order ID", width: 75 , textAlign: ej.TextAlign.Right }, + { field: "CustomerID", headerText: "Customer ID", width: 80 }, + { field: "EmployeeID", headerText: "Employee ID", width: 75, textAlign: ej.TextAlign.Right }, + { field: "Freight", width: 75, format: "{0:C}", textAlign: ej.TextAlign.Right }, + { field: "OrderDate", headerText: "Order Date", width: 80, format: "{0:MM/dd/yyyy}", textAlign: ej.TextAlign.Right }, + { field: "ShipCity", headerText: "Ship City", width: 110 } + ] + }); + }); + +function onGridRowSelect() +{ +console.log("Row Selected"); +} +function onGridRightClick() +{ +console.log("Right Click Button Clicked"); +} +function onGridColumnSelect() +{ +console.log("Column Selected"); +} + + $(function () { + $("#PivotGrid").ejPivotGrid({ + load: PivotGridload, + renderComplete: PivotGridrenderComplete, + url: "/wcf/PivotGridService.svc", + isResponsive: true + + }); + }); + + function PivotGridload() { + console.log("load"); + } + function PivotGridrenderComplete() { + console.log("rendercomplete"); + } + + + $(function () { + $("#PivotSchemaDesigner1").ejPivotSchemaDesigner({ + height: "630px", + url: "/wcf/PivotService.svc" + }); + }); + + + +$(document).ready(function () { + $("#pivotpager1").ejPivotPager({ categoricalCurrentPage: 1 }); + $("#pivotpager2").ejPivotPager({ seriesPageCount: 0 }); +}); + +$(document).ready(function () { + $("#test1").ejSchedule({ + cellHeight:"35px", cellClick: onScheduleCellClick + }); + $("#test2").ejSchedule({ + enableRTL: true, menuItemClick: onScheduleMenuItemClick + }); +}); +function onScheduleCellClick() { + console.log("cell clicked.."); +} +function onScheduleMenuItemClick() { + console.log("Menu Item Clicked.."); +} + + + $(function () { + $("#RecurrenceEditor").ejRecurrenceEditor({ + selectedRecurrenceType: 0, + create: RecurrenceEditorOncreate + }); + + }); + + function RecurrenceEditorOncreate() { + this.element.find("#recurrencetype_wrapper").css("width", "33%"); + } + +$(document).ready(function () { + +$("#GanttContainer").ejGantt({ + allowSelection: true, + allowColumnResize: true, + taskIdMapping: "TaskID", + taskNameMapping: "TaskName", + scheduleStartDate: "02/23/2014", + scheduleEndDate: "03/31/2014", + startDateMapping: "StartDate", + endDateMapping: "EndDate", + progressMapping: "Progress", + childMapping: "Children", + allowGanttChartEditing: false, + treeColumnIndex: 1, + enableResize: true, + expanded: onGanttExpand, + load: onGanttLoad + }); +}); + +function onGanttExpand() +{ +console.log("Expanded"); +} +function onGanttLoad() +{ +console.log("Loading"); +} +$(document).ready(function () { + + + $("#test1").ejReportViewer({ reportServiceUrl: "../api/RDLReport",enablePageCache: false,reportLoaded: onReportReportLoaded }); + $("#test2").ejReportViewer({ + renderMode: ej.ReportViewer.RenderMode.Default,reportServiceUrl: "../api/RDLReport",renderingBegin: onReportRenderingBegin }); +}); +function onReportRenderingBegin() { + console.log("Rendering Begin.."); +} +function onReportReportLoaded() { + console.log("Report Loaded.."); +} + +$(document).ready(function () { + var dataManager = [ + { + taskID: 1, + taskName: "Planning", + startDate: "02/03/2014", + endDate: "02/07/2014", + progress: 100, + duration: 5, + priority: "Normal", + approved: false, + subtasks: [ + { taskID: 2, taskName: "Plan timeline", startDate: "02/03/2014", endDate: "02/07/2014", duration: 5, progress: 100, priority: "Normal", approved: false }, + { taskID: 3, taskName: "Plan budget", startDate: "02/03/2014", endDate: "02/07/2014", duration: 5, progress: 100, approved: true }, + { taskID: 4, taskName: "Allocate resources", startDate: "02/03/2014", endDate: "02/07/2014", duration: 5, progress: 100, priority: "Critical", approved: false }, + { taskID: 5, taskName: "Planning complete", startDate: "02/07/2014", endDate: "02/07/2014", duration: 0, progress: 0, priority: "Low", approved: true } + ] + }]; + +$("#test1").ejTreeGrid({ + dataSource:dataManager,allowColumnResize: true, + columns: [ + { field: "taskID", headerText: "Task Id", editType: "numericedit" }, + { field: "taskName", headerText: "Task Name", editType: "stringedit" }, + { field: "startDate", headerText: "Start Date", editType: "datepicker" }, + { field: "endDate", headerText: "End Date", editType: "datepicker" }, + { field: "duration", headerText: "Duration", editType: "numericedit" }, + { field: "progress", headerText: "Progress", editType: "numericedit" } + ],load: onTreeLoad + }); + $("#test2").ejTreeGrid({ + dataSource:dataManager,rowHeight : 30, + columns: [ + { field: "taskID", headerText: "Task Id", editType: "numericedit" }, + { field: "taskName", headerText: "Task Name", editType: "stringedit" }, + { field: "startDate", headerText: "Start Date", editType: "datepicker" }, + { field: "endDate", headerText: "End Date", editType: "datepicker" }, + { field: "duration", headerText: "Duration", editType: "numericedit" }, + { field: "progress", headerText: "Progress", editType: "numericedit" } + ],rowSelected: onTreeRowSelected + + }); + + +}); +function onTreeLoad() { + console.log("loaded.."); +} +function onTreeRowSelected() { + console.log("row Selected.."); +} + + +$(document).ready(function () { + $("#navpane").ejNavigationDrawer({ type: "overlay", direction: "left", position: "fixed",open: NavigationDrawerOpen }); +}); + +function NavigationDrawerOpen() +{ + console.log("open"); +} + + + $(function () { + $('#radialmenu').ejRadialMenu({ targetElementId: "radialtarget", "autoOpen":true,select: RadialMenuSelect , mouseUp: RadialMenuMouseUp }); + }); + + function RadialMenuMouseUp() { + console.log("mouseUp"); + } + function RadialMenuSelect() { + console.log("select"); + } + + + +$(function () +{ + $("#tile1").ejTile({ text: "Map", tileSize: "medium", imageUrl: 'http://js.syncfusion.com/ug/web/content/tile/map.png', mouseUp: TileMouseUp, mouseDown: TileMouseDown }); +}); + +function TileMouseUp() { + console.log("mouseUp"); +} + +function TileMouseDown() { + console.log("mousedown"); +} + + + + + $(function () { + $("#radialSlider").ejRadialSlider({ innerCircleImageUrl: "chevron-right.png",autoOpen:true, create: RadialSliderCreate , start: RadialSliderStart }); + }); + + function RadialSliderCreate() { + console.log("create"); + } + function RadialSliderStart() { + console.log("start"); + } + +$(document).ready(function () { + $("#test1").ejSpreadsheet({ + allowDelete: true, cellEdit: onSpreadsheetCellEdit + }); + $("#test2").ejSpreadsheet({ + cssClass: "gradient-lime", drag: onSpreadsheetDrag + }); +}); +function onSpreadsheetDrag() { + console.log("item drag.."); +} +function onSpreadsheetCellEdit() { + console.log("cell edited.."); +} + + + $(function() + { + $("#OlapChart").ejOlapChart( + { + url: "OlapChartService.svc", + renderFailure: OlapChartRenderFailure, + renderSuccess: OlapChartRenderSuccess + }); + }); + + function OlapChartRenderFailure() { + console.log("failure"); + } + function OlapChartRenderSuccess() { + console.log("success"); + } + + + $(function() + { + $("#OlapClient").ejOlapClient( + { + url: "/wcf/OlapClientService.svc", + title: "OLAP Browser", + renderFailure: OlapClientRenderFailure, + renderSuccess: OlapClientRenderSuccess + }); + }); + + function OlapClientRenderFailure() { + console.log("failure"); + } + function OlapClientRenderSuccess() { + console.log("success"); + } + +$(document).ready(function() + { + $("#olapgauge1").ejOlapGauge( + { + url: "../wcf/OlapGaugeService.svc", + enableTooltip: true, + renderFailure: olapGaugerenderFailure, + renderSuccess: olapGaugerenderSuccess + }); + }); +function olapGaugerenderFailure() { + console.log("failure"); + } +function olapGaugerenderSuccess() { + console.log("success"); + } + +$(document).ready(function () { + + $("#CoreLinearGauge").ejLinearGauge({ + labelColor: "#8c8c8c", width: 500, + scales: [{ + width: 4, border: { color: "transparent",width:0 }, showBarPointers: false, showRanges: true, length: 310, + position: { x: 52, y: 50 }, markerPointers: [{ + value: 50, length: 10, width: 10, backgroundColor: "#4D4D4D", border: { color: "#4D4D4D" } + }], + labels: [{ font: { size: "11px", fontFamily: "Segoe UI", fontStyle: "bold" }, distanceFromScale:{x: -13} }], + ticks: [{ type: "majorinterval", width: 1, color: "#8c8c8c" }], + ranges: [{ + endValue: 60, + startValue: 0, + backgroundColor: "#F6B53F", + border: { color: "#F6B53F" }, startWidth: 4, endWidth: 4 + }, { + endValue: 100, + startValue: 60, + backgroundColor: "#E94649", + border: { color: "#E94649" }, startWidth: 4, endWidth: 4 + }] + }], + init:onLinearGaugeinit, + mouseClick:onLinearGaugemouseClick + }); +}); + +function onLinearGaugeinit() +{ + console.log("init"); +} +function onLinearGaugemouseClick() +{ + console.log("mouseClick"); +} + +$(document).ready(function () { + + $("#CoreCircularGauge").ejCircularGauge({ + backgroundColor: "transparent", width: 500, + scales: [{ + showRanges: true, + startAngle: 122, sweepAngle: 296, radius: 130, showScaleBar: true, size: 1, maximum: 120, majorIntervalValue: 20, minorIntervalValue: 10, + border: { + width: 0.5, + }, + pointers: [{ + value: 60, + showBackNeedle: true, + backNeedleLength: 20, + length: 95, + width: 7, + pointerCap: { radius: 12 } + }], + ticks: [{ + type: "major", + distanceFromScale: 2, + height: 16, + width: 1, color: "#8c8c8c" + }, { type: "minor", height: 8, width: 1, distanceFromScale: 2, color: "#8c8c8c" }], + labels: [{ + color: "#8c8c8c" + }], + ranges: [{ + distanceFromScale: -30, + startValue: 0, + endValue: 70 + }, { + distanceFromScale: -30, + startValue: 70, + endValue: 110, + backgroundColor: "#fc0606", + border: { color: "#fc0606" } + }, + { + distanceFromScale: -30, + startValue: 110, + endValue: 120, + backgroundColor: "#f5b43f", + border: { color: "#f5b43f" } + }] + }], + mouseClick:onCircularMouseClick + }); + +}); + +function onCircularMouseClick() +{ + console.log("Mouse click.."); +} + +$(document).ready(function () { + + $("#DigitalCore").ejDigitalGauge({ + width: 525, + height: 305, + items: [{ + segmentSettings: { + width: 1, + spacing: 0, + color: "#8c8c8c" + }, + characterSettings: { + opacity: 0.8, + }, + value: "123456789", + position: { x: 52, y: 52 } + }], + init:onDigitalGaugeinit, + itemRendering:onDigitalGaugeItemRendering + }); +}); + +function onDigitalGaugeinit() +{ + console.log("init"); +} +function onDigitalGaugeItemRendering() +{ + console.log("itemRendering"); +} + +$(document).ready(function () { + + $("#container").ejChart( + { + + + + //Initializing Common Properties for all the series + commonSeriesOptions: + { + type: 'line', enableAnimation: true, + tooltip:{ visible :true, template:'Tooltip'}, + marker: + { + shape: 'circle', + size: + { + height: 10, width: 10 + }, + visible: true + }, + border : {width: 2} + }, + + + + title :{text: 'Efficiency of oil-fired power production'}, + size: { height: "600" }, + legend: { visible: true}, + create:onChartCreate + }); + +}); + +function onChartCreate() +{ + console.log("create"); +} + +$(document).ready(function () { + + $("#scrollcontent").ejRangeNavigator({ + + enableDeferredUpdate: true, + padding: "15", + allowSnapping:true, + selectedRangeSettings: { + start:"2015/5/25", end:"2016/5/25" + }, + + }) +}); + +$(document).ready(function () { + $("#BulletGraph1").ejBulletGraph({ + qualitativeRangeSize: 32, + quantitativeScaleLength: 475, tooltipSettings: {template: "Tooltip", visible: true}, orientation: ej.datavisualization.BulletGraph.Orientation.Horizontal, + flowDirection: ej.datavisualization.BulletGraph.FlowDirection.Forward, + quantitativeScaleSettings: { + location: { x: 110, y: 10 }, + minimum: 0, + maximum: 10, + interval: 1, + minorTicksPerInterval: 4, + majorTickSettings:{ size: 13, width: 1, stroke: 'gray'}, + minorTickSettings:{ size: 5, width: 1, stroke: 'gray'}, + + labelSettings: { + position: ej.datavisualization.BulletGraph.LabelPosition.Below, offset: 14, size: 10 + }, + featuredMeasureSettings: { width: 6 }, + comparativeMeasureSettings:{ + width: 5 + }, + featureMeasures: [{ value: 8, comparativeMeasureValue: 6.7, category: ""}] + }, + qualitativeRanges: [{ + rangeEnd: 4.3 + }, { + rangeEnd: 7.3 + }, { + rangeEnd: 10 + }], + captionSettings: { textAngle: 0, + location: { x: 17, y: 20 }, text: "Revenue YTD", font: { color: null, fontFamily: 'Segoe UI', fontStyle: ej.datavisualization.BulletGraph.FontStyle.Normal, size: '12px', fontWeight: ej.datavisualization.BulletGraph.FontWeight.Normal, opacity: 1 }, //'#707070' + subTitle: { textAngle: 0, + text: "$ in Thousands", location: { x: 10, y: 35 }, font: { color: null, fontFamily: 'Segoe UI', fontStyle: ej.datavisualization.BulletGraph.FontStyle.Normal, size: '12px', fontWeight: ej.datavisualization.BulletGraph.FontWeight.Normal, opacity: 1} //'#707070' + } + } + + + + }); + + $("#BulletGraph2").ejBulletGraph({ qualitativeRangeSize: 32, height:140, + quantitativeScaleLength: 475, orientation: ej.datavisualization.BulletGraph.Orientation.Horizontal, + flowDirection: ej.datavisualization.BulletGraph.FlowDirection.Forward, + quantitativeScaleSettings: { + location: { x: 110, y: 10 }, + minimum: -10, + maximum: 10, + interval: 2, + minorTicksPerInterval: 4, + majorTickSettings:{ size: 13, width: 1}, + minorTickSettings:{ size: 5, width: 1}, + + labelSettings: { + position: ej.datavisualization.BulletGraph.LabelPosition.Below, offset: 14, size: 10, labelSuffix: ' %' + }, + featuredMeasureSettings: { width: 6 }, + comparativeMeasureSettings:{ width: 5 }, + featureMeasures: [{ value: 8, comparativeMeasureValue: 6.7}] + }, + qualitativeRanges: [{ + rangeEnd: -4, rangeStroke: "#61a301" + }, { + rangeEnd: 3, rangeStroke: "#fcda21" + }, { + rangeEnd: 10, rangeStroke: "#d61e3f" + }], + captionSettings: { textAngle: 0, + location: { x: 60, y: 25 }, text: "Profit", font: { color: null, fontFamily: 'Segoe UI', fontStyle: ej.datavisualization.BulletGraph.FontStyle.Normal, size: '13px', fontWeight: ej.datavisualization.BulletGraph.FontWeight.Normal, opacity: 1 }, //'#707070' + //subTitle: { textAngle: 0, + // text: "profit in %", location: { x: 35, y: 35 }, font: { color: null, fontFamily: 'Segoe UI', fontStyle: ej.datavisualization.BulletGraph.FontStyle.Normal, size: '12px', fontWeight: ej.datavisualization.BulletGraph.FontWeight.Normal, opacity: 1} //'#707070' + //} + }, + drawLabels:onBulletDrawLabel + }); + +}); + + function onBulletDrawLabel() + { + console.log("drawLabel"); + } + + +$(document).ready(function () { + + $("#barcode").ejBarcode({ text: "HTTP://WWW.SYNCFUSION.COM", symbologyType: "qrbarcode", xDimension: 8, displayText: true, load:onBarcodeLoad }); + +}); + +function onBarcodeLoad() + { + console.log("load"); + } + + jQuery(function ($) { + $("#container").ejMap({ + mouseover:MapMouseOver, + onRenderComplete:MapOnRenderComplete, + navigationControl:{enableNavigation:true,orientation:'vertical',absolutePosition:{x:5,y:15},dockPosition: 'none'}, + background:'white', + enableAnimation: true, + layers: [ + { + layerType: "geometry", + enableSelection: false, + enableMouseHover:false, + + showMapItems: false, + markerTemplate: 'template', + shapeSettings: { + fill: "#626171", + strokeThickness: "1", + stroke: "#6F6F79", + highlightStroke:"#6F6F79", + valuePath: "name", + highlightColor: "gray" + + }, + + } + ] + + }); + }); + function MapMouseOver() { + console.log("mouseover"); + } + function MapOnRenderComplete() { + console.log("onRenderComplete"); + } + + + jQuery(function ($) { + $("#treemapContainer").ejTreeMap({ + treeMapItemSelected:onTreeMapItemSelected, + + levels: [ + { groupPath: "Continent", groupGap: 5} + ], + colorValuePath: "Growth", + rangeColorMapping: [ + { color: "#DC562D", from: "0", to: "1" }, + { color: "#FED124", from: "1", to: "1.5" }, + { color: "#487FC1", from: "1.5", to: "2" }, + { color: "#0E9F49", from: "2", to: "3" } + ], + showTooltip:true, + leafItemSettings: { labelPath: "Region" } + }); + }); + function onTreeMapItemSelected() { + console.log("TreeMapItemSelected"); + } + + \ No newline at end of file diff --git a/ej.widgets.all/ej.web.all.d.ts b/ej.widgets.all/ej.web.all.d.ts new file mode 100644 index 0000000000..de335df408 --- /dev/null +++ b/ej.widgets.all/ej.web.all.d.ts @@ -0,0 +1,47109 @@ +// Type definitions for ej.web.all v14.1.0.41 +// Project: http://help.syncfusion.com/js/typescript +// Definitions by: Syncfusion +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/*! +* filename: ej.web.all.d.ts +* version : 14.1.0.41 +* Copyright Syncfusion Inc. 2001 - 2016. All rights reserved. +* Use of this code is subject to the terms of our license. +* A copy of the current license can be obtained at any time by e-mailing +* licensing@syncfusion.com. Any infringement will be prosecuted under +* applicable laws. +*/ +declare module ej { + + var dataUtil: dataUtil; + function isMobile(): boolean; + function isIOS(): boolean; + function isAndroid(): boolean; + function isFlat(): boolean; + function isWindows(): boolean; + function isCssCalc(): boolean; + function getCurrentPage(): JQuery; + function isLowerResolution(): boolean; + function browserInfo(): browserInfoOptions; + function isTouchDevice(): boolean; + function addPrefix(style: string): string; + function animationEndEvent(): string; + function blockDefaultActions(e: Object): void; + function buildTag(tag: string, innerHtml: string, styles: Object, attrs: Object): JQuery; + function cancelEvent(): string; + function copyObject(): string; + function createObject(nameSpace: string, value: Object, initIn: string): JQuery; + function defineClass(className: string, constructor:any, proto: Object, replace: boolean): Object; + function destroyWidgets(element: Object): void; + function endEvent(): string; + function event(type: string, data: any, eventProp: Object): Object; + function getAndroidVersion(): Object; + function getAttrVal(ele: Object, val: string, option: Object): Object; + function getBooleanVal(ele: Object, val: string, option: Object): Object; + function getClearString(): string; + function getDimension(element: Object, method: string): Object; + function getFontString(fontObj: Object): string; + function getFontStyle(style: string): string; + function getMaxZindex(): number; + function getNameSpace(className: string): string; + function getObject(nameSpace: string): Object; + function getOffset(ele: string): Object; + function getRenderMode(): string; + function getScrollableParents(element: Object): void; + function getTheme(): string; + function getZindexPartial(element: Object, popupEle: string): number; + function hasRenderMode(element: string): void; + function hasStyle(prop: string): boolean; + function hasTheme(element: string): string; + function hexFromRGB(color: string): string; + function ieClearRemover(element: string): void; + function isAndroidWebView(): string; + function isDevice(): boolean; + function isIOS7(): boolean; + function isIOSWebView(): boolean; + function isLowerAndroid(): boolean; + function isNullOrUndefined(value: Object): boolean; + function isPlainObject(): JQuery; + function isPortrait(): any; + function isTablet(): boolean; + function isWindowsWebView(): string; + function listenEvents(selectors:any, eventTypes: any, handlers: any, remove?: any, pluginObj?: any, disableMouse?: boolean): void; + function listenTouchEvent(selectors:any, eventTypes: any, handlers: any, remove?: any, pluginObj?: any, disableMouse?: boolean): void; + function logBase(val: string, base: string): number; + function measureText(text: string, maxwidth: number, font: string): string; + function moveEvent(): string; + function print(element: string): void; + function proxy(fn: Object, context: string, arg: string): boolean; + function round(value: string, div: string, up: string): any; + function sendAjaxRequest(ajaxOptions: Object): void; + function setCaretToPos(nput: string, pos1: string, pos2: string): void; + function setRenderMode(element: string): void; + function setTheme(): Object; + function startEvent(): string; + function tapEvent(): string; + function tapHoldEvent(): string; + function throwError(): Object; + function transitionEndEvent(): Object; + function userAgent(): boolean; + function widget(pluginName: string, className: string, proto: Object): Object; + function avg(json: Object, filedName: string): any; + function getGuid(prefix: string): number; + function group(jsonArray: any, field: string, agg: string, level: number, groupDs: string): Object; + function isJson(jsonData: string): string; + function max(jsonArray: any, fieldName: string, comparer: string): any; + function min(jsonArray: any, fieldName: string, comparer: string): any; + function merge(first: string, second: string): any; + function mergeshort(jsonArray: any, fieldName: string, comparer: string): any; + function parseJson(jsonText: string): string; + function parseTable(table: number, headerOption: string, headerRowIndex: string): Object; + function select(jsonArray: any, fields: string): any; + function setTransition(): boolean; + function sum(json: string, fieldName: string): string; + function swap(array: any, x: string, y: string): any; + var cssUA: string; + var serverTimezoneOffset: number; + var transform: string; + var transformOrigin: string; + var transformStyle: string; + var transition: string; + var transitionDelay: string; + var transitionDuration: string; + var transitionProperty: string; + var transitionTimingFunction: string; + export module device { + function isAndroid(): boolean; + function isIOS(): boolean; + function isFlat(): boolean; + function isIOS7(): boolean; + function isWindows(): boolean; + } + export module widget { + var autoInit: boolean; + var registeredInstances: Array; + var registeredWidgets: Array; + function register(pluginName: string, className: string, prototype: any): void; + function destroyAll(elements: Element): void; + function init(element: Element): void; + function registerInstance(element: Element, pluginName: string, className: string, prototype: any):void; + } + + interface browserInfoOptions { + name: string; + version: string; + culture: Object; + isMSPointerEnabled: boolean; + } + class WidgetBase { + destroy(): void; + element: JQuery; + setModel(options: Object, forceSet?: boolean):any; + option(prop?: Object, value?: Object, forceSet?: boolean): any; + persistState(): void; + restoreState(silent: boolean): void; + } + + class Widget extends WidgetBase { + constructor(pluginName: string, className: string, proto: any); + static fn: Widget; + static extend(widget: Widget): any; + register(pluginName: string, className: string, prototype: any): void; + destroyAll(elements: Element): void; + model: any; + } + + + interface BaseEvent { + cancel: boolean; + type: string; + } + class DataManager { + constructor(dataSource?: any, query?: ej.Query, adaptor?: any); + setDefaultQuery(query: ej.Query): void; + executeQuery(query?: ej.Query, done?: any, fail?: any, always?: any): JQueryPromise; + executeLocal(query?: ej.Query): ej.DataManager; + saveChanges(changes?: Changes, key?: string, tableName?: string): JQueryDeferred; + insert(data: Object, tableName: string): JQueryPromise; + remove(keyField: string, value: any, tableName: string): Object; + update(keyField: string, value: any, tableName: string): Object; + } + + class Query { + constructor(); + static fn: Query; + static extend(prototype: Object): Query; + key(field: string): ej.Query; + using(dataManager: ej.DataManager): ej.Query; + execute(dataManager: ej.DataManager, done: any, fail?: string, always?: string): any; + executeLocal(dataManager: ej.DataManager): ej.DataManager; + clone(): ej.Query; + from(tableName: any): ej.Query; + addParams(key: string, value: string): ej.Query; + expand(tables: any): ej.Query; + where(fieldName: string, operator: ej.FilterOperators, value: string, ignoreCase?: boolean): ej.Query; + where(predicate:ej.Predicate):ej.Query; + search(searchKey: any, fieldNames?: any, operator?: string, ignoreCase?: boolean): ej.Query; + sortBy(fieldName: string, comparer?: ej.SortOrder, isFromGroup?: boolean): ej.Query; + sortByDesc(fieldName: string): ej.Query; + group(fieldName: string): ej.Query; + page(pageIndex: number, pageSize: number): ej.Query; + take(nos: number): ej.Query; + skip(nos: number): ej.Query; + select(fieldNames: any): ej.Query; + hierarchy(query: ej.Query, selectorFn: any): ej.Query; + foreignKey(key: string): ej.Query; + requiresCount(): ej.Query; + range(start:number, end:number): ej.Query; + } + + class Adaptor { + constructor(ds: any); + pvt: Object; + type: ej.Adaptor; + options: AdaptorOptions; + extend(overrides: any): ej.Adaptor; + processQuery(dm: ej.DataManager, query: ej.Query):any; + processResponse(data: Object, ds: any, query: ej.Query, xhr: JQueryXHR, request?: Object, changes?: Changes): Object; + convertToQueryString(req: any, query: ej.Query, dm: ej.DataManager): JQueryParam; + } + + interface AdaptorOptions { + from?: string; + requestType?: string; + sortBy?: string; + select?: string; + skip?: string; + group?: string; + take?: string; + search?: string; + count?: string; + where?: string; + aggregates?: string; + } + + class UrlAdaptor extends ej.Adaptor { + constructor(); + processQuery(dm: ej.DataManager, query: ej.Query, hierarchyFilters?: Object): { + type: string; url: string; ejPvtData: Object; contentType?: string; data?: Object; + } + convertToQueryString(req: Object, query: ej.Query, dm: ej.DataManager): JQueryParam; + processResponse(data: Object, ds: any, query: ej.Query, xhr: JQueryXHR, request?: Object, changes?: Changes): Object; + onGroup(e: any): void; + batchRequest(dm: ej.DataManager, changes: Changes, e: any): void; + beforeSend(dm: ej.DataManager, request: any, settings?:any): void; + insert(dm: ej.DataManager, data: Object, tableName: string): { url: string; data: any }; + remove(dm: ej.DataManager, keyField: string, value: any, tableName: string): { type: string; url: string; data?: any }; + update(dm: ej.DataManager, keyField: string, value: any, tableName: string): { type: string; url: string; data: any }; + getFiltersFrom(data: Object, query: ej.Query): ej.Predicate; + } + + class ODataAdaptor extends ej.UrlAdaptor { + constructor(); + options: UrlAdaptorOptions; + onEachWhere(filter: any, requiresCast: boolean): any; + onPredicate(pred: ej.Predicate, query: ej.Query, requiresCast: boolean): string; + onComplexPredicate(pred: ej.Predicate, requiresCast: boolean): string; + onWhere(filters: Array): string; + onEachSearch(e: Object): void; + onSearch(e: Object): string; + onEachSort(e: Object): string; + onSortBy(e: Object): string; + onGroup(e: Object): string; + onSelect(e: Object): string; + onCount(e: Object): string; + beforeSend(dm: ej.DataManager, request: any, settings?: any): void; + processResponse(data: Object, ds: Object, query: ej.Query, xhr:any, request: any, changes: Changes): { + result: Object; count: number + }; + convertToQueryString(req: Object, query: ej.Query, dm: ej.DataManager): JQueryParam; + insert(dm: ej.DataManager, data: Object, tableName: string): { url: string; data: Object; } + remove(dm: ej.DataManager, keyField: string, value: any, tableName: string): { url: string; type: string; } + update(dm: ej.DataManager, keyField: string, value: any, tableName: string): { url: string; type: string; data: Object; accept: string; } + batchRequest(dm: ej.DataManager, changes: Changes, e: any): { url: string; type: string; data: Object; contentType: string; } + generateDeleteRequest(arr: Array, e: any): string; + generateInsertRequest(arr: Array, e: any): string; + generateUpdateRequest(arr: Array, e: any): string; + } + interface UrlAdaptorOptions { + requestType?: string; + accept?: string; + multipartAccept?: string; + sortBy?: string; + select?: string; + skip?: string; + take?: string; + count?: string; + where?: string; + expand?: string; + batch?: string; + changeSet?: string; + batchPre?: string; + contentId?: string; + batchContent?: string; + changeSetContent?: string; + batchChangeSetContentType?: string; + } + + class ODataV4Adaptor extends ej.ODataAdaptor { + constructor(); + options: ODataAdaptorOptions; + onCount(e: Object): string; + onEachSearch(e: Object): void; + onSearch(e: Object): string; + beforeSend(dm: ej.DataManager, request: any, settings?: any): void; + processResponse(data: Object, ds: Object, query: ej.Query, xhr:any, request: any, changes: Changes): { + result: Object; count: number + }; + + } + interface ODataAdaptorOptions { + requestType?: string; + accept?: string; + multipartAccept?: string; + sortBy?: string; + select?: string; + skip?: string; + take?: string; + count?: string; + search?: string; + where?: string; + expand?: string; + batch?: string; + changeSet?: string; + batchPre?: string; + contentId?: string; + batchContent?: string; + changeSetContent?: string; + batchChangeSetContentType?: string; + } + + class JsonAdaptor extends ej.Adaptor { + constructor(); + processQuery(ds: Object, query: ej.Query): string; + batchRequest(dm: ej.DataManager, changes: Changes, e:any): Changes; + onWhere(ds: Object, e: any): any; + onSearch(ds: Object, e: any): any + onSortBy(ds: Object, e: any, query: ej.Query): Object; + onGroup(ds: Object, e: any, query: ej.Query): Object; + onPage(ds: Object, e: any, query: ej.Query): Object; + onRange(ds: Object, e: any): Object; + onTake(ds: Object, e: any): Object; + onSkip(ds: Object, e: any): Object; + onSelect(ds: Object, e: any): Object; + insert(dm: ej.DataManager, data: any): Object; + remove(dm: ej.DataManager, keyField: string, value:any, tableName: string): Object; + update(dm: ej.DataManager, keyField: string, value:any, tableName: string): Object; + } + class TableModel { + constructor(name: string, jsonArray: Array, dataManager: ej.DataManager, modelComputed: any); + on(eventName: string, handler: any): void; + off(eventName: string, handler: any): void; + setDataManager(dataManager: DataManager): void; + saveChanges(): void; + rejectChanges(): void; + insert(json: any): void; + update(value: any): void; + remove(key: string): void; + isDirty(): boolean; + getChanges(): Changes; + toArray(): Array; + setDirty(dirty:any, model:any): void; + get(index: number): void; + length(): number; + bindTo(element: any): void; + } + class Model { + constructor(json: any, table: string, name: string); + formElements: Array; + computes(value: any): void; + on(eventName: string, handler: any): void; + off(eventName: string, handler: any): void; + set(field: string, value: any): void; + get(field: string): any; + revert(suspendEvent: any): void; + save(dm: ej.DataManager, key: string): void; + markCommit(): void; + markDelete(): void; + changeState(state: boolean, args: any): void; + properties(): any; + bindTo(element: any): void; + unbind(element: any): void; + } + interface Changes { + changed?: Array; + added?: Array; + deleted?: Array; + } + class Predicate { + constructor(field: string, operator: ej.FilterOperators, value: any, ignoreCase: boolean); + and(field: string, operator: any, value:any, ignoreCase:boolean): void; + or(field: string, operator: any, value: any, ignoreCase: boolean): void; + validate(record: Object): boolean; + toJSON(): { + isComplex: boolean; + field: string; + operator: string; + value: any; + ignoreCase: boolean; + condition: string; + predicates: any; + }; + } + interface dataUtil { + swap(array: Array, x: number, y: number): void; + mergeSort(jsonArray: Array, fieldName: string, comparer:any): Array; + max(jsonArray: Array, fieldName: string, comparer: string): Array; + min(jsonArray: Array, fieldName: string, comparer: string): Array; + distinct(jsonArray: Array, fieldName: string, requiresCompleteRecord:any): Array; + sum(json:any, fieldName: string): number; + avg(json:any, fieldName: string): number; + select(jsonArray: Array, fieldName: string, fields:string): Array; + group(jsonArray: Array, field: string, /* internal */ level: number): Array; + parseTable(table: string, headerOption: ej.headerOption, headerRowIndex: number): Object; + } + interface AjaxSettings { + type?: string; + cache: boolean; + data?: any; + dataType?: string; + contentType?: any; + async?: boolean; + } + enum FilterOperators { + contains, + endsWith, + equal, + greaterThan, + greaterThanOrEqual, + lessThan, + lessThanOrEqual, + notEqual, + startsWith + } + + enum MatrixDefaults { + m11, + m12, + m21, + m22, + offsetX, + offsetY, + type + } + enum MatrixTypes { + Identity, + Scaling, + Translation, + Unknown + } + + enum Orientation { + Horizontal, + Vertical + } + + enum SliderType { + Default, + MinRange, + Range + } + + enum eventType { + click, + mouseDown, + mouseLeave, + mouseMove, + mouseUp + } + enum headerOption { + row, + tHead + } + + enum filterType{ + StartsWith, + Contains, + EndsWith, + LessThan, + GreaterThan, + LessThanOrEqual , + GreaterThanOrEqual, + Equal, + NotEqual + } + enum Animation{ + Fade, + None, + Slide + } + enum Type{ + Overlay, + Slide + } +class Draggable extends ej.Widget { + static fn: Draggable; + constructor(element: JQuery, options?: DraggableOptions); + constructor(element: Element, options?: DraggableOptions); + model: DraggableOptions; +} + +interface DraggableOptions { + scope?: string; + handle?: Object; + dragArea?: Object; + clone?: boolean; + distance?: number; + helper?: any; + cursorAt?: DragAtPositon; + destroy? (e: DraggableEvent): void; + drag? (e: DraggableDragEvent): void; + dragStart? (e: DraggableDragStartEvent): void; + dragStop? (e: DraggableDragStopEvent): void; + +} + +interface DragAtPositon { + top?: number; + left?: number; +} + +interface DraggableEvent extends ej.BaseEvent { + model: DraggableOptions; +} +interface DraggableDragStartEvent extends ej.BaseEvent, DraggableEvent { + element: Object; + target: Object; +} +interface DraggableDragStopEvent extends ej.BaseEvent, DraggableEvent { + element: Object; + target: Object; +} +interface DraggableDragEvent extends ej.BaseEvent, DraggableEvent { + element: Object; + target: Object; +} +class Droppable extends ej.Widget { + static fn: Droppable; + constructor(element: JQuery, options?: DroppableOptions); + constructor(element: Element, options?: DroppableOptions); + model: DroppableOptions; +} + +interface DroppableOptions { + scope?: string; + accept?: Object; + drop? (e: DroppableDropEvent): void; + over? (e: DroppableOverEvent): void; + out? (e: DroppableOutEvent): void; +} + +interface DroppableEvent extends ej.BaseEvent { + model: DroppableOptions; +} +interface DroppableDropEvent extends ej.BaseEvent, DraggableEvent { + targetElement: Object; +} +interface DroppableOverEvent extends ej.BaseEvent, DraggableEvent { + targetElement: Object; +} +interface DroppableOutEvent extends ej.BaseEvent, DraggableEvent { + targetElement: Object; +} +class Resizable extends ej.Widget { + static fn: Resizable; + constructor(element: JQuery, options?: ResizableOptions); + constructor(element: Element, options?: ResizableOptions); + model: ResizableOptions; +} + +interface ResizableOptions { + scope?: string; + handle?: Object; + distance?: number; + cursorAt?: resizeAtPositon; + helper?: any; + maxHeight?: (number|string); + maxWidth?: (number|string); + minHeight?: (number|string); + minWidth?: (number|string); + destroy? (e: ResizeEvent): void; + resizeStart? (e: ResizableStartEvent): void; + resize? (e: ResizableEvent): void; + resizeStop? (e: ResizableStopEvent): void; +} + +interface resizeAtPositon { + top?: number; + left?: number; +} + +interface ResizeEvent extends ej.BaseEvent { + model: ResizableOptions; +} +interface ResizableStartEvent extends ej.BaseEvent, ResizeEvent { + targetElement: Object; +} +interface ResizableEvent extends ej.BaseEvent, ResizeEvent { + targetElement: Object; +} +interface ResizableStopEvent extends ej.BaseEvent, ResizeEvent { + targetElement: Object; +} + + var globalize:globalize; + var cultures:culture; + function addCulture(name: string, culture ?: any): void; + function preferredCulture(culture ?: string): culture; + function format(value: any, format: string, culture ?: string): string; + function parseInt(value: string, radix?: any, culture ?: string): number; + function parseFloat(value: string, radix?: any, culture ?: string): number; + function parseDate(value: string, format: string, culture ?: string): Date; + function getLocalizedConstants(controlName: string, culture ?: string): any; + +interface globalize { + addCulture(name: string, culture?: any): void; + preferredCulture(culture?: string): culture; + format(value: any, format: string, culture?: string): string; + parseInt(value: string, radix?: any, culture?: string): number; + parseFloat(value: string, radix?: any, culture?: string): number; + parseDate(value: string, format: string, culture?: string): Date; + getLocalizedConstants(controlName: string, culture?: string): any; + } + interface culture { + name?: string; + englishName?: string; + namtiveName?: string; + language?: string; + isRTL: boolean; + numberFormat?: formatSettings; + calendars?: calendarsSettings; + } + interface formatSettings { + pattern: Array; + decimals: number; + groupSizes: Array; + percent: percentSettings; + currency: currencySettings; + } + interface percentSettings { + pattern: Array; + decimals: number; + groupSizes: Array; + symbol: string; + } + interface currencySettings { + pattern: Array; + decimals: number; + groupSizes: Array; + symbol: string; + } + interface calendarsSettings { + standard: standardSettings; + } + interface standardSettings { + firstDay: number; + days: daySettings; + months: monthSettings; + AM: Array; + PM: Array; + twoDigitYearMax: number; + patterns: patternSettings; + } + interface daySettings { + names: Array; + namesAbbr: Array; + namesShort: Array; + } + interface monthSettings { + names: Array; + namesAbbr: Array; + } + interface patternSettings { + d: string; + D: string; + t: string; + T: string; + f: string; + F: string; + M: string; + Y: string; + S: string; + } +class Scroller extends ej.Widget { + static fn: Scroller; + constructor(element: JQuery, options?: Scroller.Model); + constructor(element: Element, options?: Scroller.Model); + model:Scroller.Model; + defaults:Scroller.Model; + + /** destroy the Scroller control, unbind the all ej control related events automatically and bring the control to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** User disables the Scroller control at any time. + * @returns {void} + */ + disable(): void; + + /** User enables the Scroller control at any time. + * @returns {void} + */ + enable(): void; + + /** Returns true if horizontal scrollbar is shown, else return false. + * @returns {boolean} + */ + isHScroll(): boolean; + + /** Returns true if vertical scrollbar is shown, else return false. + * @returns {boolean} + */ + isVScroll(): boolean; + + /** User refreshes the Scroller control at any time. + * @returns {void} + */ + refresh(): void; + + /** Scroller moves to given pixel in X (left) position. We can also specify the animation speed,in which the scroller has to move while re-positioning it. + * @returns {void} + */ + scrollX(): void; + + /** Scroller moves to given pixel in Y (top) position. We can also specify the animation speed,in which the scroller has to move while re-positioning it. + * @returns {void} + */ + scrollY(): void; +} +export module Scroller{ + +export interface Model { + + /**Set true to hides the scrollbar, when mouseout the content area. + * @Default {false} + */ + autoHide?: boolean; + + /**Specifies the height and width of button in the scrollbar. + * @Default {18} + */ + buttonSize?: number; + + /**Specifies to enable or disable the scroller + * @Default {true} + */ + enabled?: boolean; + + /**Save current model value to browser cookies for state maintenance. While refresh the page Rating control values are retained. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Indicates the Right to Left direction to scroller + * @Default {undefined} + */ + enableRTL?: boolean; + + /**Enables or Disable the touch Scroll + * @Default {true} + */ + enableTouchScroll?: boolean; + + /**Specifies the height of Scroll panel and scrollbars. + * @Default {250} + */ + height?: number; + + /**If the scrollbar has vertical it set as width, else it will set as height of the handler. + * @Default {18} + */ + scrollerSize?: number; + + /**The Scroller content and scrollbars move left with given value. + * @Default {0} + */ + scrollLeft?: number; + + /**While press on the arrow key the scrollbar position added to the given pixel value. + * @Default {57} + */ + scrollOneStepBy?: number; + + /**The Scroller content and scrollbars move to top position with specified value. + * @Default {0} + */ + scrollTop?: number; + + /**Indicates the target area to which scroller have to appear. + * @Default {null} + */ + targetPane?: string; + + /**Specifies the width of Scroll panel and scrollbars. + * @Default {0} + */ + width?: number; + + /**Fires when Scroller control is created.*/ + create? (e: CreateEventArgs): void; + + /**Fires when Scroller control is destroyed.*/ + destroy? (e: DestroyEventArgs): void; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the scroller model + */ + model?: ej.Scroller.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the scroller model + */ + model?: ej.Scroller.Model; + + /**returns the name of the event. + */ + type?: string; +} +} + +class Accordion extends ej.Widget { + static fn: Accordion; + constructor(element: JQuery, options?: Accordion.Model); + constructor(element: Element, options?: Accordion.Model); + model:Accordion.Model; + defaults:Accordion.Model; + + /** AddItem method is used to add the panel in dynamically. It receives the following parameters + * @param {string} specify the name of the header + * @param {string} content of the new panel + * @param {number} insertion place of the new panel + * @param {boolean} Enable or disable the ajax request to the added panel + * @returns {void} + */ + addItem(header_name: string, content: string, index: number, isAjaxReq: boolean): void; + + /** This method used to collapse the all the expanded items in accordion at a time. + * @returns {void} + */ + collapseAll(): void; + + /** destroy the Accordion widget all events bound using this._on will be unbind automatically and bring the control to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** Disables the accordion widget includes all the headers and content panels. + * @returns {void} + */ + disable(): void; + + /** Disable the accordion widget item based on specified header index. + * @param {Array} index values to disable the panels + * @returns {void} + */ + disableItems(index: Array): void; + + /** Enable the accordion widget includes all the headers and content panels. + * @returns {void} + */ + enable(): void; + + /** Enable the accordion widget item based on specified header index. + * @param {Array} index values to enable the panels + * @returns {void} + */ + enableItems(index: Array): void; + + /** To expand all the accordion widget items. + * @returns {void} + */ + expandAll(): void; + + /** Returns the total number of panels in the control. + * @returns {number} + */ + getItemsCount(): number; + + /** Hides the visible Accordion control. + * @returns {void} + */ + hide(): void; + + /** The refresh method is used to adjust the control size based on the parent element dimension. + * @returns {void} + */ + refresh(): void; + + /** RemoveItem method is used to remove the specified index panel.It receives the parameter as number. + * @param {number} specify the index value for remove the accordion panel. + * @returns {void} + */ + removeItem( index : number): void; + + /** Shows the hidden Accordion control. + * @returns {void} + */ + show(): void; +} +export module Accordion{ + +export interface Model { + + /**Specifies the ajaxSettings option to load the content to the accordion control. + * @Default {null} + */ + ajaxSettings?: AjaxSettings; + + /**Accordion headers can be expanded and collapsed on keyboard action. + * @Default {true} + */ + allowKeyboardNavigation?: boolean; + + /**To set the Accordion headers Collapse Speed. + * @Default {300} + */ + collapseSpeed?: number; + + /**Specifies the collapsible state of accordion control. + * @Default {false} + */ + collapsible?: boolean; + + /**Sets the root CSS class for Accordion theme, which is used customize. + */ + cssClass?: string; + + /**Allows you to set the custom header Icon. It accepts two key values “header”, ”selectedHeader”. + * @Default {{ header: e-collapse, selectedHeader: e-expand }} + */ + customIcon?: CustomIcon; + + /**Disables the specified indexed items in accordion. + * @Default {[]} + */ + disabledItems?: number[]; + + /**Specifies the animation behavior in accordion. + * @Default {true} + */ + enableAnimation?: boolean; + + /**With this enabled property, you can enable or disable the Accordion. + * @Default {true} + */ + enabled?: boolean; + + /**Used to enable the disabled items in accordion. + * @Default {[]} + */ + enabledItems?: number[]; + + /**Multiple content panels to activate at a time. + * @Default {false} + */ + enableMultipleOpen?: boolean; + + /**Save current model value to browser cookies for maintaining states. When refreshing the accordion control page, the model value is applied from browser cookies or HTML 5local storage. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Display headers and panel text from right-to-left. + * @Default {false} + */ + enableRTL?: boolean; + + /**The events API binds the action for activating the accordion header. Users can activate the header by using mouse actions such as mouse-over, mouse-up, mouse-down, and soon. + * @Default {click} + */ + events?: string; + + /**To set the Accordion headers Expand Speed. + * @Default {300} + */ + expandSpeed?: number; + + /**Sets the height for Accordion items header. + */ + headerSize?: number|string; + + /**Specifies height of the accordion. + * @Default {null} + */ + height?: number|string; + + /**Adjusts the content panel height based on the given option (content, auto, or fill). By default, the panel heights are adjusted based on the content. + * @Default {content} + */ + heightAdjustMode?: ej.Accordion.HeightAdjustMode|string; + + /**It allows to define the characteristics of the Accordion control. It will helps to extend the capability of an HTML element. + * @Default {{}} + */ + htmlAttributes?: any; + + /**The given index header will activate (open). If collapsible is set to true, and a negative value is given, then all headers are collapsed. Otherwise, the first panel isactivated. + * @Default {0} + */ + selectedItemIndex?: number|string; + + /**Activate the specified indexed items of the accordion + * @Default {[0]} + */ + selectedItems?: number[]; + + /**Used to determines the close button visibility an each accordion items. This close button helps to remove the accordion item from the control. + * @Default {false} + */ + showCloseButton?: boolean; + + /**Displays rounded corner borders on the Accordion control's panels and headers. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Specifies width of the accordion. + * @Default {null} + */ + width?: number|string; + + /**Triggered after a Accordion item is active or inactive. Argument values are activeIndex, activeHeader, inActiveHeader, inActiveIndex and current model value.*/ + activate? (e: ActivateEventArgs): void; + + /**Triggered before the AJAX content is loaded in a content panel. Arguments have location of the content (URL) and current model value.*/ + ajaxBeforeLoad? (e: AjaxBeforeLoadEventArgs): void; + + /**Triggered after AJAX load failed action. Arguments have URL, error message, and current model value.*/ + ajaxError? (e: AjaxErrorEventArgs): void; + + /**Triggered after the AJAX content loads. Arguments have current model values.*/ + ajaxLoad? (e: AjaxLoadEventArgs): void; + + /**Triggered after AJAX success action. Arguments have URL, content, and current model values.*/ + ajaxSuccess? (e: AjaxSuccessEventArgs): void; + + /**Triggered before a tab item is active. Arguments have active index and model values.*/ + beforeActivate? (e: BeforeActivateEventArgs): void; + + /**Triggered after a Accordion item is active or inactive. Argument values are activeIndex, activeHeader, inActiveHeader, inActiveIndex and current model value.*/ + beforeInactivate? (e: BeforeInactivateEventArgs): void; + + /**Triggered after Accordion control creation.*/ + create? (e: CreateEventArgs): void; + + /**Triggered after Accordion control destroy.*/ + destroy? (e: DestroyEventArgs): void; + + /**Triggered after a Accordion item is active or inactive. Argument values are activeIndex, activeHeader, inActiveHeader, inActiveIndex and current model value.*/ + inActivate? (e: InActivateEventArgs): void; +} + +export interface ActivateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the accordion model + */ + model ?: ej.Accordion.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns active index + */ + activeIndex ?: number; + + /**returns current active header + */ + activeHeader ?: any; + + /**returns true when the Accordion index activated by user interaction otherwise returns false + */ + isInteraction ?: boolean; +} + +export interface AjaxBeforeLoadEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the accordion model + */ + model ?: ej.Accordion.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns current ajax content location + */ + url ?: string; +} + +export interface AjaxErrorEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the accordion model + */ + model ?: ej.Accordion.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns current ajax content location + */ + url ?: string; + + /**returns the failed data sent. + */ + data ?: string; +} + +export interface AjaxLoadEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the accordion model + */ + model ?: ej.Accordion.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the name of the url + */ + url ?: string; +} + +export interface AjaxSuccessEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the accordion model + */ + model ?: ej.Accordion.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns current ajax content location + */ + url ?: string; + + /**returns the successful data sent. + */ + data ?: string; + + /**returns the ajax content. + */ + content ?: string; +} + +export interface BeforeActivateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the accordion model + */ + model ?: ej.Accordion.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns active index + */ + activeIndex ?: number; + + /**returns true when the Accordion index activated by user interaction otherwise returns false + */ + isInteraction ?: boolean; +} + +export interface BeforeInactivateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the accordion model + */ + model ?: ej.Accordion.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns active index + */ + inActiveIndex ?: number; + + /**returns true when the Accordion index activated by user interaction otherwise returns false + */ + isInteraction ?: boolean; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the accordion model + */ + model ?: ej.Accordion.Model; + + /**returns the name of the event + */ + type ?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the accordion model + */ + model ?: ej.Accordion.Model; + + /**returns the name of the event + */ + type ?: string; +} + +export interface InActivateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the accordion model + */ + model ?: ej.Accordion.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns active index + */ + inActiveIndex ?: number; + + /**returns in active element + */ + inActiveHeader ?: any; + + /**returns true when the Accordion index activated by user interaction otherwise returns false + */ + isInteraction ?: boolean; +} + +export interface AjaxSettings { + + /**It specifies, whether to enable or disable asynchronous request. + */ + async?: boolean; + + /**It specifies the page will be cached in the web browser. + */ + cache?: boolean; + + /**It specifies the type of data is send in the query string. + */ + contentType?: string; + + /**It specifies the data as an object, will be passed in the query string. + */ + data?: any; + + /**It specifies the type of data that you're expecting back from the response. + */ + dataType?: string; + + /**It specifies the HTTP request type. + */ + type?: string; +} + +export interface CustomIcon { + + /**This class name set to collapsing header. + */ + header?: string; + + /**This class name set to expanded (active) header. + */ + selectedHeader?: string; +} + +enum HeightAdjustMode{ + + ///Height fit to the content in the panel + Content, + + ///Height set to the largest content in the panel + Auto, + + ///Height filled to the content of the panel + Fill +} + +} + +class Autocomplete extends ej.Widget { + static fn: Autocomplete; + constructor(element: JQuery, options?: Autocomplete.Model); + constructor(element: Element, options?: Autocomplete.Model); + model:Autocomplete.Model; + defaults:Autocomplete.Model; + + /** Clears the text in the Autocomplete textbox. + * @returns {void} + */ + clearText(): void; + + /** Destroys the Autocomplete widget. + * @returns {void} + */ + destroy(): void; + + /** Disables the autocomplete widget. + * @returns {void} + */ + disable(): void; + + /** Enables the autocomplete widget. + * @returns {void} + */ + enable(): void; + + /** Returns objects (data object) of all the selected items in the autocomplete textbox. + * @returns {void} + */ + getSelectedItems(): void; + + /** Returns the current selected value from the Autocomplete textbox. + * @returns {void} + */ + getValue(): void; + + /** Search the entered text and show it in the suggestion list if available. + * @returns {void} + */ + search(): void; + + /** Open up the autocomplete suggestion popup with all list items. + * @returns {void} + */ + open(): void; + + /** Sets the value of the Autocomplete textbox based on the given key value. + * @param {string} The key value of the specific suggestion item. + * @returns {void} + */ + selectValueByKey(Key: string): void; + + /** Sets the value of the Autocomplete textbox based on the given input text value. + * @param {string} The text (label) value of the specific suggestion item. + * @returns {void} + */ + selectValueByText(Text: string): void; +} +export module Autocomplete{ + +export interface Model { + + /**Customize "Add New" text (label) to be added in the autocomplete popup list for the entered text when there are no suggestions for it. + * @Default {Add New} + */ + addNewText?: boolean; + + /**Allows new values to be added to the autocomplete input other than the values in the suggestion list. Normally, when there are no suggestions it will display “No suggestions” label in the popup. + * @Default {false} + */ + allowAddNew?: boolean; + + /**Enables or disables the sorting of suggestion list item. The default sort order is ascending order. You customize sort order. + * @Default {true} + */ + allowSorting?: boolean; + + /**To focus the items in the suggestion list when the popup is shown. By default first item will be focused. + * @Default {false} + */ + autoFocus?: boolean; + + /**Enables or disables the case sensitive search. + * @Default {false} + */ + caseSensitiveSearch?: boolean; + + /**The root class for the Autocomplete textbox widget which helps in customizing its theme. + * @Default {””} + */ + cssClass?: string; + + /**The data source contains the list of data for the suggestions list. It can be a string array or json array. + * @Default {null} + */ + dataSource?: any|Array; + + /**The time delay (in milliseconds) after which the suggestion popup will be shown. + * @Default {200} + */ + delaySuggestionTimeout?: number; + + /**The special character which acts as a separator for the given words for multi-mode search i.e. the text after the delimiter are considered as a separate word or query for search operation. + * @Default {’,’} + */ + delimiterChar?: string; + + /**The text to be displayed in the popup when there are no suggestions available for the entered text. + * @Default {“No suggestions”} + */ + emptyResultText?: string; + + /**Fills the autocomplete textbox with the first matched item from the suggestion list automatically based on the entered text when enabled. + * @Default {false} + */ + enableAutoFill?: boolean; + + /**Enables or disables the Autocomplete textbox widget. + * @Default {true} + */ + enabled?: boolean; + + /**Enables or disables displaying the duplicate names present in the search result. + * @Default {false} + */ + enableDistinct?: boolean; + + /**Allows the current model values to be saved in local storage or browser cookies for state maintenance when it is set to true. While refreshing the page, it retains the model value from browser cookies or local storage. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Displays the Autocomplete widget’s content from right to left when enabled. + * @Default {false} + */ + enableRTL?: boolean; + + /**Mapping fields for the suggestion items of the Autocomplete textbox widget. + * @Default {null} + */ + fields?: any; + + /**Specifies the search filter type. There are several types of search filter available such as ‘startswith’, ‘contains’, ‘endswith’, ‘lessthan’, ‘lessthanorequal’, ‘greaterthan’, ‘greaterthanorequal’, ‘equal’, ‘notequal’. + * @Default {ej.filterType.StartsWith} + */ + filterType?: string; + + /**The height of the Autocomplete textbox. + * @Default {null} + */ + height?: string; + + /**The search text can be highlighted in the AutoComplete suggestion list when enabled. + * @Default {false} + */ + highlightSearch?: boolean; + + /**Number of items to be displayed in the suggestion list. + * @Default {0} + */ + itemsCount?: number; + + /**Minimum number of character to be entered in the Autocomplete textbox to show the suggestion list. + * @Default {1} + */ + minCharacter?: number; + + /**Enables or disables selecting multiple values from the suggestion list. Multiple values can be selected through either of the following options, + * @Default {ej.MultiSelectMode.None} + */ + multiSelectMode?: ej.Autocomplete.MultiSelectMode|string; + + /**The height of the suggestion list. + * @Default {“152px”} + */ + popupHeight?: string; + + /**The width of the suggestion list. + * @Default {“auto”} + */ + popupWidth?: string; + + /**The query to retrieve the data from the data source. + * @Default {null} + */ + query?: ej.Query|string; + + /**Indicates that the autocomplete textbox values can only be readable. + * @Default {false} + */ + readOnly?: boolean; + + /**Enables or disables showing the message when there are no suggestions for the entered text. + * @Default {true} + */ + showEmptyResultText?: boolean; + + /**Enables or disables the loading icon to intimate the searching operation. The loading icon is visible when there is a time delay to perform the search. + * @Default {true} + */ + showLoadingIcon?: boolean; + + /**Enables the showPopup button in autocomplete textbox. When the Showpopup button is clicked, it displays all the available data from the data source. + * @Default {false} + */ + showPopupButton?: boolean; + + /**Enables or disables rounded corner. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Sort order specifies whether the suggestion list values has to be displayed in ascending or descending order. + * @Default {ej.SortOrder.Ascending} + */ + sortOrder?: ej.Autocomplete.SortOrder|string; + + /**The template to display the suggestion list items with customized appearance. + * @Default {null} + */ + template?: string; + + /**The jQuery validation error message to be displayed on form validation. + * @Default {null} + */ + validationMessage?: any; + + /**The jQuery validation rules for form validation. + * @Default {null} + */ + validationRules?: any; + + /**The value to be displayed in the autocomplete textbox. + * @Default {null} + */ + value?: string; + + /**Enables or disables the visibility of the autocomplete textbox. + * @Default {true} + */ + visible?: boolean; + + /**The text to be displayed when the value of the autocomplete textbox is empty. + * @Default {null} + */ + watermarkText?: string; + + /**The width of the Autocomplete textbox. + * @Default {null} + */ + width?: string; + + /**Triggers when the data requested from AJAX will get successfully loaded in the Autocomplete widget.*/ + actionSuccess? (e: ActionSuccessEventArgs): void; + + /**Triggers when the AJAX requests complete. The request may get failed or succeed.*/ + actionComplete? (e: ActionCompleteEventArgs): void; + + /**Triggers when the data requested from AJAX get failed.*/ + actionFailure? (e: ActionFailureEventArgs): void; + + /**Triggers when the text box value is changed.*/ + change? (e: ChangeEventArgs): void; + + /**Triggers after the suggestion popup is closed.*/ + close? (e: CloseEventArgs): void; + + /**Triggers when Autocomplete widget is created.*/ + create? (e: CreateEventArgs): void; + + /**Triggers after the Autocomplete widget is destroyed.*/ + destroy? (e: DestroyEventArgs): void; + + /**Triggers after the autocomplete textbox is focused.*/ + focusIn? (e: FocusInEventArgs): void; + + /**Triggers after the Autocomplete textbox gets out of the focus.*/ + focusOut? (e: FocusOutEventArgs): void; + + /**Triggers after the suggestion list is opened.*/ + open? (e: OpenEventArgs): void; + + /**Triggers when an item has been selected from the suggestion list.*/ + select? (e: SelectEventArgs): void; +} + +export interface ActionSuccessEventArgs { +} + +export interface ActionCompleteEventArgs { +} + +export interface ActionFailureEventArgs { +} + +export interface ChangeEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the autocomplete model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; + + /**Value of the autocomplete textbox. + */ + value?: string; +} + +export interface CloseEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the autocomplete model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; +} + +export interface CreateEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the autocomplete model object. + */ + model?: ej.Autocomplete.Model; + + /**Name of the event. + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the autocomplete model object. + */ + model?: ej.Autocomplete.Model; + + /**Name of the event. + */ + type?: string; +} + +export interface FocusInEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the autocomplete model object. + */ + model?: ej.Autocomplete.Model; + + /**Name of the event. + */ + type?: string; + + /**Value of the autocomplete textbox. + */ + value?: string; +} + +export interface FocusOutEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the autocomplete model object. + */ + model?: ej.Autocomplete.Model; + + /**Name of the event. + */ + type?: string; + + /**Value of the autocomplete textbox. + */ + value?: string; +} + +export interface OpenEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the autocomplete model object. + */ + model?: ej.Autocomplete.Model; + + /**Name of the event. + */ + type?: string; +} + +export interface SelectEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the autocomplete model object. + */ + model?: ej.Autocomplete.Model; + + /**Name of the event. + */ + type?: string; + + /**Value of the autocomplete textbox. + */ + value?: string; + + /**Text of the selected item. + */ + text?: string; + + /**Key of the selected item. + */ + key?: string; + + /**Data object of the selected item. + */ + Item?: ej.Autocomplete.Model; +} + +enum MultiSelectMode{ + + ///Multiple values are separated using a given special character. + Delimiter, + + ///Each values are displayed in separate box with close button. + VisualMode +} + + +enum SortOrder{ + + ///Items to be displayed in the suggestion list in ascending order. + Ascending, + + ///Items to be displayed in the suggestion list in descending order. + Descending +} + +} + +class Button extends ej.Widget { + static fn: Button; + constructor(element: JQuery, options?: Button.Model); + constructor(element: Element, options?: Button.Model); + model:Button.Model; + defaults:Button.Model; + + /** destroy the button widget all events bound using this._on will be unbind automatically and bring the control to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** To disable the button + * @returns {void} + */ + disable(): void; + + /** To enable the button + * @returns {void} + */ + enable(): void; +} +export module Button{ + +export interface Model { + + /**Specifies the contentType of the Button. See below to know available ContentType + * @Default {ej.ContentType.TextOnly} + */ + contentType?: ej.ContentType|string; + + /**Sets the root CSS class for Button theme, which is used customize. + */ + cssClass?: string; + + /**Specifies the button control state. + * @Default {true} + */ + enabled?: boolean; + + /**Specify the Right to Left direction to button + * @Default {false} + */ + enableRTL?: boolean; + + /**Specifies the height of the Button. + * @Default {28} + */ + height?: number; + + /**It allows to define the characteristics of the Button control. It will helps to extend the capability of an HTML element. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Specifies the image position of the Button. This image position is applicable only with the textandimage contentType property. The images can be positioned in both imageLeft and imageRight options. See below to know about available ImagePosition + * @Default {ej.ImagePosition.ImageLeft} + */ + imagePosition?: ej.ImagePosition|string; + + /**Specifies the primary icon for Button. This icon will be displayed from the left margin of the button. + * @Default {null} + */ + prefixIcon?: string; + + /**Convert the button as repeat button. It raises the 'Click' event repeatedly from the it is pressed until it is released. + * @Default {false} + */ + repeatButton?: boolean; + + /**Displays the Button with rounded corners. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Specifies the size of the Button. See below to know available ButtonSize + * @Default {ej.ButtonSize.Normal} + */ + size?: ej.ButtonSize|string; + + /**Specifies the secondary icon for Button. This icon will be displayed from the right margin of the button. + * @Default {null} + */ + suffixIcon?: string; + + /**Specifies the text content for Button. + * @Default {null} + */ + text?: string; + + /**Specified the time interval between two consecutive 'click' event on the button. + * @Default {150} + */ + timeInterval?: string; + + /**Specifies the Type of the Button. See below to know available ButtonType + * @Default {ej.ButtonType.Submit} + */ + type?: ej.ButtonType|string; + + /**Specifies the width of the Button. + * @Default {100} + */ + width?: number; + + /**Fires when Button control is clicked successfully.Consider the scenario to perform any validation,modification of content or any other operations click on button,we can make use of this click event to achieve the scenario.*/ + click? (e: ClickEventArgs): void; + + /**Fires after Button control is created.If the user want to perform any operation after the button control creation then the user can make use of this create event.*/ + create? (e: CreateEventArgs): void; + + /**Fires when the button is destroyed successfully.If the user want to perform any operation after the destroy button control then the user can make use of this destroy event.*/ + destroy? (e: DestroyEventArgs): void; +} + +export interface ClickEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the button model + */ + model?: ej.Button.Model; + + /**returns the name of the event + */ + type?: string; + + /**return the button state + */ + status?: boolean; + + /**return the event model for sever side processing. + */ + e?: any; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the button model + */ + model?: ej.Button.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the button model + */ + model?: ej.Button.Model; + + /**returns the name of the event + */ + type?: string; +} +} +enum ContentType +{ +//To display the text content only in button +TextOnly, +//To display the image only in button +ImageOnly, +//Supports to display image for both ends of the button +ImageBoth, +//Supports to display image with the text content +TextAndImage, +//Supports to display image with both ends of the text +ImageTextImage, +} +enum ImagePosition +{ +//support for aligning text in left and image in right +ImageRight, +//support for aligning text in right and image in left +ImageLeft, +//support for aligning text in bottom and image in top. +ImageTop, +//support for aligning text in top and image in bottom +ImageBottom, +} +enum ButtonSize +{ +//Creates button with inbuilt default size height, width specified +Normal, +//Creates button with inbuilt mini size height, width specified +Mini, +//Creates button with inbuilt small size height, width specified +Small, +//Creates button with inbuilt medium size height, width specified +Medium, +//Creates button with inbuilt large size height, width specified +Large, +} +enum ButtonType +{ +//Creates button with inbuilt button type specified +Button, +//Creates button with inbuilt reset type specified +Reset, +//Creates button with inbuilt submit type specified +Submit, +} + +class Captcha extends ej.Widget { + static fn: Captcha; + constructor(element: JQuery, options?: Captcha.Model); + constructor(element: Element, options?: Captcha.Model); + model:Captcha.Model; + defaults:Captcha.Model; +} +export module Captcha{ + +export interface Model { + + /**Specifies the character set of the Captcha that will be used to generate captcha text randomly. + */ + characterSet?: string; + + /**Specifies the error message to be displayed when the Captcha mismatch. + */ + customErrorMessage?: string; + + /**Set the Captcha validation automatically. + */ + enableAutoValidation?: boolean; + + /**Specifies the case sensitivity for the characters typed in the Captcha. + */ + enableCaseSensitivity?: boolean; + + /**Specifies the background patterns for the Captcha. + */ + enablePattern?: boolean; + + /**Sets the Captcha direction as right to left alignment. + */ + enableRTL?: boolean; + + /**Specifies the background apperance for the captcha. + */ + hatchStyle?: ej.HatchStyle|string; + + /**Specifies the height of the Captcha. + */ + height?: number; + + /**Specifies the method with values to be mapped in the Captcha. + */ + mapper?: string; + + /**Specifies the maximum number of characters used in the Captcha. + */ + maximumLength?: number; + + /**Specifies the minimum number of characters used in the Captcha. + */ + minimumLength?: number; + + /**Specifies the method to map values to Captcha. + */ + requestMapper?: string; + + /**Sets the Captcha with audio support, that enables to dictate the captcha text. + */ + showAudioButton?: boolean; + + /**Sets the Captcha with a refresh button. + */ + showRefreshButton?: boolean; + + /**Specifies the target button of the Captcha to validate the entered text and captcha text. + */ + targetButton?: string; + + /**Specifies the target input element that will verify the Captcha. + */ + targetInput?: string; + + /**Specifies the width of the Captcha. + */ + width?: number; + + /**Fires when captch refresh begins.*/ + refreshBegin? (e: RefreshBeginEventArgs): void; + + /**Fires after captch refresh completed.*/ + refreshComplete? (e: RefreshCompleteEventArgs): void; + + /**Fires when captch refresh fails to load.*/ + refreshFailure? (e: RefreshFailureEventArgs): void; + + /**Fires after captch refresh succeeded.*/ + refreshSuccess? (e: RefreshSuccessEventArgs): void; +} + +export interface RefreshBeginEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Captcha model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface RefreshCompleteEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Captcha model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface RefreshFailureEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Captcha model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface RefreshSuccessEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Captcha model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} +} +enum HatchStyle +{ +//Set background as None to Captcha +None, +//Set background as BackwardDiagonal to Captcha +BackwardDiagonal, +//Set background as Cross to Captcha +Cross, +//Set background as DarkDownwardDiagonal to Captcha +DarkDownwardDiagonal, +//Set background as DarkHorizontal to Captcha +DarkHorizontal, +//Set background as DarkUpwardDiagonal to Captcha +DarkUpwardDiagonal, +//Set background as DarkVertical to Captcha +DarkVertical, +//Set background as DashedDownwardDiagonal to Captcha +DashedDownwardDiagonal, +//Set background as DashedHorizontal to Captcha +DashedHorizontal, +//Set background as DashedUpwardDiagonal to Captcha +DashedUpwardDiagonal, +//Set background as DashedVertical to Captcha +DashedVertical, +//Set background as DiagonalBrick to Captcha +DiagonalBrick, +//Set background as DiagonalCross to Captcha +DiagonalCross, +//Set background as Divot to Captcha +Divot, +//Set background as DottedDiamond to Captcha +DottedDiamond, +//Set background as DottedGrid to Captcha +DottedGrid, +//Set background as ForwardDiagonal to Captcha +ForwardDiagonal, +//Set background as Horizontal to Captcha +Horizontal, +//Set background as HorizontalBrick to Captcha +HorizontalBrick, +//Set background as LargeCheckerBoard to Captcha +LargeCheckerBoard, +//Set background as LargeConfetti to Captcha +LargeConfetti, +//Set background as LargeGrid to Captcha +LargeGrid, +//Set background as LightDownwardDiagonal to Captcha +LightDownwardDiagonal, +//Set background as LightHorizontal to Captcha +LightHorizontal, +//Set background as LightUpwardDiagonal to Captcha +LightUpwardDiagonal, +//Set background as LightVertical to Captcha +LightVertical, +//Set background as Max to Captcha +Max, +//Set background as Min to Captcha +Min, +//Set background as NarrowHorizontal to Captcha +NarrowHorizontal, +//Set background as NarrowVertical to Captcha +NarrowVertical, +//Set background as OutlinedDiamond to Captcha +OutlinedDiamond, +//Set background as Percent90 to Captcha +Percent90, +//Set background as Wave to Captcha +Wave, +//Set background as Weave to Captcha +Weave, +//Set background as WideDownwardDiagonal to Captcha +WideDownwardDiagonal, +//Set background as WideUpwardDiagonal to Captcha +WideUpwardDiagonal, +//Set background as ZigZag to Captcha +ZigZag, +} + +class ListBox extends ej.Widget { + static fn: ListBox; + constructor(element: JQuery, options?: ListBox.Model); + constructor(element: Element, options?: ListBox.Model); + model:ListBox.Model; + defaults:ListBox.Model; + + /** Adds a given list items in the ListBox widget at a specified index. It accepts two parameters. + * @param {any|string} This can be a list item object (for JSON binding) or a string (for UL and LI rendering). Also we can the specify this as an array of list item object or an array of strings to add multiple items. + * @param {number} The index value to add the given items at the specified index. If index is not specified, the given items will be added at the end of the list. + * @returns {void} + */ + addItem(listItem: any|string, index: number): void; + + /** Checks all the list items in the ListBox widget. It is dependent on showCheckbox property. + * @returns {void} + */ + checkAll(): void; + + /** Checks a list item by using its index. It is dependent on showCheckbox property. + * @param {number} Index of the listbox item to be checked. If index is not specified, the given items will be added at the end of the list. + * @returns {void} + */ + checkItemByIndex(index: number): void; + + /** Checks multiple list items by using its index values. It is dependent on showCheckbox property. + * @param {number[]} Index/Indices of the listbox items to be checked. If index is not specified, the given items will be added at the end of the list. + * @returns {void} + */ + checkItemsByIndices(indices: number[]): void; + + /** Disables the ListBox widget. + * @returns {void} + */ + disable(): void; + + /** Disables a list item by passing the item text as parameter. + * @param {string} Text of the listbox item to be disabled. + * @returns {void} + */ + disableItem(text: string): void; + + /** Disables a list Item using its index value. + * @param {number} Index of the listbox item to be disabled. + * @returns {void} + */ + disableItemByIndex(index: number): void; + + /** Disables set of list Items using its index values. + * @param {number[]|string} Indices of the listbox items to be disabled. + * @returns {void} + */ + disableItemsByIndices(Indices: number[]|string): void; + + /** Enables the ListBox widget when it is disabled. + * @returns {void} + */ + enable(): void; + + /** Enables a list Item using its item text value. + * @param {string} Text of the listbox item to be enabled. + * @returns {void} + */ + enableItem(text: string): void; + + /** Enables a list item using its index value. + * @param {number} Index of the listbox item to be enabled. + * @returns {void} + */ + enableItemByIndex(index: number): void; + + /** Enables a set of list Items using its index values. + * @param {number[]|string} Indices of the listbox items to be enabled. + * @returns {void} + */ + enableItemsByIndices(indices: number[]|string): void; + + /** Returns the list of checked items in the ListBox widget. It is dependent on showCheckbox property. + * @returns {any} + */ + getCheckedItems(): any; + + /** Returns the list of selected items in the ListBox widget. + * @returns {any} + */ + getSelectedItems(): any; + + /** Returns an item’s index based on the given text. + * @param {string} The list item text (label) + * @returns {number} + */ + getIndexByText(text: string): number; + + /** Returns an item’s index based on the value given. + * @param {string} The list item’s value + * @returns {number} + */ + getIndexByValue(indices: string): number; + + /** Returns an item’s text (label) based on the index given. + * @returns {string} + */ + getTextByIndex(): string; + + /** Returns a list item’s object using its index. + * @returns {any} + */ + getItemByIndex(): any; + + /** Returns a list item’s object based on the text given. + * @param {string} The list item text. + * @returns {any} + */ + getItemByText(text: string): any; + + /** Merges the given data with the existing data items in the listbox. + * @param {Array} Data to merge in listbox. + * @returns {void} + */ + mergeData(data: Array): void; + + /** Selects the next item based on the current selection. + * @returns {void} + */ + moveDown(): void; + + /** Selects the previous item based on the current selection. + * @returns {void} + */ + moveUp(): void; + + /** Refreshes the ListBox widget. + * @param {boolean} Refreshes both the datasource and the dimensions of the ListBox widget when the parameter is passed as true, otherwise only the ListBox dimensions will be refreshed. + * @returns {void} + */ + refresh(refreshData: boolean): void; + + /** Removes all the list items from listbox. + * @returns {void} + */ + removeAll(): void; + + /** Removes the selected list items from the listbox. + * @returns {void} + */ + removeSelectedItems(): void; + + /** Removes a list item by using its text. + * @param {string} Text of the listbox item to be removed. + * @returns {void} + */ + removeItemByText(text: string): void; + + /** Removes a list item by using its index value. + * @param {number} Index of the listbox item to be removed. + * @returns {void} + */ + removeItemByIndex(index: number): void; + + /** + * @returns {void} + */ + selectAll(): void; + + /** Selects the list tem using its text value. + * @param {string} Text of the listbox item to be selected. + * @returns {void} + */ + selectItemByText(text: string): void; + + /** Selects list tem using its value property. + * @param {string} Value of the listbox item to be selected. + * @returns {void} + */ + selectItemByValue(value: string): void; + + /** Selects list item using its index value. + * @param {number} Index of the listbox item to be selected. + * @returns {void} + */ + selectItemByIndex(index: number): void; + + /** Selects a set of list items through its index values. + * @param {number|number[]} Index/Indices of the listbox item to be selected. + * @returns {void} + */ + selectItemsByIndices(Indices: number|number[]): void; + + /** Unchecks all the checked list items in the ListBox widget. To use this method showCheckbox property to be set as true. + * @returns {void} + */ + uncheckAll(): void; + + /** Unchecks a checked list item using its index value. To use this method showCheckbox property to be set as true. + * @param {number} Index of the listbox item to be unchecked. + * @returns {void} + */ + uncheckItemByIndex(index: number): void; + + /** Unchecks the set of checked list items using its index values. To use this method showCheckbox property must be set to true. + * @param {number[]|string} Indices of the listbox item to be unchecked. + * @returns {void} + */ + uncheckItemsByIndices(indices: number[]|string): void; + + /** + * @returns {void} + */ + unselectAll(): void; + + /** Unselects a selected list item using its index value + * @param {number} Index of the listbox item to be unselected. + * @returns {void} + */ + unselectItemByIndex(index: number): void; + + /** Unselects a selected list item using its text value. + * @param {string} Text of the listbox item to be unselected. + * @returns {void} + */ + unselectItemByText(text: string): void; + + /** Unselects a selected list item using its value. + * @param {string} Value of the listbox item to be unselected. + * @returns {void} + */ + unselectItemByValue(value: string): void; + + /** Unselects a set of list items using its index values. + * @param {number[]|string} Indices of the listbox item to be unselected. + * @returns {void} + */ + unselectItemsByIndices(indices: number[]|string): void; + + /** Hides all the checked items in the listbox. + * @returns {void} + */ + hideCheckedItems (): void; + + /** Shows a set of hidden list Items using its index values. + * @param {number[]|string} Indices of the listbox items to be shown. + * @returns {void} + */ + showItemByIndices(indices: number[]|string): void; + + /** Hides a set of list Items using its index values. + * @param {number[]|string} Indices of the listbox items to be hidden. + * @returns {void} + */ + hideItemsByIndices(indices: number[]|string): void; + + /** Shows the hidden list items using its values. + * @param {Array} Values of the listbox items to be shown. + * @returns {void} + */ + showItemsByValues(values: Array): void; + + /** Hides the list item using its values. + * @param {Array} Values of the listbox items to be hidden. + * @returns {void} + */ + hideItemsByValues(values: Array): void; + + /** Shows a hidden list item using its value. + * @param {string} Value of the listbox item to be shown. + * @returns {void} + */ + showItemByValue(value: string): void; + + /** Hide a list item using its value. + * @param {string} Value of the listbox item to be hidden. + * @returns {void} + */ + hideItemByValue(value: string): void; + + /** Shows a hidden list item using its index value. + * @param {number} Index of the listbox item to be shown. + * @returns {void} + */ + showItemByIndex(index: number): void; + + /** Hides a list item using its index value. + * @param {number} Index of the listbox item to be hidden. + * @returns {void} + */ + hideItemByIndex (index: number): void; + + /** + * @returns {void} + */ + show(): void; + + /** Hides the listbox. + * @returns {void} + */ + hide(): void; + + /** Hides all the listbox items in the listbox. + * @returns {void} + */ + hideAllItems(): void; + + /** Shows all the listbox items in the listbox. + * @returns {void} + */ + showAllItems(): void; +} +export module ListBox{ + +export interface Model { + + /**Enables/disables the dragging behavior of the items in ListBox widget. + * @Default {false} + */ + allowDrag?: boolean; + + /**Accepts the items which are dropped in to it, when it is set to true. + * @Default {false} + */ + allowDrop?: boolean; + + /**Enables or disables multiple selection. + * @Default {false} + */ + allowMultiSelection?: boolean; + + /**Loads the list data on demand via scrolling behavior to improve the application’s performance. There are two ways to load data which can be defined using “virtualScrollMode” property. + * @Default {false} + */ + allowVirtualScrolling?: boolean; + + /**Enables or disables the case sensitive search for list item by typing the text (search) value. + * @Default {false} + */ + caseSensitiveSearch?: boolean; + + /**Dynamically populate data of a list box while selecting an item in another list box i.e. rendering child list box based on the item selection in parent list box. This property accepts the id of the child ListBox widget to populate the data. + * @Default {null} + */ + cascadeTo?: string; + + /**Set of list items to be checked by default using its index. It works only when the showCheckbox property is set to true. + * @Default {null} + */ + checkedIndices?: string; + + /**The root class for the ListBox widget to customize the existing theme. + * @Default {“”} + */ + cssClass?: string; + + /**Contains the list of data for generating the list items. + * @Default {null} + */ + dataSource?: any; + + /**Enables or disables the ListBox widget. + * @Default {true} + */ + enabled?: boolean; + + /**Enables or disables the search behavior to find the specific list item by typing the text value. + * @Default {false} + */ + enableIncrementalSearch?: boolean; + + /**Allows the current model values to be saved in local storage or browser cookies for state maintenance when it is set to true. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Displays the ListBox widget’s content from right to left when enabled. + * @Default {false} + */ + enableRTL?: boolean; + + /**Mapping fields for the data items of the ListBox widget. + * @Default {null} + */ + fields?: any; + + /**Defines the height of the ListBox widget. + * @Default {null} + */ + height?: string; + + /**The number of list items to be shown in the ListBox widget. The remaining list items will be scrollable. + * @Default {null} + */ + itemsCount?: number; + + /**The total number of list items to be rendered in the ListBox widget. + * @Default {null} + */ + totalItemsCount?: number; + + /**The number of list items to be loaded in the list box while enabling virtual scrolling and when virtualScrollMode is set to continuous. + * @Default {5} + */ + itemRequestCount?: number; + + /**Loads data for the listbox by default (i.e. on initialization) when it is set to true. It creates empty ListBox if it is set to false. + */ + loadDataOnInit?: boolean; + + /**The query to retrieve required data from the data source. + * @Default {ej.Query()} + */ + query?: ej.Query|string; + + /**The list item to be selected by default using its index. + * @Default {null} + */ + selectedIndex?: number; + + /**The list items to be selected by default using its indices. To use this property allowMultiSelection should be enabled. + * @Default {[]} + */ + selectedIndices?: Array; + + /**Enables/Disables the multi selection option with the help of checkbox control. + * @Default {false} + */ + showCheckbox?: boolean; + + /**To display the ListBox container with rounded corners. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**The template to display the ListBox widget with customized appearance. + * @Default {null} + */ + template?: string; + + /**Holds the selected items values and used to bind value to the list item using angular and knockout. + * @Default {“”} + */ + value?: number; + + /**Specifies the virtual scroll mode to load the list data on demand via scrolling behavior. There are two types of mode. + */ + virtualScrollMode?: ej.VirtualScrollMode|string; + + /**Defines the width of the ListBox widget. + * @Default {null} + */ + width?: string; + + /**Specifies the targetID for the listbox items. + */ + targetID?: string; + + /**Triggers before the AJAX request begins to load data in the ListBox widget.*/ + actionBegin? (e: ActionBeginEventArgs): void; + + /**Triggers after the data requested via AJAX is successfully loaded in the ListBox widget.*/ + actionSuccess? (e: ActionSuccessEventArgs): void; + + /**Triggers when the AJAX requests complete. The request may get failed or succeed.*/ + actionComplete? (e: ActionCompleteEventArgs): void; + + /**Triggers when the data requested from AJAX get failed.*/ + actionFailure? (e: ActionFailureEventArgs): void; + + /**Event will be triggered before the requested data via AJAX once loaded in successfully.*/ + actionBeforeSuccess? (e: ActionBeforeSuccessEventArgs): void; + + /**Triggers when the item selection is changed.*/ + change? (e: ChangeEventArgs): void; + + /**Triggers when the list item is checked or unchecked.*/ + checkChange? (e: CheckChangeEventArgs): void; + + /**Triggers when the ListBox widget is created successfully.*/ + create? (e: CreateEventArgs): void; + + /**Triggers when the ListBox widget is destroyed successfully.*/ + destroy? (e: DestroyEventArgs): void; + + /**Triggers when focus the listbox items.*/ + focusIn? (e: FocusInEventArgs): void; + + /**Triggers when focus out from listbox items.*/ + focusOut? (e: FocusOutEventArgs): void; + + /**Triggers when the list item is being dragged.*/ + itemDrag? (e: ItemDragEventArgs): void; + + /**Triggers when the list item is ready to be dragged.*/ + itemDragStart? (e: ItemDragStartEventArgs): void; + + /**Triggers when the list item stops dragging.*/ + itemDragStop? (e: ItemDragStopEventArgs): void; + + /**Triggers when the list item is dropped.*/ + itemDrop? (e: ItemDropEventArgs): void; + + /**Triggers when a list item gets selected.*/ + select? (e: SelectEventArgs): void; + + /**Triggers when a list item gets unselected.*/ + unselect? (e: UnselectEventArgs): void; +} + +export interface ActionBeginEventArgs { +} + +export interface ActionSuccessEventArgs { +} + +export interface ActionCompleteEventArgs { +} + +export interface ActionFailureEventArgs { +} + +export interface ActionBeforeSuccessEventArgs { + + /**Instance of the listbox model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; + + /**List of actual object. + */ + actual?: any; + + /**Object of ListBox widget which contains DataManager arguments + */ + request?: any; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**List of array object + */ + result?: Array; + + /**ExcuteQuery object of DataManager + */ + xhr?: any; +} + +export interface ChangeEventArgs { + + /**Instance of the listbox model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; + + /**List item object. + */ + item?: any; + + /**The Datasource of the listbox. + */ + data?: any; + + /**List item’s index. + */ + index?: number; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Boolean value based on whether the list item is checked or not. + */ + isChecked?: boolean; + + /**Boolean value based on whether the list item is selected or not. + */ + isSelected?: boolean; + + /**Boolean value based on the list item is enabled or not. + */ + isEnabled?: boolean; + + /**List item’s text (label). + */ + text?: string; + + /**List item’s value. + */ + value?: string; +} + +export interface CheckChangeEventArgs { + + /**Instance of the listbox model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; + + /**List item object. + */ + item?: any; + + /**The Datasource of the listbox. + */ + data?: any; + + /**List item’s index. + */ + index?: number; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Boolean value based on whether the list item is checked or not. + */ + isChecked?: boolean; + + /**Boolean value based on whether the list item is selected or not. + */ + isSelected?: boolean; + + /**Boolean value based on the list item is enabled or not. + */ + isEnabled?: boolean; + + /**List item’s text (label). + */ + text?: string; + + /**List item’s value. + */ + value?: string; +} + +export interface CreateEventArgs { + + /**Instance of the listbox model object. + */ + model?: ej.ListBox.Model; + + /**Name of the event. + */ + type?: string; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; +} + +export interface DestroyEventArgs { + + /**Instance of the listbox model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; +} + +export interface FocusInEventArgs { + + /**Instance of the listbox model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; +} + +export interface FocusOutEventArgs { + + /**Instance of the listbox model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; +} + +export interface ItemDragEventArgs { + + /**Instance of the listbox model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**The Datasource of the listbox. + */ + data?: any; + + /**List item’s index. + */ + index?: number; + + /**Boolean value based on whether the list item is checked or not. + */ + isChecked?: boolean; + + /**Boolean value based on whether the list item is selected or not. + */ + isSelected?: boolean; + + /**Boolean value based on whether the list item is enabled or not. + */ + isEnabled?: boolean; + + /**List item’s text (label). + */ + text?: string; + + /**List item’s value. + */ + value?: string; +} + +export interface ItemDragStartEventArgs { + + /**Instance of the listbox model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**The Datasource of the listbox. + */ + data?: any; + + /**List item’s index. + */ + index?: number; + + /**Boolean value based on whether the list item is checked or not. + */ + isChecked?: boolean; + + /**Boolean value based on whether the list item is selected or not. + */ + isSelected?: boolean; + + /**Boolean value based on whether the list item is enabled or not. + */ + isEnabled?: boolean; + + /**List item’s text (label). + */ + text?: string; + + /**List item’s value. + */ + value?: string; +} + +export interface ItemDragStopEventArgs { + + /**Instance of the listbox model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**The Datasource of the listbox. + */ + data?: any; + + /**List item’s index. + */ + index?: number; + + /**Boolean value based on whether the list item is checked or not. + */ + isChecked?: boolean; + + /**Boolean value based on whether the list item is selected or not. + */ + isSelected?: boolean; + + /**Boolean value based on whether the list item is enabled or not. + */ + isEnabled?: boolean; + + /**List item’s text (label). + */ + text?: string; + + /**List item’s value. + */ + value?: string; +} + +export interface ItemDropEventArgs { + + /**Instance of the listbox model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**The Datasource of the listbox. + */ + data?: any; + + /**List item’s index. + */ + index?: number; + + /**Boolean value based on whether the list item is checked or not. + */ + isChecked?: boolean; + + /**Boolean value based on whether the list item is selected or not. + */ + isSelected?: boolean; + + /**Boolean value based on whether the list item is enabled or not. + */ + isEnabled?: boolean; + + /**List item’s text (label). + */ + text?: string; + + /**List item’s value. + */ + value?: string; +} + +export interface SelectEventArgs { + + /**Instance of the listbox model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; + + /**List item object. + */ + item?: any; + + /**The Datasource of the listbox. + */ + data?: any; + + /**List item’s index. + */ + index?: number; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Boolean value based on whether the list item is checked or not. + */ + isChecked?: boolean; + + /**Boolean value based on whether the list item is selected or not. + */ + isSelected?: boolean; + + /**Boolean value based on the list item is enabled or not. + */ + isEnabled?: boolean; + + /**List item’s text (label). + */ + text?: string; + + /**List item’s value. + */ + value?: string; +} + +export interface UnselectEventArgs { + + /**Instance of the listbox model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; + + /**List item object. + */ + item?: any; + + /**The Datasource of the listbox. + */ + data?: any; + + /**List item’s index. + */ + index?: number; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Boolean value based on whether the list item is checked or not. + */ + isChecked?: boolean; + + /**Boolean value based on whether the list item is selected or not. + */ + isSelected?: boolean; + + /**Boolean value based on the list item is enabled or not. + */ + isEnabled?: boolean; + + /**List item’s text (label). + */ + text?: string; + + /**List item’s value. + */ + value?: string; +} +} + +class Calculate extends ej.Widget { + static fn: Calculate; + constructor(element: JQuery, options?: Calculate.Model); + constructor(element: Element, options?: Calculate.Model); + model:Calculate.Model; + defaults:Calculate.Model; + + /** Add the custom formuls with function in CalcEngine library + * @param {string} pass the formula name + * @param {string} pass the custom function name to call + * @returns {void} + */ + addCustomFunction(FormulaName: string, FunctionName: string): void; + + /** Adds a named range to the NamedRanges collection + * @param {string} pass the namedRange's name + * @param {string} pass the cell range of NamedRange + * @returns {void} + */ + addNamedRange(Name: string, cellRange: string): void; + + /** Accepts a possible parsed formula and returns the calculated value without quotes. + * @param {string} pass the cell range to adjust its range + * @returns {string} + */ + adjustRangeArg(Name: string): string; + + /** When a formula cell changes, call this method to clear it from its dependent cells. + * @param {string} pass the changed cell address + * @returns {void} + */ + clearFormulaDependentCells(Cell: string): void; + + /** Call this method to clear whether an exception was raised during the computation of a library function. + * @returns {void} + */ + clearLibraryComputationException(): void; + + /** Get the column index from a cell reference passed in. + * @param {string} pass the cell address + * @returns {void} + */ + colIndex(Cell: string): void; + + /** Evaluates a parsed formula. + * @param {string} pass the parsed formula + * @returns {string} + */ + computedValue(Formula: string): string; + + /** Evaluates a parsed formula. + * @param {string} pass the parsed formula + * @returns {string} + */ + computeFormula(Formula: string): string; +} +export module Calculate{ + +export interface Model { +} +} + +class CheckBox extends ej.Widget { + static fn: CheckBox; + constructor(element: JQuery, options?: CheckBox.Model); + constructor(element: Element, options?: CheckBox.Model); + model:CheckBox.Model; + defaults:CheckBox.Model; + + /** Destroy the CheckBox widget all events bound using this._on will be unbind automatically and bring the control to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** Disable the CheckBox to prevent all user interactions. + * @returns {void} + */ + disable(): void; + + /** To enable the CheckBox + * @returns {void} + */ + enable(): void; + + /** To Check the status of CheckBox + * @returns {boolean} + */ + isChecked(): boolean; +} +export module CheckBox{ + +export interface Model { + + /**Specifies whether CheckBox has to be in checked or not. We can also specify array of string as value for this property. If any of the value in the specified array matches the value of the textbox, then it will be considered as checked. It will be useful in MVVM binding, specify array type to identify the values of the checked CheckBoxes. + * @Default {false} + */ + checked?: boolean|string[]; + + /**Specifies the State of CheckBox.See below to get available CheckState + * @Default {null} + */ + checkState?: ej.CheckState|string; + + /**Sets the root CSS class for CheckBox theme, which is used customize. + */ + cssClass?: string; + + /**Specifies the checkbox control state. + * @Default {true} + */ + enabled?: boolean; + + /**Specifies the persist property for CheckBox while initialization. The persist API save current model value to browser cookies for state maintains. While refreshing the CheckBox control page the model value apply from browser cookies. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Specify the Right to Left direction to Checkbox + * @Default {false} + */ + enableRTL?: boolean; + + /**Specifies the enable or disable Tri-State for checkbox control. + * @Default {false} + */ + enableTriState?: boolean; + + /**It allows to define the characteristics of the CheckBox control. It will helps to extend the capability of an HTML element. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Specified value to be added an id attribute of the CheckBox. + * @Default {null} + */ + id?: string; + + /**Specify the prefix value of id to be added before the current id of the CheckBox. + * @Default {ej} + */ + idPrefix?: string; + + /**Specifies the name attribute of the CheckBox. + * @Default {null} + */ + name?: string; + + /**Displays rounded corner borders to CheckBox + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Specifies the size of the CheckBox.See below to know available CheckboxSize + * @Default {small} + */ + size?: ej.CheckboxSize|string; + + /**Specifies the text content to be displayed for CheckBox. + */ + text?: string; + + /**Set the jQuery validation error message in CheckBox. + * @Default {null} + */ + validationMessage?: any; + + /**Set the jQuery validation rules in CheckBox. + * @Default {null} + */ + validationRules?: any; + + /**Specifies the value attribute of the CheckBox. + * @Default {null} + */ + value?: string; + + /**Fires before the CheckBox is going to changed its state successfully*/ + beforeChange? (e: BeforeChangeEventArgs): void; + + /**Fires when the CheckBox state is changed successfully*/ + change? (e: ChangeEventArgs): void; + + /**Fires when the CheckBox state is created successfully*/ + create? (e: CreateEventArgs): void; + + /**Fires when the CheckBox state is destroyed successfully*/ + destroy? (e: DestroyEventArgs): void; +} + +export interface BeforeChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the CheckBox model + */ + model?: ej.CheckBox.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the event model values + */ + event?: any; + + /**returns the status whether the element is checked or not. + */ + isChecked?: boolean; +} + +export interface ChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the CheckBox model + */ + model?: ej.CheckBox.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the event arguments + */ + event?: any; + + /**returns the status whether the element is checked or not. + */ + isChecked?: boolean; + + /**returns the state of the checkbox + */ + checkState?: string; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the CheckBox model + */ + model?: ej.CheckBox.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the CheckBox model + */ + model?: ej.CheckBox.Model; + + /**returns the name of the event + */ + type?: string; +} +} +enum CheckState +{ +//string +Uncheck, +//string +Check, +//string +Indeterminate, +} +enum CheckboxSize +{ +//Displays the CheckBox in medium size +Medium, +//Displays the CheckBox in small size +Small, +} + +class ColorPicker extends ej.Widget { + static fn: ColorPicker; + constructor(element: JQuery, options?: ColorPicker.Model); + constructor(element: Element, options?: ColorPicker.Model); + model:ColorPicker.Model; + defaults:ColorPicker.Model; + + /** Disables the color picker control + * @returns {void} + */ + disable(): void; + + /** Enable the color picker control + * @returns {void} + */ + enable(): void; + + /** Gets the selected color in RGB format + * @returns {any} + */ + getColor(): any; + + /** Gets the selected color value as string + * @returns {string} + */ + getValue(): string; + + /** To Convert color value from hexCode to RGB + * @returns {any} + */ + hexCodeToRGB(): any; + + /** Hides the ColorPicker popup, if in opened state. + * @returns {void} + */ + hide(): void; + + /** Convert color value from HSV to RGB + * @returns {any} + */ + HSVToRGB(): any; + + /** Convert color value from RGB to HEX + * @returns {string} + */ + RGBToHEX(): string; + + /** Convert color value from RGB to HSV + * @returns {any} + */ + RGBToHSV(): any; + + /** Open the ColorPicker popup. + * @returns {void} + */ + show(): void; +} +export module ColorPicker{ + +export interface Model { + + /**The ColorPicker control allows to define the customized text to displayed in button elements. Using the property to achieve the customized culture values. + * @Default {buttonText.apply= Apply, buttonText.cancel= Cancel,buttonText.swatches=Swatches} + */ + buttonText?: any; + + /**Allows to change the mode of the button. Please refer below to know available button mode + * @Default {ej.ButtonMode.Split} + */ + buttonMode?: ej.ButtonMode|string; + + /**Specifies the number of columns to be displayed color palette model. + * @Default {10} + */ + columns?: number; + + /**This property allows you to customize its appearance using user-defined CSS and custom skin options such as colors and backgrounds. + */ + cssClass?: string; + + /**This property allows to define the custom colors in the palette model.Custom palettes are created by passing a comma delimited string of HEX values or an array of colors. + * @Default {empty} + */ + custom?: Array; + + /**This property allows to embed the popup in the order of DOM element flow . When we set the value as true, the color picker popup is always in visible state. + * @Default {false} + */ + displayInline?: boolean; + + /**This property allows to change the control in enabled or disabled state. + * @Default {true} + */ + enabled?: boolean; + + /**This property allows to enable or disable the opacity slider in the color picker control + * @Default {true} + */ + enableOpacity?: boolean; + + /**It allows to define the characteristics of the ColorPicker control. It will helps to extend the capability of an HTML element. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Specifies the model type to be rendered initially in the color picker control. See below to get available ModelType + * @Default {ej.ColorPicker.ModelType.Default} + */ + modelType?: ej.ColorPicker.ModelType|string; + + /**This property allows to change the opacity value .The selected color opacity will be adjusted by using this opacity value. + * @Default {100} + */ + opacityValue?: number; + + /**Specifies the palette type to be displayed at initial time in palette model.There two types of palette model available in ColorPicker control. See below available Palette + * @Default {ej.ColorPicker.Palette.BasicPalette} + */ + palette?: ej.ColorPicker.Palette|string; + + /**This property allows to define the preset model to be rendered initially in palette type.It consists of 12 different types of presets. Each presets have 50 colors. See below available Presets + * @Default {ej.ColorPicker.Presets.Basic} + */ + presetType?: ej.ColorPicker.Presets|string; + + /**Allows to show/hides the apply and cancel buttons in ColorPicker control + * @Default {true} + */ + showApplyCancel?: boolean; + + /**Allows to show/hides the clear button in ColorPicker control + * @Default {true} + */ + showClearButton?: boolean; + + /**This property allows to provides live preview support for current cursor selection color and selected color. + * @Default {true} + */ + showPreview?: boolean; + + /**This property allows to store the color values in custom list.The ColorPicker will keep up to 11 colors in a custom list.By clicking the add button, the selected color from picker or palette will get added in the recent color list. + * @Default {false} + */ + showRecentColors?: boolean; + + /**This property allows to shows tooltip to notify the slider value in color picker control. + * @Default {false} + */ + showTooltip?: boolean; + + /**Specifies the toolIcon to be displayed in dropdown control color area. + * @Default {null} + */ + toolIcon?: string; + + /**This property allows to define the customized text or content to displayed when mouse over the following elements. This property also allows to use the culture values. + * @Default {tooltipText: { switcher: Switcher, addbutton: Add Color, basic: Basic, monochrome: Mono Chrome, flatcolors: Flat Color, seawolf: Sea Wolf, webcolors: Web Colors, sandy: Sandy, pinkshades: Pink Shades, misty: Misty, citrus: Citrus, vintage: Vintage, moonlight: Moon Light, candycrush: Candy Crush, currentcolor: Current Color, selectedcolor: Selected Color }} + */ + tooltipText?: any; + + /**Specifies the color value for color picker control, the value is in hexadecimal form with prefix of "#". + * @Default {null} + */ + value?: string; + + /**Fires after Color value has been changed successfully.If the user want to perform any operation after the color value changed then the user can make use of this change event.*/ + change? (e: ChangeEventArgs): void; + + /**Fires after closing the color picker popup.*/ + close? (e: CloseEventArgs): void; + + /**Fires after Color picker control is created. If the user want to perform any operation after the color picker control creation then the user can make use of this create event.*/ + create? (e: CreateEventArgs): void; + + /**Fires after Color picker control is destroyed. If the user want to perform any operation after the color picker control destroyed then the user can make use of this destroy event.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires after opening the color picker popup*/ + open? (e: OpenEventArgs): void; + + /**Fires after Color value has been selected successfully. If the user want to perform any operation after the color value selected then the user can make use of this select event.*/ + select? (e: SelectEventArgs): void; +} + +export interface ChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the color picker model + */ + model?: ej.ColorPicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**return the changed color value + */ + value?: string; +} + +export interface CloseEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the color picker model + */ + model?: ej.ColorPicker.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the color picker model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the color picker model + */ + model?: ej.ColorPicker.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface OpenEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the color picker model + */ + model?: ej.ColorPicker.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface SelectEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the color picker model + */ + model?: ej.ColorPicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**return the selected color value + */ + value?: string; +} + +enum ModelType{ + + ///support palette type mode in color picker. + Palette, + + ///support palette type mode in color picker. + Picker +} + + +enum Palette{ + + ///used to show the basic palette + BasicPalette, + + ///used to show the custompalette + CustomPalette +} + + +enum Presets{ + + ///used to show the basic presets + Basic, + + ///used to show the CandyCrush colors presets + CandyCrush, + + ///used to show the Citrus colors presets + Citrus, + + ///used to show the FlatColors presets + FlatColors, + + ///used to show the Misty presets + Misty, + + ///used to show the MoonLight presets + MoonLight, + + ///used to show the PinkShades presets + PinkShades, + + ///used to show the Sandy presets + Sandy, + + ///used to show the Seawolf presets + SeaWolf, + + ///used to show the Vintage presets + Vintage, + + ///used to show the WebColors presets + WebColors +} + +} +enum ButtonMode +{ +//Displays the button in split mode +Split, +//Displays the button in Dropdown mode +Dropdown, +} + +class FileExplorer extends ej.Widget { + static fn: FileExplorer; + constructor(element: JQuery, options?: FileExplorer.Model); + constructor(element: Element, options?: FileExplorer.Model); + model:FileExplorer.Model; + defaults:FileExplorer.Model; + + /** Refresh the size of FileExplorer control. + * @returns {void} + */ + adjustSize(): void; + + /** Disable the particular context menu item. + * @param {string|HTMLElement} Id of the menu item/ Menu element to be disabled + * @returns {void} + */ + disableMenuItem(item: string|HTMLElement): void; + + /** Disable the particular toolbar item. + * @param {string|HTMLElement} Id of the toolbar item/ Tool item element to be disabled + * @returns {void} + */ + disableToolbarItem(item: string|HTMLElement): void; + + /** Enable the particular context menu item. + * @param {string|HTMLElement} Id of the menu item/ Menu element to be Enabled + * @returns {void} + */ + enableMenuItem(item: string|HTMLElement): void; + + /** Enable the particular toolbar item + * @param {string|HTMLElement} Id of the tool item/ Tool item element to be Enabled + * @returns {void} + */ + enableToolbarItem(item: string|HTMLElement): void; + + /** Refresh the content of the selected folder in FileExplorer control. + * @returns {void} + */ + refresh(): void; + + /** Remove the particular toolbar item. + * @param {string|HTMLElement} Id of the tool item/ tool item element to be removed + * @returns {void} + */ + removeToolbarItem(item: string|HTMLElement): void; +} +export module FileExplorer{ + +export interface Model { + + /**Sets the URL of server side ajax handling method that handles file operation like Read, Remove, Rename, Create, Upload, Download, Copy and Move in File Explorer. + */ + ajaxAction?: string; + + /**Specifies the data type of server side ajax handling method. + * @Default {json} + */ + ajaxDataType?: string; + + /**By using ajaxSettings property, you can customize the ajax configurations. Normally you can customize the following option in ajax handling data, url, type, async, contentType, dataType and success. For upload, download and getImage API, you can only customize url. + * @Default {{ read: {}, createFolder: {}, remove: {}, rename: {}, paste: {}, getDetails: {}, download: {}, upload: {}, getImage: {}}} + */ + ajaxSettings?: any; + + /**The FileExplorer allows to select multiple files by enabling the allowMultiSelection property. You can perform multi selection by pressing the Ctrl key or Shift key. + * @Default {true} + */ + allowMultiSelection?: boolean; + + /**Sets the root class for FileExplorer theme. This cssClass API allows to use custom skinning option for File Explorer control. By defining the root class by using this API, you have to include this root class in CSS. + */ + cssClass?: string; + + /**Enables or disables the resize support in FileExplorer control. + * @Default {false} + */ + enableResize?: boolean; + + /**Enables or disables the Right to Left alignment support in FileExplorer control. + * @Default {false} + */ + enableRTL?: boolean; + + /**Allows specified type of files only to display in FileExplorer control. + * @Default {.} + */ + fileTypes?: string; + + /**By using filterSettings property, you can customize the search functionality of the search bar in FileExplorer control. + */ + filterSettings?: FilterSettings; + + /**By using the gridSettings property, you can customize the grid behavior in the FileExplorer control. + */ + gridSettings?: GridSettings; + + /**Specifies the height of FileExplorer control. + * @Default {400} + */ + height?: string|number; + + /**Enables or disables the responsive support for FileExplorer control during the window resizing time. + * @Default {false} + */ + isResponsive?: boolean; + + /**Sets the file view type. There are two view types available, such as grid, tile. See layoutType. + * @Default {ej.FileExplorer.layoutType.Grid} + */ + layout?: ej.FileExplorer.layoutType|string; + + /**Sets the culture in FileExplorer. + * @Default {en-US} + */ + locale?: string; + + /**Sets the maximum height of FileExplorer control. + * @Default {null} + */ + maxHeight?: string|number; + + /**Sets the maximum width of FileExplorer control. + * @Default {null} + */ + maxWidth?: string|number; + + /**Sets the minimum height of FileExplorer control. + * @Default {250} + */ + minHeight?: string|number; + + /**Sets the minimum width of FileExplorer control. + * @Default {400} + */ + minWidth?: string|number; + + /**The property path denotes the filesystem path that are to be explored. The path for the filesystem can be physical path or relative path, but it has to be relevant to where the Web API is hosted. + */ + path?: string; + + /**The selectedFolder is used to select the specified folder of FileExplorer control. + */ + selectedFolder?: string; + + /**The selectedItems is used to select the specified items (file, folder) of FileExplorer control. + */ + selectedItems?: string|Array; + + /**Enables or disables the context menu option in FileExplorer control. + * @Default {true} + */ + showContextMenu?: boolean; + + /**Enables or disables the footer in FileExplorer control. The footer element displays the details of the current selected files and folders. And also the footer having the switcher to change the layout view. + * @Default {true} + */ + showFooter?: boolean; + + /**Shows or disables the toolbar in FileExplorer control. + * @Default {true} + */ + showToolbar?: boolean; + + /**Enables or disables the navigation pane in FileExplorer control. The navigation pane contains a tree view element that displays all the folders from the filesystem in a hierarchical manner. This is useful to a quick navigation of any folder in the filesystem. + * @Default {true} + */ + showNavigationPane?: boolean; + + /**The tools property is used to configure and group required toolbar items in FileExplorer control. + * @Default {{ creation:[NewFolder, Open], navigation: [Back, Forward, Upward], addressBar: [Addressbar], editing: [Refresh, Upload, Delete, Rename, Download], copyPaste: [Cut, Copy, Paste], getProperties: [Details], searchBar: [Searchbar] }} + */ + tools?: any; + + /**The toolsList property is used to arrange the toolbar items in the FileExplorer control. + * @Default {[creation, navigation, addressBar, editing, copyPaste, getProperties, searchBar]} + */ + toolsList?: Array; + + /**Gets or sets an object that indicates whether to customize the upload behavior in the FileExplorer. + */ + uploadSettings?: UploadSettings; + + /**Specifies the width of FileExplorer control. + * @Default {850} + */ + width?: string|number; + + /**Fires before the ajax request is performed.*/ + beforeAjaxRequest? (e: BeforeAjaxRequestEventArgs): void; + + /**Fires before downloading the files.*/ + beforeDownload? (e: BeforeDownloadEventArgs): void; + + /**Fires before files or folders open.*/ + beforeOpen? (e: BeforeOpenEventArgs): void; + + /**Fires before uploading the files.*/ + beforeUpload? (e: BeforeUploadEventArgs): void; + + /**Fires when file or folder is copied successfully.*/ + copy? (e: CopyEventArgs): void; + + /**Fires when new folder is created successfully in file system.*/ + createFolder? (e: CreateFolderEventArgs): void; + + /**Fires when file or folder is cut successfully.*/ + cut? (e: CutEventArgs): void; + + /**Fires when the file view type is changed.*/ + layoutChange? (e: LayoutChangeEventArgs): void; + + /**Fires when files are successfully opened.*/ + open? (e: OpenEventArgs): void; + + /**Fires when a file or folder is pasted successfully.*/ + paste? (e: PasteEventArgs): void; + + /**Fires when file or folder is deleted successfully.*/ + remove? (e: RemoveEventArgs): void; + + /**Fires when resizing is performed for FileExplorer.*/ + resize? (e: ResizeEventArgs): void; + + /**Fires when resizing is started for FileExplorer.*/ + resizeStart? (e: ResizeStartEventArgs): void; + + /**Fires this event when the resizing is stopped for FileExplorer.*/ + resizeStop? (e: ResizeStopEventArgs): void; + + /**Fires when the items from grid view or tile view of FileExplorer control is selected.*/ + select? (e: SelectEventArgs): void; +} + +export interface BeforeAjaxRequestEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ajax response data + */ + data?: any; + + /**returns the FileExplorer model + */ + model?: ej.FileExplorer.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface BeforeDownloadEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the downloaded file names. + */ + files?: string[]; + + /**returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /**returns the path of currently opened item. + */ + path?: string; + + /**returns the selected item details. + */ + selectedItems?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface BeforeOpenEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the opened item type. + */ + itemType?: string; + + /**returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /**returns the path of currently opened item. + */ + path?: string; + + /**returns the selected item details. + */ + selectedItems?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface BeforeUploadEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /**returns the path of currently opened item. + */ + path?: string; + + /**returns the selected item details. + */ + selectedItems?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface CopyEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /**returns the name of copied file/folder. + */ + name?: string[]; + + /**returns the selected item details. + */ + selectedItems?: any; + + /**returns the source path. + */ + sourcePath?: string; + + /**returns the name of the event. + */ + type?: string; +} + +export interface CreateFolderEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ajax response data + */ + data?: any; + + /**returns the FileExplorer model + */ + model?: ej.FileExplorer.Model; + + /**returns the selected item details + */ + selectedItems?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface CutEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /**returns the name of moved file or folder. + */ + name?: string[]; + + /**returns the selected item details. + */ + selectedItems?: any; + + /**returns the source path. + */ + sourcePath?: string; + + /**returns the name of the event. + */ + type?: string; +} + +export interface LayoutChangeEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the current view type. + */ + layoutType?: string; + + /**returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface OpenEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the opened item type. + */ + itemType?: any; + + /**returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /**returns the path of currently opened item. + */ + path?: string; + + /**returns the selected item details. + */ + selectedItems?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface PasteEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /**returns the name of moved file or folder. + */ + name?: string[]; + + /**returns the selected item details. + */ + selectedItems?: any; + + /**returns the target folder item details. + */ + targetFolder?: any; + + /**returns the target path. + */ + targetPath?: string; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RemoveEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ajax response data. + */ + data?: any; + + /**returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /**returns the names of deleted items. + */ + name?: string; + + /**returns the path of deleted item. + */ + path?: string; + + /**returns the selected item details. + */ + selectedItems?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface ResizeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the mouse move event args. + */ + event?: any; + + /**returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface ResizeStartEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the mouse down event args. + */ + event?: any; + + /**returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface ResizeStopEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the mouse leave event args. + */ + event?: any; + + /**returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface SelectEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /**returns the name of clicked item. + */ + name?: string; + + /**returns the path of clicked item. + */ + path?: string; + + /**returns the selected item details + */ + selectedItems?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface FilterSettings { + + /**Enables or disables to perform the filter operation with case sensitive. + * @Default {false} + */ + caseSensitiveSearch?: boolean; + + /**Sets the search filter type. There are several filter types available, such as "startswith", "contains", "endswith". See filterType + * @Default {ej.FileExplorer.filterType.Contains} + */ + filterType?: ej.FilterType|string; +} + +export interface GridSettings { + + /**Gets or sets a value that indicates whether to enable the dynamic sorting behavior on grid data. Sorting can be done through clicking on particular column header. + * @Default {true} + */ + allowSorting?: boolean; + + /**Gets or sets an object that indicates to render the grid with specified columns. You can use this property same as the column property in Grid control. + * @Default {[{ field: name, headerText: Name, width: 25% }, { field: type, headerText: Type, width: 20% }, { field: dateModified, headerText: Date Modified, width: 35% }, { field: size, headerText: Size, width: 15%, textAlign: right, headerTextAlign: left }]} + */ + columns?: Array; +} + +export interface UploadSettings { + + /**Specifies the maximum file size allowed to upload. It accepts the value in bytes. + * @Default {31457280} + */ + maxFileSize?: number; + + /**Enables or disables the multiple files upload. When it is enabled, you can upload multiple files at a time and when disabled, you can upload only one file at a time. + * @Default {true} + */ + allowMultipleFile?: boolean; + + /**Enables or disables the auto upload option while uploading files in FileExplorer control. + * @Default {false} + */ + autoUpload?: boolean; +} + +enum layoutType{ + + ///Supports to display files in tile view + Tile, + + ///Supports to display files in grid view + Grid, + + ///Supports to display files as large icons + LargeIcons +} + +} + +class DatePicker extends ej.Widget { + static fn: DatePicker; + constructor(element: JQuery, options?: DatePicker.Model); + constructor(element: Element, options?: DatePicker.Model); + model:DatePicker.Model; + defaults:DatePicker.Model; + + /** Disables the DatePicker control. + * @returns {void} + */ + disable(): void; + + /** Enable the DatePicker control, if it is in disabled state. + * @returns {void} + */ + enable(): void; + + /** Returns the current date value in the DatePicker control. + * @returns {string} + */ + getValue(): string; + + /** Close the DatePicker popup, if it is in opened state. + * @returns {void} + */ + hide(): void; + + /** Opens the DatePicker popup. + * @returns {void} + */ + show(): void; +} +export module DatePicker{ + +export interface Model { + + /**Used to allow or restrict the editing in DatePicker input field directly. By setting false to this API, You can only pick the date from DatePicker popup. + * @Default {true} + */ + allowEdit?: boolean; + + /**allow or restrict the drill down to multiple levels of view (month/year/decade) in DatePicker calendar + * @Default {true} + */ + allowDrillDown?: boolean; + + /**Sets the specified text value to the today button in the DatePicker calendar. + * @Default {Today} + */ + buttonText?: string; + + /**Sets the root CSS class for Accordion theme, which is used customize. + */ + cssClass?: string; + + /**Formats the value of the DatePicker in to the specified date format. If this API is not specified, dateFormat will be set based on the current culture of DatePicker. + * @Default {MM/dd/yyyy} + */ + dateFormat?: string; + + /**Specifies the header format of days in DatePicker calendar. See below to get available Headers options + * @Default {ej.DatePicker.Header.Min} + */ + dayHeaderFormat?: string | ej.DatePicker.Header; + + /**Specifies the navigation depth level in DatePicker calendar. This option is not applied when start level view option is lower than depth level view. See below to know available levels in DatePicker Calendar + */ + depthLevel?: string | ej.DatePicker.Level; + + /**Allows to embed the DatePicker calendar in the page. Also associates DatePicker with div element instead of input. + * @Default {false} + */ + displayInline?: boolean; + + /**Enables or disables the animation effect with DatePicker calendar. + * @Default {true} + */ + enableAnimation?: boolean; + + /**Enable or disable the DatePicker control. + * @Default {true} + */ + enabled?: boolean; + + /**Sustain the entire widget model of DatePicker even after form post or browser refresh + * @Default {false} + */ + enablePersistence?: boolean; + + /**Displays DatePicker calendar along with DatePicker input field in Right to Left direction. + * @Default {false} + */ + enableRTL?: boolean; + + /**Allows to enter valid or invalid date in input textbox and indicate as error if it is invalid value, when this API value is set to true. For false value, invalid date is not allowed to input field and corrected to valid date automatically, even if invalid date is given. + * @Default {false} + */ + enableStrictMode?: boolean; + + /**Used the required fields for special Dates in DatePicker in order to customize the special dates in a calendar. + * @Default {null} + */ + fields?: Fields; + + /**Specifies the header format to be displayed in the DatePicker calendar. + * @Default {MMMM yyyy} + */ + headerFormat?: string; + + /**Specifies the height of the DatePicker input text. + * @Default {28px} + */ + height?: string; + + /**HighlightSection is used to highlight currently selected date's month/week/workdays. See below to get available HighlightSection options + * @Default {none} + */ + highlightSection?: string | ej.DatePicker.HighlightSection; + + /**Weekend dates will be highlighted when this property is set to true. + * @Default {false} + */ + highlightWeekend?: boolean; + + /**Specifies the HTML Attributes of the DatePicker. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Change the DatePicker calendar and date format based on given culture. + * @Default {en-US} + */ + locale?: string; + + /**Specifies the maximum date in the calendar that the user can select. + * @Default {new Date(2099, 11, 31)} + */ + maxDate?: string|Date; + + /**Specifies the minimum date in the calendar that the user can select. + * @Default {new Date(1900, 00, 01)} + */ + minDate?: string|Date; + + /**Allows to toggles the read only state of the DatePicker. When the widget is readOnly, it doesn't allow your input. + * @Default {false} + */ + readOnly?: boolean; + + /**It allows to display footer in DatePicker calendar. + * @Default {true} + */ + showFooter?: boolean; + + /**It allows to display/hides the other months days from the current month calendar in a DatePicker. + * @Default {true} + */ + showOtherMonths?: boolean; + + /**Shows/hides the date icon button at right side of textbox, which is used to open or close the DatePicker calendar popup. + * @Default {true} + */ + showPopupButton?: boolean; + + /**DatePicker input is displayed with rounded corner when this property is set to true. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Used to show the tooltip when hovering on the days in the DatePicker calendar. + * @Default {true} + */ + showTooltip?: boolean; + + /**Specifies the special dates in DatePicker. + * @Default {null} + */ + specialDates?: any; + + /**Specifies the start day of the week in DatePicker calendar. + * @Default {0} + */ + startDay?: number; + + /**Specifies the start level view in DatePicker calendar. See below available Levels + * @Default {ej.DatePicker.Level.Month} + */ + startLevel?: string | ej.DatePicker.Level; + + /**Specifies the number of months to be navigate for one click of next and previous button in a DatePicker Calendar. + * @Default {1} + */ + stepMonths?: number; + + /**Provides option to customize the tooltip format. + * @Default {ddd MMM dd yyyy} + */ + tooltipFormat?: string; + + /**Sets the jQuery validation support to DatePicker Date value. See validation + * @Default {null} + */ + validationMessage?: any; + + /**Sets the jQuery validation custom rules to the DatePicker. see validation + * @Default {null} + */ + validationRules?: any; + + /**sets or returns the current value of DatePicker + * @Default {null} + */ + value?: string|Date; + + /**Specifies the water mark text to be displayed in input text. + * @Default {Select date} + */ + watermarkText?: string; + + /**Specifies the width of the DatePicker input text. + * @Default {160px} + */ + width?: string; + + /**Fires before closing the DatePicker popup.*/ + beforeClose? (e: BeforeCloseEventArgs): void; + + /**Fires when each date is created in the DatePicker popup calendar.*/ + beforeDateCreate? (e: BeforeDateCreateEventArgs): void; + + /**Fires before opening the DatePicker popup.*/ + beforeOpen? (e: BeforeOpenEventArgs): void; + + /**Fires when the DatePicker input value is changed.*/ + change? (e: ChangeEventArgs): void; + + /**Fires when DatePicker popup is closed.*/ + close? (e: CloseEventArgs): void; + + /**Fires when the DatePicker is created successfully.*/ + create? (e: CreateEventArgs): void; + + /**Fires when the DatePicker is destroyed successfully.*/ + destroy? (e: DestroyEventArgs): void; + + /**NameTypeDescriptioncancelbooleanSet to true when the event has to be canceled, else false.modelobjectreturns the DatePicker model.typestringreturns the name of the event.valuestringreturns the currently selected date value.*/ + focusIn? (e: FocusInEventArgs): void; + + /**Fires when DatePicker input loses the focus.*/ + focusOut? (e: FocusOutEventArgs): void; + + /**Fires when DatePicker popup is opened.*/ + open? (e: OpenEventArgs): void; + + /**Fires when a date is selected from the DatePicker popup.*/ + select? (e: SelectEventArgs): void; +} + +export interface BeforeCloseEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the DatePicker model. + */ + model?: ej.DatePicker.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns the event parameters from DatePicker. + */ + events?: any; + + /**returns the DatePicker popup. + */ + element?: HTMLElement; +} + +export interface BeforeDateCreateEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the DatePicker model. + */ + model?: ej.DatePicker.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns the currently created date object. + */ + date?: any; + + /**returns the current DOM object of the date from the Calendar. + */ + element?: HTMLElement; +} + +export interface BeforeOpenEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the DatePicker model. + */ + model?: ej.DatePicker.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns the event parameters from DatePicker. + */ + events?: any; + + /**returns the DatePicker popup. + */ + element?: HTMLElement; +} + +export interface ChangeEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the DatePicker model. + */ + model?: ej.DatePicker.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns the DatePicker input value. + */ + value?: string; + + /**returns the previously selected value. + */ + prevDate?: string; +} + +export interface CloseEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the DatePicker model. + */ + model?: ej.DatePicker.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns the current date value. + */ + value?: string; + + /**returns the previously selected value. + */ + prevDate?: string; +} + +export interface CreateEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the DatePicker model. + */ + model?: ej.DatePicker.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the DatePicker model. + */ + model?: ej.DatePicker.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface FocusInEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the DatePicker model. + */ + model?: ej.DatePicker.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns the currently selected date value. + */ + value?: string; +} + +export interface FocusOutEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the DatePicker model. + */ + model?: ej.DatePicker.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns the currently selected date value. + */ + value?: string; + + /**returns the previously selected date value. + */ + prevDate?: string; +} + +export interface OpenEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the DatePicker model. + */ + model?: ej.DatePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the current date value. + */ + value?: string; + + /**returns the previously selected value. + */ + prevDate?: string; +} + +export interface SelectEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the DatePicker model. + */ + model?: ej.DatePicker.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns the current date value. + */ + value?: string; + + /**returns the previously selected value. + */ + prevDate?: string; + + /**returns whether the currently selected date is special date or not. + */ + isSpecialDay?: string; +} + +export interface Fields { + + /**Specifies the specials dates + */ + date?: string; + + /**Specifies the icon class to special dates. + */ + iconClass?: string; + + /**Specifies the tooltip to special dates. + */ + tooltip?: string; +} + +enum Header{ + + ///Removes day header in DatePicker + None, + + ///sets the short format of day name (like Sun) in header in DatePicker + Short, + + ///sets the Min format of day name (like su) in header format DatePicker + Min +} + + +enum Level{ + + ///allow navigation upto year level in DatePicker + Year, + + ///allow navigation upto decade level in DatePicker + Decade, + + ///allow navigation upto Century level in DatePicker + Century +} + + +enum HighlightSection{ + + ///Highlight the week of the currently selected date in DatePicker popup calendar + Week, + + ///Highlight the workdays in a currently selected date's week in DatePicker popup calendar + WorkDays, + + ///Nothing will be highlighted, remove highlights from DatePicker popup calendar if already exists + None +} + +} + +class DateTimePicker extends ej.Widget { + static fn: DateTimePicker; + constructor(element: JQuery, options?: DateTimePicker.Model); + constructor(element: Element, options?: DateTimePicker.Model); + model:DateTimePicker.Model; + defaults:DateTimePicker.Model; + + /** Disables the DateTimePicker control. + * @returns {void} + */ + disable(): void; + + /** Enables the DateTimePicker control. + * @returns {void} + */ + enable(): void; + + /** Returns the current datetime value in the DateTimePicker. + * @returns {string} + */ + getValue(): string; + + /** Hides or closes the DateTimePicker popup. + * @returns {void} + */ + hide(): void; + + /** Updates the current system date value and time value to the DateTimePicker. + * @returns {void} + */ + setCurrentDateTime(): void; + + /** Shows or opens the DateTimePicker popup. + * @returns {void} + */ + show(): void; +} +export module DateTimePicker{ + +export interface Model { + + /**Displays the custom text for the buttons inside the DateTimePicker popup. when the culture value changed, we can change the buttons text based on the culture. + * @Default {{ today: Today, timeNow: Time Now, done: Done, timeTitle: Time }} + */ + buttonText?: ButtonText; + + /**Set the root class for DateTimePicker theme. This cssClass API helps to use custom skinning option for DateTimePicker control. + */ + cssClass?: string; + + /**Defines the datetime format displayed in the DateTimePicker. The value should be a combination of date format and time format. + * @Default {M/d/yyyy h:mm tt} + */ + dateTimeFormat?: string; + + /**Specifies the header format of the datepicker inside the DateTimePicker popup. See DatePicker.Header + * @Default {ej.DatePicker.Header.Min} + */ + dayHeaderFormat?: ej.DatePicker.Header|string; + + /**Specifies the drill down level in datepicker inside the DateTimePicker popup. See ej.DatePicker.Level + */ + depthLevel?: ej.DatePicker.Level|string; + + /**Enable or disable the animation effect in DateTimePicker. + * @Default {true} + */ + enableAnimation?: boolean; + + /**When this property is set to false, it disables the DateTimePicker control. + * @Default {false} + */ + enabled?: boolean; + + /**Enables or disables the state maintenance of DateTimePicker. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Sets the DateTimePicker direction as right to left alignment. + * @Default {false} + */ + enableRTL?: boolean; + + /**When enableStrictMode true it allows the value outside of the range also but it highlights the textbox with error class, otherwise it internally changed to the correct value. + * @Default {false} + */ + enableStrictMode?: boolean; + + /**Specifies the header format to be displayed in the DatePicker calendar inside the DateTimePicker popup. + * @Default {MMMM yyyy} + */ + headerFormat?: string; + + /**Defines the height of the DateTimePicker textbox. + * @Default {30} + */ + height?: string|number; + + /**Specifies the HTML Attributes of the ejDateTimePicker + * @Default {{}} + */ + htmlAttributes?: any; + + /**Sets the time interval between the two adjacent time values in the time popup. + * @Default {30} + */ + interval?: number; + + /**Defines the localization culture for DateTimePicker. + * @Default {en-US} + */ + locale?: string; + + /**Sets the maximum value to the DateTimePicker. Beyond the maximum value an error class is added to the wrapper element when we set true to enableStrictMode. + * @Default {new Date(12/31/2099 11:59:59 PM)} + */ + maxDateTime?: string|Date; + + /**Sets the minimum value to the DateTimePicker. Behind the minimum value an error class is added to the wrapper element. + * @Default {new Date(1/1/1900 12:00:00 AM)} + */ + minDateTime?: string|Date; + + /**Specifies the popup position of DateTimePicker.See below to know available popup positions + * @Default {ej.DateTimePicker.Bottom} + */ + popupPosition?: string | ej.popupPosition; + + /**Indicates that the DateTimePicker value can only be read and can’t change. + * @Default {false} + */ + readOnly?: boolean; + + /**It allows showing days in other months of DatePicker calendar inside the DateTimePicker popup. + * @Default {true} + */ + showOtherMonths?: boolean; + + /**Shows or hides the arrow button from the DateTimePicker textbox. When the button disabled, the DateTimePicker popup opens while focus in the textbox and hides while focus out from the textbox. + * @Default {true} + */ + showPopupButton?: boolean; + + /**Changes the sharped edges into rounded corner for the DateTimePicker textbox and popup. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Specifies the start day of the week in datepicker inside the DateTimePicker popup. + * @Default {1} + */ + startDay?: number; + + /**Specifies the start level view in datepicker inside the DateTimePicker popup. See DatePicker.Level + * @Default {ej.DatePicker.Level.Month or month} + */ + startLevel?: ej.DatePicker.Level|string; + + /**Specifies the number of months to navigate at one click of next and previous button in datepicker inside the DateTimePicker popup. + * @Default {1} + */ + stepMonths?: number; + + /**Defines the time format displayed in the time dropdown inside the DateTimePicker popup. + * @Default {h:mm tt} + */ + timeDisplayFormat?: string; + + /**We can drill down up to time interval on selected date with meridian details. + * @Default {{ enabled: false, interval: 5, showMeridian: false, autoClose: true }} + */ + timeDrillDown?: TimeDrillDown; + + /**Defines the width of the time dropdown inside the DateTimePicker popup. + * @Default {100} + */ + timePopupWidth?: string|number; + + /**Set the jquery validation error message in DateTimePicker. + * @Default {null} + */ + validationMessage?: any; + + /**Set the jquery validation rules in DateTimePicker. + * @Default {null} + */ + validationRules?: any; + + /**Sets the DateTime value to the control. + */ + value?: string|Date; + + /**Defines the width of the DateTimePicker textbox. + * @Default {143} + */ + width?: string|number; + + /**Fires when the datetime value changed in the DateTimePicker textbox.*/ + change? (e: ChangeEventArgs): void; + + /**Fires when DateTimePicker popup closes.*/ + close? (e: CloseEventArgs): void; + + /**Fires after DateTimePicker control is created.*/ + create? (e: CreateEventArgs): void; + + /**Fires when the DateTimePicker is destroyed successfully*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires when the focus-in happens in the DateTimePicker textbox.*/ + focusIn? (e: FocusInEventArgs): void; + + /**Fires when the focus-out happens in the DateTimePicker textbox.*/ + focusOut? (e: FocusOutEventArgs): void; + + /**Fires when DateTimePicker popup opens.*/ + open? (e: OpenEventArgs): void; +} + +export interface ChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.DateTimePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the current value is valid or not + */ + isValidState?: boolean; + + /**returns the modified datetime value + */ + value?: string; + + /**returns the previously selected date time value + */ + prevDateTime?: string; + + /**returns true if change event triggered by interaction, otherwise returns false + */ + isInteraction?: boolean; +} + +export interface CloseEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.DateTimePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the modified datetime value + */ + value?: string; + + /**returns the previously selected date time value + */ + prevDateTime?: string; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the DateTimePicker model + */ + model?: ej.DateTimePicker.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the DateTimePicker model + */ + model?: ej.DateTimePicker.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface FocusInEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.DateTimePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the datetime value, which is in text box + */ + value?: string; +} + +export interface FocusOutEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.DateTimePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the datetime value, which is in text box + */ + value?: string; +} + +export interface OpenEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.DateTimePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the modified datetime value + */ + value?: string; + + /**returns the previously selected date time value + */ + prevDateTime?: string; +} + +export interface ButtonText { + + /**Sets the text for the Done button inside the datetime popup. + */ + done?: string; + + /**Sets the text for the Now button inside the datetime popup. + */ + timeNow?: string; + + /**Sets the header text for the Time dropdown. + */ + timeTitle?: string; + + /**Sets the text for the Today button inside the datetime popup. + */ + today?: string; +} + +export interface TimeDrillDown { + + /**This is the field to show/hide the timeDrillDown in DateTimePicker. + */ + enabled?: boolean; + + /**Sets the interval time of minutes on selected date. + */ + interval?: number; + + /**Allows the user to show or hide the meridian with time in DateTimePicker. + */ + showMeridian?: boolean; + + /**After choosing the time, the popup will close automatically if we set it as true, otherwise we focus out the DateTimePicker or choose timeNow button for closing the popup. + */ + autoClose?: boolean; +} +} +enum popupPosition +{ +//Opens the DateTimePicker popup below to the DateTimePicker input box +Bottom, +//Opens the DateTimePicker popup above to the DateTimePicker input box +Top, +} + +class Dialog extends ej.Widget { + static fn: Dialog; + constructor(element: JQuery, options?: Dialog.Model); + constructor(element: Element, options?: Dialog.Model); + model:Dialog.Model; + defaults:Dialog.Model; + + /** Closes the dialog widget dynamically. + * @returns {void} + */ + close(): void; + + /** Collapses the content area when it is expanded. + * @returns {void} + */ + collapse(): void; + + /** Destroys the Dialog widget. + * @returns {void} + */ + destroy(): void; + + /** Expands the content area when it is collapsed. + * @returns {void} + */ + expand(): void; + + /** Checks whether the Dialog widget is opened or not. This methods returns Boolean value. + * @returns {void} + */ + isOpen(): void; + + /** Maximizes the Dialog widget. + * @returns {void} + */ + maximize(): void; + + /** Minimizes the Dialog widget. + * @returns {void} + */ + minimize(): void; + + /** Opens the Dialog widget. + * @returns {void} + */ + open(): void; + + /** Pins the dialog in its current position. + * @returns {void} + */ + pin(): void; + + /** Restores the dialog. + * @returns {void} + */ + restore(): void; + + /** Unpins the Dialog widget. + * @returns {void} + */ + unpin(): void; + + /** Sets the title for the Dialog widget. + * @param {string} The title for the dialog widget. + * @returns {void} + */ + setTitle(Title: string): void; + + /** Sets the content for the Dialog widget dynamically. + * @param {string} The content for the dialog widget. It accepts both string and html string. + * @returns {void} + */ + setContent(content: string): void; + + /** Sets the focus on the Dialog widget. + * @returns {void} + */ + focus(): void; +} +export module Dialog{ + +export interface Model { + + /**Adds action buttons like close, minimize, pin, maximize in the dialog header. + */ + actionButtons?: string[]; + + /**Enables or disables draggable. + */ + allowDraggable?: boolean; + + /**Enables or disables keyboard interaction. + */ + allowKeyboardNavigation?: boolean; + + /**Customizes the Dialog widget animations. The Dialog widget can be animated while opening and closing the dialog. In order to customize animation effects, you need to set “enableAnimation” as true. It contains the following sub properties. + */ + animation?: any; + + /**The tooltip text for the dialog close button. + */ + closeIconTooltip?: string; + + /**Closes the dialog widget on pressing the ESC key when it is set to true. + */ + closeOnEscape?: boolean; + + /**The selector for the container element. If the property is set, then dialog will append to the selected element and it is restricted to move only within the specified container element. + */ + containment?: string; + + /**The content type to load the dialog content at run time. The possible values are null, ajax, iframe and image. When it is null (default value), the content inside dialog element will be displayed as content and when it is not null, the content will be loaded from the URL specified in the contentUrl property. + */ + contentType?: string; + + /**The URL to load the dialog content (such as AJAX, image, and iframe). In order to load content from URL, you need to set contentType as ‘ajax’ or ‘iframe’ or ‘image’. + */ + contentUrl?: string; + + /**The root class for the Dialog widget to customize the existing theme. + */ + cssClass?: string; + + /**Enable or disables animation when the dialog is opened or closed. + */ + enableAnimation?: boolean; + + /**Enables or disables the Dialog widget. + */ + enabled?: boolean; + + /**Enable or disables modal dialog. The modal dialog acts like a child window that is displayed on top of the main window/screen and disables the main window interaction until it is closed. + */ + enableModal?: boolean; + + /**Allows the current model values to be saved in local storage or browser cookies for state maintenance when it is set to true. + */ + enablePersistence?: boolean; + + /**Allows the dialog to be resized. The dialog cannot be resized less than the minimum height, width values and greater than the maximum height and width. + */ + enableResize?: boolean; + + /**Displays dialog content from right to left when set to true. + */ + enableRTL?: boolean; + + /**The CSS class name to display the favicon in the dialog header. In order to display favicon, you need to set showHeader as true since the favicon will be displayed in the dialog header. + */ + faviconCSS?: string; + + /**Sets the height for the dialog widget. It accepts both string and integer values. For example, it can accepts values like “auto”, “100%”, “100px” as string type and “100”, “500” as integer type. The unit of integer type value is “px”. + */ + height?: string|number; + + /**Enable or disables responsive behavior. + */ + isResponsive?: boolean; + + /**Default Value:{:.param}“en-US” + */ + locale?: number; + + /**Sets the maximum height for the dialog widget. + */ + maxHeight?: number; + + /**Sets the maximum width for the dialog widget. + */ + maxWidth?: number; + + /**Sets the minimum height for the dialog widget. + */ + minHeight?: number; + + /**Sets the minimum width for the dialog widget. + */ + minWidth?: number; + + /**Displays the Dialog widget at the given X and Y position. + */ + position?: any; + + /**Shows or hides the dialog header. + */ + showHeader?: boolean; + + /**The Dialog widget can be opened by default i.e. on initialization, when it is set to true. + */ + showOnInit?: boolean; + + /**Enables or disables the rounder corner. + */ + showRoundedCorner?: boolean; + + /**The selector for the container element. If this property is set, the dialog will be displayed (positioned) based on its container. + */ + target?: string; + + /**The title text to be displayed in the dialog header. In order to set title, you need to set showHeader as true since the title will be displayed in the dialog header. + */ + title?: string; + + /**Add or configure the tooltip text for actionButtons in the dialog header. + */ + tooltip?: any; + + /**Sets the height for the dialog widget. It accepts both string and integer values. For example, it can accepts values like “auto”, “100%”, “100px” as string type and “100”, “500” as integer type. The unit of integer type value is “px”. + */ + width?: string|number; + + /**Sets the z-index value for the Dialog widget. + */ + zIndex?: number; + + /**This event is triggered before the dialog widgets gets open.*/ + beforeOpen? (e: BeforeOpenEventArgs): void; + + /**This event is triggered whenever the Ajax request fails to retrieve the dialog content.*/ + ajaxError? (e: AjaxErrorEventArgs): void; + + /**This event is triggered whenever the Ajax request to retrieve the dialog content, gets succeed.*/ + ajaxSuccess? (e: AjaxSuccessEventArgs): void; + + /**This event is triggered before the dialog widgets get closed.*/ + beforeClose? (e: BeforeCloseEventArgs): void; + + /**This event is triggered after the dialog widget is closed.*/ + close? (e: CloseEventArgs): void; + + /**Triggered after the dialog content is loaded in DOM.*/ + contentLoad? (e: ContentLoadEventArgs): void; + + /**Triggered after the dialog is created successfully*/ + create? (e: CreateEventArgs): void; + + /**Triggered after the dialog widget is destroyed successfully*/ + destroy? (e: DestroyEventArgs): void; + + /**Triggered while the dialog is dragged.*/ + drag? (e: DragEventArgs): void; + + /**Triggered when the user starts dragging the dialog.*/ + dragStart? (e: DragStartEventArgs): void; + + /**Triggered when the user stops dragging the dialog.*/ + dragStop? (e: DragStopEventArgs): void; + + /**Triggered after the dialog is opened.*/ + open? (e: OpenEventArgs): void; + + /**Triggered while the dialog is resized.*/ + resize? (e: ResizeEventArgs): void; + + /**Triggered when the user starts resizing the dialog.*/ + resizeStart? (e: ResizeStartEventArgs): void; + + /**Triggered when the user stops resizing the dialog.*/ + resizeStop? (e: ResizeStopEventArgs): void; + + /**Triggered when the dialog content is expanded.*/ + expand? (e: ExpandEventArgs): void; + + /**Triggered when the dialog content is collapsed.*/ + collapse? (e: CollapseEventArgs): void; +} + +export interface BeforeOpenEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event + */ + type?: string; +} + +export interface AjaxErrorEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event. + */ + type?: string; + + /**URL of the content. + */ + url?: string; + + /**Error page content. + */ + responseText?: string; + + /**Error code. + */ + status?: number; + + /**The corresponding error description. + */ + statusText?: string; +} + +export interface AjaxSuccessEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event. + */ + type?: string; + + /**URL of the content. + */ + url?: string; + + /**Response content. + */ + data?: string; +} + +export interface BeforeCloseEventArgs { + + /**Current event object. + */ + event?: any; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event. + */ + type?: string; +} + +export interface CloseEventArgs { + + /**Current event object. + */ + event?: any; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event + */ + type?: string; +} + +export interface ContentLoadEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event. + */ + type?: string; + + /**URL of the content. + */ + url?: string; + + /**Content type + */ + contentType?: any; +} + +export interface CreateEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event. + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event. + */ + type?: string; +} + +export interface DragEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event. + */ + type?: string; + + /**Current event object. + */ + event?: any; +} + +export interface DragStartEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event. + */ + type?: string; + + /**Current event object. + */ + event?: any; +} + +export interface DragStopEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event. + */ + type?: string; + + /**Current event object. + */ + event?: any; +} + +export interface OpenEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event. + */ + type?: string; +} + +export interface ResizeEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event. + */ + type?: string; + + /**Current event object. + */ + event?: any; +} + +export interface ResizeStartEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event + */ + type?: string; + + /**Current event object. + */ + event?: any; +} + +export interface ResizeStopEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event + */ + type?: string; + + /**Current event object. + */ + event?: any; +} + +export interface ExpandEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event. + */ + type?: string; +} + +export interface CollapseEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event. + */ + type?: string; +} +} + +class DropDownList extends ej.Widget { + static fn: DropDownList; + constructor(element: JQuery, options?: DropDownList.Model); + constructor(element: Element, options?: DropDownList.Model); + model:DropDownList.Model; + defaults:DropDownList.Model; + + /** Adding a single item or an array of items into the DropDownList allows you to specify all the field attributes such as value, template, image URL, and html attributes for those items. + * @param {any|Array} this parameter should have field attributes with respect to mapped field attributes and it's corresponding values to fields + * @returns {void} + */ + addItem(data: any|Array): void; + + /** This method is used to select all the items in the DropDownList. + * @returns {void} + */ + checkAll(): void; + + /** Clears the text in the DropDownList textbox. + * @returns {void} + */ + clearText(): void; + + /** Destroys the DropDownList widget. + * @returns {void} + */ + destroy(): void; + + /** This property is used to disable the DropDownList widget. + * @returns {void} + */ + disable(): void; + + /** This property disables the set of items in the DropDownList. + * @param {string|number|Array} disable the given index list items + * @returns {void} + */ + disableItemsByIndices(index: string|number|Array): void; + + /** This property enables the DropDownList control. + * @returns {void} + */ + enable(): void; + + /** Enables an Item or set of Items that are disabled in the DropDownList + * @param {string|number|Array} enable the given index list items if it's disabled + * @returns {void} + */ + enableItemsByIndices(index: string|number|Array): void; + + /** This method retrieves the items using given value. + * @param {string|number|any} Return the whole object of data based on given value + * @returns {any} + */ + getItemDataByValue(value: string|number|any): any; + + /** This method is used to retrieve the items that are bound with the DropDownList. + * @returns {any} + */ + getListData(): any; + + /** This method is used to get the selected items in the DropDownList. + * @returns {HTMLElement} + */ + getSelectedItem(): HTMLElement; + + /** This method is used to retrieve the items value that are selected in the DropDownList. + * @returns {string} + */ + getSelectedValue(): string; + + /** This method hides the suggestion popup in the DropDownList. + * @returns {void} + */ + hidePopup(): void; + + /** This method is used to select the list of items in the DropDownList through the Index of the items. + * @param {string|number|Array} select the given index list items + * @returns {void} + */ + selectItemsByIndices(index: string|number|Array): void; + + /** This method is used to select an item in the DropDownList by using the given text value. + * @param {string|number|Array} select the list items relates to given text + * @returns {void} + */ + selectItemByText(index: string|number|Array): void; + + /** This method is used to select an item in the DropDownList by using the given value. + * @param {string|number|Array} select the list items relates to given values + * @returns {void} + */ + selectItemByValue(index: string|number|Array): void; + + /** This method shows the DropDownList control with the suggestion popup. + * @returns {void} + */ + showPopup(): void; + + /** This method is used to unselect all the items in the DropDownList. + * @returns {void} + */ + unCheckAll(): void; + + /** This method is used to unselect the list of items in the DropDownList through Index of the items. + * @param {string|number|Array} unselect the given index list items + * @returns {void} + */ + unselectItemsByIndices(index: string|number|Array): void; + + /** This method is used to unselect an item in the DropDownList by using the given text value. + * @param {string|number|Array} unselect the list items realtes to given text + * @returns {void} + */ + unselectItemByText(index: string|number|Array): void; + + /** This method is used to unselect an item in the DropDownList by using the given value. + * @param {string|number|Array} unselect the list items realtes to given values + * @returns {void} + */ + unselectItemByValue(index: string|number|Array): void; +} +export module DropDownList{ + +export interface Model { + + /**The cascading DropDownLists is a series of two or more DropDownLists in which each DropDownList is filtered according to the previous DropDownList’s value. + * @Default {null} + */ + cascadeTo?: string; + + /**Sets the case sensitivity of the search operation. It supports both enableFilterSearch and enableIncrementalSearch property. + * @Default {false} + */ + caseSensitiveSearch?: boolean; + + /**Dropdown widget's style and appearance can be controlled based on 13 different default built-in themes.You can customize the appearance of the dropdown by using the cssClass property. You need to specify a class name in the cssClass property and the same class name is used before the class definitions wherever the custom styles are applied. + */ + cssClass?: string; + + /**This property is used to serve data from the data services based on the query provided. To bind the data to the dropdown widget, the dataSource property is assigned with the instance of the ej.DataManager. + * @Default {null} + */ + dataSource?: any; + + /**Sets the separator when the multiSelectMode with delimiter option or checkbox is enabled with the dropdown. When you enter the delimiter value, the texts after the delimiter are considered as a separate word or query. The delimiter string is a single character and must be a symbol. Mostly, the delimiter symbol is used as comma (,) or semi-colon (;) or any other special character. + * @Default {','} + */ + delimiterChar?: string; + + /**The enabled Animation property uses the easeOutQuad animation to SlideDown and SlideUp the Popup list in 200 and 100 milliseconds, respectively. + * @Default {false} + */ + enableAnimation?: boolean; + + /**This property is used to indicate whether the DropDownList control responds to the user interaction or not. By default, the control is in the enabled mode and you can disable it by setting it to false. + * @Default {true} + */ + enabled?: boolean; + + /**Specifies to perform incremental search for the selection of items from the DropDownList with the help of this property. This helps in selecting the item by using the typed character. + * @Default {true} + */ + enableIncrementalSearch?: boolean; + + /**This property selects the item in the DropDownList when the item is entered in the Search textbox. + * @Default {false} + */ + enableFilterSearch?: boolean; + + /**Saves the current model value to the browser cookies for state maintenance. While refreshing the DropDownList control page, it retains the model value and it is applied from the browser cookies. + * @Default {false} + */ + enablePersistence?: boolean; + + /**This enables the resize handler to resize the popup to any size. + * @Default {false} + */ + enablePopupResize?: boolean; + + /**Sets the DropDownList textbox direction from right to left align. + * @Default {false} + */ + enableRTL?: boolean; + + /**This property is used to sort the Items in the DropDownList. By default, it sorts the items in an ascending order. + * @Default {false} + */ + enableSorting?: boolean; + + /**Specifies the mapping fields for the data items of the DropDownList. + * @Default {null} + */ + fields?: Fields; + + /**When the enableFilterSearch property value is set to true, the values in the DropDownList shows the items starting with or containing the key word/letter typed in the Search textbox. + * @Default {ej.FilterType.Contains} + */ + filterType?: ej.FilterType|string; + + /**Used to create visualized header for dropdown items + * @Default {null} + */ + headerTemplate?: string; + + /**Defines the height of the DropDownList textbox. + * @Default {null} + */ + height?: string|number; + + /**It sets the given HTML attributes for the DropDownList control such as ID, name, disabled, etc. + * @Default {null} + */ + htmlAttributes?: any; + + /**Data can be fetched in the DropDownList control by using the DataSource, specifying the number of items. + * @Default {5} + */ + itemsCount?: number; + + /**Defines the maximum height of the suggestion box. This property restricts the maximum height of the popup when resize is enabled. + * @Default {null} + */ + maxPopupHeight?: string|number; + + /**Defines the minimum height of the suggestion box. This property restricts the minimum height of the popup when resize is enabled. + * @Default {null} + */ + minPopupHeight?: string|number; + + /**Defines the maximum width of the suggestion box. This property restricts the maximum width of the popup when resize is enabled. + * @Default {null} + */ + maxPopupWidth?: string|number; + + /**Defines the minimum height of the suggestion box. This property restricts the minimum height of the popup when resize is enabled. + * @Default {0} + */ + minPopupWidth?: string|number; + + /**With the help of this property, you can make a single or multi selection with the DropDownList and display the text in two modes, delimiter and visual mode. In delimiter mode, you can separate the items by using the delimiter character such as comma (,) or semi-colon (;) or any other special character. In the visual mode, the items are showcased like boxes with close icon in the textbox. + * @Default {ej.MultiSelectMode.None} + */ + multiSelectMode?: ej.MultiSelectMode|string; + + /**Defines the height of the suggestion popup box in the DropDownList control. + * @Default {152px} + */ + popupHeight?: string|number; + + /**Defines the width of the suggestion popup box in the DropDownList control. + * @Default {auto} + */ + popupWidth?: string|number; + + /**Specifies the query to retrieve the data from the DataSource. + * @Default {null} + */ + query?: any; + + /**Specifies that the DropDownList textbox values should be read-only. + * @Default {false} + */ + readOnly?: boolean; + + /**Specifies an item to be selected in the DropDownList. + * @Default {null} + */ + selectedIndex?: number; + + /**Specifies the selectedItems for the DropDownList. + * @Default {[]} + */ + selectedIndices?: Array; + + /**Selects multiple items in the DropDownList with the help of the checkbox control. To achieve this, enable the showCheckbox option to true. + * @Default {false} + */ + showCheckbox?: boolean; + + /**DropDownList control is displayed with the popup seen. + * @Default {false} + */ + showPopupOnLoad?: boolean; + + /**DropDownList textbox displayed with the rounded corner style. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**When the enableSorting property value is set to true, this property helps to sort the items either in ascending or descending order + * @Default {ej.sortOrder.Ascending} + */ + sortOrder?: ej.SortOrder|string; + + /**Specifies the targetID for the DropDownList’s items. + * @Default {null} + */ + targetID?: string; + + /**By default, you can add any text or image to the DropDownList item. To customize the item layout or to create your own visualized elements, you can use this template support. + * @Default {null} + */ + template?: string; + + /**Defines the text value that is displayed in the DropDownList textbox. + * @Default {null} + */ + text?: string; + + /**Sets the jQuery validation error message in the DropDownList + * @Default {null} + */ + validationMessage?: any; + + /**Sets the jquery validation rules in the Dropdownlist. + * @Default {null} + */ + validationRules?: any; + + /**Specifies the value (text content) for the DropDownList control. + * @Default {null} + */ + value?: string; + + /**Specifies a short hint that describes the expected value of the DropDownList control. + * @Default {null} + */ + watermarkText?: string; + + /**Defines the width of the DropDownList textbox. + * @Default {null} + */ + width?: string|number; + + /**The Virtual Scrolling feature is used to display a large amount of records in the DropDownList, that is, when scrolling, an Ajax request is sent to fetch some amount of data from the server dynamically. To achieve this scenario with DropDownList, set the allowVirtualScrolling to true. You can set the itemsCount property that represents the number of items to be fetched from the server on every Ajax request. + * @Default {normal} + */ + virtualScrollMode?: ej.VirtualScrollMode|string; + + /**Fires the action before the XHR request.*/ + actionBegin? (e: ActionBeginEventArgs): void; + + /**Fires the action when the list of items is bound to the DropDownList by xhr post calling*/ + actionComplete? (e: ActionCompleteEventArgs): void; + + /**Fires the action when the xhr post calling failed on remote data binding with the DropDownList control.*/ + actionFailure? (e: ActionFailureEventArgs): void; + + /**Fires the action when the xhr post calling succeed on remote data binding with the DropDownList control*/ + actionSuccess? (e: ActionSuccessEventArgs): void; + + /**Fires the action before the popup is ready to hide.*/ + beforePopupHide? (e: BeforePopupHideEventArgs): void; + + /**Fires the action before the popup is ready to be displayed.*/ + beforePopupShown? (e: BeforePopupShownEventArgs): void; + + /**Fires when the cascading happens between two DropDownList exactly after the value changes in the first dropdown and before filtering in the second Dropdown.*/ + cascade? (e: CascadeEventArgs): void; + + /**Fires the action when the DropDownList control’s value is changed.*/ + change? (e: ChangeEventArgs): void; + + /**Fires the action when the list item checkbox value is changed.*/ + checkChange? (e: CheckChangeEventArgs): void; + + /**Fires the action once the DropDownList is created.*/ + create? (e: CreateEventArgs): void; + + /**Fires the action when the list items is bound to the DropDownList.*/ + dataBound? (e: DataBoundEventArgs): void; + + /**Fires the action when the DropDownList is destroyed.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires the action, once the popup is closed*/ + popupHide? (e: PopupHideEventArgs): void; + + /**Fires the action, when the popup is resized.*/ + popupResize? (e: PopupResizeEventArgs): void; + + /**Fires the action, once the popup is opened.*/ + popupShown? (e: PopupShownEventArgs): void; + + /**Fires the action, when resizing a popup starts.*/ + popupResizeStart? (e: PopupResizeStartEventArgs): void; + + /**Fires the action, when the popup resizing is stopped.*/ + popupResizeStop? (e: PopupResizeStopEventArgs): void; + + /**Fires the action before filtering the list items that starts in the DropDownList when the enableFilterSearch is enabled.*/ + search? (e: SearchEventArgs): void; + + /**Fires the action, when the list of item is selected.*/ + select? (e: SelectEventArgs): void; +} + +export interface ActionBeginEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the DropDownList model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface ActionCompleteEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns number of times trying to fetch the data + */ + count?: number; + + /**returns the DropDownList model + */ + model?: any; + + /**Returns the query for data retrieval + */ + query?: any; + + /**Returns the query for data retrieval from the Database + */ + request?: any; + + /**returns the name of the event + */ + type?: string; + + /**Returns the number of items fetched from remote data + */ + result?: Array; + + /**Returns the requested data + */ + xhr?: any; +} + +export interface ActionFailureEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns the error message + */ + error?: any; + + /**returns the DropDownList model + */ + model?: any; + + /**Returns the query for data retrieval + */ + query?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface ActionSuccessEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns number of times trying to fetch the data + */ + count?: number; + + /**returns the DropDownList model + */ + model?: any; + + /**Returns the query for data retrieval + */ + query?: any; + + /**Returns the query for data retrieval from the Database + */ + request?: any; + + /**returns the name of the event + */ + type?: string; + + /**Returns the number of items fetched from remote data + */ + result?: Array; + + /**Returns the requested data + */ + xhr?: any; +} + +export interface BeforePopupHideEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the DropDownList model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; + + /**returns the selected text + */ + text?: string; + + /**returns the selected value + */ + value?: string; +} + +export interface BeforePopupShownEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the DropDownList model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; + + /**returns the selected text + */ + text?: string; + + /**returns the selected value + */ + value?: string; +} + +export interface CascadeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns the cascading dropdown model. + */ + cascadeModel?: any; + + /**returns the current selected value in first dropdown. + */ + cascadeValue?: string; + + /**returns the DropDownList model + */ + model?: any; + + /**returns the default filter action for second dropdown data should happen or not. + */ + requiresDefaultFilter?: boolean; + + /**returns the name of the event + */ + type?: string; +} + +export interface ChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns the selected item with checkbox checked or not. + */ + isChecked?: boolean; + + /**Returns the selected item ID. + */ + itemId?: string; + + /**returns the DropDownList model + */ + model?: any; + + /**Returns the selected item text. + */ + selectedText?: string; + + /**returns the name of the event + */ + type?: string; + + /**Returns the selected text. + */ + text?: string; + + /**Returns the selected value. + */ + value?: string; +} + +export interface CheckChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns the selected item with checkbox checked or not. + */ + isChecked?: boolean; + + /**Returns the selected item ID. + */ + itemId?: string; + + /**returns the DropDownList model + */ + model?: any; + + /**Returns the selected item text. + */ + selectedText?: string; + + /**returns the name of the event + */ + type?: string; + + /**Returns the selected text. + */ + text?: string; + + /**Returns the selected value. + */ + value?: string; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the DropDownList model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface DataBoundEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the DropDownList model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; + + /**returns the data that is bound to DropDownList + */ + data?: any; +} + +export interface DestroyEventArgs { + + /**its value is set as true,if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the DropDownList model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface PopupHideEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the DropDownList model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; + + /**returns the selected text + */ + text?: string; + + /**returns the selected value + */ + value?: string; +} + +export interface PopupResizeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the DropDownList model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; + + /**Returns the data from the resizable plugin. + */ + event?: any; +} + +export interface PopupShownEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the DropDownList model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; + + /**returns the selected text + */ + text?: string; + + /**returns the selected value + */ + value?: string; +} + +export interface PopupResizeStartEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the DropDownList model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; + + /**Returns the data from the resizable plugin. + */ + event?: any; +} + +export interface PopupResizeStopEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the DropDownList model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; + + /**Returns the data from the resizable plugin. + */ + event?: any; +} + +export interface SearchEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns the data bound to the DropDownList. + */ + items?: any; + + /**returns the DropDownList model + */ + model?: any; + + /**Returns the selected item text. + */ + selectedText?: string; + + /**returns the name of the event + */ + type?: string; + + /**Returns the search string typed in search box. + */ + searchString?: string; +} + +export interface SelectEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns the selected item with checkbox checked or not. + */ + isChecked?: boolean; + + /**Returns the selected item ID. + */ + itemId?: string; + + /**returns the DropDownList model + */ + model?: any; + + /**Returns the selected item text. + */ + selectedText?: string; + + /**returns the name of the event + */ + type?: string; + + /**Returns the selected text. + */ + text?: string; + + /**Returns the selected value. + */ + value?: string; +} + +export interface Fields { + + /**Used to group the items. + */ + groupBy?: string; + + /**Defines the HTML attributes such as ID, class, and styles for the item. + */ + htmlAttributes?: any; + + /**Defines the ID for the tag. + */ + id?: string; + + /**Defines the image attributes such as height, width, styles, and so on. + */ + imageAttributes?: string; + + /**Defines the imageURL for the image location. + */ + imageUrl?: string; + + /**Defines the tag value to be selected initially. + */ + selected?: boolean; + + /**Defines the sprite css for the image tag. + */ + spriteCssClass?: string; + + /**Defines the table name for tag value or display text while rendering remote data. + */ + tableName?: string; + + /**Defines the text content for the tag. + */ + text?: string; + + /**Defines the tag value. + */ + value?: string; +} +} +enum FilterType +{ +//filter the data wherever contains search key +Contains, +//filter the data based on search key present at start position +StartsWith, +} +enum MultiSelectMode +{ +// can select only single item in DropDownList +None, +//can select multiple items and it's seperated by delimiterChar +Delimiter, +// can select multiple items and it's show's like visual box in textbox +VisualMode, +} +enum SortOrder +{ +// Sort the data in ascending order +Ascending, +//Sort the data in descending order +Descending, +} +enum VirtualScrollMode +{ +// The data is loaded only to the corresponding page (display items). When scrolling some other position, it enables the load on demand with the DropDownList. +Normal, +//The data items are loaded from the remote when scroll handle reaches the end of the scrollbar like infinity scrolling. +Continuous, +} + +class Editor extends ej.Widget { + static fn: Editor; + constructor(element: JQuery, options?: Editor.Model); + constructor(element: Element, options?: Editor.Model); + model:Editor.Model; + defaults:Editor.Model; + + /** destroy the editor widgets all events are unbind automatically and bring the control to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** To disable the corresponding Editors + * @returns {void} + */ + disable(): void; + + /** To enable the corresponding Editors + * @returns {void} + */ + enable(): void; + + /** To get value from corresponding Editors + * @returns {number} + */ + getValue(): number; +} + + class NumericTextbox extends Editor{ +} + + class CurrencyTextbox extends Editor{ +} + + class PercentageTextbox extends Editor{ +} +export module Editor{ + +export interface Model { + + /**Sets the root CSS class for Accordion theme, which is used customize. + */ + cssClass?: string; + + /**DecimalPlaces declares the number of digits to be displayed right side of the value. + * @Default {0} + */ + decimalPlaces?: number; + + /**Specify the editor control state. + * @Default {true} + */ + enabled?: boolean; + + /**Specify the enablePersistence to editor to save current model value to browser cookies for state maintains + * @Default {false} + */ + enablePersistence?: boolean; + + /**Specify the Right to Left Direction to editor. + * @Default {false} + */ + enableRTL?: boolean; + + /**Strict mode option to restrict entering values defined outside the range in the editor. + * @Default {false} + */ + enableStrictMode?: boolean; + + /**It provides the options to get the customized character to separate the digits. If not set, the separator defined by the current culture. + * @Default {null} + */ + groupSeparator?: string; + + /**Specifies the height of the editor. + * @Default {30} + */ + height?: number|string; + + /**It allows to define the characteristics of the Editors control. It will helps to extend the capability of an HTML element. + * @Default {{}} + */ + htmlAttributes?: any; + + /**The Editor value increment or decrement based an increment step value. + * @Default {1} + */ + incrementStep?: number; + + /**Specifies the Localization info used by the editor. + * @Default {en-US} + */ + locale?: string; + + /**Specifies the maximum value of the editor. + * @Default {Number.MAX_VALUE} + */ + maxValue?: number; + + /**Specifies the minimum value of the editor. + * @Default {-(Number.MAX_VALUE) and 0 for Currency Textbox.} + */ + minValue?: number; + + /**Specifies the name of the editor. + * @Default {Sets id as name if it is null.} + */ + name?: string; + + /**Toggles the readonly state of the editor. When the Editor is readonly it doesn't allow user interactions. + * @Default {false} + */ + readOnly?: boolean; + + /**Specify the rounded corner to editor + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Specifies whether the up and down spin buttons should be displayed in editor. + * @Default {true} + */ + showSpinButton?: boolean; + + /**Enables decimal separator position validation on type . + * @Default {false} + */ + validateOnType?: boolean; + + /**Set the jQuery validation error message in editor. + * @Default {null} + */ + validationMessage?: any; + + /**Set the jQuery validation rules to the editor. + * @Default {null} + */ + validationRules?: any; + + /**Specifies the value of the editor. + * @Default {null} + */ + value?: number|string; + + /**Specify the watermark text to editor. + */ + watermarkText?: string; + + /**Specifies the width of the editor. + * @Default {143} + */ + width?: number|string; + + /**Fires after Editor control value is changed.*/ + change? (e: ChangeEventArgs): void; + + /**Fires after Editor control is created.*/ + create? (e: CreateEventArgs): void; + + /**Fires when the Editor is destroyed successfully.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires after Editor control is focused.*/ + focusIn? (e: FocusInEventArgs): void; + + /**Fires after Editor control is loss the focus.*/ + focusOut? (e: FocusOutEventArgs): void; +} + +export interface ChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the corresponding editor model. + */ + model ?: ej.Editor.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns the corresponding editor control value. + */ + value ?: number; + + /**returns true when the value changed by user interaction otherwise returns false + */ + isInteraction ?: boolean; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the editor model + */ + model ?: ej.Editor.Model; + + /**returns the name of the event + */ + type ?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the editor model + */ + model ?: ej.Editor.Model; + + /**returns the name of the event + */ + type ?: string; +} + +export interface FocusInEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the corresponding editor model. + */ + model?: ej.Editor.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns the corresponding editor control value. + */ + value?: number; +} + +export interface FocusOutEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the corresponding editor model. + */ + model?: ej.Editor.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns the corresponding editor control value. + */ + value?: number; +} +} + +class ListView extends ej.Widget { + static fn: ListView; + constructor(element: JQuery, options?: ListView.Model); + constructor(element: Element, options?: ListView.Model); + model:ListView.Model; + defaults:ListView.Model; + + /** To add item in the given index. + * @param {string} Specifies the item to be added in ListView + * @param {number} Specifies the index where item to be added + * @returns {void} + */ + addItem(item: string, index: number): void; + + /** To check all the items. + * @returns {void} + */ + checkAllItem(): void; + + /** To check item in the given index. + * @param {number} Specifies the index of the item to be checked + * @returns {void} + */ + checkItem(index: number): void; + + /** To clear all the list item in the control before updating with new datasource. + * @returns {void} + */ + clear(): void; + + /** To make the item in the given index to be default state. + * @param {number} Specifies the index to make the item to be in default state. + * @returns {void} + */ + deActive(index: number): void; + + /** To disable item in the given index. + * @param {number} Specifies the index value to be disabled. + * @returns {void} + */ + disableItem(index: number): void; + + /** To enable item in the given index. + * @param {number} Specifies the index value to be enabled. + * @returns {void} + */ + enableItem(index: number): void; + + /** To get the active item. + * @returns {HTMLElement} + */ + getActiveItem(): HTMLElement; + + /** To get the text of the active item. + * @returns {string} + */ + getActiveItemText(): string; + + /** To get all the checked items. + * @returns {Array} + */ + getCheckedItems(): Array; + + /** To get the text of all the checked items. + * @returns {Array} + */ + getCheckedItemsText(): Array; + + /** To get the total item count. + * @returns {number} + */ + getItemsCount(): number; + + /** To get the text of the item in the given index. + * @param {string|number} Specifies the index value to get the textvalue. + * @returns {string} + */ + getItemText(index: string|number): string; + + /** To check whether the item in the given index has child item. + * @param {number} Specifies the index value to check the item has child or not. + * @returns {boolean} + */ + hasChild(index: number): boolean; + + /** To hide the list. + * @returns {void} + */ + hide(): void; + + /** To hide item in the given index. + * @param {number} Specifies the index value to hide the item. + * @returns {void} + */ + hideItem(index: number): void; + + /** To check whether item in the given index is checked. + * @returns {boolean} + */ + isChecked(): boolean; + + /** To load the ajax content while selecting the item. + * @param {string} Specifies the item to load the ajax content. + * @returns {void} + */ + loadAjaxContent(item: string): void; + + /** To remove the check mark either for specific item in the given index or for all items. + * @param {number} Specifies the index value to remove the checkbox. + * @returns {void} + */ + removeCheckMark(index: number): void; + + /** To remove item in the given index. + * @param {number} Specifies the index value to remove the item. + * @returns {void} + */ + removeItem(index: number): void; + + /** To select item in the given index. + * @param {number} Specifies the index value to select the item. + * @returns {void} + */ + selectItem(index: number): void; + + /** To make the item in the given index to be active state. + * @param {number} Specifies the index value to make the item in active state. + * @returns {void} + */ + setActive(index: number): void; + + /** To show the list. + * @returns {void} + */ + show(): void; + + /** To show item in the given index. + * @param {number} Specifies the index value to show the hided item. + * @returns {void} + */ + showItem(index: number): void; + + /** To uncheck all the items. + * @returns {void} + */ + unCheckAllItem(): void; + + /** To uncheck item in the given index. + * @param {number} Specifies the index value to uncheck the item. + * @returns {void} + */ + unCheckItem(index: number): void; +} +export module ListView{ + +export interface Model { + + /**Sets the root class for ListView theme. This cssClass API helps to use custom skinning option for ListView control. By defining the root class using this API, we need to include this root class in CSS. + */ + cssClass?: string; + + /**Contains the list of data for generating the ListView items. + * @Default {[]} + */ + dataSource?: Array; + + /**Specifies whether to load ajax content while selecting item. + * @Default {false} + */ + enableAjax?: boolean; + + /**Specifies whether to enable caching the content. + * @Default {false} + */ + enableCache?: boolean; + + /**Specifies whether to enable check mark for the item. + * @Default {false} + */ + enableCheckMark?: boolean; + + /**Specifies whether to enable the filtering feature to filter the item. + * @Default {false} + */ + enableFiltering?: boolean; + + /**Specifies whether to group the list item. + * @Default {false} + */ + enableGroupList?: boolean; + + /**Specifies to maintain the current model value to browser cookies for state maintenance. While refresh the page, the model value will get apply to the control from browser cookies. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Specifies the field settings to map the datasource. + */ + fieldSettings?: any; + + /**Specifies the text of the back button in the header. + * @Default {null} + */ + headerBackButtonText?: string; + + /**Specifies the title of the header. + * @Default {Title} + */ + headerTitle?: string; + + /**Specifies the height. + * @Default {null} + */ + height?: number; + + /**Specifies whether to retain the selection of the item. + * @Default {false} + */ + persistSelection?: boolean; + + /**Specifies whether to prevent the selection of the item. + * @Default {false} + */ + preventSelection?: boolean; + + /**Specifies the query to execute with the datasource. + * @Default {null} + */ + query?: any; + + /**Specifies whether need to render the control with the template contents. + * @Default {false} + */ + renderTemplate?: boolean; + + /**Specifies the index of item which need to be in selected state initially while loading. + * @Default {0} + */ + selectedItemIndex?: number; + + /**Specifies whether to show the header. + * @Default {true} + */ + showHeader?: boolean; + + /**Specifies ID of the element contains template contents. + * @Default {false} + */ + templateId?: boolean; + + /**Specifies the width. + * @Default {null} + */ + width?: number; + + /**Event triggers before the ajax request happens.*/ + ajaxBeforeLoad? (e: AjaxBeforeLoadEventArgs): void; + + /**Event triggers after the ajax content loaded completely.*/ + ajaxComplete? (e: AjaxCompleteEventArgs): void; + + /**Event triggers when the ajax request failed.*/ + ajaxError? (e: AjaxErrorEventArgs): void; + + /**Event triggers after the ajax content loaded successfully.*/ + ajaxSuccess? (e: AjaxSuccessEventArgs): void; + + /**Event triggers before the items loaded.*/ + load? (e: LoadEventArgs): void; + + /**Event triggers after the items loaded.*/ + loadComplete? (e: LoadCompleteEventArgs): void; + + /**Event triggers when mouse down happens on the item.*/ + mouseDown? (e: MouseDownEventArgs): void; + + /**Event triggers when mouse up happens on the item.*/ + mouseUP? (e: MouseUPEventArgs): void; +} + +export interface AjaxBeforeLoadEventArgs { + + /**returns true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the name of the event. + */ + type?: string; + + /**returns the model value of the control. + */ + model?: any; + + /**returns the ajax settings. + */ + ajaxData?: any; +} + +export interface AjaxCompleteEventArgs { + + /**returns true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the name of the event. + */ + type?: string; + + /**returns the model value of the control. + */ + model?: any; +} + +export interface AjaxErrorEventArgs { + + /**returns true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the name of the event. + */ + type?: string; + + /**returns the model value of the control. + */ + model?: any; + + /**returns the error thrown in the ajax post. + */ + errorThrown?: any; + + /**returns the status. + */ + textStatus?: any; + + /**returns the current list item. + */ + item?: any; + + /**returns the current item text. + */ + text?: string; + + /**returns the current item index. + */ + index?: number; +} + +export interface AjaxSuccessEventArgs { + + /**returns true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the name of the event. + */ + type?: string; + + /**returns the model value of the control. + */ + model?: any; + + /**returns the ajax current content. + */ + content?: string; + + /**returns the current list item. + */ + item?: any; + + /**returns the current item text. + */ + text?: string; + + /**returns the current item index. + */ + index?: number; + + /**returns the current url of the ajax post. + */ + url?: string; +} + +export interface LoadEventArgs { + + /**returns true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the name of the event. + */ + type?: string; + + /**returns the model value of the control. + */ + model?: any; +} + +export interface LoadCompleteEventArgs { + + /**returns true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the name of the event. + */ + type?: string; + + /**returns the model value of the control. + */ + model?: any; +} + +export interface MouseDownEventArgs { + + /**returns true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the name of the event. + */ + type?: string; + + /**returns the model value of the control. + */ + model?: any; + + /**If the child element exist return true; otherwise, false. + */ + hasChild?: boolean; + + /**returns the current list item. + */ + item?: string; + + /**returns the current text of item. + */ + text?: string; + + /**returns the current Index of the item. + */ + index?: number; + + /**If checked return true; otherwise, false. + */ + isChecked?: boolean; + + /**returns the list of checked items. + */ + checkedItems?: number; + + /**returns the current checked item text. + */ + checkedItemsText?: string; +} + +export interface MouseUPEventArgs { + + /**returns true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the name of the event. + */ + type?: string; + + /**returns the model value of the control. + */ + model?: any; + + /**If the child element exist return true; otherwise, false. + */ + hasChild?: boolean; + + /**returns the current list item. + */ + item?: string; + + /**returns the current text of item. + */ + text?: string; + + /**returns the current Index of the item. + */ + index?: number; + + /**If checked return true; otherwise, false. + */ + isChecked?: boolean; + + /**returns the list of checked items. + */ + checkedItems?: number; + + /**returns the current checked item text. + */ + checkedItemsText?: string; +} +} + +class MaskEdit extends ej.Widget { + static fn: MaskEdit; + constructor(element: JQuery, options?: MaskEdit.Model); + constructor(element: Element, options?: MaskEdit.Model); + model:MaskEdit.Model; + defaults:MaskEdit.Model; + + /** To clear the text in mask edit textbox control. + * @returns {void} + */ + clear(): void; + + /** To disable the mask edit textbox control. + * @returns {void} + */ + disable(): void; + + /** To enable the mask edit textbox control. + * @returns {void} + */ + enable(): void; + + /** To obtained the pure value of the text value, removes all the symbols in mask edit textbox control. + * @returns {string} + */ + get_StrippedValue(): string; + + /** To obtained the textbox value as such that, Just replace all '_' to ' '(space) in mask edit textbox control. + * @returns {string} + */ + get_UnstrippedValue(): string; +} +export module MaskEdit{ + +export interface Model { + + /**Specify the cssClass to achieve custom theme. + * @Default {null} + */ + cssClass?: string; + + /**Specify the custom character allowed to entered in mask edit textbox control. + * @Default {null} + */ + customCharacter?: string; + + /**Specify the state of the mask edit textbox control. + * @Default {true} + */ + enabled?: boolean; + + /**Specify the enablePersistence to mask edit textbox to save current model value to browser cookies for state maintains. + */ + enablePersistence?: boolean; + + /**Specifies the height for the mask edit textbox control. + * @Default {28 px} + */ + height?: string; + + /**Specifies whether hide the prompt characters with spaces on blur. Prompt chars will be shown again on focus the textbox. + * @Default {false} + */ + hidePromptOnLeave?: boolean; + + /**Specifies the list of html attributes to be added to mask edit textbox. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Specify the inputMode for mask edit textbox control. See InputMode + * @Default {ej.InputMode.Text} + */ + inputMode?: ej.InputMode|string; + + /**Specifies the input mask. + * @Default {null} + */ + maskFormat?: string; + + /**Specifies the name attribute value for the mask edit textbox. + * @Default {null} + */ + name?: string; + + /**Toggles the readonly state of the mask edit textbox. When the mask edit textbox is readonly, it doesn't allow your input. + * @Default {false} + */ + readOnly?: boolean; + + /**Specifies whether the error will show until correct value entered in the mask edit textbox control. + * @Default {false} + */ + showError?: boolean; + + /**MaskEdit input is displayed in rounded corner style when this property is set to true. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Specify the text alignment for mask edit textbox control.See TextAlign + * @Default {left} + */ + textAlign?: ej.TextAlign|string; + + /**Sets the jQuery validation error message in mask edit. This property works when the widget is present inside the form. Include jquery.validate.min.js plugin additionally. + * @Default {null} + */ + validationMessage?: any; + + /**Sets the jQuery validation rules to the MaskEdit. This property works when the widget is present inside the form. Include jquery.validate.min.js plugin additionally. + * @Default {null} + */ + validationRules?: any; + + /**Specifies the value for the mask edit textbox control. + * @Default {null} + */ + value?: string; + + /**Specifies the water mark text to be displayed in input text. + * @Default {null} + */ + watermarkText?: string; + + /**Specifies the width for the mask edit textbox control. + * @Default {143pixel} + */ + width?: string; + + /**Fires when value changed in mask edit textbox control.*/ + change? (e: ChangeEventArgs): void; + + /**Fires after MaskEdit control is created.*/ + create? (e: CreateEventArgs): void; + + /**Fires when the MaskEdit is destroyed successfully.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires when focused in mask edit textbox control.*/ + focusIn? (e: FocusInEventArgs): void; + + /**Fires when focused out in mask edit textbox control.*/ + focusOut? (e: FocusOutEventArgs): void; + + /**Fires when keydown in mask edit textbox control.*/ + keydown? (e: KeydownEventArgs): void; + + /**Fires when key press in mask edit textbox control.*/ + keyPress? (e: KeyPressEventArgs): void; + + /**Fires when keyup in mask edit textbox control.*/ + keyup? (e: KeyupEventArgs): void; + + /**Fires when mouse out in mask edit textbox control.*/ + mouseout? (e: MouseoutEventArgs): void; + + /**Fires when mouse over in mask edit textbox control.*/ + mouseover? (e: MouseoverEventArgs): void; +} + +export interface ChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the mask edit model + */ + model?: ej.MaskEdit.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the mask edit value + */ + value?: number; + + /**returns unstripped value in mask edit textbox control. + */ + unmaskedValue?: string; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the MaskEdit model + */ + model?: ej.MaskEdit.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the MaskEdit model + */ + model?: ej.MaskEdit.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface FocusInEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the mask edit model + */ + model?: ej.MaskEdit.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the mask edit value + */ + value?: number; + + /**returns unstripped value in mask edit textbox control. + */ + unmaskedValue?: string; +} + +export interface FocusOutEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the mask edit model + */ + model?: ej.MaskEdit.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the mask edit value + */ + value?: number; + + /**returns unstripped value in mask edit textbox control. + */ + unmaskedValue?: string; +} + +export interface KeydownEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the mask edit model + */ + model?: ej.MaskEdit.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the mask edit value + */ + value?: number; + + /**returns unstripped value in mask edit textbox control. + */ + unmaskedValue?: string; +} + +export interface KeyPressEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the mask edit model + */ + model?: ej.MaskEdit.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the mask edit value + */ + value?: number; + + /**returns unstripped value in mask edit textbox control. + */ + unmaskedValue?: string; +} + +export interface KeyupEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the mask edit model + */ + model?: ej.MaskEdit.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the mask edit value + */ + value?: number; + + /**returns unstripped value in mask edit textbox control. + */ + unmaskedValue?: string; +} + +export interface MouseoutEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the mask edit model + */ + model?: ej.MaskEdit.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the mask edit value + */ + value?: number; + + /**returns unstripped value in mask edit textbox control. + */ + unmaskedValue?: string; +} + +export interface MouseoverEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the mask edit model + */ + model?: ej.MaskEdit.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the mask edit value + */ + value?: number; + + /**returns unstripped value in mask edit textbox control. + */ + unmaskedValue?: string; +} +} +enum InputMode +{ +//string +Password, +//string +Text, +} +enum TextAlign +{ +//string +Center, +//string +Justify, +//string +Left, +//string +Right, +} + +class Menu extends ej.Widget { + static fn: Menu; + constructor(element: JQuery, options?: Menu.Model); + constructor(element: Element, options?: Menu.Model); + model:Menu.Model; + defaults:Menu.Model; + + /** Disables the Menu control. + * @returns {void} + */ + disable(): void; + + /** Specifies the Menu Item to be disabled by using the Menu Item Text. + * @param {string} Specifies the Menu Item Text to be disabled. + * @returns {void} + */ + disableItem(itemtext: string): void; + + /** Specifies the Menu Item to be disabled by using the Menu Item Id. + * @param {string|number} Specifies the Menu Item id to be disabled + * @returns {void} + */ + disableItembyID(itemid: string|number): void; + + /** Enables the Menu control. + * @returns {void} + */ + enable(): void; + + /** Specifies the Menu Item to be enabled by using the Menu Item Text. + * @param {string} Specifies the Menu Item Text to be enabled. + * @returns {void} + */ + enableItem(itemtext: string): void; + + /** Specifies the Menu Item to be enabled by using the Menu Item Id. + * @param {string|number} Specifies the Menu Item id to be enabled. + * @returns {void} + */ + enableItembyID(itemid: string|number): void; + + /** Hides the Context Menu control. + * @returns {void} + */ + hide(): void; + + /** Insert the menu item as child of target node. + * @param {any} Information about Menu item. + * @param {string|any} Selector of target node or Object of target node. + * @returns {void} + */ + insert(item: any, target: string|any): void; + + /** Insert the menu item after the target node. + * @param {any} Information about Menu item. + * @param {string|any} Selector of target node or Object of target node. + * @returns {void} + */ + insertAfter(item: any, target: string|any): void; + + /** Insert the menu item before the target node. + * @param {any} Information about Menu item. + * @param {string|any} Selector of target node or Object of target node. + * @returns {void} + */ + insertBefore(item: any, target: string|any): void; + + /** Remove Menu item. + * @param {any|Array} Selector of target node or Object of target node. + * @returns {void} + */ + remove(target: any|Array): void; + + /** To show the Menu control. + * @param {number} x co-ordinate position of context menu. + * @param {number} y co-ordinate position of context menu. + * @param {any} target element + * @param {any} name of the event + * @returns {void} + */ + show(locationX: number, locationY: number, targetElement: any, event: any): void; +} +export module Menu{ + +export interface Model { + + /**To enable or disable the Animation while hover or click an menu items.See AnimationType + * @Default {ej.AnimationType.Default} + */ + animationType?: ej.AnimationType|string; + + /**Specifies the target id of context menu. On right clicking the specified contextTarget element, context menu gets shown. + * @Default {null} + */ + contextMenuTarget?: string; + + /**Specify the CSS class to achieve custom theme. + */ + cssClass?: string; + + /**To enable or disable the Animation effect while hover or click an menu items. + * @Default {true} + */ + enableAnimation?: boolean; + + /**Specifies the root menu items to be aligned center in horizontal menu. + * @Default {false} + */ + enableCenterAlign?: boolean; + + /**Enable / Disable the Menu control. + * @Default {true} + */ + enabled?: boolean; + + /**Specifies the menu items to be displayed in right to left direction. + * @Default {false} + */ + enableRTL?: boolean; + + /**When this property sets to false, the menu items is displayed without any separators. + * @Default {true} + */ + enableSeparator?: boolean; + + /**Specifies the target which needs to be excluded. i.e., The context menu will not be displayed in those specified targets. + * @Default {null} + */ + excludeTarget?: string; + + /**Fields used to bind the data source and it includes following field members to make databind easier. + * @Default {null} + */ + fields?: Fields; + + /**Specifies the height of the root menu. + * @Default {auto} + */ + height?: string|number; + + /**Specifies the list of html attributes to be added to menu control. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Specifies the type of the menu. Essential JavaScript Menu consists of two type of menu, they are Normal Menu and Context Menu mode.See MenuType + * @Default {ej.MenuType.NormalMenu} + */ + menuType?: string|ej.MenuType; + + /**Specifies the sub menu items to be show or open only on click. + * @Default {false} + */ + openOnClick?: boolean; + + /**Specifies the orientation of normal menu. Normal menu can rendered in horizontal or vertical direction by using this API. See Orientation + * @Default {ej.Orientation.Horizontal} + */ + orientation?: string|ej.Orientation; + + /**Specifies the main menu items arrows only to be shown if it contains child items. + * @Default {true} + */ + showRooltLevelArrows?: boolean; + + /**Specifies the sub menu items arrows only to be shown if it contains child items. + * @Default {true} + */ + showSubLevelArrows?: boolean; + + /**Specifies position of pulldown submenus that will appear on mouse over.See Direction + * @Default {ej.Direction.Right} + */ + subMenuDirection?: string|ej.Direction; + + /**Specifies the title to responsive menu. + * @Default {Menu} + */ + titleText?: string; + + /**Specifies the width of the main menu. + * @Default {auto} + */ + width?: string|number; + + /**Fires before context menu gets open.*/ + beforeOpen? (e: BeforeOpenEventArgs): void; + + /**Fires when mouse click on menu items.*/ + click? (e: ClickEventArgs): void; + + /**Fire when context menu on close.*/ + close? (e: CloseEventArgs): void; + + /**Fires when context menu on open.*/ + open? (e: OpenEventArgs): void; + + /**Fires to create menu items.*/ + create? (e: CreateEventArgs): void; + + /**Fires to destroy menu items.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires when key down on menu items.*/ + keydown? (e: KeydownEventArgs): void; + + /**Fires when mouse out from menu items.*/ + mouseout? (e: MouseoutEventArgs): void; + + /**Fires when mouse over the Menu items.*/ + mouseover? (e: MouseoverEventArgs): void; +} + +export interface BeforeOpenEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the menu model + */ + model?: ej.Menu.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the target element + */ + target?: any; +} + +export interface ClickEventArgs { + + /**returns the menu model + */ + model?: ej.Menu.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns clicked menu item text + */ + text?: string; + + /**returns clicked menu item element + */ + element?: any; + + /**returns the event + */ + event?: any; + + /**returns the selected item + */ + selectedItem?: number; +} + +export interface CloseEventArgs { + + /**returns the menu model + */ + model?: ej.Menu.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the target element + */ + target?: any; +} + +export interface OpenEventArgs { + + /**returns the menu model + */ + model?: ej.Menu.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the target element + */ + target?: any; +} + +export interface CreateEventArgs { + + /**returns the menu model + */ + model?: ej.Menu.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**returns the menu model + */ + model?: ej.Menu.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface KeydownEventArgs { + + /**returns the menu model + */ + model?: ej.Menu.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns clicked menu item text + */ + menuText?: string; + + /**returns clicked menu item element + */ + element?: any; + + /**returns the event + */ + event?: any; +} + +export interface MouseoutEventArgs { + + /**returns the menu model + */ + model?: ej.Menu.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns clicked menu item text + */ + text?: string; + + /**returns clicked menu item element + */ + element?: any; + + /**returns the event + */ + event?: any; +} + +export interface MouseoverEventArgs { + + /**returns the menu model + */ + model?: ej.Menu.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns clicked menu item text + */ + text?: string; + + /**returns clicked menu item element + */ + element?: any; + + /**returns the event + */ + event?: any; +} + +export interface Fields { + + /**It receives the child data for the inner level. + */ + child?: any; + + /**It receives datasource as Essential DataManager object and JSON object. + */ + dataSource?: any; + + /**Specifies the html attributes to “li” item list. + */ + htmlAttribute?: string; + + /**Specifies the id to menu items list + */ + id?: string; + + /**Specifies the image attribute to “img” tag inside items list. + */ + imageAttribute?: string; + + /**Specifies the image URL to “img” tag inside item list. + */ + imageUrl?: string; + + /**Adds custom attributes like "target" to the anchor tag of the menu items. + */ + linkAttribute?: string; + + /**Specifies the parent id of the table. + */ + parentId?: string; + + /**It receives query to retrieve data from the table (query is same as SQL). + */ + query?: any; + + /**Specifies the sprite CSS class to “li” item list. + */ + spriteCssClass?: string; + + /**It receives table name to execute query on the corresponding table. + */ + tableName?: string; + + /**Specifies the text of menu items list. + */ + text?: string; + + /**Specifies the url to the anchor tag in menu item list. + */ + url?: string; +} +} +enum AnimationType +{ +//string +Default, +//string +None, +} +enum MenuType +{ +//string +ContextMenu, +//string +NormalMenu, +} +enum Direction +{ +//string +Left, +//string +None, +//string +Right, +} + +class Pager extends ej.Widget { + static fn: Pager; + constructor(element: JQuery, options?: Pager.Model); + constructor(element: Element, options?: Pager.Model); + model:Pager.Model; + defaults:Pager.Model; + + /** Send a paging request to specified page through the pagerControl. + * @returns {void} + */ + gotoPage(): void; +} +export module Pager{ + +export interface Model { + + /**Gets or sets a value that indicates whether to define the number of records displayed per page. + * @Default {12} + */ + pageSize?: number; + + /**Gets or sets a value that indicates whether to define the number of pages displayed in the pager for navigation. + * @Default {10} + */ + pageCount?: number; + + /**Gets or sets a value that indicates whether to define which page to display currently in pager. + * @Default {1} + */ + currentPage?: number; + + /**Get or sets a value of total number of pages in the pager. The totalPages value is calculated based on pagesize and totalrecords. + * @Default {null} + */ + totalPages?: number; + + /**Get the value of total number of records which is bound to a data item. + * @Default {null} + */ + totalRecordsCount?: number; + + /**Gets or sets a value that indicates whether to pass the current page information as a query string along with the url while navigating to other page. + * @Default {false} + */ + enableQueryString?: boolean; + + /**Gets or sets a value that indicates whether to customizing the user interface (UI) as locale-specific in order to display regional data i.e. in a language and culture specific to a particular country or region. + * @Default {en-US} + */ + locale?: string; + + /**Align content in the pager control from right to left by setting the property as true. + * @Default {false} + */ + enableRTL?: boolean; + + /**Triggered when pager numeric item is clicked in pager control.*/ + click? (e: ClickEventArgs): void; +} + +export interface ClickEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the current page index. + */ + currentPage?: number; + + /**Returns the pager model. + */ + model?: any; + + /**Returns the name of event + */ + type?: string; + + /**Returns current action event type and its target. + */ + event?: any; +} +} + +class ProgressBar extends ej.Widget { + static fn: ProgressBar; + constructor(element: JQuery, options?: ProgressBar.Model); + constructor(element: Element, options?: ProgressBar.Model); + model:ProgressBar.Model; + defaults:ProgressBar.Model; + + /** Destroy the progressbar widget + * @returns {void} + */ + destroy(): void; + + /** Disables the progressbar control + * @returns {void} + */ + disable(): void; + + /** Enables the progressbar control + * @returns {void} + */ + enable(): void; + + /** Returns the current progress value in percent. + * @returns {number} + */ + getPercentage(): number; + + /** Returns the current progress value + * @returns {number} + */ + getValue(): number; +} +export module ProgressBar{ + +export interface Model { + + /**Sets the root CSS class for ProgressBar theme, which is used customize. + * @Default {null} + */ + cssClass?: string; + + /**When this property sets to false, it disables the ProgressBar control + * @Default {true} + */ + enabled?: boolean; + + /**Save current model value to browser cookies for state maintains. While refresh the progressBar control page retains the model value apply from browser cookies + * @Default {false} + */ + enablePersistence?: boolean; + + /**Sets the ProgressBar direction as right to left alignment. + * @Default {false} + */ + enableRTL?: boolean; + + /**Defines the height of the ProgressBar. + * @Default {null} + */ + height?: number|string; + + /**It allows to define the characteristics of the progressBar control. It will helps to extend the capability of an HTML element. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Sets the maximum value of the ProgressBar. + * @Default {100} + */ + maxValue?: number; + + /**Sets the minimum value of the ProgressBar. + * @Default {0} + */ + minValue?: number; + + /**Sets the ProgressBar value in percentage. The value should be in between 0 to 100. + * @Default {0} + */ + percentage?: number; + + /**Displays rounded corner borders on the progressBar control. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Sets the custom text for the ProgressBar. The text placed in the middle of the ProgressBar and it can be customizable using the class 'e-progress-text'. + * @Default {null} + */ + text?: string; + + /**Sets the ProgressBar value. The value should be in between min and max values. + * @Default {0} + */ + value?: number; + + /**Defines the width of the ProgressBar. + * @Default {null} + */ + width?: number|string; + + /**Event triggers when the progress value changed*/ + change? (e: ChangeEventArgs): void; + + /**Event triggers when the process completes (at 100%)*/ + complete? (e: CompleteEventArgs): void; + + /**Event triggers when the progressbar are created*/ + create? (e: CreateEventArgs): void; + + /**Event triggers when the progressbar are destroyed*/ + destroy? (e: DestroyEventArgs): void; + + /**Event triggers when the process starts (from 0%)*/ + start? (e: StartEventArgs): void; +} + +export interface ChangeEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the ProgressBar model + */ + model?: ej.ProgressBar.Model; + + /**returns the current progress percentage + */ + percentage?: any; + + /**returns the name of the event + */ + type?: string; + + /**returns the current progress value + */ + value?: string; +} + +export interface CompleteEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the ProgressBar model + */ + model?: ej.ProgressBar.Model; + + /**returns the current progress percentage + */ + percentage?: any; + + /**returns the name of the event + */ + type?: string; + + /**returns the current progress value + */ + value?: string; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the progressbar model + */ + model?: ej.ProgressBar.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the progressbar model + */ + model?: ej.ProgressBar.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface StartEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the ProgressBar model + */ + model?: ej.ProgressBar.Model; + + /**returns the current progress percentage + */ + percentage?: any; + + /**returns the name of the event + */ + type?: string; + + /**returns the current progress value + */ + value?: string; +} +} + +class RadioButton extends ej.Widget { + static fn: RadioButton; + constructor(element: JQuery, options?: RadioButton.Model); + constructor(element: Element, options?: RadioButton.Model); + model:RadioButton.Model; + defaults:RadioButton.Model; + + /** To disable the RadioButton + * @returns {void} + */ + disable(): void; + + /** To enable the RadioButton + * @returns {void} + */ + enable(): void; +} +export module RadioButton{ + +export interface Model { + + /**Specifies the check attribute of the Radio Button. + * @Default {false} + */ + checked?: boolean; + + /**Specify the CSS class to RadioButton to achieve custom theme. + */ + cssClass?: string; + + /**Specifies the RadioButton control state. + * @Default {true} + */ + enabled?: boolean; + + /**Specifies the enablePersistence property for RadioButton while initialization. The enablePersistence API save current model value to browser cookies for state maintains. While refreshing the radio button control page the model value apply from browser cookies. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Specify the Right to Left direction to RadioButton + * @Default {false} + */ + enableRTL?: boolean; + + /**Specifies the HTML Attributes of the Checkbox + * @Default {{}} + */ + htmlAttributes?: any; + + /**Specifies the id attribute for the Radio Button while initialization. + * @Default {null} + */ + id?: string; + + /**Specify the idPrefix value to be added before the current id of the RadioButton. + * @Default {ej} + */ + idPrefix?: string; + + /**Specifies the name attribute for the Radio Button while initialization. + * @Default {Sets id as name if it is null} + */ + name?: string; + + /**Specifies the size of the RadioButton. + * @Default {small} + */ + size?: ej.RadioButtonSize|string; + + /**Specifies the text content for RadioButton. + */ + text?: string; + + /**Set the jquery validation error message in radio button. + * @Default {null} + */ + validationMessage?: any; + + /**Set the jquery validation rules in radio button. + * @Default {null} + */ + validationRules?: any; + + /**Specifies the value attribute of the Radio Button. + * @Default {null} + */ + value?: string; + + /**Fires before the RadioButton is going to changed its state successfully*/ + beforeChange? (e: BeforeChangeEventArgs): void; + + /**Fires when the RadioButton state is changed successfully*/ + change? (e: ChangeEventArgs): void; + + /**Fires when the RadioButton created successfully*/ + create? (e: CreateEventArgs): void; + + /**Fires when the RadioButton destroyed successfully*/ + destroy? (e: DestroyEventArgs): void; +} + +export interface BeforeChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the RadioButton model + */ + model?: ej.RadioButton.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns true if element is checked, otherwise returns false + */ + isChecked?: boolean; + + /**returns true if change event triggered by interaction, otherwise returns false + */ + isInteraction?: boolean; +} + +export interface ChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the RadioButton model + */ + model?: ej.RadioButton.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns true if element is checked, otherwise returns false + */ + isChecked?: boolean; + + /**returns true if change event triggered by interaction, otherwise returns false + */ + isInteraction?: boolean; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the RadioButton model + */ + model?: ej.RadioButton.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the RadioButton model + */ + model?: ej.RadioButton.Model; + + /**returns the name of the event + */ + type?: string; +} +} +enum RadioButtonSize +{ +//Shows small size radio button +Small, +//Shows medium size radio button +Medium, +} + +class Rating extends ej.Widget { + static fn: Rating; + constructor(element: JQuery, options?: Rating.Model); + constructor(element: Element, options?: Rating.Model); + model:Rating.Model; + defaults:Rating.Model; + + /** Destroy the Rating widget all events bound will be unbind automatically and bring the control to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** To get the current value of rating control. + * @returns {number} + */ + getValue(): number; + + /** To hide the rating control. + * @returns {void} + */ + hide(): void; + + /** User can refresh the rating control to identify changes. + * @returns {void} + */ + refresh(): void; + + /** To reset the rating value. + * @returns {void} + */ + reset(): void; + + /** To set the rating value. + * @param {string|number} Specifies the rating value. + * @returns {void} + */ + setValue(value: string|number): void; + + /** To show the rating control + * @returns {void} + */ + show(): void; +} +export module Rating{ + +export interface Model { + + /**Enables the rating control with reset button.It can be used to reset the rating control value. + * @Default {true} + */ + allowReset?: boolean; + + /**Specify the CSS class to achieve custom theme. + */ + cssClass?: string; + + /**When this property is set to false, it disables the rating control. + * @Default {true} + */ + enabled?: boolean; + + /**Save current model value to browser cookies for state maintenance. While refresh the page Rating control values are retained. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Specifies the height of the Rating control wrapper. + * @Default {null} + */ + height?: string; + + /**Specifies the value to be increased while navigating between shapes(stars) in Rating control. + * @Default {1} + */ + incrementStep?: number; + + /**Allow to render the maximum number of Rating shape(star). + * @Default {5} + */ + maxValue?: number; + + /**Allow to render the minimum number of Rating shape(star). + * @Default {0} + */ + minValue?: number; + + /**Specifies the orientation of Rating control. See Orientation + * @Default {ej.Rating.Orientation.Horizontal} + */ + orientation?: ej.Orientation|string; + + /**Helps to provide more precise ratings.Rating control supports three precision modes - full, half, and exact. See Precision + * @Default {full} + */ + precision?: ej.Rating.Precision|string; + + /**Interaction with Rating control can be prevented by enabling this API. + * @Default {false} + */ + readOnly?: boolean; + + /**To specify the height of each shape in Rating control. + * @Default {23} + */ + shapeHeight?: number; + + /**To specify the width of each shape in Rating control. + * @Default {23} + */ + shapeWidth?: number; + + /**Enables the tooltip option.Currently selected value will be displayed in tooltip. + * @Default {true} + */ + showTooltip?: boolean; + + /**To specify the number of stars to be selected while rendering. + * @Default {1} + */ + value?: number; + + /**Specifies the width of the Rating control wrapper. + * @Default {null} + */ + width?: string; + + /**Fires when Rating value changes.*/ + change? (e: ChangeEventArgs): void; + + /**Fires when Rating control is clicked successfully.*/ + click? (e: ClickEventArgs): void; + + /**Fires when Rating control is created.*/ + create? (e: CreateEventArgs): void; + + /**Fires when Rating control is destroyed successfully.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires when mouse hover is removed from Rating control.*/ + mouseout? (e: MouseoutEventArgs): void; + + /**Fires when mouse hovered over the Rating control.*/ + mouseover? (e: MouseoverEventArgs): void; +} + +export interface ChangeEventArgs { + + /**returns the current value. + */ + value?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the rating model + */ + model?: ej.Rating.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the mouse click event args values. + */ + event?: any; +} + +export interface ClickEventArgs { + + /**returns the current value. + */ + value?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the rating model + */ + model?: ej.Rating.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the mouse click event args values. + */ + event?: any; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the rating model + */ + model?: ej.Rating.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the rating model + */ + model?: ej.Rating.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface MouseoutEventArgs { + + /**returns the current value. + */ + value?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the rating model + */ + model?: ej.Rating.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the mouse click event args values. + */ + event?: any; +} + +export interface MouseoverEventArgs { + + /**returns the current value. + */ + value?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the rating model + */ + model?: ej.Rating.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the mouse click event args values. + */ + event?: any; + + /**returns the current index value. + */ + index?: any; +} + +enum Precision{ + + ///string + Exact, + + ///string + Full, + + ///string + Half +} + +} + +class Ribbon extends ej.Widget { + static fn: Ribbon; + constructor(element: JQuery, options?: Ribbon.Model); + constructor(element: Element, options?: Ribbon.Model); + model:Ribbon.Model; + defaults:Ribbon.Model; + + /** Adds contextual tab or contextual tab set dynamically in the ribbon control with contextual tabs object and index position. When index is null, ribbon contextual tab or contextual tab set is added at the last index. + * @param {any} contextual tab or contextual tab set object. + * @param {number} index of the contextual tab or contextual tab set, this is optional. + * @returns {void} + */ + addContextualTabs(contextualTabSet: any, index: number): void; + + /** Adds tab dynamically in the ribbon control with given name, tab group array and index position. When index is null, ribbon tab is added at the last index. + * @param {string} ribbon tab display text. + * @param {Array} groups to be displayed in ribbon tab . + * @param {number} index of the ribbon tab,this is optional. + * @returns {void} + */ + addTab(tabText: string, ribbonGroups: Array, index: number): void; + + /** Adds tab group dynamically in the ribbon control with given tab index, tab group object and group index position. When group index is null, ribbon group is added at the last index. + * @param {number} ribbon tab index. + * @param {any} group to be displayed in ribbon tab . + * @param {number} index of the ribbon group,this is optional. + * @returns {void} + */ + addTabGroup(tabIndex: number, tabGroup: any, groupIndex: number): void; + + /** Adds group content dynamically in the ribbon control with given tab index, group index, sub group index, content and content index position. When content index is null, content is added at the last index. + * @param {number} ribbon tab index. + * @param {number} ribbon group index. + * @param {number} sub group index in the ribbon group, + * @param {any} content to be displayed in the ribbon group. + * @param {number} ribbon content index .this is optional. + * @returns {void} + */ + addTabGroupContent(tabIndex: number, groupIndex: number, subGroupIndex: number, content: any, contentIndex: number): void; + + /** Hides the ribbon backstage page. + * @returns {void} + */ + hideBackstage(): void; + + /** Collapses the ribbon tab content. + * @returns {void} + */ + collapse(): void; + + /** Destroys the ribbon widget. All the events bound using this._on are unbound automatically and the ribbon control is moved to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** Expands the ribbon tab content. + * @returns {void} + */ + expand(): void; + + /** Gets text of the given index tab in the ribbon control. + * @param {number} index of the tab item. + * @returns {string} + */ + getTabText(index: number): string; + + /** Hides the given text tab in the ribbon control. + * @param {string} text of the tab item. + * @returns {void} + */ + hideTab(string: string): void; + + /** Checks whether the given text tab in the ribbon control is enabled or not. + * @param {string} text of the tab item. + * @returns {boolean} + */ + isEnable(string: string): boolean; + + /** Checks whether the given text tab in the ribbon control is visible or not. + * @param {string} text of the tab item. + * @returns {boolean} + */ + isVisible(string: string): boolean; + + /** Removes the given index tab item from the ribbon control. + * @param {number} index of tab item. + * @returns {void} + */ + removeTab(index: number): void; + + /** Sets new text to the given text tab in the ribbon control. + * @param {string} current text of the tab item. + * @param {string} new text of the tab item. + * @returns {void} + */ + setTabText(tabText: string, newText: string): void; + + /** Displays the ribbon backstage page. + * @returns {void} + */ + showBackstage(): void; + + /** Displays the given text tab in the ribbon control. + * @param {string} text of the tab item. + * @returns {void} + */ + showTab(string: string): void; +} +export module Ribbon{ + +export interface Model { + + /**Enables the ribbon resize feature. + * @Default {false} + */ + allowResizing?: boolean; + + /**Specifies the height, width, enableRTL, showRoundedCorner,enabled,cssClass property to the controls in the ribbon commonly andit will work only when those properties are not defined in buttonSettings and content defaults. + * @Default {object} + */ + buttonDefaults?: any; + + /**Property to enable the ribbon quick access toolbar. + * @Default {false} + */ + showQAT?: boolean; + + /**Sets custom setting to the collapsible pin in the ribbon. + * @Default {Object} + */ + collapsePinSettings?: CollapsePinSettings; + + /**Sets custom setting to the expandable pin in the ribbon. + * @Default {Object} + */ + expandPinSettings?: ExpandPinSettings; + + /**Specifies the application tab to contain application menu or backstage page in the ribbon control. + * @Default {Object} + */ + applicationTab?: ApplicationTab; + + /**Specifies the contextual tabs and tab set to the ribbon control with the background color and border color. Refer to the tabs section for adding tabs into the contextual tab and contextual tab set. + * @Default {array} + */ + contextualTabs?: Array; + + /**Specifies the index or indexes to disable the given index tab or indexes tabs in the ribbon control. + * @Default {0} + */ + disabledItemIndex?: Array; + + /**Specifies the index or indexes to enable the given index tab or indexes tabs in the ribbon control. + * @Default {null} + */ + enabledItemIndex?: Array; + + /**Specifies the index of the ribbon tab to select the given index tab item in the ribbon control. + * @Default {1} + */ + selectedItemIndex?: number; + + /**Specifies the tabs and its groups. Also specifies the control details that has to be placed in the tab area in the ribbon control. + * @Default {array} + */ + tabs?: Array; + + /**Gets or sets a value that indicates whether to customizing the user interface (UI) as locale-specific in order to display regional data i.e. in a language and culture specific to a particular country or region and it will need to use the user's preference. + * @Default {en-US} + */ + locale?: string; + + /**Specifies the width to the ribbon control. You can set width in string or number format. + * @Default {null} + */ + width?: string|number; + + /**Triggered before the ribbon tab item is removed.*/ + beforeTabRemove? (e: BeforeTabRemoveEventArgs): void; + + /**Triggered before the ribbon control is created.*/ + create? (e: CreateEventArgs): void; + + /**Triggered before the ribbon control is destroyed.*/ + destroy? (e: DestroyEventArgs): void; + + /**Triggered when the control in the group is clicked successfully.*/ + groupClick? (e: GroupClickEventArgs): void; + + /**Triggered when the groupexpander in the group is clicked successfully.*/ + groupExpand? (e: GroupExpandEventArgs): void; + + /**Triggered when an item in the Gallery control is clicked successfully.*/ + galleryItemClick? (e: GalleryItemClickEventArgs): void; + + /**Triggered when a tab or button in the backstage page is clicked successfully.*/ + backstageItemClick? (e: BackstageItemClickEventArgs): void; + + /**Triggered when the ribbon control is collapsed.*/ + collapse? (e: CollapseEventArgs): void; + + /**Triggered when the ribbon control is expanded.*/ + expand? (e: ExpandEventArgs): void; + + /**Triggered after adding the new ribbon tab item.*/ + tabAdd? (e: TabAddEventArgs): void; + + /**Triggered when tab is clicked successfully in the ribbon control.*/ + tabClick? (e: TabClickEventArgs): void; + + /**Triggered before the ribbon tab is created.*/ + tabCreate? (e: TabCreateEventArgs): void; + + /**Triggered after the tab item is removed from the ribbon control.*/ + tabRemove? (e: TabRemoveEventArgs): void; + + /**Triggered after the ribbon tab item is selected in the ribbon control.*/ + tabSelect? (e: TabSelectEventArgs): void; + + /**Triggered when the expand/collapse button is clicked successfully .*/ + toggleButtonClick? (e: ToggleButtonClickEventArgs): void; + + /**Triggered when the QAT menu item is clicked successfully .*/ + qatMenuItemClick? (e: QatMenuItemClickEventArgs): void; +} + +export interface BeforeTabRemoveEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns current tab item index in the ribbon control. + */ + index?: number; +} + +export interface CreateEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**Set to true when the event has to be cancelled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns current ribbon tab item index + */ + deleteIndex?: number; +} + +export interface GroupClickEventArgs { + + /**Set to true when the event has to be cancelled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns the control clicked in the group. + */ + target?: number; +} + +export interface GroupExpandEventArgs { + + /**Set to true when the event has to be cancelled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns the clicked groupexpander. + */ + target?: number; +} + +export interface GalleryItemClickEventArgs { + + /**Set to true when the event has to be cancelled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the gallery model. + */ + galleryModel?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns the item clicked in the gallery. + */ + target?: number; +} + +export interface BackstageItemClickEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns the item clicked in the gallery. + */ + target?: number; + + /**returns the id of the target item. + */ + id?: string; + + /**returns the text of the target item. + */ + text?: string; +} + +export interface CollapseEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface ExpandEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface TabAddEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns new added tab header. + */ + tabHeader?: any; + + /**returns new added tab content panel. + */ + tabContent?: any; +} + +export interface TabClickEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns previous active tab header. + */ + prevActiveHeader?: any; + + /**returns previous active index. + */ + prevActiveIndex?: number; + + /**returns current active tab header . + */ + activeHeader?: any; + + /**returns current active index. + */ + activeIndex?: number; +} + +export interface TabCreateEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns current ribbon tab item index + */ + deleteIndex?: number; +} + +export interface TabRemoveEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns the removed index. + */ + removedIndex?: number; +} + +export interface TabSelectEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns previous active tab header. + */ + prevActiveHeader?: any; + + /**returns previous active index. + */ + prevActiveIndex?: number; + + /**returns current active tab header . + */ + activeHeader?: any; + + /**returns current active index. + */ + activeIndex?: number; +} + +export interface ToggleButtonClickEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns the expand/collapse button. + */ + target?: number; +} + +export interface QatMenuItemClickEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns the clicked menu item text. + */ + text?: string; +} + +export interface CollapsePinSettings { + + /**Sets tooltip for the collapse pin . + * @Default {null} + */ + toolTip?: string; + + /**Specifies the custom tooltip for collapse pin.Refer to ejRibbon#tabs->groups->content->groups->customToolTip for its inner properties. + * @Default {Object} + */ + customToolTip?: any; +} + +export interface ExpandPinSettings { + + /**Sets tooltip for the expand pin. + * @Default {null} + */ + toolTip?: string; + + /**Specifies the custom tooltip for expand pin.Refer to ejRibbon#tabs->groups->content->groups->customToolTip for its inner properties. + * @Default {Object} + */ + customToolTip?: any; +} + +export interface ApplicationTabBackstageSettingsPages { + + /**Specifies the id for ribbon backstage page's tab and button elements. + * @Default {null} + */ + id?: string; + + /**Specifies the text for ribbon backstage page's tab header and button elements. + * @Default {null} + */ + text?: string; + + /**Specifies the type for ribbon backstage page's contents. Set "ej.Ribbon.backStageItemType.tab" to render the tab or "ej.Ribbon.backStageItemType.button" to render the button. + * @Default {ej.Ribbon.itemType.tab} + */ + itemType?: ej.Ribbon.itemType|string; + + /**Specifies the id of html elements like div, ul, etc., as ribbon backstage page's tab content. + * @Default {null} + */ + contentID?: string; + + /**Specifies the separator between backstage page's tab and button elements. + * @Default {false} + */ + enableSeparator?: boolean; +} + +export interface ApplicationTabBackstageSettings { + + /**Specifies the display text of application tab. + * @Default {null} + */ + text?: string; + + /**Specifies the height of ribbon backstage page. + * @Default {null} + */ + height?: string|number; + + /**Specifies the width of ribbon backstage page. + * @Default {null} + */ + width?: string|number; + + /**Specifies the ribbon backstage page with its tab and button elements. + * @Default {array} + */ + pages?: Array; + + /**Specifies the width of backstage page header that contains tabs and buttons. + * @Default {null} + */ + headerWidth?: string|number; +} + +export interface ApplicationTab { + + /**Specifies the ribbon backstage page items. + * @Default {object} + */ + backstageSettings?: ApplicationTabBackstageSettings; + + /**Specifies the ID of 'ul' list to create application menu in the ribbon control. + * @Default {null} + */ + menuItemID?: string; + + /**Specifies the menu members, events by using the menu settings for the menu in the application tab. + * @Default {object} + */ + menuSettings?: any; + + /**Specifies the application menu or backstage page. Specify the type of application tab as "ej.Ribbon.applicationTabType.menu" to render the application menu or "ej.Ribbon.applicationTabType.backstage" to render backstage page in the ribbon control. + * @Default {ej.Ribbon.applicationTabType.menu} + */ + type?: ej.Ribbon.applicationTabType|string; +} + +export interface ContextualTabs { + + /**Specifies the backgroundColor of the contextual tabs and tab set in the ribbon control. + * @Default {null} + */ + backgroundColor?: string; + + /**Specifies the borderColor of the contextual tabs and tab set in the ribbon control. + * @Default {null} + */ + borderColor?: string; + + /**Specifies the tabs to present in the contextual tabs and tab set. Refer to the tabs section for adding tabs into the contextual tabs and tab set. + * @Default {array} + */ + tabs?: Array; +} + +export interface TabsGroupsContentGroupsCustomGalleryItems { + + /**Specifies the syncfusion button members, events by using buttonSettings. + * @Default {object} + */ + buttonSettings?: any; + + /**Specifies the type as ej.Ribbon.customItemType.menu or ej.Ribbon.customItemType.button to render Syncfusion button and menu. + * @Default {ej.Ribbon.customItemType.button} + */ + customItemType?: ej.Ribbon.customItemType|string; + + /**Specifies the custom tooltip for gallery extra item's button. Refer to ejRibbon#tabs->groups->content->groups->customToolTip for its inner properties. + * @Default {object} + */ + customToolTip?: any; + + /**Specifies the UL list id to render menu as gallery extra item. + * @Default {null} + */ + menuId?: string; + + /**Specifies the Syncfusion menu members, events by using menuSettings. + * @Default {object} + */ + menuSettings?: any; + + /**Specifies the text for gallery extra item's button. + * @Default {null} + */ + text?: string; + + /**Specifies the tooltip for gallery extra item's button. + * @Default {null} + */ + toolTip?: string; +} + +export interface TabsGroupsContentGroupsCustomToolTip { + + /**Sets content to the custom tooltip. Text and html support are provided for content. + * @Default {null} + */ + content?: string; + + /**Sets icon to the custom tooltip content. + * @Default {null} + */ + prefixIcon?: string; + + /**Sets title to the custom tooltip. Text and html support are provided for title and the title is in bold for text format. + * @Default {null} + */ + title?: string; +} + +export interface TabsGroupsContentGroupsGalleryItems { + + /**Specifies the Syncfusion button members, events by using buttonSettings. + * @Default {object} + */ + buttonSettings?: any; + + /**Specifies the custom tooltip for gallery content. Refer to ejRibbon#tabs->groups->content->groups->customToolTip for its inner properties. + * @Default {object} + */ + customToolTip?: any; + + /**Sets text for the gallery content. + * @Default {null} + */ + text?: string; + + /**Sets tooltip for the gallery content. + * @Default {null} + */ + toolTip?: string; +} + +export interface TabsGroupsContentGroups { + + /**Specifies the Syncfusion button members, events by using this buttonSettings. + * @Default {object} + */ + buttonSettings?: any; + + /**It is used to set the count of gallery contents in a row. + * @Default {null} + */ + columns?: number; + + /**Specifies the custom items such as div, table, controls as custom controls with the type "ej.Ribbon.type.custom" in the groups. + * @Default {null} + */ + contentID?: string; + + /**Specifies the css class property to apply styles to the button, split, dropdown controls in the groups. + * @Default {null} + */ + cssClass?: string; + + /**Specifies the Syncfusion button and menu as gallery extra items. + * @Default {array} + */ + customGalleryItems?: Array; + + /**Provides custom tooltip for button, split button, dropdown list, toggle button, custom controls in the sub groups. Text and html support are also provided for title and content. + * @Default {Object} + */ + customToolTip?: TabsGroupsContentGroupsCustomToolTip; + + /**Specifies the Syncfusion dropdown list members, events by using this dropdownSettings. + * @Default {object} + */ + dropdownSettings?: any; + + /**Specifies the separator to the control that is in row type group. The separator separates the control from the next control in the group. Set "true" to enable the separator. + * @Default {false} + */ + enableSeparator?: boolean; + + /**Sets the count of gallery contents in a row, when the gallery is in expanded state. + * @Default {null} + */ + expandedColumns?: number; + + /**Defines each gallery content. + * @Default {array} + */ + galleryItems?: Array; + + /**Specifies the Id for button, split button, dropdown list, toggle button, gallery, custom controls in the sub groups. + * @Default {null} + */ + id?: string; + + /**Specifies the size for button, split button controls. Set "true" for big size and "false" for small size. + * @Default {null} + */ + isBig?: boolean; + + /**Sets the height of each gallery content. + * @Default {null} + */ + itemHeight?: string|number; + + /**Sets the width of each gallery content. + * @Default {null} + */ + itemWidth?: string|number; + + /**Specifies the Syncfusion split button members, events by using this splitButtonSettings. + * @Default {object} + */ + splitButtonSettings?: any; + + /**Specifies the text for button, split button, toggle button controls in the sub groups. + * @Default {null} + */ + text?: string; + + /**Specifies the Syncfusion toggle button members, events by using toggleButtonSettings. + * @Default {object} + */ + toggleButtonSettings?: any; + + /**Specifies the tooltip for button, split button, dropdown list, toggle button, custom controls in the sub groups. + * @Default {null} + */ + toolTip?: string; + + /**To add,show and hide controls in Quick Access toolbar. + * @Default {ej.Ribbon.quickAccessMode.none} + */ + quickAccessMode?: ej.Ribbon.quickAccessMode|string; + + /**Specifies the type as "ej.Ribbon.type.button" or "ej.Ribbon.type.splitButton" or "ej.Ribbon.type.dropDownList" or "ej.Ribbon.type.toggleButton" or "ej.Ribbon.type.custom" or "ej.Ribbon.type.gallery" to render button, split, dropdown, toggle button, gallery, custom controls. + * @Default {ej.Ribbon.type.button} + */ + type?: ej.Ribbon.type|string; +} + +export interface TabsGroupsContent { + + /**Specifies the height, width, type, isBig property to the controls in the group commonly. + * @Default {object} + */ + defaults?: any; + + /**Specifies the controls such as Syncfusion button, split button, dropdown list, toggle button, gallery, custom controls in the subgroup of the ribbon tab . + * @Default {array} + */ + groups?: Array; +} + +export interface TabsGroupsGroupExpanderSettings { + + /**Sets tooltip for the group expander of the group. + * @Default {null} + */ + toolTip?: string; + + /**Specifies the custom tooltip for group expander.Refer to ejRibbon#tabs->groups->content->groups->customToolTip for its inner properties. + * @Default {Object} + */ + customToolTip?: any; +} + +export interface TabsGroups { + + /**Specifies the alignment of controls in the groups in 'row' type or 'column' type. Value for row type is "ej.Ribbon.alignType.rows" and for column type is "ej.Ribbon.alignType.columns". + * @Default {ej.Ribbon.alignType.rows} + */ + alignType?: ej.Ribbon.alignType|string; + + /**Specifies the Syncfusion button, split button, dropdown list, toggle button, gallery, custom controls to the groups in the ribbon control. + * @Default {array} + */ + content?: Array; + + /**Specifies the ID of custom items to be placed in the groups. + * @Default {null} + */ + contentID?: string; + + /**Specifies the HTML contents to place into the groups. + * @Default {null} + */ + customContent?: string; + + /**Specifies the group expander for groups in the ribbon control. Set "true" to enable the group expander. + * @Default {false} + */ + enableGroupExpander?: boolean; + + /**Sets custom setting to the groups in the ribbon control. + * @Default {Object} + */ + groupExpanderSettings?: TabsGroupsGroupExpanderSettings; + + /**Specifies the text to the groups in the ribbon control. + * @Default {null} + */ + text?: string; + + /**Specifies the custom items such as div, table, controls by using the "custom" type. + * @Default {null} + */ + type?: string; +} + +export interface Tabs { + + /**Specifies single group or multiple groups and its contents to each tab in the ribbon control. + * @Default {array} + */ + groups?: Array; + + /**Specifies the ID for each tab's content panel. + * @Default {null} + */ + id?: string; + + /**Specifies the text of the tab in the ribbon control. + * @Default {null} + */ + text?: string; +} + +enum itemType{ + + ///To render the button for ribbon backstage page’s contents + Button, + + ///To render the tab for ribbon backstage page’s contents + Tab +} + + +enum applicationTabType{ + + ///applicationTab display as menu + Menu, + + ///applicationTab display as backstage + Backstage +} + + +enum alignType{ + + ///To align the group content's in row + Rows, + + ///To align group content's in columns + Columns +} + + +enum customItemType{ + + ///Specifies the button type in customGalleryItems + Button, + + ///Specifies the menu type in customGalleryItems + Menu +} + + +enum quickAccessMode{ + + ///Controls are hidden in Quick Access toolbar + None, + + ///Add controls in toolBar + ToolBar, + + ///Add controls in menu + Menu +} + + +enum type{ + + ///Specifies the button control + Button, + + ///Specifies the split button + SplitButton, + + ///Specifies the dropDown + DropDownList, + + ///To append external element's + Custom, + + ///Specifies the toggle button + ToggleButton, + + ///Specifies the ribbon gallery + Gallery +} + +} + +class Kanban extends ej.Widget { + static fn: Kanban; + constructor(element: JQuery, options?: Kanban.Model); + constructor(element: Element, options?: Kanban.Model); + model:Kanban.Model; + defaults:Kanban.Model; + + /** Add a new card in kanban control.If parameters are not given default dialog will be open + * @param {string} Pass the primary key field Name of the column + * @param {Array} Pass the edited json data of card need to be add. + * @returns {void} + */ + addCard(primaryKey: string, card: Array): void; + + /** Method used for send a clear search request to kanban. + * @returns {void} + */ + clearSearch(): void; + + /** It is used to clear all the card selection. + * @returns {void} + */ + clearSelection(): void; + + /** Collapse all the swimlane rows in kanban. + * @returns {void} + */ + collapseAll(): void; + + /** Add or remove columns in kanban columns collections + * @param {Array|string} Pass array of columns or string of headerText to add/remove the column in kanban + * @param {Array|string} Pass array of columns or string of keyvalue to add/remove the column in kanban + * @param {string} optional Pass add/remove action to be performed. By default "add" action will perform + * @returns {void} + */ + columns(columndetails: Array|string, keyvalue: Array|string, action: string): void; + + /** Send a cancel request of add/edit card in kanban + * @returns {void} + */ + cancelEdit(): void; + + /** Destroy the kanban widget all events bound using this._on will be unbind automatically and bring the control to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** Delete a card in kanban control. + * @param {string|number} Pass the key of card to be delete + * @returns {void} + */ + deleteCard(Key: string|number): void; + + /** Refresh the kanban with new data source. + * @param {Array} Pass new data source to the kanban + * @returns {void} + */ + dataSource(datasource: Array): void; + + /** Send a save request in kanban when any card is in edit/new add card state. + * @returns {void} + */ + endEdit(): void; + + /** toggleColumn based on the headerText in kanban. + * @param {any} Pass the header text of the column to get the corresponding column object + * @returns {void} + */ + toggleColumn( headerText : any): void; + + /** Expand or collapse the card based on the state of target "div" + * @param {string|number} Pass the key of card to be toggle + * @returns {void} + */ + toggleCard( key : string|number): void; + + /** Expand or collapse the swimlane row based on the state of target "div" + * @param {any} Pass the div object to toggleSwimlane row based on its row state + * @returns {void} + */ + toggleSwimlane( $div : any): void; + + /** Expand all the swimlane rows in kanban. + * @returns {void} + */ + expandAll(): void; + + /** used for get the names of all the visible column name collections in kanban. + * @returns {void} + */ + getVisibleColumnNames(): void; + + /** Get the scroller object of kanban. + * @returns {void} + */ + getScrollObject(): void; + + /** Get the column details based on the given header text in kanban. + * @param {string} Pass the header text of the column to get the corresponding column object + * @returns {string} + */ + getColumnByHeaderText( headerText : string): string; + + /** Hide columns from the kanban based on the header text + * @param {Array|string} you can pass either array of header text of various columns or a header text of a column to hide + * @returns {void} + */ + hideColumns( headerText : Array|string): void; + + /** Refresh the template of the kanban + * @returns {void} + */ + refreshTemplate(): void; + + /** Refresh the kanban contents.The template refreshment is based on the argument passed along with this method + * @param {boolean} optional When templateRefresh is set true, template and kanban contents both are refreshed in kanban else only kanban content is refreshed + * @returns {void} + */ + refresh( templateRefresh : boolean): void; + + /** send a search request to kanban with specified string passed in it. + * @param {string} Pass the string to search in Kanban card + * @returns {void} + */ + searchCards( searchString: string): void; + + /** Method used for set validation to a field during editing. + * @param {string} Specify the name of the column to set validation rules + * @param {any} Specify the validation rules for the field + * @returns {void} + */ + setValidationToField(name: string, rules: any): void; + + /** Send an edit card request in kanban.Parameter will be Html element or primary key + * @param {any} Pass the div selected row element to be edited in kanban + * @returns {void} + */ + startEdit( $div : any): void; + + /** Show columns in the kanban based on the header text. + * @param {Array|string} You can pass either array of header text of various columns or a header text of a column to show + * @returns {void} + */ + showColumns( headerText : Array|string): void; + + /** Update a card in kanban control based on key and json data given. + * @param {string} Pass the key field Name of the column + * @param {Array} Pass the edited json data of card need to be update. + * @returns {void} + */ + updateCard( key : string, data : Array): void; +} +export module Kanban{ + +export interface Model { + + /**Gets or sets a value that indicates whether to enable allowDragAndDrop behavior on kanban. + * @Default {true} + */ + allowDragAndDrop?: boolean; + + /**To enable or disable the title of the card. + * @Default {false} + */ + allowTitle?: boolean; + + /**Customize the settings for swimlane. + * @Default {Object} + */ + swimlaneSettings?: SwimlaneSettings; + + /**To enable or disable the column expand /collapse. + * @Default {false} + */ + allowToggleColumn?: boolean; + + /**To enable Searching operation in kanban. + * @Default {false} + */ + allowSearching?: boolean; + + /**Gets or sets a value that indicates whether to enable allowSelection behavior on kanban.User can select card and the selected card will be highlighted on kanban. + * @Default {true} + */ + allowSelection?: boolean; + + /**Gets or sets a value that indicates whether to allow card hover actions. + * @Default {true} + */ + allowHover?: boolean; + + /**To allow keyboard navigation actions. + * @Default {true} + */ + allowKeyboardNavigation?: boolean; + + /**Gets or sets a value that indicates whether to enable the scrollbar in the kanban and view the card by scroll through the kanban manually. + * @Default {false} + */ + allowScrolling?: boolean; + + /**Gets or sets an object that indicates whether to customize the context menu behavior of the kanban. + * @Default {Object} + */ + contextMenuSettings?: ContextMenuSettings; + + /**Gets or sets an object that indicates to render the kanban with specified columns. + * @Default {array} + */ + columns?: Array; + + /**Gets or sets an object that indicates whether to Customize the card based on the Mapping Fields. + * @Default {Object} + */ + cardSettings?: CardSettings; + + /**Gets or sets a value that indicates to render the kanban with custom theme. + * @Default {null} + */ + cssClass?: string; + + /**Gets or sets the data to render the kanban with card. + * @Default {Object} + */ + dataSource?: any; + + /**Align content in the kanban control from right to left by setting the property as true. + * @Default {false} + */ + enableRTL?: boolean; + + /**To show Total count of cards in each column + * @Default {true} + */ + enableTotalCount?: boolean; + + /**Gets or sets a value that indicates whether to enablehover support for performing card hover actions. + * @Default {true} + */ + enableHover?: boolean; + + /**Get or sets an object that indicates whether to customize the editing behavior of the kanban. + * @Default {Object} + */ + editSettings?: EditSettings; + + /**To customize field mappings for card , editing title and control key parameters + * @Default {Object} + */ + fields?: Fields; + + /**To map datasource field for column values mapping + * @Default {null} + */ + keyField?: string; + + /**Gets or sets a value that indicates whether the kanban design has be to made responsive. + * @Default {false} + */ + isResponsive?: boolean; + + /**Gets or sets a value that indicates whether to set the minimum width of the responsive kanban while isResponsive property is true and enableResponsiveRow property is set as false. + * @Default {null} + */ + minWidth?: number; + + /**To customize the filtering behavior based on queries given. + * @Default {array} + */ + filterSettings?: Array; + + /**The primarykey field is get as property of kanban. And this will used for Drag and drop and editing mainly + * @Default {null} + */ + primaryKeyField?: string; + + /**ej Query to query database of kanban. + * @Default {Object} + */ + query?: any; + + /**To change the key in keyboard interaction to kanban control. + * @Default {Object} + */ + keySettings?: KeySettings; + + /**Gets or sets an object that indicates whether to customize the scrolling behavior of the kanban. + * @Default {Object} + */ + scrollSettings?: any; + + /**To customize the searching behavior of the kanban. + * @Default {Object} + */ + searchSettings?: SearchSettings; + + /**To allow customize selection type. Accepting types are "single" and "multiple". + * @Default {ej.Kanban.SelectionType.Single} + */ + selectionType?: ej.Kanban.SelectionType|string; + + /**Gets or sets an object that indicates to managing the collection of stacked header rows for the kanban. + * @Default {Array} + */ + stackedHeaderRows?: Array; + + /**The tooltip allows to display card details in a tooltip while hovering on it. + */ + tooltipSettings?: TooltipSettings; + + /**Gets or sets a value that indicates whether to customizing the user interface (UI) as locale-specific in order to display regional data i.e. in a language and culture specific to a particular country or region. + * @Default {en-US} + */ + locale?: string; + + /**Triggered for every kanban action before its starts.*/ + actionBegin? (e: ActionBeginEventArgs): void; + + /**tiggered for every kanban action success event.*/ + actionComplete? (e: ActionCompleteEventArgs): void; + + /**Triggered for every kanban action server failure event.*/ + actionFailure? (e: ActionFailureEventArgs): void; + + /**Triggered before the task is going to be edited.*/ + beginEdit? (e: BeginEditEventArgs): void; + + /**Triggered before the task is going to be added*/ + beginAdd? (e: BeginAddEventArgs): void; + + /**triggered before the card is going to be selecting.*/ + beforeCardSelect? (e: BeforeCardSelectEventArgs): void; + + /**Trigger after the card is clicked.*/ + cardClick? (e: CardClickEventArgs): void; + + /**Triggered when the card is being dragged.*/ + cardDrag? (e: CardDragEventArgs): void; + + /**Triggered when card dragging start.*/ + cardDragStart? (e: CardDragStartEventArgs): void; + + /**triggered when card dragging stops.*/ + cardDragStop? (e: CardDragStopEventArgs): void; + + /**Triggered when the card is Drop.*/ + cardDrop? (e: CardDropEventArgs): void; + + /**Triggered after the card is select.*/ + cardSelect? (e: CardSelectEventArgs): void; + + /**Triggered when card is double clicked.*/ + cardDoubleClick? (e: CardDoubleClickEventArgs): void; +} + +export interface ActionBeginEventArgs { + + /**Returns the kanban model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the current action event type. + */ + originalEventType?: string; + + /**Returns primary key value. + */ + primaryKeyValue?: string; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the edited row index. + */ + rowIndex?: number; + + /**Returns the card object (JSON). + */ + data?: any; + + /**Returns current filtering object field name. + */ + currentFilteringobject?: any; + + /**Returns filter details. + */ + filterCollection?: any; +} + +export interface ActionCompleteEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the kanban model. + */ + model?: any; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns current action event type. + */ + originalEventType?: string; + + /**Returns primary key. + */ + primaryKey?: string; + + /**Returns primary key value. + */ + primaryKeyValue?: string; + + /**Returns kanban element. + */ + target?: any; + + /**Returns the card object (JSON). + */ + data?: any; + + /**Returns the selectedRow index. + */ + selectedRow?: number; + + /**Returns current filtering column field name. + */ + currentFilteringColumn?: string; + + /**Returns filter details. + */ + filterCollection?: any; +} + +export interface ActionFailureEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the kanban model. + */ + model?: any; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the error return by server. + */ + error?: any; + + /**Returns current action event type. + */ + originalEventType?: string; + + /**Returns primary key value. + */ + primaryKeyValue?: string; + + /**Returns kanban element. + */ + target?: any; + + /**Returns the card object (JSON). + */ + data?: any; + + /**Returns current filtering column field name. + */ + currentFilteringColumn?: string; + + /**Returns filter details. + */ + filterCollection?: any; +} + +export interface BeginEditEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the kanban model. + */ + model?: any; + + /**Returns primary key value. + */ + primaryKeyValue?: string; + + /**Returns beginedit data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface BeginAddEventArgs { + + /**Returns the kanban model. + */ + model?: any; + + /**Returns primary key value. + */ + primaryKeyValue?: string; + + /**Returns beginAdd data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface BeforeCardSelectEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the select cell index value. + */ + cellIndex?: number; + + /**Returns the select card index value. + */ + cardIndex?: number; + + /**Returns the select cell element + */ + currentCell?: any; + + /**Returns the previously select the card element + */ + previousCard?: any; + + /**Returns the previously select card indexes + */ + previousRowcellindex?: Array; + + /**Returns the Target item. + */ + Target?: any; + + /**Returns the kanban model. + */ + model?: any; + + /**Returns select card data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface CardClickEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns current record object (JSON). + */ + data?: any; + + /**Returns the current card to the kanban. + */ + currentCard?: string; + + /**Returns kanban element. + */ + target?: any; + + /**Returns the kanban model. + */ + model?: any; + + /**Returns the Header text of the column corresponding to the selected card. + */ + columnName?: string; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface CardDragEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns drag data. + */ + data?: any; + + /**Returns drag start element. + */ + dragtarget?: any; + + /**Returns dragged element. + */ + draggedElement?: any; + + /**Returns the kanban model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface CardDragStartEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns carddragstart data. + */ + data?: any; + + /**Returns dragged element. + */ + draggedElement?: any; + + /**Returns the kanban model. + */ + model?: any; + + /**Returns drag start element. + */ + dragtarget?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface CardDragStopEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns dragged element. + */ + draggedElement?: any; + + /**Returns the kanban model. + */ + model?: any; + + /**Returns drag stop element. + */ + droptarget?: any; + + /**Returns dragg stop data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface CardDropEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns dragged element. + */ + draggedElement?: any; + + /**Returns dragged data. + */ + data?: any; + + /**Returns the kanban model. + */ + model?: any; + + /**Returns drop element. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface CardSelectEventArgs { + + /**Returns the select cell index value. + */ + cellIndex?: number; + + /**Returns the select card index value. + */ + cardIndex?: number; + + /**Returns the select cell element + */ + currentCell?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the previously select the card element + */ + previousCard?: any; + + /**Returns the previously select card indexes + */ + previousRowcellindex?: Array; + + /**Returns the current item. + */ + currentTarget?: any; + + /**Returns the kanban model. + */ + model?: any; + + /**Returns select card data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface CardDoubleClickEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns current card object (JSON). + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface SwimlaneSettings { + + /**To enable or disable items count in swimlane + * @Default {true} + */ + showCount?: boolean; +} + +export interface ContextMenuSettingsCustomMenuItems { + + /**Sets context menu to target element. + * @Default {ej.Kanban.Target.All} + */ + target?: ej.Kanban.Target|string; + + /**Gets the name to custom menu. + * @Default {null} + */ + text?: string; + + /**Gets the template to render custom menu. + * @Default {null} + */ + template?: string; +} + +export interface ContextMenuSettings { + + /**To enable Context menu , All default context menu will show. + * @Default {false} + */ + enable?: boolean; + + /**Gets or sets a value that indicates the list of items needs to be diable from default context menu + * @Default {array} + */ + disableDefaultItems?: Array; + + /**Gets or sets a value that indicates whether to add custom contextMenu items + * @Default {array} + */ + customMenuItems?: Array; +} + +export interface ColumnsConstraints { + + /**It is used to specify the type whether the constraints based on column or swimlane. + * @Default {null} + */ + type?: string; + + /**It is used to specify the minimum amount of card in particular column cell or swimlane cell can hold. + * @Default {null} + */ + min?: number; + + /**It is used to specify the maximum amount of card in particular column cell or swimlane cell can hold. + * @Default {null} + */ + max?: number; +} + +export interface Columns { + + /**Gets or sets an object that indicates to render the kanban with specified columns headertext. + * @Default {null} + */ + headerText?: string; + + /**Gets or sets an object that indicates to render the kanban with specified columns key. + * @Default {null} + */ + key?: string|number; + + /**To set column collape or expand state + * @Default {false} + */ + isCollapsed?: boolean; + + /**To customize the column constraints whether the constraints contains minimum limit or maximum limit or both. + * @Default {object} + */ + constraints?: ColumnsConstraints; + + /**Gets or sets a value that indicates to add the template within the header element. + * @Default {null} + */ + headerTemplate?: string; + + /**Gets or sets an object that indicates to render the kanban with specified columns width. + * @Default {null} + */ + width?: string|number; + + /**Gets or sets an object that indicates to render the kanban with specified columns visible. + * @Default {true} + */ + visible?: boolean; +} + +export interface CardSettings { + + /**Gets or sets a value that indicates to add the template of card . + * @Default {null} + */ + template?: string; + + /**To customize the card bordercolor based on assinged task. Colors and corresponding values defined here will be mapped with colorField mapped data source column. + * @Default {Object} + */ + colorMapping?: any; +} + +export interface EditSettingsEditItems { + + /**It is used to map editing field in the card. + * @Default {null} + */ + field?: string; + + /**It is used to set the particular editType in the card for editing. + * @Default {ej.Kanban.EditingType.String} + */ + editType?: ej.Kanban.EditingType|string; + + /**Gets or sets a value that indicates to define constraints for saving data to the database. + * @Default {Object} + */ + validationRules?: any; + + /**It is used to set the particular editparams in the card for editing. + * @Default {Object} + */ + editParams?: any; + + /**It is used to specify defaultValue in the card. + * @Default {null} + */ + defaultValue?: string|number; +} + +export interface EditSettings { + + /**Gets or sets a value that indicates whether to enable the editing action in cards of kanban. + * @Default {false} + */ + allowEditing?: boolean; + + /**Gets or sets a value that indicates whether to enable the adding action in cards behavior on kanban. + * @Default {false} + */ + allowAdding?: boolean; + + /**This specifies the id of the template.which is require to be edited using the Dialog Box + * @Default {null} + */ + dialogTemplate?: string; + + /**Get or sets an object that indicates whether to customize the editMode of the kanban. + * @Default {ej.Kanban.EditMode.Dialog} + */ + editMode?: ej.Kanban.EditMode|string; + + /**Get or sets an object that indicates whether to customize the editing fields of kanban card. + * @Default {Array} + */ + editItems?: Array; +} + +export interface Fields { + + /**The primarykey field is get as property of kanban. And this will used for Drag and drop and editing mainly. + * @Default {null} + */ + primaryKey?: string; + + /**To enable swimlane grouping based on the given key field. + * @Default {null} + */ + swimlaneKey?: string; + + /**Priority field has been mapped data source field to maintain card priority + * @Default {null} + */ + priority?: string; + + /**ContentField has been Mapped into card text. + * @Default {null} + */ + content?: string; + + /**TagField has been Mapped into card tag. + * @Default {null} + */ + tag?: string; + + /**TitleField has been Mapped to field in datasource for title content. If titlefield specified , card expand/collapse will be enabled with header and content section + * @Default {null} + */ + title?: string; + + /**To customize the card has been Mapped into card colorfield. + * @Default {null} + */ + color?: string; + + /**ImageUrlField has been Mapped into card image. + * @Default {null} + */ + imageUrl?: string; +} + +export interface FilterSettings { + + /**Gets or sets an object of display name to filter queries. + * @Default {null} + */ + text?: string; + + /**Gets or sets an object that Queries to perform filtering + * @Default {Object} + */ + query?: any; + + /**Gets or sets an object of tooltip to filter buttons. + * @Default {null} + */ + description?: string; +} + +export interface KeySettings { + + /**To specify the focus in kanban control. + * @Default {Object} + */ + focus?: any; + + /**To specify the key value to insert the card. + * @Default {null} + */ + insertCard?: string; + + /**To specify the key value to delete the card. + * @Default {null} + */ + deleteCard?: string; + + /**TTo specify the key value to edit the card. + * @Default {null} + */ + editCard?: string; + + /**TTo specify the key value to save request. + * @Default {null} + */ + saveRequest?: string; + + /**To specify the key value to cancel request. + * @Default {null} + */ + cancelRequest?: string; + + /**To specify the key value to first card selection. + * @Default {null} + */ + firstCardSelection?: string; + + /**To specify the key value to last card selection. + * @Default {null} + */ + lastCardSelection?: string; + + /**To specify the key value to upArrow. + * @Default {null} + */ + upArrow?: string; + + /**To specify the key value to downArrow. + * @Default {null} + */ + downArrow?: string; + + /**To specify the key value to rightArrow. + * @Default {null} + */ + rightArrow?: string; + + /**To specify the key value to leftArrow. + * @Default {null} + */ + leftArrow?: string; + + /**To specify the key value to swimlane expand all. + * @Default {null} + */ + swimlaneExpandAll?: string; + + /**To specify the key value to swimlane collapse all. + * @Default {null} + */ + swimlaneCollapseAll?: string; + + /**To specify the key value to selected group expand. + * @Default {null} + */ + selectedGroupExpand?: string; + + /**To specify the key value to selected group collapse. + * @Default {null} + */ + selectedGroupCollapse?: string; + + /**To specify the key value to selected column collapse. + * @Default {null} + */ + selectedColumnCollapse?: string; + + /**To specify the key value to selected column expand. + * @Default {null} + */ + selectedColumnExpand?: string; + + /**To specify the key value to multi selection by up arrow. + * @Default {null} + */ + multiSelectionByUpArrow?: string; + + /**To specify the key value to multi selection by left arrow. + * @Default {null} + */ + multiSelectionByLeftArrow?: string; + + /**To specify the key value to multi selection by right arrow. + * @Default {null} + */ + multiSelectionByRightArrow?: string; +} + +export interface SearchSettings { + + /**To customize the fields the searching operation can be perform. + * @Default {Array} + */ + fields?: Array; + + /**To customize the searching string. + * @Default {null} + */ + key?: string; + + /**To customize the operator based on searching. + * @Default {null} + */ + operator?: string; + + /**To customize the ignorecase based on searching. + * @Default {true} + */ + ignoreCase?: boolean; +} + +export interface StackedHeaderRowsStackedHeaderColumns { + + /**Gets or sets a value that indicates the headerText for the particular stacked header column. + * @Default {null} + */ + headerText?: string; + + /**Gets or sets a value that indicates the column for the particular stacked header column. + * @Default {null} + */ + column?: string; +} + +export interface StackedHeaderRows { + + /**Gets or sets a value that indicates whether to add stacked header columns into the stacked header rows. + * @Default {Array} + */ + stackedHeaderColumns?: Array; +} + +export interface TooltipSettings { + + /**To enable or disable the tooltip display. + * @Default {false} + */ + enable?: boolean; + + /**To customize the tooltip display based on your requirements. + * @Default {null} + */ + template?: string; +} + +enum Target{ + + ///Sets context menu to kanban header + Header, + + ///Sets context menu to kanban content + Content, + + ///Sets context menu to kanban + All +} + + +enum EditMode{ + + ///Creates kanban with editMode as Dialog + Dialog, + + ///Creates kanban with editMode as DialogTemplate + DialogTemplate +} + + +enum EditingType{ + + ///Allows to set edit type as string edit type + String, + + ///Allows to set edit type as numeric edit type + Numeric, + + ///Allows to set edit type as drop down edit type + Dropdown, + + ///Allows to set edit type as date picker edit type + DatePicker, + + ///Allows to set edit type as date time picker edit type + DateTimePicker, + + ///Allows to set edit type as text area edit type + TextArea, + + ///Allows to set edit type as RTE edit type + RTE +} + + +enum SelectionType{ + + ///Support for Single selection in Kanban + Single, + + ///Support for multiple selections in Kanban + Multiple +} + +} + +class Rotator extends ej.Widget { + static fn: Rotator; + constructor(element: JQuery, options?: Rotator.Model); + constructor(element: Element, options?: Rotator.Model); + model:Rotator.Model; + defaults:Rotator.Model; + + /** Disables the Rotator control. + * @returns {void} + */ + disable(): void; + + /** Enables the Rotator control. + * @returns {void} + */ + enable(): void; + + /** This method is used to get the current slide index. + * @returns {number} + */ + getIndex(): number; + + /** This method is used to move a slide to the specified index. + * @param {number} index of an slide + * @returns {void} + */ + gotoIndex(index: number): void; + + /** This method is used to pause autoplay. + * @returns {void} + */ + pause(): void; + + /** This method is used to move slides continuously (or start autoplay) in the specified autoplay direction. + * @returns {void} + */ + play(): void; + + /** This method is used to move to the next slide from the current slide. If the current slide is the last slide, then the first slide will be treated as the next slide. + * @returns {void} + */ + slideNext(): void; + + /** This method is used to move to the previous slide from the current slide. If the current slide is the first slide, then the last slide will be treated as the previous slide. + * @returns {void} + */ + slidePrevious(): void; +} +export module Rotator{ + +export interface Model { + + /**Turns on keyboard interaction with the Rotator items. You must set this property to true to access the following keyboard shortcuts: + * @Default {true} + */ + allowKeyboardNavigation?: boolean; + + /**Sets the animationSpeed of slide transition. + * @Default {600} + */ + animationSpeed?: string|number; + + /**Specifies the animationType type for the Rotator Item. animationType options include slide, fastSlide, slowSlide, and other custom easing animationTypes. + * @Default {slide} + */ + animationType?: string; + + /**Enables the circular mode item rotation. + * @Default {true} + */ + circularMode?: boolean; + + /**Specify the CSS class to Rotator to achieve custom theme. + */ + cssClass?: string; + + /**Specify the list of data which contains a set of data fields. Each data value is used to render an item for the Rotator. + * @Default {null} + */ + dataSource?: any; + + /**Sets the delay between the Rotator Items move after the slide transition. + * @Default {500} + */ + delay?: number; + + /**Specifies the number of Rotator Items to be displayed. + * @Default {1} + */ + displayItemsCount?: string|number; + + /**Rotates the Rotator Items continuously without user interference. + * @Default {false} + */ + enableAutoPlay?: boolean; + + /**Enables or disables the Rotator control. + * @Default {true} + */ + enabled?: boolean; + + /**Specifies right to left transition of slides. + * @Default {false} + */ + enableRTL?: boolean; + + /**Defines mapping fields for the data items of the Rotator. + * @Default {null} + */ + fields?: Fields; + + /**Sets the space between the Rotator Items. + */ + frameSpace?: string|number; + + /**Resizes the Rotator when the browser is resized. + * @Default {false} + */ + isResponsive?: boolean; + + /**Specifies the number of Rotator Items to navigate on a single click (next/previous/play buttons). The navigateSteps property value must be less than or equal to the displayItemsCount property value. + * @Default {1} + */ + navigateSteps?: string|number; + + /**Specifies the orientation for the Rotator control, that is, whether it must be rendered horizontally or vertically. See Orientation + * @Default {ej.Orientation.Horizontal} + */ + orientation?: ej.Orientation|string; + + /**Specifies the position of the showPager in the Rotator Item. See PagerPosition + * @Default {outside} + */ + pagerPosition?: string|ej.Rotator.PagerPosition; + + /**Retrieves data from remote data. This property is applicable only when a remote data source is used. + * @Default {null} + */ + query?: string; + + /**If the Rotator Item is an image, you can specify a caption for the Rotator Item. The caption text for each Rotator Item must be set by using the title attribute of the respective tag. The caption cannot be displayed if multiple Rotator Items are present. + * @Default {false} + */ + showCaption?: boolean; + + /**Turns on or off the slide buttons (next and previous) in the Rotator Items. Slide buttons are used to navigate the Rotator Items. + * @Default {true} + */ + showNavigateButton?: boolean; + + /**Turns on or off the pager support in the Rotator control. The Pager is used to navigate the Rotator Items. + * @Default {true} + */ + showPager?: boolean; + + /**Enable play / pause button on rotator. + * @Default {false} + */ + showPlayButton?: boolean; + + /**Turns on or off thumbnail support in the Rotator control. Thumbnail is used to navigate between slides. Thumbnail supports only single slide transition You must specify the source for thumbnail elements through the thumbnailSourceID property. + * @Default {false} + */ + showThumbnail?: boolean; + + /**Sets the height of a Rotator Item. + */ + slideHeight?: string|number; + + /**Sets the width of a Rotator Item. + */ + slideWidth?: string|number; + + /**Sets the index of the slide that must be displayed first. + * @Default {0} + */ + startIndex?: string|number; + + /**Pause the auto play while hover on the rotator content. + * @Default {false} + */ + stopOnHover?: boolean; + + /**Specifies the source for thumbnail elements. + * @Default {null} + */ + thumbnailSourceID?: any; + + /**This event is fired when the Rotator slides are changed.*/ + change? (e: ChangeEventArgs): void; + + /**This event is fired when the Rotator control is initialized.*/ + create? (e: CreateEventArgs): void; + + /**This event is fired when the Rotator control is destroyed.*/ + destroy? (e: DestroyEventArgs): void; + + /**This event is fired when a pager is clicked.*/ + pagerClick? (e: PagerClickEventArgs): void; + + /**This event is fired when enableAutoPlay is started.*/ + start? (e: StartEventArgs): void; + + /**This event is fired when autoplay is stopped or paused.*/ + stop? (e: StopEventArgs): void; + + /**This event is fired when a thumbnail pager is clicked.*/ + thumbItemClick? (e: ThumbItemClickEventArgs): void; +} + +export interface ChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the rotator model + */ + model?: ej.Rotator.Model; + + /**returns the name of the event + */ + type?: string; + + /**the current rotator id. + */ + itemId?: string; + + /**returns the current slide index. + */ + activeItemIndex?: number; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the rotator model + */ + model?: ej.Rotator.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the rotator model + */ + model?: ej.Rotator.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface PagerClickEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the rotator model + */ + model?: ej.Rotator.Model; + + /**returns the name of the event + */ + type?: string; + + /**the current rotator id. + */ + itemId?: string; + + /**returns the current slide index. + */ + activeItemIndex?: number; +} + +export interface StartEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the rotator model + */ + model?: ej.Rotator.Model; + + /**returns the name of the event + */ + type?: string; + + /**the current rotator id. + */ + itemId?: string; + + /**returns the current slide index. + */ + activeItemIndex?: number; +} + +export interface StopEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the rotator model + */ + model?: ej.Rotator.Model; + + /**returns the name of the event + */ + type?: string; + + /**the current rotator id. + */ + itemId?: string; + + /**returns the current slide index. + */ + activeItemIndex?: number; +} + +export interface ThumbItemClickEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the rotator model + */ + model?: ej.Rotator.Model; + + /**returns the name of the event + */ + type?: string; + + /**the current rotator id. + */ + itemId?: string; + + /**returns the current slide index. + */ + activeItemIndex?: number; +} + +export interface Fields { + + /**Specifies a link for the image. + */ + linkAttribute?: string; + + /**Specifies where to open a given link. + */ + targetAttribute?: string; + + /**Specifies a caption for the image. + */ + text?: string; + + /**Specifies a caption for the thumbnail image. + */ + thumbnailText?: string; + + /**Specifies the URL for an thumbnail image. + */ + thumbnailUrl?: string; + + /**Specifies the URL for an image. + */ + url?: string; +} + +enum PagerPosition{ + + ///string + BottomLeft, + + ///string + BottomRight, + + ///string + Outside, + + ///string + TopCenter, + + ///string + TopLeft, + + ///string + TopRight +} + +} + +class RTE extends ej.Widget { + static fn: RTE; + constructor(element: JQuery, options?: RTE.Model); + constructor(element: Element, options?: RTE.Model); + model:RTE.Model; + defaults:RTE.Model; + + /** Returns the range object. + * @returns {void} + */ + createRange(): void; + + /** Disables the RTE control. + * @returns {void} + */ + disable(): void; + + /** Disables the corresponding tool in the RTE ToolBar. + * @returns {void} + */ + disableToolbarItem(): void; + + /** Enables the RTE control. + * @returns {void} + */ + enable(): void; + + /** Enables the corresponding tool in the toolbar when the tool is disabled. + * @returns {void} + */ + enableToolbarItem(): void; + + /** Performs the action value based on the given command. + * @returns {void} + */ + executeCommand(): void; + + /** Focuses the RTE control. + * @returns {void} + */ + focus(): void; + + /** Gets the command status of the selected text based on the given comment in the RTE control. + * @returns {void} + */ + getCommandStatus(): void; + + /** Gets the HTML string from the RTE control. + * @returns {void} + */ + getDocument(): void; + + /** Gets the HTML string from the RTE control. + * @returns {void} + */ + getHtml(): void; + + /** Gets the selected html string from the RTE control. + * @returns {void} + */ + getSelectedHtml(): void; + + /** Gets the content as string from the RTE control. + * @returns {void} + */ + getText(): void; + + /** Hides the RTE control. + * @returns {void} + */ + hide(): void; + + /** Inserts new item to the target contextmenu node. + * @returns {void} + */ + insertMenuOption(): void; + + /** This method helps to insert/paste the content at the current cursor (caret) position or the selected content to be replaced with our text by passing the value as parameter to the pasteContent method in the Editor. + * @returns {void} + */ + pasteContent(): void; + + /** Refreshes the RTE control. + * @returns {void} + */ + refresh(): void; + + /** Removes the target menu item from the RTE contextmenu. + * @returns {void} + */ + removeMenuOption (): void; + + /** Removes the given tool from the RTE Toolbar. + * @returns {void} + */ + removeToolbarItem(): void; + + /** Selects all the contents within the RTE. + * @returns {void} + */ + selectAll(): void; + + /** Selects the contents in the given range. + * @returns {void} + */ + selectRange(): void; + + /** Sets the color picker model type rendered initially in the RTE control. + * @returns {void} + */ + setColorPickerType(): void; + + /** Sets the HTML string from the RTE control. + * @returns {void} + */ + setHtml(): void; + + /** Displays the RTE control. + * @returns {void} + */ + show(): void; +} +export module RTE{ + +export interface Model { + + /**Enables/disables the editing of the content. + * @Default {True} + */ + allowEditing?: boolean; + + /**RTE control can be accessed through the keyboard shortcut keys. + * @Default {True} + */ + allowKeyboardNavigation?: boolean; + + /**When the property is set to true, it focuses the RTE at the time of rendering. + * @Default {false} + */ + autoFocus?: boolean; + + /**Based on the content size, its height is adjusted instead of adding the scrollbar. + * @Default {false} + */ + autoHeight?: boolean; + + /**Sets the colorCode to display the color of the fontColor and backgroundColor in the font tools of the RTE. + * @Default {[000000, FFFFFF, C4C4C4, ADADAD, 595959, 262626, 4f81bd, dbe5f1, b8cce4, 95b3d7, 366092, 244061, c0504d, f2dcdb, e5b9b7, d99694, 953734,632423, 9bbb59, ebf1dd, d7e3bc, c3d69b, 76923c, 4f6128, 8064a2, e5e0ec, ccc1d9, b2a2c7, 5f497a, 3f3151, f79646, fdeada, fbd5b5, fac08f,e36c09, 974806]} + */ + colorCode?: any; + + /**The number of columns given are rendered in the color palate popup. + * @Default {6} + */ + colorPaletteColumns?: number; + + /**The number of rows given are rendered in the color palate popup. + * @Default {6} + */ + colorPaletteRows?: number; + + /**Sets the root class for the RTE theme. This cssClass API helps the usage of custom skinning option for the RTE control by including this root class in CSS. + */ + cssClass?: string; + + /**Enables/disables the RTE control’s accessibility or interaction. + * @Default {True} + */ + enabled?: boolean; + + /**When the property is set to true, it returns the encrypted text. + * @Default {false} + */ + enableHtmlEncode?: boolean; + + /**Maintain the values of the RTE after page reload. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Shows the resize icon and enables the resize option in the RTE. + * @Default {True} + */ + enableResize?: boolean; + + /**Shows the RTE in the RTL direction. + * @Default {false} + */ + enableRTL?: boolean; + + /**Formats the contents based on the XHTML rules. + * @Default {false} + */ + enableXHTML?: boolean; + + /**Enables the tab key action with the RichTextEditor content. + * @Default {True} + */ + enableTabKeyNavigation?: boolean; + + /**Load the external CSS file inside Iframe. + * @Default {null} + */ + externalCSS?: string; + + /**This API allows to enable the file browser support in the RTE control to browse, create, delete and upload the files in the specified current directory. + * @Default {null} + */ + fileBrowser?: FileBrowser; + + /**Sets the fontName in the RTE. + * @Default {{text: Segoe UI, value: Segoe UI },{text: Arial, value: Arial,Helvetica,sans-serif },{text: Courier New, value: Courier New,Courier,Monospace },{text: Georgia, value: Georgia,serif },{text: Impact, value: Impact,Charcoal,sans-serif },{text: Lucida Console, value: Lucida Console,Monaco,Monospace },{text: Tahoma, value: Tahoma,Geneva,sans-serif },{text: Times New Roman, value: Times New Roman },{text: Trebuchet MS, value: Trebuchet MS,Helvetica,sans-serif },{text: Verdana, value: Verdana,Geneva,sans-serif}} + */ + fontName?: any; + + /**Sets the fontSize in the RTE. + * @Default {{ text: 1, value: 1 },{ text: 2 (10pt), value: 2 },{ text: 3 (12pt), value: 3 },{ text: 4 (14pt), value: 4 },{ text: 5 (18pt), value: 5 },{ text: 6 (24pt), value: 6 },{ text: 7 (36pt), value: 7 }} + */ + fontSize?: any; + + /**Sets the format in the RTE. + * @Default {{ text: Paragraph, value: <p>, spriteCssClass: e-paragraph },{ text: Quotation, value: <blockquote>, spriteCssClass: e-quotation },{ text: Heading 1, value: <h1>, spriteCssClass: e-h1 },{ text: Heading 2, value: <h2>, spriteCssClass: e-h2 },{ text: Heading 3, value: <h3>, spriteCssClass: e-h3 },{ text: Heading 4, value: <h4>, spriteCssClass: e-h4 },{ text: Heading 5, value: <h5>, spriteCssClass: e-h5 },{ text: Heading 6, value: <h6>, spriteCssClass: e-h6}} + */ + format?: string; + + /**Defines the height of the RTE textbox. + * @Default {370} + */ + height?: string|number; + + /**Specifies the HTML Attributes of the ejRTE. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Sets the given attributes to the iframe body element. + * @Default {{}} + */ + iframeAttributes?: any; + + /**This API allows the image browser to support in the RTE control to browse, create, delete, and upload the image files to the specified current directory. + * @Default {null} + */ + imageBrowser?: ImageBrowser; + + /**Enables/disables responsive support for the RTE control toolbar items during the window resizing time. + * @Default {false} + */ + isResponsive?: boolean; + + /**Sets the culture in the RTE when you set the localization values are needs to be assigned to the corresponding text as follows. + * @Default {en-US} + */ + locale?: string; + + /**Sets the maximum height for the RTE outer wrapper element. + * @Default {null} + */ + maxHeight?: string|number; + + /**Sets the maximum length for the RTE outer wrapper element. + * @Default {7000} + */ + maxLength?: number; + + /**Sets the maximum width for the RTE outer wrapper element. + * @Default {null} + */ + maxWidth?: string|number; + + /**Sets the minimum height for the RTE outer wrapper element. + * @Default {280} + */ + minHeight?: string|number; + + /**Sets the minimum width for the RTE outer wrapper element. + * @Default {400} + */ + minWidth?: string|number; + + /**Sets the name in the RTE. When the name value is not initialized, the ID value is assigned to the name. + */ + name?: string; + + /**Shows ClearAll icon in the RTE footer. + * @Default {false} + */ + showClearAll?: boolean; + + /**Shows the clear format in the RTE footer. + * @Default {true} + */ + showClearFormat?: boolean; + + /**Shows the Custom Table in the RTE. + * @Default {True} + */ + showCustomTable?: boolean; + + /**Shows custom contextmenu with the RTE. + * @Default {True} + */ + showContextMenu?: boolean; + + /**This API is used to set the default dimensions for the image and video. When this property is set to true, the image and video dialog displays the dimension option. + * @Default {false} + */ + showDimensions?: boolean; + + /**Shows the FontOption in the RTE. + * @Default {True} + */ + showFontOption?: boolean; + + /**Shows footer in the RTE. When the footer is enabled, it displays the html tag, word Count, character count, clear format, resize icon and clear all the content icons, by default. + * @Default {false} + */ + showFooter?: boolean; + + /**Shows the HtmlSource in the RTE footer. + * @Default {false} + */ + showHtmlSource?: boolean; + + /**When the cursor is placed or when the text is selected in the RTE, it displays the tag info in the footer. + * @Default {True} + */ + showHtmlTagInfo?: boolean; + + /**Shows the toolbar in the RTE. + * @Default {True} + */ + showToolbar?: boolean; + + /**Counts the total characters and displays it in the RTE footer. + * @Default {True} + */ + showCharCount?: boolean; + + /**Counts the total words and displays it in the RTE footer. + * @Default {True} + */ + showWordCount?: boolean; + + /**The given number of columns render the insert table pop. + * @Default {10} + */ + tableColumns?: number; + + /**The given number of rows render the insert table pop. + * @Default {8} + */ + tableRows?: number; + + /**Sets the tools in the RTE and gets the inner display order of the corresponding group element. Tools are dependent on the toolsList property. + * @Default {formatStyle: [format],style: [bold, italic, underline, strikethrough],alignment: [justifyLeft, justifyCenter, justifyRight, justifyFull],lists: [unorderedList, orderedList],indenting: [outdent, indent],doAction: [undo, redo],links: [createLink,removeLink],images: [image],media: [video],tables: [createTable, addRowAbove, addRowBelow, addColumnLeft, addColumnRight, deleteRow, deleteColumn, deleteTable]],view:[“fullScreen”,zoomIn,zoomOut],print:[print]} + */ + tools?: Tools; + + /**Specifies the list of groups and order of those groups displayed in the RTE toolbar. The toolsList property is used to get the root group order and tools property is used to get the inner order of the corresponding groups displayed. When the value is not specified, it gets its default display order and tools. + * @Default {[formatStyle, font, style, effects, alignment, lists, indenting, clipboard, doAction, clear, links, images, media, tables, casing,view, customTools,print,edit]} + */ + toolsList?: Array; + + /**Gets the undo stack limit. + * @Default {50} + */ + undoStackLimit?: number; + + /**The given string value is displayed in the editable area. + * @Default {null} + */ + value?: string; + + /**Sets the jquery validation rules to the Rich Text Editor. + * @Default {null} + */ + validationRules?: any; + + /**Sets the jquery validation error message to the Rich Text Editor. + * @Default {null} + */ + validationMessage?: any; + + /**Defines the width of the RTE textbox. + * @Default {786} + */ + width?: string|number; + + /**Increases and decreases the contents zoom range in percentage + * @Default {0.05} + */ + zoomStep?: string|number; + + /**Fires when changed successfully.*/ + change? (e: ChangeEventArgs): void; + + /**Fires when the RTE is created successfully*/ + create? (e: CreateEventArgs): void; + + /**Fires when mouse click on menu items.*/ + contextMenuClick? (e: ContextMenuClickEventArgs): void; + + /**Fires before the RTE is destroyed.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires when the commands are executed successfully.*/ + execute? (e: ExecuteEventArgs): void; + + /**Fires when the keydown action is successful.*/ + keydown? (e: KeydownEventArgs): void; + + /**Fires when the keyup action is successful.*/ + keyup? (e: KeyupEventArgs): void; + + /**Fires before the RTE Edit area is rendered and after the toolbar is rendered.*/ + preRender? (e: PreRenderEventArgs): void; +} + +export interface ChangeEventArgs { + + /**When the event is canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the RTE model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface CreateEventArgs { + + /**When the event is canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns the RTE model + */ + model?: any; + + /**Returns the name of the event + */ + type?: string; +} + +export interface ContextMenuClickEventArgs { + + /**returns clicked menu item text. + */ + text?: string; + + /**returns clicked menu item element. + */ + element?: any; + + /**returns the selected item. + */ + selectedItem?: number; +} + +export interface DestroyEventArgs { + + /**When the event is canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns the RTE model + */ + model?: any; + + /**Returns the name of the event + */ + type?: string; +} + +export interface ExecuteEventArgs { + + /**When the event is canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns the RTE model + */ + model?: any; + + /**Returns the name of the event + */ + type?: string; +} + +export interface KeydownEventArgs { + + /**When the event is canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns the RTE model + */ + model?: any; + + /**Returns the name of the event + */ + type?: string; +} + +export interface KeyupEventArgs { + + /**When the event is canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns the RTE model + */ + model?: any; + + /**Returns the name of the event + */ + type?: string; +} + +export interface PreRenderEventArgs { + + /**When the event is canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns the RTE model + */ + model?: any; + + /**Returns the name of the event + */ + type?: string; +} + +export interface FileBrowser { + + /**This API is used to receive the server-side handler for file related operations. + */ + ajaxAction?: string; + + /**Specifies the file type extension shown in the file browser window. + */ + extensionAllow?: string; + + /**Specifies the directory to perform operations like create, delete and rename folder and files, and upload the selected files to the current directory. + */ + filePath?: string; +} + +export interface ImageBrowser { + + /**This API is used to receive the server-side handler for the file related operations. + */ + ajaxAction?: string; + + /**Specifies the file type extension shown in the image browser window. + */ + extensionAllow?: string; + + /**Specifies the directory to perform operations like create, delete and rename folder and files, and upload the selected images to the current directory. + */ + filePath?: string; +} + +export interface ToolsCustomOrderedList { + + /**Specifies the name for customOrderedList item. + */ + name?: string; + + /**Specifies the title for customOrderedList item. + */ + tooltip?: string; + + /**Specifies the styles for customOrderedList item. + */ + css?: string; + + /**Specifies the text for customOrderedList item. + */ + text?: string; + + /**Specifies the list style for customOrderedList item. + */ + listStyle?: string; + + /**Specifies the image for customOrderedList item. + */ + listImage?: string; +} + +export interface ToolsCustomUnorderedList { + + /**Specifies the name for customUnorderedList item. + */ + name?: string; + + /**Specifies the title for customUnorderedList item. + */ + tooltip?: string; + + /**Specifies the styles for customUnorderedList item. + */ + css?: string; + + /**Specifies the text for customUnorderedList item. + */ + text?: string; + + /**Specifies the list style for customUnorderedList item. + */ + listStyle?: string; + + /**Specifies the image for customUnorderedList item. + */ + listImage?: string; +} + +export interface Tools { + + /**Specifies the alignment tools and the display order of this tool in the RTE toolbar. + */ + alignment?: any; + + /**Specifies the casing tools and the display order of this tool in the RTE toolbar. + */ + casing?: Array; + + /**Specifies the clear tools and the display order of this tool in the RTE toolbar. + */ + clear?: Array; + + /**Specifies the clipboard tools and the display order of this tool in the RTE toolbar. + */ + clipboard?: Array; + + /**Specifies the edit tools and the displays tool in the RTE toolbar. + */ + edit?: Array; + + /**Specifies the doAction tools and the display order of this tool in the RTE toolbar. + */ + doAction?: Array; + + /**Specifies the effect of tools and the display order of this tool in RTE toolbar. + */ + effects?: Array; + + /**Specifies the font tools and the display order of this tool in the RTE toolbar. + */ + font?: Array; + + /**Specifies the formatStyle tools and the display order of this tool in the RTE toolbar. + */ + formatStyle?: Array; + + /**Specifies the image tools and the display order of this tool in the RTE toolbar. + */ + images?: Array; + + /**Specifies the indent tools and the display order of this tool in the RTE toolbar. + */ + indenting?: Array; + + /**Specifies the link tools and the display order of this tool in the RTE toolbar. + */ + links?: Array; + + /**Specifies the list tools and the display order of this tool in the RTE toolbar. + */ + lists?: Array; + + /**Specifies the media tools and the display order of this tool in the RTE toolbar. + */ + media?: Array; + + /**Specifies the style tools and the display order of this tool in the RTE toolbar. + */ + style?: Array; + + /**Specifies the table tools and the display order of this tool in the RTE toolbar. + */ + tables?: Array; + + /**Specifies the view tools and the display order of this tool in the RTE toolbar. + */ + view?: Array; + + /**Specifies the print tools and the display order of this tool in the RTE toolbar. + */ + print?: Array; + + /**Specifies the customOrderedList tools and the display order of this tool in the RTE toolbar. + */ + customOrderedList?: Array; + + /**Specifies the customUnOrderedList tools and the display order of this tool in the RTE toolbar. + */ + customUnorderedList?: Array; +} +} + +class Slider extends ej.Widget { + static fn: Slider; + constructor(element: JQuery, options?: Slider.Model); + constructor(element: Element, options?: Slider.Model); + model:Slider.Model; + defaults:Slider.Model; + + /** To disable the slider + * @returns {void} + */ + disable(): void; + + /** To enable the slider + * @returns {void} + */ + enable(): void; + + /** To get value from slider handle + * @returns {number} + */ + getValue(): number; + + /** To set value to slider handle + * @returns {void} + */ + setValue(): void; +} +export module Slider{ + +export interface Model { + + /**Specifies the animationSpeed of the slider. + * @Default {500} + */ + animationSpeed?: number; + + /**Specify the CSS class to slider to achieve custom theme. + */ + cssClass?: string; + + /**Specifies the animation behavior of the slider. + * @Default {true} + */ + enableAnimation?: boolean; + + /**Specifies the state of the slider. + * @Default {true} + */ + enabled?: boolean; + + /**Specify the enablePersistence to slider to save current model value to browser cookies for state maintains + * @Default {false} + */ + enablePersistence?: boolean; + + /**Specifies the Right to Left Direction of the slider. + * @Default {false} + */ + enableRTL?: boolean; + + /**Specifies the height of the slider. + * @Default {14} + */ + height?: string; + + /**Specifies the HTML Attributes of the ejSlider. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Specifies the incremental step value of the slider. + * @Default {1} + */ + incrementStep?: number; + + /**Specifies the distance between two major (large) ticks from the scale of the slider. + * @Default {10} + */ + largeStep?: number; + + /**Specifies the ending value of the slider. + * @Default {100} + */ + maxValue?: number; + + /**Specifies the starting value of the slider. + * @Default {0} + */ + minValue?: number; + + /**Specifies the orientation of the slider. + * @Default {ej.orientation.Horizontal} + */ + orientation?: ej.Orientation|string; + + /**Specifies the readOnly of the slider. + * @Default {false} + */ + readOnly?: boolean; + + /**Specifies the rounded corner behavior for slider. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Shows/Hide the major (large) and minor (small) ticks in the scale of the slider. + * @Default {false} + */ + showScale?: boolean; + + /**Specifies the small ticks from the scale of the slider. + * @Default {true} + */ + showSmallTicks?: boolean; + + /**Specifies the showTooltip to shows the current Slider value, while moving the Slider handle or clicking on the slider handle of the slider. + * @Default {true} + */ + showTooltip?: boolean; + + /**Specifies the sliderType of the slider. + * @Default {ej.SliderType.Default} + */ + sliderType?: ej.slider.sliderType|string; + + /**Specifies the distance between two minor (small) ticks from the scale of the slider. + * @Default {1} + */ + smallStep?: number; + + /**Specifies the value of the slider. But it's not applicable for range slider. To range slider we can use values property. + * @Default {0} + */ + value?: number; + + /**Specifies the values of the range slider. But it's not applicable for default and minRange sliders. we can use value property for default and minRange sliders. + * @Default {[minValue,maxValue]} + */ + values?: Array; + + /**Specifies the width of the slider. + * @Default {100%} + */ + width?: string; + + /**Fires once Slider control value is changed successfully.*/ + change? (e: ChangeEventArgs): void; + + /**Fires once Slider control has been created successfully.*/ + create? (e: CreateEventArgs): void; + + /**Fires when Slider control has been destroyed successfully.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires once Slider control is sliding successfully.*/ + slide? (e: SlideEventArgs): void; + + /**Fires once Slider control is started successfully.*/ + start? (e: StartEventArgs): void; + + /**Fires when Slider control is stopped successfully.*/ + stop? (e: StopEventArgs): void; +} + +export interface ChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns current handle number or index + */ + sliderIndex?: number; + + /**returns slider id. + */ + id?: string; + + /**returns the slider model. + */ + model?: ej.Slider.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns the slider value. + */ + value?: number; + + /**returns true if event triggered by interaction else returns false. + */ + isInteraction?: boolean; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the slider model + */ + model?: ej.Slider.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the slider model + */ + model?: ej.Slider.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface SlideEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns current handle number or index + */ + sliderIndex?: number; + + /**returns slider id + */ + id?: string; + + /**returns the slider model + */ + model?: ej.Slider.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the slider value + */ + value?: number; +} + +export interface StartEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns current handle number or index + */ + sliderIndex?: number; + + /**returns slider id + */ + id?: string; + + /**returns the slider model + */ + model?: ej.Slider.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the slider value + */ + value?: number; +} + +export interface StopEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns current handle number or index + */ + sliderIndex?: number; + + /**returns slider id + */ + id?: string; + + /**returns the slider model + */ + model?: ej.Slider.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the slider value + */ + value?: number; +} +} +module slider +{ +enum sliderType +{ +//Shows default slider +Default, +//Shows minRange slider +MinRange, +//Shows Range slider +Range, +} +} + +class SplitButton extends ej.Widget { + static fn: SplitButton; + constructor(element: JQuery, options?: SplitButton.Model); + constructor(element: Element, options?: SplitButton.Model); + model:SplitButton.Model; + defaults:SplitButton.Model; + + /** destroy the split button widget all events bound using this._on will be unbind automatically and bring the control to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** To disable the split button + * @returns {void} + */ + disable(): void; + + /** To Enable the split button + * @returns {void} + */ + enable(): void; + + /** To Hide the list content of the split button. + * @returns {void} + */ + hide(): void; + + /** To show the list content of the split button. + * @returns {void} + */ + show(): void; +} +export module SplitButton{ + +export interface Model { + + /**Specifies the arrowPosition of the Split or Dropdown Button.See arrowPosition + * @Default {ej.ArrowPosition.Right} + */ + arrowPosition?: string|ej.ArrowPosition; + + /**Specifies the buttonMode like Split or Dropdown Button.See ButtonMode + * @Default {ej.ButtonMode.Split} + */ + buttonMode?: string|ej.ButtonMode; + + /**Specifies the contentType of the Split Button.See ContentType + * @Default {ej.ContentType.TextOnly} + */ + contentType?: string|ej.ContentType; + + /**Set the root class for Split Button control theme + */ + cssClass?: string; + + /**Specifies the disabling of Split Button if enabled is set to false. + * @Default {true} + */ + enabled?: boolean; + + /**Specifies the enableRTL property for Split Button while initialization. + * @Default {false} + */ + enableRTL?: boolean; + + /**Specifies the height of the Split Button. + * @Default {“”} + */ + height?: string|number; + + /**Specifies the HTML Attributes of the Split Button. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Specifies the imagePosition of the Split Button.See imagePositions + * @Default {ej.ImagePosition.ImageRight} + */ + imagePosition?: string|ej.ImagePosition; + + /**Specifies the image content for Split Button while initialization. + */ + prefixIcon?: string; + + /**Specifies the showRoundedCorner property for Split Button while initialization. + * @Default {false} + */ + showRoundedCorner?: string; + + /**Specifies the size of the Button. See ButtonSize + * @Default {ej.ButtonSize.Normal} + */ + size?: string|ej.ButtonSize; + + /**Specifies the image content for Split Button while initialization. + */ + suffixIcon?: string; + + /**Specifies the list content for Split Button while initialization + */ + targetID?: string; + + /**Specifies the text content for Split Button while initialization. + */ + text?: string; + + /**Specifies the width of the Split Button. + * @Default {“”} + */ + width?: string|number; + + /**Fires before menu of the split button control is opened.*/ + beforeOpen? (e: BeforeOpenEventArgs): void; + + /**Fires when Button control is clicked successfully*/ + click? (e: ClickEventArgs): void; + + /**Fires before the list content of Button control is closed*/ + close? (e: CloseEventArgs): void; + + /**Fires after Split Button control is created.*/ + create? (e: CreateEventArgs): void; + + /**Fires when the Split Button is destroyed successfully*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires when a menu item is Hovered out successfully*/ + itemMouseOut? (e: ItemMouseOutEventArgs): void; + + /**Fires when a menu item is Hovered in successfully*/ + itemMouseOver? (e: ItemMouseOverEventArgs): void; + + /**Fires when a menu item is clicked successfully*/ + itemSelected? (e: ItemSelectedEventArgs): void; + + /**Fires before the list content of Button control is opened*/ + open? (e: OpenEventArgs): void; +} + +export interface BeforeOpenEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the split button model + */ + model?: ej.SplitButton.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface ClickEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the split button model + */ + model?: ej.SplitButton.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the target of the current object. + */ + target?: any; + + /**return the button state + */ + status?: boolean; +} + +export interface CloseEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the split button model + */ + model?: ej.SplitButton.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface CreateEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the split button model + */ + model?: ej.SplitButton.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the split button model + */ + model?: ej.SplitButton.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface ItemMouseOutEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the split button model + */ + model?: ej.SplitButton.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the clicked menu item element + */ + element?: any; + + /**returns the event + */ + event?: any; +} + +export interface ItemMouseOutEvent { + + /**return the menu item id + */ + ID?: string; + + /**return the clicked menu item text + */ + Text?: string; +} + +export interface ItemMouseOverEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the split button model + */ + model?: ej.SplitButton.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the clicked menu item element + */ + element?: any; + + /**returns the event + */ + event?: any; +} + +export interface ItemMouseOverEvent { + + /**return the menu item id + */ + ID?: string; + + /**return the clicked menu item text + */ + Text?: string; +} + +export interface ItemSelectedEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the split button model + */ + model?: ej.SplitButton.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the clicked menu item element + */ + element?: any; + + /**returns the selected item + */ + selectedItem?: any; + + /**return the menu id + */ + menuId?: string; + + /**return the clicked menu item text + */ + menuText?: string; +} + +export interface OpenEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the split button model + */ + model?: ej.SplitButton.Model; + + /**returns the name of the event + */ + type?: string; +} +} +enum ArrowPosition +{ +//To set Left arrowPosition of the split button +Left, +//To set Right arrowPosition of the split button +Right, +//To set Top arrowPosition of the split button +Top, +//To set Bottom arrowPosition of the split button +Bottom, +} + +class Splitter extends ej.Widget { + static fn: Splitter; + constructor(element: JQuery, options?: Splitter.Model); + constructor(element: Element, options?: Splitter.Model); + model:Splitter.Model; + defaults:Splitter.Model; + + /** To add a new pane to splitter control. + * @param {string} content of pane. + * @param {any} pane properties. + * @param {number} index of pane. + * @returns {HTMLElement} + */ + addItem(content: string, property: any, index: number): HTMLElement; + + /** To collapse the splitter control pane. + * @param {number} index number of pane. + * @returns {void} + */ + collapse(paneIndex: number): void; + + /** To expand the splitter control pane. + * @param {number} index number of pane. + * @returns {void} + */ + expand(paneIndex: number): void; + + /** To refresh the splitter control pane resizing. + * @returns {void} + */ + refresh(): void; + + /** To remove a specified pane from the splitter control. + * @param {number} index of pane. + * @returns {void} + */ + removeItem(index: number): void; +} +export module Splitter{ + +export interface Model { + + /**Turns on keyboard interaction with the Splitter panes. You must set this property to true to access the keyboard shortcuts of ejSplitter. + * @Default {true} + */ + allowKeyboardNavigation?: boolean; + + /**Specify animation speed for the Splitter pane movement, while collapsing and expanding. + * @Default {300} + */ + animationSpeed?: number; + + /**Specify the CSS class to splitter control to achieve custom theme. + * @Default {“”} + */ + cssClass?: string; + + /**Specifies the animation behavior of the splitter. + * @Default {true} + */ + enableAnimation?: boolean; + + /**Specifies the splitter control to be displayed in right to left direction. + * @Default {false} + */ + enableRTL?: boolean; + + /**Specify height for splitter control. + * @Default {null} + */ + height?: string; + + /**Specifies the HTML Attributes of the Splitter. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Specify window resizing behavior for splitter control. + * @Default {false} + */ + isResponsive?: boolean; + + /**Specify the orientation for spliter control. See orientation + * @Default {ej.orientation.Horizontal or “horizontal”} + */ + orientation?: ej.Orientation|string; + + /**Specify properties for each pane like paneSize, minSize, maxSize, collapsible, resizable. + * @Default {[]} + */ + properties?: Array; + + /**Specify width for splitter control. + * @Default {null} + */ + width?: string; + + /**Fires before expanding / collapsing the split pane of splitter control.*/ + beforeExpandCollapse? (e: BeforeExpandCollapseEventArgs): void; + + /**Fires when splitter control pane has been created.*/ + create? (e: CreateEventArgs): void; + + /**Fires when splitter control pane has been destroyed.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires when expand / collapse operation in splitter control pane has been performed successfully.*/ + expandCollapse? (e: ExpandCollapseEventArgs): void; + + /**Fires when resize in splitter control pane.*/ + resize? (e: ResizeEventArgs): void; +} + +export interface BeforeExpandCollapseEventArgs { + + /**if the event should be cancelled; otherwise, false. + */ + cancel?: boolean; + + /**returns collapsed pane details. + */ + collapsed?: any; + + /**returns expanded pane details. + */ + expanded?: any; + + /**returns the splitter model. + */ + model?: ej.Splitter.Model; + + /**returns the current split bar index. + */ + splitbarIndex?: number; + + /**returns the name of the event. + */ + type?: string; +} + +export interface CreateEventArgs { + + /**if the event should be cancelled; otherwise, false. + */ + cancel?: boolean; + + /**returns the splitter model. + */ + model?: ej.Splitter.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be cancelled; otherwise, false. + */ + cancel?: boolean; + + /**returns the splitter model. + */ + model?: ej.Splitter.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface ExpandCollapseEventArgs { + + /**if the event should be cancelled; otherwise, false. + */ + cancel?: boolean; + + /**returns collapsed pane details. + */ + collapsed?: any; + + /**returns expanded pane details. + */ + expanded?: any; + + /**returns the splitter model. + */ + model?: ej.Splitter.Model; + + /**returns the current split bar index. + */ + splitbarIndex?: number; + + /**returns the name of the event. + */ + type?: string; +} + +export interface ResizeEventArgs { + + /**if the event should be cancelled; otherwise, false. + */ + cancel?: boolean; + + /**returns previous pane details. + */ + prevPane?: any; + + /**returns next pane details. + */ + nextPane?: any; + + /**returns the splitter model. + */ + model?: ej.Splitter.Model; + + /**returns the current split bar index. + */ + splitbarIndex?: number; + + /**returns the name of the event. + */ + type?: string; +} +} + +class Tab extends ej.Widget { + static fn: Tab; + constructor(element: JQuery, options?: Tab.Model); + constructor(element: Element, options?: Tab.Model); + model:Tab.Model; + defaults:Tab.Model; + + /** Add new tab items with given name, url and given index position, if index null it’s add last item. + * @param {string} URL name / tab id. + * @param {string} Tab Display name. + * @param {number} Index position to placed , this is optional. + * @param {string} specifies cssClass, this is optional. + * @param {string} specifies id of tab, this is optional. + * @returns {void} + */ + addItem(url: string, displayLabel: string, index: number, cssClass: string, id: string): void; + + /** To disable the tab control. + * @returns {void} + */ + disable(): void; + + /** To enable the tab control. + * @returns {void} + */ + enable(): void; + + /** This function get the number of tab rendered + * @returns {number} + */ + getItemsCount(): number; + + /** This function hides the tab control. + * @returns {void} + */ + hide(): void; + + /** This function hides the specified item tab in tab control. + * @param {number} index of tab item. + * @returns {void} + */ + hideItem(index: number): void; + + /** Remove the given index tab item. + * @param {number} index of tab item. + * @returns {void} + */ + removeItem(index: number): void; + + /** This function is to show the tab control. + * @returns {void} + */ + show(): void; + + /** This function helps to show the specified hidden tab item in tab control. + * @param {number} index of tab item. + * @returns {void} + */ + showItem(index: number): void; +} +export module Tab{ + +export interface Model { + + /**Specifies the ajaxSettings option to load the content to the Tab control. + */ + ajaxSettings?: AjaxSettings; + + /**Tab items interaction with keyboard keys, like headers active navigation. + * @Default {true} + */ + allowKeyboardNavigation?: boolean; + + /**Allow to collapsing the active item, while click on the active header. + * @Default {false} + */ + collapsible?: boolean; + + /**Set the root class for Tab theme. This cssClass API helps to use custom skinning option for Tab control. + */ + cssClass?: string; + + /**Disables the given tab headers and content panels. + * @Default {[]} + */ + disabledItemIndex?: number[]; + + /**Specifies the animation behavior of the tab. + * @Default {true} + */ + enableAnimation?: boolean; + + /**When this property is set to false, it disables the tab control. + * @Default {true} + */ + enabled?: boolean; + + /**Enables the given tab headers and content panels. + * @Default {[]} + */ + enabledItemIndex?: number[]; + + /**Save current model value to browser cookies for state maintains. While refresh the Tab control page the model value apply from browser cookies. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Display Right to Left direction for headers and panels text of tab. + * @Default {false} + */ + enableRTL?: boolean; + + /**Specify to enable scrolling for Tab header. + * @Default {false} + */ + enableTabScroll?: boolean; + + /**The event API to bind the action for active the tab items. + * @Default {click} + */ + events?: string; + + /**Specifies the position of Tab header as top, bottom, left or right. See below to get availanle Position + * @Default {top} + */ + headerPosition?: string | ej.Tab.Position; + + /**Set the height of the tab header element. Default this property value is null, so height take content height. + * @Default {null} + */ + headerSize?: string|number; + + /**Height set the outer panel element. Default this property value is null, so height take content height. + * @Default {null} + */ + height?: string|number; + + /**Adjust the content panel height for given option (content, auto and fill), by default panels height adjust based on the content.See below to get available HeightAdjustMode + * @Default {content} + */ + heightAdjustMode?: string | ej.Tab.HeightAdjustMode; + + /**Specifies to hide a pane of Tab control. + * @Default {[]} + */ + hiddenItemIndex?: Array; + + /**Specifies the HTML Attributes of the Tab. + * @Default {{}} + */ + htmlAttributes?: any; + + /**The idPrefix property appends the given string on the added tab item id’s in runtime. + * @Default {ej-tab-} + */ + idPrefix?: string; + + /**Specifies the Tab header in active for given index value. + * @Default {0} + */ + selectedItemIndex?: number; + + /**Display the close button for each tab items. While clicking on the close icon, particular tab item will be removed. + * @Default {false} + */ + showCloseButton?: boolean; + + /**Display the Reload button for each tab items. + * @Default {false} + */ + showReloadIcon?: boolean; + + /**Tab panels and headers to be displayed in rounded corner style. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Set the width for outer panel element, if not it’s take parent width. + * @Default {null} + */ + width?: string|number; + + /**Triggered after a tab item activated.*/ + itemActive? (e: ItemActiveEventArgs): void; + + /**Triggered before ajax content has been loaded.*/ + ajaxBeforeLoad? (e: AjaxBeforeLoadEventArgs): void; + + /**Triggered if error occurs in Ajax request.*/ + ajaxError? (e: AjaxErrorEventArgs): void; + + /**Triggered after ajax content load action.*/ + ajaxLoad? (e: AjaxLoadEventArgs): void; + + /**Triggered after a tab item activated.*/ + ajaxSuccess? (e: AjaxSuccessEventArgs): void; + + /**Triggered before a tab item activated.*/ + beforeActive? (e: BeforeActiveEventArgs): void; + + /**Triggered before a tab item remove.*/ + beforeItemRemove? (e: BeforeItemRemoveEventArgs): void; + + /**Triggered before a tab item Create.*/ + create? (e: CreateEventArgs): void; + + /**Triggered before a tab item destroy.*/ + destroy? (e: DestroyEventArgs): void; + + /**Triggered after new tab item add*/ + itemAdd? (e: ItemAddEventArgs): void; + + /**Triggered after tab item removed.*/ + itemRemove? (e: ItemRemoveEventArgs): void; +} + +export interface ItemActiveEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the tab model. + */ + model?: ej.Tab.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns previous active tab header. + */ + prevActiveHeader?: HTMLElement; + + /**returns previous active index. + */ + prevActiveIndex?: number; + + /**returns current active tab header . + */ + activeHeader?: HTMLElement; + + /**returns current active index. + */ + activeIndex?: number; + + /**returns, is it triggered by interaction or not. + */ + isInteraction?: boolean; +} + +export interface AjaxBeforeLoadEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the tab model. + */ + model?: ej.Tab.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns previous active tab header. + */ + prevActiveHeader?: HTMLElement; + + /**returns previous active index. + */ + prevActiveIndex?: number; + + /**returns current active tab header . + */ + activeHeader?: HTMLElement; + + /**returns current active index. + */ + activeIndex?: number; + + /**returns the url of ajax request + */ + url?: string; + + /**returns, is it triggered by interaction or not. + */ + isInteraction?: boolean; +} + +export interface AjaxErrorEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the tab model. + */ + model?: ej.Tab.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns ajax data details. + */ + data?: any; + + /**returns the url of ajax request. + */ + url?: string; +} + +export interface AjaxLoadEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the tab model. + */ + model?: ej.Tab.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns previous active tab header. + */ + prevActiveHeader?: HTMLElement; + + /**returns previous active index. + */ + prevActiveIndex?: number; + + /**returns current active tab header . + */ + activeHeader?: HTMLElement; + + /**returns current active index. + */ + activeIndex?: number; + + /**returns the url of ajax request + */ + url?: string; + + /**returns, is it triggered by interaction or not. + */ + isInteraction?: boolean; +} + +export interface AjaxSuccessEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the tab model. + */ + model?: ej.Tab.Model; + + /**returns the name of the event. + */ + type?: string; + + /**return ajax data. + */ + data?: any; + + /**returns ajax url + */ + url?: string; + + /**returns content of ajax request. + */ + content?: any; +} + +export interface BeforeActiveEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the tab model. + */ + model?: ej.Tab.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns previous active tab header. + */ + prevActiveHeader?: HTMLElement; + + /**returns previous active index. + */ + prevActiveIndex?: number; + + /**returns current active tab header . + */ + activeHeader?: HTMLElement; + + /**returns current active index. + */ + activeIndex?: number; + + /**returns, is it triggered by interaction or not. + */ + isInteraction?: boolean; +} + +export interface BeforeItemRemoveEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the tab model. + */ + model?: ej.Tab.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns current tab item index + */ + index?: number; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the tab model. + */ + model?: ej.Tab.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the tab model. + */ + model?: ej.Tab.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface ItemAddEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the tab model. + */ + model?: ej.Tab.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns new added tab header. + */ + tabHeader?: HTMLElement; + + /**returns new added tab content panel. + */ + tabContent?: any; +} + +export interface ItemRemoveEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the tab model. + */ + model?: ej.Tab.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns removed tab header. + */ + removedTab?: HTMLElement; +} + +export interface AjaxSettings { + + /**It specifies, whether to enable or disable asynchronous request. + * @Default {true} + */ + async?: boolean; + + /**It specifies the page will be cached in the web browser. + * @Default {false} + */ + cache?: boolean; + + /**It specifies the type of data is send in the query string. + * @Default {html} + */ + contentType?: string; + + /**It specifies the data as an object, will be passed in the query string. + * @Default {{}} + */ + data?: any; + + /**It specifies the type of data that you're expecting back from the response. + * @Default {html} + */ + dataType?: string; + + /**It specifies the HTTP request type. + * @Default {get} + */ + type?: string; +} + +enum Position{ + + ///Tab headers display to top position + Top, + + ///Tab headers display to bottom position + Bottom, + + ///Tab headers display to left position. + Left, + + ///Tab headers display to right position. + Right +} + + +enum HeightAdjustMode{ + + ///string + None, + + ///string + Content, + + ///string + Auto, + + ///string + Fill +} + +} + +class TagCloud extends ej.Widget { + static fn: TagCloud; + constructor(element: JQuery, options?: TagCloud.Model); + constructor(element: Element, options?: TagCloud.Model); + model:TagCloud.Model; + defaults:TagCloud.Model; + + /** Inserts a new item into the TagCloud + * @param {string} Insert new item into the TagCloud + * @returns {void} + */ + insert(name: string): void; + + /** Inserts a new item into the TagCloud at a particular position. + * @param {string} Inserts a new item into the TagCloud + * @param {number} Inserts a new item into the TagCloud with the specified position + * @returns {void} + */ + insertAt(name: string, position: number): void; + + /** Removes the item from the TagCloud based on the name. It removes all the tags which have the corresponding name + * @param {string} name of the tag. + * @returns {void} + */ + remove(name: string): void; + + /** Removes the item from the TagCloud based on the position. It removes the tags from the the corresponding position only. + * @param {number} position of tag item. + * @returns {void} + */ + removeAt(position: number): void; +} +export module TagCloud{ + +export interface Model { + + /**Specify the CSS class to button to achieve custom theme. + */ + cssClass?: string; + + /**The dataSource contains the list of data to display in a cloud format. Each data contains a link url, frequency to categorize the font size and a display text. + * @Default {null} + */ + dataSource?: any; + + /**Sets the TagCloud and tag items direction as right to left alignment. + * @Default {false} + */ + enableRTL?: boolean; + + /**Defines the mapping fields for the data items of the TagCloud. + * @Default {null} + */ + fields?: Fields; + + /**Defines the format for the TagCloud to display the tag items.See Format + * @Default {ej.Format.Cloud} + */ + format?: string|ej.Format; + + /**Sets the maximum font size value for the tag items. The font size for the tag items will be generated in between the minimum and maximum font size values. + * @Default {40px} + */ + maxFontSize?: string|number; + + /**Sets the minimum font size value for the tag items. The font size for the tag items will be generated in between the minimum and maximum font size values. + * @Default {10px} + */ + minFontSize?: string|number; + + /**Define the query to retrieve the data from online server. The query is used only when the online dataSource is used. + * @Default {null} + */ + query?: any; + + /**Shows or hides the TagCloud title. When this set to false, it hides the TagCloud header. + * @Default {true} + */ + showTitle?: boolean; + + /**Sets the title image for the TagCloud. To show the title image, the showTitle property should be enabled. + * @Default {null} + */ + titleImage?: string; + + /**Sets the title text for the TagCloud. To show the title text, the showTitle property should be enabled. + * @Default {Title} + */ + titleText?: string; + + /**Event triggers when the TagCloud items are clicked*/ + click? (e: ClickEventArgs): void; + + /**Event triggers when the TagCloud are created*/ + create? (e: CreateEventArgs): void; + + /**Event triggers when the TagCloud are destroyed*/ + destroy? (e: DestroyEventArgs): void; + + /**Event triggers when the cursor leaves out from a tag item*/ + mouseout? (e: MouseoutEventArgs): void; + + /**Event triggers when the cursor hovers on a tag item*/ + mouseover? (e: MouseoverEventArgs): void; +} + +export interface ClickEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TagCloud model + */ + model?: ej.TagCloud.Model; + + /**returns the name of the event + */ + type?: string; + + /**return current tag name + */ + text?: string; + + /**return current url link + */ + url?: string; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TagCloud model + */ + model?: ej.TagCloud.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TagCloud model + */ + model?: ej.TagCloud.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface MouseoutEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TagCloud model + */ + model?: ej.TagCloud.Model; + + /**returns the name of the event + */ + type?: string; + + /**return current tag name + */ + text?: string; + + /**return current url link + */ + url?: string; +} + +export interface MouseoverEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TagCloud model + */ + model?: ej.TagCloud.Model; + + /**returns the name of the event + */ + type?: string; + + /**return current tag name + */ + text?: string; + + /**return current url link + */ + url?: string; +} + +export interface Fields { + + /**Defines the frequency number to categorize the font size. + */ + frequency?: number; + + /**Defines the html attributes for the anchor elements inside the each tag items. + */ + htmlAttributes?: any; + + /**Defines the tag value or display text. + */ + text?: string; + + /**Defines the url link to navigate while click the tag. + */ + url?: string; +} +} +enum Format +{ +//To render the TagCloud items in cloud format +Cloud, +//To render the TagCloud items in list format +List, +} + +class TimePicker extends ej.Widget { + static fn: TimePicker; + constructor(element: JQuery, options?: TimePicker.Model); + constructor(element: Element, options?: TimePicker.Model); + model:TimePicker.Model; + defaults:TimePicker.Model; + + /** Allows you to disable the TimePicker. + * @returns {void} + */ + disable(): void; + + /** Allows you to enable the TimePicker. + * @returns {void} + */ + enable(): void; + + /** It returns the current time value. + * @returns {string} + */ + getValue(): string; + + /** This method will hide the TimePicker control popup. + * @returns {void} + */ + hide(): void; + + /** Updates the current system time in TimePicker. + * @returns {void} + */ + setCurrentTime(): void; + + /** This method will show the TimePicker control popup. + * @returns {void} + */ + show(): void; +} +export module TimePicker{ + +export interface Model { + + /**Sets the root CSS class for the TimePicker theme, which is used to customize. + */ + cssClass?: string; + + /**Specifies the animation behavior in TimePicker. + * @Default {true} + */ + enableAnimation?: boolean; + + /**When this property is set to false, it disables the TimePicker control. + * @Default {true} + */ + enabled?: boolean; + + /**Save current model value to browser cookies for maintaining states. When refreshing the TimePicker control page, the model value is applied from browser cookies or HTML 5local storage. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Displays the TimePicker as right to left alignment. + * @Default {false} + */ + enableRTL?: boolean; + + /**When the enableStrictMode is set as true it allows the value outside of the range and also indicate with red color border, otherwise it internally changed to the min or max range value based an input value. + * @Default {false} + */ + enableStrictMode?: boolean; + + /**Defines the height of the TimePicker textbox. + */ + height?: string|number; + + /**Sets the step value for increment an hour value through arrow keys or mouse scroll. + * @Default {1} + */ + hourInterval?: number; + + /**It allows to define the characteristics of the TimePicker control. It will helps to extend the capability of an HTML element. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Sets the time interval between the two adjacent time values in the popup. + * @Default {30} + */ + interval?: number; + + /**Defines the localization info used by the TimePicker. + * @Default {en-US} + */ + locale?: string; + + /**Sets the maximum time value to the TimePicker. + * @Default {11:59:59 PM} + */ + maxTime?: string; + + /**Sets the minimum time value to the TimePicker. + * @Default {12:00:00 AM} + */ + minTime?: string; + + /**Sets the step value for increment the minute value through arrow keys or mouse scroll. + * @Default {1} + */ + minutesInterval?: number; + + /**Defines the height of the TimePicker popup. + * @Default {191px} + */ + popupHeight?: string|number; + + /**Defines the width of the TimePicker popup. + * @Default {auto} + */ + popupWidth?: string|number; + + /**Toggles the readonly state of the TimePicker + * @Default {false} + */ + readOnly?: boolean; + + /**Sets the step value for increment the seconds value through arrow keys or mouse scroll. + * @Default {1} + */ + secondsInterval?: number; + + /**shows or hides the drop down button in TimePicker. + * @Default {true} + */ + showPopupButton?: boolean; + + /**TimePicker is displayed with rounded corner when this property is set to true. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Defines the time format displayed in the TimePicker. + * @Default {h:mm tt} + */ + timeFormat?: string; + + /**Sets a specified time value on the TimePicker. + * @Default {null} + */ + value?: string|Date; + + /**Defines the width of the TimePicker textbox. + */ + width?: string|number; + + /**Fires when the time value changed in the TimePicker.*/ + beforeChange? (e: BeforeChangeEventArgs): void; + + /**Fires when the TimePicker popup before opened.*/ + beforeOpen? (e: BeforeOpenEventArgs): void; + + /**Fires when the time value changed in the TimePicker.*/ + change? (e: ChangeEventArgs): void; + + /**Fires when the TimePicker popup closed.*/ + close? (e: CloseEventArgs): void; + + /**Fires when create TimePicker successfully.*/ + create? (e: CreateEventArgs): void; + + /**Fires when the TimePicker is destroyed successfully.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires when the TimePicker control gets focus.*/ + focusIn? (e: FocusInEventArgs): void; + + /**Fires when the TimePicker control get lost focus.*/ + focusOut? (e: FocusOutEventArgs): void; + + /**Fires when the TimePicker popup opened.*/ + open? (e: OpenEventArgs): void; + + /**Fires when the value is selected from the TimePicker dropdown list.*/ + select? (e: SelectEventArgs): void; +} + +export interface BeforeChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.TimePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the previously selected time value + */ + prevTime?: string; + + /**returns the modified time value + */ + value?: string; +} + +export interface BeforeOpenEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.TimePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the previously selected time value + */ + prevTime?: string; + + /**returns the time value + */ + value?: string; +} + +export interface ChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.TimePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns true when the value changed by user interaction otherwise returns false + */ + isInteraction?: boolean; + + /**returns the previously selected time value + */ + prevTime?: string; + + /**returns the modified time value + */ + value?: string; +} + +export interface CloseEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.TimePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the previously selected time value + */ + prevTime?: string; + + /**returns the time value + */ + value?: string; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.TimePicker.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.TimePicker.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface FocusInEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.TimePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the previously selected time value + */ + prevTime?: string; + + /**returns the current time value + */ + value?: string; +} + +export interface FocusOutEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.TimePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the previously selected time value + */ + prevTime?: string; + + /**returns the current time value + */ + value?: string; +} + +export interface OpenEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.TimePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the time value + */ + value?: string; +} + +export interface SelectEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.TimePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the previously selected time value + */ + prevTime?: string; + + /**returns the selected time value + */ + value?: string; +} +} + +class ToggleButton extends ej.Widget { + static fn: ToggleButton; + constructor(element: JQuery, options?: ToggleButton.Model); + constructor(element: Element, options?: ToggleButton.Model); + model:ToggleButton.Model; + defaults:ToggleButton.Model; + + /** Allows you to destroy the ToggleButton widget. + * @returns {void} + */ + destroy(): void; + + /** To disable the ToggleButton to prevent all user interactions. + * @returns {void} + */ + disable(): void; + + /** To enable the ToggleButton. + * @returns {void} + */ + enable(): void; +} +export module ToggleButton{ + +export interface Model { + + /**Specify the icon in active state to the toggle button and it will be aligned from left margin of the button. + */ + activePrefixIcon?: string; + + /**Specify the icon in active state to the toggle button and it will be aligned from right margin of the button. + */ + activeSuffixIcon?: string; + + /**Sets the text when ToggleButton is in active state i.e.,checked state. + * @Default {null} + */ + activeText?: string; + + /**Specifies the contentType of the ToggleButton. See ContentType as below + * @Default {ej.ContentType.TextOnly} + */ + contentType?: ej.ContentType|string; + + /**Specify the CSS class to the ToggleButton to achieve custom theme. + */ + cssClass?: string; + + /**Specify the icon in default state to the toggle button and it will be aligned from left margin of the button. + */ + defaultPrefixIcon?: string; + + /**Specify the icon in default state to the toggle button and it will be aligned from right margin of the button. + */ + defaultSuffixIcon?: string; + + /**Specifies the text of the ToggleButton, when the control is a default state. i.e., unChecked state. + * @Default {null} + */ + defaultText?: string; + + /**Specifies the state of the ToggleButton. + * @Default {true} + */ + enabled?: boolean; + + /**Save current model value to browser cookies for maintaining states. When refreshing the ToggleButton control page, the model value is applied from browser cookies or HTML 5local storage. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Specify the Right to Left direction of the ToggleButton. + * @Default {false} + */ + enableRTL?: boolean; + + /**Specifies the height of the ToggleButton. + * @Default {28pixel} + */ + height?: number|string; + + /**It allows to define the characteristics of the ToggleButton control. It will helps to extend the capability of an HTML element. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Specifies the image position of the ToggleButton. + * @Default {ej.ImagePosition.ImageLeft} + */ + imagePosition?: ej.ImagePosition|string; + + /**Allows to prevents the control switched to checked (active) state. + * @Default {false} + */ + preventToggle?: boolean; + + /**Displays the ToggleButton with rounded corners. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Specifies the size of the ToggleButton. See ButtonSize as below + * @Default {ej.ButtonSize.Normal} + */ + size?: ej.ButtonSize|string; + + /**It allows to define the ToggleButton state to checked(Active) or unchecked(Default) at initial time. + * @Default {false} + */ + toggleState?: boolean; + + /**Specifies the type of the ToggleButton. See ButtonType as below + * @Default {ej.ButtonType.Button} + */ + type?: ej.ButtonType|string; + + /**Specifies the width of the ToggleButton. + * @Default {100pixel} + */ + width?: number|string; + + /**Fires when ToggleButton control state is changed successfully.*/ + change? (e: ChangeEventArgs): void; + + /**Fires when ToggleButton control is clicked successfully.*/ + click? (e: ClickEventArgs): void; + + /**Fires when ToggleButton control is created successfully.*/ + create? (e: CreateEventArgs): void; + + /**Fires when ToggleButton control is destroyed successfully.*/ + destroy? (e: DestroyEventArgs): void; +} + +export interface ChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**return the toggle button checked state + */ + isChecked?: boolean; + + /**returns the toggle button model + */ + model?: ej.ToggleButton.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface ClickEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**return the toggle button checked state + */ + isChecked?: boolean; + + /**returns the toggle button model + */ + model?: ej.ToggleButton.Model; + + /**return the toggle button state + */ + status?: boolean; + + /**returns the name of the event + */ + type?: string; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the toggle button model + */ + model?: ej.ToggleButton.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the toggle button model + */ + model?: ej.ToggleButton.Model; + + /**returns the name of the event + */ + type?: string; +} +} + +class Toolbar extends ej.Widget { + static fn: Toolbar; + constructor(element: JQuery, options?: Toolbar.Model); + constructor(element: Element, options?: Toolbar.Model); + model:Toolbar.Model; + defaults:Toolbar.Model; + + /** Deselect the specified Toolbar item. + * @param {any} The element need to be deselected + * @returns {void} + */ + deselectItem(element: any): void; + + /** Deselect the Toolbar item based on specified id. + * @param {string} The ID of the element need to be deselected + * @returns {void} + */ + deselectItemByID(ID: string): void; + + /** Allows you to destroy the Toolbar widget. + * @returns {void} + */ + destroy(): void; + + /** To disable all items in the Toolbar control. + * @returns {void} + */ + disable(): void; + + /** Disable the specified Toolbar item. + * @param {any} The element need to be disabled + * @returns {void} + */ + disableItem(element: any): void; + + /** Disable the Toolbar item based on specified item id in the Toolbar. + * @param {string} The ID of the element need to be disabled + * @returns {void} + */ + disableItemByID(ID: string): void; + + /** Enable the Toolbar if it is in disabled state. + * @returns {void} + */ + enable(): void; + + /** Enable the Toolbar item based on specified item. + * @param {any} The element need to be enabled + * @returns {void} + */ + enableItem(element: any): void; + + /** Enable the Toolbar item based on specified item id in the Toolbar. + * @param {string} The ID of the element need to be enabled + * @returns {void} + */ + enableItemByID(ID: string): void; + + /** To hide the Toolbar + * @returns {void} + */ + hide(): void; + + /** Remove the item from toolbar, based on specified item. + * @param {any} The element need to be removed + * @returns {void} + */ + removeItem(element: any): void; + + /** Remove the item from toolbar, based on specified item id in the Toolbar. + * @param {string} The ID of the element need to be removed + * @returns {void} + */ + removeItemByID(ID: string): void; + + /** Selects the item from toolbar, based on specified item. + * @param {any} The element need to be selected + * @returns {void} + */ + selectItem(element: any): void; + + /** Selects the item from toolbar, based on specified item id in the Toolbar. + * @param {string} The ID of the element need to be selected + * @returns {void} + */ + selectItemByID(ID: string): void; + + /** To show the Toolbar. + * @returns {void} + */ + show(): void; +} +export module Toolbar{ + +export interface Model { + + /**Sets the root CSS class for Toolbar control to achieve the custom theme. + */ + cssClass?: string; + + /**Specifies dataSource value for the Toolbar control during initialization. + * @Default {null} + */ + dataSource?: any; + + /**Specifies the Toolbar control state. + * @Default {true} + */ + enabled?: boolean; + + /**Specifies enableRTL property to align the Toolbar control from right to left direction. + * @Default {false} + */ + enableRTL?: boolean; + + /**Allows to separate the each UL items in the Toolbar control. + * @Default {false} + */ + enableSeparator?: boolean; + + /**Specifies the mapping fields for the data items of the Toolbar + * @Default {null} + */ + fields?: string; + + /**Specifies the height of the Toolbar. + * @Default {28} + */ + height?: number|string; + + /**Specifies whether the Toolbar control is need to be show or hide. + * @Default {false} + */ + hide?: boolean; + + /**Enables/Disables the responsive support for Toolbar items during the window resizing time. + * @Default {false} + */ + isResponsive?: boolean; + + /**Specifies the Toolbar orientation. See orientation + * @Default {Horizontal} + */ + orientation?: ej.Orientation|string; + + /**Specifies the query to retrieve the data from the online server. The query is used only when the online dataSource is used. + * @Default {null} + */ + query?: any; + + /**Displays the Toolbar with rounded corners. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Specifies the width of the Toolbar. + */ + width?: number|string; + + /**Fires after Toolbar control is clicked.*/ + click? (e: ClickEventArgs): void; + + /**Fires after Toolbar control is created.*/ + create? (e: CreateEventArgs): void; + + /**Fires when the Toolbar is destroyed successfully.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires after Toolbar control item is hovered.*/ + itemHover? (e: ItemHoverEventArgs): void; + + /**Fires after mouse leave from Toolbar control item.*/ + itemLeave? (e: ItemLeaveEventArgs): void; +} + +export interface ClickEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Toolbar model + */ + model?: ej.Toolbar.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the target of the current object. + */ + target?: any; + + /**returns the target of the current object. + */ + currentTarget?: any; + + /**return the Toolbar state + */ + status?: boolean; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Toolbar model + */ + model?: ej.Toolbar.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Toolbar model + */ + model?: ej.Toolbar.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface ItemHoverEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Toolbar model + */ + model?: ej.Toolbar.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the target of the current object. + */ + target?: any; + + /**returns the target of the current object. + */ + currentTarget?: any; + + /**return the Toolbar state + */ + status?: boolean; +} + +export interface ItemLeaveEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Toolbar model + */ + model?: ej.Toolbar.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the target of the current object. + */ + target?: any; + + /**returns the target of the current object. + */ + currentTarget?: any; + + /**return the Toolbar state + */ + status?: boolean; +} + +export interface Fields { + + /**Defines the group name for the item. + */ + group?: string; + + /**Defines the html attributes such as id, class, styles for the item to extend the capability. + */ + htmlAttributes?: any; + + /**Defines id for the tag. + */ + id?: string; + + /**Defines the image attributes such as height, width, styles and so on. + */ + imageAttributes?: string; + + /**Defines the imageURL for the image location. + */ + imageUrl?: string; + + /**Defines the sprite CSS for the image tag. + */ + spriteCssClass?: string; + + /**Defines the text content for the tag. + */ + text?: string; + + /**Defines the tooltip text for the tag. + */ + tooltipText?: string; +} +} + +class TreeView extends ej.Widget { + static fn: TreeView; + constructor(element: JQuery, options?: TreeView.Model); + constructor(element: Element, options?: TreeView.Model); + model:TreeView.Model; + defaults:TreeView.Model; + + /** To add a Node or collection of nodes in TreeView. If target tree node is specified, then the given nodes are added as child of target tree node, otherwise nodes are added in TreeView. + * @param {string|any} New node text or JSON object + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + addNode(newNodeText: string|any, target: string|any): void; + + /** To add a collection of nodes in TreeView. If target tree node is specified, then the given nodes are added as child of target tree node, otherwise nodes are added in TreeView. + * @param {any|Array} New node details in JSON object + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + addNodes(collection: any|Array, target : string|any): void; + + /** To check all the nodes in TreeView. + * @returns {void} + */ + checkAll(): void; + + /** To check a node in TreeView. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + checkNode( element : string|any): void; + + /** To collapse all the TreeView nodes. + * @returns {void} + */ + collapseAll(): void; + + /** To collapse a particular node in TreeView. + * @param {string|any} ID of TreeView node|object of TreeView node + * @returns {void} + */ + collapseNode( element : string|any): void; + + /** To disable the node in the TreeView. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + disableNode( element : string|any): void; + + /** To enable the node in the TreeView. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + enableNode( element : string|any): void; + + /** To ensure that the TreeView node is visible in the TreeView. This method is useful if we need select a TreeView node dynamically. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {boolean} + */ + ensureVisible( element : string|any): boolean; + + /** To expand all the TreeView nodes. + * @returns {void} + */ + expandAll(): void; + + /** To expandNode particular node in TreeView. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + expandNode( element : string|any): void; + + /** To get currently checked nodes in TreeView. + * @returns {any} + */ + getCheckedNodes(): any; + + /** To get currently checked nodes indexes in TreeView. + * @returns {Array} + */ + getCheckedNodesIndex(): Array; + + /** To get number of nodes in TreeView. + * @returns {number} + */ + getNodeCount(): number; + + /** To get currently expanded nodes in TreeView. + * @returns {any} + */ + getExpandedNodes(): any; + + /** To get currently expanded nodes indexes in TreeView. + * @returns {Array} + */ + getExpandedNodesIndex(): Array; + + /** To get TreeView node by using index position in TreeView. + * @param {number} Index position of TreeView node + * @returns {any} + */ + getNodeByIndex( index : number): any; + + /** To get TreeView node data such as id, text, parentId, selected, checked, expanded, level, childs and index. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {any} + */ + getNode(element: string|any): any; + + /** To get current index position of TreeView node. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {number} + */ + getNodeIndex(element : string|any): number; + + /** To get immediate parent TreeView node of particular TreeView node. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {any} + */ + getParent(element : string|any): any; + + /** To get the currently selected node in TreeView. + * @returns {any} + */ + getSelectedNode(): any; + + /** To get the index position of currently selected node in TreeView. + * @returns {number} + */ + getSelectedNodeIndex(): number; + + /** To get the text of a node in TreeView. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {string} + */ + getText( element : string|any): string; + + /** To get the updated datasource of TreeView after performing some operation like drag and drop, node editing, adding and removing node. + * @returns {Array} + */ + getTreeData(): Array; + + /** To get currently visible nodes in TreeView. + * @returns {any} + */ + getVisibleNodes(): any; + + /** To check a node having child or not. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {boolean} + */ + hasChildNode( element : string|any): boolean; + + /** To show nodes in TreeView. + * @returns {void} + */ + hide(): void; + + /** To hide particular node in TreeView. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + hideNode( element : string|any): void; + + /** To add a Node or collection of nodes after the particular TreeView node. + * @param {string|any} New node text or JSON object + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + insertAfter( newNodeText : string|any, target : string|any): void; + + /** To add a Node or collection of nodes before the particular TreeView node. + * @param {string|any} New node text or JSON object + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + insertBefore( newNodeText : string|any, target : string|any): void; + + /** To check the given TreeView node is checked or unchecked. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {boolean} + */ + isNodeChecked( element : string|any): boolean; + + /** To check whether the child nodes are loaded of the given TreeView node. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {boolean} + */ + isChildLoaded( element : string|any): boolean; + + /** To check the given TreeView node is disabled or enabled. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {boolean} + */ + isDisabled( element : string|any): boolean; + + /** To check the given node is exist in TreeView. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {boolean} + */ + isExist( element : string|any): boolean; + + /** To get the expand status of the given TreeView node. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {boolean} + */ + isExpanded( element : string|any): boolean; + + /** To get the select status of the given TreeView node. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {boolean} + */ + isSelected( element : string|any): boolean; + + /** To get the visibility status of the given TreeView node. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {boolean} + */ + isVisible( element : string|any): boolean; + + /** To load the TreeView nodes from the particular URL. If target tree node is specified, then the given nodes are added as child of target tree node, otherwise nodes are added in TreeView. + * @param {string} URL location, the data returned from the URL will be loaded in TreeView + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + loadData( URL : string, target : string|any): void; + + /** To move the TreeView node with in same TreeView. The new poistion of given TreeView node will be based on destionation node and index position. + * @param {string|any} ID of TreeView node/object of TreeView node + * @param {string|any} ID of TreeView node/object of TreeView node + * @param {number} New index position of given source node + * @returns {void} + */ + moveNode( sourceNode : string|any, destinationNode : string|any, index : number): void; + + /** To refresh the TreeView + * @returns {void} + */ + refresh(): void; + + /** To remove all the nodes in TreeView. + * @returns {void} + */ + removeAll(): void; + + /** To remove a node in TreeView. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + removeNode( element : string|any): void; + + /** To select a node in TreeView. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + selectNode( element : string|any): void; + + /** To show nodes in TreeView. + * @returns {void} + */ + show(): void; + + /** To show a node in TreeView. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + showNode( element : string|any): void; + + /** To uncheck all the nodes in TreeView. + * @returns {void} + */ + unCheckAll(): void; + + /** To uncheck a node in TreeView. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + uncheckNode( element : string|any): void; + + /** To unselect the node in the TreeView. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + unselectNode( element : string|any): void; + + /** To edit or update the text of the TreeView node. + * @param {string|any} ID of TreeView node/object of TreeView node + * @param {string} New text + * @returns {void} + */ + updateText( target : string|any, newText : string): void; +} +export module TreeView{ + +export interface Model { + + /**Gets or sets a value that indicates whether to enable drag and drop a node within the same tree. + * @Default {false} + */ + allowDragAndDrop?: boolean; + + /**Gets or sets a value that indicates whether to enable drag and drop a node in inter ej.TreeView. + * @Default {true} + */ + allowDragAndDropAcrossControl?: boolean; + + /**Gets or sets a value that indicates whether to drop a node to a sibling of particular node. + * @Default {true} + */ + allowDropSibling?: boolean; + + /**Gets or sets a value that indicates whether to drop a node to a child of particular node. + * @Default {true} + */ + allowDropChild?: boolean; + + /**Gets or sets a value that indicates whether to enable node editing support for TreeView. + * @Default {false} + */ + allowEditing?: boolean; + + /**Gets or sets a value that indicates whether to enable keyboard support for TreeView actions like nodeSelection, nodeEditing, nodeExpand, nodeCollapse, nodeCut and Paste. + * @Default {true} + */ + allowKeyboardNavigation?: boolean; + + /**Allow us to specify the parent and child nodes to get auto check while we check or uncheck a node. + * @Default {true} + */ + autoCheck?: boolean; + + /**Allow us to specify the parent node to be retain in checked or unchecked state instead of going for indeterminate state. + * @Default {false} + */ + autoCheckParentNode?: boolean; + + /**Gets or sets a value that indicates the checkedNodes index collection as an array. The given array index position denotes the nodes, that are checked while rendering TreeView. + * @Default {[]} + */ + checkedNodes?: Array; + + /**Sets the root CSS class for TreeView which allow us to customize the appearance. + */ + cssClass?: string; + + /**Gets or sets a value that indicates whether to enable or disable the animation effect while expanding or collapsing a node. + * @Default {true} + */ + enableAnimation?: boolean; + + /**Gets or sets a value that indicates whether a TreeView can be enabled or disabled. No actions can be performed while this property is set as false + * @Default {true} + */ + enabled?: boolean; + + /**Allow us to prevent multiple nodes to be in expanded state. If it set to false, previously expanded node will be collapsed automatically, while we expand a node. + * @Default {true} + */ + enableMultipleExpand?: boolean; + + /**Sets a value that indicates whether to persist the TreeView model state in page using applicable medium i.e., HTML5 localStorage or cookies + * @Default {false} + */ + enablePersistence?: boolean; + + /**Gets or sets a value that indicates to align content in the TreeView control from right to left by setting the property as true. + * @Default {false} + */ + enableRTL?: boolean; + + /**Gets or sets a array of value that indicates the expandedNodes index collection as an array. The given array index position denotes the nodes, that are expanded while rendering TreeView. + * @Default {[]} + */ + expandedNodes?: Array; + + /**Gets or sets a value that indicates the TreeView node can be expand or collapse by using the specified action. + * @Default {dblclick} + */ + expandOn?: string; + + /**Gets or sets a fields object that allow us to map the data members with field properties in order to make the data binding easier. + * @Default {null} + */ + fields?: Fields; + + /**Defines the height of the TreeView. + * @Default {Null} + */ + height?: string|number; + + /**Specifies the HTML Attributes for the TreeView. Using this API we can add custom attributes in TreeView control. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Specifies the child nodes to be loaded on demand + * @Default {false} + */ + loadOnDemand?: boolean; + + /**Gets or Sets a value that indicates the index position of a tree node. The particular index tree node will be selected while rendering the TreeView. + * @Default {-1} + */ + selectedNode?: number; + + /**Gets or sets a value that indicates whether to display or hide checkbox for all TreeView nodes. + * @Default {false} + */ + showCheckbox?: boolean; + + /**By using sortSettings property, you can customize the sorting option in TreeView control. + */ + sortSettings?: SortSettings; + + /**Allow us to use custom template in order to create TreeView. + * @Default {null} + */ + template?: string; + + /**Defines the width of the TreeView. + * @Default {Null} + */ + width?: string|number; + + /**Fires before adding node to TreeView.*/ + beforeAdd? (e: BeforeAddEventArgs): void; + + /**Fires before collapse a node.*/ + beforeCollapse? (e: BeforeCollapseEventArgs): void; + + /**Fires before cut node in TreeView.*/ + beforeCut? (e: BeforeCutEventArgs): void; + + /**Fires before deleting node in TreeView.*/ + beforeDelete? (e: BeforeDeleteEventArgs): void; + + /**Fires before editing the node in TreeView.*/ + beforeEdit? (e: BeforeEditEventArgs): void; + + /**Fires before expanding the node.*/ + beforeExpand? (e: BeforeExpandEventArgs): void; + + /**Fires before loading nodes to TreeView.*/ + beforeLoad? (e: BeforeLoadEventArgs): void; + + /**Fires before paste node in TreeView.*/ + beforePaste? (e: BeforePasteEventArgs): void; + + /**Fires before selecting node in TreeView.*/ + beforeSelect? (e: BeforeSelectEventArgs): void; + + /**Fires when TreeView created successfully.*/ + create? (e: CreateEventArgs): void; + + /**Fires when TreeView destroyed successfully.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires before nodeEdit Successful.*/ + inlineEditValidation? (e: InlineEditValidationEventArgs): void; + + /**Fires when key pressed successfully.*/ + keyPress? (e: KeyPressEventArgs): void; + + /**Fires when data load fails.*/ + loadError? (e: LoadErrorEventArgs): void; + + /**Fires when data loaded successfully.*/ + loadSuccess? (e: LoadSuccessEventArgs): void; + + /**Fires once node added successfully.*/ + nodeAdd? (e: NodeAddEventArgs): void; + + /**Fires once node checked successfully.*/ + nodeCheck? (e: NodeCheckEventArgs): void; + + /**Fires when node clicked successfully.*/ + nodeClick? (e: NodeClickEventArgs): void; + + /**Fires when node collapsed successfully.*/ + nodeCollapse? (e: NodeCollapseEventArgs): void; + + /**Fires when node cut successfully.*/ + nodeCut? (e: NodeCutEventArgs): void; + + /**Fires when node deleted successfully.*/ + nodeDelete? (e: NodeDeleteEventArgs): void; + + /**Fires when node dragging.*/ + nodeDrag? (e: NodeDragEventArgs): void; + + /**Fires once node drag start successfully.*/ + nodeDragStart? (e: NodeDragStartEventArgs): void; + + /**Fires before the dragged node to be dropped.*/ + nodeDragStop? (e: NodeDragStopEventArgs): void; + + /**Fires once node dropped successfully.*/ + nodeDropped? (e: NodeDroppedEventArgs): void; + + /**Fires once node edited successfully.*/ + nodeEdit? (e: NodeEditEventArgs): void; + + /**Fires once node expanded successfully.*/ + nodeExpand? (e: NodeExpandEventArgs): void; + + /**Fires once node pasted successfully.*/ + nodePaste? (e: NodePasteEventArgs): void; + + /**Fires when node selected successfully.*/ + nodeSelect? (e: NodeSelectEventArgs): void; + + /**Fires once node unchecked successfully.*/ + nodeUncheck? (e: NodeUncheckEventArgs): void; +} + +export interface BeforeAddEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the given new node data + */ + data ?: string|any; + + /**returns the parent element, the given new nodes to be appended to the given parent element + */ + targetParent ?: any; + + /**returns the given parent node details + */ + parentDetails ?: any; +} + +export interface BeforeCollapseEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the value of the node + */ + value ?: string; + + /**returns the current element of the node clicked + */ + currentElement ?: any; + + /**returns the child nodes are loaded or not + */ + isChildLoaded ?: boolean; + + /**returns the id of currently clicked node + */ + id ?: string; + + /**returns the parent id of currently clicked node + */ + parentId ?: string; + + /**returns the format asynchronous or synchronous + */ + async ?: boolean; +} + +export interface BeforeCutEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the event object + */ + event ?: any; + + /**returns the target element, the given node to be cut + */ + target ?: any; + + /**returns the given target node values + */ + nodeDetails ?: any; + + /**returns the keypressed keycode value + */ + keyCode ?: number; +} + +export interface BeforeDeleteEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the event object + */ + event ?: any; + + /**returns the target element, the given node to be deleted + */ + target ?: any; + + /**returns the given target node values + */ + nodeDetails ?: any; + + /**returns the current parent element of the target node + */ + parentElement ?: any; + + /**returns the parent node values + */ + parentDetails ?: any; +} + +export interface BeforeEditEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the current element of the node clicked + */ + currentElement ?: any; +} + +export interface BeforeExpandEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the value of the node + */ + value ?: string; + + /**if the child node is ready to expanded state; otherwise, false. + */ + isChildLoaded ?: boolean; + + /**returns the current element of the node clicked + */ + currentElement ?: any; + + /**returns the id of currently clicked node + */ + id ?: string; + + /**returns the parent id of currently clicked node + */ + parentId ?: string; + + /**returns the format asynchronous or synchronous + */ + async ?: boolean; +} + +export interface BeforeLoadEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the AJAX settings object + */ + ajaxOptions ?: any; +} + +export interface BeforePasteEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the event object + */ + event ?: any; + + /**returns the target element, the given node to be pasted + */ + target ?: any; + + /**returns the given target node values + */ + nodeDetails ?: any; + + /**returns the keypressed keycode value + */ + keyCode ?: number; +} + +export interface BeforeSelectEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the target element, the given node to be selected + */ + target ?: any; + + /**returns the given target node values + */ + nodeDetails ?: any; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; +} + +export interface InlineEditValidationEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the new entered text for the node + */ + newText ?: string; + + /**returns the current node element id + */ + id ?: any; + + /**returns the old node text + */ + oldText ?: string; +} + +export interface KeyPressEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the event object + */ + event ?: any; + + /**returns the current element of the node clicked + */ + currentElement ?: any; + + /**returns the value of the node + */ + value ?: string; + + /**returns node path from root element + */ + path ?: string; + + /**returns the keypressed keycode value + */ + keyCode ?: number; + + /**it returns when the current node is in expanded state; otherwise, false. + */ + isExpanded ?: boolean; +} + +export interface LoadErrorEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the AJAX error object + */ + error ?: any; +} + +export interface LoadSuccessEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the success data from the URL + */ + data ?: any; + + /**returns the target parent element, the data returned from the URL to be appended to the given parent element, else in TreeView + */ + targetParent ?: any; + + /**returns the given parent node details + */ + parentDetails ?: any; +} + +export interface NodeAddEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the added data, that are given initially + */ + data ?: any; + + /**returns the newly added elements + */ + nodes ?: any; + + /**returns the target parent element of the added element + */ + parentElement ?: any; + + /**returns the given parent node details + */ + parentDetails ?: any; +} + +export interface NodeCheckEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the event object + */ + event ?: any; + + /**returns the value of the node + */ + value ?: string; + + /**returns the id of the current element of the node clicked + */ + id ?: string; + + /**returns the id of the parent element of current element of the node clicked + */ + parentId ?: string; + + /**returns the current element of the node clicked + */ + currentElement ?: any; + + /**it returns true when the node checkbox is checked; otherwise, false. + */ + isChecked ?: boolean; + + /**it returns the currently checked node name + */ + currentNode ?: Array; + + /**it returns the currently checked and its child node details + */ + currentCheckedNodes ?: Array; +} + +export interface NodeClickEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the event object + */ + event ?: any; + + /**returns the current element of the node clicked + */ + currentElement ?: any; + + /**returns the id of current element + */ + id ?: string; + + /**returns the parentId of current element + */ + parentId ?: string; +} + +export interface NodeCollapseEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the id of the current element of the node clicked + */ + id ?: string; + + /**returns the name of the event + */ + type ?: string; + + /**returns the id of the parent element of current element of the node clicked + */ + parentId ?: string; + + /**returns the value of the node + */ + value ?: string; + + /**returns the current element of the node clicked + */ + currentElement ?: any; + + /**returns the child nodes are loaded or not + */ + isChildLoaded ?: boolean; + + /**returns the format asynchronous or synchronous + */ + async ?: boolean; +} + +export interface NodeCutEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the event object + */ + event ?: any; + + /**returns the current parent element of the cut node + */ + parentElement ?: any; + + /**returns the given parent node details + */ + parentDetails ?: any; + + /**returns the keypressed keycode value + */ + keyCode ?: number; +} + +export interface NodeDeleteEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the event object + */ + event ?: any; + + /**returns the current parent element of the deleted node + */ + parentElement ?: any; + + /**returns the given parent node details + */ + parentDetails ?: any; +} + +export interface NodeDragEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the original drag target + */ + dragTarget ?: any; + + /**returns the current target TreeView node + */ + target ?: any; + + /**returns the current target details + */ + targetElementData ?: any; + + /**returns the current parent element of the target node + */ + draggedElement ?: any; + + /**returns the given parent node details + */ + draggedElementData ?: any; + + /**returns the event object + */ + event ?: any; +} + +export interface NodeDragStartEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the original drag target + */ + dragTarget ?: any; + + /**returns the current dragging parent TreeView node + */ + parentElement ?: any; + + /**returns the current dragging parent TreeView node details + */ + parentElementData ?: any; + + /**returns the current parent element of the dragging node + */ + target ?: any; + + /**returns the given parent node details + */ + targetElementData ?: any; + + /**returns the event object + */ + event ?: any; +} + +export interface NodeDragStopEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the original drop target + */ + dropTarget ?: any; + + /**returns the current dragged TreeView node + */ + draggedElement ?: any; + + /**returns the current dragged TreeView node details + */ + draggedElementData ?: any; + + /**returns the current parent element of the dragged node + */ + target ?: any; + + /**returns the given parent node details + */ + targetElementData ?: any; + + /**returns the drop position such as before, after or over + */ + position ?: string; + + /**returns the event object + */ + event ?: any; +} + +export interface NodeDroppedEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the original drop target + */ + dropTarget ?: any; + + /**returns the current dropped TreeView node + */ + droppedElement ?: any; + + /**returns the current dropped TreeView node details + */ + droppedElementData ?: any; + + /**returns the current parent element of the dropped node + */ + target ?: any; + + /**returns the given parent node details + */ + targetElementData ?: any; + + /**returns the drop position such as before, after or over + */ + position ?: string; + + /**returns the event object + */ + event ?: any; +} + +export interface NodeEditEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the id of the element + */ + id ?: string; + + /**returns the oldText of the element + */ + oldText ?: string; + + /**returns the newText of the element + */ + newText ?: string; + + /**returns the event object + */ + event ?: any; + + /**returns the target element, the given node to be cut + */ + target ?: any; + + /**returns the given target node values + */ + nodeDetails ?: any; +} + +export interface NodeExpandEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the value of the node + */ + value ?: string; + + /**if the child node is ready to expanded state; otherwise, false. + */ + isChildLoaded ?: boolean; + + /**returns the current element of the node clicked + */ + currentElement ?: any; + + /**returns the id of currently clicked node + */ + id ?: string; + + /**returns the parent id of currently clicked node + */ + parentId ?: string; + + /**returns the format asynchronous or synchronous + */ + async ?: boolean; +} + +export interface NodePasteEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the event object + */ + event ?: any; + + /**returns the pasted element + */ + target ?: any; + + /**returns the given target node values + */ + nodeDetails ?: any; + + /**returns the keypressed keycode value + */ + keyCode ?: number; +} + +export interface NodeSelectEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the id of the current element of the node clicked + */ + id ?: any; + + /**returns the id of the parent element of current element of the node clicked + */ + parentId ?: any; + + /**returns the value of the node + */ + value ?: string; + + /**returns the current element of the node clicked + */ + currentElement ?: any; +} + +export interface NodeUncheckEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the event object + */ + event ?: any; + + /**returns the id of the current element of the node clicked + */ + id ?: any; + + /**returns the id of the parent element of current element of the node clicked + */ + parentId ?: any; + + /**returns the value of the node + */ + value ?: string; + + /**returns the current element of the node clicked + */ + currentElement ?: any; + + /**it returns true when the node checkbox is checked; otherwise, false. + */ + isChecked ?: boolean; + + /**it returns currently unchecked node name + */ + currentNode ?: string; + + /**it returns currently unchecked node and its child node details. + */ + currentUncheckedNodes ?: Array; +} + +export interface Fields { + + /**It receives the child level or inner level data source such as Essential DataManager object and JSON object. + */ + child?: any; + + /**It receives Essential DataManager object and JSON object. + */ + dataSource?: any; + + /**Specifies the node to be in expanded state. + */ + expanded?: boolean; + + /**Its allow us to indicate whether the node has child or not in load on demand + */ + hasChild?: boolean; + + /**Specifies the html attributes to “li” item list. + */ + htmlAttribute?: any; + + /**Specifies the id to TreeView node items list. + */ + id?: string; + + /**Specifies the image attribute to “img” tag inside items list + */ + imageAttribute?: any; + + /**Specifies the html attributes to “li” item list. + */ + imageUrl?: string; + + /**If its true Checkbox node will be checked when rendered with checkbox. + */ + isChecked?: boolean; + + /**Specifies the link attribute to “a” tag in item list. + */ + linkAttribute?: any; + + /**Specifies the parent id of the node. The nodes are listed as child nodes of the specified parent node by using its parent id. + */ + parentId?: string; + + /**It receives query to retrieve data from the table (query is same as SQL). + */ + query?: any; + + /**Allow us to specify the node to be in selected state + */ + selected?: boolean; + + /**Specifies the sprite CSS class to “li” item list. + */ + spriteCssClass?: string; + + /**It receives the table name to execute query on the corresponding table. + */ + tableName?: string; + + /**Specifies the text of TreeView node items list. + */ + text?: string; +} + +export interface SortSettings { + + /**Enables or disables the sorting option in TreeView control + * @Default {false} + */ + allowSorting?: boolean; + + /**Sets the sorting order type. There are two sorting types available, such as "ascending", "descending". + * @Default {ej.sortOrder.Ascending} + */ + sortOrder?: ej.sortOrder|string; +} +} +enum sortOrder +{ +//Enum for Ascending sort order +Ascending, +//Enum for Descending sort order +Descending, +} + +class Uploadbox extends ej.Widget { + static fn: Uploadbox; + constructor(element: JQuery, options?: Uploadbox.Model); + constructor(element: Element, options?: Uploadbox.Model); + model:Uploadbox.Model; + defaults:Uploadbox.Model; + + /** The destroy method destroys the control and brings the control to a pre-init state. All the events of the Upload control is bound by using this._on unbinds automatically. + * @returns {void} + */ + destroy(): void; + + /** Disables the Uploadbox control + * @returns {void} + */ + disable(): void; + + /** Enables the Uploadbox control + * @returns {void} + */ + enable(): void; +} +export module Uploadbox{ + +export interface Model { + + /**Enables the file drag and drop support to the Uploadbox control. + * @Default {false} + */ + allowDragAndDrop?: boolean; + + /**Uploadbox supports both synchronous and asynchronous upload. This can be achieved by using the asyncUpload property. + * @Default {true} + */ + asyncUpload?: boolean; + + /**Uploadbox supports auto uploading of files after the file selection is done. + * @Default {false} + */ + autoUpload?: boolean; + + /**Sets the text for each action button. + * @Default {{browse: Browse, upload: Upload, cancel: Cancel, close: Close}} + */ + buttonText?: ButtonText; + + /**Sets the root class for the Uploadbox control theme. This cssClass API helps to use custom skinning option for the Uploadbox button and dialog content. + */ + cssClass?: string; + + /**Specifies the custom file details in the dialog popup on initialization. + * @Default {{ title:true, name:true, size:true, status:true, action:true}} + */ + customFileDetails?: CustomFileDetails; + + /**Specifies the actions for dialog popup while initialization. + * @Default {{ modal:false, closeOnComplete:false, content:null, drag:true}} + */ + dialogAction?: DialogAction; + + /**Displays the Uploadbox dialog at the given X and Y positions. X: Dialog sets the left position value. Y: Dialog sets the top position value. + * @Default {null} + */ + dialogPosition?: any; + + /**Property for applying the text to the Dialog title and content headers. + * @Default {{ title: Upload Box, name: Name, size: Size, status: Status}} + */ + dialogText?: DialogText; + + /**The dropAreaText is displayed when the draganddrop support is enabled in the Uploadbox control. + * @Default {Drop files or click to upload} + */ + dropAreaText?: string; + + /**Specifies the dropAreaHeight when the draganddrop support is enabled in the Uploadbox control. + * @Default {100%} + */ + dropAreaHeight?: number|string; + + /**Specifies the dropAreaWidth when the draganddrop support is enabled in the Uploadbox control. + * @Default {100%} + */ + dropAreaWidth?: number|string; + + /**Based on the property value, Uploadbox is enabled or disabled. + * @Default {true} + */ + enabled?: boolean; + + /**Sets the right-to-left direction property for the Uploadbox control. + * @Default {false} + */ + enableRTL?: boolean; + + /**Only the files with the specified extension is allowed to upload. This is mentioned in the string format. + */ + extensionsAllow?: string; + + /**Only the files with the specified extension is denied for upload. This is mentioned in the string format. + */ + extensionsDeny?: string; + + /**Sets the maximum size limit for uploading the file. This is mentioned in the number format. + * @Default {31457280} + */ + fileSize?: number; + + /**Sets the height of the browse button. + * @Default {35px} + */ + height?: string; + + /**Configures the culture data and sets the culture to the Uploadbox. + * @Default {en-US} + */ + locale?: string; + + /**Enables multiple file selection for upload. + * @Default {true} + */ + multipleFilesSelection?: boolean; + + /**You can push the file to the Uploadbox in the client-side of the XHR supported browsers alone. + * @Default {null} + */ + pushFile?: any; + + /**Specifies the remove action to be performed after the file uploading is completed. Here, mention the server address for removal. + */ + removeUrl?: string; + + /**Specifies the save action to be performed after the file is pushed for uploading. Here, mention the server address to be saved. + */ + saveUrl?: string; + + /**Enables the browse button support to the Uploadbox control. + * @Default {true} + */ + showBrowseButton?: boolean; + + /**Specifies the file details to be displayed when selected for uploading. This can be done when the showFileDetails is set to true. + * @Default {true} + */ + showFileDetails?: boolean; + + /**Sets the name for the Uploadbox control. This API helps to Map the action in code behind to retrieve the files. + */ + uploadName?: string; + + /**Sets the width of the browse button. + * @Default {100px} + */ + width?: string; + + /**Fires when the upload progress begins.*/ + begin? (e: BeginEventArgs): void; + + /**Fires when the upload progress is cancelled.*/ + cancel? (e: CancelEventArgs): void; + + /**Fires when the file upload progress is completed.*/ + complete? (e: CompleteEventArgs): void; + + /**Fires when the file upload progress is completed.*/ + success? (e: SuccessEventArgs): void; + + /**Fires when the Uploadbox control is created.*/ + create? (e: CreateEventArgs): void; + + /**Fires when the Uploadbox control is destroyed.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires when the Upload process ends in Error.*/ + error? (e: ErrorEventArgs): void; + + /**Fires when the file is selected for upload successfully.*/ + fileSelect? (e: FileSelectEventArgs): void; + + /**Fires when the uploaded file is removed successfully.*/ + remove? (e: RemoveEventArgs): void; +} + +export interface BeginEventArgs { + + /**To pass additional information to the server. + */ + data?: any; + + /**Selected FileList Object. + */ + files?: any; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Uploadbox model + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface CancelEventArgs { + + /**Canceled FileList Object. + */ + fileStatus?: any; + + /**returns the Uploadbox model + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface CompleteEventArgs { + + /**AJAX event argument for reference. + */ + e?: any; + + /**Uploaded file list. + */ + files?: any; + + /**response from the server. + */ + responseText?: string; + + /**XHR-AJAX Object for reference. + */ + xhr?: any; + + /**returns the Uploadbox model + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface SuccessEventArgs { + + /**response from the server. + */ + responseText?: string; + + /**AJAX event argument for reference. + */ + e?: any; + + /**successfully uploaded files list. + */ + success?: any; + + /**Uploaded file list. + */ + files?: any; + + /**XHR-AJAX Object for reference. + */ + xhr?: any; + + /**returns the Uploadbox model + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface CreateEventArgs { + + /**returns the Uploadbox model + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**returns the Uploadbox model + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface ErrorEventArgs { + + /**details about the error information. + */ + error?: string; + + /**returns the name of the event. + */ + type?: string; + + /**error event action details. + */ + action?: string; + + /**returns the file details of the file uploaded + */ + files?: any; +} + +export interface FileSelectEventArgs { + + /**returns Selected FileList objects + */ + files?: any; + + /**returns the Uploadbox model + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RemoveEventArgs { + + /**returns the Uploadbox model + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns the file details of the file object + */ + fileStatus?: any; +} + +export interface ButtonText { + + /**Sets the text for the browse button. + */ + browse?: string; + + /**Sets the text for the cancel button. + */ + cancel?: string; + + /**Sets the text for the close button. + */ + Close?: string; + + /**Sets the text for the Upload button inside the dialog popup. + */ + upload?: string; +} + +export interface CustomFileDetails { + + /**Enables the file upload interactions like remove/cancel in File details of the dialog popup. + */ + action?: boolean; + + /**Enables the name in the File details of the dialog popup. + */ + name?: boolean; + + /**Enables or disables the File size details of the dialog popup. + */ + size?: boolean; + + /**Enables or disables the file uploading status visibility in the dialog file details content. + */ + status?: boolean; + + /**Enables the title in File details for the dialog popup. + */ + title?: boolean; +} + +export interface DialogAction { + + /**Once uploaded successfully, the dialog popup closes immediately. + */ + closeOnComplete?: boolean; + + /**Sets the content container option to the Uploadbox dialog popup. + */ + content?: string; + + /**Enables the drag option to the dialog popup. + */ + drag?: boolean; + + /**Enables or disables the Uploadbox dialog’s modal property to the dialog popup. + */ + modal?: boolean; +} + +export interface DialogText { + + /**Sets the uploaded file’s Name (header text) to the Dialog popup. + */ + name?: string; + + /**Sets the upload file Size (header text) to the dialog popup. + */ + size?: string; + + /**Sets the upload file Status (header text) to the dialog popup. + */ + status?: string; + + /**Sets the title text of the dialog popup. + */ + title?: string; +} +} + +class WaitingPopup extends ej.Widget { + static fn: WaitingPopup; + constructor(element: JQuery, options?: WaitingPopup.Model); + constructor(element: Element, options?: WaitingPopup.Model); + model:WaitingPopup.Model; + defaults:WaitingPopup.Model; + + /** To hide the waiting popup + * @returns {void} + */ + hide(): void; + + /** Refreshes the WaitingPopup control by resetting the pop-up panel position and content position + * @returns {void} + */ + refresh(): void; + + /** To show the waiting popup + * @returns {void} + */ + show(): void; +} +export module WaitingPopup{ + +export interface Model { + + /**Sets the root class for the WaitingPopup control theme + * @Default {null} + */ + cssClass?: string; + + /**Enables or disables the default loading icon. + * @Default {true} + */ + showImage?: boolean; + + /**Enables the visibility of the WaitingPopup control + * @Default {false} + */ + showOnInit?: boolean; + + /**Loads HTML content inside the popup panel instead of the default icon + * @Default {null} + */ + template?: any; + + /**Sets the custom text in the pop-up panel to notify the waiting process + * @Default {null} + */ + text?: string; + + /**Fires after Create WaitingPopup successfully*/ + create? (e: CreateEventArgs): void; + + /**Fires after Destroy WaitingPopup successfully*/ + destroy? (e: DestroyEventArgs): void; +} + +export interface CreateEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the WaitingPopup model + */ + model?: ej.WaitingPopup.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the WaitingPopup model + */ + model?: ej.WaitingPopup.Model; + + /**returns the name of the event + */ + type?: string; +} +} + +class Grid extends ej.Widget { + static fn: Grid; + constructor(element: JQuery, options?: Grid.Model); + constructor(element: Element, options?: Grid.Model); + model:Grid.Model; + defaults:Grid.Model; + + /** Adds a grid model property which is to be ignored upon exporting. + * @returns {void} + */ + addIgnoreOnExport(): void; + + /** Add a new record in grid control when allowAdding is set as true. + * @returns {void} + */ + addRecord(): void; + + /** Cancel the modified changes in grid control when edit mode is "batch". + * @returns {void} + */ + batchCancel(): void; + + /** Save the modified changes to data source in grid control when edit mode is "batch". + * @returns {void} + */ + batchSave(): void; + + /** Send a cancel request in grid. + * @returns {void} + */ + cancelEdit(): void; + + /** Send a cancel request to the edited cell in grid. + * @returns {void} + */ + cancelEditCell(): void; + + /** It is used to clear all the cell selection. + * @returns {boolean} + */ + clearCellSelection(): boolean; + + /** It is used to clear all the row selection or at specific row selection based on the index provided. + * @param {number} optional If index of the column is specified then it will remove the selection from the particular column else it will clears all of the column selection + * @returns {boolean} + */ + clearColumnSelection(index: number): boolean; + + /** It is used to clear all the filtering done. + * @param {string} If field of the column is specified then it will clear the particular filtering column + * @returns {void} + */ + clearFiltering(field: string): void; + + /** Clear the searching from the grid + * @returns {void} + */ + clearSearching(): void; + + /** Clear all the row selection or at specific row selection based on the index provided + * @param {number} optional If index of the row is specified then it will remove the selection from the particular row else it will clears all of the row selection + * @returns {boolean} + */ + clearSelection(index: number): boolean; + + /** Clear the sorting from columns in the grid + * @returns {void} + */ + clearSorting(): void; + + /** Collapse all the group caption rows in grid + * @returns {void} + */ + collapseAll(): void; + + /** Collapse the group drop area in grid + * @returns {void} + */ + collapseGroupDropArea(): void; + + /** Add or remove columns in grid column collections + * @param {Array|string} Pass array of columns or string of field name to add/remove the column in grid + * @param {string} optional Pass add/remove action to be performed. By default "add" action will perform + * @returns {void} + */ + columns(columnDetails: Array|string, action: string): void; + + /** Refresh the grid with new data source + * @param {Array} Pass new data source to the grid + * @returns {void} + */ + dataSource(datasource: Array): void; + + /** Delete a record in grid control when allowDeleting is set as true + * @param {string} Pass the primary key field Name of the column + * @param {Array} Pass the json data of record need to be delete. + * @returns {void} + */ + deleteRecord(fieldName: string, data: Array): void; + + /** Destroy the grid widget all events bound using this._on will be unbind automatically and bring the control to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** Edit a particular cell based on the row index and field name provided in "batch" edit mode. + * @param {number} Pass row index to edit particular cell + * @param {string} Pass the field name of the column to perform batch edit + * @returns {void} + */ + editCell(index: number, fieldName: string): void; + + /** Send a save request in grid. + * @returns {void} + */ + endEdit(): void; + + /** Expand all the group caption rows in grid. + * @returns {void} + */ + expandAll(): void; + + /** Expand or collapse the row based on the row state in grid + * @param {JQuery} Pass the target object to expand/collapse the row based on its row state + * @returns {HTMLElement} + */ + expandCollapse($target: JQuery): HTMLElement; + + /** Expand the group drop area in grid. + * @returns {void} + */ + expandGroupDropArea(): void; + + /** Export the grid content to excel, word or pdf document. + * @param {string} Pass the controller action name corresponding to exporting + * @param {string} optionalASP server event name corresponding to exporting + * @param {boolean} optionalPass the multiple exporting value as true/false + * @param {Array} optionalPass the array of the gridIds to be filtered + * @returns {void} + */ + export(action: string, serverEvent: string, multipleExport: boolean, gridIds: Array): void; + + /** Send a filtering request to filter one column in grid. + * @param {string} Pass the field name of the column + * @param {string} string/integer/dateTime operator + * @param {string|number} Pass the value to be filtered in a column + * @param {string} Pass the predicate as and/or + * @param {boolean} optional Pass the match case value as true/false + * @returns {void} + */ + filterColumn(fieldName: string, filterOperator: string, filterValue: string|number, predicate: string, matchcase: boolean): void; + + /** Send a filtering request to filter single or multiple column in grid. + * @param {Array} Pass array of filterColumn query for performing filter operation + * @returns {void} + */ + filterColumn(filterQueries: Array): void; + + /** Get the batch changes of edit, delete and add operations of grid. + * @returns {any} + */ + getBatchChanges(): any; + + /** Get the browser details + * @returns {any} + */ + getBrowserDetails(): any; + + /** Get the column details based on the given field in grid + * @param {string} Pass the field name of the column to get the corresponding column object + * @returns {any} + */ + getColumnByField(fieldName: string): any; + + /** Get the column details based on the given header text in grid. + * @param {string} Pass the header text of the column to get the corresponding column object + * @returns {any} + */ + getColumnByHeaderText(headerText: string): any; + + /** Get the column details based on the given column index in grid + * @param {number} Pass the index of the column to get the corresponding column object + * @returns {any} + */ + getColumnByIndex(columnIndex: number): any; + + /** Get the list of field names from column collection in grid. + * @returns {Array} + */ + getColumnFieldNames(): Array; + + /** Get the column index of the given field in grid. + * @param {string} Pass the field name of the column to get the corresponding column index + * @returns {number} + */ + getColumnIndexByField(fieldName: string): number; + + /** Get the content div element of grid. + * @returns {HTMLElement} + */ + getContent(): HTMLElement; + + /** Get the content table element of grid + * @returns {HTMLElement} + */ + getContentTable(): HTMLElement; + + /** Get the data of currently edited cell value in "batch" edit mode + * @returns {any} + */ + getCurrentEditCellData(): any; + + /** Get the current page index in grid pager. + * @returns {number} + */ + getCurrentIndex(): number; + + /** Get the current page data source of grid. + * @returns {Array} + */ + getCurrentViewData(): Array; + + /** Get the column field name from the given header text in grid. + * @param {string} Pass header text of the column to get its corresponding field name + * @returns {string} + */ + getFieldNameByHeaderText(headerText: string): string; + + /** Get the filter bar of grid + * @returns {HTMLElement} + */ + getFilterBar(): HTMLElement; + + /** Get the records filtered or searched in Grid + * @returns {Array} + */ + getFilteredRecords(): Array; + + /** Get the footer content of grid. + * @returns {HTMLElement} + */ + getFooterContent(): HTMLElement; + + /** Get the footer table element of grid. + * @returns {HTMLElement} + */ + getFooterTable(): HTMLElement; + + /** Get the header content div element of grid. + * @returns {HTMLElement} + */ + getHeaderContent(): HTMLElement; + + /** Get the header table element of grid + * @returns {HTMLElement} + */ + getHeaderTable(): HTMLElement; + + /** Get the column header text from the given field name in grid. + * @param {string} Pass field name of the column to get its corresponding header text + * @returns {string} + */ + getHeaderTextByFieldName(field: string): string; + + /** Get the names of all the hidden column collections in grid. + * @returns {Array} + */ + getHiddenColumnNames(): Array; + + /** Get the row index based on the given tr element in grid. + * @param {JQuery} Pass the tr element in grid content to get its row index + * @returns {number} + */ + getIndexByRow($tr: JQuery): number; + + /** Get the pager of grid. + * @returns {HTMLElement} + */ + getPager(): HTMLElement; + + /** Get the names of primary key columns in Grid + * @returns {Array} + */ + getPrimaryKeyFieldNames(): Array; + + /** Get the rows(tr element) from the given from and to row index in grid + * @param {number} Pass the from index from which the rows to be returned + * @param {number} Pass the to index to which the rows to be returned + * @returns {HTMLElement} + */ + getRowByIndex(from: number, to: number): HTMLElement; + + /** Get the row height of grid. + * @returns {number} + */ + getRowHeight(): number; + + /** Get the rows(tr element)of grid which is displayed in the current page. + * @returns {HTMLElement} + */ + getRows(): HTMLElement; + + /** Get the scroller object of grid. + * @returns {any} + */ + getScrollObject(): any; + + /** Get the selected records details in grid. + * @returns {void} + */ + getSelectedRecords(): void; + + /** Get the names of all the visible column collections in grid + * @returns {Array} + */ + getVisibleColumnNames(): Array; + + /** Send a paging request to specified page in grid + * @param {number} Pass the page index to perform paging at specified page index + * @returns {void} + */ + gotoPage(pageIndex: number): void; + + /** Send a column grouping request in grid. + * @param {string} Pass the field Name of the column to be grouped in grid control + * @returns {void} + */ + groupColumn(fieldName: string): void; + + /** Hide columns from the grid based on the header text + * @param {Array|string} you can pass either array of header text of various columns or a header text of a column to hide + * @returns {void} + */ + hideColumns(headerText: Array|string): void; + + /** Print the grid control + * @returns {void} + */ + print(): void; + + /** It is used to refresh and reset the changes made in "batch" edit mode + * @returns {void} + */ + refreshBatchEditChanges(): void; + + /** Refresh the grid contents. The template refreshment is based on the argument passed along with this method + * @param {boolean} optional When templateRefresh is set true, template and grid contents both are refreshed in grid else only grid content is refreshed + * @returns {void} + */ + refreshContent(templateRefresh: boolean): void; + + /** Refresh the template of the grid + * @returns {void} + */ + refreshTemplate(): void; + + /** Refresh the toolbar items in grid. + * @returns {void} + */ + refreshToolbar(): void; + + /** Remove a column or collection of columns from a sorted column collections in grid. + * @param {Array|string} Pass array of field names of the columns to remove a collection of sorted columns or pass a string of field name to remove a column from sorted column collections + * @returns {void} + */ + removeSortedColumns(fieldName: Array|string): void; + + /** Creates a grid control + * @returns {void} + */ + render(): void; + + /** Re-order the column in grid + * @param {string} Pass the from field name of the column needs to be changed + * @param {string} Pass the to field name of the column needs to be changed + * @returns {void} + */ + reorderColumns(fromFieldName: string, toFieldName: string): void; + + /** Reset the model collections like pageSettings, groupSettings, filterSettings, sortSettings and summaryRows. + * @returns {void} + */ + resetModelCollections(): void; + + /** Resize the columns by giving column name and width for the corresponding one. + * @param {string} Pass the column name that needs to be changed + * @param {string} Pass the width to resize the particular columns + * @returns {void} + */ + resizeColumns(column: string, width: string): void; + + /** Resolves row height issue when unbound column is used with FrozenColumn + * @returns {void} + */ + rowHeightRefresh(): void; + + /** Save the particular edited cell in grid. + * @returns {boolean} + */ + saveCell(): boolean; + + /** Set dimension for grid with corresponding to grid parent. + * @returns {void} + */ + setDimension(): void; + + /** Send a request to grid to refresh the width set to columns + * @returns {void} + */ + setWidthToColumns(): void; + + /** Send a search request to grid with specified string passed in it + * @param {string} Pass the string to search in Grid records + * @returns {void} + */ + search(searchString: string): void; + + /** Select cells in grid. + * @param {any} It is used to set the starting index of row and indexes of cells for that corresponding row for selecting cells. + * @returns {void} + */ + selectCells(rowCellIndexes: any): void; + + /** Select columns in grid. + * @param {number} It is used to set the starting index of column for selecting columns. + * @returns {void} + */ + selectColumns(fromIndex: number): void; + + /** Select rows in grid. + * @param {number} It is used to set the starting index of row for selecting rows. + * @param {number} It is used to set the ending index of row for selecting rows. + * @returns {void} + */ + selectRows(fromIndex: number, toIndex: number): void; + + /** Select rows in grid. + * @param {Array} Pass array of rowIndexes for selecting rows + * @returns {void} + */ + selectRows(rowIndexes: Array): void; + + /** Used to update a particular cell value.Note: It will work only for Local Data. + * @returns {void} + */ + setCellText(): void; + + /** Used to update a particular cell value based on specified row Index and the fieldName. + * @param {number} It is used to set the index for selecting the row. + * @param {string} It is used to set the field name for selecting column. + * @param {any} It is used to set the value for the selected cell. + * @returns {void} + */ + setCellValue(Index: number, fieldName: string, value: any): void; + + /** Set validation to a field during editing. + * @param {string} Specify the field name of the column to set validation rules + * @param {any} Specify the validation rules for the field + * @returns {void} + */ + setValidationToField(fieldName: string, rules: any): void; + + /** Show columns in the grid based on the header text + * @param {Array|string} you can pass either array of header text of various columns or a header text of a column to show + * @returns {void} + */ + showColumns(headerText: Array|string): void; + + /** Send a sorting request in grid. + * @param {string} Pass the field name of the column as columnName for which sorting have to be performed + * @param {string} optional Pass the sort direction ascending/descending by which the column have to be sort. By default it is sorting in an ascending order + * @returns {void} + */ + sortColumn(columnName: string, sortingDirection: string): void; + + /** Send an edit record request in grid + * @param {JQuery} Pass the tr- selected row element to be edited in grid + * @returns {HTMLElement} + */ + startEdit($tr: JQuery): HTMLElement; + + /** Un-group a column from grouped columns collection in grid + * @param {string} Pass the field Name of the column to be ungrouped from grouped column collection + * @returns {void} + */ + ungroupColumn(fieldName: string): void; + + /** Update a edited record in grid control when allowEditing is set as true. + * @param {string} Pass the primary key field Name of the column + * @param {Array} Pass the edited json data of record need to be update. + * @returns {void} + */ + updateRecord(fieldName: string, data: Array): void; + + /** It adapts grid to its parent element or to the browsers window. + * @returns {void} + */ + windowonresize(): void; +} +export module Grid{ + +export interface Model { + + /**Gets or sets a value that indicates whether to customizing cell based on our needs. + * @Default {false} + */ + allowCellMerging?: boolean; + + /**Gets or sets a value that indicates whether to enable dynamic grouping behavior. Grouping can be done by drag on drop desired columns to grid’s GroupDropArea. This can be further customized through “groupSettings” property. + * @Default {false} + */ + allowGrouping?: boolean; + + /**Gets or sets a value that indicates whether to enable keyboard support for performing grid actions. selectionType – Gets or sets a value that indicates whether to enable single row or multiple rows selection behavior in grid. Multiple selection can be done through by holding CTRL and clicking the grid rows + * @Default {true} + */ + allowKeyboardNavigation?: boolean; + + /**Gets or sets a value that indicates whether to enable dynamic filtering behavior on grid. Filtering can be used to limit the records displayed using required criteria and this can be further customized through “filterSettings” property + * @Default {false} + */ + allowFiltering?: boolean; + + /**Gets or sets a value that indicates whether to enable the dynamic sorting behavior on grid data. Sorting can be done through clicking on particular column header. + * @Default {false} + */ + allowSorting?: boolean; + + /**Gets or sets a value that indicates whether to enable multi columns sorting behavior in grid. Sort multiple columns by holding CTRL and click on the corresponding column header. + * @Default {false} + */ + allowMultiSorting?: boolean; + + /**This specifies the grid to show the paginated data. Also enables pager control at the bottom of grid for dynamic navigation through data source. Paging can be further customized through “pageSettings” property. + * @Default {false} + */ + allowPaging?: boolean; + + /**Gets or sets a value that indicates whether to enable the columns reordering behavior in the grid. Reordering can be done through by drag and drop the particular column from one index to another index within the grid. + * @Default {false} + */ + allowReordering?: boolean; + + /**Gets or sets a value that indicates whether the column is non resizable. Column width is set automatically based on the content or header text which is large. + * @Default {false} + */ + allowResizeToFit?: boolean; + + /**Gets or sets a value that indicates whether to enable dynamic resizable of columns. Resize the width of the columns by simply click and move the particular column header line + * @Default {false} + */ + allowResizing?: boolean; + + /**Gets or sets a value that indicates whether to enable the scrollbar in the grid and view the records by scroll through the grid manually + * @Default {false} + */ + allowScrolling?: boolean; + + /**Gets or sets a value that indicates whether to enable dynamic searching behavior in grid. Currently search box can be enabled through “toolbarSettings” + * @Default {false} + */ + allowSearching?: boolean; + + /**Gets or sets a value that indicates whether user can select rows on grid. On enabling feature, selected row will be highlighted. + * @Default {true} + */ + allowSelection?: boolean; + + /**Gets or sets a value that indicates whether the Content will wrap to the next line if the content exceeds the boundary of the Column Cells. + * @Default {false} + */ + allowTextWrap?: boolean; + + /**Gets or sets a value that indicates whether to enable the multiple exporting behavior on grid data. + * @Default {false} + */ + allowMultipleExporting?: boolean; + + /**Gets or sets a value that indicates to define common width for all the columns in the grid. + */ + commonWidth?: number; + + /**Gets or sets a value that indicates to enable the visibility of the grid lines. + * @Default {ej.Grid.GridLines.Both} + */ + gridLines?: ej.Grid.GridLines|string; + + /**This specifies the grid to add the grid control inside the grid row of the parent with expand/collapse options + * @Default {null} + */ + childGrid?: any; + + /**Used to enable or disable static width settings for column. If the columnLayout is set as fixed, then column width will be static. + * @Default {ej.Grid.ColumnLayout.Auto} + */ + columnLayout?: ej.Grid.ColumnLayout|string; + + /**Gets or sets an object that indicates to render the grid with specified columns + * @Default {[]} + */ + columns?: Array; + + /**Gets or sets an object that indicates whether to customize the context menu behavior of the grid. + */ + contextMenuSettings?: ContextMenuSettings; + + /**Gets or sets a value that indicates to render the grid with custom theme. allowScrolling – Gets or sets a value that indicates whether to enable the scrollbar in the grid and view the records by scroll through the grid manually + */ + cssClass?: string; + + /**Gets or sets the data to render the grid with records + * @Default {null} + */ + dataSource?: any; + + /**Default Value: + * @Default {null} + */ + detailsTemplate?: string; + + /**Gets or sets an object that indicates whether to customize the editing behavior of the grid. + */ + editSettings?: EditSettings; + + /**Gets or sets a value that indicates whether to enable the alternative rows differentiation in the grid records based on corresponding theme. + * @Default {true} + */ + enableAltRow?: boolean; + + /**Gets or sets a value that indicates whether to enable the save action in the grid through row selection + * @Default {true} + */ + enableAutoSaveOnSelectionChange?: boolean; + + /**Gets or sets a value that indicates whether to enable mouse over effect on the corresponding column header cell of the grid + * @Default {false} + */ + enableHeaderHover?: boolean; + + /**Gets or sets a value that indicates whether to persist the grid model state in page using applicable medium i.e., HTML5 localStorage or cookies + * @Default {false} + */ + enablePersistence?: boolean; + + /**Gets or sets a value that indicates whether the grid rows has to be rendered as detail view in mobile mode + * @Default {false} + */ + enableResponsiveRow?: boolean; + + /**Gets or sets a value that indicates whether to enable mouse over effect on corresponding grid row. + * @Default {true} + */ + enableRowHover?: boolean; + + /**Align content in the grid control from right to left by setting the property as true. + * @Default {false} + */ + enableRTL?: boolean; + + /**To Disable the mouse swipe property as false. + * @Default {true} + */ + enableTouch?: boolean; + + /**Gets or sets an object that indicates whether to customize the filtering behavior of the grid + */ + filterSettings?: FilterSettings; + + /**Gets or sets an object that indicates whether to customize the grouping behavior of the grid. + */ + groupSettings?: GroupSettings; + + /**Gets or sets an object that indicates whether to auto wrap the grid header or content or both + */ + textWrapSettings?: TextWrapSettings; + + /**Gets or sets a value that indicates whether the grid design has be to made responsive. + * @Default {false} + */ + isResponsive?: boolean; + + /**This specifies to change the key in keyboard interaction to grid control + * @Default {null} + */ + keySettings?: any; + + /**Gets or sets a value that indicates whether to customizing the user interface (UI) as locale-specific in order to display regional data i.e. in a language and culture specific to a particular country or region. + * @Default {en-US} + */ + locale?: string; + + /**Gets or sets a value that indicates whether to set the minimum width of the responsive grid while isResponsive property is true and enableResponsiveRow property is set as false. + * @Default {0} + */ + minWidth?: number; + + /**Gets or sets an object that indicates whether to modify the pager default configuration. + */ + pageSettings?: PageSettings; + + /**Query the dataSource from the table for Grid. + * @Default {null} + */ + query?: any; + + /**Gets or sets a value that indicates to render the grid with template rows. The template row must be a table row. That table row must have the JavaScript render binding format ({{:columnName}}) then the grid data source binds the data to the corresponding table row of the template. + * @Default {null} + */ + rowTemplate?: string; + + /**Gets or sets an object that indicates whether to customize the scrolling behavior of the grid. + */ + scrollSettings?: ScrollSettings; + + /**Gets or sets an object that indicates whether to customize the searching behavior of the grid + */ + searchSettings?: SearchSettings; + + /**Gets a value that indicates whether the grid model to hold multiple selected records . selectedRecords can be used to displayed hold the single or multiple selected records using “selectedRecords” property + * @Default {null} + */ + selectedRecords?: Array; + + /**Gets or sets a value that indicates to select the row while initializing the grid + * @Default {-1} + */ + selectedRowIndex?: number; + + /**This property is used to configure the selection behavior of the grid. + */ + selectionSettings?: SelectionSettings; + + /**The row selection behavior of grid. Accepting types are "single" and "multiple". + * @Default {ej.Grid.SelectionType.Single} + */ + selectionType?: ej.Grid.SelectionType|string; + + /**This specifies to add new editable row dynamically at the either top or bottom of the grid. + * @Default {false} + */ + showAddNewRow?: boolean; + + /**Default Value: + * @Default {false} + */ + showColumnChooser?: boolean; + + /**Default Value: + * @Default {true} + */ + showInColumnChooser?: boolean; + + /**Gets or sets a value that indicates stacked header should be shown on grid layout when the property “stackedHeaderRows” is set. + * @Default {false} + */ + showStackedHeader?: boolean; + + /**Gets or sets a value that indicates summary rows should be shown on grid layout when the property “summaryRows” is set + * @Default {false} + */ + showSummary?: boolean; + + /**Gets or sets a value that indicates whether to customize the sorting behavior of the grid. + */ + sortSettings?: SortSettings; + + /**Gets or sets an object that indicates to managing the collection of stacked header rows for the grid. + * @Default {[]} + */ + stackedHeaderRows?: Array; + + /**Gets or sets an object that indicates to managing the collection of summary rows for the grid. + * @Default {[]} + */ + summaryRows?: Array; + + /**Gets or sets an object that indicates whether to enable the toolbar in the grid and add toolbar items + */ + toolbarSettings?: ToolbarSettings; + + /**Triggered for every grid action before its starts.*/ + actionBegin? (e: ActionBeginEventArgs): void; + + /**Triggered for every grid action success event.*/ + actionComplete? (e: ActionCompleteEventArgs): void; + + /**Triggered for every grid action server failure event.*/ + actionFailure? (e: ActionFailureEventArgs): void; + + /**Triggered when record batch add.*/ + batchAdd? (e: BatchAddEventArgs): void; + + /**Triggered when record batch delete.*/ + batchDelete? (e: BatchDeleteEventArgs): void; + + /**Triggered before the batch add.*/ + beforeBatchAdd? (e: BeforeBatchAddEventArgs): void; + + /**Triggered before the batch delete.*/ + beforeBatchDelete? (e: BeforeBatchDeleteEventArgs): void; + + /**Triggered before the batch save.*/ + beforeBatchSave? (e: BeforeBatchSaveEventArgs): void; + + /**Triggered before the record is going to be edited.*/ + beginEdit? (e: BeginEditEventArgs): void; + + /**Triggered when record cell edit.*/ + cellEdit? (e: CellEditEventArgs): void; + + /**Triggered when record cell save.*/ + cellSave? (e: CellSaveEventArgs): void; + + /**Triggered after the cell is selected.*/ + cellSelected? (e: CellSelectedEventArgs): void; + + /**Triggered before the cell is going to be selected.*/ + cellSelecting? (e: CellSelectingEventArgs): void; + + /**Triggered when the column is being dragged.*/ + columnDrag? (e: ColumnDragEventArgs): void; + + /**Triggered when column dragging begins.*/ + columnDragStart? (e: ColumnDragStartEventArgs): void; + + /**Triggered when the column is dropped.*/ + columnDrop? (e: ColumnDropEventArgs): void; + + /**Triggered after the column is selected.*/ + columnSelected? (e: ColumnSelectedEventArgs): void; + + /**Triggered before the column is going to be selected.*/ + columnSelecting? (e: ColumnSelectingEventArgs): void; + + /**Triggered when context menu item is clicked*/ + contextClick? (e: ContextClickEventArgs): void; + + /**Triggered before the context menu is opened.*/ + contextOpen? (e: ContextOpenEventArgs): void; + + /**Triggered when the grid is rendered completely.*/ + create? (e: CreateEventArgs): void; + + /**Triggered when the grid is bound with data during initial rendering.*/ + dataBound? (e: DataBoundEventArgs): void; + + /**Triggered when grid going to destroy.*/ + destroy? (e: DestroyEventArgs): void; + + /**Triggered when detail template row is clicked to collapse.*/ + detailsCollapse? (e: DetailsCollapseEventArgs): void; + + /**Triggered detail template row is initialized.*/ + detailsDataBound? (e: DetailsDataBoundEventArgs): void; + + /**Triggered when detail template row is clicked to expand.*/ + detailsExpand? (e: DetailsExpandEventArgs): void; + + /**Triggered after the record is added.*/ + endAdd? (e: EndAddEventArgs): void; + + /**Triggered after the record is deleted.*/ + endDelete? (e: EndDeleteEventArgs): void; + + /**Triggered after the record is edited.*/ + endEdit? (e: EndEditEventArgs): void; + + /**Triggered initial load.*/ + load? (e: LoadEventArgs): void; + + /**Triggered every time a request is made to access particular cell information, element and data.*/ + mergeCellInfo? (e: MergeCellInfoEventArgs): void; + + /**Triggered every time a request is made to access particular cell information, element and data.*/ + queryCellInfo? (e: QueryCellInfoEventArgs): void; + + /**Triggered when record is clicked.*/ + recordClick? (e: RecordClickEventArgs): void; + + /**Triggered when record is double clicked.*/ + recordDoubleClick? (e: RecordDoubleClickEventArgs): void; + + /**Triggered after column resized.*/ + resized? (e: ResizedEventArgs): void; + + /**Triggered when column resize end.*/ + resizeEnd? (e: ResizeEndEventArgs): void; + + /**Triggered when column resize start.*/ + resizeStart? (e: ResizeStartEventArgs): void; + + /**Triggered when right clicked on grid element.*/ + rightClick? (e: RightClickEventArgs): void; + + /**Triggered every time a request is made to access row information, element and data.*/ + rowDataBound? (e: RowDataBoundEventArgs): void; + + /**Triggered after the row is selected.*/ + rowSelected? (e: RowSelectedEventArgs): void; + + /**Triggered before the row is going to be selected.*/ + rowSelecting? (e: RowSelectingEventArgs): void; + + /**Triggered when refresh the template column elements in the Grid.*/ + templateRefresh? (e: TemplateRefreshEventArgs): void; + + /**Triggered when toolbar item is clicked in grid.*/ + toolBarClick? (e: ToolBarClickEventArgs): void; +} + +export interface ActionBeginEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the current selected page number. + */ + currentPage?: number; + + /**Returns the previous selected page number. + */ + previousPage?: number; + + /**Returns the end row index of that current page. + */ + endIndex?: number; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the start row index of that current page. + */ + startIndex?: number; + + /**Returns the current grouped column field name. + */ + columnName?: string; + + /**Returns the column sort direction. + */ + columnSortDirection?: string; + + /**Returns current edited row. + */ + row?: any; + + /**Returns the current action event type. + */ + originalEventType?: string; + + /**Returns primary key. + */ + primaryKey?: string; + + /**Returns primary key value. + */ + primaryKeyValue?: string; + + /**Returns the edited row index. + */ + rowIndex?: number; + + /**Returns the record object (JSON). + */ + data?: any; + + /**Returns the foreign key record object (JSON). + */ + foreignKeyData?: any; + + /**Returns the selected row index. + */ + selectedRow?: number; + + /**Returns selected row for delete. + */ + tr?: any; + + /**Returns current filtering column field name. + */ + currentFilteringColumn?: any; + + /**Returns filter details. + */ + filterCollection?: any; + + /**Returns type of the column like number, string and so on. + */ + columnType?: string; + + /**Returns the excel filter model. + */ + filtermodel?: any; + + /**Returns the dataSource. + */ + dataSource?: any; + + /**Returns the query manager. + */ + query?: any; + + /**Returns the customfilter option value. + */ + isCustomFilter?: boolean; +} + +export interface ActionCompleteEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the current selected page number. + */ + currentPage?: number; + + /**Returns the previous selected page number. + */ + previousPage?: number; + + /**Returns the end row index of that current page. + */ + endIndex?: number; + + /**Returns current action event type. + */ + originalEventType?: string; + + /**Returns the start row index of the current page. + */ + startIndex?: number; + + /**Returns grid element. + */ + target?: any; + + /**Returns the current sorted column field name. + */ + columnName?: string; + + /**Returns the column sort direction. + */ + columnSortDirection?: string; + + /**Returns current edited row. + */ + row?: any; + + /**Returns primary key. + */ + primaryKey?: string; + + /**Returns primary key value. + */ + primaryKeyValue?: string; + + /**Returns the edited row index. + */ + rowIndex?: number; + + /**Returns the record object (JSON). + */ + data?: any; + + /**Returns the selectedRow index. + */ + selectedRow?: number; + + /**Returns the foreign key record object (JSON). + */ + foreignKeyData?: any; + + /**Returns selected row for delete. + */ + tr?: any; + + /**Returns current filtering column field name. + */ + currentFilteringColumn?: string; + + /**Returns filter details. + */ + filterCollection?: any; + + /**Returns the dataSource. + */ + dataSource?: any; + + /**Returns the excel filter model. + */ + filtermodel?: any; + + /**Returns type of the column like number, string and so on. + */ + columnType?: string; + + /**Returns the customfilter option value. + */ + isCustomFilter?: boolean; +} + +export interface ActionFailureEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the error return by server. + */ + error?: any; + + /**Returns the current selected page number. + */ + currentPage?: number; + + /**Returns the previous selected page number. + */ + previousPage?: number; + + /**Returns the end row index of that current page. + */ + endIndex?: number; + + /**Returns current action event type. + */ + originalEventType?: string; + + /**Returns the start row index of the current page. + */ + startIndex?: number; + + /**Returns grid element. + */ + target?: any; + + /**Returns the current sorted column field name. + */ + columnName?: string; + + /**Returns the column sort direction. + */ + columnSortDirection?: string; + + /**Returns current edited row. + */ + row?: any; + + /**Returns primary key. + */ + primaryKey?: string; + + /**Returns primary key value. + */ + primaryKeyValue?: string; + + /**Returns the edited row index. + */ + rowIndex?: number; + + /**Returns the record object (JSON). + */ + data?: any; + + /**Returns the selectedRow index. + */ + selectedRow?: number; + + /**Returns the foreign key record object (JSON). + */ + foreignKeyData?: any; + + /**Returns selected row for delete. + */ + tr?: any; + + /**Returns current filtering column field name. + */ + currentFilteringColumn?: string; + + /**Returns filter details. + */ + filterCollection?: any; +} + +export interface BatchAddEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns deleted data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the column object. + */ + columnObject?: any; + + /**Returns the column index. + */ + columnIndex?: number; + + /**Returns the row element. + */ + row?: any; + + /**Returns the primaryKey. + */ + primaryKey?: any; + + /**Returns the cell object. + */ + cell?: any; +} + +export interface BatchDeleteEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns deleted data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the primary key. + */ + primaryKey?: any; + + /**Returns the row Index. + */ + rowIndex?: number; +} + +export interface BeforeBatchAddEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns deleted data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the default data object. + */ + defaultData?: any; + + /**Returns the primaryKey. + */ + primaryKey?: any; +} + +export interface BeforeBatchDeleteEventArgs { + + /**Returns the grid model. + */ + model?: any; + + /**Returns deleted data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the primaryKey. + */ + primaryKey?: any; + + /**Returns the row index. + */ + rowIndex?: number; + + /**Returns the row data. + */ + rowData?: any; + + /**Returns the row element. + */ + row?: any; +} + +export interface BeforeBatchSaveEventArgs { + + /**Returns the grid model. + */ + model?: any; + + /**Returns deleted data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the changed record object. + */ + batchChanges?: any; +} + +export interface BeginEditEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the current edited row. + */ + row?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the primary key. + */ + primaryKey?: any; + + /**Returns the primary key value. + */ + primaryKeyValue?: any; + + /**Returns the edited row index. + */ + rowIndex?: number; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface CellEditEventArgs { + + /**Returns the grid model. + */ + model?: any; + + /**Returns deleted data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the validation rules. + */ + validationRules?: any; + + /**Returns the column name. + */ + columnName?: string; + + /**Returns the cell value. + */ + value?: string; + + /**Returns the row data object. + */ + rowData?: any; + + /**Returns the previous value of the cell. + */ + previousValue?: string; + + /**Returns the column object. + */ + columnObject?: any; + + /**Returns the cell object. + */ + cell?: any; + + /**Returns isForeignKey option value. + */ + isForeignKey?: boolean; +} + +export interface CellSaveEventArgs { + + /**Returns the grid model. + */ + model?: any; + + /**Returns deleted data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the column name. + */ + columnName?: string; + + /**Returns the cell value. + */ + value?: string; + + /**Returns the row data object. + */ + rowData?: any; + + /**Returns the previous value of the cell. + */ + previousValue?: string; + + /**Returns the column object. + */ + columnObject?: any; + + /**Returns the cell object. + */ + cell?: any; + + /**Returns isForeignKey option value. + */ + isForeignKey?: boolean; +} + +export interface CellSelectedEventArgs { + + /**Returns the selected cell index value. + */ + cellIndex?: number; + + /**Returns the previous selected cell index value. + */ + previousRowCellIndex?: number; + + /**Returns the selected cell element. + */ + currentCell?: any; + + /**Returns the previous selected cell element. + */ + previousRowCell?: any; + + /**Returns current record object (JSON). + */ + data?: any; + + /**Returns the selected row cell index values. + */ + selectedRowCellIndex?: Array; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface CellSelectingEventArgs { + + /**Returns the selected cell index value. + */ + cellIndex?: number; + + /**Returns the previous selected cell index value. + */ + previousRowCellIndex?: number; + + /**Returns the selected cell element. + */ + currentCell?: any; + + /**Returns the previous selected cell element. + */ + previousRowCell?: any; + + /**Returns current record object (JSON). + */ + data?: any; + + /**Returns whether the ctrl key is pressed while selecting cell + */ + isCtrlKeyPressed?: boolean; + + /**Returns whether the shift key is pressed while selecting cell + */ + isShiftKeyPressed?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface ColumnDragEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns draggable element type. + */ + draggableType?: any; + + /**Returns the draggable column object. + */ + column?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns target elements based on mouse move position. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface ColumnDragStartEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns draggable element type. + */ + draggableType?: any; + + /**Returns the draggable column object. + */ + column?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns drag start element. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface ColumnDropEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns draggable element type. + */ + draggableType?: string; + + /**Returns the draggable column object. + */ + column?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns dropped dragged element. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface ColumnSelectedEventArgs { + + /**Returns the selected cell index value. + */ + columnIndex?: number; + + /**Returns the previous selected column index value. + */ + previousColumnIndex?: number; + + /**Returns the selected header cell element. + */ + headerCell?: any; + + /**Returns the previous selected header cell element. + */ + prevColumnHeaderCell?: any; + + /**Returns corresponding column object (JSON). + */ + column?: any; + + /**Returns the selected columns values. + */ + selectedColumnsIndex?: Array; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface ColumnSelectingEventArgs { + + /**Returns the selected column index value. + */ + columnIndex?: number; + + /**Returns the previous selected column index value. + */ + previousColumnIndex?: number; + + /**Returns the selected header cell element. + */ + headerCell?: any; + + /**Returns the previous selected header cell element. + */ + prevColumnHeaderCell?: any; + + /**Returns corresponding column object (JSON). + */ + column?: any; + + /**Returns whether the ctrl key is pressed while selecting cell + */ + isCtrlKeyPressed?: boolean; + + /**Returns whether the shift key is pressed while selecting cell + */ + isShiftKeyPressed?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface ContextClickEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the current item. + */ + currentTarget?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the status of contextmenu item which denotes its enabled state + */ + status?: boolean; + + /**Returns the target item. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface ContextOpenEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the current item. + */ + currentTarget?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the status of contextmenu item which denotes its enabled state + */ + status?: boolean; + + /**Returns the target item. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface CreateEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface DataBoundEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**Returns the grid model. + */ + model?: any; + + /**Returns deleted data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface DetailsCollapseEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns detail row element. + */ + detailsRow?: any; + + /**Returns master row of detail row record object (JSON). + */ + masterData?: any; + + /**Returns the foreign key record object (JSON). + */ + foreignKeyData?: any; + + /**Returns master row element. + */ + masterRow?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface DetailsDataBoundEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns details row element. + */ + detailsElement?: any; + + /**Returns the details row data. + */ + data?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface DetailsExpandEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns detail row element. + */ + detailsRow?: any; + + /**Returns master row of detail row record object (JSON). + */ + masterData?: any; + + /**Returns the foreign key record object (JSON). + */ + foreignKeyData?: any; + + /**Returns master row element. + */ + masterRow?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface EndAddEventArgs { + + /**Returns the grid model. + */ + model?: any; + + /**Returns added data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface EndDeleteEventArgs { + + /**Returns the grid model. + */ + model?: any; + + /**Returns deleted data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface EndEditEventArgs { + + /**Returns the grid model. + */ + model?: any; + + /**Returns modified data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface LoadEventArgs { + + /**Returns the grid model. + */ + model?: any; + + /**Returns deleted data. + */ + data?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface MergeCellInfoEventArgs { + + /**Returns grid cell. + */ + cell?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns current row record object (JSON). + */ + data?: any; + + /**Returns the text value in the cell. + */ + text?: string; + + /**Returns the column object. + */ + column?: any; + + /**Method to merge Grid rows. + */ + rowMerge?: void; + + /**Method to merge Grid columns. + */ + colMerge?: void; + + /**Method to merge Grid rows and columns. + */ + merge?: void; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface QueryCellInfoEventArgs { + + /**Returns grid cell. + */ + cell?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns current row record object (JSON). + */ + data?: any; + + /**Returns the text value in the cell. + */ + text?: string; + + /**Returns the column object. + */ + column?: any; + + /**Returns the foreign key record object (JSON). + */ + foreignKeyData?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface RecordClickEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns current record object (JSON). + */ + data?: any; + + /**Returns the row index of the selected row. + */ + rowIndex?: number; + + /**Returns the jquery object of the current selected row. + */ + row?: any; + + /**Returns the current selected cell. + */ + cell?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the cell index value. + */ + cellIndex?: number; + + /**Returns the corresponding cell value. + */ + cellValue?: string; + + /**Returns the Header text of the column corresponding to the selected cell. + */ + columnName?: string; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface RecordDoubleClickEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns current record object (JSON). + */ + data?: any; + + /**Returns the row index of the selected row. + */ + rowIndex?: number; + + /**Returns the jquery object of the current selected row. + */ + row?: any; + + /**Returns the current selected cell. + */ + cell?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the selected cell index value. + */ + cellIndex?: number; + + /**Returns the corresponding cell value. + */ + cellValue?: string; + + /**Returns the Header text of the column corresponding to the selected cell. + */ + columnName?: string; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface ResizedEventArgs { + + /**Returns the grid model. + */ + model?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns deleted data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the column index. + */ + columnIndex?: number; + + /**Returns the column object. + */ + column?: any; + + /**Returns the grid object. + */ + target?: any; + + /**Returns the old width value. + */ + oldWidth?: number; + + /**Returns the new width value. + */ + newWidth?: number; +} + +export interface ResizeEndEventArgs { + + /**Returns the grid model. + */ + model?: any; + + /**Returns deleted data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the column index. + */ + columnIndex?: number; + + /**Returns the column object. + */ + column?: any; + + /**Returns the grid object. + */ + target?: any; + + /**Returns the old width value. + */ + oldWidth?: number; + + /**Returns the new width value. + */ + newWidth?: number; + + /**Returns the extra width value. + */ + extra?: number; +} + +export interface ResizeStartEventArgs { + + /**Returns the grid model. + */ + model?: any; + + /**Returns deleted data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the column index. + */ + columnIndex?: number; + + /**Returns the column object. + */ + column?: any; + + /**Returns the grid object. + */ + target?: any; + + /**Returns the old width value. + */ + oldWidth?: number; +} + +export interface RightClickEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns current record object (JSON). + */ + currentData?: any; + + /**Returns the row index of the selected row. + */ + rowIndex?: number; + + /**Returns the current selected row. + */ + row?: any; + + /**Returns the selected row data object. + */ + data?: any; + + /**Returns the cell index of the selected cell. + */ + cellIndex?: number; + + /**Returns the cell value. + */ + cellValue?: string; + + /**Returns the cell object. + */ + cell?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface RowDataBoundEventArgs { + + /**Returns grid row. + */ + row?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns current row record object (JSON). + */ + data?: any; + + /**Returns the foreign key record object (JSON). + */ + foreignKeyData?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface RowSelectedEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns current record object (JSON). + */ + data?: any; + + /**Returns the foreign key record object (JSON). + */ + foreignKeyData?: any; + + /**Returns the row index of the selected row. + */ + rowIndex?: number; + + /**Returns the current selected row. + */ + row?: any; + + /**Returns the previous selected row element. + */ + prevRow?: any; + + /**Returns the previous selected row index. + */ + prevRowIndex?: number; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface RowSelectingEventArgs { + + /**Returns the selected row index value. + */ + rowIndex?: number; + + /**Returns the selected row element. + */ + row?: any; + + /**Returns the previous selected row element. + */ + prevRow?: any; + + /**Returns the previous selected row index. + */ + prevRowIndex?: number; + + /**Returns current record object (JSON). + */ + data?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface TemplateRefreshEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the cell object. + */ + cell?: any; + + /**Returns the column object. + */ + column?: any; + + /**Returns the current row data. + */ + data?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the current row index. + */ + rowIndex?: number; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface ToolBarClickEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the current item. + */ + currentTarget?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the status of toolbar item which denotes its enabled state + */ + status?: boolean; + + /**Returns the target item. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the grid model. + */ + gridModel?: any; + + /**Returns the toolbar object of the selected toolbar element. + */ + toolbarData?: any; +} + +export interface ColumnsCommands { + + /**Gets or sets an object that indicates to define all the button options which are available in ejButton. + */ + buttonOptions?: any; + + /**Gets or sets a value that indicates to add the command column button. See unboundType + */ + type?: ej.Grid.UnboundType|string; +} + +export interface Columns { + + /**Gets or sets a value that indicates whether to enable editing behavior for particular column. + * @Default {true} + */ + allowEditing?: boolean; + + /**Gets or sets a value that indicates whether to enable dynamic filtering behavior for particular column. + * @Default {true} + */ + allowFiltering?: boolean; + + /**Gets or sets a value that indicates whether to enable dynamic grouping behavior for particular column. + * @Default {true} + */ + allowGrouping?: boolean; + + /**Gets or sets a value that indicates whether to enable dynamic sorting behavior for particular column. + * @Default {true} + */ + allowSorting?: boolean; + + /**Gets or sets a value that indicates whether to enable dynamic resizable for particular column. + * @Default {true} + */ + allowResizing?: boolean; + + /**Used to hide the particular column in column chooser by giving value as false. + * @Default {true} + */ + showInColumnChooser?: boolean; + + /**Gets or sets an object that indicates to define a command column in the grid. + * @Default {[]} + */ + commands?: Array; + + /**Gets or sets a value that indicates to provide custom css for an individual column. + */ + cssClass?: string; + + /**Gets or sets a value that indicates the attribute values to the td element of a particular column + */ + customAttributes?: any; + + /**Gets or sets a value that indicates to bind the external datasource to the particular column when columnEditType as "dropdownedit" and also it is used to bind the datasource to the foreign key column while editing the grid. //Where data is array of JSON objects of text and value for the drop-down and array of JSON objects for foreign key column. + * @Default {null} + */ + dataSource?: Array; + + /**Gets or sets a value that indicates to display the specified default value while adding a new record to the grid + */ + defaultValue?: string|number|boolean|Date; + + /**Gets or sets a value that indicates to render the grid content and header with an html elements + * @Default {false} + */ + disableHtmlEncode?: boolean; + + /**Gets or sets a value that indicates to display a column value as checkbox or string + * @Default {true} + */ + displayAsCheckBox?: boolean; + + /**Gets or sets a value that indicates to customize ejNumericTextbox of an editable column. See editingType + */ + editParams?: any; + + /**Gets or sets a template that displays a custom editor used to edit column values. See editTemplate + * @Default {null} + */ + editTemplate?: any; + + /**Gets or sets a value that indicates to render the element(based on edit type) for editing the grid record. See editingType + * @Default {ej.Grid.EditingType.String} + */ + editType?: ej.Grid.EditingType|string; + + /**Gets or sets a value that indicates to display the columns in the grid mapping with column name of the dataSource. + */ + field?: string; + + /**Gets or sets a value that indicates to define foreign key field name of the grid datasource. + * @Default {null} + */ + foreignKeyField?: string; + + /**Gets or sets a value that indicates to bind the field which is in foreign column datasource based on the foreignKeyField + * @Default {null} + */ + foreignKeyValue?: string; + + /**Gets or sets a value that indicates the format for the text applied on the column + */ + format?: string; + + /**Gets or sets a value that indicates to add the template within the header element of the particular column. + * @Default {null} + */ + headerTemplateID?: string; + + /**Gets or sets a value that indicates to display the title of that particular column. + */ + headerText?: string; + + /**This defines the text alignment of a particular column header cell value. See headerTextAlign + * @Default {ej.TextAlign.Left} + */ + headerTextAlign?: ej.TextAlign|string; + + /**You can use this property to freeze selected columns in grid at the time of scrolling. + * @Default {false} + */ + isFrozen?: boolean; + + /**Gets or sets a value that indicates the column has an identity in the database. + * @Default {false} + */ + isIdentity?: boolean; + + /**Gets or sets a value that indicates the column is act as a primary key(read-only) of the grid. The editing is performed based on the primary key column + * @Default {false} + */ + isPrimaryKey?: boolean; + + /**Gets or sets a value that indicates whether to bind the column which are not in the datasource + * @Default {false} + */ + isUnbound?: boolean; + + /**Gets or sets a value that indicates whether to enables column template for a particular column. + * @Default {false} + */ + template?: boolean|string; + + /**Gets or sets a value that indicates to add the template as a particular column data . + * @Default {null} + */ + templateID?: string; + + /**Gets or sets a value that indicates to align the text within the column. See textAlign + * @Default {ej.TextAlign.Left} + */ + textAlign?: ej.TextAlign|string; + + /**Sets the template for Tooltip in Grid Columns(both header and content) + */ + tooltip?: string; + + /**Sets the clip mode for Grid cell as ellipsis or clipped content(both header and content) + * @Default {ej.Grid.ClipMode.Clip} + */ + clipMode?: ej.Grid.ClipMode|string; + + /**Gets or sets a value that indicates to specify the data type of the specified columns. + */ + type?: string; + + /**Gets or sets a value that indicates to define constraints for saving data to the database. + */ + validationRules?: any; + + /**Gets or sets a value that indicates whether this column is visible in the grid. + * @Default {true} + */ + visible?: boolean; + + /**Gets or sets a value that indicates to define the width for a particular column in the grid. + */ + width?: number; +} + +export interface ContextMenuSettingsSubContextMenu { + + /**Used to get or set the corresponding custom context menu item to which the submenu to be appended. + * @Default {null} + */ + contextMenuItem?: string; + + /**Used to get or set the sub menu items to the custom context menu item. + * @Default {[]} + */ + subMenu?: Array; +} + +export interface ContextMenuSettings { + + /**Gets or sets a value that indicates whether to add the default context menu actions as a context menu items If enableContextMenu is true it will show all the items related to the target, if you want selected items from contextmenu you have to mention in the contextMenuItems + * @Default {[]} + */ + contextMenuItems?: Array; + + /**Gets or sets a value that indicates whether to add custom contextMenu items within the toolbar to perform any action in the grid + * @Default {[]} + */ + customContextMenuItems?: Array; + + /**Gets or sets a value that indicates whether to enable the context menu action in the grid. + * @Default {false} + */ + enableContextMenu?: boolean; + + /**Used to get or set the subMenu to the corresponding custom context menu item. + */ + subContextMenu?: Array; + + /**Gets or sets a value that indicates whether to disable the default context menu items in the grid. + * @Default {false} + */ + disabledefaultitems?: boolean; +} + +export interface EditSettings { + + /**Gets or sets a value that indicates whether to enable insert action in the editing mode. + * @Default {false} + */ + allowAdding?: boolean; + + /**Gets or sets a value that indicates whether to enable the delete action in the editing mode. + * @Default {false} + */ + allowDeleting?: boolean; + + /**Gets or sets a value that indicates whether to enable the edit action in the editing mode. + * @Default {false} + */ + allowEditing?: boolean; + + /**Gets or sets a value that indicates whether to enable the editing action while double click on the record + * @Default {true} + */ + allowEditOnDblClick?: boolean; + + /**This specifies the id of the template. This template can be used to display the data that you require to be edited using the Dialog Box + * @Default {null} + */ + dialogEditorTemplateID?: string; + + /**Gets or sets a value that indicates whether to define the mode of editing See editMode + * @Default {ej.Grid.EditMode.Normal} + */ + editMode?: ej.Grid.EditMode|string; + + /**This specifies the id of the template. This template can be used to display the data that you require to be edited using the External edit form + * @Default {null} + */ + externalFormTemplateID?: string; + + /**This specifies to set the position of an External edit form either in the top-right or bottom-left of the grid + * @Default {ej.Grid.FormPosition.BottomLeft} + */ + formPosition?: ej.Grid.FormPosition|string; + + /**This specifies the id of the template. This template can be used to display the data that you require to be edited using the Inline edit form + * @Default {null} + */ + inlineFormTemplateID?: string; + + /**This specifies to set the position of an adding new row either in the top or bottom of the grid + * @Default {ej.Grid.RowPosition.top} + */ + rowPosition?: ej.Grid.RowPosition|string; + + /**Gets or sets a value that indicates whether the confirm dialog has to be shown while saving or discarding the batch changes + * @Default {true} + */ + showConfirmDialog?: boolean; + + /**Gets or sets a value that indicates whether the confirm dialog has to be shown while deleting record + * @Default {false} + */ + showDeleteConfirmDialog?: boolean; + + /**Gets or sets a value that indicates whether the title for edit form is different from the primarykey column. + * @Default {null} + */ + titleColumn?: string; + + /**Gets or sets a value that indicates whether to display the add new form by default in the grid. + * @Default {false} + */ + showAddNewRow?: boolean; +} + +export interface FilterSettingsFilteredColumns { + + /**Gets or sets a value that indicates whether to define the field name of the column to be filter. + */ + field?: string; + + /**Gets or sets a value that indicates whether to define the filter condition to filtered column. + */ + operator?: ej.FilterOperators|string; + + /**Gets or sets a value that indicates whether to define the predicate as and/or. + */ + predicate?: string; + + /**Gets or sets a value that indicates whether to define the value to be filtered in a column. + */ + value?: string|number; +} + +export interface FilterSettings { + + /**Gets or sets a value that indicates to perform the filter operation with case sensitive in excel styled filter menu mode + * @Default {false} + */ + enableCaseSensitivity?: boolean; + + /**This specifies the grid to starts the filter action while typing in the filterBar or after pressing the enter key. based on the filterBarMode. See filterBarMode + * @Default {ej.Grid.FilterBarMode.Immediate} + */ + filterBarMode?: ej.Grid.FilterBarMode|string; + + /**Gets or sets a value that indicates whether to define the filtered columns details programmatically at initial load + * @Default {[]} + */ + filteredColumns?: Array; + + /**This specifies the grid to show the filterBar or filterMenu to the grid records. See filterType + * @Default {ej.Grid.FilterType.FilterBar} + */ + filterType?: ej.Grid.FilterType|string; + + /**Gets or sets a value that indicates the maximum number of filter choices that can be showed in the excel styled filter menu. + * @Default {1000} + */ + maxFilterChoices?: number; + + /**This specifies the grid to show the filter text within the grid pager itself. + * @Default {true} + */ + showFilterBarMessage?: boolean; + + /**Gets or sets a value that indicates whether to enable the predicate options in the filtering menu + * @Default {false} + */ + showPredicate?: boolean; +} + +export interface GroupSettings { + + /**Gets or sets a value that customize the group caption format. + * @Default {null} + */ + captionFormat?: string; + + /**Gets or sets a value that indicates whether to enable the animation effects to the group drop area + * @Default {true} + */ + enableDropAreaAnimation?: boolean; + + /**Gets or sets a value that indicates whether to enable animation button option in the group drop area of the grid. + * @Default {false} + */ + enableDropAreaAutoSizing?: boolean; + + /**Gets or sets a value that indicates whether to add grouped columns programmatically at initial load + * @Default {[]} + */ + groupedColumns?: Array; + + /**Gets or sets a value that indicates whether to show the group drop area just above the column header. It can be used to avoid ungrouping the already grouped column using groupsettings. + * @Default {true} + */ + showDropArea?: boolean; + + /**Gets or sets a value that indicates whether to hide the grouped columns from the grid + * @Default {false} + */ + showGroupedColumn?: boolean; + + /**Gets or sets a value that indicates whether to show the group button image(toggle button)in the column header and also in the grouped column in the group drop area . It can be used to group/ungroup the columns by click on the toggle button. + * @Default {false} + */ + showToggleButton?: boolean; + + /**Gets or sets a value that indicates whether to enable the close button in the grouped column which is in the group drop area to ungroup the grouped column + * @Default {false} + */ + showUngroupButton?: boolean; +} + +export interface TextWrapSettings { + + /**This specifies the grid to apply the auto wrap for grid content or header or both. + * @Default {ej.Grid.WrapMode.Both} + */ + wrapMode?: ej.Grid.WrapMode|string; +} + +export interface PageSettings { + + /**Gets or sets a value that indicates whether to define which page to display currently in the grid + * @Default {1} + */ + currentPage?: number; + + /**Gets or sets a value that indicates whether to pass the current page information as a query string along with the url while navigating to other page. + * @Default {false} + */ + enableQueryString?: boolean; + + /**Gets or sets a value that indicates whether to enables pager template for the grid. + * @Default {false} + */ + enableTemplates?: boolean; + + /**Gets or sets a value that indicates whether to define the number of pages displayed in the pager for navigation + * @Default {8} + */ + pageCount?: number; + + /**Gets or sets a value that indicates whether to define the number of records displayed per page + * @Default {12} + */ + pageSize?: number; + + /**Gets or sets a value that indicates whether to enables default pager for the grid. + * @Default {false} + */ + showDefaults?: boolean; + + /**Gets or sets a value that indicates to add the template as a pager template for grid. + * @Default {null} + */ + template?: string; + + /**Get the value of total number of pages in the grid. The totalPages value is calculated based on page size and total records of grid + * @Default {null} + */ + totalPages?: number; + + /**Get the value of total number of records which is bound to the grid. The totalRecordsCount value is calculated based on dataSource bound to the grid. + * @Default {null} + */ + totalRecordsCount?: number; + + /**Gets or sets a value that indicates whether to define the number of pages to print + * @Default {ej.Grid.PrintMode.AllPages} + */ + printMode?: ej.Grid.PrintMode|string; +} + +export interface ScrollSettings { + + /**This specify the grid to to view data that you require without buffering the entire load of a huge database + * @Default {false} + */ + allowVirtualScrolling?: boolean; + + /**This specify the grid to enable/disable touch control for scrolling. + * @Default {true} + */ + enableTouchScroll?: boolean; + + /**This specify the grid to freeze particular columns at the time of scrolling. + * @Default {0} + */ + frozenColumns?: number; + + /**This specify the grid to freeze particular rows at the time of scrolling. + * @Default {0} + */ + frozenRows?: number; + + /**This specify the grid to show the vertical scroll bar, to scroll and view the grid contents. + * @Default {0} + */ + height?: number; + + /**This is used to define the mode of virtual scrolling in grid. See virtualScrollMode + * @Default {ej.Grid.VirtualScrollMode.Normal} + */ + virtualScrollMode?: ej.Grid.VirtualScrollMode|string; + + /**This specify the grid to show the horizontal scroll bar, to scroll and view the grid contents + * @Default {250} + */ + width?: number; + + /**This specify the scroll down pixel of mouse wheel, to scroll mouse wheel and view the grid contents. + * @Default {57} + */ + scrollOneStepBy?: number; +} + +export interface SearchSettings { + + /**This specify the grid to search for the value in particular columns that is mentioned in the field. + * @Default {[]} + */ + field?: any; + + /**This specifies the grid to search the particular data that is mentioned in the key. + */ + key?: string; + + /**It specifies the grid to search the records based on operator. + * @Default {contains} + */ + operator?: string; + + /**It enables or disables case-sensitivity while searching the search key in grid. + * @Default {true} + */ + ignoreCase?: boolean; +} + +export interface SelectionSettings { + + /**Gets or sets a value that indicates whether to enable the toggle selction behavior for row, cell and column. + * @Default {false} + */ + enableToggle?: boolean; + + /**Gets or sets a value that indicates whether to add the default selection actions as a seleciton mode.See selectionMode + * @Default {[row]} + */ + selectionMode?: ej.Grid.SelectionMode|string; +} + +export interface SortSettingsSortedColumns { + + /**Gets or sets a value that indicates whether to define the direction to sort the column. + */ + direction?: string; + + /**Gets or sets a value that indicates whether to define the field name of the column to be sort + */ + field?: string; +} + +export interface SortSettings { + + /**Gets or sets a value that indicates whether to define the direction and field to sort the column. + */ + sortedColumns?: Array; +} + +export interface StackedHeaderRowsStackedHeaderColumns { + + /**Gets or sets a value that indicates the header text for the particular stacked header column. + * @Default {null} + */ + column?: string; + + /**Gets or sets a value that indicates class to the corresponding stackedHeaderColumn. + * @Default {null} + */ + cssClass?: string; + + /**Gets or sets a value that indicates the header text for the particular stacked header column. + * @Default {null} + */ + headerText?: string; + + /**Gets or sets a value that indicates the text alignment of the corresponding headerText. + * @Default {ej.TextAlign.Left} + */ + textAlign?: string; +} + +export interface StackedHeaderRows { + + /**Gets or sets a value that indicates whether to add stacked header columns into the stacked header rows + * @Default {[]} + */ + stackedHeaderColumns?: Array; +} + +export interface SummaryRowsSummaryColumns { + + /**Gets or sets a value that indicates the text displayed in the summary column as a value + * @Default {null} + */ + customSummaryValue?: string; + + /**This specifies summary column used to perform the summary calculation + * @Default {null} + */ + dataMember?: string; + + /**Gets or sets a value that indicates to define the target column at which to display the summary. + * @Default {null} + */ + displayColumn?: string; + + /**Gets or sets a value that indicates the format for the text applied on the column + * @Default {null} + */ + format?: string; + + /**Gets or sets a value that indicates the text displayed before the summary column value + * @Default {null} + */ + prefix?: string; + + /**Gets or sets a value that indicates the text displayed after the summary column value + * @Default {null} + */ + suffix?: string; + + /**Gets or sets a value that indicates the type of calculations to be performed for the corresponding summary column + * @Default {[]} + */ + summaryType?: ej.Grid.SummaryType|string; + + /**Gets or sets a value that indicates to add the template for the summary value of dataMember given. + * @Default {null} + */ + template?: string; +} + +export interface SummaryRows { + + /**Gets or sets a value that indicates whether to show the summary value within the group caption area for the corresponding summary column while grouping the column + * @Default {false} + */ + showCaptionSummary?: boolean; + + /**Gets or sets a value that indicates whether to show the group summary value for the corresponding summary column while grouping a column + * @Default {false} + */ + showGroupSummary?: boolean; + + /**Gets or sets a value that indicates whether to show the total summary value the for the corresponding summary column. The summary row is added after the grid content. + * @Default {true} + */ + showTotalSummary?: boolean; + + /**Gets or sets a value that indicates whether to add summary columns into the summary rows. + * @Default {[]} + */ + summaryColumns?: Array; + + /**This specifies the grid to show the title for the summary rows. + */ + title?: string; + + /**This specifies the grid to show the title of summary row in the specified column. + * @Default {null} + */ + titleColumn?: string; +} + +export interface ToolbarSettings { + + /**Gets or sets a value that indicates whether to add custom toolbar items within the toolbar to perform any action in the grid + * @Default {[]} + */ + customToolbarItems?: Array; + + /**Gets or sets a value that indicates whether to enable toolbar in the grid. + * @Default {false} + */ + showToolbar?: boolean; + + /**Gets or sets a value that indicates whether to add the default editing actions as a toolbar items + * @Default {[]} + */ + toolbarItems?: ej.Grid.ToolBarItems|string; +} + +enum GridLines{ + + ///Displays both the horizontal and vertical grid lines. + Both, + + ///Displays the horizontal grid lines only. + Horizontal, + + ///Displays the vertical grid lines only. + Vertical, + + ///No grid lines are displayed. + None +} + + +enum ColumnLayout{ + + ///Column layout is auto(based on width). + Auto, + + ///Column layout is fixed(based on width). + Fixed +} + + +enum UnboundType{ + + ///Unbound type is edit. + Edit, + + ///Unbound type is save. + Save, + + ///Unbound type is delete. + Delete, + + ///Unbound type is cancel. + Cancel +} + + +enum EditingType{ + + ///Specifies editing type as string edit. + String, + + ///Specifies editing type as boolean edit. + Boolean, + + ///Specifies editing type as numeric edit. + Numeric, + + ///Specifies editing type as dropdown edit. + Dropdown, + + ///Specifies editing type as datepicker. + DatePicker, + + ///Specifies editing type as datetime picker. + DateTimePicker +} + + +enum ClipMode{ + + ///Shows ellipsis for the overflown cell. + Ellipsis, + + ///Truncate the text in the cell + Clip, + + ///Shows ellipsis and tooltip for the overflown cell. + EllipsisWithTooltip +} + + +enum EditMode{ + + ///Edit mode is normal. + Normal, + + ///Truncate the text in the cell + Clip, + + ///Edit mode is dialog. + Dialog, + + ///Edit mode is dialog template. + DialogTemplate, + + ///Edit mode is batch. + Batch, + + ///Edit mode is inline form. + InlineForm, + + ///Edit mode is inline template form. + InlineTemplateForm, + + ///Edit mode is external form. + ExternalForm, + + ///Edit mode is external form template. + ExternalFormTemplate +} + + +enum FormPosition{ + + ///Form position is bottomleft. + BottomLeft, + + ///Form position is topright. + TopRight +} + + +enum RowPosition{ + + ///Specifies position of add new row as top. + Top, + + ///Specifies position of add new row as bottom. + Bottom +} + + +enum FilterBarMode{ + + ///Initiate filter operation on typing the filter query. + Immediate, + + ///Initiate filter operation after Enter key is pressed. + OnEnter +} + + +enum FilterType{ + + ///Specifies the filter type as menu. + Menu, + + ///Specifies the filter type as excel. + Excel, + + ///Specifies the filter type as filterbar. + FilterBar +} + + +enum WrapMode{ + + ///Auto wrap is applied for both content and header. + Both, + + ///Auto wrap is applied only for content. + Content, + + ///Auto wrap is applied only for header. + Header +} + + +enum PrintMode{ + + ///Prints all pages. + AllPages, + + ///Prints curren tpage. + CurrentPage +} + + +enum VirtualScrollMode{ + + ///virtual scroll mode is normal. + Normal, + + ///virtual scroll mode is continuous. + Continuous +} + + +enum SelectionMode{ + + ///Selection is row basis. + Row, + + ///Selection is cell basis. + Cell, + + ///Selection is column basis. + Column +} + + +enum SelectionType{ + + ///Specifies the selection type as single. + Single, + + ///Specifies the selection type as multiple. + Multiple +} + + +enum SummaryType{ + + ///Summary type is average. + Average, + + ///Summary type is minimum. + Minimum, + + ///Summary type is maximum. + Maximum, + + ///Summary type is count. + Count, + + ///Summary type is sum. + Sum, + + ///Summary type is custom. + Custom, + + ///Summary type is true count. + TrueCount, + + ///Summary type is false count. + FalseCount +} + + +enum ToolBarItems{ + + ///Toolbar item is add. + Add, + + ///Toolbar item is edit. + Edit, + + ///Toolbar item is delete. + Delete, + + ///Toolbar item is update. + Update, + + ///Toolbar item is cancel. + Cancel, + + ///Toolbar item is search. + Search, + + ///Toolbar item is pdfExport. + PdfExport, + + ///Toolbar item is printGrid. + PrintGrid, + + ///Toolbar item is wordExport. + WordExport +} + +} + +class PivotGrid extends ej.Widget { + static fn: PivotGrid; + constructor(element: JQuery, options?: PivotGrid.Model); + constructor(element: Element, options?: PivotGrid.Model); + model:PivotGrid.Model; + defaults:PivotGrid.Model; + + /** Perform an asynchronous HTTP (AJAX) request. + * @returns {void} + */ + doAjaxPost(): void; + + /** Perform an asynchronous HTTP (FullPost) submit. + * @returns {void} + */ + doPostBack(): void; + + /** Exports the PivotGrid to an appropriate format based on the parameter passed. + * @returns {void} + */ + exportPivotGrid(): void; + + /** This function re-renders the PivotGrid on clicking the navigation buttons on PivotPager. + * @returns {void} + */ + refreshPagedPivotGrid(): void; + + /** This function receives the JSON formatted datasource to render the PivotGrid control. + * @returns {void} + */ + renderControlFromJSON(): void; +} +export module PivotGrid{ + +export interface Model { + + /**Sets the mode for the PivotGrid widget for binding either OLAP or relational data source. + * @Default {ej.PivotGrid.AnalysisMode.Olap} + */ + analysisMode?: any; + + /**Specifies the CSS class to PivotGrid to achieve custom theme. + * @Default {“”} + */ + cssClass?: string; + + /**Contains the serialized OlapReport at that instant. + * @Default {“”} + */ + currentReport?: string; + + /**Initializes the data source for the PivotGrid widget, when it functions completely on client-side. + * @Default {{}} + */ + dataSource?: DataSource; + + /**Used to bind the drilled members by default through report. + * @Default {[]} + */ + drilledItems?: Array; + + /**Object utilized to pass additional information between client-end and service-end. + * @Default {null} + */ + customObject?: any; + + /**Allows the user to access each cell on right-click. + * @Default {false} + */ + enableCellContext?: boolean; + + /**Enables the cell selection for a specified range of value cells. + * @Default {false} + */ + enableCellSelection?: boolean; + + /**Collapses the Pivot Items along rows and columns by default. It works only for relational data source. + * @Default {false} + */ + enableCollapseByDefault?: boolean; + + /**Enables the display of grand total for all the columns. + * @Default {true} + */ + enableColumnGrandTotal?: boolean; + + /**Allows the user to format a specific set of cells based on the condition. + * @Default {false} + */ + enableConditionalFormatting?: boolean; + + /**Allows the user to refresh the control on-demand and not during every UI operation. + * @Default {false} + */ + enableDeferUpdate?: boolean; + + /**Enables the display of GroupingBar allowing you to filter, sort and remove fields obtained from relational datasource. + * @Default {false} + */ + enableGroupingBar?: boolean; + + /**Enables the display of grand total for rows and columns. + * @Default {true} + */ + enableGrandTotal?: boolean; + + /**Allows the user to load PivotGrid using JSON data. + * @Default {false} + */ + enableJSONRendering?: boolean; + + /**Enables rendering of PivotGrid widget along with the PivotTable Field List, which allows UI operation. + * @Default {true} + */ + enablePivotFieldList?: boolean; + + /**Enables the display of grand total for all the rows. + * @Default {true} + */ + enableRowGrandTotal?: boolean; + + /**Allows the user to view PivotGrid from right to left. + * @Default {false} + */ + enableRTL?: boolean; + + /**Allows the user to enable ToolTip option. + * @Default {false} + */ + enableToolTip?: boolean; + + /**Allows the user to view large amount of data through virtual scrolling. + * @Default {false} + */ + enableVirtualScrolling?: boolean; + + /**Allows the user to configure hyperlink settings of PivotGrid control. + * @Default {{}} + */ + hyperlinkSettings?: HyperlinkSettings; + + /**This is used for identifying whether the member is Named Set or not. + * @Default {false} + */ + isNamedSets?: boolean; + + /**Allows the user to enable PivotGrid’s responsiveness in the browser layout. + * @Default {false} + */ + isResponsive?: boolean; + + /**Contains the serialized JSON string which renders PivotGrid. + * @Default {“”} + */ + jsonRecords?: string; + + /**Sets the summary layout for PivotGrid. Following are the ways in which summary can be positioned: normal summary (bottom), top summary, no summary and excel-like summary. + * @Default {ej.PivotGrid.Layout.Normal} + */ + layout?: ej.PivotGrid.Layout|string; + + /**Allows the user to set the localized language for the widget. + * @Default {en-US} + */ + locale?: string; + + /**Sets the mode for the PivotGrid widget for binding data source either in server-side or client-side. + * @Default {ej.PivotGrid.OperationalMode.ClientMode} + */ + operationalMode?: any; + + /**Allows the user to set custom name for the methods at service-end, communicated during AJAX post. + * @Default {{}} + */ + serviceMethodSettings?: ServiceMethodSettings; + + /**Connects the service using the specified URL for any server updates. + * @Default {“”} + */ + url?: string; + + /**Triggers when it reaches client-side after any AJAX request.*/ + afterServiceInvoke? (e: AfterServiceInvokeEventArgs): void; + + /**Triggers before any AJAX request is passed from PivotGrid to service methods.*/ + beforeServiceInvoke? (e: BeforeServiceInvokeEventArgs): void; + + /**Triggers when right-click action is performed on a cell.*/ + cellContext? (e: CellContextEventArgs): void; + + /**Triggers when a specific range of value cells are selected.*/ + cellSelection? (e: CellSelectionEventArgs): void; + + /**Triggers when the hyperlink of column header is clicked.*/ + columnHeaderHyperlinkClick? (e: ColumnHeaderHyperlinkClickEventArgs): void; + + /**Triggers after performing drill operation in PivotGrid.*/ + drillSuccess? (e: DrillSuccessEventArgs): void; + + /**Triggers when PivotGrid loading is initiated.*/ + load? (e: LoadEventArgs): void; + + /**Triggers when PivotGrid widget completes all operations at client-side after any AJAX request.*/ + renderComplete? (e: RenderCompleteEventArgs): void; + + /**Triggers when any error occurred during AJAX request.*/ + renderFailure? (e: RenderFailureEventArgs): void; + + /**Triggers when PivotGrid successfully reaches client-side after any AJAX request.*/ + renderSuccess? (e: RenderSuccessEventArgs): void; + + /**Triggers when the hyperlink of row header is clicked.*/ + rowHeaderHyperlinkClick? (e: RowHeaderHyperlinkClickEventArgs): void; + + /**Triggers when the hyperlink of summary cell is clicked.*/ + summaryCellHyperlinkClick? (e: SummaryCellHyperlinkClickEventArgs): void; + + /**Triggers when the hyperlink of value cell is clicked.*/ + valueCellHyperlinkClick? (e: ValueCellHyperlinkClickEventArgs): void; +} + +export interface AfterServiceInvokeEventArgs { + + /**return the current action of PivotGrid control. + */ + action?: string; + + /**return the custom object bounds with PivotGrid control. + */ + customObject?: any; + + /**return the outer HTML of PivotGrid control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the PivotGrid model + */ + model?: ej.PivotGrid.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface BeforeServiceInvokeEventArgs { + + /**return the current action of PivotGrid control. + */ + action?: string; + + /**return the custom object bounds with PivotGrid control. + */ + customObject?: any; + + /**return the outer HTML of PivotGrid control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the PivotGrid model + */ + model?: ej.PivotGrid.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface CellContextEventArgs { + + /**returns the original event args. + */ + args?: any; + + /**returns the cell position (row index and column index) in table. + */ + cellPosition?: string; + + /**returns the type of the cell. + */ + cellType?: string; + + /**returns the serialized data of the header cells. + */ + rowData?: string; + + /**returns the unique name of levels/members. + */ + uniqueName?: string; +} + +export interface CellSelectionEventArgs { + + /**returns the original event args. + */ + args?: any; + + /**Returns the selected cell values. + */ + cellvalue?: any; + + /**Returns the selected value cells row headers. + */ + rowheaders?: any; + + /**Returns the selected value cells column headers. + */ + colheaders?: any; + + /**Returns the selected value cells measure. + */ + measure?: any; + + /**Return the row and column measure count. + */ + measureValue?: any; +} + +export interface ColumnHeaderHyperlinkClickEventArgs { + + /**returns the original event args. + */ + args?: any; + + /**returns the cell position (row index and column index) in table. + */ + cellPosition?: string; + + /**returns the type of the cell. + */ + cellType?: string; + + /**returns the serialized data of the header cells. + */ + rowData?: string; + + /**returns the unique name of levels/members. + */ + uniqueName?: string; +} + +export interface DrillSuccessEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the PivotGrid model + */ + model?: ej.PivotGrid.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface LoadEventArgs { + + /**returns the original event args. + */ + args?: any; + + /**returns the current action of PivotGrid control. + */ + action?: string; + + /**returns the custom object bounded with the control. + */ + customObject?: any; + + /**returns the HTML of PivotGrid control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the PivotGrid model. + */ + model?: ej.PivotGrid.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RenderCompleteEventArgs { + + /**returns the original event args. + */ + args?: any; + + /**returns the current action of PivotGrid control. + */ + action?: string; + + /**returns the custom object bounded with the control. + */ + customObject?: any; + + /**returns the HTML of PivotGrid control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the PivotGrid model. + */ + model?: ej.PivotGrid.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RenderFailureEventArgs { + + /**returns the original event args. + */ + args?: any; + + /**returns the current action of PivotGrid control. + */ + action?: string; + + /**returns the custom object bounded with the control. + */ + customObject?: any; + + /**returns the HTML of PivotGrid control. + */ + element?: string; + + /**returns the error message with error code. + */ + message?: any; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the PivotGrid model. + */ + model?: ej.PivotGrid.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RenderSuccessEventArgs { + + /**returns the original event args. + */ + args?: any; + + /**returns the current action of PivotGrid control. + */ + action?: string; + + /**returns the custom object bounded with the control. + */ + customObject?: any; + + /**returns the HTML of PivotGrid control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the PivotGrid model. + */ + model?: ej.PivotGrid.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RowHeaderHyperlinkClickEventArgs { + + /**returns the original event args. + */ + args?: any; + + /**returns the cell position (row index and column index) in table. + */ + cellPosition?: string; + + /**returns the type of the cell. + */ + cellType?: string; + + /**returns the serialized data of the header cells. + */ + rowData?: string; + + /**returns the unique name of levels/members. + */ + uniqueName?: string; +} + +export interface SummaryCellHyperlinkClickEventArgs { + + /**returns the original event args. + */ + args?: any; + + /**returns the cell position (row index and column index) in table. + */ + cellPosition?: string; + + /**returns the type of the cell. + */ + cellType?: string; + + /**returns the serialized data of the header cells. + */ + rowData?: string; + + /**returns the unique name of levels/members. + */ + uniqueName?: string; +} + +export interface ValueCellHyperlinkClickEventArgs { + + /**returns the original event args. + */ + args?: any; + + /**returns the cell position (row index and column index) in table. + */ + cellPosition?: string; + + /**returns the type of the cell. + */ + cellType?: string; + + /**returns the serialized data of the header cells. + */ + rowData?: string; + + /**returns the unique name of levels/members. + */ + uniqueName?: string; +} + +export interface DataSourceValues { + + /**This holds the measures unique names to bind the measures from Cube. + * @Default {[]} + */ + measures?: Array; + + /**To set the axis name in-order to place the measures. + * @Default {“”} + */ + axis?: string; +} + +export interface DataSource { + + /**Contains the database name as string type to fetch the data from the given connection string. + * @Default {“”} + */ + catalog?: string; + + /**Lists out the items to be arranged in column section of PivotGrid. + * @Default {[]} + */ + columns?: Array; + + /**Contains the respective Cube name as string type. + * @Default {“”} + */ + cube?: string; + + /**Provides the raw data source for the PivotGrid. + * @Default {null} + */ + data?: any; + + /**Lists out the items to be arranged in row section of PivotGrid. + * @Default {[]} + */ + rows?: Array; + + /**Lists out the items which supports calculation in PivotGrid. + * @Default {[]} + */ + values?: Array; + + /**Lists out the items which supports filtering of values in PivotGrid. + * @Default {[]} + */ + filters?: Array; +} + +export interface HyperlinkSettings { + + /**Allows the user to enable/disable hyperlink for column header. + * @Default {false} + */ + enableColumnHeaderHyperlink?: boolean; + + /**Allows the user to enable/disable hyperlink for row header. + * @Default {false} + */ + enableRowHeaderHyperlink?: boolean; + + /**Allows the user to enable/disable hyperlink for summary cells. + * @Default {false} + */ + enableSummaryCellHyperlink?: boolean; + + /**Allows the user to enable/disable hyperlink for value cells. + * @Default {false} + */ + enableValueCellHyperlink?: boolean; +} + +export interface ServiceMethodSettings { + + /**Allows the user to set the custom name for the service method that's responsible for drill up/down operation in PivotGrid. + * @Default {DrillGrid} + */ + drillDown?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for exporting. + * @Default {Export} + */ + exportPivotGrid?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for performing server-side actions on defer update. + * @Default {DeferUpdate} + */ + deferUpdate?: string; + + /**Allows the user to set the custom name for the service method that’s responsible to getting the values for the tree-view inside filter dialog. + * @Default {FetchMembers} + */ + fetchMembers?: string; + + /**Allows the user to set the custom name for the service method that's responsible for filtering operation in PivotGrid. + * @Default {Filtering} + */ + filtering?: string; + + /**Allows the user to set the custom name for the service method that's responsible for initializing PivotGrid. + * @Default {InitializeGrid} + */ + initialize?: string; + + /**Allows the user to set the custom name for the service method that's responsible for the server-side action, on dropping a node into Field List. + * @Default {NodeDropped} + */ + nodeDropped?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for the server-side action on changing the checked state of a node in Field List. + * @Default {NodeStateModified} + */ + nodeStateModified?: string; + + /**Allows the user to set the custom name for the service method that's responsible for performing paging operation in PivotGrid. + * @Default {Paging} + */ + paging?: string; + + /**Allows the user to set the custom name for the service method that's responsible for sorting operation in PivotGrid. + * @Default {Sorting} + */ + sorting?: string; +} + +enum Layout{ + + ///To set normal summary layout in PivotGrid. + Normal, + + ///To set layout with summaries at the top in PivotGrid. + NormalTopSummary, + + ///To set layout without summaries in PivotGrid. + NoSummaries, + + ///To set excel-like layout in PivotGrid. + ExcelLikeLayout +} + +} + +class PivotSchemaDesigner extends ej.Widget { + static fn: PivotSchemaDesigner; + constructor(element: JQuery, options?: PivotSchemaDesigner.Model); + constructor(element: Element, options?: PivotSchemaDesigner.Model); + model:PivotSchemaDesigner.Model; + defaults:PivotSchemaDesigner.Model; + + /** Perform an asynchronous HTTP (AJAX) request. + * @returns {void} + */ + doAjaxPost(): void; +} +export module PivotSchemaDesigner{ + +export interface Model { + + /**Specifies the CSS class to PivotSchemaDesigner to achieve custom theme. + * @Default {“”} + */ + cssClass?: string; + + /**Object utilized to pass additional information between client-end and service-end. + * @Default {{}} + */ + customObject?: any; + + /**For ASP.NET and MVC Wrapper, Pivots Schema Designer will be initialized and rendered empty initially. Once PivotGrid widget is rendered completely, Pivots Schema Designer will just be populated with data source by setting this property to “true”. + * @Default {false} + */ + enableWrapper?: boolean; + + /**Allows the user to set the list of filters in filter section. + * @Default {newArray()} + */ + filters?: Array; + + /**Sets the height for PivotSchemaDesigner. + * @Default {“”} + */ + height?: string; + + /**Allows the user to set the localized language for the widget. + * @Default {en-US} + */ + locale?: string; + + /**Allows the user to set list of PivotCalculations in values section. + * @Default {newArray()} + */ + pivotCalculations?: Array; + + /**Allows the user to set the list of PivotItems in column section. + * @Default {newArray()} + */ + pivotColumns?: Array; + + /**Sets the Pivot control bound with this PivotSchemaDesigner. + * @Default {null} + */ + pivotControl?: any; + + /**Allows the user to set the list of PivotItems in row section. + * @Default {newArray()} + */ + pivotRows?: Array; + + /**Allows the user to arrange the fields inside Field List of PivotSchemaDesigner. + * @Default {newArray()} + */ + pivotTableFields?: Array; + + /**Allows the user to set custom name for the methods at service-end, communicated during AJAX post. + * @Default {{}} + */ + serviceMethod?: ServiceMethod; + + /**Connects the service using the specified URL for any server updates. + * @Default {“”} + */ + url?: string; + + /**Sets the width for PivotSchemaDesigner. + * @Default {“”} + */ + width?: string; + + /**Triggers when it reaches client-side after any AJAX request.*/ + afterServiceInvoke? (e: AfterServiceInvokeEventArgs): void; + + /**Triggers before any AJAX request is passed from PivotSchemaDesigner to service methods.*/ + beforeServiceInvoke? (e: BeforeServiceInvokeEventArgs): void; +} + +export interface AfterServiceInvokeEventArgs { + + /**return the current action of PivotSchemaDesigner control. + */ + action?: string; + + /**return the custom object bounds with PivotSchemaDesigner control. + */ + customObject?: any; + + /**return the outer HTML of PivotSchemaDesigner control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the PivotSchemaDesigner model + */ + model?: ej.PivotSchemaDesigner.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface BeforeServiceInvokeEventArgs { + + /**return the current action of PivotSchemaDesigner control. + */ + action?: string; + + /**return the custom object bounds with PivotSchemaDesigner control. + */ + customObject?: any; + + /**return the outer HTML of PivotSchemaDesigner control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the PivotSchemaDesigner model + */ + model?: ej.PivotSchemaDesigner.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface ServiceMethod { + + /**Allows the user to set the custom name for the service method that’s responsible for getting the values for the tree-view inside filter dialog. + * @Default {FetchMembers} + */ + fetchMembers?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for filtering operation in Field List. + * @Default {Filtering} + */ + filtering?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for the server-side action, on expanding members in Field List. + * @Default {MemberExpanded} + */ + memberExpand?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for the server-side action, on dropping a node into Field List. + * @Default {NodeDropped} + */ + nodeDropped?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for the server-side action on changing the checked state of a node in Field List. + * @Default {NodeStateModified} + */ + nodeStateModified?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for remove operation in Field List. + * @Default {RemoveButton} + */ + removeButton?: string; +} +} + +class PivotPager extends ej.Widget { + static fn: PivotPager; + constructor(element: JQuery, options?: PivotPager.Model); + constructor(element: Element, options?: PivotPager.Model); + model:PivotPager.Model; + defaults:PivotPager.Model; + + /** This function initializes the page counts and page numbers for the PivotPager. + * @returns {void} + */ + initPagerProperties(): void; +} +export module PivotPager{ + +export interface Model { + + /**Contains the current page number in categorical axis. + * @Default {1} + */ + categoricalCurrentPage?: number; + + /**Contains the total page count in categorical axis. + * @Default {1} + */ + categoricalPageCount?: number; + + /**Allows the user to set the localized language for the widget. + * @Default {en-US} + */ + locale?: string; + + /**Sets the pager mode (Only Categorical Pager/Only Series Pager/Both) for the PivotPager. + * @Default {ej.PivotPager.Mode.Both} + */ + mode?: ej.PivotPager.Mode|string; + + /**Contains the current page number in series axis. + * @Default {1} + */ + seriesCurrentPage?: number; + + /**Contains the total page count in series axis. + * @Default {1} + */ + seriesPageCount?: number; + + /**Contains the ID of the target element for which paging needs to be done. + * @Default {“”} + */ + targetControlID?: string; +} + +enum Mode{ + + ///To set both categorical and series pager for paging. + Both, + + ///To set only categorical pager for paging. + Categorical, + + ///To set only series pager for paging. + Series +} + +} + +class Schedule extends ej.Widget { + static fn: Schedule; + constructor(element: JQuery, options?: Schedule.Model); + constructor(element: Element, options?: Schedule.Model); + model:Schedule.Model; + defaults:Schedule.Model; + + /** This method is used to delete the appointment based on the guid value or the appointment data passed to it. + * @param {string|any} GUID value of an appointment element or an appointment object + * @returns {void} + */ + deleteAppointment(data: string|any): void; + + /** Destroys the Schedule widget. All the events bound using this._on are unbound automatically and the control is moved to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** Exports the appointments from the Schedule control. + * @param {string} It refers the controller action name to redirect. (For MVC) + * @param {string} It refers the server event name.(For ASP) + * @param {string|number} Pass the id of an appointment, in case if a single appointment needs to be exported. Otherwise, it takes the null value. + * @returns {void} + */ + exportSchedule(action: string, serverEvent: string, id: string|number): void; + + /** Searches the appointments from appointment list of Schedule control. + * @param {Array} Holds array of one or more conditional objects for filtering the appointments based on it. + * @returns {void} + */ + filterAppointments(filterConditions: Array): void; + + /** Gets the appointment list of Schedule control. + * @returns {void} + */ + getAppointments(): void; + + /** Prints the Scheduler. + * @returns {void} + */ + print(): void; + + /** Refreshes the Scroller within Scheduler while using it with some other controls or application. + * @returns {void} + */ + refreshScroller(): void; + + /** It is used to save the appointment. The appointment obj is based on the argument passed along with this method. + * @param {any} appointment object which includes appointment details + * @returns {void} + */ + saveAppointment(appointmentObject: any): void; + + /** Retrieves the time slot information (start/end time and resource details) of the given element. The parameter is optional - as when no element is passed to it, the currently selected cell information will be retrieved. When multiple cells are selected in the Scheduler, it is not necessary to provide the parameter. + * @param {any} TD element object rendered as Scheduler work cell + * @returns {void} + */ + getSlotByElement(element: any): void; + + /** Searches the appointments from the appointment list of Schedule control. + * @param {any|string} Defines the search word or the filter condition, based on which the appointments are filtered from the list. + * @param {string} Defines the field name on which the search is to be made. + * @param {string|string} Defines the filterOperator value for the search operation. + * @param {boolean} Defines the ignoreCase value for performing the search operation. + * @returns {void} + */ + searchAppointments(searchString: any|string, field: string, operator: string|string, ignoreCase: boolean): void; + + /** To refresh the Schedule control. + * @returns {void} + */ + refresh(): void; + + /** Refreshes only the appointments within the Schedule control. + * @returns {void} + */ + refreshAppointment(): void; +} +export module Schedule{ + +export interface Model { + + /**When set to true, Schedule allows the appointments to be dragged and dropped at required time. + * @Default {true} + */ + allowDragAndDrop?: boolean; + + /**When set to true, Scheduler allows interaction through keyboard shortcut keys. + * @Default {true} + */ + allowKeyboardNavigation?: boolean; + + /**It includes the dataSource option and the fields related to Schedule appointments. The appointment fields within the appointmentSettings can accept both string and object type values. To apply validation rules on the appointment window fields, then the appointment fields needs to be defined with object type values. + */ + appointmentSettings?: AppointmentSettings; + + /**Default Value + * @Default {null} + */ + appointmentTemplateId?: string; + + /**Default Value + */ + cssClass?: string; + + /**Sets various categorize colors to the Schedule appointments to differentiate it. + */ + categorizeSettings?: CategorizeSettings; + + /**Sets the height for Schedule cells. + * @Default {20px} + */ + cellHeight?: string; + + /**Sets the width for Schedule cells. + */ + cellWidth?: string; + + /**Holds all options related to the context menu settings of the Schedule. + */ + contextMenuSettings?: ContextMenuSettings; + + /**Sets current date of the Schedule. The Schedule displays initially with the date that is provided here. + * @Default {new Date()} + */ + currentDate?: any; + + /**Sets current view of the Schedule. Schedule renders initially with the view that is specified here. The available views are day, week, workweek, month, agenda and custom view - from which any one of the required view can be set to the Schedule. It accepts both string or enum values. The enum values that are accepted by currentView(ej.Schedule.CurrentView) are as follows, + * @Default {ej.Schedule.CurrentView.Week} + */ + currentView?: string|ej.Schedule.CurrentView; + + /**Sets the date format for Schedule. + */ + dateFormat?: string; + + /**When set to true, shows the previous/next appointment navigator button on the Scheduler. + * @Default {true} + */ + showAppointmentNavigator?: boolean; + + /**When set to true, enables the resize behavior of appointments within the Schedule. + * @Default {true} + */ + enableAppointmentResize?: boolean; + + /**When set to true, enables the loading of Schedule appointments based on your demand. With this load on demand concept, the data consumption of the Schedule can be limited. + * @Default {false} + */ + enableLoadOnDemand?: boolean; + + /**Saves the current model value to browser cookies for state maintenance. When the page gets refreshed, Schedule control values are retained. + * @Default {false} + */ + enablePersistence?: boolean; + + /**When set to true, the Schedule layout and behavior changes as per the common RTL conventions. + * @Default {false} + */ + enableRTL?: boolean; + + /**Sets the end hour time limit to be displayed on the Schedule. + * @Default {24} + */ + endHour?: number; + + /**To configure resource grouping on the Schedule. + */ + group?: Group; + + /**Sets the height of the Schedule. Accepts both pixel and percentage values. + * @Default {1120px} + */ + height?: string; + + /**To define the work hours within the Schedule control. + */ + workHours?: WorkHours; + + /**When set to true, enables the Schedule to observe Daylight Saving Time for supported timezones. + * @Default {false} + */ + isDST?: boolean; + + /**When set to true, adapts the Schedule layout to fit the screen size of devices on which it renders. + * @Default {true} + */ + isResponsive?: boolean; + + /**Sets the specific culture to the Schedule. + * @Default {en-US} + */ + locale?: string; + + /**Sets the maximum date limit to display on the Schedule. Setting maxDate with specific date value disallows the Schedule to navigate beyond that date. + * @Default {new Date(2099, 12, 31)} + */ + maxDate?: any; + + /**Sets the minimum date limit to display on the Schedule. Setting minDate with specific date value disallows the Schedule to navigate beyond that date. + * @Default {new Date(1900, 01, 01)} + */ + minDate?: any; + + /**Sets the mode of Schedule rendering either in a vertical or horizontal direction. It accepts either string("vertical" or "horizontal") or enum values. The enum values that are accepted by orientation(ej.Schedule.Orientation) are as follows, + * @Default {ej.Schedule.Orientation.Vertical} + */ + orientation?: string|ej.Schedule.Orientation; + + /**Holds all the options related to priority settings of the Schedule. + */ + prioritySettings?: PrioritySettings; + + /**When set to true, disables the interaction with the Schedule appointments, simply allowing the date and view navigation to occur. + * @Default {false} + */ + readOnly?: boolean; + + /**Holds all the options related to reminder settings of the Schedule. + */ + reminderSettings?: ReminderSettings; + + /**Defines the specific start and end dates to be rendered in the Schedule control. To render such user-specified custom date ranges in the Schedule control, set the currentView property to customview. + * @Default {null} + */ + renderDates?: RenderDates; + + /**Template design that applies on the Schedule resource header. + * @Default {null} + */ + resourceHeaderTemplateId?: string; + + /**Holds all the options related to the resources settings of the Schedule. It is a collection of one or more resource objects, where the levels of resources are rendered on the Schedule based on the order of the resource data provided within this collection. + * @Default {null} + */ + resources?: Array; + + /**When set to true, displays the all-day row cells on the Schedule. + * @Default {true} + */ + showAllDayRow?: boolean; + + /**When set to true, displays the current time indicator on the Schedule. + * @Default {true} + */ + showCurrentTimeIndicator?: boolean; + + /**When set to true, displays the header bar on the Schedule. + * @Default {true} + */ + showHeaderBar?: boolean; + + /**When set to true, displays the location field additionally on Schedule appointment window. + * @Default {false} + */ + showLocationField?: boolean; + + /**When set to true, displays the quick window for every single click made on the Schedule cells or appointments. + * @Default {true} + */ + showQuickWindow?: boolean; + + /**When set to true, displays the timescale on the left side of the Schedule. + * @Default {true} + */ + showTimeScale?: boolean; + + /**Sets the start hour time range to be displayed on the Schedule. + * @Default {0} + */ + startHour?: number; + + /**Sets either 12 or 24 hour time mode on the Schedule. It accepts either the string value("12" or "24") or the below mentioned enum values. The enum values that are accepted by timeMode(ej.Schedule.TimeMode) are as follows, + * @Default {null} + */ + timeMode?: string|ej.Schedule.TimeMode; + + /**Sets the timezone for the Schedule. + * @Default {null} + */ + timeZone?: string; + + /**Sets the collection of timezone items to be bound to the Schedule. Only the items bound to this property gets listed out in the timezone field of the appointment window. + */ + timeZoneCollection?: TimeZoneCollection; + + /**Defines the view collection to be displayed on the Schedule. By default, it displays all the views namely, Day, Week, WorkWeek and Month. + * @Default {[Day, Week, WorkWeek, Month, Agenda]} + */ + views?: Array; + + /**Sets the width of the Schedule. Accepts both pixel and percentage values. + * @Default {100%} + */ + width?: string; + + /**When set to true, Schedule allows the validation of recurrence pattern to take place before it is being assigned to the appointments. For example, when one of the instance of recurrence appointment is dragged beyond the next or previous instance of the same recurrence appointment, a pop-up is displayed with the validation message disallowing the drag functionality. + * @Default {true} + */ + enableRecurrenceValidation?: boolean; + + /**Sets the week to display more than one week appointment summary. + */ + agendaViewSettings?: AgendaViewSettings; + + /**You can change or set the starting day of the week. + * @Default {null} + */ + firstDayOfWeek?: string; + + /**You can set the workWeek days of the workWeek. + * @Default {[Monday, Tuesday, Wednesday, Thursday, Friday]} + */ + workWeek?: Array; + + /**The tooltip allows to display appointment details in a tooltip while hovering on it. + */ + tooltipSettings?: TooltipSettings; + + /**Holds all the options related to the time scale of Scheduler. The timeslots either major or minor slots can be customized with this property. + */ + timeScale?: TimeScale; + + /**When set to true, shows the delete confirmation dialog before deleting an appointment. + * @Default {true} + */ + showDeleteConfirmationDialog?: boolean; + + /**Accepts the id value of the template layout defined for the all-day cells. + * @Default {null} + */ + allDayCellsTemplateId?: string; + + /**Accepts the id value of the template layout defined for the work cells and month cells. + * @Default {null} + */ + workCellsTemplateId?: string; + + /**Accepts the id value of the template layout defined for the date header cells. + * @Default {null} + */ + dateHeaderTemplateId?: string; + + /**when set to false, allows the height of the work-cells to adjust automatically based on the number of appointment count it has. + * @Default {true} + */ + showOverflowButton?: boolean; + + /**Allows setting draggable area for the Scheduler appointments. Also, turns on the external drag and drop, when set with some specific external drag area name. + */ + appointmentDragArea?: string; + + /**When set to true, displays the other months days from the current month on the Schedule. + * @Default {true} + */ + showNextPrevMonth?: boolean; + + /**Triggers before the action begin of the Schedule.*/ + actionBegin? (e: ActionBeginEventArgs): void; + + /**Triggers after the completion of action in the Schedule.*/ + actionComplete? (e: ActionCompleteEventArgs): void; + + /**Triggers after the appointment is clicked.*/ + appointmentClick? (e: AppointmentClickEventArgs): void; + + /**Triggers before the appointment is being removed from the Scheduler.*/ + beforeAppointmentRemove? (e: BeforeAppointmentRemoveEventArgs): void; + + /**Triggers before the edited appointment is being saved.*/ + beforeAppointmentChange? (e: BeforeAppointmentChangeEventArgs): void; + + /**Triggers after the appointment is hovered.*/ + appointmentHover? (e: AppointmentHoverEventArgs): void; + + /**Triggers before the appointment gets saved.*/ + beforeAppointmentCreate? (e: BeforeAppointmentCreateEventArgs): void; + + /**Triggers before the appointment window opens.*/ + appointmentWindowOpen? (e: AppointmentWindowOpenEventArgs): void; + + /**Triggers before the context menu opens.*/ + beforeContextMenuOpen? (e: BeforeContextMenuOpenEventArgs): void; + + /**Triggers after the cell is clicked.*/ + cellClick? (e: CellClickEventArgs): void; + + /**Triggers after the cell is clicked twice.*/ + cellDoubleClick? (e: CellDoubleClickEventArgs): void; + + /**Triggers after the cell is hovered.*/ + cellHover? (e: CellHoverEventArgs): void; + + /**Triggers while the appointment is being dragged over the work cells.*/ + drag? (e: DragEventArgs): void; + + /**Triggers when the appointment dragging begins.*/ + dragStart? (e: DragStartEventArgs): void; + + /**Triggers when the appointment is dropped.*/ + dragStop? (e: DragStopEventArgs): void; + + /**Triggers after the context menu is clicked.*/ + menuItemClick? (e: MenuItemClickEventArgs): void; + + /**Triggers after the Schedule view or date is navigated.*/ + navigation? (e: NavigationEventArgs): void; + + /**Triggers every time before the elements of the scheduler such as work cells, time cells or header cells and so on renders or re-renders on a page.*/ + queryCellInfo? (e: QueryCellInfoEventArgs): void; + + /**Triggers when the reminder is raised for an appointment.*/ + reminder? (e: ReminderEventArgs): void; + + /**Triggers while resizing the appointment.*/ + resize? (e: ResizeEventArgs): void; + + /**Triggers when the appointment resizing begins.*/ + resizeStart? (e: ResizeStartEventArgs): void; + + /**Triggers when appointment resizing stops.*/ + resizeStop? (e: ResizeStopEventArgs): void; + + /**Triggers when the overflow button is clicked.*/ + overflowButtonClick? (e: OverflowButtonClickEventArgs): void; + + /**Triggers while mouse hovering on the overflow button.*/ + overflowButtonHover? (e: OverflowButtonHoverEventArgs): void; + + /**Triggers when any of the keyboard keys are pressed.*/ + keyDown? (e: KeyDownEventArgs): void; + + /**Triggers after the appointment is saved.*/ + appointmentCreated? (e: AppointmentCreatedEventArgs): void; + + /**Triggers after the appointment is edited.*/ + appointmentChanged? (e: AppointmentChangedEventArgs): void; + + /**Triggers after the appointment is deleted.*/ + appointmentRemoved? (e: AppointmentRemovedEventArgs): void; +} + +export interface ActionBeginEventArgs { + + /**Returns the current date value. + */ + currentDate?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the current view value. + */ + currentView?: string; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the action begin request type. + */ + requestType?: string; + + /**Returns the target of the click. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the save appointment value. + */ + data?: any; + + /**Returns the id of delete appointment. + */ + id?: number; +} + +export interface ActionCompleteEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the data about view change action. + */ + data?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the action complete request type. + */ + requestType?: string; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the appointment data dropped. + */ + appointment?: any; +} + +export interface AppointmentClickEventArgs { + + /**Returns the object of appointmentClick event. + */ + object?: any; + + /**Returns the clicked appointment object. + */ + appointment?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface BeforeAppointmentRemoveEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the deleted appointment object. + */ + appointment?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the Scheduler event. + */ + type?: string; +} + +export interface BeforeAppointmentChangeEventArgs { + + /**Returns the edited appointment object. + */ + appointment?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the Scheduler event. + */ + type?: string; +} + +export interface AppointmentHoverEventArgs { + + /**Returns the object of appointmentHover event. + */ + object?: any; + + /**Returns the hovered appointment object. + */ + appointment?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface BeforeAppointmentCreateEventArgs { + + /**Returns the appointment object. + */ + appointment?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the Scheduler event. + */ + type?: string; +} + +export interface AppointmentWindowOpenEventArgs { + + /**returns the object of appointmentWindowOpen event while selecting the detail option from quick window or edit appointment or edit series option. + */ + object?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the end time of the double clicked cell. + */ + endTime?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the action name that triggers window open. + */ + originalEventType?: string; + + /**Returns the start time of the double clicked cell. + */ + startTime?: any; + + /**Returns the target of the double clicked cell. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the edit appointment object. + */ + appointment?: any; + + /**Returns the edit occurrence option value. + */ + edit?: boolean; +} + +export interface BeforeContextMenuOpenEventArgs { + + /**Returns the object of beforeContextMenuOpen event. + */ + object?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the current cell index value. + */ + cellIndex?: number; + + /**Returns the current date value. + */ + currentDate?: any; + + /**Returns the current resource details, when multiple resources are present, otherwise returns null. + */ + resources?: any; + + /**Returns the current appointment details while opening the menu from appointment. + */ + appointment?: any; + + /**Returns the object of before opening menu target. + */ + events?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface CellClickEventArgs { + + /**Returns the object of cellClick event. + */ + object?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the end time of the clicked cell. + */ + endTime?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the start time of the clicked cell. + */ + startTime?: any; + + /**Returns the target of the clicked cell. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface CellDoubleClickEventArgs { + + /**Returns the object of cellDoubleClick event. + */ + object?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the end time of the double clicked cell. + */ + endTime?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the start time of the double clicked cell. + */ + startTime?: any; + + /**Returns the target of the double clicked cell. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface CellHoverEventArgs { + + /**Returns the object of cellHover event. + */ + object?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the index of the hovered cell. + */ + cellIndex?: any; + + /**Returns the current date of the hovered cell. + */ + currentDate?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the target of the clicked cell. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface DragEventArgs { + + /**Returns the object of dragOver event. + */ + object?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the target of the drag over appointment. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface DragStartEventArgs { + + /**Returns the object of dragStart event. + */ + object?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the target of the dragging appointment. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface DragStopEventArgs { + + /**Returns the object of dragDrop event. + */ + object?: any; + + /**Returns the dropped appointment object. + */ + appointment?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface MenuItemClickEventArgs { + + /**Returns the object of menuItemClick event. + */ + object?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the object of menu item event. + */ + events?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface NavigationEventArgs { + + /**Returns the current date object. + */ + currentDate?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the current view value. + */ + currentView?: string; + + /**Returns the previous view value. + */ + previousView?: string; + + /**Returns the target of the action. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the previous date of the Schedule. + */ + previousDate?: any; +} + +export interface QueryCellInfoEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the current appontment data. + */ + appointment?: any; + + /**Returns the currently rendering DOM element. + */ + element?: any; + + /**Returns the name of the currently rendering element on the scheduler. + */ + requestType?: string; + + /**Returns the cell type which is currently rendering on the Scheduler. + */ + cellType?: string; + + /**Returns the start date of the currently rendering appointment. + */ + currentAppointmentDate?: any; + + /**Returns the currently rendering cell information. + */ + cell?: any; + + /**Returns the currently rendering resource details. + */ + resource?: any; + + /**Returns the currently rendering date information. + */ + currentDay?: any; +} + +export interface ReminderEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the appointment object for which the reminder is raised. + */ + reminderAppointment?: any; +} + +export interface ResizeEventArgs { + + /**Returns the object of resizing event. + */ + object?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the resize element value. + */ + element?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface ResizeStartEventArgs { + + /**Returns the object of resizeStart event. + */ + object?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the resize element value. + */ + element?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface ResizeStopEventArgs { + + /**Returns the object of resizeStop event. + */ + object?: any; + + /**Returns the resized appointment value. + */ + appointment?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the target of the resized appointment. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface OverflowButtonClickEventArgs { + + /**Returns the object consisting of starttime, endtime and resource value of the underlying cell on which the clicked overflow button is present. + */ + object?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the object of menu item event. + */ + events?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface OverflowButtonHoverEventArgs { + + /**Returns the object consisting of starttime, endtime and resource value of the underlying cell on which the overflow button is currently hovered. + */ + object?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the object of menu item event. + */ + events?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface KeyDownEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the object of menu item event. + */ + events?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface AppointmentCreatedEventArgs { + + /**Returns the appointment object. + */ + appointment?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the Scheduler event. + */ + type?: string; +} + +export interface AppointmentChangedEventArgs { + + /**Returns the edited appointment object. + */ + appointment?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the Scheduler event. + */ + type?: string; +} + +export interface AppointmentRemovedEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the deleted appointment object. + */ + appointment?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the Scheduler event. + */ + type?: string; +} + +export interface AppointmentSettings { + + /**Default Value + * @Default {Array} + */ + dataSource?: any|Array; + + /**Default Value + * @Default {null} + */ + query?: string; + + /**Default Value + * @Default {null} + */ + tableName?: string; + + /**Binds the id field name in dataSource to the id of Schedule appointments. It denotes the unique id assigned to appointments. + */ + id?: string; + + /**Binds the name of startTime field in the dataSource with start time of the Schedule appointments. It indicates the date and Time when Schedule appointment actually starts. + */ + startTime?: string; + + /**Binds the name of endTime field in dataSource with the end time of Schedule appointments. It indicates the date and time when Schedule appointment actually ends. + */ + endTime?: string; + + /**Binds the name of subject field in the dataSource to appointment Subject. Indicates the Subject or title that gets displayed on Schedule appointments. + */ + subject?: string; + + /**Binds the description field name in dataSource. It indicates the appointment description. + */ + description?: string; + + /**Binds the name of recurrence field in dataSource. It indicates whether the appointment is a recurrence appointment or not. + */ + recurrence?: string; + + /**Binds the name of recurrenceRule field in dataSource. It indicates the recurrence pattern associated with appointments. + */ + recurrenceRule?: string; + + /**Binds the name of allDay field in dataSource. It indicates whether the appointment is an allday appointment or not. + * @Default {AllDay} + */ + allDay?: string; + + /**Default Value + * @Default {null} + */ + resourceFields?: string; + + /**Default Value + * @Default {null} + */ + categorize?: string; + + /**Default Value + * @Default {null} + */ + location?: string; + + /**Default Value + * @Default {null} + */ + priority?: string; + + /**Default Value + * @Default {StartTimeZone} + */ + startTimeZone?: string; + + /**Default Value + * @Default {EndTimeZone} + */ + endTimeZone?: string; +} + +export interface CategorizeSettings { + + /**Default Value + * @Default {false} + */ + allowMultiple?: boolean; + + /**Default Value + * @Default {false} + */ + enable?: boolean; + + /**Default Value + * @Default {Array} + */ + dataSource?: Array|any; + + /**Binds id field name in the dataSource to id of category data. + * @Default {id} + */ + id?: string; + + /**Binds text field name in the dataSource to category text. + * @Default {text} + */ + text?: string; + + /**Binds color field name in the dataSource to category color. + * @Default {color} + */ + color?: string; + + /**Binds fontColor field name in the dataSource to category font. + * @Default {fontColor} + */ + fontColor?: string; +} + +export interface ContextMenuSettings { + + /**When set to true, enables the context menu options available for the Schedule cells and appointments. + * @Default {false} + */ + enable?: boolean; + + /**Contains all the default context menu options that are applicable for both Schedule cells and appointments. It also supports adding custom menu items to cells or appointment collection. + * @Default {[]} + */ + menuItems?: any; +} + +export interface Group { + + /**Holds the array of resource names to be grouped on the Schedule. + */ + resources?: any; +} + +export interface WorkHours { + + /**When set to true, highlights the work hours of the Schedule. + * @Default {true} + */ + highlight?: boolean; + + /**Sets the start time to depict the start of working or business hour in a day. + * @Default {null} + */ + start?: number; + + /**Sets the end time to depict the end of working or business hour in a day. + * @Default {null} + */ + end?: number; +} + +export interface PrioritySettings { + + /**When set to true, enables the priority options available for the Schedule appointments. + * @Default {false} + */ + enable?: boolean; + + /**The dataSource option can accept the JSON object collection that contains the priority related data. + * @Default {Array} + */ + dataSource?: any|Array; + + /**Binds text field name in the dataSource to prioritySettings text. These text gets listed out in priority field of the appointment window. + * @Default {text} + */ + text?: string; + + /**Binds value field name in the dataSource to prioritySettings value. These field names usually accepts four priority values by default, high, low, medium and none. + * @Default {value} + */ + value?: string; + + /**Allows priority field customization in the appointment window to add custom icons denoting the priority level for the appointments. + * @Default {null} + */ + template?: string; +} + +export interface ReminderSettings { + + /**When set to true, enables the reminder option available for the Schedule appointments. + * @Default {false} + */ + enable?: boolean; + + /**Sets the timing, when the reminders are to be alerted for the Schedule appointments. + * @Default {5} + */ + alertBefore?: number; +} + +export interface RenderDates { + + /**Sets the start of custom date range to be rendered in the Schedule. + * @Default {null} + */ + start?: any; + + /**Sets the end limit of the custom date range. + * @Default {null} + */ + end?: any; +} + +export interface ResourcesResourceSettings { + + /**The dataSource option accepts either JSON object collection or DataManager (ej.DataManager) instance that contains the resources related data. + */ + dataSource?: any|Array; + + /**Binds text field name in the dataSource to resourceSettings text. These text gets listed out in resources field of the appointment window. + */ + text?: string; + + /**Binds id field name in the dataSource to resourceSettings id. + */ + id?: string; + + /**Binds groupId field name in the dataSource to resourceSettings groupId. + */ + groupId?: string; + + /**Binds color field name in the dataSource to resourceSettings color. The color specified here gets applied to the Schedule appointments denoting to the resource it belongs. + */ + color?: string; + + /**Binds the starting work hour field name in the dataSource. It's optional, but when provided with some numeric value will set the starting work hour for specific resources. + */ + start?: string; + + /**Binds the end work hour field name in the dataSource. It's optional, but when provided with some numeric value will set the end work hour for specific resources. + */ + end?: string; + + /**Binds the resources working days field name in the dataSource. It's optional, and accepts the array of strings (week day names). When provided with some values (array of day names), only those days will render for the specific resources. + */ + workWeek?: string; + + /**Binds appointmentClass field name in the dataSource. It applies custom CSS class name to appointments depicting to the resource it belongs. + */ + appointmentClass?: string; +} + +export interface Resources { + + /**It holds the name of the resource field to be bound to the Schedule appointments that contains the resource Id. + * @Default {[]} + */ + field?: string; + + /**It holds the title name of the resource field to be displayed on the Schedule appointment window. + * @Default {[]} + */ + title?: string; + + /**A unique resource name that is used for differentiating various resource objects while grouping it in various levels. + * @Default {[]} + */ + name?: string; + + /**When set to true, allows multiple selection of resource names, thus creating multiple instances of same appointment for the selected resources. + * @Default {[]} + */ + allowMultiple?: string; + + /**It holds the field names of the resources to be bound to the Schedule and also the dataSource. + */ + resourceSettings?: ResourcesResourceSettings; +} + +export interface TimeZoneCollection { + + /**Sets the collection of timezone items to the dataSource that accepts either JSON object collection or DataManager (ej.DataManager) instance that contains Schedule timezones. + */ + dataSource?: any; + + /**Binds text field name in the dataSource to timeZoneCollection text. These text gets listed out in the timezone fields of the appointment window. + */ + text?: string; + + /**Binds id field name in the dataSource to timeZoneCollection id. + */ + id?: string; + + /**Binds value field name in the dataSource to timeZoneCollection value. + */ + value?: string; +} + +export interface AgendaViewSettings { + + /**You can display the summary of multiple week's appointment by setting this value. + * @Default {7} + */ + daysInAgenda?: number; + + /**You can customize the Date column display based on the requirement. + * @Default {null} + */ + dateColumnTemplateId?: string; + + /**You can customize the time column display based on the requirement. + * @Default {null} + */ + timeColumnTemplateId?: string; +} + +export interface TooltipSettings { + + /**To enable or disable the tooltip display. + * @Default {false} + */ + enable?: boolean; + + /**To customize the tooltip display based on your requirements. + * @Default {null} + */ + templateId?: string; +} + +export interface TimeScale { + + /**When set to true, displays the timescale on the Scheduler. + * @Default {null} + */ + enable?: boolean; + + /**When set with some specific value, defines the number of time divisions split per hour(as per value given for the majorTimeSlot). Those time divisions are meant to be the minor slots. + * @Default {2} + */ + minorSlotCount?: number; + + /**Accepts the value in minutes. When provided with specific value, displays the appropriate time interval on the Scheduler + * @Default {60} + */ + majorSlot?: number; + + /**Accepts id value of the template defined for minor time slots + * @Default {null} + */ + minorSlotTemplateId?: string; + + /**Accepts id value of the template defined for major time slots. + * @Default {null} + */ + majorSlotTemplateId?: string; +} + +enum CurrentView{ + + ///Set currentView as Day to Scheduler + Day, + + ///Set currentView as Week to Scheduler + Week, + + ///Set currentView as Workweek to Scheduler + Workweek, + + ///Set currentView as Month to Scheduler + Month, + + ///Set currentView as Agenda to Scheduler + Agenda, + + ///Set currentView as CustomView to Scheduler + CustomView +} + + +enum Orientation{ + + ///Set orientation as vertical to Scheduler + Vertical, + + ///Set orientation as horizontal to Scheduler + Horizontal +} + + +enum TimeMode{ + + ///Set timeMode as 12 hours to Scheduler + Hour12, + + ///Set timeMode as 24 hours to Scheduler + Hour24 +} + +} + +class RecurrenceEditor extends ej.Widget { + static fn: RecurrenceEditor; + static Locale:any; + constructor(element: JQuery, options?: RecurrenceEditorOptions); + constructor(element: Element, options?: RecurrenceEditorOptions); + model:RecurrenceEditorOptions; + defaults:RecurrenceEditorOptions; + recurrenceDateGenerator(recurrenceString: string,strDate:Object): string; + closeRecurPublic(): string; + getRecurrenceRule(): void; + recurrenceRuleSplit(recurrenceRule: string, recurrenceExDate?: string): Object; + +} +interface RecurrenceEditorOptions { + frequencies?: Array; + firstDayOfWeek?: string; + name?: string; + enableSpinners?: boolean; + startDate?: Date; + locale?: string; + enableRTL?: boolean; + value?: string; + dateFormat?: string; + selectedRecurrenceType?: number; + enableRecurrenceValidation?: boolean; + minDate?: Date; + maxDate?: Date; + cssClass?: string; + change?(e: RecurrenceEditorChangeEvent): void; + create?(e: RecurrenceEditorBaseEvent): void; +} +interface RecurrenceEditorBaseEvent extends ej.BaseEvent { + model: RecurrenceEditorOptions; +} +interface RecurrenceEditorChangeEvent extends RecurrenceEditorBaseEvent { + requestType?: string; +} +class Gantt extends ej.Widget { + static fn: Gantt; + constructor(element: JQuery, options?: Gantt.Model); + constructor(element: Element, options?: Gantt.Model); + model:Gantt.Model; + defaults:Gantt.Model; + + /** To add item in gantt + * @param {any} Item to add in Gantt row. + * @param {string} Defines in which position the row wants to add + * @returns {void} + */ + addRecord(data: any, rowPosition: string): void; + + /** Positions the splitter by the specified column index. + * @param {number} Set the splitter position based on column index. + * @returns {void} + */ + setSplitterIndex(index: number): void; + + /** To cancel the edited state of an item in gantt + * @returns {void} + */ + cancelEdit(): void; + + /** To collapse all the parent items in gantt + * @returns {void} + */ + collapseAllItems(): void; + + /** To delete a selected item in gantt + * @returns {void} + */ + deleteItem(): void; + + /** destroy the gantt widget all events bound using this._on will be unbind automatically and bring the control to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** To Expand all the parent items in gantt + * @returns {void} + */ + expandAllItems(): void; + + /** To expand and collapse an item in gantt using item's ID + * @param {number} Exapnd or Collapse a record based on task id. + * @returns {void} + */ + expandCollapseRecord(taskId: number): void; + + /** To hide the column by using header text + * @param {string} you can pass a header text of a column to hide + * @returns {void} + */ + hideColumn(headerText: string): void; + + /** To indent a selected item in gantt + * @returns {void} + */ + indentItem(): void; + + /** To Open the dialog to add new task to the gantt + * @returns {void} + */ + openAddDialog(): void; + + /** To Open the dialog to edit existing task to the gantt + * @returns {void} + */ + openEditDialog(): void; + + /** To outdent a selected item in gantt + * @returns {void} + */ + outdentItem(): void; + + /** To save the edited state of an item in gantt + * @returns {void} + */ + saveEdit(): void; + + /** To search an item with search string provided at the run time + * @param {string} you can pass a text to search in Gantt Control. + * @returns {void} + */ + searchItem(searchString: string): void; + + /** To set the grid width in gantt + * @param {string} you can give either percentage or pixels value + * @returns {void} + */ + setSplitterPosition(width: string): void; + + /** To show the column by using header text + * @param {string} you can pass a header text of a column to show + * @returns {void} + */ + showColumn(headerText: string): void; +} +export module Gantt{ + +export interface Model { + + /**Specifies the fields to be included in the add dialog in gantt + * @Default {[]} + */ + addDialogFields?: Array; + + /**Enables or disables the ability to resize column. + * @Default {false} + */ + allowColumnResize?: boolean; + + /**Enables or Disables gantt chart editing in gantt + * @Default {true} + */ + allowGanttChartEditing?: boolean; + + /**Enables or Disables Keyboard navigation in gantt + * @Default {true} + */ + allowKeyboardNavigation?: boolean; + + /**Specifies enabling or disabling multiple sorting for Gantt columns + * @Default {false} + */ + allowMultiSorting?: boolean; + + /**Enables or disables the interactive selection of a row. + * @Default {true} + */ + allowSelection?: boolean; + + /**Enables or disables sorting. When enabled, we can sort the column by clicking on the column. + * @Default {false} + */ + allowSorting?: boolean; + + /**Enable or disable predecessor validation. When it is true, all the task's start and end dates are aligned based on its predecessors start and end dates. + * @Default {true} + */ + enablePredecessorValidation?: boolean; + + /**Specifies the baseline background color in gantt + * @Default {#fba41c} + */ + baselineColor?: string; + + /**Specifies the mapping property path for baseline end date in datasource + */ + baselineEndDateMapping?: string; + + /**Specifies the mapping property path for baseline start date of a task in datasource + */ + baselineStartDateMapping?: string; + + /**Specifies the mapping property path for sub tasks in datasource + */ + childMapping?: string; + + /**Specifies the background of connector lines in Gantt + */ + connectorLineBackground?: string; + + /**Specifies the width of the connector lines in gantt + * @Default {1} + */ + connectorlineWidth?: number; + + /**Specify the CSS class for gantt to achieve custom theme. + */ + cssClass?: string; + + /**Collection of data or hierarchical data to represent in gantt + * @Default {null} + */ + dataSource?: Array; + + /**Specifies the dateFormat for gantt , given format is displayed in tooltip , grid . + * @Default {MM/dd/yyyy} + */ + dateFormat?: string; + + /**Specifies the mapping property path for duration of a task in datasource + */ + durationMapping?: string; + + /**Specifies the duration unit for each tasks whether days or hours or minutes + * @Default {ej.Gantt.DurationUnit.Day} + */ + durationUnit?: ej.Gantt.DurationUnit|string; + + /**Specifies the fields to be included in the edit dialog in gantt + * @Default {[]} + */ + editDialogFields?: Array; + + /**Option to configure the splitter position. + */ + splitterSettings?: SplitterSettings; + + /**Specifies the editSettings options in gantt. + */ + editSettings?: EditSettings; + + /**Enables or Disables enableAltRow row effect in gantt + * @Default {true} + */ + enableAltRow?: boolean; + + /**Enables or disables the collapse all records when loading the gantt. + * @Default {false} + */ + enableCollapseAll?: boolean; + + /**Enables or disables the contextmenu for gantt , when enabled contextmenu appears on right clicking gantt + * @Default {false} + */ + enableContextMenu?: boolean; + + /**Indicates whether we can edit the progress of a task interactively in gantt chart. + * @Default {true} + */ + enableProgressBarResizing?: boolean; + + /**Enables or disables the option for dynamically updating the Gantt size on window resizing + * @Default {false} + */ + enableResize?: boolean; + + /**Enables or disables tooltip while editing (dragging/resizing) the taskbar. + * @Default {true} + */ + enableTaskbarDragTooltip?: boolean; + + /**Enables or disables tooltip for taskbar. + * @Default {true} + */ + enableTaskbarTooltip?: boolean; + + /**Enables/Disables virtualization for rendering gantt items. + * @Default {false} + */ + enableVirtualization?: boolean; + + /**Specifies the mapping property path for end Date of a task in datasource + */ + endDateMapping?: string; + + /**Specifies whether to highlight the weekends in gantt . + * @Default {true} + */ + highlightWeekends?: boolean; + + /**Collection of holidays with date, background and label information to be displayed in gantt. + * @Default {[]} + */ + holidays?: Array; + + /**Specifies whether to include weekends while calculating the duration of a task. + * @Default {true} + */ + includeWeekend?: boolean; + + /**Specify the locale for gantt + * @Default {en-US} + */ + locale?: string; + + /**Specifies the mapping property path for milestone in datasource + */ + milestoneMapping?: string; + + /**Specifies the background of parent progressbar in gantt + */ + parentProgressbarBackground?: string; + + /**Specifies the background of parent taskbar in gantt + */ + parentTaskbarBackground?: string; + + /**Specifies the mapping property path for parent task Id in self reference datasource + */ + parentTaskIdMapping?: string; + + /**Specifies the mapping property path for predecessors of a task in datasource + */ + predecessorMapping?: string; + + /**Specifies the background of progressbar in gantt + */ + progressbarBackground?: string; + + /**Specified the height of the progressbar in taskbar + * @Default {100} + */ + progressbarHeight?: number; + + /**Specifies the template for tooltip on resizing progressbar + * @Default {null} + */ + progressbarTooltipTemplate?: string; + + /**Specifies the template ID for customized tooltip for progressbar editing in gantt + * @Default {null} + */ + progressbarTooltipTemplateId?: string; + + /**Specifies the mapping property path for progress percentage of a task in datasource + */ + progressMapping?: string; + + /**It receives query to retrieve data from the table (query is same as SQL). + * @Default {null} + */ + query?: any; + + /**Enables or Disables rendering baselines in Gantt , when enabled baseline is rendered in gantt + * @Default {false} + */ + renderBaseline?: boolean; + + /**Specifies the mapping property name for resource ID in resource Collection in gantt + */ + resourceIdMapping?: string; + + /**Specifies the mapping property path for resources of a task in datasource + */ + resourceInfoMapping?: string; + + /**Specifies the mapping property path for resource name of a task in gantt + */ + resourceNameMapping?: string; + + /**Collection of data regarding resources involved in entire project + * @Default {[]} + */ + resources?: Array; + + /**Specifies whether rounding off the day working time edits + * @Default {true} + */ + roundOffDayworkingTime?: boolean; + + /**Specifies the height of a single row in gantt. Also, we need to set same height in the CSS style with class name e-rowcell. + * @Default {30} + */ + rowHeight?: number; + + /**Specifies end date of the gantt schedule. By default, end date will be rounded to its next Saturday. + * @Default {null} + */ + scheduleEndDate?: string; + + /**Specifies the options for customizing schedule header. + */ + scheduleHeaderSettings?: ScheduleHeaderSettings; + + /**Specifies start date of the gantt schedule. By default, start date will be rounded to its previous Sunday. + * @Default {null} + */ + scheduleStartDate?: string; + + /**Specifies the selected row index in gantt + * @Default {null} + */ + selectedItem?: number; + + /**Specifies the selected row Index in gantt , the row with given index will highlighted + * @Default {-1} + */ + selectedRowIndex?: number; + + /**Enables or disables the column chooser. + * @Default {false} + */ + showColumnChooser?: boolean; + + /**Specifies whether to show grid cell tooltip. + * @Default {true} + */ + showGridCellTooltip?: boolean; + + /**Specifies whether to show grid cell tooltip over expander cell alone. + * @Default {true} + */ + showGridExpandCellTooltip?: boolean; + + /**Specifies whether display task progress inside taskbar. + * @Default {true} + */ + showProgressStatus?: boolean; + + /**Specifies whether to display resource names for a task beside taskbar. + * @Default {true} + */ + showResourceNames?: boolean; + + /**Specifies whether to display task name beside task bar. + * @Default {true} + */ + showTaskNames?: boolean; + + /**Specifies the size option of gantt control. + */ + sizeSettings?: SizeSettings; + + /**Specifies the sorting options for gantt. + */ + sortSettings?: SortSettings; + + /**Specifies splitter position in gantt. + * @Default {null} + */ + splitterPosition?: string; + + /**Specifies the mapping property path for start date of a task in datasource + */ + startDateMapping?: string; + + /**Specifies the options for striplines + * @Default {[]} + */ + stripLines?: Array; + + /**Specifies the background of the taskbar in gantt + */ + taskbarBackground?: string; + + /**Specifies the template script for customized tooltip for taskbar editing in gantt + */ + taskbarEditingTooltipTemplate?: string; + + /**Specifies the template Id for customized tooltip for taskbar editing in gantt + */ + taskbarEditingTooltipTemplateId?: string; + + /**Specifies the template for tooltip on mouse action on taskbars + */ + taskbarTooltipTemplate?: string; + + /**Specifies the template id for tooltip on mouse action on taskbars + */ + taskbarTooltipTemplateId?: string; + + /**Specifies the mapping property path for task Id in datasource + */ + taskIdMapping?: string; + + /**Specifies the mapping property path for task name in datasource + */ + taskNameMapping?: string; + + /**Specifies the toolbarSettings options. + */ + toolbarSettings?: ToolbarSettings; + + /**Specifies the tree expander column in gantt + * @Default {0} + */ + treeColumnIndex?: number; + + /**Specifies the weekendBackground color in gantt + * @Default {#F2F2F2} + */ + weekendBackground?: string; + + /**Specifies the working time schedule of day + * @Default {ej.Gantt.workingTimeScale.TimeScale8Hours} + */ + workingTimeScale?: ej.Gantt.workingTimeScale|string; + + /**Triggered for every gantt action before its starts.*/ + actionBegin? (e: ActionBeginEventArgs): void; + + /**Triggered for every gantt action success event.*/ + actionComplete? (e: ActionCompleteEventArgs): void; + + /**Triggered while enter the edit mode in the tree grid cell*/ + beginEdit? (e: BeginEditEventArgs): void; + + /**Triggered after collapsed the gantt record*/ + collapsed? (e: CollapsedEventArgs): void; + + /**Triggered while collapsing the gantt record*/ + collapsing? (e: CollapsingEventArgs): void; + + /**Triggered while Context Menu is rendered in Gantt control*/ + contextMenuOpen? (e: ContextMenuOpenEventArgs): void; + + /**Triggered after save the modified cellValue in gantt.*/ + endEdit? (e: EndEditEventArgs): void; + + /**Triggered after expand the record*/ + expanded? (e: ExpandedEventArgs): void; + + /**Triggered while expanding the gantt record*/ + expanding? (e: ExpandingEventArgs): void; + + /**Triggered while gantt is loaded*/ + load? (e: LoadEventArgs): void; + + /**Triggered while rendering each cell in the tree grid*/ + queryCellInfo? (e: QueryCellInfoEventArgs): void; + + /**Triggered while rendering each taskbar in the gantt chart*/ + queryTaskbarInfo? (e: QueryTaskbarInfoEventArgs): void; + + /**Triggered while rendering each row*/ + rowDataBound? (e: RowDataBoundEventArgs): void; + + /**Triggered after the row is selected.*/ + rowSelected? (e: RowSelectedEventArgs): void; + + /**Triggered before the row is going to be selected.*/ + rowSelecting? (e: RowSelectingEventArgs): void; + + /**Triggered after completing the editing operation in taskbar*/ + taskbarEdited? (e: TaskbarEditedEventArgs): void; + + /**Triggered while editing the gantt chart (dragging, resizing the taskbar )*/ + taskbarEditing? (e: TaskbarEditingEventArgs): void; + + /**Triggered when toolbar item is clicked in Gantt.*/ + toolbarClick? (e: ToolbarClickEventArgs): void; +} + +export interface ActionBeginEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the current grouped column field name. + */ + columnName?: string; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the direction of sorting ascending or descending + */ + columnSortDirection?: string; + + /**Returns the value of searching element. + */ + keyValue?: string; + + /**Returns the data of deleting element. + */ + data?: string; + + /**Returns selected record index + */ + recordIndex?: number; +} + +export interface ActionCompleteEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the current grouped column field name. + */ + columnName?: string; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the direction of sorting ascending or descending + */ + columnSortDirection?: string; + + /**Returns the value of searched element. + */ + keyValue?: string; + + /**Returns the data of deleted element. + */ + data?: string; + + /**Returns selected record index + */ + recordIndex?: number; +} + +export interface BeginEditEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row element of editing cell. + */ + rowElement?: any; + + /**Returns the Element of editing cell. + */ + cellElement?: any; + + /**Returns the data of current cell record. + */ + data?: any; + + /**Returns the column Index of cell belongs. + */ + columnIndex?: number; +} + +export interface CollapsedEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row index of collapsed record. + */ + recordIndex?: number; + + /**Returns the data of collapsed record. + */ + data?: any; + + /**Returns Request Type. + */ + requestType?: string; + + /**Returns state of a record whether it is in expanded or collapsed state. + */ + expanded?: boolean; +} + +export interface CollapsingEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row index of collapsing record. + */ + recordIndex?: number; + + /**Returns the data of edited cell record.. + */ + data?: any; + + /**Returns state of a record whether it is in expanded or collapsed state. + */ + expanded?: boolean; +} + +export interface ContextMenuOpenEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the default context menu items to which we add custom items. + */ + contextMenuItems?: Array; + + /**Returns the gantt model. + */ + model?: any; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface EndEditEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row element of editing cell. + */ + rowElement?: any; + + /**Returns the Element of editing cell. + */ + cellElement?: any; + + /**Returns the data of edited cell record. + */ + data?: any; + + /**Returns the column name of edited cell belongs. + */ + columnName?: string; + + /**Returns the column object of edited cell belongs. + */ + columnObject?: any; +} + +export interface ExpandedEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row index of record. + */ + recordIndex?: number; + + /**Returns the data of expanded record. + */ + data?: any; + + /**Returns Request Type. + */ + requestType?: string; + + /**Returns state of a record whether it is in expanded or collapsed state. + */ + expanded?: boolean; +} + +export interface ExpandingEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row index of record. + */ + recordIndex?: any; + + /**Returns the data of edited cell record.. + */ + data?: any; + + /**Returns state of a record whether it is in expanded or collapsed state. + */ + expanded?: boolean; +} + +export interface LoadEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the gantt model + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface QueryCellInfoEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the selecting cell element. + */ + cellElement?: any; + + /**Returns the value of cell. + */ + cellValue?: string; + + /**Returns the data of current cell record. + */ + data?: any; + + /**Returns the column of cell belongs. + */ + column?: any; +} + +export interface QueryTaskbarInfoEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the taskbar background of current item. + */ + TaskbarBackground?: string; + + /**Returns the progressbar background of current item. + */ + ProgressbarBackground?: string; + + /**Returns the parent taskbar background of current item. + */ + parentTaskbarBackground?: string; + + /**Returns the parent progressbar background of current item. + */ + parentProgressbarBackground?: string; + + /**Returns the data of the record. + */ + data?: any; +} + +export interface RowDataBoundEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row element of rendering row. + */ + rowElement?: any; + + /**Returns the data of rendering row record.. + */ + data?: any; +} + +export interface RowSelectedEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the selecting row element. + */ + targetRow?: any; + + /**Returns the index of selecting row record. + */ + recordIndex?: number; + + /**Returns the data of selected record. + */ + data?: any; +} + +export interface RowSelectingEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the data selecting record. + */ + data?: any; + + /**Returns the index of selecting row record. + */ + recordIndex?: string; + + /**Returns the selecting row chart element. + */ + targetChartRow?: any; + + /**Returns the selecting row grid element. + */ + targetGridRow?: any; + + /**Returns the previous selected data. + */ + previousData?: any; + + /**Returns the previous selected row index. + */ + previousIndex?: string; + + /**Returns the previous selected row chart element. + */ + previousChartRow?: any; + + /**Returns the previous selected row grid element. + */ + previousGridRow?: any; +} + +export interface TaskbarEditedEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the data of edited record. + */ + data?: any; + + /**Returns the previous data value of edited record. + */ + previousData?: any; + + /**Returns 'true' if taskbar is dragged. + */ + dragging?: boolean; + + /**Returns 'true' if taskbar is left resized. + */ + leftResizing?: boolean; + + /**Returns 'true' if taskbar is right resized. + */ + rightResizing?: boolean; + + /**Returns 'true' if taskbar is progress resized. + */ + progressResizing?: boolean; + + /**Returns the field values of record being edited. + */ + editingFields?: any; + + /**Returns the gantt model. + */ + model?: any; +} + +export interface TaskbarEditingEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the gantt model. + */ + model?: any; + + /**Returns the row object being edited. + */ + rowData?: any; + + /**Returns the field values of record being edited. + */ + editingFields?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface ToolbarClickEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the current item. + */ + currentTarget?: any; + + /**Returns the Gantt model. + */ + model?: any; + + /**Returns the name of the toolbar item on which mouse click has been performed + */ + itemName?: string; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface SplitterSettings { + + /**Specifies position of the splitter in Gantt , splitter can be placed either based on percentage values or pixel values. + */ + position?: string; + + /**Specifies the position of splitter in Gantt, based on column index in Gantt. + */ + index?: string; +} + +export interface EditSettings { + + /**Enables or disables add record icon in gantt toolbar + * @Default {false} + */ + allowAdding?: boolean; + + /**Enables or disables delete icon in gantt toolbar + * @Default {false} + */ + allowDeleting?: boolean; + + /**Specifies the option for enabling or disabling editing in Gantt grid part + * @Default {false} + */ + allowEditing?: boolean; + + /**Specifies the edit mode in Gantt, "normal" is for dialog editing ,"cellEditing" is for cell type editing + * @Default {normal} + */ + editMode?: string; +} + +export interface ScheduleHeaderSettings { + + /**Specified the format for day view in schedule header + * @Default {ddd} + */ + dayHeaderFormat?: string; + + /**Specified the format for Hour view in schedule header + * @Default {HH} + */ + hourHeaderFormat?: string; + + /**Specifies the number of minutes per interval + * @Default {ej.Gantt.minutesPerInterval.Auto} + */ + minutesPerInterval?: ej.Gantt.minutesPerInterval|string; + + /**Specified the format for month view in schedule header + * @Default {MMM} + */ + monthHeaderFormat?: string; + + /**Specifies the schedule mode + * @Default {ej.Gantt.ScheduleHeaderType.Week} + */ + scheduleHeaderType?: ej.Gantt.ScheduleHeaderType|string; + + /**Specified the background for weekends in gantt + * @Default {#F2F2F2} + */ + weekendBackground?: string; + + /**Specified the format for week view in schedule header + * @Default {ddd} + */ + weekHeaderFormat?: string; + + /**Specified the format for year view in schedule header + * @Default {yyyy} + */ + yearHeaderFormat?: string; +} + +export interface SizeSettings { + + /**Specifies the height of gantt control + * @Default {450px} + */ + height?: string; + + /**Specifies the width of gantt control + * @Default {1000px} + */ + width?: string; +} + +export interface SortSettings { + + /**Specifies the sorted columns for gantt + * @Default {[]} + */ + sortedColumns?: Array; +} + +export interface ToolbarSettings { + + /**Specifies the state of enabling or disabling toolbar + * @Default {true} + */ + showToolBar?: boolean; + + /**Specifies the list of toolbar items to rendered in toolbar + * @Default {[]} + */ + toolbarItems?: Array; +} + +enum DurationUnit{ + + ///Sets the Duration Unit as day. + Day, + + ///Sets the Duration Unit as hour. + Hour, + + ///Sets the Duration Unit as minute. + Minute +} + + +enum minutesPerInterval{ + + ///Sets the interval automatically according with schedule start and end date. + Auto, + + ///Sets one minute intervals per hour. + OneMinute, + + ///Sets Five minute intervals per hour. + FiveMinutes, + + ///Sets fifteen minute intervals per hour. + FifteenMinutes, + + ///Sets thirty minute intervals per hour. + ThirtyMinutes +} + + +enum ScheduleHeaderType{ + + ///Sets year Schedule Mode. + Year, + + ///Sets month Schedule Mode. + Month, + + ///Sets week Schedule Mode. + Week, + + ///Sets day Schedule Mode. + Day, + + ///Sets hour Schedule Mode. + Hour +} + + +enum workingTimeScale{ + + ///Sets eight hour timescale. + TimeScale8Hours, + + ///Sets twenty four hour timescale. + TimeScale24Hours +} + +} + +class ReportViewer extends ej.Widget { + static fn: ReportViewer; + constructor(element: JQuery, options?: ReportViewer.Model); + constructor(element: Element, options?: ReportViewer.Model); + model:ReportViewer.Model; + defaults:ReportViewer.Model; + + /** Export the report to the specified format. + * @returns {void} + */ + exportReport(): void; + + /** Fit the report page to the container. + * @returns {void} + */ + fitToPage(): void; + + /** Fit the report page height to the container. + * @returns {void} + */ + fitToPageHeight(): void; + + /** Fit the report page width to the container. + * @returns {void} + */ + fitToPageWidth(): void; + + /** Get the available datasets name of the rdlc report. + * @returns {void} + */ + getDataSetNames(): void; + + /** Get the available parameters of the report. + * @returns {void} + */ + getParameters(): void; + + /** Navigate to first page of report. + * @returns {void} + */ + gotoFirstPage(): void; + + /** Navigate to last page of the report. + * @returns {void} + */ + gotoLastPage(): void; + + /** Navigate to next page from the current page. + * @returns {void} + */ + gotoNextPage(): void; + + /** Go to specific page index of the report. + * @returns {void} + */ + gotoPageIndex(): void; + + /** Navigate to previous page from the current page. + * @returns {void} + */ + gotoPreviousPage(): void; + + /** Print the report. + * @returns {void} + */ + print(): void; + + /** Apply print layout to the report. + * @returns {void} + */ + printLayout(): void; + + /** Refresh the report. + * @returns {void} + */ + refresh(): void; +} +export module ReportViewer{ + +export interface Model { + + /**Gets or sets the list of data sources for the RDLC report. + * @Default {[]} + */ + dataSources?: Array; + + /**Enables or disables the page cache of report. + * @Default {false} + */ + enablePageCache?: boolean; + + /**Specifies the export settings. + */ + exportSettings?: ExportSettings; + + /**When set to true, adapts the report layout to fit the screen size of devices on which it renders. + * @Default {true} + */ + isResponsive?: boolean; + + /**Specifies the locale for report viewer. + * @Default {en-US} + */ + locale?: string; + + /**Specifies the page settings. + */ + pageSettings?: PageSettings; + + /**Gets or sets the list of parameters associated with the report. + * @Default {[]} + */ + parameters?: Array; + + /**Enables and disables the print mode. + * @Default {false} + */ + printMode?: boolean; + + /**Specifies the print option of the report. + * @Default {ej.ReportViewer.PrintOptions.Default} + */ + printOptions?: ej.ReportViewer.PrintOptions|string; + + /**Specifies the processing mode of the report. + * @Default {ej.ReportViewer.ProcessingMode.Remote} + */ + processingMode?: ej.ReportViewer.ProcessingMode|string; + + /**Specifies the render layout. + * @Default {ej.ReportViewer.RenderMode.Default} + */ + renderMode?: ej.ReportViewer.RenderMode|string; + + /**Gets or sets the path of the report file. + * @Default {empty} + */ + reportPath?: string; + + /**Gets or sets the reports server url. + * @Default {empty} + */ + reportServerUrl?: string; + + /**Specifies the report Web API service url. + * @Default {empty} + */ + reportServiceUrl?: string; + + /**Specifies the toolbar settings. + */ + toolbarSettings?: ToolbarSettings; + + /**Gets or sets the zoom factor for report viewer. + * @Default {1} + */ + zoomFactor?: number; + + /**Fires when the report viewer is destroyed successfully.If you want to perform any operation after destroying the reportviewer control,you can make use of the destroy event.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires during drill through action done in report.If you want to perform any operation when a drill through action is performed, you can make use of the drillThrough event.*/ + drillThrough? (e: DrillThroughEventArgs): void; + + /**Fires before report rendering is completed.If you want to perform any operation before the rendering of report,you can make use of the renderingBegin event.*/ + renderingBegin? (e: RenderingBeginEventArgs): void; + + /**Fires after report rendering completed.If you want to perform any operation after the rendering of report,you can make use of this renderingComplete event.*/ + renderingComplete? (e: RenderingCompleteEventArgs): void; + + /**Fires when any error occurred while rendering the report.If you want to perform any operation when an error occurs in the report, you can make use of the reportError event.*/ + reportError? (e: ReportErrorEventArgs): void; + + /**Fires when the report is being exported.If you want to perform any operation before exporting of report, you can make use of the reportExport event.*/ + reportExport? (e: ReportExportEventArgs): void; + + /**Fires when the report is loaded.If you want to perform any operation after the successful loading of report, you can make use of the reportLoaded event.*/ + reportLoaded? (e: ReportLoadedEventArgs): void; + + /**Fires when click the View Report Button.*/ + viewReportClick? (e: ViewReportClickEventArgs): void; +} + +export interface DestroyEventArgs { + + /**true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the report model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface DrillThroughEventArgs { + + /**true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the actionInfo's parameters bookmarkLink, hyperLink, reportName, parameters. + */ + actionInfo?: any; + + /**returns the report model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RenderingBeginEventArgs { + + /**true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the report model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RenderingCompleteEventArgs { + + /**true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the report model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns the collection of parameters. + */ + reportParameters?: any; +} + +export interface ReportErrorEventArgs { + + /**true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the error details. + */ + error?: string; + + /**returns the report model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface ReportExportEventArgs { + + /**true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the report model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface ReportLoadedEventArgs { + + /**true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the report model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface ViewReportClickEventArgs { + + /**true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the parameter collection. + */ + parameters?: any; + + /**returns the report model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface DataSources { + + /**Gets or sets the name of the data source. + * @Default {empty} + */ + name?: string; + + /**Gets or sets the values of data source. + * @Default {[]} + */ + values?: Array; +} + +export interface ExportSettings { + + /**Specifies the export formats. + * @Default {ej.ReportViewer.ExportOptions.All} + */ + exportOptions?: ej.ReportViewer.ExportOptions|string; + + /**Specifies the excel export format. + * @Default {ej.ReportViewer.ExcelFormats.Excel97to2003} + */ + excelFormat?: ej.ReportViewer.ExcelFormats|string; + + /**Specifies the word export format. + * @Default {ej.ReportViewer.WordFormats.Doc} + */ + wordFormat?: ej.ReportViewer.WordFormats|string; +} + +export interface PageSettings { + + /**Specifies the print layout orientation. + * @Default {null} + */ + orientation?: ej.ReportViewer.Orientation|string; + + /**Specifies the paper size of print layout. + * @Default {null} + */ + paperSize?: ej.ReportViewer.PaperSize|string; +} + +export interface Parameters { + + /**Gets or sets the parameter labels. + * @Default {null} + */ + labels?: Array; + + /**Gets or sets the name of the parameter. + * @Default {empty} + */ + name?: string; + + /**Gets or sets whether the parameter allows nullable value or not. + * @Default {false} + */ + nullable?: boolean; + + /**Gets or sets the prompt message associated with the specified parameter. + * @Default {empty} + */ + prompt?: string; + + /**Gets or sets the parameter values. + * @Default {[]} + */ + values?: Array; +} + +export interface ToolbarSettings { + + /**Fires when user click on toolbar item in the toolbar. + * @Default {empty} + */ + click?: string; + + /**Specifies the toolbar items. + * @Default {ej.ReportViewer.ToolbarItems.All} + */ + items?: ej.ReportViewer.ToolbarItems|string; + + /**Shows or hides the toolbar. + * @Default {true} + */ + showToolbar?: boolean; + + /**Shows or hides the tooltip of toolbar items. + * @Default {true} + */ + showTooltip?: boolean; + + /**Specifies the toolbar template ID. + * @Default {empty} + */ + templateId?: string; +} + +enum ExportOptions{ + + ///Specifies the All property in ExportOptions to get all availble options. + All, + + ///Specifies the Pdf property in ExportOptions to get Pdf option. + Pdf, + + ///Specifies the Word property in ExportOptions to get Word option. + Word, + + ///Specifies the Excel property in ExportOptions to get Excel option. + Excel, + + ///Specifies the Html property in ExportOptions to get Html option. + Html +} + + +enum ExcelFormats{ + + ///Specifies the Excel97to2003 property in ExcelFormats to get specified version of exported format. + Excel97to2003, + + ///Specifies the Excel2007 property in ExcelFormats to get specified version of exported format. + Excel2007, + + ///Specifies the Excel2010 property in ExcelFormats to get specified version of exported format. + Excel2010, + + ///Specifies the Excel2013 property in ExcelFormats to get specified version of exported format. + Excel2013 +} + + +enum WordFormats{ + + ///Specifies the Doc property in WordFormats to get specified version of exported format. + Doc, + + ///Specifies the Dot property in WordFormats to get specified version of exported format. + Dot, + + ///Specifies the Docx property in WordFormats to get specified version of exported format. + Docx, + + ///Specifies the Word2007 property in WordFormats to get specified version of exported format. + Word2007, + + ///Specifies the Word2010 property in WordFormats to get specified version of exported format. + Word2010, + + ///Specifies the Word2013 property in WordFormats to get specified version of exported format. + Word2013, + + ///Specifies the Word2007Dotx property in WordFormats to get specified version of exported format. + Word2007Dotx, + + ///Specifies the Word2010Dotx property in WordFormats to get specified version of exported format. + Word2010Dotx, + + ///Specifies the Word2013Dotx property in WordFormats to get specified version of exported format. + Word2013Dotx, + + ///Specifies the Word2007Docm property in WordFormats to get specified version of exported format. + Word2007Docm, + + ///Specifies the Word2010Docm property in WordFormats to get specified version of exported format. + Word2010Docm, + + ///Specifies the Word2013Docm property in WordFormats to get specified version of exported format. + Word2013Docm, + + ///Specifies the Word2007Dotm property in WordFormats to get specified version of exported format. + Word2007Dotm, + + ///Specifies the Word2010Dotm property in WordFormats to get specified version of exported format. + Word2010Dotm, + + ///Specifies the Word2013Dotm property in WordFormats to get specified version of exported format. + Word2013Dotm, + + ///Specifies the Rtf property in WordFormats to get specified version of exported format. + Rtf, + + ///Specifies the Txt property in WordFormats to get specified version of exported format. + Txt, + + ///Specifies the EPub property in WordFormats to get specified version of exported format. + EPub, + + ///Specifies the Html property in WordFormats to get specified version of exported format. + Html, + + ///Specifies the Xml property in WordFormats to get specified version of exported format. + Xml, + + ///Specifies the Automatic property in WordFormats to get specified version of exported format. + Automatic +} + + +enum Orientation{ + + ///Specifies the Landscape property in pageSettings.orientation to get specified layout. + Landscape, + + ///Specifies the portrait property in pageSettings.orientation to get specified layout. + Portrait +} + + +enum PaperSize{ + + ///Specifies the A3 as value in pageSettings.paperSize to get specified size. + A3, + + ///Specifies the A4 as value in pageSettings.paperSize to get specified size. + Portrait, + + ///Specifies the B4(JIS) as value in pageSettings.paperSize to get specified size. + B4_JIS, + + ///Specifies the B5(JIS) as value in pageSettings.paperSize to get specified size. + B5_JIS, + + ///Specifies the Envelope #10 as value in pageSettings.paperSize to get specified size. + Envelope_10, + + ///Specifies the Envelope as value in pageSettings.paperSize to get specified size. + Envelope_Monarch, + + ///Specifies the Executive as value in pageSettings.paperSize to get specified size. + Executive, + + ///Specifies the Legal as value in pageSettings.paperSize to get specified size. + Legal, + + ///Specifies the Letter as value in pageSettings.paperSize to get specified size. + Letter, + + ///Specifies the Tabloid as value in pageSettings.paperSize to get specified size. + Tabloid, + + ///Specifies the Custom as value in pageSettings.paperSize to get specified size. + Custom +} + + +enum PrintOptions{ + + ///Specifies the Default property in printOptions. + Default, + + ///Specifies the NewTab property in printOptions. + NewTab, + + ///Specifies the None property in printOptions. + None +} + + +enum ProcessingMode{ + + ///Specifies the Remote property in processingMode. + Remote, + + ///Specifies the Local property in processingMode. + Local +} + + +enum RenderMode{ + + ///Specifies the Default property in RenderMode to get default output. + Default, + + ///Specifies the Mobile property in RenderMode to get specified output. + Mobile, + + ///Specifies the Desktop property in RenderMode to get specified output. + Desktop +} + + +enum ToolbarItems{ + + ///Specifies the Print as value in ToolbarItems to get specified item. + Print, + + ///Specifies the Refresh as value in ToolbarItems to get specified item. + Refresh, + + ///Specifies the Zoom as value in ToolbarItems to get specified item. + Zoom, + + ///Specifies the FittoPage as value in ToolbarItems to get specified item. + FittoPage, + + ///Specifies the Export as value in ToolbarItems to get specified item. + Export, + + ///Specifies the PageNavigation as value in ToolbarItems to get specified item. + PageNavigation, + + ///Specifies the Parameters as value in ToolbarItems to get specified item. + Parameters, + + ///Specifies the PrintLayout as value in ToolbarItems to get specified item. + PrintLayout, + + ///Specifies the PageSetup as value in ToolbarItems to get specified item. + PageSetup +} + +} + +class TreeGrid extends ej.Widget { + static fn: TreeGrid; + constructor(element: JQuery, options?: TreeGrid.Model); + constructor(element: Element, options?: TreeGrid.Model); + model:TreeGrid.Model; + defaults:TreeGrid.Model; + + /** To clear all the selection in TreeGrid + * @param {number} you can pass a row index to clear the row selection. + * @returns {void} + */ + clearSelection(index: number): void; + + /** To collapse all the parent items in tree grid + * @returns {void} + */ + collapseAll(): void; + + /** To hide the column by using header text + * @param {string} you can pass a header text of a column to hide. + * @returns {void} + */ + hideColumn(headerText: string): void; + + /** To refresh the changes in tree grid + * @param {Array} Pass which data source you want to show in tree grid + * @param {any} Pass which data you want to show in tree grid + * @returns {void} + */ + refresh(dataSource: Array, query: any): void; + + /** Freeze all the columns preceding to the column specified by the field name. + * @param {string} Freeze all Columns before this field column. + * @returns {void} + */ + freezePrecedingColumns (field: string): void; + + /** Freeze/unfreeze the specified column. + * @param {string} Freeze/Unfreeze this field column. + * @param {boolean} Decides to Freeze/Unfreeze this field column. + * @returns {void} + */ + freezeColumn (field: string, isFrozen: boolean): void; + + /** To save the edited cell in TreeGrid + * @returns {void} + */ + saveCell(): void; + + /** To search an item with search string provided at the run time + * @param {string} you can pass a searchString to search the tree grid + * @returns {void} + */ + search(searchString: string): void; + + /** To show the column by using header text + * @param {string} you can pass a header text of a column to show. + * @returns {void} + */ + showColumn(headerText: string): void; + + /** To sorting the data based on the particular fields + * @param {string} you can pass a name of column to sort. + * @param {string} you can pass a sort direction to sort the column. + * @returns {void} + */ + sortColumn(columnName: string, columnSortDirection: string): void; +} +export module TreeGrid{ + +export interface Model { + + /**Enables or disables the ability to resize the column width interactively. + * @Default {false} + */ + allowColumnResize?: boolean; + + /**Enables or disables the ability to drag and drop the row interactively to reorder the rows. + * @Default {false} + */ + allowDragAndDrop?: boolean; + + /**Enables or disables the ability to filter the data on all the columns. Enabling this property will display a row with editor controls corresponding to each column. You can restrict filtering on particular column by disabling this property directly on that column instance itself. + * @Default {false} + */ + allowFiltering?: boolean; + + /**Enables or disables keyboard navigation. + * @Default {true} + */ + allowKeyboardNavigation?: boolean; + + /**Enables or disables the ability to sort the rows based on multiple columns/fields by clicking on each column header. Rows will be sorted recursively on clicking the column headers. + * @Default {false} + */ + allowMultiSorting?: boolean; + + /**Enables or disables the ability to select a row interactively. + * @Default {true} + */ + allowSelection?: boolean; + + /**Enables or disables the ability to sort the rows based on a single field/column by clicking on that column header. When enabled, rows can be sorted only by single field/column. + * @Default {false} + */ + allowSorting?: boolean; + + /**Specifies the id of the template that has to be applied for alternate rows. + */ + altRowTemplateID?: string; + + /**Specifies the mapping property path for sub tasks in datasource + */ + childMapping?: string; + + /**Option for adding columns; each column has the option to bind to a field in the dataSource. + */ + columns?: Array; + + /**Options for displaying and customizing context menu items. + */ + contextMenuSettings?: ContextMenuSettings; + + /**Specifies hierarchical or self-referential data to populate the TreeGrid. + * @Default {null} + */ + dataSource?: Array; + + /**Specifies whether to wrap the header text when it is overflown i.e., when it exceeds the header width. + * @Default {none} + */ + headerTextOverflow?: string; + + /**Options for displaying and customizing the tooltip. This tooltip will show the preview of the row that is being dragged. + */ + dragTooltip?: DragTooltip; + + /**Options for enabling and configuring the editing related operations. + */ + editSettings?: EditSettings; + + /**Specifies whether to render alternate rows in different background colors. + * @Default {true} + */ + enableAltRow?: boolean; + + /**Specifies whether to load all the rows in collapsed state when the TreeGrid is rendered for the first time. + * @Default {false} + */ + enableCollapseAll?: boolean; + + /**Specifies whether to resize TreeGrid whenever window size changes. + * @Default {false} + */ + enableResize?: boolean; + + /**Specifies whether to render only the visual elements that are visible in the UI. When you enable this property, it will reduce the loading time for loading large number of records. + * @Default {false} + */ + enableVirtualization?: boolean; + + /**Specifies if the filtering should happen immediately on each key press or only on pressing enter key. + * @Default {immediate} + */ + filterBarMode?: string; + + /**Specifies the name of the field in the dataSource, which contains the id of that row. + */ + idMapping?: string; + + /**Specifies the name of the field in the dataSource, which contains the parent’s id. This is necessary to form a parent-child hierarchy, if the dataSource contains self-referential data. + */ + parentIdMapping?: string; + + /**Specifies ej.Query to select data from the dataSource. This property is applicable only when the dataSource is ej.DataManager. + * @Default {null} + */ + query?: any; + + /**Specifies the height of a single row in tree grid. Also, we need to set same height in the CSS style with class name e-rowcell. + * @Default {30} + */ + rowHeight?: number; + + /**Specifies the id of the template to be applied for all the rows. + */ + rowTemplateID?: string; + + /**Specifies the index of the selected row. + * @Default {-1} + */ + selectedRowIndex?: number; + + /**Specifies the type of selection whether to select single row or multiple rows. + * @Default {ej.TreeGrid.SelectionType.Single} + */ + selectionType?: ej.Gantt.SelectionType|string; + + /**Controls the visibility of the menu button, which is displayed on the column header. Clicking on this button will show a popup menu. When you choose “Columns” item from this popup, a list box with column names will be shown, from which you can select/deselect a column name to control the visibility of the respective columns. + * @Default {false} + */ + showColumnChooser?: boolean; + + /**Specifies whether to show tooltip when mouse is hovered on the cell. + * @Default {true} + */ + showGridCellTooltip?: boolean; + + /**Specifies whether to show tooltip for the cells, which has expander button. + * @Default {true} + */ + showGridExpandCellTooltip?: boolean; + + /**Options for setting width and height for TreeGrid. + */ + sizeSettings?: SizeSettings; + + /**Options for sorting the rows. + */ + sortSettings?: SortSettings; + + /**Options for displaying and customizing the toolbar items. + */ + toolbarSettings?: ToolbarSettings; + + /**Specifies the index of the column that needs to have the expander button. By default, cells in the first column contain the expander button. + * @Default {0} + */ + treeColumnIndex?: number; + + /**Triggered before every success event of TreeGrid action.*/ + actionBegin? (e: ActionBeginEventArgs): void; + + /**Triggered for every TreeGrid action success event.*/ + actionComplete? (e: ActionCompleteEventArgs): void; + + /**Triggered while enter the edit mode in the TreeGrid cell*/ + beginEdit? (e: BeginEditEventArgs): void; + + /**Triggered after collapsed the TreeGrid record*/ + collapsed? (e: CollapsedEventArgs): void; + + /**Triggered while collapsing the TreeGrid record*/ + collapsing? (e: CollapsingEventArgs): void; + + /**Triggered while Context Menu is rendered in TreeGrid control*/ + contextMenuOpen? (e: ContextMenuOpenEventArgs): void; + + /**Triggered after saved the modified cellValue in TreeGrid*/ + endEdit? (e: EndEditEventArgs): void; + + /**Triggered after expand the record*/ + expanded? (e: ExpandedEventArgs): void; + + /**Triggered while expanding the TreeGrid record*/ + expanding? (e: ExpandingEventArgs): void; + + /**Triggered while Treegrid is loaded*/ + load? (e: LoadEventArgs): void; + + /**Triggered while rendering each cell in the TreeGrid*/ + queryCellInfo? (e: QueryCellInfoEventArgs): void; + + /**Triggered while rendering each row*/ + rowDataBound? (e: RowDataBoundEventArgs): void; + + /**Triggered while dragging a row in TreeGrid control*/ + rowDrag? (e: RowDragEventArgs): void; + + /**Triggered while start to drag row in TreeGrid control*/ + rowDragStart? (e: RowDragStartEventArgs): void; + + /**Triggered while drop a row in TreeGrid control*/ + rowDragStop? (e: RowDragStopEventArgs): void; + + /**Triggered after the row is selected.*/ + rowSelected? (e: RowSelectedEventArgs): void; + + /**Triggered before the row is going to be selected.*/ + rowSelecting? (e: RowSelectingEventArgs): void; + + /**Triggered when toolbar item is clicked in TreeGrid.*/ + toolbarClick? (e: ToolbarClickEventArgs): void; +} + +export interface ActionBeginEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the current grouped column field name. + */ + columnName?: string; + + /**Returns the TreeGrid model. + */ + model?: any; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the direction of sorting ascending or descending. + */ + columnSortDirection?: string; + + /**Returns the value of expanding parent element. + */ + keyValue?: string; + + /**Returns the data or deleting element. + */ + data?: string; +} + +export interface ActionCompleteEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the current grouped column field name. + */ + columnName?: string; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the direction of sorting ascending or descending + */ + columnSortDirection?: string; + + /**Returns the value of searched element. + */ + keyValue?: string; + + /**Returns the data of deleted element. + */ + data?: string; + + /**Returns selected record index + */ + recordIndex?: number; +} + +export interface BeginEditEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row element of editing cell. + */ + rowElement?: any; + + /**Returns the Element of editing cell. + */ + cellElement?: any; + + /**Returns the data of current cell record. + */ + data?: any; + + /**Returns the column Index of cell belongs. + */ + columnIndex?: number; +} + +export interface CollapsedEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row index of collapsed record. + */ + recordIndex?: number; + + /**Returns the data of collpsed record.. + */ + data?: any; + + /**Returns Request Type. + */ + requestType?: string; + + /**Returns state of a record whether it is in expanded or collapsed state. + */ + expanded?: boolean; + + /**Returns the event type. + */ + type?: string; +} + +export interface CollapsingEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row index of collapsing record. + */ + recordIndex?: number; + + /**Returns the data of collapsing record.. + */ + data?: any; + + /**Returns the event Type. + */ + type?: string; + + /**Returns state of a record whether it is in expanded or collapsing state. + */ + expanded?: boolean; +} + +export interface ContextMenuOpenEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the default context menu items to which we add custom items. + */ + contextMenuItems?: Array; + + /**Returns the TreeGrid model. + */ + model?: any; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface EndEditEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row element of editing cell. + */ + rowElement?: any; + + /**Returns the Element of editing cell. + */ + cellElement?: any; + + /**Returns the data of edited cell record. + */ + data?: any; + + /**Returns the column name of edited cell belongs. + */ + columnName?: string; + + /**Returns the column object of edited cell belongs. + */ + columnObject?: any; +} + +export interface ExpandedEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row index of expanded record. + */ + recordIndex?: number; + + /**Returns the data of expanded record.. + */ + data?: any; + + /**Returns Request Type. + */ + requestType?: string; + + /**Returns state of a record whether it is in expanded or expanded state. + */ + expanded?: boolean; + + /**Returns the event type. + */ + type?: string; +} + +export interface ExpandingEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row index of expanding record. + */ + recordIndex?: number; + + /**Returns the data of expanding record.. + */ + data?: any; + + /**Returns the event Type. + */ + type?: string; + + /**Returns state of a record whether it is in expanded or collapsed state. + */ + expanded?: boolean; +} + +export interface LoadEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the TreeGrid model + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface QueryCellInfoEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the selecting cell element. + */ + cellElement?: any; + + /**Returns the value of cell. + */ + cellValue?: string; + + /**Returns the data of current cell record. + */ + data?: any; + + /**Returns the column of cell belongs. + */ + column?: any; +} + +export interface RowDataBoundEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row element of rendering row. + */ + rowElement?: any; + + /**Returns the data of rendering row record. + */ + data?: any; +} + +export interface RowDragEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row which we start to drag. + */ + draggedRow?: any; + + /**Returns the row index which we start to drag. + */ + draggedRowIndex?: number; + + /**Returns the row on which we are dragging. + */ + targetRow?: any; + + /**Returns the row index on which we are dragging. + */ + targetRowIndex?: number; + + /**Returns that we can drop over that record or not. + */ + canDrop?: boolean; + + /**Returns the TreeGrid model. + */ + model?: any; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface RowDragStartEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row which we start to drag. + */ + draggedRow?: any; + + /**Returns the row index which we start to drag. + */ + draggedRowIndex?: boolean; + + /**Returns the TreeGrid model. + */ + model?: any; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface RowDragStopEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row which we start to drag. + */ + draggedRow?: any; + + /**Returns the row index which we start to drag. + */ + draggedRowIndex?: number; + + /**Returns the row which we are dropped to row. + */ + targetRow?: any; + + /**Returns the row index which we are dropped to row. + */ + targetRowIndex?: number; + + /**Returns the TreeGrid model. + */ + model?: any; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface RowSelectedEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the selecting row element. + */ + targetRow?: any; + + /**Returns the index of selecting row record. + */ + recordIndex?: number; + + /**Returns the data of selected record. + */ + data?: any; + + /**Returns the event type. + */ + type?: string; +} + +export interface RowSelectingEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the data selecting record. + */ + data?: any; + + /**Returns the index of selecting row record. + */ + recordIndex?: string; + + /**Returns the selecting row element. + */ + targetRow?: any; + + /**Returns the previous selected data. + */ + previousData?: any; + + /**Returns the previous selected row index. + */ + previousIndex?: string; + + /**Returns the previous selected row element. + */ + previousTreeGridRow?: any; +} + +export interface ToolbarClickEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the current item. + */ + currentTarget?: any; + + /**Returns the TreeGrid model. + */ + model?: any; + + /**Returns the name of the toolbar item on which mouse click has been performed + */ + itemName?: string; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface Columns { + + /**Enables or disables the ability to filter the rows based on this column. + * @Default {false} + */ + allowFiltering?: boolean; + + /**Enables or disables the ability to sort the rows based on this column/field. + * @Default {false} + */ + allowSorting?: boolean; + + /**Specifies the edit type of the column. + * @Default {ej.TreeGrid.EditingType.String} + */ + editType?: ej.TreeGrid.EditingType|string; + + /**Specifies the name of the field from the dataSource to bind with this column. + */ + field?: string; + + /**Specifies the type of the editor control to be used to filter the rows. + * @Default {ej.TreeGrid.EditingType.String} + */ + filterEditType?: ej.TreeGrid.EditingType|string; + + /**Header text of the column. + * @Default {null} + */ + headerText?: string; + + /**Controls the visibility of the column. + * @Default {true} + */ + visible?: boolean; + + /**Specifies the header template value for the column header + */ + headerTemplateID?: string; + + /**Specifies whether the column is frozen + * @Default {false} + */ + isFrozen?: boolean; + + /**Enables or disables the ability to freeze/unfreeze the columns + * @Default {false} + */ + allowFreezing?: boolean; +} + +export interface ContextMenuSettings { + + /**Option for adding items to context menu. + * @Default {[]} + */ + contextMenuItems?: Array; + + /**Shows/hides the context menu. + * @Default {false} + */ + showContextMenu?: boolean; +} + +export interface DragTooltip { + + /**Specifies whether to show tooltip while dragging a row. + * @Default {true} + */ + showTooltip?: boolean; + + /**Option to add field names whose corresponding values in the dragged row needs to be shown in the preview tooltip. + * @Default {[]} + */ + tooltipItems?: Array; + + /**Custom template for that tooltip that is shown while dragging a row. + * @Default {null} + */ + tooltipTemplate?: string; +} + +export interface EditSettings { + + /**Enables or disables the button to add new row in context menu as well as in toolbar. + * @Default {true} + */ + allowAdding?: boolean; + + /**Enables or disables the button to delete the selected row in context menu as well as in toolbar. + * @Default {true} + */ + allowDeleting?: boolean; + + /**Enables or disables the ability to edit a row or cell. + * @Default {false} + */ + allowEditing?: boolean; + + /**specifies the edit mode in TreeGrid , "cellEditing" is for cell type editing and "rowEditing" is for entire row. + * @Default {ej.TreeGrid.EditMode.CellEditing} + */ + editMode?: ej.TreeGrid.EditMode|string; + + /**Specifies the position where the new row has to be added. + * @Default {top} + */ + rowPosition?: ej.TreeGrid.RowPosition|string; +} + +export interface SizeSettings { + + /**Height of the TreeGrid. + * @Default {null} + */ + height?: string; + + /**Width of the TreeGrid. + * @Default {null} + */ + width?: string; +} + +export interface SortSettings { + + /**Option to add columns based on which the rows have to be sorted recursively. + * @Default {[]} + */ + sortedColumns?: Array; +} + +export interface ToolbarSettings { + + /**Shows/hides the toolbar. + * @Default {false} + */ + showToolBar?: boolean; + + /**Option to add items to the toolbar. + * @Default {[]} + */ + toolbarItems?: Array; +} + +enum EditingType{ + + ///It Specifies String edit type. + String, + + ///It Specifies Boolean edit type. + Boolean, + + ///It Specifies Numeric edit type. + Numeric, + + ///It Specifies Dropdown edit type. + Dropdown, + + ///It Specifies DatePicker edit type. + DatePicker, + + ///It Specifies DateTimePicker edit type. + DateTimePicker, + + ///It Specifies Maskedit edit type. + Maskedit +} + + +enum EditMode{ + + ///you can edit a cell. + CellEditing, + + ///you can edit a row. + RowEditing +} + + +enum RowPosition{ + + ///you can add a new row at top. + Top, + + ///you can add a new row at bottom. + Bottom, + + ///you can add a new row to above selected row. + Above, + + ///you can add a new row to below selected row. + Below, + + ///you can add a new row as a child for selected row. + Child +} + +} +module Gantt +{ +enum SelectionType +{ +//you can select a single row. +Single, +//you can select a multiple row. +Multiple, +} +} + +class NavigationDrawer extends ej.Widget { + static fn: NavigationDrawer; + constructor(element: JQuery, options?: NavigationDrawer.Model); + constructor(element: Element, options?: NavigationDrawer.Model); + model:NavigationDrawer.Model; + defaults:NavigationDrawer.Model; + + /** To close the navigation drawer control + * @returns {void} + */ + close(): void; + + /** To open the navigation drawer control + * @returns {void} + */ + open(): void; + + /** To Toggle the navigation drawer control + * @returns {void} + */ + toggle(): void; +} +export module NavigationDrawer{ + +export interface Model { + + /**Specifies the contentId for navigation drawer, where the ajax content need to updated + * @Default {null} + */ + contentid?: string; + + /**Sets the root class for NavigationDrawer theme. This cssClass API helps to use custom skinning option for NavigationDrawer control. By defining the root class using this API, we need to include this root class in CSS. + */ + cssclass?: string; + + /**Sets the Direction for the control. See Direction + * @Default {left} + */ + direction?: ej.Direction|string; + + /**Sets the listview to be enabled or not + * @Default {false} + */ + enablelistview?: boolean; + + /**Specifies the listview items as an array of object. + * @Default {[]} + */ + items?: Array; + + /**Sets all the properties of listview to render in navigation drawer + */ + listviewsettings?: any; + + /**Specifies position whether it is in fixed or relative to the page. See Position + * @Default {normal} + */ + position?: string; + + /**Specifies the targetId for navigation drawer + */ + targetid?: string; + + /**Sets the rendering type of the control. See Type + * @Default {overlay} + */ + type?: string; + + /**Specifies the width of the control + * @Default {auto} + */ + width?: number; + + /**Event triggers before the control gets closed.*/ + beforeclose? (e: BeforecloseEventArgs): void; + + /**Event triggers when the control open.*/ + open? (e: OpenEventArgs): void; + + /**Event triggers when the Swipe happens.*/ + swipe? (e: SwipeEventArgs): void; +} + +export interface BeforecloseEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Navigation Drawer model + */ + model?: ej.NavigationDrawer.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the item of element + */ + item?: any; + + /**returns the name of item + */ + itemName?: string; +} + +export interface OpenEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Navigation Drawer model + */ + model?: ej.NavigationDrawer.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the item of element + */ + item?: any; + + /**returns the name of item + */ + itemName?: string; +} + +export interface SwipeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Navigation Drawer model + */ + model?: ej.NavigationDrawer.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the item of element + */ + item?: any; + + /**returns the name of item + */ + itemName?: string; +} +} + +class RadialMenu extends ej.Widget { + static fn: RadialMenu; + constructor(element: JQuery, options?: RadialMenu.Model); + constructor(element: Element, options?: RadialMenu.Model); + model:RadialMenu.Model; + defaults:RadialMenu.Model; + + /** To hide the redialmenu + * @returns {void} + */ + hide(): void; + + /** To hide the redialmenu items + * @returns {void} + */ + menuHide(): void; + + /** To Show the redialmenu + * @returns {void} + */ + show(): void; +} +export module RadialMenu{ + +export interface Model { + + /**To show the Radial in intial render. + */ + autoOpen?: boolean; + + /**Renders the back button Image for Radial using class. + */ + backImageClass?: string; + + /**Sets the root class for RadialMenu theme. This cssClass API helps to use custom skinning option for RadialMenu control. By defining the root class using this API, we need to include this root class in CSS. + */ + cssClass?: string; + + /**To enable Animation for Radial Menu. + */ + enableAnimation?: boolean; + + /**Renders the Image for Radial using Class. + */ + imageClass?: string; + + /**Specifies the radius of radial menu + */ + radius?: number; + + /**To show the Radial while clicking given target element. + */ + targetElementId?: string; + + /**Event triggers when the mouse down happens.*/ + mouseDown? (e: MouseDownEventArgs): void; + + /**Event triggers when the mouse up happens.*/ + mouseUp? (e: MouseUpEventArgs): void; + + /**Event triggers when we select an item.*/ + select? (e: SelectEventArgs): void; +} + +export interface MouseDownEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Radialmenu model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; + + /**returns the item of element + */ + item?: any; + + /**returns the name of item + */ + itemName?: string; +} + +export interface MouseUpEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Radialmenu model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; + + /**returns the item of element + */ + item?: any; + + /**returns the name of item + */ + itemName?: string; +} + +export interface SelectEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Radialmenu model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; + + /**returns the item of element + */ + item?: any; + + /**returns the name of item + */ + itemName?: string; +} +} + +class Tile extends ej.Widget { + static fn: Tile; + constructor(element: JQuery, options?: Tile.Model); + constructor(element: Element, options?: Tile.Model); + model:Tile.Model; + defaults:Tile.Model; + + /** Update the image template of tile item to another one. + * @param {string} UpdateTemplate by using id + * @returns {void} + */ + updateTemplate(name: string): void; +} +export module Tile{ + +export interface Model { + + /**Section for badge specific functionalities and it represents the notification for tile items. + */ + badge?: Badge; + + /**Specifies the tile caption in outside of template content. + * @Default {null} + */ + captionTemplateId?: string; + + /**Sets the root class for Tile theme. This cssClass API helps to use custom skinning option for Tile control. By defining the root class using this API, we need to include this root class in CSS. + */ + cssClass?: string; + + /**Saves current model value to browser cookies for state maintains. While refreshing the page retains the model value applies from browser cookies. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Customize the tile size height. + * @Default {null} + */ + height?: number; + + /**Specifies Tile imageClass, using this property we can give images for each tile through css classes. + * @Default {null} + */ + imageClass?: string; + + /**Specifies the position of tile image. See imagePosition + * @Default {center} + */ + imagePosition?: ej.Tile.ImagePosition|string; + + /**Specifies the tile image in outside of template content. + * @Default {null} + */ + imageTemplateId?: string; + + /**Specifies the url of tile image. + * @Default {null} + */ + imageUrl?: string; + + /**Section for livetile specific functionalities. + */ + livetile?: Livetile; + + /**Specifies whether the tile text to be shown or hidden. + * @Default {true} + */ + showText?: boolean; + + /**Changes the text of a tile. + * @Default {Text} + */ + text?: string; + + /**Aligns the text of a tile. See textAlignment + * @Default {normal} + */ + textAlignment?: ej.Tile.TextAlignment|string; + + /**Specifies the size of a tile. See tileSize + * @Default {small} + */ + tileSize?: ej.Tile.TileSize|string; + + /**Customize the tile size width. + * @Default {null} + */ + width?: number; + + /**Sets the rounded corner to tile. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Sets allowSelection to tile. + * @Default {false} + */ + allowSelection?: boolean; + + /**Sets the background color to tile. + * @Default {false} + */ + backgroundColor?: string; + + /**Event triggers when the mouse down happens in the tile*/ + mouseDown? (e: MouseDownEventArgs): void; + + /**Event triggers when the mouse up happens in the tile*/ + mouseUp? (e: MouseUpEventArgs): void; +} + +export interface MouseDownEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the tile model + */ + model?: boolean; + + /**returns the name of the event + */ + type?: boolean; + + /**returns the current tile text + */ + text?: string; + + /**returns the index of current tile item + */ + index?: number; +} + +export interface MouseUpEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the tile model + */ + model?: boolean; + + /**returns the name of the event + */ + type?: boolean; + + /**returns the current tile text + */ + text?: boolean; + + /**returns the index of current tile item + */ + index?: number; +} + +export interface Badge { + + /**Specifies whether to enable badge or not. + * @Default {false} + */ + enabled?: boolean; + + /**Specifies maximum value for tile badge. + * @Default {100} + */ + maxValue?: number; + + /**Specifies minimum value for tile badge. + * @Default {1} + */ + minValue?: number; + + /**Specifies text instead of number for tile badge. + * @Default {null} + */ + text?: string; + + /**Sets value for tile badge. + * @Default {1} + */ + value?: number; + + /**Sets position for tile badge. + * @Default {“bottomright”} + */ + position?: ej.Tile.BadgePosition|string; +} + +export interface Livetile { + + /**Specifies whether to enable livetile or not. + * @Default {false} + */ + enabled?: boolean; + + /**Specifies liveTile images in css classes. + * @Default {null} + */ + imageClass?: string; + + /**Specifies liveTile images in templates. + * @Default {null} + */ + imageTemplateId?: string; + + /**Specifies liveTile images in css classes. + * @Default {null} + */ + imageUrl?: string; + + /**Specifies liveTile type for Tile. See orientation + * @Default {flip} + */ + type?: ej.Tile.LiveTileType|string; + + /**Specifies time interval between two successive livetile animation + * @Default {2000} + */ + updateInterval?: number; + + /**Sets the text to each living tile + * @Default {Null} + */ + text?: Array; +} + +enum BadgePosition{ + + ///To set the topright position of tile badge + Topright, + + ///To set the bottomright of tile image + Bottomright +} + + +enum ImagePosition{ + + ///To set the center position of tile image + Center, + + ///To set the top position of tile image + Top, + + ///To set the bottom position of tile image + Bottom, + + ///To set the right position of tile image + Right, + + ///To set the left position of tile image + Left, + + ///To set the topleft position of tile image + TopLeft, + + ///To set the topright position of tile image + TopRight, + + ///To set the bottomright position of tile image + BottomRight, + + ///To set the bottomleft position of tile image + BottomLeft, + + ///To set the fill position of tile image + Fill +} + + +enum LiveTileType{ + + ///To set flip type of liveTile for tile control + Flip, + + ///To set slide type of liveTile for tile control + Slide, + + ///To set carousel type of liveTile for tile control + Carousel +} + + +enum TextAlignment{ + + ///To set the normal alignment of text for tile control + Normal, + + ///To set the left alignment of text for tile control + Left, + + ///To set the right alignment of text for tile control + Right, + + ///To set the center alignment of text for tile control + Center +} + + +enum TextPosition{ + + ///To set the innertop position of the tile text + Innertop, + + ///To set the innerbottom position of the tile text + Innerbottom, + + ///To set the outer position of the tile text + Outer +} + + +enum TileSize{ + + ///To set the medium size for tile control + Medium, + + ///To set the small size for tile control + Small, + + ///To set the large size for tile control + Large, + + ///To set the wide size for tile control + Wide +} + +} + +class RadialSlider extends ej.Widget { + static fn: RadialSlider; + element: JQuery; + constructor(element: JQuery, options?: RadialSliderOptions); + constructor(element: Element, options?: RadialSliderOptions); + model:RadialSliderOptions; + defaults:RadialSliderOptions; + show(): void; + hide(): void; +} + +interface RadialSliderOptions { + radius?: number; + endAngle?: number; + startAngle?: number; + ticks?: Int32Array; + enableRoundOff?: boolean; + value?: number; + strokeWidth?: number; + autoOpen?: boolean; + enableAnimation?: boolean; + cssClass?: string; + innerCircleImageClass?: string; + innerCircleImageUrl?: string; + showInnerCircle?: boolean; + inline?: boolean; + stop? (e: RadialSliderStopEventArgs): void; + start? (e: RadialSliderStartEventArgs): void; + slide? (e: RadialSliderSlideEventArgs): void; + change? (e: RadialSliderChangeEventArgs): void; + mouseover? (e: RadialSliderMouseOverEventArgs): void; + create? (e: RadialSliderCreateEventArgs): void; + destory? (e: RadialSliderDestroyEventArgs): void; +} +interface RadialSliderCreateEventArgs { + cancel: boolean; + model: RadialSliderOptions; + type: string; +} +interface RadialSliderDestroyEventArgs { + cancel: boolean; + model: RadialSliderOptions; + type: string; +} +interface RadialSliderStopEventArgs { + cancel: boolean; + model: RadialSliderOptions; + type: string; + value: number; +} + +interface RadialSliderStartEventArgs { + cancel: boolean; + model: RadialSliderOptions; + type: string; + value: number; +} +interface RadialSliderSlideEventArgs { + cancel: boolean; + model: RadialSliderOptions; + type: string; + value: number; + selectedValue: number; +} +interface RadialSliderChangeEventArgs { + cancel: boolean; + model: RadialSliderOptions; + type: string; + value: number; + oldValue: number; +} +interface RadialSliderMouseOverEventArgs { + cancel: boolean; + model: RadialSliderOptions; + type: string; + value: number; + selectedValue: number; +} +class Spreadsheet extends ej.Widget { + static fn: Spreadsheet; + constructor(element: JQuery, options?: Spreadsheet.Model); + constructor(element: Element, options?: Spreadsheet.Model); + model:Spreadsheet.Model; + defaults:Spreadsheet.Model; + + /** This method is used to add a new sheet in the last position of the sheet container. + * @returns {void} + */ + addNewSheet(): void; + + /** It is used to clear all the data and format in the specified range of cells in Spreadsheet. + * @param {string} Optional. If range is specified, then it will clear all content in the specified range else it will use the current selected range. + * @returns {void} + */ + clearAll(range: string): void; + + /** This property is used to clear all the formats applied in the specified range in Spreadsheet. + * @param {string} Optional. If range is specified, then it will clear all format in the specified range else it will use the current selected range. + * @returns {void} + */ + clearAllFormat(range: string): void; + + /** Used to clear the applied border in the specified range in Spreadsheet. + * @param {string} Optional. If range is specified, then it will clear border in the specified range else it will use the current selected range. + * @returns {void} + */ + clearBorder(range: string): void; + + /** This property is used to clear the contents in the specified range in Spreadsheet. + * @param {string} Optional. If the range is specified, then it will clear the content in the specified range else it will use the current selected range. + * @returns {void} + */ + clearContents(range: string): void; + + /** This method is used to remove only the data in the range denoted by the specified range name. + * @param {string} Pass the defined rangeSettings property name. + * @returns {void} + */ + clearRange(rangeName: string): void; + + /** It is used to remove data in the specified range of cells based on the defined property. + * @param {Array|string} Optional. If range is specified, it will clear data for the specified range else it will use the current selected range. + * @param {string} Optional. If property is specified, it will remove the specified property in the range else it will remove default properties + * @param {boolean} Optional. If pass true, if you want to skip the hidden rows + * @returns {void} + */ + clearRangeData(range: Array|string, property: string, skipHiddenRow: boolean): void; + + /** This method is used to copy sheets in Spreadsheet. + * @param {number} Pass the sheet index that you want to copy. + * @param {number} Pass the position index where you want to copy. + * @returns {void} + */ + copySheet(fromIdx: number, toIdx: number): void; + + /** This method is used to delete the entire column which is selected. + * @param {number} Pass the start column index. + * @param {number} Pass the end column index. + * @returns {void} + */ + deleteEntireColumn(startCol: number, endCol: number): void; + + /** This method is used to delete the entire row which is selected. + * @param {number} Pass the start row index. + * @param {number} Pass the end row index. + * @returns {void} + */ + deleteEntireRow(startRow: number, endRow: number): void; + + /** This method is used to delete a particular sheet in the Spreadsheet. + * @param {number} Pass the sheet index to perform delete action. + * @returns {void} + */ + deleteSheet(idx: number): void; + + /** This method is used to delete the selected cells and shift the remaining cells to left. + * @param {any} Row index and column index of the starting cell. + * @param {any} Row index and column index of the ending cell. + * @returns {void} + */ + deleteShiftLeft(startCell: any, endCell: any): void; + + /** This method is used to delete the selected cells and shift the remaining cells up. + * @param {any} Row index and column index of the start cell. + * @param {any} Row index and column index of the end cell. + * @returns {void} + */ + deleteShiftUp(startCell: any, endCell: any): void; + + /** This method is used to edit data in the specified range of cells based on its corresponding rangeSettings. + * @param {string} Pass the defined rangeSettings property name. + * @param {Function} Pass the function that you want to perform range edit. + * @returns {void} + */ + editRange(rangeName: string, fn: Function): void; + + /** This method is used to get the activation panel in the Spreadsheet. + * @returns {HTMLElement} + */ + getActivationPanel(): HTMLElement; + + /** This method is used to get the active cell object in Spreadsheet. It will returns object which contains rowIndex and colIndex of the active cell. + * @param {number} Optional. If sheetIdx is specified, it will return the active cell object in specified sheet index else it will use the current sheet index + * @returns {any} + */ + getActiveCell(sheetIdx: number): any; + + /** This method is used to get the active cell element based on the given sheet index in the Spreadsheet. + * @param {number} Optional. If sheetIndex is specified, it will return the active cell element in specified sheet index else it will use the current active sheet index. + * @returns {HTMLElement} + */ + getActiveCellElem(sheetIdx: number): HTMLElement; + + /** This method is used to get the current active sheet index in Spreadsheet. + * @returns {number} + */ + getActiveSheetIndex(): number; + + /** This method is used to get the auto fill element in Spreadsheet. + * @returns {HTMLElement} + */ + getAutoFillElem(): HTMLElement; + + /** This method is used to get the cell element based on specified row and column index in the Spreadsheet. + * @param {number} Pass the row index. + * @param {number} Pass the column index. + * @param {number} Optional. Pass the sheet index that you want to get cell. + * @returns {HTMLElement} + */ + getCell(rowIdx: number, colIdx: number, sheetIdx: number): HTMLElement; + + /** This method is used to get the frozen columns index in the Spreadsheet. + * @param {number} Pass the sheet index. + * @returns {number} + */ + getFrozenColumns(sheetIdx: number): number; + + /** This method is used to get the frozen row’s index in Spreadsheet. + * @param {number} Pass the sheet index. + * @returns {number} + */ + getFrozenRows(sheetIdx: number): number; + + /** This method is used to get the hyperlink data as object from the specified cell in Spreadsheet. + * @param {HTMLElement} Pass the DOM element to get hyperlink + * @returns {any} + */ + getHyperlink(cell: HTMLElement): any; + + /** This method is used to get all cell elements in the specified range. + * @param {number} Pass the row index of the start cell. + * @param {number} Pass the column index of the start cell. + * @param {number} Pass the row index of the end cell. + * @param {number} Pass the column index of the end cell. + * @param {number} Pass the index of the sheet. + * @returns {HTMLElement} + */ + getRange(startRIndex: number, startCIndex: number, endRIndex: number, endCIndex: number, sheetIdx: number): HTMLElement; + + /** This method is used to get the data in specified range in Spreadsheet. + * @param {Array|string} Optional. If range is specified, it will get range data for the specified range else it will use the current selected range. + * @param {boolean} Pass 'true' if you want cell values alone. + * @param {Array|string} Optional. If property is specified, it will get the specified property in the range else it will get default properties. + * @param {number} Optional. Pass the index of the sheet. + * @param {boolean} Optional. When skipDateTime is set as true, it return 'value2' cell value (cell type as 'datetime') + * @param {boolean} Optional. Pass true, if you want to get the calculated formula value else it return formula string. + * @param {boolean} Optional. Pass true, if you want to skip the hidden rows data. + * @param {number} Optional. Pass virtual row index of sheet. + * @param {number} Optional. Pass virtual row count of sheet. + * @returns {Array} + */ + getRangeData(range: Array|string, valueOnly: boolean, property: Array|string, sheetIdx: number, skipDateTime: boolean, skipFormula: boolean, skipHiddenRow: boolean, virtualRowIdx: number, virtualRowCount: number): Array; + + /** This method is used to get the range indices array based on the specified alpha range in Spreadsheet. + * @param {string} Pass the alpha range that you want to get range indices. + * @returns {Array} + */ + getRangeIndices(range: string): Array; + + /** This method is used to get the sheet details based on the given sheet index in Spreadsheet. + * @param {number} Pass the sheet index to get the sheet object. + * @returns {any} + */ + getSheet(sheetIdx: number): any; + + /** This method is used to get the sheet content div element of Spreadsheet. + * @param {number} Pass the sheet index to get the sheet content. + * @returns {HTMLElement} + */ + getSheetElement(sheetIdx: number): HTMLElement; + + /** This method is used to send a paging request to the specified sheet Index in the Spreadsheet. + * @param {number} Pass the sheet index to perform paging at specified sheet index + * @param {boolean} Pass 'true' to create a new sheet. If the specified sheet index is already exist, it navigate to that sheet else it create a new sheet. + * @returns {void} + */ + gotoPage(sheetIdx: number, newSheet: boolean): void; + + /** This method is used to hide the entire columns from the specified range (startCol, endCol) in Spreadsheet. + * @param {number} Index of the start column. + * @param {number} Index of the end column. + * @returns {void} + */ + hideColumn(startCol: number, endCol: number): void; + + /** This method is used to hide the formula bar in Spreadsheet. + * @returns {void} + */ + hideFormulaBar(): void; + + /** This method is used to hide the rows, based on the specified row index in Spreadsheet. + * @param {number} Index of the start row. + * @param {number} Index of the end row. + * @returns {void} + */ + hideRow(startRow: number, endRow: number): void; + + /** This method is used to hide the sheet based on the specified sheetIndex or sheet name in the Spreadsheet. + * @param {string|number} Pass the sheet name or index that you want to hide. + * @returns {void} + */ + hideSheet(sheetIdx: string|number): void; + + /** This method is used to hide the displayed waiting pop-up in Spreadsheet. + * @returns {void} + */ + hideWaitingPopUp(): void; + + /** This method is used to insert a column before the active cell's column in the Spreadsheet. + * @param {number} Pass start column. + * @param {number} Pass end column. + * @returns {void} + */ + insertEntireColumn(startCol: number, endCol: number): void; + + /** This method is used to insert a row before the active cell's row in the Spreadsheet. + * @param {number} Pass start row. + * @param {number} Pass end row. + * @returns {void} + */ + insertEntireRow(startRow: number, endRow: number): void; + + /** This method is used to insert a new sheet to the left of the current active sheet. + * @returns {void} + */ + insertSheet(): void; + + /** This method is used to insert cells in the selected or specified range and shift remaining cells to bottom. + * @param {any} Row index and column index of the start cell. + * @param {any} Row index and column index of the end cell. + * @returns {void} + */ + insertShiftBottom(startCell: any, endCell: any): void; + + /** This method is used to insert cells in the selected or specified range and shift remaining cells to right. + * @param {any} Row index and column index of the start cell. + * @param {any} Row index and column index of the end cell. + * @returns {void} + */ + insertShiftRight(startCell: any, endCell: any): void; + + /** This method is used to import excel file manually by using form data. + * @param {any} Pass the form data object to import files manually. + * @returns {void} + */ + import(importRequest: any): void; + + /** This method is used to lock/unlock the range of cells in active sheet. Lock cells are activated only after the sheet is protected. Once the sheet is protected it is unable to lock/unlock cells. + * @param {string|Array} Pass the alpha range cells or array range of cells. + * @param {string} Optional. By default is true. If it is false locked cells are unlocked. + * @returns {void} + */ + lockCells(range: string|Array, isLocked: string): void; + + /** This method is used to merge cells by across in the Spreadsheet. + * @param {string} Optional. To pass the cell range or selected cells are process. + * @param {boolean} Optional. If pass true it does not show alert. + * @returns {void} + */ + mergeAcrossCells(range: string, alertStatus: boolean): void; + + /** This method is used to merge the selected cells in the Spreadsheet. + * @param {string} Optional. To pass the cell range or selected cells are process. + * @param {boolean} Optional. If pass true it does not show alert. + * @returns {void} + */ + mergeCells(range: string, alertStatus: boolean): void; + + /** This method is used to move sheets in Spreadsheet. + * @param {number} Pass the sheet index that you want to move. + * @param {number} Pass the position index where you want to move. + * @returns {void} + */ + moveSheet(fromIdx: number, toIdx: number): void; + + /** This method is used to protect or unprotect active sheet. + * @param {boolean} Optional. By default is true. If it is false active sheet is unprotected. + * @returns {void} + */ + protectSheet(isProtected: boolean): void; + + /** This method is used to remove the hyperlink from selected cells of current sheet. + * @param {string} Hyperlink remove from the specified range. + * @param {boolean} Optional. If it is true, It will clear link only not format. + * @returns {void} + */ + removeHyperlink(range: string, isClearHLink: boolean): void; + + /** This method is used to remove the range data and its defined rangeSettings property based on the specified range name. + * @param {string} Pass the defined rangeSetting property name. + * @returns {void} + */ + removeRange(rangeName: string): void; + + /** This method is used to set the active cell in the Spreadsheet. + * @param {number} Pass the row index. + * @param {number} Pass the column index. + * @param {number} Pass the index of the sheet. + * @returns {void} + */ + setActiveCell(rowIdx: number, colIdx: number, sheetIdx: number): void; + + /** This method is used to set active sheet index for the Spreadsheet. + * @param {number} Pass the active sheet index for Spreadsheet. + * @returns {void} + */ + setActiveSheetIndex(sheetIdx: number): void; + + /** This method is used to set border for the specified range of cells in the Spreadsheet. + * @param {any} Pass the border properties that you want to set. + * @param {string} Optional. If range is specified, it will set border for the specified range else it will use the selected range. + * @returns {void} + */ + setBorder(property: any, range: string): void; + + /** This method is used to set the hyperlink in selected cells of the current sheet. + * @param {string} If range is specified, it will set the hyperlink in range of the cells. + * @param {any} Pass cellAddress or webAddress + * @param {number} If we pass cellAddress then which sheet to be navigate in the applied link. + * @returns {void} + */ + setHyperlink(range: string, link: any, sheetIdx: number): void; + + /** This method is used to set the focus to the Spreadsheet. + * @returns {void} + */ + setSheetFocus(): void; + + /** This method is used to set the width for the columns in the Spreadsheet. + * @param {Array|any} Pass the cell index and width of the cells. + * @returns {void} + */ + setWidthToColumns(widthColl: Array|any): void; + + /** This method is used to rename the active sheet. + * @param {string} Pass the sheet name that you want to change the current active sheet name. + * @returns {void} + */ + sheetRename(sheetName: string): void; + + /** This method is used to display the activationPanel for the specified range name. + * @param {string} Pass the range name that you want to display the activation panel. + * @returns {void} + */ + showActivationPanel(rangeName: string): void; + + /** This method is used to show the hidden columns within the specified range in the Spreadsheet. + * @param {number} Index of the start column. + * @param {number} Index of the end column. + * @returns {void} + */ + showColumn(startColIdx: number, endColIdx: number): void; + + /** This method is used to show the formula bar in Spreadsheet. + * @returns {void} + */ + showFormulaBar(): void; + + /** This method is used to show the hidden rows in the specified range in the Spreadsheet. + * @param {number} Index of the start row. + * @param {number} Index of the end row. + * @returns {void} + */ + showRow(startRow: number, endRow: number): void; + + /** This method is used to show waiting pop-up in Spreadsheet. + * @returns {void} + */ + showWaitingPopUp(): void; + + /** This method is used to unfreeze the frozen rows and columns in the Spreadsheet. + * @returns {void} + */ + unfreezePanes(): void; + + /** This method is used to unhide the sheet based on specified sheet name or sheet index. + * @param {string|number} Pass the sheet name or index that you want to unhide. + * @returns {void} + */ + unhideSheet(sheetInfo: string|number): void; + + /** This method is used to unmerge the selected range of cells in the Spreadsheet. + * @param {string} Optional. If the range is specified, then it will un merge the specified range else it will use the current selected range. + * @returns {void} + */ + unmergeCells(range: string): void; + + /** This method is used to unwrap the selected range of cells in the Spreadsheet. + * @param {Array|string} Optional. If the range is specified, then it will update unwrap in the specified range else it will use the current selected range. + * @returns {void} + */ + unWrapText(range: Array|string): void; + + /** This method is used to update the data for the specified range of cells in the Spreadsheet. + * @param {any} Pass the cells data that you want to update. + * @param {Array} Optional. If range is specified, it will update data for the specified range else it will use the current selected range. + * @returns {void} + */ + updateData(data: any, range: Array): void; + + /** This method is used to update the formula bar in the Spreadsheet. + * @returns {void} + */ + updateFormulaBar(): void; + + /** This method is used to update the range of cells based on the specified settings which we want to update in the Spreadsheet. + * @param {number} Pass the sheet index that you want to update. + * @param {any} Pass the dataSource, startCell and showHeader values as settings. + * @returns {void} + */ + updateRange(sheetIdx: number, settings: any): void; + + /** This method is used to update the unique data for the specified range of cells in Spreadsheet. + * @param {any} Pass the data that you want to update in the particular range + * @param {Array|string} Optional. If range is specified, it will update data for the specified range else it will use the current selected range. + * @returns {void} + */ + updateUniqueData(data: any, range: Array|string): void; + + /** This method is used to wrap the selected range of cells in the Spreadsheet. + * @param {Array|string} Optional. If the range is specified, then it will update wrap in the specified range else it will use the current selected range. + * @returns {void} + */ + wrapText(range: Array|string): void; + + XLCellType: Spreadsheet.XLCellType; + + XLCFormat: Spreadsheet.XLCFormat; + + XLChart: Spreadsheet.XLChart; + + XLClipboard: Spreadsheet.XLClipboard; + + XLComment: Spreadsheet.XLComment; + + XLDragDrop: Spreadsheet.XLDragDrop; + + XLDragFill: Spreadsheet.XLDragFill; + + XLEdit: Spreadsheet.XLEdit; + + XLExport: Spreadsheet.XLExport; + + XLFilter: Spreadsheet.XLFilter; + + XLFormat: Spreadsheet.XLFormat; + + XLFreeze: Spreadsheet.XLFreeze; + + XLPrint: Spreadsheet.XLPrint; + + XLResize: Spreadsheet.XLResize; + + XLRibbon: Spreadsheet.XLRibbon; + + XLSearch: Spreadsheet.XLSearch; + + XLSelection: Spreadsheet.XLSelection; + + XLSort: Spreadsheet.XLSort; + + XLValidate: Spreadsheet.XLValidate; +} +export module Spreadsheet{ + +export interface XLCellType { + + /** This method is used to set a cell type from the specified range of cells in the spreadsheet. + * @param {string} Pass the range where you want apply cell type. + * @param {any} Pass type of cell type and its settings. + * @param {number} Optional. Pass sheet index. + * @returns {void} + */ + addCellTypes(range: string,settings: any,sheetIdx: number): void; + + /** This method is used to remove cell type from the specified range of cells in the Spreadsheet. + * @param {string} Pass the range where you want remove cell type. + * @param {number} Optional. Pass sheet index. + * @returns {void} + */ + removeCellTypes(range: string,sheetIdx: number): void; +} + +export interface XLCFormat { + + /** This method is used to clear the applied conditional formatting rules in the Spreadsheet. + * @param {boolean} Pass true if you want to clear rules from selected cells else it will clear rules from entire sheet. + * @param {Array|string} Optional. If range is specified, it will clear rules for the specified range else it will use the current selected range. + * @returns {void} + */ + clearCF(isSelected: boolean,range: Array|string): void; + + /** This method is used to get the applied conditional formatting rules as array of objects based on the specified row Index and column Index in the Spreadsheet. + * @param {number} Pass the row index. + * @param {number} Pass the column index. + * @returns {Array} + */ + getCFRule(rowIdx: number,colIdx: number): Array; + + /** This method is used to set the conditional formatting rule in the Spreadsheet. + * @param {any} Pass the rule to set. + * @returns {void} + */ + setCFRule(rule: any): void; +} + +export interface XLChart { + + /** This method is used to create a chart for specified range in Spreadsheet. + * @param {string} Optional. If range is specified, it will create chart for the specified range else it will use the current selected range. + * @param {any} To pass the type of chart and chart name. + * @returns {void} + */ + createChart(range: string,options: any): void; + + /** This method is used to refresh the chart in the Spreadsheet. + * @param {string} To pass the chart Id. + * @param {any} To pass the type of chart and chart name. + * @returns {void} + */ + refreshChart(id: string,options: any): void; + + /** This method is used to resize the chart of specified id in the Spreadsheet. + * @param {string} To pass the chart id. + * @param {number} To pass height value. + * @param {number} To pass the width value. + * @returns {void} + */ + resizeChart(id: string,height: number,width: number): void; +} + +export interface XLClipboard { + + /** This method is used to copy the selected cells in the Spreadsheet. + * @returns {void} + */ + copy(): void; + + /** This method is used to cut the selected cells in the Spreadsheet. + * @returns {void} + */ + cut(): void; + + /** This method is used to paste the cut or copied cells data in the Spreadsheet. + * @returns {void} + */ + paste(): void; +} + +export interface XLComment { + + /** This method is used to delete the comment in the specified range in Spreadsheet. + * @param {Array|string} Optional. If range is specified, it will delete comments for the specified range else it will use the current selected range. + * @param {number} Optional. If sheetIdx is specified, it will delete comment in specified sheet else it will use active sheet. + * @param {boolean} Optional. Pass true, if you want to skip the hidden rows data. + * @returns {void} + */ + deleteComment(range: Array|string,sheetIdx: number,skipHiddenRow: boolean): void; + + /** This method is used to edit the comment in the target Cell in Spreadsheet. + * @param {any} Optional. Pass the row index and column index of the cell which contains comment. + * @returns {void} + */ + editComment(targetCell: any): void; + + /** This method is used to find the next comment from the active cell in Spreadsheet. + * @returns {boolean} + */ + findNextComment(): boolean; + + /** This method is used to find the previous comment from the active cell in Spreadsheet. + * @returns {boolean} + */ + findPrevComment(): boolean; + + /** This method is used to get comment data for the specified cell. + * @param {HTMLElement} Pass the DOM element to get comment data as object. + * @returns {any} + */ + getComment(cell: HTMLElement): any; + + /** This method is used to set new comment in Spreadsheet. + * @param {string|Array} Optional. If we pass the range comment will set in the range otherwise it will set with selected cells. + * @param {string} Pass the comment data. + * @param {boolean} Optional. Pass true to show comment in edit mode + * @returns {void} + */ + setComment(range: string|Array,data: string,showEditPanel: boolean): void; + + /** This method is used to show all the comments in the Spreadsheet. + * @returns {void} + */ + showAllComments(): void; + + /** This method is used to show or hide the specific comment in the Spreadsheet. + * @param {HTMLElement} Optional. Pass the cell DOM element to show or hide its comment. If pass empty argument active cell will processed. + * @returns {void} + */ + showHideComment(targetCell: HTMLElement): void; +} + +export interface XLDragDrop { + + /** This method is used to drag and drop the selected range of cells to destination range in the Spreadsheet. + * @param {any|Array} Pass the source range to perform drag and drop. + * @param {any|Array} Pass the destination range to drop the dragged cells. + * @returns {void} + */ + moveRangeTo(sourceRange: any|Array,destinationRange: any|Array): void; +} + +export interface XLDragFill { + + /** This method is used to perform auto fill in Spreadsheet. + * @param {any} Pass the options to perform auto fill in Spreadsheet. + * @returns {void} + */ + autoFill(options: any): void; + + /** This method is used to hide the auto fill element in the Spreadsheet. + * @returns {void} + */ + hideAutoFillElement(): void; + + /** This method is used to hide the auto fill options in the Spreadsheet. + * @returns {void} + */ + hideAutoFillOptions(): void; + + /** This method is used to set position of the auto fill element in the Spreadsheet. + * @param {boolean} Pass the drag fill status as boolean value for show auto fill options in Spreadsheet. + * @returns {void} + */ + positionAutoFillElement(isDragFill: boolean): void; +} + +export interface XLEdit { + + /** This method is used to calculate formulas in the specified sheet. + * @param {number} Optional. If sheet index is specified, then it will calculate formulas in the specified sheet only else it will calculate formulas in all sheets. + * @returns {void} + */ + calcNow(sheetIdx: number): void; + + /** This method is used to edit a particular cell based on the row index and column index in the Spreadsheet. + * @param {number} Pass the row index to edit particular cell. + * @param {number} Pass the column index to edit particular cell. + * @param {boolean} Pass true, if you want to maintain previous cell value. + * @returns {void} + */ + editCell(rowIdx: number,colIdx: number,oldData: boolean): void; + + /** This method is used to get the property value of particular cell, based on the row and column index in the Spreadsheet. + * @param {number} Pass the row index to get the property value. + * @param {number} Pass the column index to get the property value. + * @param {string} Optional. Pass the property name that you want("value", "value2", "type", "cFormatRule", "range", "thousandSeparator", "rule", "format", "border", "picture", "chart", "calcValue", "align", "hyperlink", "formats", "borders", "tformats", "tborders", "isFilterHeader", "filterState", "tableName", "comment", "formatStr", "decimalPlaces", "cellType"). + * @param {number} Optional. Pass the index of the sheet. + * @returns {any|string|Array} + */ + getPropertyValue(rowIdx: number,colIdx: number,prop: string,sheetIdx: number): any|string|Array; + + /** This method is used to get the property value in specified cell in Spreadsheet. + * @param {HTMLElement} Pass the cell element to get property value. + * @param {string} Pass the property name that you want ("value", "value2", "type", "cFormatRule", "range", "thousandSeparator", "rule", "format", "border", "picture", "chart", "calcValue", "align", "hyperlink", "formats", "borders", "tformats", "tborders", "isFilterHeader", "filterState", "tableName", "comment", "formatStr", "decimalPlaces", "cellType"). + * @param {number} Pass the index of sheet. + * @returns {void} + */ + getPropertyValueByElem(elem: HTMLElement,property: string,sheetIdx: number): void; + + /** This method is used to save the edited cell value in the Spreadsheet. + * @returns {void} + */ + saveCell(): void; + + /** This method is used to update a particular cell value in the Spreadsheet. + * @param {any} Pass row index and column index of the cell. + * @param {string|number} Pass the cell value. + * @returns {void} + */ + updateCell(cell: any,value: string|number): void; + + /** This method is used to update a particular cell value and its format in the Spreadsheet. + * @param {any} Pass row index and column index of the cell. + * @param {string|number} Pass the cell value. + * @param {string} Pass the class name to update format. + * @param {number} Pass sheet index. + * @returns {void} + */ + updateCellValue(cellIdx: any,val: string|number,formatClass: string,sheetIdx: number): void; +} + +export interface XLExport { + + /** This method is used to save the sheet data as Excel or CSV document (.xls, .xlsx and .csv) in Spreadsheet. + * @param {string} Pass the export type that you want. + * @returns {void} + */ + export(type: string): void; +} + +export interface XLFilter { + + /** This method is used to clear the filter in filtered columns in the Spreadsheet. + * @returns {void} + */ + clearFilter(): void; + + /** This method is used to apply filter for the selected range of cells in the Spreadsheet. + * @param {string} Pass the range of the selected cells. + * @returns {void} + */ + filter(range: string): void; + + /** This method is used to apply filter for the column by active cell's value in the Spreadsheet. + * @returns {void} + */ + filterByActiveCell(): void; +} + +export interface XLFormat { + + /** This method is used to create a table for the selected range of cells in the Spreadsheet. + * @param {any} Pass the table object. + * @param {string} Optional. If the range is specified, then it will create table in the specified range else it will use the current selected range. + * @returns {void} + */ + createTable(tableObject: any,range: string): void; + + /** This method is used to set format style and values in a cell or range of cells. + * @param {any} Pass the formatObject which contains style, type, format, groupSeparator and decimalPlaces. + * @param {string} Pass the range indices to format cells. + * @returns {void} + */ + format(formatObj: any,range: string): void; + + /** This method is used to remove table with specified tableId in the Spreadsheet. + * @param {number} Pass the tableId that you want to remove. + * @returns {void} + */ + removeTable(tableId: number): void; + + /** This method is used to update the decimal places for numeric value for the selected range of cells in the Spreadsheet. + * @param {string} Pass the decimal places type in increment/decrement. + * @param {string} Pass the range indices. + * @returns {void} + */ + updateDecimalPlaces(type: string,range: string): void; + + /** This method is used to update the format for the selected range of cells in the Spreadsheet. + * @param {any} Pass the format object that you want to update. + * @param {Array} Optional. If the range is specified, then it will update format in the specified range else it will use the current selected range. + * @returns {void} + */ + updateFormat(formatObj: any,range: Array): void; + + /** This method is used to update the unique format for selected range of cells in the Spreadsheet. + * @param {string} Pass the unique format class. + * @param {Array} Optional. If the range is specified, then it will update format in the specified range else it will use the current selected range. + * @returns {void} + */ + updateUniqueFormat(formatClass: string,range: Array): void; +} + +export interface XLFreeze { + + /** This method is used to freeze columns upto the specified column index in the Spreadsheet. + * @param {number} Index of the column to be freeze. + * @returns {void} + */ + freezeColumns(colIdx: number): void; + + /** This method is used to freeze the first column in the Spreadsheet. + * @returns {void} + */ + freezeLeftColumn(): void; + + /** This method is used to freeze rows and columns before the specified cell in the Spreadsheet. + * @param {any} Row index and column index of the cell which you want to freeze. + * @returns {void} + */ + freezePanes(cell: any): void; + + /** This method is used to freeze rows upto the specified row index in the Spreadsheet. + * @param {number} Index of the row to be freeze. + * @returns {void} + */ + freezeRows(rowIdx: number): void; + + /** This method is used to freeze the top row in the Spreadsheet. + * @returns {void} + */ + freezeTopRow(): void; +} + +export interface XLPrint { + + /** This method is used to print the selected contents in the Spreadsheet. + * @returns {void} + */ + printSelection(): void; + + /** This method is used to print the entire contents in the active sheet. + * @returns {void} + */ + printSheet(): void; +} + +export interface XLResize { + + /** This method is used to get the column width of the specified column index in the Spreadsheet. + * @param {number} Pass the column index. + * @returns {number} + */ + getColWidth(colIdx: number): number; + + /** This method is used to get the row height of the specified row index in the Spreadsheet. + * @param {number} Pass the row index which you want to find its height. + * @returns {number} + */ + getRowHeight(rowIdx: number): number; + + /** This method is used to set the column width of the specified column index in the Spreadsheet. + * @param {number} Pass the column index. + * @param {number} Pass the width value that you want to set. + * @returns {void} + */ + setColWidth(colIdx: number,size: number): void; + + /** This method is used to set the row height of the specified row index in the Spreadsheet. + * @param {number} Pass the row index. + * @param {number} Pass the height value that you want to set. + * @returns {void} + */ + setRowHeight(rowIdx: number,size: number): void; +} + +export interface XLRibbon { + + /** This method is used to add a new name in the Spreadsheet name manager. + * @param {string} Pass the name that you want to define in name manager. + * @param {string} Pass the cell reference. + * @param {string} Optional. Pass comment, if you want. + * @param {number} Optional. Pass the sheet index. + * @returns {void} + */ + addNamedRange(name: string,refersTo: string,comment: string,sheetIdx: number): void; + + /** This method is used to insert the few type (SUM, MAX, MIN, AVG, COUNT) of formulas in the selected range of cells in the Spreadsheet. + * @param {string} To pass the type("SUM","MAX","MIN","AVG","COUNT"). + * @param {string} If range is specified, it will apply auto sum for the specified range else it will use the current selected range. + * @returns {void} + */ + autoSum(type: string,range: string): void; + + /** This method is used to delete the defined name in the Spreadsheet name manager. + * @param {string} Pass the defined name that you want to remove from name manager. + * @returns {void} + */ + removeNamedRange(name: string): void; +} + +export interface XLSearch { + + /** This method is used to find and replace all data by workbook in the Spreadsheet. + * @param {string} Pass the search data. + * @param {string} Pass the replace data. + * @param {boolean} Pass true, if you want to match with case-sensitive. + * @param {boolean} Pass true, if you want to match with entire cell contents. + * @returns {void} + */ + replaceAllByBook(findData: string,replaceData: string,isCSen: boolean,isEMatch: boolean): void; + + /** This method is used to find and replace all data by sheet in Spreadsheet. + * @param {string} Pass the search data. + * @param {string} Pass the replace data. + * @param {boolean} Pass true, if you want to match with case-sensitive. + * @param {boolean} Pass true, if you want to match with entire cell contents. + * @returns {void} + */ + replaceAllBySheet(findData: string,replaceData: string,isCSen: boolean,isEMatch: boolean): void; +} + +export interface XLSelection { + + /** This method is used to get the selected cells element based on specified sheet index in the Spreadsheet. + * @param {number} Pass the sheet index to get the cells element. + * @returns {HTMLElement} + */ + getSelectedCells(sheetIdx: number): HTMLElement; + + /** This method is used to refresh the selection in the Spreadsheet. + * @param {Array} Optional. Pass range to refresh selection. + * @returns {void} + */ + refreshSelection(range: Array): void; + + /** This method is used to select a single column in the Spreadsheet. + * @param {number} Pass the column index value. + * @returns {void} + */ + selectColumn(colIdx: number): void; + + /** This method is used to select entire columns in a specified range (start index and end index) in the Spreadsheet. + * @param {number} Pass the column start index. + * @param {number} Pass the column end index. + * @returns {void} + */ + selectColumns(startIdx: number,endIdx: number): void; + + /** This method is used to select the specified range of cells in the Spreadsheet. + * @param {string} Pass range which want to select. + * @param {any} Pass the row and column index of the end cell. + * @returns {void} + */ + selectRange(range: string,endCell: any): void; + + /** This method is used to select a single row in the Spreadsheet. + * @param {number} Pass the row index value. + * @returns {void} + */ + selectRow(rowIdx: number): void; + + /** This method is used to select entire rows in a specified range (start index and end index) in the Spreadsheet. + * @param {number} Pass the start row index. + * @param {number} Pass the end row index. + * @returns {void} + */ + selectRows(startIdx: number,endIdx: number): void; + + /** This method is used to select all cells in active sheet. + * @returns {void} + */ + selectSheet(): void; +} + +export interface XLSort { + + /** This method is used to sort a particular range of cells based on its cell or font color in the Spreadsheet. + * @param {string} Pass 'PutCellColor' to sort by cell color or 'PutFontColor' for by font color. + * @param {any} Pass the HEX color code to sort. + * @param {string} Pass the range + * @returns {void} + */ + sortByColor(operation: string,color: any,range: string): void; + + /** This method is used to sort a particular range of cells based on its values in the Spreadsheet. + * @param {Array|string} Pass the range to sort. + * @param {string} Pass the column name. + * @param {any} Pass the direction to sort (ascending or descending). + * @returns {void} + */ + sortByRange(range: Array|string,columnName: string,direction: any): void; +} + +export interface XLValidate { + + /** This method is used to apply data validation rules in a selected range of cells based on the defined condition in the Spreadsheet. + * @param {string} If range is specified, it will apply rules for the specified range else it will use the current selected range. + * @param {Array} Pass the validation condition, value1 and value2. + * @param {string} Pass the data type. + * @param {boolean} Pass 'true' if you ignore blank values. + * @param {boolean} Pass 'true' if you want to show an error alert. + * @returns {void} + */ + applyDVRules(range: string,values: Array,type: string,required: boolean,showErrorAlert: boolean): void; + + /** This method is used to clear the applied validation rules in a specified range of cells in the Spreadsheet. + * @param {string} Optional. If range is specified, it will clear rules for the specified range else it will use the current selected range. + * @returns {void} + */ + clearDV(range: string): void; + + /** This method is used to highlight invalid data in a specified range of cells in the Spreadsheet. + * @param {string} Optional. If range is specified, it will clear rules for the specified range else it will use the current selected range. + * @returns {void} + */ + highlightInvalidData(range: string): void; +} + +export interface Model { + + /**Gets or sets an active sheet index in the Spreadsheet. By defining this value, you can specify which sheet should be active in workbook. + * @Default {1} + */ + activeSheetIndex?: number; + + /**Gets or sets a value that indicates whether to enable or disable auto rendering of cell type in the Spreadsheet. + * @Default {false} + */ + allowAutoCellType?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable auto fill feature in the Spreadsheet. + * @Default {true} + */ + allowAutoFill?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable auto sum feature in the Spreadsheet. + * @Default {true} + */ + allowAutoSum?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable cell format feature in the Spreadsheet. By enabling this, you can customize styles and number formats. + * @Default {true} + */ + allowCellFormatting?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable cell type feature in the Spreadsheet. + * @Default {false} + */ + allowCellType?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable chart feature in the Spreadsheet. By enabling this feature, you can create and customize charts in Spreadsheet. + * @Default {true} + */ + allowCharts?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable clipboard feature in the Spreadsheet. By enabling this feature, you can perform cut/copy and paste operations in Spreadsheet. + * @Default {true} + */ + allowClipboard?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable comment feature in the Spreadsheet. By enabling this, you can add/delete/modify comments in Spreadsheet. + * @Default {true} + */ + allowComments?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable Conditional Format feature in the Spreadsheet. By enabling this, you can apply formatting to the selected range of cells based on the provided conditions (Greater than, Less than, Equal, Between, Contains, etc.).Note: allowCellFormatting must be true while using conditional formatting. + * @Default {true} + */ + allowConditionalFormats?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable data validation feature in the Spreadsheet. + * @Default {true} + */ + allowDataValidation?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable the delete action in the Spreadsheet. By enabling this feature, you can delete existing rows, columns, cells and sheet. + * @Default {true} + */ + allowDelete?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable drag and drop feature in the Spreadsheet. + * @Default {true} + */ + allowDragAndDrop?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable the edit action in the Spreadsheet. + * @Default {true} + */ + allowEditing?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable filtering feature in the Spreadsheet. Filtering can be used to limit the data displayed using required criteria. + * @Default {true} + */ + allowFiltering?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable table feature in the Spreadsheet. By enabling this, you can render table in selected range. + * @Default {true} + */ + allowFormatAsTable?: boolean; + + /**Get or sets a value that indicates whether to enable or disable format painter feature in the Spreadsheet. By enabling this feature, you can copy the format from the selected range and apply it to another range. + * @Default {true} + */ + allowFormatPainter?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable formula bar in the Spreadsheet. + * @Default {true} + */ + allowFormulaBar?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable freeze pane support in Spreadsheet. After enabling this feature, you can use freeze top row, freeze first column and freeze panes options. + * @Default {true} + */ + allowFreezing?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable hyperlink feature in the Spreadsheet. By enabling this feature, you can add hyperlink which is used to easily navigate to the cell reference from one sheet to another or a web page. + * @Default {true} + */ + allowHyperlink?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable import feature in the Spreadsheet. By enabling this feature, you can open existing Spreadsheet documents. + * @Default {true} + */ + allowImport?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable the insert action in the Spreadsheet. By enabling this feature, you can insert new rows, columns, cells and sheet. + * @Default {true} + */ + allowInsert?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable keyboard navigation feature in the Spreadsheet. + * @Default {true} + */ + allowKeyboardNavigation?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable lock cell feature in the Spreadsheet. + * @Default {true} + */ + allowLockCell?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable merge feature in the Spreadsheet. + * @Default {true} + */ + allowMerging?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable resizing feature in the Spreadsheet. By enabling this feature, you can change the column width and row height by dragging its header boundaries. + * @Default {true} + */ + allowResizing?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable find and replace feature in the Spreadsheet. By enabling this, you can easily find and replace a specific value in the sheet or workbook. By using goto behavior, you can select and highlight all cells that contains specific data or data types. + * @Default {true} + */ + allowSearching?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable selection in the Spreadsheet. By enabling this feature, selected items will be highlighted. + * @Default {true} + */ + allowSelection?: boolean; + + /**Gets or sets a value that indicates whether to enable the sorting feature in the Spreadsheet. + * @Default {true} + */ + allowSorting?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable undo and redo feature in the Spreadsheet. + * @Default {true} + */ + allowUndoRedo?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable wrap text feature in the Spreadsheet. By enabling this, cell content can wrap to the next line, if the cell content exceeds the boundary of the cell. + * @Default {true} + */ + allowWrap?: boolean; + + /**Gets or sets a value that indicates to define the width of the activation panel in Spreadsheet. + * @Default {200} + */ + apWidth?: number; + + /**Gets or sets an object that indicates to customize the auto fill behavior in the Spreadsheet. + */ + autoFillSettings?: AutoFillSettings; + + /**Gets or sets an object that indicates to customize the chart behavior in the Spreadsheet. + */ + chartSettings?: ChartSettings; + + /**Gets or sets a value that defines the number of columns displayed in the sheet. + * @Default {21} + */ + columnCount?: number; + + /**Gets or sets a value that indicates to define the common width for each column in the Spreadsheet. + * @Default {60} + */ + columnWidth?: number; + + /**Gets or sets a value that indicates to render the spreadsheet with custom theme. + */ + cssClass?: string; + + /**Gets or sets a value that indicates whether to enable or disable context menu in the Spreadsheet. + * @Default {true} + */ + enableContextMenu?: boolean; + + /**Gets or sets an object that indicates to customize the exporting behavior in Spreadsheet. + */ + exportSettings?: ExportSettings; + + /**Gets or sets an object that indicates to customize the format behavior in the Spreadsheet. + */ + formatSettings?: FormatSettings; + + /**Gets or sets an object that indicates to customize the import behavior in the Spreadsheet. + */ + importSettings?: ImportSettings; + + /**Gets or sets a value that indicates whether to customizing the user interface (UI) as locale-specific in order to display regional data (i.e.) in a language and culture specific to a particular country or region. + * @Default {en-US} + */ + locale?: string; + + /**Gets or sets an object that indicates to customize the picture behavior in the Spreadsheet. + */ + pictureSettings?: PictureSettings; + + /**Gets or sets an object that indicates to customize the print option in Spreadsheet. + */ + printSettings?: PrintSettings; + + /**Gets or sets a value that indicates whether to define the number of rows to be displayed in the sheet. + * @Default {20} + */ + rowCount?: number; + + /**Gets or sets a value that indicates to define the common height for each row in the sheet. + * @Default {20} + */ + rowHeight?: number; + + /**Gets or sets an object that indicates to customize the scroll options in the Spreadsheet. + */ + scrollSettings?: ScrollSettings; + + /**Gets or sets an object that indicates to customize the selection options in the Spreadsheet. + */ + selectionSettings?: SelectionSettings; + + /**Gets or sets a value that indicates to define the number of sheets to be created at the initial load. + * @Default {1} + */ + sheetCount?: number; + + /**Gets or sets an object that indicates to customize the sheet behavior in Spreadsheet. + */ + sheets?: Array; + + /**Gets or sets a value that indicates whether to show or hide ribbon in the Spreadsheet. + * @Default {true} + */ + showRibbon?: boolean; + + /**This is used to set the number of undo-redo steps in the Spreadsheet. + * @Default {20} + */ + undoRedoStep?: number; + + /**Define the username for the Spreadsheet which is displayed in comment. + * @Default {User Name} + */ + userName?: string; + + /**Triggered for every action before its starts.*/ + actionBegin? (e: ActionBeginEventArgs): void; + + /**Triggered for every action complete.*/ + actionComplete? (e: ActionCompleteEventArgs): void; + + /**Triggered when the auto fill operation begins.*/ + autoFillBegin? (e: AutoFillBeginEventArgs): void; + + /**Triggered when the auto fill operation completes.*/ + autoFillComplete? (e: AutoFillCompleteEventArgs): void; + + /**Triggered before the cells to be formatted.*/ + beforeCellFormat? (e: BeforeCellFormatEventArgs): void; + + /**Triggered before the cell selection.*/ + beforeCellSelect? (e: BeforeCellSelectEventArgs): void; + + /**Triggered before the selected cells are dropped.*/ + beforeDrop? (e: BeforeDropEventArgs): void; + + /**Triggered before the contextmenu is open.*/ + beforeOpen? (e: BeforeOpenEventArgs): void; + + /**Triggered before the activation panel is open.*/ + beforePanelOpen? (e: BeforePanelOpenEventArgs): void; + + /**Triggered when click on sheet cell.*/ + cellClick? (e: CellClickEventArgs): void; + + /**Triggered when the cell is edited.*/ + cellEdit? (e: CellEditEventArgs): void; + + /**Triggered when mouse hover on cell in sheets.*/ + cellHover? (e: CellHoverEventArgs): void; + + /**Triggered when save the edited cell.*/ + cellSave? (e: CellSaveEventArgs): void; + + /**Triggered when click the contextmenu items.*/ + contextMenuClick? (e: ContextMenuClickEventArgs): void; + + /**Triggered when the selected cells are being dragged.*/ + drag? (e: DragEventArgs): void; + + /**Triggered when the selected cells are initiated to drag.*/ + dragStart? (e: DragStartEventArgs): void; + + /**Triggered when the selected cells are dropped.*/ + drop? (e: DropEventArgs): void; + + /**Triggered before the range editing starts.*/ + editRangeBegin? (e: EditRangeBeginEventArgs): void; + + /**Triggered after range editing completes.*/ + editRangeComplete? (e: EditRangeCompleteEventArgs): void; + + /**Triggered before the sheet is loaded.*/ + load? (e: LoadEventArgs): void; + + /**Triggered after the sheet is loaded.*/ + loadComplete? (e: LoadCompleteEventArgs): void; + + /**Triggered every click of the menu item.*/ + menuClick? (e: MenuClickEventArgs): void; + + /**Triggered when import sheet is failed to open.*/ + openFailure? (e: OpenFailureEventArgs): void; + + /**Triggered when pager item is clicked in the Spreadsheet.*/ + pagerClick? (e: PagerClickEventArgs): void; + + /**Triggered when click on the ribbon.*/ + ribbonClick? (e: RibbonClickEventArgs): void; + + /**Triggered when the chart series rendering.*/ + seriesRendering? (e: SeriesRenderingEventArgs): void; + + /**Triggered when click the ribbon tab.*/ + tabClick? (e: TabClickEventArgs): void; + + /**Triggered when select the ribbon tab.*/ + tabSelect? (e: TabSelectEventArgs): void; +} + +export interface ActionBeginEventArgs { + + /**Returns the applied style format object. + */ + afterFormat?: any; + + /**Returns the applied style format object. + */ + beforeFormat?: any; + + /**Returns the sheet index. + */ + sheetIdx?: number; + + /**Returns the cell range. + */ + range?: Array; + + /**Returns the action format. + */ + reqType?: string; + + /**Returns goto index while paging. + */ + gotoIdx?: number; + + /**Returns boolean value. If create new sheet it returns true. + */ + newSheet?: boolean; + + /**Return column name while sorting. + */ + columnName?: string; + + /**Returns selected columns while sorting or filtering begins. + */ + colSelected?: number; + + /**Returns sort direction while sort action begins. + */ + sortDirection?: string; +} + +export interface ActionCompleteEventArgs { + + /**Returns Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the applied cell format object. + */ + selectedCell?: Array|any; + + /**Returns the sheet index. + */ + sheetIdx?: number; + + /**Returns the request type. + */ + reqType?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface AutoFillBeginEventArgs { + + /**Returns auto fill begin cell range. + */ + dataRange?: Array; + + /**Returns which direction drag the auto fill. + */ + direction?: string; + + /**Returns fill cells range. + */ + fillRange?: Array; + + /**Returns the auto fill type. + */ + fillType?: string; + + /**Returns the sheet index. + */ + sheetIdx?: number; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface AutoFillCompleteEventArgs { + + /**Returns auto fill begin cell range. + */ + dataRange?: Array; + + /**Returns which direction to drag the auto fill. + */ + direction?: string; + + /**Returns fill cells range. + */ + fillRange?: Array; + + /**Returns the auto fill type. + */ + fillType?: string; + + /**Returns the sheet index. + */ + sheetIdx?: number; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface BeforeCellFormatEventArgs { + + /**Returns the sheet index. + */ + sheetIdx?: number; + + /**Returns the applied style format object. + */ + format?: any; + + /**Returns the selected cells. + */ + cells?: Array|any; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface BeforeCellSelectEventArgs { + + /**Returns the previous cell range. + */ + prevRange?: Array; + + /**Returns the current cell range. + */ + currRange?: Array; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface BeforeDropEventArgs { + + /**Returns the sheet index. + */ + sheetIdx?: number; + + /**Returns the current cell row and column index. + */ + currentCell?: any; + + /**Returns the drag cells range object. + */ + dragAndDropRange?: any; + + /**Returns the cell Overwriting alert option value. + */ + preventAlert?: boolean; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the target item. + */ + target?: HTMLElement; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface BeforeOpenEventArgs { + + /**Returns the target element. + */ + target?: HTMLElement; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface BeforePanelOpenEventArgs { + + /**Returns the sheet index. + */ + sheetIdx?: number; + + /**Returns the activation panel element. + */ + activationPanel?: any; + + /**Returns the range option value. + */ + range?: any; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface CellClickEventArgs { + + /**Returns the click cell element. + */ + cell?: HTMLElement; + + /**Returns the column index of clicked cell. + */ + columnIndex?: number; + + /**Returns the row index of clicked cell. + */ + rowIndex?: number; + + /**Returns the column name of clicked cell. + */ + columnName?: string; + + /**Returns the column information. + */ + columnObject?: any; +} + +export interface CellEditEventArgs { + + /**Returns the click cell element. + */ + cell?: HTMLElement; + + /**Returns the columnName of clicked cell. + */ + columnName?: string; + + /**Returns the column field information. + */ + columnObject?: any; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface CellHoverEventArgs { + + /**Returns the target element. + */ + target?: HTMLElement; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface CellSaveEventArgs { + + /**Returns the save cell element. + */ + cell?: HTMLElement; + + /**Returns the columnName of clicked cell. + */ + columnName?: string; + + /**Returns the column field information. + */ + columnObject?: any; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the cell previous value. + */ + pValue?: string; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the cell value. + */ + value?: string; +} + +export interface ContextMenuClickEventArgs { + + /**Returns target element Id. + */ + Id?: string; + + /**Returns the target element. + */ + element?: HTMLElement; + + /**Returns event information. + */ + event?: any; + + /**Returns target element and event information. + */ + events?: any; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns target element parent Id. + */ + parentId?: string; + + /**Returns target element parent text. + */ + parentText?: string; + + /**Returns target element text. + */ + text?: string; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface DragEventArgs { + + /**Returns the sheet index. + */ + sheetIdx?: number; + + /**Returns the current cell row and column index. + */ + currentCell?: any; + + /**Returns the drag cells range object. + */ + dragAndDropRange?: any; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the target item. + */ + target?: HTMLElement; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface DragStartEventArgs { + + /**Returns the sheet index. + */ + sheetIdx?: number; + + /**Returns the current cell row and column index. + */ + currentCell?: any; + + /**Returns the drag cells range object. + */ + dragAndDropRange?: any; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the target item. + */ + target?: HTMLElement; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface DropEventArgs { + + /**Returns the sheet index. + */ + sheetIdx?: number; + + /**Returns the current cell row and column index. + */ + currentCell?: any; + + /**Returns the drag cells range object. + */ + dragAndDropRange?: any; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the target item. + */ + target?: HTMLElement; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface EditRangeBeginEventArgs { + + /**Returns the sheet index. + */ + sheetIdx?: number; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the range option value. + */ + range?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface EditRangeCompleteEventArgs { + + /**Returns the sheet index. + */ + sheetIdx?: number; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the range option value. + */ + range?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface LoadEventArgs { + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the active sheet index. + */ + sheetIndex?: number; +} + +export interface LoadCompleteEventArgs { + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface MenuClickEventArgs { + + /**Returns menu click element. + */ + element?: HTMLElement; + + /**Returns the event information. + */ + event?: any; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns target element parent Id. + */ + parentId?: string; + + /**Returns target element parent text. + */ + parentText?: string; + + /**Returns target element text. + */ + text?: string; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface OpenFailureEventArgs { + + /**Returns the failure type. + */ + failureType?: string; + + /**Returns the status index. + */ + status?: number; + + /**Returns the status in text. + */ + statusText?: string; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface PagerClickEventArgs { + + /**Returns the active sheet index. + */ + activeSheet?: number; + + /**Returns the new sheet index. + */ + gotoSheet?: number; + + /**Returns whether new sheet icon is clicked. + */ + newSheet?: boolean; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface RibbonClickEventArgs { + + /**Returns element Id. + */ + Id?: string; + + /**Returns target information. + */ + prop?: any; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns status. + */ + status?: boolean; + + /**Returns isChecked in boolean. + */ + isChecked?: boolean; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface SeriesRenderingEventArgs { + + /**Returns chart data and chart information. + */ + data?: any; + + /**Returns the chart model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface TabClickEventArgs { + + /**Returns the active tab index. + */ + activeIndex?: number; + + /**Returns active tab header element. + */ + activeHeader?: any; + + /**Returns previous active tab header element. + */ + prevActiveHeader?: any; + + /**Returns previous active tab index. + */ + prevActiveIndex?: number; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface TabSelectEventArgs { + + /**Returns the active tab index. + */ + activeIndex?: number; + + /**Returns active tab header element. + */ + activeHeader?: any; + + /**Returns previous active tab header element. + */ + prevActiveHeader?: any; + + /**Returns previous active tab index. + */ + prevActiveIndex?: number; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface AutoFillSettings { + + /**This property is used to set fillType unit in Spreadsheet. It has five types which are CopyCells, FillSeries, FillFormattingOnly, FillWithoutFormatting and FlashFill. + * @Default {ej.Spreadsheet.AutoFillOptions.FillSeries} + */ + fillType?: ej.Spreadsheet.AutoFillOptions|string; + + /**Gets or sets a value that indicates to enable or disable auto fill options in the Spreadsheet. + * @Default {true} + */ + showFillOptions?: boolean; +} + +export interface ChartSettings { + + /**Gets or sets a value that defines the chart height in Spreadsheet. + * @Default {220} + */ + height?: number; + + /**Gets or sets a value that defines the chart width in the Spreadsheet. + * @Default {440} + */ + width?: number; +} + +export interface ExportSettings { + + /**Gets or sets a value that indicates whether to enable or disable save feature in Spreadsheet. By enabling this feature, you can save existing Spreadsheet. + * @Default {true} + */ + allowExporting?: boolean; + + /**Gets or sets a value that indicates to define csvUrl for export to csv format. + * @Default {null} + */ + csvUrl?: string; + + /**Gets or sets a value that indicates to define excelUrl for export to excel format.Note: User must specify allowExporting true while use this property. + * @Default {null} + */ + excelUrl?: string; + + /**Gets or sets a value that indicates to define password while export to excel format. + * @Default {null} + */ + password?: string; +} + +export interface FormatSettings { + + /**Gets or sets a value that indicates whether to enable or disable cell border feature in the Spreadsheet. + * @Default {true} + */ + allowCellBorder?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable decimal places in the Spreadsheet. + * @Default {true} + */ + allowDecimalPlaces?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable font family feature in Spreadsheet. + * @Default {true} + */ + allowFontFamily?: boolean; +} + +export interface ImportSettings { + + /**Sets import mapper to perform import feature in Spreadsheet. + */ + importMapper?: string; + + /**Sets import Url to access the online files in the Spreadsheet. + */ + importUrl?: string; + + /**Gets or sets a value that indicates to define password while importing in the Spreadsheet. + */ + password?: string; +} + +export interface PictureSettings { + + /**Gets or sets a value that indicates whether to enable or disable picture feature in Spreadsheet. By enabling this, you can add pictures in Spreadsheet. + * @Default {true} + */ + allowPictures?: boolean; + + /**Gets or sets a value that indicates to define height to picture in the Spreadsheet. + * @Default {220} + */ + height?: number; + + /**Gets or sets a value that indicates to define width to picture in the Spreadsheet. + * @Default {440} + */ + width?: number; +} + +export interface PrintSettings { + + /**Gets or sets a value that indicates whether to enable or disable page setup support for printing in Spreadsheet. + * @Default {true} + */ + allowPageSetup?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable page size support for printing in Spreadsheet. + * @Default {false} + */ + allowPageSize?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable print feature in the Spreadsheet. + * @Default {true} + */ + allowPrinting?: boolean; +} + +export interface ScrollSettings { + + /**Gets or sets a value that indicates whether to enable or disable scrolling in Spreadsheet. + * @Default {true} + */ + allowScrolling?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable sheet on demand. By enabling this, it render only the active sheet element while paging remaining sheets are created one by one. + * @Default {false} + */ + allowSheetOnDemand?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable virtual scrolling feature in the Spreadsheet. + * @Default {true} + */ + allowVirtualScrolling?: boolean; + + /**Gets or sets the value that indicates to define the height of spreadsheet. + * @Default {550} + */ + height?: number|string; + + /**Gets or sets the value that indicates whether to enable or disable responsive mode in the Spreadsheet. + * @Default {false} + */ + isResponsive?: boolean; + + /**Gets or sets a value that indicates to set scroll mode in Spreadsheet. It has two scroll modes, Normal and Infinite. + * @Default {ej.Spreadsheet.scrollMode.Infinite} + */ + scrollMode?: ej.Spreadsheet.scrollMode|string; + + /**Gets or sets the value that indicates to define the height off spreadsheet. + * @Default {1200} + */ + width?: number|string; +} + +export interface SelectionSettings { + + /**Gets or sets a value that indicates to define active cell in spreadsheet. + */ + activeCell?: string; + + /**Gets or sets a value that indicates to define animation time while selection in the Spreadsheet. + * @Default {0.001} + */ + animationTime?: number; + + /**Gets or sets a value that indicates to enable or disable animation while selection.Note: allowSelection must be true while using this property. + * @Default {false} + */ + enableAnimation?: boolean; + + /**Gets or sets a value that indicates to set selection type in Spreadsheet. It has three types which are Column, Row and default. + * @Default {ej.Spreadsheet.SelectionType.Default} + */ + selectionType?: ej.Spreadsheet.SelectionType|string; + + /**Gets or sets a value that indicates to set selection unit in Spreadsheet. It has three types which are Single, Range and MultiRange. + * @Default {ej.Spreadsheet.SelectionUnit.MultiRange} + */ + selectionUnit?: ej.Spreadsheet.SelectionUnit|string; +} + +export interface SheetsRangeSettings { + + /**Gets or sets the data to render the Spreadsheet. + */ + dataSource?: any; + + /**Specifies the header styles for the datasource range in Spreadsheet. + * @Default {null} + */ + headerStyles?: any; + + /**Specifies the primary key for the datasource in Spreadsheet. + */ + primaryKey?: string; + + /**Specifies the query for the datasource in Spreadsheet. + * @Default {null} + */ + query?: any; + + /**Gets or sets a value that indicates whether to enable or disable the datasource header in Spreadsheet. + * @Default {false} + */ + showHeader?: boolean; + + /**Specifies the start cell for the datasource range in Spreadsheet. + * @Default {A1} + */ + startCell?: string; +} + +export interface Sheets { + + /**Gets or sets a value that indicates to define column count in the Spreadsheet. + * @Default {21} + */ + colCount?: number; + + /**Gets or sets a value that indicates to define column width in the Spreadsheet. + * @Default {64} + */ + columnWidth?: number; + + /**Gets or sets the data to render the Spreadsheet. + */ + dataSource?: any; + + /**Gets or sets a value that indicates whether to enable or disable field as column header in the Spreadsheet. + * @Default {false} + */ + fieldAsColumnHeader?: boolean; + + /**Specifies the header styles for the datasource range in Spreadsheet. + * @Default {null} + */ + headerStyles?: any; + + /**Specifies the primary key for the datasource in Spreadsheet. + */ + primaryKey?: string; + + /**Specifies the query for the datasource in Spreadsheet. + * @Default {null} + */ + query?: any; + + /**Specifies single range or multiple range settings for a sheet in Spreadsheet. + */ + rangeSettings?: Array; + + /**Gets or sets a value that indicates to define row count in the Spreadsheet. + * @Default {20} + */ + rowCount?: number; + + /**Gets or sets a value that indicates whether to show or hide grid lines in the Spreadsheet. + * @Default {true} + */ + showGridlines?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable the datasource header in Spreadsheet. + * @Default {false} + */ + showHeader?: boolean; + + /**Gets or sets a value that indicates whether to show or hide headings in the Spreadsheet. + * @Default {true} + */ + showHeadings?: boolean; + + /**Specifies the start cell for the datasource range in Spreadsheet. + * @Default {A1} + */ + startCell?: string; +} + +enum AutoFillOptions{ + + ///Specifies the CopyCells property in AutoFillOptions. + CopyCells, + + ///Specifies the FillSeries property in AutoFillOptions. + FillSeries, + + ///Specifies the FillFormattingOnly property in AutoFillOptions. + FillFormattingOnly, + + ///Specifies the FillWithoutFormatting property in AutoFillOptions. + FillWithoutFormatting, + + ///Specifies the FlashFill property in AutoFillOptions. + FlashFill +} + + +enum scrollMode{ + + ///To enable Infinite scroll mode for Spreadsheet. + Infinite, + + ///To enable Normal scroll mode for Spreadsheet. + Normal +} + + +enum SelectionType{ + + ///To select only Column in Spreadsheet. + Column, + + ///To select only Row in Spreadsheet. + Row, + + ///To select both Column/Row in Spreadsheet. + Default +} + + +enum SelectionUnit{ + + ///To enable Single selection in Spreadsheet. + Single, + + ///To enable Range selection in Spreadsheet. + Range, + + ///To enable MultiRange selection in Spreadsheet. + MultiRange +} + +} + +} +declare module ej.olap { + +class OlapChart extends ej.Widget { + static fn: OlapChart; + constructor(element: JQuery, options?: OlapChart.Model); + constructor(element: Element, options?: OlapChart.Model); + model:OlapChart.Model; + defaults:OlapChart.Model; + + /** Perform an asynchronous HTTP (AJAX) request. + * @returns {void} + */ + doAjaxPost(): void; + + /** Perform an asynchronous HTTP (FullPost) submit. + * @returns {void} + */ + doPostBack(): void; + + /** Exports the OlapChart to an appropriate format based on the parameter passed. + * @returns {void} + */ + exportOlapChart(): void; + + /** This function receives the JSON formatted datasource to render the OlapChart control. + * @returns {void} + */ + renderChartFromJSON(): void; + + /** This function receives the update from service-end, which would be utilized for rendering the widget. + * @returns {void} + */ + renderControlSuccess(): void; +} +export module OlapChart{ + +export interface Model { + + /**Specifies the CSS class to OlapChart to achieve custom theme. + * @Default {“”} + */ + cssClass?: string; + + /**Contains the serialized OlapReport at that instant, that is, current OlapReport. + * @Default {“”} + */ + currentReport?: string; + + /**Object utilized to pass additional information between client-end and service-end. + * @Default {{}} + */ + customObject?: any; + + /**Allows the user to enable 3D view of OlapChart. + * @Default {false} + */ + enable3D?: boolean; + + /**Allows the user to enable OlapChart’s responsiveness in the browser layout. + * @Default {false} + */ + isResponsive?: boolean; + + /**Allows the user to set the localized language for the widget. + * @Default {en-US} + */ + locale?: string; + + /**Allows the user to rotate the angle of OlapChart in 3D view. + * @Default {0} + */ + rotation?: number; + + /**Allows the user to set custom name for the methods at service-end, communicated on AJAX post. + * @Default {{}} + */ + serviceMethodSettings?: ServiceMethodSettings; + + /**Connects the service using the specified URL for any server updates. + * @Default {“”} + */ + url?: string; + + /**Triggers when it reaches client-side after any AJAX request.*/ + afterServiceInvoke? (e: AfterServiceInvokeEventArgs): void; + + /**Triggers before any AJAX request is passed from OlapChart to service methods.*/ + beforeServiceInvoke? (e: BeforeServiceInvokeEventArgs): void; + + /**Triggers when drill up/down happens in OlapChart control.*/ + drillSuccess? (e: DrillSuccessEventArgs): void; + + /**Triggers when OlapChart widget completes all operations at client-side after any AJAX request.*/ + renderComplete? (e: RenderCompleteEventArgs): void; + + /**Triggers when any error occurred during AJAX request.*/ + renderFailure? (e: RenderFailureEventArgs): void; + + /**Triggers when OlapChart successfully reaches client-side after any AJAX request.*/ + renderSuccess? (e: RenderSuccessEventArgs): void; +} + +export interface AfterServiceInvokeEventArgs { + + /**return the current action of OlapChart control. + */ + action?: string; + + /**return the custom object bounds with OlapChart control. + */ + customObject?: any; + + /**return the outer HTML of OlapChart control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapChart model. + */ + model?: ej.olap.OlapChart.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface BeforeServiceInvokeEventArgs { + + /**return the current action of OlapChart control. + */ + action?: string; + + /**return the custom object bounds with OlapChart control. + */ + customObject?: any; + + /**return the outer HTML of OlapChart control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapChart model. + */ + model?: ej.olap.OlapChart.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface DrillSuccessEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapChart model. + */ + model?: ej.olap.OlapChart.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RenderCompleteEventArgs { + + /**return the current action of OlapChart control. + */ + action?: string; + + /**return the custom object bounds with OlapChart control. + */ + customObject?: any; + + /**return the outer HTML of OlapChart control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapChart model. + */ + model?: ej.olap.OlapChart.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RenderFailureEventArgs { + + /**return the current action of OlapChart control. + */ + action?: string; + + /**return the custom object bounds with OlapChart control. + */ + customObject?: any; + + /**return the error stack trace of the original exception. + */ + message?: any; + + /**return the outer HTML of OlapChart control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapChart model. + */ + model?: ej.olap.OlapChart.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RenderSuccessEventArgs { + + /**return the current action of OlapChart control. + */ + action?: string; + + /**return the custom object bounds with OlapChart control. + */ + customObject?: any; + + /**return the outer HTML of OlapChart control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapChart model. + */ + model?: ej.olap.OlapChart.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface ServiceMethodSettings { + + /**Allows the user to set the custom name for the service method that’s responsible for exporting. + * @Default {Export} + */ + exportOlapChart?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for drilling up/down operation in OlapChart. + * @Default {DrillChart} + */ + drillDown?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for initializing OlapChart. + * @Default {InitializeChart} + */ + initialize?: string; +} +} + +class OlapClient extends ej.Widget { + static fn: OlapClient; + constructor(element: JQuery, options?: OlapClient.Model); + constructor(element: Element, options?: OlapClient.Model); + model:OlapClient.Model; + defaults:OlapClient.Model; + + /** Perform an asynchronous HTTP (AJAX) request. + * @returns {void} + */ + doAjaxPost(): void; + + /** Perform an asynchronous HTTP (FullPost) submit. + * @returns {void} + */ + doPostBack(): void; +} +export module OlapClient{ + +export interface Model { + + /**Allows the user to set the specific chart type for OlapChart. + * @Default {ej.olap.OlapChart.ChartTypes.Column} + */ + chartType?: ej.olap.OlapChart.ChartTypes|string; + + /**Sets the mode to export the OLAP visualization components such as OlapChart and PivotGrid in OlapClient. Based on the option, either Chart or Grid or both gets exported. + * @Default {ej.olap.OlapClient.ClientExportMode.ChartAndGrid} + */ + clientExportMode?: string; + + /**Specifies the CSS class to OlapClient to achieve custom theme. + * @Default {“”} + */ + cssClass?: string; + + /**Object utilized to pass additional information between client-end and service-end. + * @Default {{}} + */ + customObject?: any; + + /**Allows the user to customize the widgets layout and appearance. + * @Default {{}} + */ + displaySettings?: DisplaySettings; + + /**Allows the user to refresh the control on-demand and not during every UI operation. + * @Default {false} + */ + enableDeferUpdate?: boolean; + + /**Enables/disables the visibility of measure group selector drop-down in Cube Browser. + * @Default {false} + */ + enableMeasureGroups?: boolean; + + /**Sets the summary layout for PivotGrid. Following are the ways in which summary can be positioned: normal summary (bottom), top summary, no summary and excel-like summary. + * @Default {ej.PivotGrid.Layout.Normal} + */ + gridLayout?: ej.PivotGrid.Layout|string; + + /**Allows the user to set the localized language for the widget. + * @Default {en-US} + */ + locale?: string; + + /**Allows the user to set custom name for the methods at service-end, communicated during AJAX post. + * @Default {{}} + */ + serviceMethodSettings?: ServiceMethodSettings; + + /**Sets the title for OlapClient widget. + * @Default {null} + */ + title?: string; + + /**Connects the service using the specified URL for any server updates. + * @Default {null} + */ + url?: string; + + /**Triggers when it reaches client-side after any AJAX request.*/ + afterServiceInvoke? (e: AfterServiceInvokeEventArgs): void; + + /**Triggers before any AJAX request is passed from OlapClient to service methods.*/ + beforeServiceInvoke? (e: BeforeServiceInvokeEventArgs): void; + + /**Triggers before rendering the OlapChart.*/ + chartLoad? (e: ChartLoadEventArgs): void; + + /**Triggers while we initiate loading of the widget.*/ + load? (e: LoadEventArgs): void; + + /**Triggers when OlapClient widget completes all operations at client-end after any AJAX request.*/ + renderComplete? (e: RenderCompleteEventArgs): void; + + /**Triggers when any error occurred during AJAX request.*/ + renderFailure? (e: RenderFailureEventArgs): void; + + /**Triggers when OlapClient successfully reaches client-side after any AJAX request.*/ + renderSuccess? (e: RenderSuccessEventArgs): void; +} + +export interface AfterServiceInvokeEventArgs { + + /**return the current action of OlapClient control. + */ + action?: string; + + /**return the custom object bounds with OlapClient control. + */ + customObject?: any; + + /**return the outer HTML of OlapClient control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapClient model. + */ + model?: ej.olap.OlapClient.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface BeforeServiceInvokeEventArgs { + + /**return the current action of OlapClient control. + */ + action?: string; + + /**return the custom object bounds with OlapClient control. + */ + customObject?: any; + + /**return the outer HTML of OlapClient control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapClient model. + */ + model?: ej.olap.OlapClient.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface ChartLoadEventArgs { + + /**return the current action of OlapChart control. + */ + action?: string; + + /**return the custom object bounds with OlapChart control. + */ + customObject?: any; + + /**return the outer HTML of OlapChart control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapChart model. + */ + model?: ej.olap.OlapClient.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface LoadEventArgs { + + /**returns the outer HTML of OlapClient component. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapClient model. + */ + model?: ej.olap.OlapClient.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RenderCompleteEventArgs { + + /**returns the custom object bounded with the control. + */ + customObject?: any; + + /**returns the outer HTML of OlapClient control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapClient model. + */ + model?: ej.olap.OlapClient.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RenderFailureEventArgs { + + /**returns the custom object bounded with the control. + */ + customObject?: any; + + /**returns the outer HTML of OlapClient control. + */ + element?: string; + + /**returns the error message with error code. + */ + message?: any; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapClient model. + */ + model?: ej.olap.OlapClient.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RenderSuccessEventArgs { + + /**returns the custom object bounded with the control. + */ + customObject?: any; + + /**returns the outer HTML of OlapClient control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapClient model. + */ + model?: ej.olap.OlapClient.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface DisplaySettings { + + /**Let’s the user to customize the display of OlapChart and PivotGrid widgets, either in tab view or in tile view. + * @Default {ej.olap.OlapClient.ControlPlacement.Tab} + */ + controlPlacement?: ej.olap.OlapClient.ControlPlacement|string; + + /**Let’s the user to set either Chart or Grid as the start-up widget. + * @Default {ej.olap.OlapClient.DefaultView.Grid} + */ + defaultView?: ej.olap.OlapClient.DefaultView|string; + + /**Enables/disables the full screen view of OlapChart and PivotGrid in OlapClient. + * @Default {false} + */ + enableFullScreen?: boolean; + + /**Enhances the space for PivotGrid and OlapChart, by hiding Cube Browser and Axis Element Builder. + * @Default {false} + */ + enableTogglePanel?: boolean; + + /**Allows the user to enable OlapClient’s responsiveness in the browser layout. + * @Default {false} + */ + isResponsive?: boolean; + + /**Sets the display mode (Only Chart/Only Grid/Both) in OlapClient. + * @Default {ej.olap.OlapClient.DisplayMode.ChartAndGrid} + */ + mode?: ej.olap.OlapClient.DisplayMode|string; +} + +export interface ServiceMethodSettings { + + /**Allows the user to set the custom name for the service method that’s responsible for updating the entire report and widget, while changing the Cube. + * @Default {CubeChanged} + */ + cubeChanged?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for exporting. + * @Default {Export} + */ + exportOlapClient?: string; + + /**Allows the user to set the custom name for the service method that’s responsible to get the members, for the tree-view inside member-editor dialog. + * @Default {FetchMemberTreeNodes} + */ + fetchMemberTreeNodes?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for fetching the report names from the database. + * @Default {FetchReportListFromDB} + */ + fetchReportList?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for updating report while filtering members. + * @Default {FilterElement} + */ + filterElement?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for initializing OlapClient. + * @Default {InitializeClient} + */ + initialize?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for loading the report collection from the database. + * @Default {LoadReportFromDB} + */ + loadReport?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for retrieving the MDX query for the current report. + * @Default {GetMDXQuery} + */ + mdxQuery?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for updating the tree-view inside Cube Browser, while changing the measure group. + * @Default {MeasureGroupChanged} + */ + measureGroupChanged?: string; + + /**Allows the user to set the custom name for the service method that’s responsible to get the child members, on tree-view node expansion. + * @Default {MemberExpanded} + */ + memberExpand?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for updating report while dropping a node/SplitButton inside Axis Element Builder. + * @Default {NodeDropped} + */ + nodeDropped?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for updating report while removing SplitButton from Axis Element Builder. + * @Default {RemoveSplitButton} + */ + removeSplitButton?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for saving the report collection to database. + * @Default {SaveReportToDB} + */ + saveReport?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for toggling the elements in row and column axes. + * @Default {ToggleAxis} + */ + toggleAxis?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for any toolbar operation. + * @Default {ToolbarOperations} + */ + toolbarServices?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for updating report collection. + * @Default {UpdateReport} + */ + updateReport?: string; +} +} +module OlapChart +{ +enum ChartTypes +{ +//To render a Line type for OlapChart. +Line, +//To render a Spline type for OlapChart. +Spline, +//To render a Column type for OlapChart. +Column, +//To render a Area type for OlapChart. +Area, +//To render a SplineArea type for OlapChart. +SplineArea, +//To render a StepLine type for OlapChart. +StepLine, +//To render a StepArea type for OlapChart. +StepArea, +//To render a Pie type for OlapChart. +Pie, +//To render a Bar type for OlapChart. +Bar, +//To render a StackingArea type for OlapChart. +StackingArea, +//To render a StackingColumn type for OlapChart. +StackingColumn, +//To render a StackingBar type for OlapChart. +StackingBar, +//To render a Pyramid type for OlapChart. +Pyramid, +//To render a Funnel type for OlapChart. +Funnel, +//To render a Doughnut type for OlapChart. +Doughnut, +//To render a Scatter type for OlapChart. +Scatter, +//To render a Bubble type for OlapChart. +Bubble, +} +} +module OlapClient +{ +enum ControlPlacement +{ +//To display OlapChart and PivotGrid widgets in tab view. +Tab, +//To display OlapChart and PivotGrid widgets within the same view, one below the other. +Tile, +} +} +module OlapClient +{ +enum DefaultView +{ +//To set OlapChart as a default control in view when the OlapClient widget is loaded for the first time. +Chart, +//To set PivotGrid as a default control in view when the OlapClient widget is loaded for the first time. +Grid, +} +} +module OlapClient +{ +enum DisplayMode +{ +//To display only OlapChart widget. +ChartOnly, +//To display only PivotGrid widget. +GridOnly, +//To display both OlapChart and PivotGrid widgets. +ChartAndGrid, +} +} + +class OlapGauge extends ej.Widget { + static fn: OlapGauge; + constructor(element: JQuery, options?: OlapGauge.Model); + constructor(element: Element, options?: OlapGauge.Model); + model:OlapGauge.Model; + defaults:OlapGauge.Model; + + /** Perform an asynchronous HTTP (AJAX) request. + * @returns {void} + */ + doAjaxPost(): void; + + /** This function is used to refresh the OlapGauge at client-side itself. + * @returns {void} + */ + refresh(): void; + + /** This function removes the KPI related images from OlapGauge. + * @returns {void} + */ + removeImg(): void; + + /** This function receives the JSON formatted datasource to render the OlapGauge control. + * @returns {void} + */ + renderControlFromJSON(): void; +} +export module OlapGauge{ + +export interface Model { + + /**Sets the number of column count to arrange the OlapGauge's. + * @Default {0} + */ + columnsCount?: number; + + /**Specify the CSS class to OlapGauge to achieve custom theme. + * @Default {“”} + */ + cssClass?: string; + + /**Object utilized to pass additional information between client-end and service-end. + * @Default {{}} + */ + customObject?: any; + + /**Enables/disables tooltip visibility in OlapGauge. + * @Default {false} + */ + enableTooltip?: boolean; + + /**Allows the user to enable OlapGauge’s responsiveness in the browser layout. + * @Default {false} + */ + isResponsive?: boolean; + + /**Allows the user to change the format of the label values in OlapGauge. + * @Default {ej.olap.OlapGauge.NumberFormat.Default} + */ + labelFormatSettings?: ej.olap.OlapGauge.NumberFormat|string; + + /**Allows the user to set the localized language for the widget. + * @Default {en-US} + */ + locale?: string; + + /**Sets the number of row count to arrange the OlapGauge's. + * @Default {0} + */ + rowsCount?: number; + + /**Sets the scale values such as pointers, indicators, etc... for OlapGauge. + * @Default {{}} + */ + scales?: any; + + /**Allows the user to set the custom name for the methods at service-end, communicated during AJAX post. + * @Default {{}} + */ + serviceMethodSettings?: ServiceMethodSettings; + + /**Enables/disables the header labels in OlapGauge. + * @Default {true} + */ + showHeaderLabel?: boolean; + + /**Connects the service using the specified URL for any server updates. + * @Default {“”} + */ + url?: string; + + /**Triggers when it reaches client-side after any AJAX request.*/ + afterServiceInvoke? (e: AfterServiceInvokeEventArgs): void; + + /**Triggers before any AJAX request is passed from OlapGauge to service methods.*/ + beforeServiceInvoke? (e: BeforeServiceInvokeEventArgs): void; + + /**Triggers when OlapGauge started loading at client-side.*/ + load? (e: LoadEventArgs): void; + + /**Triggers when OlapGauge widget completes all operations at client-side after any AJAX request.*/ + renderComplete? (e: RenderCompleteEventArgs): void; + + /**Triggers when any error occurred during AJAX request.*/ + renderFailure? (e: RenderFailureEventArgs): void; + + /**Triggers when OlapGauge successfully reaches client-side after any AJAX request.*/ + renderSuccess? (e: RenderSuccessEventArgs): void; +} + +export interface AfterServiceInvokeEventArgs { + + /**return the current action of OlapGauge control. + */ + action?: string; + + /**return the custom object bounds with OlapGauge control. + */ + customObject?: any; + + /**return the outer HTML of OlapGauge control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapGauge model. + */ + model?: ej.olap.OlapGauge.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface BeforeServiceInvokeEventArgs { + + /**return the current action of OlapGauge control. + */ + action?: string; + + /**return the custom object bounds with OlapGauge control. + */ + customObject?: any; + + /**return the outer HTML of OlapGauge control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapGauge model. + */ + model?: ej.olap.OlapGauge.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface LoadEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapGauge model. + */ + model?: ej.olap.OlapGauge.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RenderCompleteEventArgs { + + /**returns the outer HTML of OlapGauge control. + */ + element?: string; + + /**returns the custom object bounded with the control. + */ + customObject?: any; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapGauge model. + */ + model?: ej.olap.OlapGauge.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RenderFailureEventArgs { + + /**returns the outer HTML of OlapGauge control. + */ + element?: string; + + /**returns the custom object bounded with the control. + */ + customObject?: any; + + /**returns the error message with error code. + */ + message?: any; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapGauge model. + */ + model?: ej.olap.OlapGauge.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns the JSON formatted response while error occurs. + */ + responseJSON?: any; +} + +export interface RenderSuccessEventArgs { + + /**returns the outer HTML of OlapGauge control. + */ + element?: string; + + /**returns the custom object bounded with the control. + */ + customObject?: any; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapGauge model. + */ + model?: ej.olap.OlapGauge.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface LabelFormatSettings { + + /**Allows the user to change the number format of the label values in OlapGauge. + * @Default {ej.olap.OlapGauge.NumberFormat.Default} + */ + numberFormat?: ej.olap.OlapGauge.NumberFormat|string; + + /**Allows you to change the position of a digit on the right-hand side of the decimal point for label value. + * @Default {5} + */ + decimalPlaces?: number; + + /**Allows you to add a text at the beginning of the label. + */ + prefixText?: string; + + /**Allows you to add text at the end of the label. + */ + suffixText?: string; +} + +export interface ServiceMethodSettings { + + /**Allows the user to set the custom name for the service method that’s responsible for initializing OlapGauge. + * @Default {InitializeGauge} + */ + initialize?: string; +} +} +module OlapGauge +{ +enum NumberFormat +{ +//To set default format for label values. +Default, +//To set currency format for label values. +Currency, +//To set percentage format for label values. +Percentage, +//To set fraction format for label values. +Fraction, +//To set scientific format for label values. +Scientific, +//To set text format for label values. +Text, +//To set notation format for label values. +Notation, +} +} + +} +declare module ej.datavisualization { + +class LinearGauge extends ej.Widget { + static fn: LinearGauge; + constructor(element: JQuery, options?: LinearGauge.Model); + constructor(element: Element, options?: LinearGauge.Model); + model:LinearGauge.Model; + defaults:LinearGauge.Model; + + /** destroy the linear gauge all events bound using this._on will be unbind automatically and bring the control to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** To export Image + * @returns {void} + */ + exportImage(): void; + + /** To get Bar Distance From Scale in number + * @returns {void} + */ + getBarDistanceFromScale(): void; + + /** To get Bar Pointer Value in number + * @returns {void} + */ + getBarPointerValue(): void; + + /** To get Bar Width in number + * @returns {void} + */ + getBarWidth(): void; + + /** To get CustomLabel Angle in number + * @returns {void} + */ + getCustomLabelAngle(): void; + + /** To get CustomLabel Value in string + * @returns {void} + */ + getCustomLabelValue(): void; + + /** To get Label Angle in number + * @returns {void} + */ + getLabelAngle(): void; + + /** To get LabelPlacement in number + * @returns {void} + */ + getLabelPlacement(): void; + + /** To get LabelStyle in number + * @returns {void} + */ + getLabelStyle(): void; + + /** To get Label XDistance From Scale in number + * @returns {void} + */ + getLabelXDistanceFromScale(): void; + + /** To get PointerValue in number + * @returns {void} + */ + getLabelYDistanceFromScale(): void; + + /** To get Major Interval Value in number + * @returns {void} + */ + getMajorIntervalValue(): void; + + /** To get MarkerStyle in number + * @returns {void} + */ + getMarkerStyle(): void; + + /** To get Maximum Value in number + * @returns {void} + */ + getMaximumValue(): void; + + /** To get PointerValue in number + * @returns {void} + */ + getMinimumValue(): void; + + /** To get Minor Interval Value in number + * @returns {void} + */ + getMinorIntervalValue(): void; + + /** To get Pointer Distance From Scale in number + * @returns {void} + */ + getPointerDistanceFromScale(): void; + + /** To get PointerHeight in number + * @returns {void} + */ + getPointerHeight(): void; + + /** To get Pointer Placement in String + * @returns {void} + */ + getPointerPlacement(): void; + + /** To get PointerValue in number + * @returns {void} + */ + getPointerValue(): void; + + /** To get PointerWidth in number + * @returns {void} + */ + getPointerWidth(): void; + + /** To get Range Border Width in number + * @returns {void} + */ + getRangeBorderWidth(): void; + + /** To get Range Distance From Scale in number + * @returns {void} + */ + getRangeDistanceFromScale(): void; + + /** To get Range End Value in number + * @returns {void} + */ + getRangeEndValue(): void; + + /** To get Range End Width in number + * @returns {void} + */ + getRangeEndWidth(): void; + + /** To get Range Position in number + * @returns {void} + */ + getRangePosition(): void; + + /** To get Range Start Value in number + * @returns {void} + */ + getRangeStartValue(): void; + + /** To get Range Start Width in number + * @returns {void} + */ + getRangeStartWidth(): void; + + /** To get ScaleBarLength in number + * @returns {void} + */ + getScaleBarLength(): void; + + /** To get Scale Bar Size in number + * @returns {void} + */ + getScaleBarSize(): void; + + /** To get Scale Border Width in number + * @returns {void} + */ + getScaleBorderWidth(): void; + + /** To get Scale Direction in number + * @returns {void} + */ + getScaleDirection(): void; + + /** To get Scale Location in object + * @returns {void} + */ + getScaleLocation(): void; + + /** To get Scale Style in string + * @returns {void} + */ + getScaleStyle(): void; + + /** To get Tick Angle in number + * @returns {void} + */ + getTickAngle(): void; + + /** To get Tick Height in number + * @returns {void} + */ + getTickHeight(): void; + + /** To get getTickPlacement in number + * @returns {void} + */ + getTickPlacement(): void; + + /** To get Tick Style in string + * @returns {void} + */ + getTickStyle(): void; + + /** To get Tick Width in number + * @returns {void} + */ + getTickWidth(): void; + + /** To get get Tick XDistance From Scale in number + * @returns {void} + */ + getTickXDistanceFromScale(): void; + + /** To get Tick YDistance From Scale in number + * @returns {void} + */ + getTickYDistanceFromScale(): void; + + /** Specifies the scales. + * @returns {void} + */ + scales(): void; + + /** To set setBarDistanceFromScale + * @returns {void} + */ + setBarDistanceFromScale(): void; + + /** To set setBarPointerValue + * @returns {void} + */ + setBarPointerValue(): void; + + /** To set setBarWidth + * @returns {void} + */ + setBarWidth(): void; + + /** To set setCustomLabelAngle + * @returns {void} + */ + setCustomLabelAngle(): void; + + /** To set setCustomLabelValue + * @returns {void} + */ + setCustomLabelValue(): void; + + /** To set setLabelAngle + * @returns {void} + */ + setLabelAngle(): void; + + /** To set setLabelPlacement + * @returns {void} + */ + setLabelPlacement(): void; + + /** To set setLabelStyle + * @returns {void} + */ + setLabelStyle(): void; + + /** To set setLabelXDistanceFromScale + * @returns {void} + */ + setLabelXDistanceFromScale(): void; + + /** To set setLabelYDistanceFromScale + * @returns {void} + */ + setLabelYDistanceFromScale(): void; + + /** To set setMajorIntervalValue + * @returns {void} + */ + setMajorIntervalValue(): void; + + /** To set setMarkerStyle + * @returns {void} + */ + setMarkerStyle(): void; + + /** To set setMaximumValue + * @returns {void} + */ + setMaximumValue(): void; + + /** To set setMinimumValue + * @returns {void} + */ + setMinimumValue(): void; + + /** To set setMinorIntervalValue + * @returns {void} + */ + setMinorIntervalValue(): void; + + /** To set setPointerDistanceFromScale + * @returns {void} + */ + setPointerDistanceFromScale(): void; + + /** To set PointerHeight + * @returns {void} + */ + setPointerHeight(): void; + + /** To set setPointerPlacement + * @returns {void} + */ + setPointerPlacement(): void; + + /** To set PointerValue + * @returns {void} + */ + setPointerValue(): void; + + /** To set PointerWidth + * @returns {void} + */ + setPointerWidth(): void; + + /** To set setRangeBorderWidth + * @returns {void} + */ + setRangeBorderWidth(): void; + + /** To set setRangeDistanceFromScale + * @returns {void} + */ + setRangeDistanceFromScale(): void; + + /** To set setRangeEndValue + * @returns {void} + */ + setRangeEndValue(): void; + + /** To set setRangeEndWidth + * @returns {void} + */ + setRangeEndWidth(): void; + + /** To set setRangePosition + * @returns {void} + */ + setRangePosition(): void; + + /** To set setRangeStartValue + * @returns {void} + */ + setRangeStartValue(): void; + + /** To set setRangeStartWidth + * @returns {void} + */ + setRangeStartWidth(): void; + + /** To set setScaleBarLength + * @returns {void} + */ + setScaleBarLength(): void; + + /** To set setScaleBarSize + * @returns {void} + */ + setScaleBarSize(): void; + + /** To set setScaleBorderWidth + * @returns {void} + */ + setScaleBorderWidth(): void; + + /** To set setScaleDirection + * @returns {void} + */ + setScaleDirection(): void; + + /** To set setScaleLocation + * @returns {void} + */ + setScaleLocation(): void; + + /** To set setScaleStyle + * @returns {void} + */ + setScaleStyle(): void; + + /** To set setTickAngle + * @returns {void} + */ + setTickAngle(): void; + + /** To set setTickHeight + * @returns {void} + */ + setTickHeight(): void; + + /** To set setTickPlacement + * @returns {void} + */ + setTickPlacement(): void; + + /** To set setTickStyle + * @returns {void} + */ + setTickStyle(): void; + + /** To set setTickWidth + * @returns {void} + */ + setTickWidth(): void; + + /** To set setTickXDistanceFromScale + * @returns {void} + */ + setTickXDistanceFromScale(): void; + + /** To set setTickYDistanceFromScale + * @returns {void} + */ + setTickYDistanceFromScale(): void; +} +export module LinearGauge{ + +export interface Model { + + /**Specifies the animationSpeed + * @Default {500} + */ + animationSpeed?: number; + + /**Specifies the backgroundColor for Linear gauge. + * @Default {null} + */ + backgroundColor?: string; + + /**Specifies the borderColor for Linear gauge. + * @Default {null} + */ + borderColor?: string; + + /**Specifies the animate state + * @Default {true} + */ + enableAnimation?: boolean; + + /**Specifies the animate state for marker pointer + * @Default {true} + */ + enableMarkerPointerAnimation?: boolean; + + /**Specifies the can resize state. + * @Default {false} + */ + enableResize?: boolean; + + /**Specify frame of linear gauge + * @Default {null} + */ + frame?: Frame; + + /**Specifies the height of Linear gauge. + * @Default {400} + */ + height?: number; + + /**Specifies the labelColor for Linear gauge. + * @Default {null} + */ + labelColor?: string; + + /**Specifies the maximum value of Linear gauge. + * @Default {100} + */ + maximum?: number; + + /**Specifies the minimum value of Linear gauge. + * @Default {0} + */ + minimum?: number; + + /**Specifies the orientation for Linear gauge. + * @Default {Vertical} + */ + orientation?: string; + + /**Specify labelPosition value of Linear gauge See OuterCustomLabelPosition + * @Default {bottom} + */ + outerCustomLabelPosition?: ej.datavisualization.LinearGauge.OuterCustomLabelPosition|string; + + /**Specifies the pointerGradient1 for Linear gauge. + * @Default {null} + */ + pointerGradient1?: any; + + /**Specifies the pointerGradient2 for Linear gauge. + * @Default {null} + */ + pointerGradient2?: any; + + /**Specifies the read only state. + * @Default {true} + */ + readOnly?: boolean; + + /**Specifies the scales + * @Default {null} + */ + scales?: Scales; + + /**Specifies the theme for Linear gauge. See LinearGauge.Themes + * @Default {flatlight} + */ + theme?: ej.datavisualization.LinearGauge.Themes|string; + + /**Specifies the tick Color for Linear gauge. + * @Default {null} + */ + tickColor?: string; + + /**Specify tooltip options of linear gauge + * @Default {false} + */ + tooltip?: Tooltip; + + /**Specifies the value of the Gauge. + * @Default {0} + */ + value?: number; + + /**Specifies the width of Linear gauge. + * @Default {150} + */ + width?: number; + + /**Triggers while the bar pointer are being drawn on the gauge.*/ + drawBarPointers? (e: DrawBarPointersEventArgs): void; + + /**Triggers while the customLabel are being drawn on the gauge.*/ + drawCustomLabel? (e: DrawCustomLabelEventArgs): void; + + /**Triggers while the Indicator are being drawn on the gauge.*/ + drawIndicators? (e: DrawIndicatorsEventArgs): void; + + /**Triggers while the label are being drawn on the gauge.*/ + drawLabels? (e: DrawLabelsEventArgs): void; + + /**Triggers while the marker are being drawn on the gauge.*/ + drawMarkerPointers? (e: DrawMarkerPointersEventArgs): void; + + /**Triggers while the range are being drawn on the gauge.*/ + drawRange? (e: DrawRangeEventArgs): void; + + /**Triggers while the ticks are being drawn on the gauge.*/ + drawTicks? (e: DrawTicksEventArgs): void; + + /**Triggers when the gauge is initialized.*/ + init? (e: InitEventArgs): void; + + /**Triggers while the gauge start to Load.*/ + load? (e: LoadEventArgs): void; + + /**Triggers when the left mouse button is clicked.*/ + mouseClick? (e: MouseClickEventArgs): void; + + /**Triggers when clicking and dragging the mouse pointer over the gauge pointer.*/ + mouseClickMove? (e: MouseClickMoveEventArgs): void; + + /**Triggers when the mouse click is released.*/ + mouseClickUp? (e: MouseClickUpEventArgs): void; + + /**Triggers while the rendering of the gauge completed.*/ + renderComplete? (e: RenderCompleteEventArgs): void; +} + +export interface DrawBarPointersEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the pointer + */ + position?: any; + + /**returns the gauge model + */ + Model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the pointer style + */ + style?: string; + + /**returns the current Bar pointer element. + */ + barElement?: any; + + /**returns the index of the bar pointer. + */ + barPointerIndex?: number; + + /**returns the value of the bar pointer. + */ + PointerValue?: number; + + /**returns the name of the event + */ + type?: any; +} + +export interface DrawCustomLabelEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the customLabel + */ + position?: any; + + /**returns the gauge model + */ + Model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the customLabel style + */ + style?: any; + + /**returns the current customLabel element. + */ + customLabelElement?: any; + + /**returns the index of the customLabel. + */ + customLabelIndex?: number; + + /**returns the name of the event + */ + type?: any; +} + +export interface DrawIndicatorsEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the Indicator + */ + position?: any; + + /**returns the gauge model + */ + Model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the Indicator style + */ + style?: string; + + /**returns the current Indicator element. + */ + IndicatorElement?: any; + + /**returns the index of the Indicator. + */ + IndicatorIndex?: number; + + /**returns the name of the event + */ + type?: any; +} + +export interface DrawLabelsEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the label + */ + position?: any; + + /**returns the gauge model + */ + Model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the label belongs. + */ + scaleIndex?: number; + + /**returns the label style + */ + style?: string; + + /**returns the angle of the label. + */ + angle?: number; + + /**returns the current label element. + */ + element?: any; + + /**returns the index of the label. + */ + index?: number; + + /**returns the label value of the label. + */ + value?: number; + + /**returns the name of the event + */ + type?: any; +} + +export interface DrawMarkerPointersEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the pointer + */ + position?: any; + + /**returns the gauge model + */ + Model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the ticks style + */ + style?: string; + + /**returns the current marker pointer element. + */ + markerElement?: any; + + /**returns the index of the marker pointer. + */ + markerPointerIndex?: number; + + /**returns the value of the marker pointer. + */ + pointerValue?: number; + + /**returns the angle of the marker pointer. + */ + pointerAngle?: number; + + /**returns the name of the event + */ + type?: any; +} + +export interface DrawRangeEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the range + */ + position?: any; + + /**returns the gauge model + */ + Model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the range style + */ + style?: string; + + /**returns the current range element. + */ + rangeElement?: any; + + /**returns the index of the range. + */ + rangeIndex?: number; + + /**returns the name of the event + */ + type?: any; +} + +export interface DrawTicksEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the ticks + */ + position?: any; + + /**returns the gauge model + */ + Model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the tick belongs. + */ + scaleIndex?: number; + + /**returns the ticks style + */ + style?: string; + + /**returns the angle of the tick. + */ + angle?: number; + + /**returns the current tick element. + */ + element?: any; + + /**returns the index of the tick. + */ + index?: number; + + /**returns the tick value of the tick. + */ + value?: number; + + /**returns the name of the event + */ + type?: any; +} + +export interface InitEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + Model?: any; + + /**returns the entire scale element. + */ + scaleElement?: any; + + /**returns the context element + */ + context?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface LoadEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + Model?: any; + + /**returns the entire scale element. + */ + scaleElement?: any; + + /**returns the context element + */ + context?: any; + + /**returns the name of the event + */ + type?: any; +} + +export interface MouseClickEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: any; + + /**returns the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the context element* @param {Object} args.markerpointer returns the context element + */ + context?: any; + + /**returns the pointer Index + */ + markerpointerindex?: number; + + /**returns the pointer element. + */ + markerpointerelement?: any; + + /**returns the value of the pointer. + */ + markerpointervalue?: number; + + /**returns the pointer style + */ + style?: string; + + /**returns the startX and startY of the pointer. + */ + position?: any; +} + +export interface MouseClickMoveEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: any; + + /**returns the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the context element + */ + context?: any; + + /**returns the pointer Index + */ + index?: number; + + /**returns the pointer element. + */ + element?: any; + + /**returns the value of the pointer. + */ + value?: number; + + /**returns the pointer style + */ + style?: string; + + /**returns the startX and startY of the pointer. + */ + position?: any; +} + +export interface MouseClickUpEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: any; + + /**returns the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the context element* @param {Object} args.markerpointer returns the context element + */ + context?: any; + + /**returns the pointer Index + */ + markerpointerIndex?: number; + + /**returns the pointer element. + */ + markerpointerElement?: any; + + /**returns the value of the pointer. + */ + markerpointerValue?: number; + + /**returns the pointer style + */ + style?: string; + + /**returns the startX and startY of the pointer. + */ + position?: any; +} + +export interface RenderCompleteEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + Model?: any; + + /**returns the entire scale element. + */ + scaleElement?: any; + + /**returns the context element + */ + context?: any; + + /**returns the name of the event + */ + type?: any; +} + +export interface Frame { + + /**Specifies the frame background image url of linear gauge + * @Default {null} + */ + backgroundImageUrl?: string; + + /**Specifies the frame InnerWidth + * @Default {8} + */ + innerWidth?: number; + + /**Specifies the frame OuterWidth + * @Default {12} + */ + outerWidth?: number; +} + +export interface ScalesBarPointersBorder { + + /**Specifies the border Color of bar pointer + * @Default {null} + */ + color?: string; + + /**Specifies the border Width of bar pointer + * @Default {1.5} + */ + width?: number; +} + +export interface ScalesBarPointers { + + /**Specifies the backgroundColor of bar pointer + * @Default {null} + */ + backgroundColor?: string; + + /**Specifies the border of bar pointer + * @Default {null} + */ + border?: ScalesBarPointersBorder; + + /**Specifies the distanceFromScale of bar pointer + * @Default {0} + */ + distanceFromScale?: number; + + /**Specifies the scaleBar Gradient of bar pointer + * @Default {null} + */ + gradients?: any; + + /**Specifies the opacity of bar pointer + * @Default {1} + */ + opacity?: number; + + /**Specifies the value of bar pointer + * @Default {null} + */ + value?: number; + + /**Specifies the pointer Width of bar pointer + * @Default {width=30} + */ + width?: number; +} + +export interface ScalesBorder { + + /**Specifies the border color of the Scale. + * @Default {null} + */ + color?: string; + + /**Specifies the border width of the Scale. + * @Default {1.5} + */ + width?: number; +} + +export interface ScalesCustomLabelsFont { + + /**Specifies the fontFamily in customLabels + * @Default {Arial} + */ + fontFamily?: string; + + /**Specifies the fontStyle in customLabels. See FontStyle + * @Default {Bold} + */ + fontStyle?: ej.datavisualization.LinearGauge.FontStyle|string; + + /**Specifies the font size in customLabels + * @Default {11px} + */ + size?: string; +} + +export interface ScalesCustomLabelsPosition { + + /**Specifies the position x in customLabels + * @Default {0} + */ + x?: number; + + /**Specifies the y in customLabels + * @Default {0} + */ + y?: number; +} + +export interface ScalesCustomLabels { + + /**Specifies the label Color in customLabels + * @Default {null} + */ + color?: number; + + /**Specifies the font in customLabels + * @Default {null} + */ + font?: ScalesCustomLabelsFont; + + /**Specifies the opacity in customLabels + * @Default {0} + */ + opacity?: string; + + /**Specifies the position in customLabels + * @Default {null} + */ + position?: ScalesCustomLabelsPosition; + + /**Specifies the positionType in customLabels.See CustomLabelPositionType + * @Default {null} + */ + positionType?: any; + + /**Specifies the textAngle in customLabels + * @Default {0} + */ + textAngle?: number; + + /**Specifies the label Value in customLabels + */ + value?: string; +} + +export interface ScalesIndicatorsBorder { + + /**Specifies the border Color in bar indicators + * @Default {null} + */ + color?: string; + + /**Specifies the border Width in bar indicators + * @Default {1.5} + */ + width?: number; +} + +export interface ScalesIndicatorsFont { + + /**Specifies the fontFamily of font in bar indicators + * @Default {Arial} + */ + fontFamily?: string; + + /**Specifies the fontStyle of font in bar indicators. See FontStyle + * @Default {ej.datavisualization.LinearGauge.FontStyle.Bold} + */ + fontStyle?: ej.datavisualization.LinearGauge.FontStyle|string; + + /**Specifies the size of font in bar indicators + * @Default {11px} + */ + size?: string; +} + +export interface ScalesIndicatorsPosition { + + /**Specifies the x position in bar indicators + * @Default {0} + */ + x?: number; + + /**Specifies the y position in bar indicators + * @Default {0} + */ + y?: number; +} + +export interface ScalesIndicatorsStateRanges { + + /**Specifies the backgroundColor in bar indicators state ranges + * @Default {null} + */ + backgroundColor?: string; + + /**Specifies the borderColor in bar indicators state ranges + * @Default {null} + */ + borderColor?: string; + + /**Specifies the endValue in bar indicators state ranges + * @Default {60} + */ + endValue?: number; + + /**Specifies the startValue in bar indicators state ranges + * @Default {50} + */ + startValue?: number; + + /**Specifies the text in bar indicators state ranges + */ + text?: string; + + /**Specifies the textColor in bar indicators state ranges + * @Default {null} + */ + textColor?: string; +} + +export interface ScalesIndicatorsTextLocation { + + /**Specifies the textLocation position in bar indicators + * @Default {0} + */ + x?: number; + + /**Specifies the Y position in bar indicators + * @Default {0} + */ + y?: number; +} + +export interface ScalesIndicators { + + /**Specifies the backgroundColor in bar indicators + * @Default {null} + */ + backgroundColor?: string; + + /**Specifies the border in bar indicators + * @Default {null} + */ + border?: ScalesIndicatorsBorder; + + /**Specifies the font of bar indicators + * @Default {null} + */ + font?: ScalesIndicatorsFont; + + /**Specifies the indicator Height of bar indicators + * @Default {30} + */ + height?: number; + + /**Specifies the opacity in bar indicators + * @Default {NaN} + */ + opacity?: number; + + /**Specifies the position in bar indicators + * @Default {null} + */ + position?: ScalesIndicatorsPosition; + + /**Specifies the state ranges in bar indicators + * @Default {Array} + */ + stateRanges?: Array; + + /**Specifies the textLocation in bar indicators + * @Default {null} + */ + textLocation?: ScalesIndicatorsTextLocation; + + /**Specifies the indicator Style of font in bar indicators + * @Default {ej.datavisualization.LinearGauge.IndicatorType.Rectangle} + */ + type?: ej.datavisualization.LinearGauge.IndicatorTypes|string; + + /**Specifies the indicator Width in bar indicators + * @Default {30} + */ + width?: number; +} + +export interface ScalesLabelsDistanceFromScale { + + /**Specifies the xDistanceFromScale of labels. + * @Default {-10} + */ + x?: number; + + /**Specifies the yDistanceFromScale of labels. + * @Default {0} + */ + y?: number; +} + +export interface ScalesLabelsFont { + + /**Specifies the fontFamily of font. + * @Default {Arial} + */ + fontFamily?: string; + + /**Specifies the fontStyle of font.See FontStyle + * @Default {ej.datavisualization.LinearGauge.FontStyle.Bold} + */ + fontStyle?: ej.datavisualization.LinearGauge.FontStyle|string; + + /**Specifies the size of font. + * @Default {11px} + */ + size?: string; +} + +export interface ScalesLabels { + + /**Specifies the angle of labels. + * @Default {0} + */ + angle?: number; + + /**Specifies the DistanceFromScale of labels. + * @Default {null} + */ + distanceFromScale?: ScalesLabelsDistanceFromScale; + + /**Specifies the font of labels. + * @Default {null} + */ + font?: ScalesLabelsFont; + + /**need to includeFirstValue. + * @Default {true} + */ + includeFirstValue?: boolean; + + /**Specifies the opacity of label. + * @Default {0} + */ + opacity?: number; + + /**Specifies the label Placement of label. See LabelPlacement + * @Default {Near} + */ + placement?: ej.datavisualization.LinearGauge.PointerPlacement|string; + + /**Specifies the textColor of font. + * @Default {null} + */ + textColor?: string; + + /**Specifies the label Style of label. See LabelType + * @Default {ej.datavisualization.LinearGauge.LabelType.Major} + */ + type?: ej.datavisualization.LinearGauge.ScaleType|string; + + /**Specifies the unitText of label. + */ + unitText?: string; + + /**Specifies the unitText Position of label.See UnitTextPlacement + * @Default {Back} + */ + unitTextPlacement?: ej.datavisualization.LinearGauge.UnitTextPlacement|string; +} + +export interface ScalesMarkerPointersBorder { + + /**Specifies the border color of marker pointer + * @Default {null} + */ + color?: string; + + /**Specifies the border of marker pointer + * @Default {number} + */ + width?: number; +} + +export interface ScalesMarkerPointers { + + /**Specifies the backgroundColor of marker pointer + * @Default {null} + */ + backgroundColor?: string; + + /**Specifies the border of marker pointer + * @Default {null} + */ + border?: ScalesMarkerPointersBorder; + + /**Specifies the distanceFromScale of marker pointer + * @Default {0} + */ + distanceFromScale?: number; + + /**Specifies the pointer Gradient of marker pointer + * @Default {null} + */ + gradients?: any; + + /**Specifies the pointer Length of marker pointer + * @Default {30} + */ + length?: number; + + /**Specifies the opacity of marker pointer + * @Default {1} + */ + opacity?: number; + + /**Specifies the pointer Placement of marker pointer See PointerPlacement + * @Default {Far} + */ + placement?: ej.datavisualization.LinearGauge.PointerPlacement|string; + + /**Specifies the marker Style of marker pointerSee MarkerType + * @Default {Triangle} + */ + type?: ej.datavisualization.LinearGauge.MarkerType|string; + + /**Specifies the value of marker pointer + * @Default {null} + */ + value?: number; + + /**Specifies the pointer Width of marker pointer + * @Default {30} + */ + width?: number; +} + +export interface ScalesPosition { + + /**Specifies the Horizontal position + * @Default {50} + */ + x?: number; + + /**Specifies the vertical position + * @Default {50} + */ + y?: number; +} + +export interface ScalesRangesBorder { + + /**Specifies the border color in the ranges. + * @Default {null} + */ + color?: string; + + /**Specifies the border width in the ranges. + * @Default {1.5} + */ + width?: number; +} + +export interface ScalesRanges { + + /**Specifies the backgroundColor in the ranges. + * @Default {null} + */ + backgroundColor?: string; + + /**Specifies the border in the ranges. + * @Default {null} + */ + border?: ScalesRangesBorder; + + /**Specifies the distanceFromScale in the ranges. + * @Default {0} + */ + distanceFromScale?: number; + + /**Specifies the endValue in the ranges. + * @Default {60} + */ + endValue?: number; + + /**Specifies the endWidth in the ranges. + * @Default {10} + */ + endWidth?: number; + + /**Specifies the range Gradient in the ranges. + * @Default {null} + */ + gradients?: any; + + /**Specifies the opacity in the ranges. + * @Default {null} + */ + opacity?: number; + + /**Specifies the range Position in the ranges. See RangePlacement + * @Default {Center} + */ + placement?: ej.datavisualization.LinearGauge.PointerPlacement|string; + + /**Specifies the startValue in the ranges. + * @Default {20} + */ + startValue?: number; + + /**Specifies the startWidth in the ranges. + * @Default {10} + */ + startWidth?: number; +} + +export interface ScalesTicksDistanceFromScale { + + /**Specifies the xDistanceFromScale in the tick. + * @Default {0} + */ + x?: number; + + /**Specifies the yDistanceFromScale in the tick. + * @Default {0} + */ + y?: number; +} + +export interface ScalesTicks { + + /**Specifies the angle in the tick. + * @Default {0} + */ + angle?: number; + + /**Specifies the tick Color in the tick. + * @Default {null} + */ + color?: string; + + /**Specifies the DistanceFromScale in the tick. + * @Default {null} + */ + distanceFromScale?: ScalesTicksDistanceFromScale; + + /**Specifies the tick Height in the tick. + * @Default {10} + */ + height?: number; + + /**Specifies the opacity in the tick. + * @Default {0} + */ + opacity?: number; + + /**Specifies the tick Placement in the tick. See TickPlacement + * @Default {Near} + */ + placement?: ej.datavisualization.LinearGauge.PointerPlacement|string; + + /**Specifies the tick Style in the tick. See TickType + * @Default {MajorInterval} + */ + type?: ej.datavisualization.LinearGauge.TicksType|string; + + /**Specifies the tick Width in the tick. + * @Default {3} + */ + width?: number; +} + +export interface Scales { + + /**Specifies the backgroundColor of the Scale. + * @Default {null} + */ + backgroundColor?: string; + + /**Specifies the scaleBar Gradient of bar pointer + * @Default {Array} + */ + barPointers?: Array; + + /**Specifies the border of the Scale. + * @Default {null} + */ + border?: ScalesBorder; + + /**Specifies the customLabel + * @Default {Array} + */ + customLabels?: Array; + + /**Specifies the scale Direction of the Scale. See Directions + * @Default {CounterClockwise} + */ + direction?: ej.datavisualization.LinearGauge.Direction|string; + + /**Specifies the indicator + * @Default {Array} + */ + indicators?: Array; + + /**Specifies the labels. + * @Default {Array} + */ + labels?: Array; + + /**Specifies the scaleBar Length. + * @Default {290} + */ + length?: number; + + /**Specifies the majorIntervalValue of the Scale. + * @Default {10} + */ + majorIntervalValue?: number; + + /**Specifies the markerPointers + * @Default {Array} + */ + markerPointers?: Array; + + /**Specifies the maximum of the Scale. + * @Default {null} + */ + maximum?: number; + + /**Specifies the minimum of the Scale. + * @Default {null} + */ + minimum?: number; + + /**Specifies the minorIntervalValue of the Scale. + * @Default {2} + */ + minorIntervalValue?: number; + + /**Specifies the opacity of the Scale. + * @Default {NaN} + */ + opacity?: number; + + /**Specifies the position + * @Default {null} + */ + position?: ScalesPosition; + + /**Specifies the ranges in the tick. + * @Default {Array} + */ + ranges?: Array; + + /**Specifies the shadowOffset. + * @Default {0} + */ + shadowOffset?: number; + + /**Specifies the showBarPointers state. + * @Default {true} + */ + showBarPointers?: boolean; + + /**Specifies the showCustomLabels state. + * @Default {false} + */ + showCustomLabels?: boolean; + + /**Specifies the showIndicators state. + * @Default {false} + */ + showIndicators?: boolean; + + /**Specifies the showLabels state. + * @Default {true} + */ + showLabels?: boolean; + + /**Specifies the showMarkerPointers state. + * @Default {true} + */ + showMarkerPointers?: boolean; + + /**Specifies the showRanges state. + * @Default {false} + */ + showRanges?: boolean; + + /**Specifies the showTicks state. + * @Default {true} + */ + showTicks?: boolean; + + /**Specifies the ticks in the scale. + * @Default {Array} + */ + ticks?: Array; + + /**Specifies the scaleBar type .See ScaleType + * @Default {Rectangle} + */ + type?: ej.datavisualization.LinearGauge.ScaleType|string; + + /**Specifies the scaleBar width. + * @Default {30} + */ + width?: number; +} + +export interface Tooltip { + + /**Specify showCustomLabelTooltip value of linear gauge + * @Default {false} + */ + showCustomLabelTooltip?: boolean; + + /**Specify showLabelTooltip value of linear gauge + * @Default {false} + */ + showLabelTooltip?: boolean; + + /**Specify templateID value of linear gauge + * @Default {false} + */ + templateID?: string; +} +} +module LinearGauge +{ +enum OuterCustomLabelPosition +{ +//string +Left, +//string +Right, +//string +Top, +//string +Bottom, +} +} +module LinearGauge +{ +enum FontStyle +{ +//string +Bold, +//string +Italic, +//string +Regular, +//string +Strikeout, +//string +Underline, +} +} +module LinearGauge +{ +enum Direction +{ +//string +Clockwise, +//string +CounterClockwise, +} +} +module LinearGauge +{ +enum IndicatorTypes +{ +//string +Rectangle, +//string +Circle, +//string +RoundedRectangle, +//string +Text, +} +} +module LinearGauge +{ +enum PointerPlacement +{ +//string +Near, +//string +Far, +//string +Center, +} +} +module LinearGauge +{ +enum ScaleType +{ +//string +Major, +//string +Minor, +} +} +module LinearGauge +{ +enum UnitTextPlacement +{ +//string +Back, +//string +From, +} +} +module LinearGauge +{ +enum MarkerType +{ +//string +Rectangle, +//string +Triangle, +//string +Ellipse, +//string +Diamond, +//string +Pentagon, +//string +Circle, +//string +Star, +//string +Slider, +//string +Pointer, +//string +Wedge, +//string +Trapezoid, +//string +RoundedRectangle, +} +} +module LinearGauge +{ +enum TicksType +{ +//string +Majorinterval, +//string +Minorinterval, +} +} +module LinearGauge +{ +enum Themes +{ +//string +FlatLight, +//string +FlatDark, +} +} + +class CircularGauge extends ej.Widget { + static fn: CircularGauge; + constructor(element: JQuery, options?: CircularGauge.Model); + constructor(element: Element, options?: CircularGauge.Model); + model:CircularGauge.Model; + defaults:CircularGauge.Model; + + /** destroy the circular gauge widget. all events bound using this._on will be unbind automatically and bring the control to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** To export Image + * @returns {void} + */ + exportImage(): void; + + /** To get BackNeedleLength + * @returns {void} + */ + getBackNeedleLength(): void; + + /** To get CustomLabelAngle + * @returns {void} + */ + getCustomLabelAngle(): void; + + /** To get CustomLabelValue + * @returns {void} + */ + getCustomLabelValue(): void; + + /** To get LabelAngle + * @returns {void} + */ + getLabelAngle(): void; + + /** To get LabelDistanceFromScale + * @returns {void} + */ + getLabelDistanceFromScale(): void; + + /** To get LabelPlacement + * @returns {void} + */ + getLabelPlacement(): void; + + /** To get LabelStyle + * @returns {void} + */ + getLabelStyle(): void; + + /** To get MajorIntervalValue + * @returns {void} + */ + getMajorIntervalValue(): void; + + /** To get MarkerDistanceFromScale + * @returns {void} + */ + getMarkerDistanceFromScale(): void; + + /** To get MarkerStyle + * @returns {void} + */ + getMarkerStyle(): void; + + /** To get MaximumValue + * @returns {void} + */ + getMaximumValue(): void; + + /** To get MinimumValue + * @returns {void} + */ + getMinimumValue(): void; + + /** To get MinorIntervalValue + * @returns {void} + */ + getMinorIntervalValue(): void; + + /** To get NeedleStyle + * @returns {void} + */ + getNeedleStyle(): void; + + /** To get PointerCapBorderWidth + * @returns {void} + */ + getPointerCapBorderWidth(): void; + + /** To get PointerCapRadius + * @returns {void} + */ + getPointerCapRadius(): void; + + /** To get PointerLength + * @returns {void} + */ + getPointerLength(): void; + + /** To get PointerNeedleType + * @returns {void} + */ + getPointerNeedleType(): void; + + /** To get PointerPlacement + * @returns {void} + */ + getPointerPlacement(): void; + + /** To get PointerValue + * @returns {void} + */ + getPointerValue(): void; + + /** To get PointerWidth + * @returns {void} + */ + getPointerWidth(): void; + + /** To get RangeBorderWidth + * @returns {void} + */ + getRangeBorderWidth(): void; + + /** To get RangeDistanceFromScale + * @returns {void} + */ + getRangeDistanceFromScale(): void; + + /** To get RangeEndValue + * @returns {void} + */ + getRangeEndValue(): void; + + /** To get RangePosition + * @returns {void} + */ + getRangePosition(): void; + + /** To get RangeSize + * @returns {void} + */ + getRangeSize(): void; + + /** To get RangeStartValue + * @returns {void} + */ + getRangeStartValue(): void; + + /** To get ScaleBarSize + * @returns {void} + */ + getScaleBarSize(): void; + + /** To get ScaleBorderWidth + * @returns {void} + */ + getScaleBorderWidth(): void; + + /** To get ScaleDirection + * @returns {void} + */ + getScaleDirection(): void; + + /** To get ScaleRadius + * @returns {void} + */ + getScaleRadius(): void; + + /** To get StartAngle + * @returns {void} + */ + getStartAngle(): void; + + /** To get SubGaugeLocation + * @returns {void} + */ + getSubGaugeLocation(): void; + + /** To get SweepAngle + * @returns {void} + */ + getSweepAngle(): void; + + /** To get TickAngle + * @returns {void} + */ + getTickAngle(): void; + + /** To get TickDistanceFromScale + * @returns {void} + */ + getTickDistanceFromScale(): void; + + /** To get TickHeight + * @returns {void} + */ + getTickHeight(): void; + + /** To get TickPlacement + * @returns {void} + */ + getTickPlacement(): void; + + /** To get TickStyle + * @returns {void} + */ + getTickStyle(): void; + + /** To get TickWidth + * @returns {void} + */ + getTickWidth(): void; + + /** To set includeFirstValue + * @returns {void} + */ + includeFirstValue(): void; + + /** Switching the redraw option for the gauge + * @returns {void} + */ + redraw(): void; + + /** To set BackNeedleLength + * @returns {void} + */ + setBackNeedleLength(): void; + + /** To set CustomLabelAngle + * @returns {void} + */ + setCustomLabelAngle(): void; + + /** To set CustomLabelValue + * @returns {void} + */ + setCustomLabelValue(): void; + + /** To set LabelAngle + * @returns {void} + */ + setLabelAngle(): void; + + /** To set LabelDistanceFromScale + * @returns {void} + */ + setLabelDistanceFromScale(): void; + + /** To set LabelPlacement + * @returns {void} + */ + setLabelPlacement(): void; + + /** To set LabelStyle + * @returns {void} + */ + setLabelStyle(): void; + + /** To set MajorIntervalValue + * @returns {void} + */ + setMajorIntervalValue(): void; + + /** To set MarkerDistanceFromScale + * @returns {void} + */ + setMarkerDistanceFromScale(): void; + + /** To set MarkerStyle + * @returns {void} + */ + setMarkerStyle(): void; + + /** To set MaximumValue + * @returns {void} + */ + setMaximumValue(): void; + + /** To set MinimumValue + * @returns {void} + */ + setMinimumValue(): void; + + /** To set MinorIntervalValue + * @returns {void} + */ + setMinorIntervalValue(): void; + + /** To set NeedleStyle + * @returns {void} + */ + setNeedleStyle(): void; + + /** To set PointerCapBorderWidth + * @returns {void} + */ + setPointerCapBorderWidth(): void; + + /** To set PointerCapRadius + * @returns {void} + */ + setPointerCapRadius(): void; + + /** To set PointerLength + * @returns {void} + */ + setPointerLength(): void; + + /** To set PointerNeedleType + * @returns {void} + */ + setPointerNeedleType(): void; + + /** To set PointerPlacement + * @returns {void} + */ + setPointerPlacement(): void; + + /** To set PointerValue + * @returns {void} + */ + setPointerValue(): void; + + /** To set PointerWidth + * @returns {void} + */ + setPointerWidth(): void; + + /** To set RangeBorderWidth + * @returns {void} + */ + setRangeBorderWidth(): void; + + /** To set RangeDistanceFromScale + * @returns {void} + */ + setRangeDistanceFromScale(): void; + + /** To set RangeEndValue + * @returns {void} + */ + setRangeEndValue(): void; + + /** To set RangePosition + * @returns {void} + */ + setRangePosition(): void; + + /** To set RangeSize + * @returns {void} + */ + setRangeSize(): void; + + /** To set RangeStartValue + * @returns {void} + */ + setRangeStartValue(): void; + + /** To set ScaleBarSize + * @returns {void} + */ + setScaleBarSize(): void; + + /** To set ScaleBorderWidth + * @returns {void} + */ + setScaleBorderWidth(): void; + + /** To set ScaleDirection + * @returns {void} + */ + setScaleDirection(): void; + + /** To set ScaleRadius + * @returns {void} + */ + setScaleRadius(): void; + + /** To set StartAngle + * @returns {void} + */ + setStartAngle(): void; + + /** To set SubGaugeLocation + * @returns {void} + */ + setSubGaugeLocation(): void; + + /** To set SweepAngle + * @returns {void} + */ + setSweepAngle(): void; + + /** To set TickAngle + * @returns {void} + */ + setTickAngle(): void; + + /** To set TickDistanceFromScale + * @returns {void} + */ + setTickDistanceFromScale(): void; + + /** To set TickHeight + * @returns {void} + */ + setTickHeight(): void; + + /** To set TickPlacement + * @returns {void} + */ + setTickPlacement(): void; + + /** To set TickStyle + * @returns {void} + */ + setTickStyle(): void; + + /** To set TickWidth + * @returns {void} + */ + setTickWidth(): void; +} +export module CircularGauge{ + +export interface Model { + + /**Specifies animationSpeed of circular gauge + * @Default {500} + */ + animationSpeed?: number; + + /**Specifies the background color of circular gauge. + * @Default {null} + */ + backgroundColor?: string; + + /**Specify distanceFromCorner value of circular gauge + * @Default {center} + */ + distanceFromCorner?: number; + + /**Specify animate value of circular gauge + * @Default {true} + */ + enableAnimation?: boolean; + + /**Specify enableResize value of circular gauge + * @Default {false} + */ + enableResize?: boolean; + + /**Specify the frame of circular gauge + * @Default {Object} + */ + frame?: Frame; + + /**Specify gaugePosition value of circular gauge See GaugePosition + * @Default {center} + */ + gaugePosition?: ej.datavisualization.CircularGauge.gaugePosition|string; + + /**Specifies the height of circular gauge. + * @Default {360} + */ + height?: number; + + /**Specifies the interiorGradient of circular gauge. + * @Default {null} + */ + interiorGradient?: any; + + /**Specify isRadialGradient value of circular gauge + * @Default {false} + */ + isRadialGradient?: boolean; + + /**Specifies the maximum value of circular gauge. + * @Default {100} + */ + maximum?: number; + + /**Specifies the minimum value of circular gauge. + * @Default {0} + */ + minimum?: number; + + /**Specify outerCustomLabelPosition value of circular gauge See OuterCustomLabelPosition + * @Default {bottom} + */ + outerCustomLabelPosition?: ej.datavisualization.CircularGauge.CustomLabelPositionType|string; + + /**Specifies the radius of circular gauge. + * @Default {180} + */ + radius?: number; + + /**Specify readonly value of circular gauge + * @Default {true} + */ + readOnly?: boolean; + + /**Specify the pointers, ticks, labels, indicators, ranges of circular gauge + * @Default {null} + */ + scales?: Scales; + + /**Specify the theme of circular gauge. + * @Default {flatlight} + */ + theme?: string; + + /**Specify tooltip option of circular gauge + * @Default {object} + */ + tooltip?: Tooltip; + + /**Specifies the value of circular gauge. + * @Default {0} + */ + value?: number; + + /**Specifies the width of circular gauge. + * @Default {360} + */ + width?: number; + + /**Triggers while the custom labels are being drawn on the gauge.*/ + drawCustomLabel? (e: DrawCustomLabelEventArgs): void; + + /**Triggers while the indicators are being started to drawn on the gauge.*/ + drawIndicators? (e: DrawIndicatorsEventArgs): void; + + /**Triggers while the labels are being drawn on the gauge.*/ + drawLabels? (e: DrawLabelsEventArgs): void; + + /**Triggers while the pointer cap is being drawn on the gauge.*/ + drawPointerCap? (e: DrawPointerCapEventArgs): void; + + /**Triggers while the pointers are being drawn on the gauge.*/ + drawPointers? (e: DrawPointersEventArgs): void; + + /**Triggers when the ranges begin to be getting drawn on the gauge.*/ + drawRange? (e: DrawRangeEventArgs): void; + + /**Triggers while the ticks are being drawn on the gauge.*/ + drawTicks? (e: DrawTicksEventArgs): void; + + /**Triggers while the gauge start to Load.*/ + load? (e: LoadEventArgs): void; + + /**Triggers when the left mouse button is clicked.*/ + mouseClick? (e: MouseClickEventArgs): void; + + /**Triggers when clicking and dragging the mouse pointer over the gauge pointer.*/ + mouseClickMove? (e: MouseClickMoveEventArgs): void; + + /**Triggers when the mouse click is released.*/ + mouseClickUp? (e: MouseClickUpEventArgs): void; + + /**Triggers when the rendering of the gauge is completed.*/ + renderComplete? (e: RenderCompleteEventArgs): void; +} + +export interface DrawCustomLabelEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the custom label + */ + position?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the custom label belongs. + */ + scaleIndex?: number; + + /**returns the custom label style + */ + style?: string; + + /**returns the current custom label element. + */ + customLabelElement?: any; + + /**returns the index of the custom label. + */ + customLabelIndex?: number; + + /**returns the name of the event + */ + type?: string; +} + +export interface DrawIndicatorsEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the indicator + */ + position?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the indicator belongs. + */ + scaleIndex?: number; + + /**returns the indicator style + */ + style?: string; + + /**returns the current indicator element. + */ + indicatorElement?: any; + + /**returns the index of the indicator. + */ + indicatorIndex?: number; + + /**returns the name of the event + */ + type?: string; +} + +export interface DrawLabelsEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the labels + */ + position?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the label belongs. + */ + scaleIndex?: number; + + /**returns the label style + */ + style?: string; + + /**returns the angle of the labels. + */ + angle?: number; + + /**returns the current label element. + */ + element?: any; + + /**returns the index of the label. + */ + index?: number; + + /**returns the value of the label. + */ + pointerValue?: number; + + /**returns the name of the event + */ + type?: string; +} + +export interface DrawPointerCapEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the startX and startY of the pointer cap. + */ + position?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the pointer cap style + */ + style?: string; + + /**returns the name of the event + */ + type?: string; +} + +export interface DrawPointersEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the pointer + */ + position?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the pointer style + */ + style?: string; + + /**returns the angle of the pointer. + */ + angle?: number; + + /**returns the current pointer element. + */ + element?: any; + + /**returns the index of the pointer. + */ + index?: number; + + /**returns the value of the pointer. + */ + value?: number; + + /**returns the name of the event + */ + type?: string; +} + +export interface DrawRangeEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the range + */ + position?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the range belongs. + */ + scaleIndex?: number; + + /**returns the range style + */ + style?: string; + + /**returns the current range element. + */ + rangeElement?: any; + + /**returns the index of the range. + */ + rangeIndex?: number; + + /**returns the name of the event + */ + type?: string; +} + +export interface DrawTicksEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the ticks + */ + position?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the tick belongs. + */ + scaleIndex?: number; + + /**returns the ticks style + */ + style?: string; + + /**returns the angle of the tick. + */ + angle?: number; + + /**returns the current tick element. + */ + element?: any; + + /**returns the index of the tick. + */ + index?: number; + + /**returns the label value of the tick. + */ + pointerValue?: number; + + /**returns the name of the event + */ + type?: string; +} + +export interface LoadEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + Model?: any; + + /**returns the entire scale element. + */ + scaleElement?: any; + + /**returns the context element + */ + context?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface MouseClickEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: any; + + /**returns the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the context element + */ + context?: any; + + /**returns the pointer Index + */ + index?: number; + + /**returns the pointer element. + */ + element?: any; + + /**returns the value of the pointer. + */ + value?: number; + + /**returns the angle of the pointer. + */ + angle?: number; + + /**returns the pointer style + */ + style?: string; + + /**returns the startX and startY of the pointer. + */ + position?: any; +} + +export interface MouseClickMoveEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: any; + + /**returns the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the context element + */ + context?: any; + + /**returns the pointer Index + */ + index?: number; + + /**returns the pointer element. + */ + element?: any; + + /**returns the value of the pointer. + */ + value?: number; + + /**returns the angle of the pointer. + */ + angle?: number; + + /**returns the pointer style + */ + style?: string; + + /**returns the startX and startY of the pointer. + */ + position?: any; +} + +export interface MouseClickUpEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: any; + + /**returns the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the context element + */ + context?: any; + + /**returns the pointer Index + */ + index?: number; + + /**returns the pointer element. + */ + element?: any; + + /**returns the value of the pointer. + */ + value?: number; + + /**returns the angle of the pointer. + */ + angle?: number; + + /**returns the pointer style + */ + style?: string; + + /**returns the startX and startY of the pointer. + */ + position?: any; +} + +export interface RenderCompleteEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the entire scale element. + */ + scaleElement?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface Frame { + + /**Specify the url of the frame background image for circular gauge + * @Default {null} + */ + backgroundImageUrl?: string; + + /**Specifies the frameType of circular gauge. See Frame + * @Default {FullCircle} + */ + frameType?: ej.datavisualization.CircularGauge.FrameType|string; + + /**Specifies the end angle for the half circular frame. + * @Default {360} + */ + halfCircleFrameEndAngle?: number; + + /**Specifies the start angle for the half circular frame. + * @Default {180} + */ + halfCircleFrameStartAngle?: number; +} + +export interface ScalesBorder { + + /**Specify border color for scales of circular gauge + * @Default {null} + */ + color?: string; + + /**Specify border width of circular gauge + * @Default {1.5} + */ + width?: number; +} + +export interface ScalesIndicatorsPosition { + + /**Specify x-axis of position of circular gauge + * @Default {0} + */ + x?: number; + + /**Specify y-axis of position of circular gauge + * @Default {0} + */ + y?: number; +} + +export interface ScalesIndicatorsStateRanges { + + /**Specify backgroundColor for indicator of circular gauge + * @Default {null} + */ + backgroundColor?: string; + + /**Specify borderColor for indicator of circular gauge + * @Default {null} + */ + borderColor?: string; + + /**Specify end value for each specified state of circular gauge + * @Default {0} + */ + endValue?: number; + + /**Specify value of the font as the indicator when the indicator style is set with the value "text" of circular gauge + * @Default {null} + */ + font?: any; + + /**Specify start value for each specified state of circular gauge + * @Default {0} + */ + startValue?: number; + + /**Specify value of the text as the indicator when the indicator style is set with the value "text" of circular gauge + */ + text?: string; + + /**Specify value of the textColor as the indicator when the indicator style is set with the value "text" of circular gauge + * @Default {null} + */ + textColor?: string; +} + +export interface ScalesIndicators { + + /**Specify indicator height of circular gauge + * @Default {15} + */ + height?: number; + + /**Specify imageUrl of circular gauge + * @Default {null} + */ + imageUrl?: string; + + /**Specify position of circular gauge + * @Default {Object} + */ + position?: ScalesIndicatorsPosition; + + /**Specify the various states of circular gauge + * @Default {Array} + */ + stateRanges?: Array; + + /**Specify indicator style of circular gauge. See IndicatorType + * @Default {Circle} + */ + type?: ej.datavisualization.CircularGauge.IndicatorTypes|string; + + /**Specify indicator width of circular gauge + * @Default {15} + */ + width?: number; +} + +export interface ScalesLabelsFont { + + /**Specify font fontFamily for labels of circular gauge + * @Default {Arial} + */ + fontFamily?: string; + + /**Specify font Style for labels of circular gauge + * @Default {Bold} + */ + fontStyle?: string; + + /**Specify font size for labels of circular gauge + * @Default {11px} + */ + size?: string; +} + +export interface ScalesLabels { + + /**Specify the angle for the labels of circular gauge + * @Default {0} + */ + angle?: number; + + /**Specify labels autoAngle value of circular gauge + * @Default {false} + */ + autoAngle?: boolean; + + /**Specify label color of circular gauge + * @Default {null} + */ + color?: string; + + /**Specify distanceFromScale value for labels of circular gauge + * @Default {0} + */ + distanceFromScale?: number; + + /**Specify font for labels of circular gauge + * @Default {Object} + */ + font?: ScalesLabelsFont; + + /**Specify includeFirstValue of circular gauge + * @Default {true} + */ + includeFirstValue?: boolean; + + /**Specify opacity value for labels of circular gauge + * @Default {null} + */ + opacity?: number; + + /**Specify label placement of circular gauge. See LabelPlacement + * @Default {Near} + */ + placement?: ej.datavisualization.CircularGauge.Placement|string; + + /**Specify label Style of circular gauge. See LabelType + * @Default {Major} + */ + type?: ej.datavisualization.CircularGauge.LabelType|string; + + /**Specify unitText of circular gauge + */ + unitText?: string; + + /**Specify unitTextPosition of circular gauge. See UnitTextPosition + * @Default {Back} + */ + unitTextPosition?: ej.datavisualization.CircularGauge.UnitTextPlacement|string; +} + +export interface ScalesPointerCap { + + /**Specify cap backgroundColor of circular gauge + * @Default {null} + */ + backgroundColor?: string; + + /**Specify cap borderColor of circular gauge + * @Default {null} + */ + borderColor?: string; + + /**Specify pointerCap borderWidth value of circular gauge + * @Default {3} + */ + borderWidth?: number; + + /**Specify cap interiorGradient value of circular gauge + * @Default {null} + */ + interiorGradient?: any; + + /**Specify pointerCap Radius value of circular gauge + * @Default {7} + */ + radius?: number; +} + +export interface ScalesPointersBorder { + + /**Specify border color for pointer of circular gauge + * @Default {null} + */ + color?: string; + + /**Specify border width for pointers of circular gauge + * @Default {1.5} + */ + width?: number; +} + +export interface ScalesPointersPointerValueTextFont { + + /**Specify pointer value text font family of circular gauge. + * @Default {Arial} + */ + fontFamily?: string; + + /**Specify pointer value text font style of circular gauge. + * @Default {Bold} + */ + fontStyle?: string; + + /**Specify pointer value text size of circular gauge. + * @Default {11px} + */ + size?: string; +} + +export interface ScalesPointersPointerValueText { + + /**Specify pointer text angle of circular gauge. + * @Default {0} + */ + angle?: number; + + /**Specify pointer text auto angle of circular gauge. + * @Default {false} + */ + autoAngle?: boolean; + + /**Specify pointer value text color of circular gauge. + * @Default {#8c8c8c} + */ + color?: string; + + /**Specify pointer value text distance from pointer of circular gauge. + * @Default {20} + */ + distance?: number; + + /**Specify pointer value text font option of circular gauge. + * @Default {object} + */ + font?: ScalesPointersPointerValueTextFont; + + /**Specify pointer value text opacity of circular gauge. + * @Default {1} + */ + opacity?: number; + + /**enable pointer value text visibility of circular gauge. + * @Default {false} + */ + showValue?: boolean; +} + +export interface ScalesPointers { + + /**Specify backgroundColor for the pointer of circular gauge + * @Default {null} + */ + backgroundColor?: string; + + /**Specify backNeedleLength of circular gauge + * @Default {10} + */ + backNeedleLength?: number; + + /**Specify the border for pointers of circular gauge + * @Default {Object} + */ + border?: ScalesPointersBorder; + + /**Specify distanceFromScale value for pointers of circular gauge + * @Default {0} + */ + distanceFromScale?: number; + + /**Specify pointer gradients of circular gauge + * @Default {null} + */ + gradients?: any; + + /**Specify pointer image of circular gauge.It is applicable for both marker as well as needle type pointers. + * @Default {NULL} + */ + imageUrl?: string; + + /**Specify pointer length of circular gauge + * @Default {150} + */ + length?: number; + + /**Specify marker Style value of circular gauge. See MarkerType + * @Default {Rectangle} + */ + markerType?: ej.datavisualization.CircularGauge.MarkerType|string; + + /**Specify needle Style value of circular gauge. See NeedleType + * @Default {Triangle} + */ + needleType?: ej.datavisualization.CircularGauge.NeedleType|string; + + /**Specify opacity value for pointer of circular gauge + * @Default {1} + */ + opacity?: number; + + /**Specify pointer Placement value of circular gauge. See PointerPlacement + * @Default {Near} + */ + placement?: ej.datavisualization.CircularGauge.Placement|string; + + /**Specify pointer value text of circular gauge. + * @Default {Object} + */ + pointerValueText?: ScalesPointersPointerValueText; + + /**Specify showBackNeedle value of circular gauge + * @Default {false} + */ + showBackNeedle?: boolean; + + /**Specify pointer type value of circular gauge. See PointerType + * @Default {Needle} + */ + type?: ej.datavisualization.CircularGauge.PointerType|string; + + /**Specify value of the pointer of circular gauge + * @Default {null} + */ + value?: number; + + /**Specify pointer width of circular gauge + * @Default {7} + */ + width?: number; +} + +export interface ScalesRangesBorder { + + /**Specify border color for ranges of circular gauge + * @Default {#32b3c6} + */ + color?: string; + + /**Specify border width for ranges of circular gauge + * @Default {1.5} + */ + width?: number; +} + +export interface ScalesRanges { + + /**Specify backgroundColor for the ranges of circular gauge + * @Default {#32b3c6} + */ + backgroundColor?: string; + + /**Specify border for ranges of circular gauge + * @Default {Object} + */ + border?: ScalesRangesBorder; + + /**Specify distanceFromScale value for ranges of circular gauge + * @Default {25} + */ + distanceFromScale?: number; + + /**Specify endValue for ranges of circular gauge + * @Default {null} + */ + endValue?: number; + + /**Specify endWidth for ranges of circular gauge + * @Default {10} + */ + endWidth?: number; + + /**Specify range gradients of circular gauge + * @Default {null} + */ + gradients?: any; + + /**Specify opacity value for ranges of circular gauge + * @Default {null} + */ + opacity?: number; + + /**Specify placement of circular gauge. See RangePlacement + * @Default {Near} + */ + placement?: ej.datavisualization.CircularGauge.Placement|string; + + /**Specify size of the range value of circular gauge + * @Default {5} + */ + size?: number; + + /**Specify startValue for ranges of circular gauge + * @Default {null} + */ + startValue?: number; + + /**Specify startWidth of circular gauge + * @Default {[Array.number] scale.ranges.startWidth = 10} + */ + startWidth?: number; +} + +export interface ScalesSubGaugesPosition { + + /**Specify x-axis position for sub-gauge of circular gauge + * @Default {0} + */ + x?: number; + + /**Specify y-axis position for sub-gauge of circular gauge + * @Default {0} + */ + y?: number; +} + +export interface ScalesSubGauges { + + /**Specify subGauge Height of circular gauge + * @Default {150} + */ + height?: number; + + /**Specify position for sub-gauge of circular gauge + * @Default {Object} + */ + position?: ScalesSubGaugesPosition; + + /**Specify subGauge Width of circular gauge + * @Default {150} + */ + width?: number; +} + +export interface ScalesTicks { + + /**Specify the angle for the ticks of circular gauge + * @Default {0} + */ + angle?: number; + + /**Specify tick color of circular gauge + * @Default {null} + */ + color?: string; + + /**Specify distanceFromScale value for ticks of circular gauge + * @Default {0} + */ + distanceFromScale?: number; + + /**Specify tick height of circular gauge + * @Default {16} + */ + height?: number; + + /**Specify tick placement of circular gauge. See TickPlacement + * @Default {Near} + */ + placement?: ej.datavisualization.CircularGauge.Placement|string; + + /**Specify tick Style of circular gauge. See TickType + * @Default {Major} + */ + type?: ej.datavisualization.CircularGauge.LabelType|string; + + /**Specify tick width of circular gauge + * @Default {3} + */ + width?: number; +} + +export interface Scales { + + /**Specify backgroundColor for the scale of circular gauge + * @Default {null} + */ + backgroundColor?: string; + + /**Specify border for scales of circular gauge + * @Default {Object} + */ + border?: ScalesBorder; + + /**Specify scale direction of circular gauge. See Directions + * @Default {Clockwise} + */ + direction?: ej.datavisualization.CircularGauge.Direction|string; + + /**Specify representing state of circular gauge + * @Default {Array} + */ + indicators?: Array; + + /**Specify the text values displayed in a meaningful manner alongside the ticks of circular gauge + * @Default {Array} + */ + labels?: Array; + + /**Specify majorIntervalValue of circular gauge + * @Default {10} + */ + majorIntervalValue?: number; + + /**Specify maximum scale value of circular gauge + * @Default {null} + */ + maximum?: number; + + /**Specify minimum scale value of circular gauge + * @Default {null} + */ + minimum?: number; + + /**Specify minorIntervalValue of circular gauge + * @Default {2} + */ + minorIntervalValue?: number; + + /**Specify opacity value of circular gauge + * @Default {1} + */ + opacity?: number; + + /**Specify pointer cap of circular gauge + * @Default {Object} + */ + pointerCap?: ScalesPointerCap; + + /**Specify pointers value of circular gauge + * @Default {Array} + */ + pointers?: Array; + + /**Specify scale radius of circular gauge + * @Default {170} + */ + radius?: number; + + /**Specify ranges value of circular gauge + * @Default {Array} + */ + ranges?: Array; + + /**Specify shadowOffset value of circular gauge + * @Default {0} + */ + shadowOffset?: number; + + /**Specify showIndicators of circular gauge + * @Default {false} + */ + showIndicators?: boolean; + + /**Specify showLabels of circular gauge + * @Default {true} + */ + showLabels?: boolean; + + /**Specify showPointers of circular gauge + * @Default {true} + */ + showPointers?: boolean; + + /**Specify showRanges of circular gauge + * @Default {false} + */ + showRanges?: boolean; + + /**Specify showScaleBar of circular gauge + * @Default {false} + */ + showScaleBar?: boolean; + + /**Specify showTicks of circular gauge + * @Default {true} + */ + showTicks?: boolean; + + /**Specify scaleBar size of circular gauge + * @Default {6} + */ + size?: number; + + /**Specify startAngle of circular gauge + * @Default {115} + */ + startAngle?: number; + + /**Specify subGauge of circular gauge + * @Default {Array} + */ + subGauges?: Array; + + /**Specify sweepAngle of circular gauge + * @Default {310} + */ + sweepAngle?: number; + + /**Specify ticks of circular gauge + * @Default {Array} + */ + ticks?: Array; +} + +export interface Tooltip { + + /**enable showCustomLabelTooltip of circular gauge + * @Default {false} + */ + showCustomLabelTooltip?: boolean; + + /**enable showLabelTooltip of circular gauge + * @Default {false} + */ + showLabelTooltip?: boolean; + + /**Specify tooltip templateID of circular gauge + * @Default {false} + */ + templateID?: string; +} +} +module CircularGauge +{ +enum FrameType +{ +//string +FullCircle, +//string +HalfCircle, +} +} +module CircularGauge +{ +enum gaugePosition +{ +//string +TopLeft, +//string +TopRight, +//string +TopCenter, +//string +MiddleLeft, +//string +MiddleRight, +//string +Center, +//string +BottomLeft, +//string +BottomRight, +//string +BottomCenter, +} +} +module CircularGauge +{ +enum CustomLabelPositionType +{ +//string +Top, +//string +Bottom, +//string +Right, +//string +Left, +} +} +module CircularGauge +{ +enum Direction +{ +//string +Clockwise, +//string +CounterClockwise, +} +} +module CircularGauge +{ +enum IndicatorTypes +{ +//string +Rectangle, +//string +Circle, +//string +Text, +//string +RoundedRectangle, +//string +Image, +} +} +module CircularGauge +{ +enum Placement +{ +//string +Near, +//string +Far, +} +} +module CircularGauge +{ +enum LabelType +{ +//string +Major, +//string +Minor, +} +} +module CircularGauge +{ +enum UnitTextPlacement +{ +//string +Back, +//string +Front, +} +} +module CircularGauge +{ +enum MarkerType +{ +//string +Rectangle, +//string +Circle, +//string +Triangle, +//string +Ellipse, +//string +Diamond, +//string +Pentagon, +//string +Slider, +//string +Pointer, +//string +Wedge, +//string +Trapezoid, +//string +RoundedRectangle, +//string +Image, +} +} +module CircularGauge +{ +enum NeedleType +{ +//string +Triangle, +//string +Rectangle, +//string +Arrow, +//string +Image, +//string +Trapezoid, +} +} +module CircularGauge +{ +enum PointerType +{ +//string +Needle, +//string +Marker, +} +} + +class DigitalGauge extends ej.Widget { + static fn: DigitalGauge; + constructor(element: JQuery, options?: DigitalGauge.Model); + constructor(element: Element, options?: DigitalGauge.Model); + model:DigitalGauge.Model; + defaults:DigitalGauge.Model; + + /** To destroy the digital gauge + * @returns {void} + */ + destroy(): void; + + /** To export Digital Gauge as Image + * @param {string} fileName for the Image + * @param {string} fileType for the Image + * @returns {void} + */ + exportImage(fileName: string, fileType: string): void; + + /** Gets the location of an item that is displayed on the gauge. + * @param {number} Position value of an item that is displayed on the gauge. + * @returns {void} + */ + getPosition(itemIndex: number): void; + + /** ClientSideMethod getValue Gets the value of an item that is displayed on the gauge + * @param {number} Index value of an item that displayed on the gauge + * @returns {void} + */ + getValue(itemIndex: number): void; + + /** Refresh the digital gauge widget + * @returns {void} + */ + refresh(): void; + + /** ClientSideMethod Set Position Sets the location of an item to be displayed in the gauge + * @param {number} Index value of the digital gauge item + * @param {any} Location value of the digital gauge + * @returns {void} + */ + setPosition(itemIndex: number, value: any): void; + + /** ClientSideMethod SetValue Sets the value of an item to be displayed in the gauge. + * @param {number} Index value of the digital gauge item + * @param {string} Text value to be displayed in the gaugeS + * @returns {void} + */ + setValue(itemIndex: number, value: string): void; +} +export module DigitalGauge{ + +export interface Model { + + /**Specifies the resize option of the DigitalGauge. + * @Default {false} + */ + enableResize?: boolean; + + /**Specifies the frame of the Digital gauge. + * @Default {{backgroundImageUrl: null, innerWidth: 6, outerWidth: 10}} + */ + frame?: Frame; + + /**Specifies the height of the DigitalGauge. + * @Default {150} + */ + height?: number; + + /**Specifies the items for the DigitalGauge. + * @Default {null} + */ + items?: Items; + + /**Specifies the matrixSegmentData for the DigitalGauge. + */ + matrixSegmentData?: any; + + /**Specifies the segmentData for the DigitalGauge. + */ + segmentData?: any; + + /**Specifies the themes for the Digital gauge. See Themes + * @Default {flatlight} + */ + themes?: string; + + /**Specifies the value to the DigitalGauge. + * @Default {text} + */ + value?: string; + + /**Specifies the width for the Digital gauge. + * @Default {400} + */ + width?: number; + + /**Triggers when the gauge is initialized.*/ + init? (e: InitEventArgs): void; + + /**Triggers when the gauge item rendering.*/ + itemRendering? (e: ItemRenderingEventArgs): void; + + /**Triggers when the gauge is start to load.*/ + load? (e: LoadEventArgs): void; + + /**Triggers when the gauge render is completed.*/ + renderComplete? (e: RenderCompleteEventArgs): void; +} + +export interface InitEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the all the options of the items. + */ + items?: any; + + /**returns the context element + */ + context?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface ItemRenderingEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the all the options of the items. + */ + items?: any; + + /**returns the context element + */ + context?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface LoadEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the all the options of the items. + */ + items?: any; + + /**returns the context element + */ + context?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface RenderCompleteEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the all the options of the items. + */ + items?: any; + + /**returns the context element + */ + context?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface Frame { + + /**Specifies the url of an image to be displayed as background of the Digital gauge. + * @Default {null} + */ + backgroundImageUrl?: string; + + /**Specifies the inner width for the frame, when the background image has been set for the Digital gauge.. + * @Default {6} + */ + innerWidth?: number; + + /**Specifies the outer width of the frame, when the background image has been set for the Digital gauge. + * @Default {10} + */ + outerWidth?: number; +} + +export interface ItemsCharacterSettings { + + /**Specifies the CharacterCount value for the DigitalGauge. + * @Default {4} + */ + count?: number; + + /**Specifies the opacity value for the DigitalGauge. + * @Default {1} + */ + opacity?: number; + + /**Specifies the value for spacing between the characters + * @Default {2} + */ + spacing?: number; + + /**Specifies the character type for the text to be displayed. + * @Default {ej.datavisualization.DigitalGauge.CharacterType.EightCrossEightDotMatrix} + */ + type?: ej.datavisualization.DigitalGauge.CharacterType|string; +} + +export interface ItemsFont { + + /**Set the font family value + * @Default {Arial} + */ + fontFamily?: string; + + /**Set the font style for the font + * @Default {italic} + */ + fontStyle?: ej.datavisualization.DigitalGauge.FontStyle|string; + + /**Set the font size value + * @Default {11px} + */ + size?: string; +} + +export interface ItemsPosition { + + /**Set the horizontal location for the text, where it needs to be placed within the gauge. + * @Default {0} + */ + x?: number; + + /**Set the vertical location for the text, where it needs to be placed within the gauge. + * @Default {0} + */ + y?: number; +} + +export interface ItemsSegmentSettings { + + /**Set the color for the text segments. + * @Default {null} + */ + color?: string; + + /**Set the gradient for the text segments. + * @Default {null} + */ + gradient?: any; + + /**Set the length for the text segments. + * @Default {2} + */ + length?: number; + + /**Set the opacity for the text segments. + * @Default {0} + */ + opacity?: number; + + /**Set the spacing for the text segments. + * @Default {1} + */ + spacing?: number; + + /**Set the width for the text segments. + * @Default {1} + */ + width?: number; +} + +export interface Items { + + /**Specifies the Character settings for the DigitalGauge. + * @Default {null} + */ + characterSettings?: ItemsCharacterSettings; + + /**Enable/Disable the custom font to be applied to the text in the gauge. + * @Default {false} + */ + enableCustomFont?: boolean; + + /**Set the specific font for the text, when the enableCustomFont is set to true + * @Default {null} + */ + font?: ItemsFont; + + /**Set the location for the text, where it needs to be placed within the gauge. + * @Default {null} + */ + position?: ItemsPosition; + + /**Set the segment settings for the digital gauge. + * @Default {null} + */ + segmentSettings?: ItemsSegmentSettings; + + /**Set the value for enabling/disabling the blurring effect for the shadows of the text + * @Default {0} + */ + shadowBlur?: number; + + /**Specifies the color of the text shadow. + * @Default {null} + */ + shadowColor?: string; + + /**Set the x offset value for the shadow of the text, indicating the location where it needs to be displayed. + * @Default {1} + */ + shadowOffsetX?: number; + + /**Set the y offset value for the shadow of the text, indicating the location where it needs to be displayed. + * @Default {1} + */ + shadowOffsetY?: number; + + /**Set the alignment of the text that is displayed within the gauge.See TextAlign + * @Default {left} + */ + textAlign?: string; + + /**Specifies the color of the text. + * @Default {null} + */ + textColor?: string; + + /**Specifies the text value. + * @Default {null} + */ + value?: string; +} +} +module DigitalGauge +{ +enum CharacterType +{ +//string +SevenSegment, +//string +FourteenSegment, +//string +SixteenSegment, +//string +EightCrossEightDotMatrix, +//string +EightCrossEightSquareMatrix, +} +} +module DigitalGauge +{ +enum FontStyle +{ +//string +Normal, +//string +Bold, +//string +Italic, +//string +Underline, +//string +Strikeout, +} +} + +class Chart extends ej.Widget { + static fn: Chart; + constructor(element: JQuery, options?: Chart.Model); + constructor(element: Element, options?: Chart.Model); + model:Chart.Model; + defaults:Chart.Model; + + /** Animates the series and/or indicators in Chart. When parameter is not passed to this method, then all the series and indicators present in Chart are animated. + * @param {Array} Series and indicator objects passed in the array collection are animated.Example + * @param {any} Series or indicator object passed to this method are animated.Example, + * @returns {void} + */ + animate(options: Array, option: any): void; + + /** Exports chart as an image or to an excel file. Chart can be exported as an image only when exportCanvasRendering option is set to true. + * @param {string} Type of the export operation to be performed. Following are the two export types that are supported now,1. 'image'2. 'excel'Example + * @param {string} URL of the service, where the chart will be exported to excel.Example, + * @param {boolean} When this parameter is true, all the chart objects initialized to the same document are exported to a single excel file. This is an optional parameter. By default, it is false.Example, + * @returns {void} + */ + export(type: string, url: string, exportMultipleChart: boolean): void; + + /** Redraws the entire chart. You can call this method whenever you update, add or remove points from the data source or whenever you want to refresh the UI. + * @returns {void} + */ + redraw(): void; +} +export module Chart{ + +export interface Model { + + /**Options for adding and customizing annotations in Chart. + */ + annotations?: Array; + + /**Url of the image to be used as chart background. + * @Default {null} + */ + backGroundImageUrl?: string; + + /**Options for customizing the color, opacity and width of the chart border. + */ + border?: Border; + + /**Controls whether Chart has to be responsive or not. + * @Default {false} + */ + canResize?: boolean; + + /**Options for configuring the border and background of the plot area. + */ + chartArea?: ChartArea; + + /**Options to split Chart into multiple plotting areas vertically. Each object in the collection represents a plotting area in Chart. + */ + columnDefinitions?: Array; + + /**Options for configuring the properties of all the series. You can also override the options for specific series by using series collection. + */ + commonSeriesOptions?: CommonSeriesOptions; + + /**Options for displaying and customizing the crosshair. + */ + crosshair?: Crosshair; + + /**Depth of the 3D Chart from front view of series to background wall. This property is applicable only for 3D view. + * @Default {100} + */ + depth?: number; + + /**Controls whether 3D view has to be enabled or not. 3D view is supported only for column, bar. Stacking column, stacking bar, pie and doughnut series types. + * @Default {false} + */ + enable3D?: boolean; + + /**Controls whether Chart has to be rendered as Canvas or SVG. Canvas rendering supports all functionalities in SVG rendering except 3D Charts. + * @Default {false} + */ + enableCanvasRendering?: boolean; + + /**Controls whether 3D view has to be rotated on dragging. This property is applicable only for 3D view. + * @Default {false} + */ + enableRotation?: boolean; + + /**Options to customize the technical indicators. + */ + indicators?: Array; + + /**Options to customize the legend items and legend title. + */ + legend?: Legend; + + /**Name of the culture based on which chart should be localized. Number and date time values are localized with respect to the culture name.String type properties like title text are not localized automatically. Provide localized text as value to string type properties. + * @Default {en-US} + */ + locale?: string; + + /**Palette is used to store the series fill color in array and apply the color to series collection in the order of series index. + * @Default {null} + */ + palette?: Array; + + /**Options to customize the left, right, top and bottom margins of chart area. + */ + Margin?: any; + + /**Perspective angle of the 3D view. Chart appears closer when perspective angle is decreased, and distant when perspective angle is increased.This property is applicable only when 3D view is enabled + * @Default {90} + */ + perspectiveAngle?: number; + + /**This is a horizontal axis that contains options to configure axis and it is the primary x axis for all the series in series array. To override x axis for particular series, create an axis object by providing unique name by using name property and add it to axes array. Then, assign the name to the series’s xAxisName property to link both axis and series. + */ + primaryXAxis?: PrimaryXAxis; + + /**This is a vertical axis that contains options to configure axis. This is the primary y axis for all the series in series array. To override y axis for particular series, create an axis object by providing unique name by using name property and add it to axes array. Then, assign the name to the series’s yAxisName property to link both axis and series. + */ + primaryYAxis?: PrimaryYAxis; + + /**Rotation angle of the 3D view. This property is applicable only when 3D view is enabled. + * @Default {0} + */ + rotation?: number; + + /**Options to split Chart into multiple plotting areas horizontally. Each object in the collection represents a plotting area in Chart. + */ + rowDefinitions?: Array; + + /**Specifies the properties used for customizing the series. + */ + series?: Array; + + /**Controls whether data points has to be displayed side by side or along the depth of the axis. + * @Default {false} + */ + sideBySideSeriesPlacement?: boolean; + + /**Options to customize the Chart size. + */ + size?: Size; + + /**Specifies the theme for Chart. + * @Default {Flatlight. See Theme} + */ + theme?: ej.datavisualization.Chart.Theme|string; + + /**Slope angle of 3D Chart. This property is applicable only when 3D view is enabled. + * @Default {0} + */ + tilt?: number; + + /**Options for customizing the title and subtitle of Chart. + */ + title?: Title; + + /**Width of the wall used in 3D Chart. Wall is present only in Cartesian type 3D series and not in 3D pie or Doughnut series. This property is applicable only when 3D view is enabled. + * @Default {2} + */ + wallSize?: number; + + /**Options for enabling zooming feature of chart. + */ + zooming?: Zooming; + + /**Fires after the series animation is completed. This event will be triggered for each series when animation is enabled.*/ + animationComplete? (e: AnimationCompleteEventArgs): void; + + /**Fires before rendering the labels. This event is fired for each label in axis. You can use this event to add custom text to axis labels.*/ + axesLabelRendering? (e: AxesLabelRenderingEventArgs): void; + + /**Fires during the initialization of axis labels.*/ + axesLabelsInitialize? (e: AxesLabelsInitializeEventArgs): void; + + /**Fires during axes range calculation. This event is fired for each axis present in Chart. You can use this event to customize axis range as required.*/ + axesRangeCalculate? (e: AxesRangeCalculateEventArgs): void; + + /**Fires before rendering the axis title. This event is triggered for each axis with title. You can use this event to add custom text to axis title.*/ + axesTitleRendering? (e: AxesTitleRenderingEventArgs): void; + + /**Fires during the calculation of chart area bounds. You can use this event to customize the bounds of chart area.*/ + chartAreaBoundsCalculate? (e: ChartAreaBoundsCalculateEventArgs): void; + + /**Fires after chart is created.*/ + create? (e: CreateEventArgs): void; + + /**Fires when chart is destroyed completely.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires before rendering the data labels. This event is triggered for each data label in the series. You can use this event to add custom text in data labels.*/ + displayTextRendering? (e: DisplayTextRenderingEventArgs): void; + + /**Fires during the calculation of legend bounds. You can use this event to customize the bounds of legend.*/ + legendBoundsCalculate? (e: LegendBoundsCalculateEventArgs): void; + + /**Fires on clicking the legend item.*/ + legendItemClick? (e: LegendItemClickEventArgs): void; + + /**Fires when moving mouse over legend item. You can use this event for hit testing on legend items.*/ + legendItemMouseMove? (e: LegendItemMouseMoveEventArgs): void; + + /**Fires before rendering the legend item. This event is fired for each legend item in Chart. You can use this event to customize legend item shape or add custom text to legend item.*/ + legendItemRendering? (e: LegendItemRenderingEventArgs): void; + + /**Fires before loading the chart.*/ + load? (e: LoadEventArgs): void; + + /**Fires on clicking a point in chart. You can use this event to handle clicks made on points.*/ + pointRegionClick? (e: PointRegionClickEventArgs): void; + + /**Fires when mouse is moved over a point.*/ + pointRegionMouseMove? (e: PointRegionMouseMoveEventArgs): void; + + /**Fires before rendering chart.*/ + preRender? (e: PreRenderEventArgs): void; + + /**Fires after selecting a series. This event is triggered after selecting a series only if selection mode is series.*/ + seriesRegionClick? (e: SeriesRegionClickEventArgs): void; + + /**Fires before rendering a series. This event is fired for each series in Chart.*/ + seriesRendering? (e: SeriesRenderingEventArgs): void; + + /**Fires before rendering the marker symbols. This event is triggered for each marker in Chart.*/ + symbolRendering? (e: SymbolRenderingEventArgs): void; + + /**Fires before rendering the Chart title. You can use this event to add custom text in Chart title.*/ + titleRendering? (e: TitleRenderingEventArgs): void; + + /**Fires before rendering the tooltip. This event is fired when tooltip is enabled and mouse is hovered on a Chart point. You can use this event to customize tooltip before rendering.*/ + toolTipInitialize? (e: ToolTipInitializeEventArgs): void; + + /**Fires before rendering crosshair tooltip in axis. This event is fired for each axis with crosshair label enabled. You can use this event to customize crosshair label before rendering*/ + trackAxisToolTip? (e: TrackAxisToolTipEventArgs): void; + + /**Fires before rendering trackball tooltip. This event is fired for each series in Chart because trackball tooltip is displayed for all the series. You can use this event to customize the text displayed in trackball tooltip.*/ + trackToolTip? (e: TrackToolTipEventArgs): void; + + /**Fires, on clicking the axis label.*/ + axisLabelClick? (e: AxisLabelClickEventArgs): void; + + /**Fires on moving mouse over the axis label.*/ + axisLabelMouseMove? (e: AxisLabelMouseMoveEventArgs): void; + + /**Fires, on the clicking the chart.*/ + chartClick? (e: ChartClickEventArgs): void; + + /**Fires on moving mouse over the chart.*/ + chartMouseMove? (e: ChartMouseMoveEventArgs): void; + + /**Fires, on double clicking the chart.*/ + chartDoubleClick? (e: ChartDoubleClickEventArgs): void; + + /**Fires on clicking the annotation.*/ + annotationClick? (e: AnnotationClickEventArgs): void; + + /**Fires, after the chart is resized.*/ + afterResize? (e: AfterResizeEventArgs): void; + + /**Fires, when chart size is changing.*/ + beforeResize? (e: BeforeResizeEventArgs): void; + + /**Fires, when error bar is rendering.*/ + errorBarRendering? (e: ErrorBarRenderingEventArgs): void; +} + +export interface AnimationCompleteEventArgs { + + /**Instance of the series that completed has animation. + */ + series?: any; + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface AxesLabelRenderingEventArgs { + + /**Instance of the corresponding axis. + */ + Axis?: any; + + /**Formatted text of the respective label. You can also add custom text to the label. + */ + LabelText?: string; + + /**Actual value of the label. + */ + LabelValue?: string; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the chart model object. + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface AxesLabelsInitializeEventArgs { + + /**Collection of axes in Chart + */ + dataAxes?: any; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the chart model object. + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface AxesRangeCalculateEventArgs { + + /**Difference between minimum and maximum value of axis range. + */ + delta?: number; + + /**Interval value of axis range. Grid lines, tick lines and axis labels are drawn based on this interval value. + */ + interval?: number; + + /**Maximum value of axis range. + */ + max?: number; + + /**Minimum value of axis range. + */ + min?: number; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the chart model object. + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface AxesTitleRenderingEventArgs { + + /**Instance of the axis whose title is being rendered + */ + axes?: any; + + /**X-coordinate of title location + */ + locationX?: number; + + /**Y-coordinate of title location + */ + locationY?: number; + + /**Axis title text. You can add custom text to the title. + */ + title?: string; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the chart model object. + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface ChartAreaBoundsCalculateEventArgs { + + /**Height of the chart area. + */ + areaBoundsHeight?: number; + + /**Width of the chart area. + */ + areaBoundsWidth?: number; + + /**X-coordinate of the chart area. + */ + areaBoundsX?: number; + + /**Y-coordinate of the chart area. + */ + areaBoundsY?: number; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the chart model object. + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface CreateEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the chart model object. + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the chart model object. + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface DisplayTextRenderingEventArgs { + + /**Text displayed in data label. You can add custom text to the data label + */ + text?: string; + + /**X-coordinate of data label location + */ + locationX?: number; + + /**Y-coordinate of data label location + */ + locationY?: number; + + /**Index of the series in series Collection whose data label is being rendered + */ + seriesIndex?: number; + + /**Index of the point in series whose data label is being rendered + */ + pointIndex?: number; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the chart model object. + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface LegendBoundsCalculateEventArgs { + + /**Height of the legend. + */ + legendBoundsHeight?: number; + + /**Width of the legend. + */ + legendBoundsWidth?: number; + + /**Number of rows to display the legend items + */ + legendBoundsRows?: number; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the chart model object. + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface LegendItemClickEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X-coordinate of legend item in pixel + */ + startX?: number; + + /**Y-coordinate of legend item in pixel + */ + startY?: number; + + /**Instance of the legend item object that is about to be rendered + */ + LegendItem?: any; + + /**Options to customize the legend item styles such as border, color, size, etc…, + */ + style?: any; + + /**Instance that holds information about legend bounds and legend item bounds. + */ + Bounds?: any; + + /**Name of the legend item shape. Use this option to customize legend item shape before rendering + */ + symbolShape?: string; + + /**Instance of the series object corresponding to the legend item + */ + series?: any; +} + +export interface LegendItemMouseMoveEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X-coordinate of legend item in pixel + */ + startX?: number; + + /**Y-coordinate of legend item in pixel + */ + startY?: number; + + /**Instance of the legend item object that is about to be rendered + */ + LegendItem?: any; + + /**Options to customize the legend item styles such as border, color, size, etc…, + */ + style?: any; + + /**Options to customize the legend item styles such as border, color, size, etc…, + */ + Bounds?: any; + + /**Name of the legend item shape. Use this option to customize legend item shape before rendering + */ + symbolShape?: string; + + /**Instance of the series object corresponding to the legend item + */ + series?: any; +} + +export interface LegendItemRenderingEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X-coordinate of legend item in pixel + */ + startX?: number; + + /**Y-coordinate of legend item in pixel + */ + startY?: number; + + /**Instance of the legend item object that is about to be rendered + */ + legendItem?: any; + + /**Options to customize the legend item styles such as border, color, size, etc. + */ + style?: any; + + /**Name of the legend item shape. Use this option to customize legend item shape before rendering + */ + symbolShape?: string; +} + +export interface LoadEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface PointRegionClickEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X-coordinate of point in pixel + */ + locationX?: number; + + /**Y-coordinate of point in pixel + */ + locationY?: number; + + /**Index of the point in series + */ + pointIndex?: number; + + /**Index of the series in series collection to which the point belongs + */ + seriesIndex?: number; +} + +export interface PointRegionMouseMoveEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X-coordinate of point in pixel + */ + locationX?: number; + + /**Y-coordinate of point in pixel + */ + locationY?: number; + + /**Index of the point in series + */ + pointIndex?: number; + + /**Index of the series in series collection to which the point belongs + */ + seriesIndex?: number; +} + +export interface PreRenderEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface SeriesRegionClickEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Instance of the selected series + */ + series?: any; + + /**Index of the selected series + */ + seriesIndex?: number; +} + +export interface SeriesRenderingEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Instance of the series which is about to get rendered + */ + series?: any; +} + +export interface SymbolRenderingEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Instance that holds the location of marker symbol + */ + location?: any; + + /**Options to customize the marker style such as color, border and size + */ + style?: any; +} + +export interface TitleRenderingEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Option to customize the title location in pixels + */ + location?: any; + + /**Read-only option to find the size of the title + */ + size?: any; + + /**Use this option to add custom text in title + */ + title?: string; +} + +export interface ToolTipInitializeEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Text to be displayed in tooltip. Set this option to customize the text displayed in tooltip + */ + currentText?: string; + + /**Index of the point on which mouse is hovered + */ + pointIndex?: number; + + /**Index of the series in series collection whose point is hovered by mouse + */ + seriesIndex?: number; +} + +export interface TrackAxisToolTipEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Location of the crosshair label in pixels + */ + location?: any; + + /**Index of the axis for which crosshair label is displayed + */ + axisIndex?: number; + + /**Instance of the chart axis object for which cross hair label is displayed + */ + crossAxis?: number; + + /**Text to be displayed in crosshair label. Use this option to add custom text in crosshair label + */ + currentTrackText?: string; +} + +export interface TrackToolTipEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Location of the trackball tooltip in pixels + */ + location?: any; + + /**Index of the point for which trackball tooltip is displayed + */ + pointIndex?: number; + + /**Index of the series in series collection + */ + seriesIndex?: number; + + /**Text to be displayed in trackball tooltip. Use this option to add custom text in trackball tooltip + */ + currentText?: string; + + /**Instance of the series object for which trackball tooltip is displayed. + */ + series?: any; +} + +export interface AxisLabelClickEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X and Y co-ordinate of the labels in chart area. + */ + location?: any; + + /**Index of the label. + */ + index?: number; + + /**Instance of the corresponding axis. + */ + axis?: any; + + /**Label that is clicked. + */ + text?: string; +} + +export interface AxisLabelMouseMoveEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X and Y co-ordinate of the labels in chart area. + */ + location?: any; + + /**Index of the label. + */ + index?: number; + + /**Instance of the corresponding axis. + */ + axis?: any; + + /**Label that is hovered. + */ + text?: string; +} + +export interface ChartClickEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X and Y co-ordinate of the points with respect to chart area. + */ + location?: any; + + /**ID of the target element. + */ + id?: string; + + /**Width and height of the chart. + */ + size?: any; + + /**x-coordinate of the pointer, relative to the page + */ + pageX?: number; + + /**y-coordinate of the pointer, relative to the page + */ + pageY?: number; +} + +export interface ChartMouseMoveEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X and Y co-ordinate of the points with respect to chart area. + */ + location?: any; + + /**ID of the target element. + */ + id?: string; + + /**Width and height of the chart. + */ + size?: any; + + /**x-coordinate of the pointer, relative to the page + */ + pageX?: number; + + /**y-coordinate of the pointer, relative to the page + */ + pageY?: number; +} + +export interface ChartDoubleClickEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X and Y co-ordinate of the points with respect to chart area. + */ + location?: any; + + /**ID of the target element. + */ + id?: string; + + /**Width and height of the chart. + */ + size?: any; + + /**x-coordinate of the pointer, relative to the page + */ + pageX?: number; + + /**y-coordinate of the pointer, relative to the page + */ + pageY?: number; +} + +export interface AnnotationClickEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X and Y co-ordinate of the annotation in chart area. + */ + location?: any; + + /**Information about the annotation, like Coordinate unit, Region, content + */ + contentData?: any; + + /**x-coordinate of the pointer, relative to the page + */ + pageX?: number; + + /**y-coordinate of the pointer, relative to the page + */ + pageY?: number; +} + +export interface AfterResizeEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Chart width, after resize + */ + width?: number; + + /**Chart height, after resize + */ + height?: number; + + /**Chart width, before resize + */ + prevWidth?: number; + + /**Chart height, before resize + */ + prevHeight?: number; + + /**Chart width, when the chart was first rendered + */ + originalWidth?: number; + + /**Chart height, when the chart was first rendered + */ + originalHeight?: number; +} + +export interface BeforeResizeEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Chart width, before resize + */ + currentWidth?: number; + + /**Chart height, before resize + */ + currentHeight?: number; + + /**Chart width, after resize + */ + newWidth?: number; + + /**Chart height, after resize + */ + newHeight?: number; +} + +export interface ErrorBarRenderingEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Error bar Object + */ + errorbar?: any; +} + +export interface AnnotationsMargin { + + /**Annotation is placed at the specified value above its original position. + * @Default {0} + */ + bottom?: number; + + /**Annotation is placed at the specified value from left side of its original position. + * @Default {0} + */ + left?: number; + + /**Annotation is placed at the specified value from the right side of its original position. + * @Default {0} + */ + right?: number; + + /**Annotation is placed at the specified value under its original position. + * @Default {0} + */ + top?: number; +} + +export interface Annotations { + + /**Angle to rotate the annotation in degrees. + * @Default {'0'} + */ + angle?: number; + + /**Text content or id of a HTML element to be displayed as annotation. + */ + content?: string; + + /**Specifies how annotations have to be placed in Chart. + * @Default {none. See CoordinateUnit} + */ + coordinateUnit?: ej.datavisualization.Chart.CoordinateUnit|string; + + /**Specifies the horizontal alignment of the annotation. + * @Default {middle. See HorizontalAlignment} + */ + horizontalAlignment?: ej.datavisualization.Chart.HorizontalAlignment|string; + + /**Options to customize the margin of annotation. + */ + margin?: AnnotationsMargin; + + /**Controls the opacity of the annotation. + * @Default {1} + */ + opacity?: number; + + /**Specifies whether annotation has to be placed with respect to chart or series. + * @Default {chart. See Region} + */ + region?: ej.datavisualization.Chart.Region|string; + + /**Specifies the vertical alignment of the annotation. + * @Default {middle. See VerticalAlignment} + */ + verticalAlignment?: ej.datavisualization.Chart.VerticalAlignment|string; + + /**Controls the visibility of the annotation. + * @Default {false} + */ + visible?: boolean; + + /**Represents the horizontal offset when coordinateUnit is pixels.when coordinateUnit is points, it represents the x-coordinate of axis bounded with xAxisName property or primary X axis when xAxisName is not provided.This property is not applicable when coordinateUnit is none. + * @Default {0} + */ + x?: number; + + /**Name of the horizontal axis to be used for positioning the annotation. This property is applicable only when coordinateUnit is points. + */ + xAxisName?: string; + + /**Represents the vertical offset when coordinateUnit is pixels.When coordinateUnit is points, it represents the y-coordinate of axis bounded with yAxisName property or primary Y axis when yAxisName is not provided.This property is not applicable when coordinateUnit is none. + * @Default {0} + */ + y?: number; + + /**Name of the vertical axis to be used for positioning the annotation.This property is applicable only when coordinateUnit is points. + */ + yAxisName?: string; +} + +export interface Border { + + /**Border color of the chart. + * @Default {null} + */ + color?: string; + + /**Opacity of the chart border. + * @Default {0.3} + */ + opacity?: number; + + /**Width of the Chart border. + * @Default {0} + */ + width?: number; +} + +export interface ChartAreaBorder { + + /**Border color of the plot area. + * @Default {Gray} + */ + color?: string; + + /**Opacity of the plot area border. + * @Default {0.3} + */ + opacity?: number; + + /**Border width of the plot area. + * @Default {0.5} + */ + width?: number; +} + +export interface ChartArea { + + /**Background color of the plot area. + * @Default {transparent} + */ + background?: string; + + /**Options for customizing the border of the plot area. + */ + border?: ChartAreaBorder; +} + +export interface ColumnDefinitions { + + /**Specifies the unit to measure the width of the column in plotting area. + * @Default {'pixel'. See Unit} + */ + unit?: ej.datavisualization.Chart.Unit|string; + + /**Width of the column in plotting area. Width is measured in either pixel or percentage based on the value of unit property. + * @Default {50} + */ + columnWidth?: number; + + /**Color of the line that indicates the starting point of the column in plotting area. + * @Default {transparent} + */ + lineColor?: string; + + /**Width of the line that indicates the starting point of the column in plot area. + * @Default {1} + */ + lineWidth?: number; +} + +export interface CommonSeriesOptionsBorder { + + /**Border color of all series. + * @Default {transparent} + */ + color?: string; + + /**DashArray for border of the series. + * @Default {null} + */ + dashArray?: string; + + /**Border width of all series. + * @Default {1} + */ + width?: number; +} + +export interface CommonSeriesOptionsFont { + + /**Font color of the text in all series. + * @Default {#707070} + */ + color?: string; + + /**Font Family for all the series. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Specifies the font Style for all the series. + * @Default {normal} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Specifies the font weight for all the series. + * @Default {regular} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity for text in all the series. + * @Default {1} + */ + opacity?: number; + + /**Font size for text in all the series. + * @Default {12px} + */ + size?: string; +} + +export interface CommonSeriesOptionsMarkerBorder { + + /**Border color of the marker shape. + * @Default {white} + */ + color?: string; + + /**Border width of the marker shape. + * @Default {3} + */ + width?: number; +} + +export interface CommonSeriesOptionsMarkerDataLabelBorder { + + /**Border color of the data label. + * @Default {null} + */ + color?: string; + + /**Border width of the data label. + * @Default {0.1} + */ + width?: number; +} + +export interface CommonSeriesOptionsMarkerDataLabelConnectorLine { + + /**Specifies when the connector has to be drawn as Bezier curve or straight line. This is applicable only for Pie and Doughnut chart types. + * @Default {line. See ConnectorLineType} + */ + type?: ej.datavisualization.Chart.ConnectorLineType|string; + + /**Width of the connector. + * @Default {0.5} + */ + width?: number; +} + +export interface CommonSeriesOptionsMarkerDataLabelFont { + + /**Font family of the data label. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style of the data label. + * @Default {normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the data label. + * @Default {regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of the text. + * @Default {1} + */ + opacity?: number; + + /**Font size of the data label. + * @Default {12px} + */ + size?: string; +} + +export interface CommonSeriesOptionsMarkerDataLabelMargin { + + /**Bottom margin of the text. + * @Default {5} + */ + bottom?: number; + + /**Left margin of the text. + * @Default {5} + */ + left?: number; + + /**Right margin of the text. + * @Default {5} + */ + right?: number; + + /**Top margin of the text. + * @Default {5} + */ + top?: number; +} + +export interface CommonSeriesOptionsMarkerDataLabel { + + /**Angle of the data label in degrees. Only the text gets rotated, whereas the background and border does not rotate. + * @Default {null} + */ + angle?: number; + + /**Options for customizing the border of the data label. + */ + border?: CommonSeriesOptionsMarkerDataLabelBorder; + + /**Options for displaying and customizing the line that connects point and data label. + */ + connectorLine?: CommonSeriesOptionsMarkerDataLabelConnectorLine; + + /**Background color of the data label. + * @Default {null} + */ + fill?: string; + + /**Options for customizing the data label font. + */ + font?: CommonSeriesOptionsMarkerDataLabelFont; + + /**Horizontal alignment of the data label. + * @Default {center} + */ + horizontalTextAlignment?: ej.datavisualization.Chart.HorizontalTextAlignment|string; + + /**Margin of the text to its background shape. The size of the background shape increases based on the margin applied to its text. + */ + margin?: CommonSeriesOptionsMarkerDataLabelMargin; + + /**Opacity of the data label. + * @Default {1} + */ + opacity?: number; + + /**Background shape of the data label. + * @Default {none. See Shape} + */ + shape?: ej.datavisualization.Chart.Shape|string; + + /**Name of a field in data source, where datalabel text is displayed. + */ + textMappingName?: string; + + /**Specifies the position of the data label. This property can be used only for the series such as column, bar, stacked column, stacked bar, 100% stacked column, 100% stacked bar, candle and OHLC. + * @Default {top. See TextPosition} + */ + textPosition?: ej.datavisualization.Chart.TextPosition|string; + + /**Vertical alignment of the data label. + * @Default {center} + */ + verticalTextAlignment?: ej.datavisualization.Chart.VerticalTextAlignment|string; + + /**Controls the visibility of the data labels. + * @Default {false} + */ + visible?: boolean; +} + +export interface CommonSeriesOptionsMarkerSize { + + /**Height of the marker. + * @Default {6} + */ + height?: number; + + /**Width of the marker. + * @Default {6} + */ + width?: number; +} + +export interface CommonSeriesOptionsMarker { + + /**Options for customizing the border of the marker shape. + */ + border?: CommonSeriesOptionsMarkerBorder; + + /**Options for displaying and customizing data labels. + */ + dataLabel?: CommonSeriesOptionsMarkerDataLabel; + + /**Color of the marker shape. + * @Default {null} + */ + fill?: string; + + /**The URL for the Image to be displayed as marker. In order to display image as marker, set series.marker.shape as ‘image’. + */ + imageUrl?: string; + + /**Opacity of the marker. + * @Default {1} + */ + opacity?: number; + + /**Specifies the shape of the marker. + * @Default {circle. See Shape} + */ + shape?: ej.datavisualization.Chart.Shape|string; + + /**Options for customizing the size of the marker shape. + */ + size?: CommonSeriesOptionsMarkerSize; + + /**Controls the visibility of the marker shape. + * @Default {false} + */ + visible?: boolean; +} + +export interface CommonSeriesOptionsTooltipBorder { + + /**Border color of the tooltip. + * @Default {null} + */ + color?: string; + + /**Border width of the tooltip. + * @Default {1} + */ + width?: number; +} + +export interface CommonSeriesOptionsTooltip { + + /**Options for customizing the border of the tooltip. + */ + border?: CommonSeriesOptionsTooltipBorder; + + /**Customize the corner radius of the tooltip rectangle. + * @Default {0} + */ + rx?: number; + + /**Customize the corner radius of the tooltip rectangle. + * @Default {0} + */ + ry?: number; + + /**Specifies the duration, the tooltip has to be displayed. + * @Default {500ms} + */ + duration?: string; + + /**Enables/disables the animation of the tooltip when moving from one point to other. + * @Default {true} + */ + enableAnimation?: boolean; + + /**Background color of the tooltip. + * @Default {null} + */ + fill?: string; + + /**Format of the tooltip content. + * @Default {#point.x# : #point.y#} + */ + format?: string; + + /**Opacity of the tooltip. + * @Default {0.5} + */ + opacity?: number; + + /**Custom template to format the tooltip content. Use “point.x” and “point.y” as a placeholder text to display the corresponding data point’s x and y value. + * @Default {null} + */ + template?: string; + + /**Controls the visibility of the tooltip. + * @Default {false} + */ + visible?: boolean; +} + +export interface CommonSeriesOptionsEmptyPointSettingsStyleBorder { + + /**Border color of the empty point. + */ + color?: string; + + /**Border width of the empty point. + * @Default {1} + */ + width?: number; +} + +export interface CommonSeriesOptionsEmptyPointSettingsStyle { + + /**Color of the empty point. + */ + color?: string; + + /**Options for customizing border of the empty point in the series. + */ + border?: CommonSeriesOptionsEmptyPointSettingsStyleBorder; +} + +export interface CommonSeriesOptionsEmptyPointSettings { + + /**Controls the visibility of the empty point. + * @Default {true} + */ + visible?: boolean; + + /**Specifies the mode of empty point. + * @Default {gap} + */ + displayMode?: ej.datavisualization.Chart.EmptyPointMode|string; + + /**Options for customizing the color and border of the empty point in the series. + */ + style?: CommonSeriesOptionsEmptyPointSettingsStyle; +} + +export interface CommonSeriesOptionsConnectorLine { + + /**Width of the connector line. + * @Default {1} + */ + width?: number; + + /**Color of the connector line. + * @Default {#565656} + */ + color?: string; + + /**DashArray of the connector line. + * @Default {null} + */ + dashArray?: string; + + /**DashArray of the connector line. + * @Default {1} + */ + opacity?: number; +} + +export interface CommonSeriesOptionsErrorBarCap { + + /**Show/Hides the error bar cap. + * @Default {true} + */ + visible?: boolean; + + /**Width of the error bar cap. + * @Default {1} + */ + width?: number; + + /**Length of the error bar cap. + * @Default {1} + */ + length?: number; + + /**Color of the error bar cap. + * @Default {“#000000”} + */ + fill?: string; +} + +export interface CommonSeriesOptionsErrorBar { + + /**Show/hides the error bar + * @Default {visible} + */ + visibility?: boolean; + + /**Specifies the type of error bar. + * @Default {FixedValue} + */ + type?: ej.datavisualization.Chart.ErrorBarType|string; + + /**Specifies the mode of error bar. + * @Default {vertical} + */ + mode?: ej.datavisualization.Chart.ErrorBarMode|string; + + /**Specifies the direction of error bar. + * @Default {both} + */ + direction?: ej.datavisualization.Chart.ErrorBarDirection|string; + + /**Value of vertical error bar. + * @Default {3} + */ + verticalErrorValue?: number; + + /**Value of horizontal error bar. + * @Default {1} + */ + horizontalErrorValue?: number; + + /**Value of positive horizontal error bar. + * @Default {1} + */ + horizontalPositiveErrorValue?: number; + + /**Value of negative horizontal error bar. + * @Default {1} + */ + horizontalNegativeErrorValue?: number; + + /**Value of positive vertical error bar. + * @Default {5} + */ + verticalPositiveErrorValue?: number; + + /**Value of negative vertical error bar. + * @Default {5} + */ + verticalNegativeErrorValue?: number; + + /**Fill color of the error bar. + * @Default {#000000} + */ + fill?: string; + + /**Width of the error bar. + * @Default {1} + */ + width?: number; + + /**Options for customizing the error bar cap. + */ + cap?: CommonSeriesOptionsErrorBarCap; +} + +export interface CommonSeriesOptionsTrendlines { + + /**Show/hides the trendline. + */ + visibility?: boolean; + + /**Specifies the type of the trendline for the series. + * @Default {linear. See TrendlinesType} + */ + type?: string; + + /**Name for the trendlines that is to be displayed in the legend text. + * @Default {trendline} + */ + name?: string; + + /**Fill color of the trendlines. + * @Default {#0000FF} + */ + fill?: string; + + /**Width of the trendlines. + * @Default {1} + */ + width?: number; + + /**Opacity of the trendline. + * @Default {1} + */ + opacity?: number; + + /**Pattern of dashes and gaps used to stroke the trendline. + */ + dashArray?: string; + + /**Future trends of the current series. + * @Default {0} + */ + forwardForecast?: number; + + /**Past trends of the current series. + * @Default {0} + */ + backwardForecast?: number; + + /**Specifies the order of the polynomial trendlines. + * @Default {0} + */ + polynomialOrder?: number; + + /**Specifies the moving average starting period value. + * @Default {2} + */ + period?: number; +} + +export interface CommonSeriesOptionsHighlightSettingsBorder { + + /**Border color of the series/point on highlight. + */ + color?: string; + + /**Border width of the series/point on highlight. + * @Default {2} + */ + width?: string; +} + +export interface CommonSeriesOptionsHighlightSettings { + + /**Enables/disables the ability to highlight the series or data point interactively. + * @Default {false} + */ + enable?: boolean; + + /**Specifies whether the series or data point has to be highlighted. + * @Default {series. See Mode} + */ + mode?: ej.datavisualization.Chart.Mode|string; + + /**Color of the series/point on highlight. + */ + color?: string; + + /**Opacity of the series/point on highlight. + * @Default {0.6} + */ + opacity?: number; + + /**Options for customizing the border of series on highlight. + */ + border?: CommonSeriesOptionsHighlightSettingsBorder; + + /**Specifies the pattern for the series/point on highlight. + * @Default {none. See Pattern} + */ + pattern?: string; + + /**Custom pattern for the series on highlight. + */ + customPattern?: string; +} + +export interface CommonSeriesOptionsSelectionSettingsBorder { + + /**Border color of the series/point on selection. + */ + color?: string; + + /**Border width of the series/point on selection. + * @Default {2} + */ + width?: string; +} + +export interface CommonSeriesOptionsSelectionSettings { + + /**Enables/disables the ability to select a series/data point interactively. + * @Default {false} + */ + enable?: boolean; + + /**Specifies the type of selection. + * @Default {single} + */ + type?: ej.datavisualization.Chart.SelectionType|string; + + /**Specifies whether the series or data point has to be selected. + * @Default {series. See Mode} + */ + mode?: ej.datavisualization.Chart.Mode|string; + + /**Color of the series/point on selection. + */ + color?: string; + + /**Opacity of the series/point on selection. + * @Default {0.6} + */ + opacity?: number; + + /**Options for customizing the border of the series on selection. + */ + border?: CommonSeriesOptionsSelectionSettingsBorder; + + /**Specifies the pattern for the series/point on selection. + * @Default {none. See Pattern} + */ + pattern?: string; + + /**Custom pattern for the series on selection. + */ + customPattern?: string; +} + +export interface CommonSeriesOptions { + + /**Options to customize the border of all the series. + */ + border?: CommonSeriesOptionsBorder; + + /**Pattern of dashes and gaps used to stroke all the line type series. + */ + dashArray?: string; + + /**Set the dataSource for all series. It can be an array of JSON objects or an instance of ej.DataManager. + * @Default {null} + */ + dataSource?: any; + + /**Controls the size of the hole in doughnut series. Value ranges from 0 to 1 + * @Default {0.4} + */ + doughnutCoefficient?: number; + + /**Controls the size of the doughnut series. Value ranges from 0 to 1. + * @Default {0.8} + */ + doughnutSize?: number; + + /**Specifies the type of series to be drawn in radar or polar series. + * @Default {line. See DrawType} + */ + drawType?: ej.datavisualization.Chart.DrawType|string; + + /**Enable/disable the animation for all the series. + * @Default {true} + */ + enableAnimation?: boolean; + + /**To avoid overlapping of data labels smartly. + * @Default {true} + */ + enableSmartLabels?: boolean; + + /**Start angle of pie/doughnut series. + * @Default {null} + */ + endAngle?: number; + + /**Explodes the pie/doughnut slices on mouse move. + * @Default {false} + */ + explode?: boolean; + + /**Explodes all the slice of pie/doughnut on render. + * @Default {false} + */ + explodeAll?: boolean; + + /**Index of the point to be exploded from pie/doughnut/pyramid/funnel. + * @Default {null} + */ + explodeIndex?: number; + + /**Specifies the distance of the slice from the center, when it is exploded. + * @Default {0.4} + */ + explodeOffset?: number; + + /**Fill color for all the series. + * @Default {null} + */ + fill?: string; + + /**Options for customizing the font of all the series. + */ + font?: CommonSeriesOptionsFont; + + /**Sets the height of the funnel in funnel series. Values can be either pixel or percentage. + * @Default {32.7%} + */ + funnelHeight?: string; + + /**Sets the width of the funnel in funnel series. Values can be either pixel or percentage. + * @Default {11.6%} + */ + funnelWidth?: string; + + /**Gap between the slices in pyramid and funnel series. + * @Default {0} + */ + gapRatio?: number; + + /**Specifies whether to join start and end point of a line/area series used in polar/radar chart to form a closed path. + * @Default {true} + */ + isClosed?: boolean; + + /**Specifies whether to stack the column series in polar/radar charts. + * @Default {false} + */ + isStacking?: boolean; + + /**Renders the chart vertically. This is applicable only for cartesian type series. + * @Default {false} + */ + isTransposed?: boolean; + + /**Position of the data label in pie/doughnut/pyramid/funnel series. OutsideExtended position is not applicable for pyramid/funnel. + * @Default {inside. See LabelPosition} + */ + labelPosition?: ej.datavisualization.Chart.LabelPosition|string; + + /**Specifies the line cap of the series. + * @Default {butt. See LineCap} + */ + lineCap?: ej.datavisualization.Chart.LineCap|string; + + /**Specifies the type of shape to be used where two lines meet. + * @Default {round. See LineJoin} + */ + lineJoin?: ej.datavisualization.Chart.LineJoin|string; + + /**Options for displaying and customizing marker for individual point in a series. Marker contains shapes and/or data labels. + */ + marker?: CommonSeriesOptionsMarker; + + /**Opacity of the series. + * @Default {1} + */ + opacity?: number; + + /**Name of a field in data source, where the fill color for all the data points is generated. + */ + palette?: string; + + /**Controls the size of pie series. Value ranges from 0 to 1. + * @Default {0.8} + */ + pieCoefficient?: number; + + /**Specifies the mode of the pyramid series. + * @Default {linear. See PyramidMode} + */ + pyramidMode?: ej.datavisualization.Chart.PyramidMode|string; + + /**Start angle from where the pie/doughnut series renders. By default it starts from 0. + * @Default {null} + */ + startAngle?: number; + + /**Options for customizing the tooltip of chart. + */ + tooltip?: CommonSeriesOptionsTooltip; + + /**Specifies the type of the series to render in chart. + * @Default {column. See Type} + */ + type?: ej.datavisualization.Chart.Type|string; + + /**Specifies the name of the x-axis that has to be associated with this series. Add an axis instance with this name to axes collection. + * @Default {null} + */ + xAxisName?: string; + + /**Name of the property in the datasource that contains x value for the series. + * @Default {null} + */ + xName?: string; + + /**Specifies the name of the y-axis that has to be associated with this series. Add an axis instance with this name to axes collection. + * @Default {null} + */ + yAxisName?: string; + + /**Name of the property in the datasource that contains y value for the series. + * @Default {null} + */ + yName?: string; + + /**Name of the property in the datasource that contains high value for the series. + * @Default {null} + */ + high?: string; + + /**Name of the property in the datasource that contains low value for the series. + * @Default {null} + */ + low?: string; + + /**Name of the property in the datasource that contains open value for the series. + * @Default {null} + */ + open?: string; + + /**Name of the property in the datasource that contains close value for the series. + * @Default {null} + */ + close?: string; + + /**Name of the property in the datasource that contains the size value for the bubble series. + * @Default {null} + */ + size?: string; + + /**Options for customizing the empty point in the series. + */ + emptyPointSettings?: CommonSeriesOptionsEmptyPointSettings; + + /**Fill color for the positive column of the waterfall. + * @Default {null} + */ + positiveFill?: string; + + /**Options for customizing the waterfall connector line. + */ + connectorLine?: CommonSeriesOptionsConnectorLine; + + /**Options to customize the error bar in series. + */ + errorBar?: CommonSeriesOptionsErrorBar; + + /**Option to add the trendlines to chart. + */ + trendlines?: Array; + + /**Options for customizing the appearance of the series or data point while highlighting. + */ + highlightSettings?: CommonSeriesOptionsHighlightSettings; + + /**Options for customizing the appearance of the series/data point on selection. + */ + selectionSettings?: CommonSeriesOptionsSelectionSettings; +} + +export interface CrosshairMarkerBorder { + + /**Border width of the marker. + * @Default {3} + */ + width?: number; +} + +export interface CrosshairMarkerSize { + + /**Height of the marker. + * @Default {10} + */ + height?: number; + + /**Width of the marker. + * @Default {10} + */ + width?: number; +} + +export interface CrosshairMarker { + + /**Options for customizing the border. + */ + border?: CrosshairMarkerBorder; + + /**Opacity of the marker. + * @Default {true} + */ + opacity?: boolean; + + /**Options for customizing the size of the marker. + */ + size?: CrosshairMarkerSize; + + /**Show/hides the marker. + * @Default {true} + */ + visible?: boolean; +} + +export interface Crosshair { + + /**Options for customizing the marker in crosshair. + */ + marker?: CrosshairMarker; + + /**Specifies the type of the crosshair. It can be trackball or crosshair + * @Default {crosshair. See CrosshairType} + */ + type?: ej.datavisualization.Chart.CrosshairType|string; + + /**Show/hides the crosshair/trackball visibility. + * @Default {false} + */ + visible?: boolean; +} + +export interface IndicatorsHistogramBorder { + + /**Color of the histogram border in MACD indicator. + * @Default {#9999ff} + */ + color?: string; + + /**Controls the width of histogram border line in MACD indicator. + * @Default {1} + */ + width?: number; +} + +export interface IndicatorsHistogram { + + /**Options to customize the histogram border in MACD indicator. + */ + border?: IndicatorsHistogramBorder; + + /**Color of histogram columns in MACD indicator. + * @Default {#ccccff} + */ + fill?: string; + + /**Opacity of histogram columns in MACD indicator. + * @Default {1} + */ + opacity?: number; +} + +export interface IndicatorsLowerLine { + + /**Color of lower line. + * @Default {#008000} + */ + fill?: string; + + /**Width of the lower line. + * @Default {2} + */ + width?: number; +} + +export interface IndicatorsMacdLine { + + /**Color of MACD line. + * @Default {#ff9933} + */ + fill?: string; + + /**Width of the MACD line. + * @Default {2} + */ + width?: number; +} + +export interface IndicatorsPeriodLine { + + /**Color of period line in indicator. + * @Default {blue} + */ + fill?: string; + + /**Width of the period line in indicators. + * @Default {2} + */ + width?: number; +} + +export interface IndicatorsTooltipBorder { + + /**Border color of indicator tooltip. + * @Default {null} + */ + color?: string; + + /**Border width of indicator tooltip. + * @Default {1} + */ + width?: number; +} + +export interface IndicatorsTooltip { + + /**Option to customize the border of indicator tooltip. + */ + border?: IndicatorsTooltipBorder; + + /**Specifies the animation duration of indicator tooltip. + * @Default {500ms} + */ + duration?: string; + + /**Enables/disables the tooltip animation. + * @Default {true} + */ + enableAnimation?: boolean; + + /**Format of indicator tooltip. Use “point.x” and “point.y” as a placeholder text to display the corresponding data point’s x and y value. + * @Default {#point.x# : #point.y#} + */ + format?: string; + + /**Background color of indicator tooltip. + * @Default {null} + */ + fill?: string; + + /**Opacity of indicator tooltip. + * @Default {0.95} + */ + opacity?: number; + + /**Controls the visibility of indicator tooltip. + * @Default {false} + */ + visible?: boolean; +} + +export interface IndicatorsUpperLine { + + /**Fill color of the upper line in indicators + * @Default {#ff9933} + */ + fill?: string; + + /**Width of the upper line in indicators. + * @Default {2} + */ + width?: number; +} + +export interface Indicators { + + /**The dPeriod value for stochastic indicator. + * @Default {3} + */ + dPeriod?: number; + + /**Enables/disables the animation. + * @Default {false} + */ + enableAnimation?: boolean; + + /**Color of the technical indicator. + * @Default {#00008B} + */ + fill?: string; + + /**Options to customize the histogram in MACD indicator. + */ + histogram?: IndicatorsHistogram; + + /**Specifies the k period in stochastic indicator. + * @Default {3} + */ + kPeriod?: number; + + /**Specifies the long period in MACD indicator. + * @Default {26} + */ + longPeriod?: number; + + /**Options to customize the lower line in indicators. + */ + lowerLine?: IndicatorsLowerLine; + + /**Options to customize the MACD line. + */ + macdLine?: IndicatorsMacdLine; + + /**Specifies the type of the MACD indicator. + * @Default {line. See MACDType} + */ + macdType?: string; + + /**Specifies period value in indicator. + * @Default {14} + */ + period?: number; + + /**Options to customize the period line in indicators. + */ + periodLine?: IndicatorsPeriodLine; + + /**Name of the series for which indicator has to be drawn. + */ + seriesName?: string; + + /**Specifies the short period in MACD indicator. + * @Default {13} + */ + shortPeriod?: number; + + /**Specifies the standard deviation value for Bollinger band indicator. + * @Default {2} + */ + standardDeviations?: number; + + /**Options to customize the tooltip. + */ + tooltip?: IndicatorsTooltip; + + /**Trigger value of MACD indicator. + * @Default {9} + */ + trigger?: number; + + /**Specifies the visibility of indicator. + * @Default {visible} + */ + visibility?: string; + + /**Specifies the type of indicator that has to be rendered. + * @Default {sma. See IndicatorsType} + */ + type?: string; + + /**Options to customize the upper line in indicators + */ + upperLine?: IndicatorsUpperLine; + + /**Width of the indicator line. + * @Default {2} + */ + width?: number; + + /**Name of the horizontal axis used for indicator. Primary X axis is used when x axis name is not specified. + */ + xAxisName?: string; + + /**Name of the vertical axis used for indicator. Primary Y axis is used when y axis name is not specified + */ + yAxisName?: string; +} + +export interface LegendBorder { + + /**Border color of the legend. + * @Default {transparent} + */ + color?: string; + + /**Border width of the legend. + * @Default {1} + */ + width?: number; +} + +export interface LegendFont { + + /**Font family for legend item text. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style for legend item text. + * @Default {Normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight for legend item text. + * @Default {Regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Font size for legend item text. + * @Default {12px} + */ + size?: string; +} + +export interface LegendItemStyleBorder { + + /**Border color of the legend items. + * @Default {transparent} + */ + color?: string; + + /**Border width of the legend items. + * @Default {1} + */ + width?: number; +} + +export interface LegendItemStyle { + + /**Options for customizing the border of legend items. + */ + border?: LegendItemStyleBorder; + + /**Height of the shape in legend items. + * @Default {10} + */ + height?: number; + + /**Width of the shape in legend items. + * @Default {10} + */ + width?: number; +} + +export interface LegendLocation { + + /**X value or horizontal offset to position the legend in chart. + * @Default {0} + */ + x?: number; + + /**Y value or vertical offset to position the legend. + * @Default {0} + */ + y?: number; +} + +export interface LegendSize { + + /**Height of the legend. Height can be specified in either pixel or percentage. + * @Default {null} + */ + height?: string; + + /**Width of the legend. Width can be specified in either pixel or percentage. + * @Default {null} + */ + width?: string; +} + +export interface LegendTitleFont { + + /**Font family for the text in legend title. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style for legend title. + * @Default {normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight for legend title. + * @Default {normal. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Font size for legend title. + * @Default {12px} + */ + size?: string; +} + +export interface LegendTitle { + + /**Options to customize the font used for legend title + */ + font?: LegendTitleFont; + + /**Text to be displayed in legend title. + */ + text?: string; + + /**Alignment of the legend title. + * @Default {center. See Alignment} + */ + textAlignment?: ej.datavisualization.Chart.Alignment|string; +} + +export interface Legend { + + /**Horizontal alignment of the legend. + * @Default {Center. See Alignment} + */ + alignment?: ej.datavisualization.Chart.Alignment|string; + + /**Background for the legend. Use this property to add a background image or background color for the legend. + */ + background?: string; + + /**Options for customizing the legend border. + */ + border?: LegendBorder; + + /**Number of columns to arrange the legend items. + * @Default {null} + */ + columnCount?: number; + + /**Controls whether legend has to use scrollbar or not. When enabled, scroll bar appears depending upon size and position properties of legend. + * @Default {true} + */ + enableScrollbar?: boolean; + + /**Fill color for the legend items. By using this property, it displays all legend item shapes in same color.Legend items representing invisible series is displayed in gray color. + * @Default {null} + */ + fill?: string; + + /**Options to customize the font used for legend item text. + */ + font?: LegendFont; + + /**Gap or padding between the legend items. + * @Default {10} + */ + itemPadding?: number; + + /**Options to customize the style of legend items. + */ + itemStyle?: LegendItemStyle; + + /**Options to customize the location of chart legend. Legend is placed in provided location only when value of position property is custom + */ + location?: LegendLocation; + + /**Opacity of the legend. + * @Default {1} + */ + opacity?: number; + + /**Places the legend at specified position. Legend can be placed at left, right, top or bottom of the chart area.To manually specify the location of legend, set custom as value to this property. + * @Default {Bottom. See Position} + */ + position?: ej.datavisualization.Chart.Position|string; + + /**Number of rows to arrange the legend items. + * @Default {null} + */ + rowCount?: number; + + /**Shape of the legend items. Default shape for pie and doughnut series is circle and all other series uses rectangle. + * @Default {None. See Shape} + */ + shape?: ej.datavisualization.Chart.Shape|string; + + /**Options to customize the size of the legend. + */ + size?: LegendSize; + + /**Options to customize the legend title. + */ + title?: LegendTitle; + + /**Specifies the action taken when the legend width is more than the textWidth. + * @Default {none. See textOverflow} + */ + textOverflow?: ej.datavisualization.Chart.TextOverflow|string; + + /**Text width for legend item. + * @Default {34} + */ + textWidth?: number; + + /**Controls the visibility of the legend. + * @Default {true} + */ + visible?: boolean; +} + +export interface PrimaryXAxisAlternateGridBandEven { + + /**Fill color for the even grid bands. + * @Default {transparent} + */ + fill?: string; + + /**Opacity of the even grid band. + * @Default {1} + */ + opacity?: number; +} + +export interface PrimaryXAxisAlternateGridBandOdd { + + /**Fill color of the odd grid bands + * @Default {transparent} + */ + fill?: string; + + /**Opacity of odd grid band + * @Default {1} + */ + opacity?: number; +} + +export interface PrimaryXAxisAlternateGridBand { + + /**Options for customizing even grid band. + */ + even?: PrimaryXAxisAlternateGridBandEven; + + /**Options for customizing odd grid band. + */ + odd?: PrimaryXAxisAlternateGridBandOdd; +} + +export interface PrimaryXAxisAxisLine { + + /**Pattern of dashes and gaps to be applied to the axis line. + * @Default {null} + */ + dashArray?: string; + + /**Padding for axis line. Normally, it is used along with plotOffset to pad the plot area. + * @Default {null} + */ + offset?: number; + + /**Show/hides the axis line. + * @Default {true} + */ + visible?: boolean; + + /**Width of axis line. + * @Default {1} + */ + width?: number; +} + +export interface PrimaryXAxisCrosshairLabel { + + /**Show/hides the crosshair label associated with this axis. + * @Default {false} + */ + visible?: boolean; +} + +export interface PrimaryXAxisFont { + + /**Font family of labels. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style of labels. + * @Default {ej.datavisualization.Chart.FontStyle.Normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the label. + * @Default {ej.datavisualization.Chart.FontWeight.Regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of the axis labels. + * @Default {1} + */ + opacity?: number; + + /**Font size of the axis labels. + * @Default {13px} + */ + size?: string; +} + +export interface PrimaryXAxisMajorGridLines { + + /**Pattern of dashes and gaps used to stroke the major grid lines. + * @Default {null} + */ + dashArray?: string; + + /**Opacity of major grid lines. + * @Default {1} + */ + opacity?: number; + + /**Show/hides the major grid lines. + * @Default {true} + */ + visible?: boolean; + + /**Width of the major grid lines. + * @Default {1} + */ + width?: number; +} + +export interface PrimaryXAxisMajorTickLines { + + /**Length of the major tick lines. + * @Default {5} + */ + size?: number; + + /**Show/hides the major tick lines. + * @Default {true} + */ + visible?: boolean; + + /**Width of the major tick lines. + * @Default {1} + */ + width?: number; +} + +export interface PrimaryXAxisMinorGridLines { + + /**Patterns of dashes and gaps used to stroke the minor grid lines. + * @Default {null} + */ + dashArray?: string; + + /**Show/hides the minor grid lines. + * @Default {true} + */ + visible?: boolean; + + /**Width of the minorGridLines. + * @Default {1} + */ + width?: number; +} + +export interface PrimaryXAxisMinorTickLines { + + /**Length of the minor tick lines. + * @Default {5} + */ + size?: number; + + /**Show/hides the minor tick lines. + * @Default {true} + */ + visible?: boolean; + + /**Width of the minor tick line. + * @Default {1} + */ + width?: number; +} + +export interface PrimaryXAxisRange { + + /**Minimum value of the axis range. + * @Default {null} + */ + minimum?: number; + + /**Maximum value of the axis range. + * @Default {null} + */ + maximum?: number; + + /**Interval of the axis range. + * @Default {null} + */ + interval?: number; +} + +export interface PrimaryXAxisStripLineFont { + + /**Font color of the strip line text. + * @Default {black} + */ + color?: string; + + /**Font family of the strip line text. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style of the strip line text. + * @Default {Normal} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the strip line text. + * @Default {regular} + */ + fontWeight?: string; + + /**Opacity of the strip line text. + * @Default {1} + */ + opacity?: number; + + /**Font size of the strip line text. + * @Default {12px} + */ + size?: string; +} + +export interface PrimaryXAxisStripLine { + + /**Border color of the strip line. + * @Default {gray} + */ + borderColor?: string; + + /**Background color of the strip line. + * @Default {gray} + */ + color?: string; + + /**End value of the strip line. + * @Default {null} + */ + end?: number; + + /**Options for customizing the font of the text. + */ + font?: PrimaryXAxisStripLineFont; + + /**Start value of the strip line. + * @Default {null} + */ + start?: number; + + /**Indicates whether to render the strip line from the minimum/start value of the axis. This property does not work when start property is set. + * @Default {false} + */ + startFromAxis?: boolean; + + /**Specifies text to be displayed inside the strip line. + * @Default {stripLine} + */ + text?: string; + + /**Specifies the alignment of the text inside the strip line. + * @Default {middlecenter. See TextAlignment} + */ + textAlignment?: ej.datavisualization.Chart.TextAlignment|string; + + /**Show/hides the strip line. + * @Default {false} + */ + visible?: boolean; + + /**Width of the strip line. + * @Default {0} + */ + width?: number; + + /**Specifies the order where the strip line and the series have to be rendered. When zOrder is “behind”, strip line is rendered under the series and when it is “over”, it is rendered above the series. + * @Default {over. See ZIndex} + */ + zIndex?: ej.datavisualization.Chart.ZIndex|string; +} + +export interface PrimaryXAxisTitleFont { + + /**Font family of the title text. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style of the title text. + * @Default {ej.datavisualization.Chart.FontStyle.Normal} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the title text. + * @Default {ej.datavisualization.Chart.FontWeight.Regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of the axis title text. + * @Default {1} + */ + opacity?: number; + + /**Font size of the axis title. + * @Default {16px} + */ + size?: string; +} + +export interface PrimaryXAxisTitle { + + /**Specifies whether to trim the axis title when it exceeds the chart area or the maximum width of the title. + * @Default {false} + */ + enableTrim?: boolean; + + /**Options for customizing the title font. + */ + font?: PrimaryXAxisTitleFont; + + /**Maximum width of the title, when the title exceeds this width, the title gets trimmed, when enableTrim is true. + * @Default {34} + */ + maximumTitleWidth?: number; + + /**Title for the axis. + */ + text?: string; + + /**Controls the visibility of axis title. + * @Default {true} + */ + visible?: boolean; +} + +export interface PrimaryXAxis { + + /**Options for customizing horizontal axis alternate grid band. + */ + alternateGridBand?: PrimaryXAxisAlternateGridBand; + + /**Options for customizing the axis line. + */ + axisLine?: PrimaryXAxisAxisLine; + + /**Specifies the index of the column where the axis is associated, when the chart area is divided into multiple plot areas by using columnDefinitions. + * @Default {null} + */ + columnIndex?: number; + + /**Specifies the number of columns or plot areas an axis has to span horizontally. + * @Default {null} + */ + columnSpan?: number; + + /**Options to customize the crosshair label. + */ + crosshairLabel?: PrimaryXAxisCrosshairLabel; + + /**With this setting, you can request axis to calculate intervals approximately equal to your desired interval. + * @Default {null} + */ + desiredIntervals?: number; + + /**Specifies the position of labels at the edge of the axis. + * @Default {ej.datavisualization.Chart.EdgeLabelPlacement.None. See EdgeLabelPlacement} + */ + edgeLabelPlacement?: ej.datavisualization.Chart.EdgeLabelPlacement|string; + + /**Specifies whether to trim the axis label when the width of the label exceeds the maximumLabelWidth. + * @Default {false} + */ + enableTrim?: boolean; + + /**Options for customizing the font of the axis Labels. + */ + font?: PrimaryXAxisFont; + + /**Specifies the type of interval in date time axis. + * @Default {null. See IntervalType} + */ + intervalType?: ej.datavisualization.Chart.IntervalType|string; + + /**Specifies whether to inverse the axis. + * @Default {false} + */ + isInversed?: boolean; + + /**Custom formatting for axis label and supports all standard formatting type of numerical and date time values. + * @Default {null} + */ + labelFormat?: string; + + /**Specifies the action to take when the axis labels are overlapping with each other. + * @Default {ej.datavisualization.Chart.LabelIntersectAction.None. See LabelIntersectAction} + */ + labelIntersectAction?: ej.datavisualization.Chart.LabelIntersectAction|string; + + /**Specifies the position of the axis labels. + * @Default {outside. See LabelPosition} + */ + labelPosition?: ej.datavisualization.Chart.LabelPosition|string; + + /**Angle in degrees to rotate the axis labels. + * @Default {null} + */ + labelRotation?: number; + + /**Logarithmic base value. This is applicable only for logarithmic axis. + * @Default {10} + */ + logBase?: number; + + /**Options for customizing major gird lines. + */ + majorGridLines?: PrimaryXAxisMajorGridLines; + + /**Options for customizing the major tick lines. + */ + majorTickLines?: PrimaryXAxisMajorTickLines; + + /**Maximum number of labels to be displayed in every 100 pixels. + * @Default {3} + */ + maximumLabels?: number; + + /**Maximum width of the axis label. When the label exceeds the width, the label gets trimmed when the enableTrim is set to true. + * @Default {34} + */ + maximumLabelWidth?: number; + + /**Options for customizing the minor grid lines. + */ + minorGridLines?: PrimaryXAxisMinorGridLines; + + /**Options for customizing the minor tick lines. + */ + minorTickLines?: PrimaryXAxisMinorTickLines; + + /**Specifies the number of minor ticks per interval. + * @Default {null} + */ + minorTicksPerInterval?: number; + + /**Unique name of the axis. To associate an axis with the series, you have to set this name to the xAxisName/yAxisName property of the series. + * @Default {null} + */ + name?: string; + + /**Specifies whether to render the axis at the opposite side of its default position. + * @Default {false} + */ + opposedPosition?: boolean; + + /**Specifies the padding for the plot area. + * @Default {10} + */ + plotOffset?: number; + + /**Options to customize the range of the axis. + */ + range?: PrimaryXAxisRange; + + /**Specifies the padding for the axis range. + * @Default {None. See RangePadding} + */ + rangePadding?: ej.datavisualization.Chart.RangePadding|string; + + /**Rounds the number to the given number of decimals. + * @Default {null} + */ + roundingPlaces?: number; + + /**Options for customizing the strip lines. + * @Default {[ ]} + */ + stripLine?: Array; + + /**Specifies the position of the axis tick lines. + * @Default {outside. See TickLinesPosition} + */ + tickLinesPosition?: ej.datavisualization.Chart.TickLinesPosition|string; + + /**Options for customizing the axis title. + */ + title?: PrimaryXAxisTitle; + + /**Specifies the type of data the axis is handling. + * @Default {null. See ValueType} + */ + valueType?: ej.datavisualization.Chart.ValueType|string; + + /**Show/hides the axis. + * @Default {true} + */ + visible?: boolean; + + /**The axis is scaled by this factor. When zoomFactor is 0.5, the chart is scaled by 200% along this axis. Value ranges from 0 to 1. + * @Default {1} + */ + zoomFactor?: number; + + /**Position of the zoomed axis. Value ranges from 0 to 1. + * @Default {0} + */ + zoomPosition?: number; +} + +export interface PrimaryYAxisAlternateGridBandEven { + + /**Fill color for the even grid bands. + * @Default {transparent} + */ + fill?: string; + + /**Opacity of the even grid band. + * @Default {1} + */ + opacity?: number; +} + +export interface PrimaryYAxisAlternateGridBandOdd { + + /**Fill color of the odd grid bands. + * @Default {transparent} + */ + fill?: string; + + /**Opacity of odd grid band. + * @Default {1} + */ + opacity?: number; +} + +export interface PrimaryYAxisAlternateGridBand { + + /**Options for customizing even grid band. + */ + even?: PrimaryYAxisAlternateGridBandEven; + + /**Options for customizing odd grid band. + */ + odd?: PrimaryYAxisAlternateGridBandOdd; +} + +export interface PrimaryYAxisAxisLine { + + /**Pattern of dashes and gaps to be applied to the axis line. + * @Default {null} + */ + dashArray?: string; + + /**Padding for axis line. Normally, it is used along with plotOffset to pad the plot area. + * @Default {null} + */ + offset?: number; + + /**Show/hides the axis line. + * @Default {true} + */ + visible?: boolean; + + /**Width of axis line. + * @Default {1} + */ + width?: number; +} + +export interface PrimaryYAxisCrosshairLabel { + + /**Show/hides the crosshair label associated with this axis. + * @Default {false} + */ + visible?: boolean; +} + +export interface PrimaryYAxisFont { + + /**Font family of labels. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style of labels. + * @Default {ej.datavisualization.Chart.FontStyle.Normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the label. + * @Default {ej.datavisualization.Chart.FontWeight.Regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of the axis labels. + * @Default {1} + */ + opacity?: number; + + /**Font size of the axis labels. + * @Default {13px} + */ + size?: string; +} + +export interface PrimaryYAxisMajorGridLines { + + /**Pattern of dashes and gaps used to stroke the major grid lines. + * @Default {null} + */ + dashArray?: string; + + /**Opacity of major grid lines. + * @Default {1} + */ + opacity?: number; + + /**Show/hides the major grid lines. + * @Default {true} + */ + visible?: boolean; + + /**Width of the major grid lines. + * @Default {1} + */ + width?: number; +} + +export interface PrimaryYAxisMajorTickLines { + + /**Length of the major tick lines. + * @Default {5} + */ + size?: number; + + /**Show/hides the major tick lines. + * @Default {true} + */ + visible?: boolean; + + /**Width of the major tick lines. + * @Default {1} + */ + width?: number; +} + +export interface PrimaryYAxisMinorGridLines { + + /**Patterns of dashes and gaps used to stroke the minor grid lines. + * @Default {null} + */ + dashArray?: string; + + /**Show/hides the minor grid lines. + * @Default {true} + */ + visible?: boolean; + + /**Width of the minorGridLines. + * @Default {1} + */ + width?: number; +} + +export interface PrimaryYAxisMinorTickLines { + + /**Length of the minor tick lines. + * @Default {5} + */ + size?: number; + + /**Show/hides the minor tick lines. + * @Default {true} + */ + visible?: boolean; + + /**Width of the minor tick line + * @Default {1} + */ + width?: number; +} + +export interface PrimaryYAxisStripLineFont { + + /**Font color of the strip line text. + * @Default {black} + */ + color?: string; + + /**Font family of the strip line text. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style of the strip line text. + * @Default {Normal} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the strip line text. + * @Default {regular} + */ + fontWeight?: string; + + /**Opacity of the strip line text. + * @Default {1} + */ + opacity?: number; + + /**Font size of the strip line text. + * @Default {12px} + */ + size?: string; +} + +export interface PrimaryYAxisStripLine { + + /**Border color of the strip line. + * @Default {gray} + */ + borderColor?: string; + + /**Background color of the strip line. + * @Default {gray} + */ + color?: string; + + /**End value of the strip line. + * @Default {null} + */ + end?: number; + + /**Options for customizing the font of the text. + */ + font?: PrimaryYAxisStripLineFont; + + /**Start value of the strip line. + * @Default {null} + */ + start?: number; + + /**Indicates whether to render the strip line from the minimum/start value of the axis. This property won’t work when start property is set. + * @Default {false} + */ + startFromAxis?: boolean; + + /**Specifies text to be displayed inside the strip line. + * @Default {stripLine} + */ + text?: string; + + /**Specifies the alignment of the text inside the strip line. + * @Default {middlecenter. See TextAlignment} + */ + textAlignment?: ej.datavisualization.Chart.TextAlignment|string; + + /**Show/hides the strip line. + * @Default {false} + */ + visible?: boolean; + + /**Width of the strip line. + * @Default {0} + */ + width?: number; + + /**Specifies the order in which strip line and the series have to be rendered. When zOrder is “behind”, strip line is rendered below the series and when it is “over”, it is rendered above the series. + * @Default {over. See ZIndex} + */ + zIndex?: ej.datavisualization.Chart.ZIndex|string; +} + +export interface PrimaryYAxisTitleFont { + + /**Font family of the title text. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style of the title text. + * @Default {ej.datavisualization.Chart.FontStyle.Normal} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the title text. + * @Default {ej.datavisualization.Chart.FontWeight.Regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of the axis title text. + * @Default {1} + */ + opacity?: number; + + /**Font size of the axis title. + * @Default {16px} + */ + size?: string; +} + +export interface PrimaryYAxisTitle { + + /**Specifies whether to trim the axis title when it exceeds the chart area or the maximum width of the title. + * @Default {ej.datavisualization.Chart.enableTrim} + */ + enableTrim?: boolean; + + /**Options for customizing the title font. + */ + font?: PrimaryYAxisTitleFont; + + /**Maximum width of the title, when the title exceeds this width, the title gets trimmed, when enableTrim is true. + * @Default {ej.datavisualization.Chart.maximumTitleWidth.null} + */ + maximumTitleWidth?: number; + + /**Title for the axis. + */ + text?: string; + + /**Controls the visibility of axis title. + * @Default {true} + */ + visible?: boolean; +} + +export interface PrimaryYAxis { + + /**Options for customizing vertical axis alternate grid band. + */ + alternateGridBand?: PrimaryYAxisAlternateGridBand; + + /**Options for customizing the axis line. + */ + axisLine?: PrimaryYAxisAxisLine; + + /**Options to customize the crosshair label. + */ + crosshairLabel?: PrimaryYAxisCrosshairLabel; + + /**With this setting, you can request axis to calculate intervals approximately equal to your desired interval. + * @Default {null} + */ + desiredIntervals?: number; + + /**Specifies the position of labels at the edge of the axis. + * @Default {ej.datavisualization.Chart.EdgeLabelPlacement.None. See EdgeLabelPlacement} + */ + edgeLabelPlacement?: ej.datavisualization.Chart.EdgeLabelPlacement|string; + + /**Specifies whether to trim the axis label when the width of the label exceeds the maximumLabelWidth. + * @Default {false} + */ + enableTrim?: boolean; + + /**Options for customizing the font of the axis Labels. + */ + font?: PrimaryYAxisFont; + + /**Specifies the type of interval in date time axis. + * @Default {null. See IntervalType} + */ + intervalType?: ej.datavisualization.Chart.IntervalType|string; + + /**Specifies whether to inverse the axis. + * @Default {false} + */ + isInversed?: boolean; + + /**Custom formatting for axis label and supports all standard formatting type of numerical and date time values. + * @Default {null} + */ + labelFormat?: string; + + /**Specifies the action to take when the axis labels are overlapping with each other. + * @Default {ej.datavisualization.Chart.LabelIntersectAction.None} + */ + labelIntersectAction?: ej.datavisualization.Chart.LabelIntersectAction|string; + + /**Default Value + * @Default {outside. See LabelPosition} + */ + labelPosition?: ej.datavisualization.Chart.LabelPosition|string; + + /**Logarithmic base value. This is applicable only for logarithmic axis. + * @Default {10} + */ + logBase?: number; + + /**Options for customizing major gird lines. + */ + majorGridLines?: PrimaryYAxisMajorGridLines; + + /**Options for customizing the major tick lines. + */ + majorTickLines?: PrimaryYAxisMajorTickLines; + + /**Maximum number of labels to be displayed in every 100 pixels. + * @Default {3} + */ + maximumLabels?: number; + + /**Maximum width of the axis label. When the label exceeds the width, the label gets trimmed when the enableTrim is set to true. + * @Default {ej.datavisualization.Chart.maximumLabelWidth type {int}} + */ + maximumLabelWidth?: number; + + /**Options for customizing the minor grid lines. + */ + minorGridLines?: PrimaryYAxisMinorGridLines; + + /**Options for customizing the minor tick lines. + */ + minorTickLines?: PrimaryYAxisMinorTickLines; + + /**Specifies the number of minor ticks per interval. + * @Default {null} + */ + minorTicksPerInterval?: number; + + /**Unique name of the axis. To associate an axis with the series, you have to set this name to the xAxisName/yAxisName property of the series. + * @Default {null} + */ + name?: string; + + /**Specifies whether to render the axis at the opposite side of its default position. + * @Default {false} + */ + opposedPosition?: boolean; + + /**Specifies the padding for the plot area. + * @Default {10} + */ + plotOffset?: number; + + /**Specifies the padding for the axis range. + * @Default {ej.datavisualization.Chart.RangePadding.None. See RangePadding} + */ + rangePadding?: ej.datavisualization.Chart.RangePadding|string; + + /**Rounds the number to the given number of decimals. + * @Default {null} + */ + roundingPlaces?: number; + + /**Specifies the index of the row to which the axis is associated, when the chart area is divided into multiple plot areas by using rowDefinitions. + * @Default {null} + */ + rowIndex?: number; + + /**Specifies the number of row or plot areas an axis has to span vertically. + * @Default {null} + */ + rowSpan?: number; + + /**Options for customizing the strip lines. + * @Default {[ ]} + */ + stripLine?: Array; + + /**Specifies the position of the axis tick lines. + * @Default {outside. See TickLinesPosition} + */ + tickLinesPosition?: ej.datavisualization.Chart.TickLinesPosition|string; + + /**Options for customizing the axis title. + */ + title?: PrimaryYAxisTitle; + + /**Specifies the type of data the axis is handling. + * @Default {null. See ValueType} + */ + valueType?: ej.datavisualization.Chart.ValueType|string; + + /**Show/hides the axis. + * @Default {true} + */ + visible?: boolean; + + /**The axis is scaled by this factor. When zoomFactor is 0.5, the chart is scaled by 200% along this axis. Values ranges from 0 to 1. + * @Default {1} + */ + zoomFactor?: number; + + /**Position of the zoomed axis. Value ranges from 0 to 1 + * @Default {0} + */ + zoomPosition?: number; +} + +export interface RowDefinitions { + + /**Specifies the unit to measure the height of the row in plotting area. + * @Default {'pixel'. See Unit} + */ + unit?: ej.datavisualization.Chart.Unit|string; + + /**Height of the row in plotting area. Height is measured in either pixel or percentage based on the value of unit property. + * @Default {50} + */ + rowHeight?: number; + + /**Color of the line that indicates the starting point of the row in plotting area. + * @Default {transparent} + */ + lineColor?: string; + + /**Width of the line that indicates the starting point of the row in plot area. + * @Default {1} + */ + lineWidth?: number; +} + +export interface SeriesBorder { + + /**Border color of the series. + * @Default {transparent} + */ + color?: string; + + /**Border width of the series. + * @Default {1} + */ + width?: number; + + /**DashArray for border of the series. + * @Default {null} + */ + dashArray?: string; +} + +export interface SeriesFont { + + /**Font color of the series text. + * @Default {#707070} + */ + color?: string; + + /**Font Family of the series. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font Style of the series. + * @Default {Normal} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the series. + * @Default {Regular} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of series text. + * @Default {1} + */ + opacity?: number; + + /**Size of the series text. + * @Default {12px} + */ + size?: string; +} + +export interface SeriesMarkerBorder { + + /**Border color of the marker shape. + * @Default {white} + */ + color?: string; + + /**Border width of the marker shape. + * @Default {3} + */ + width?: number; +} + +export interface SeriesMarkerDataLabelBorder { + + /**Border color of the data label. + * @Default {null} + */ + color?: string; + + /**Border width of the data label. + * @Default {0.1} + */ + width?: number; +} + +export interface SeriesMarkerDataLabelConnectorLine { + + /**Specifies when the connector has to be drawn as Bezier curve or straight line. This is applicable only for Pie and Doughnut chart types. + * @Default {line. See ConnectorLineType} + */ + type?: ej.datavisualization.Chart.Type|string; + + /**Width of the connector. + * @Default {0.5} + */ + width?: number; +} + +export interface SeriesMarkerDataLabelFont { + + /**Font family of the data label. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style of the data label. + * @Default {normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the data label. + * @Default {regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of the text. + * @Default {1} + */ + opacity?: number; + + /**Font size of the data label. + * @Default {12px} + */ + size?: string; +} + +export interface SeriesMarkerDataLabelMargin { + + /**Bottom margin of the text. + * @Default {5} + */ + bottom?: number; + + /**Left margin of the text. + * @Default {5} + */ + left?: number; + + /**Right margin of the text. + * @Default {5} + */ + right?: number; + + /**Top margin of the text. + * @Default {5} + */ + top?: number; +} + +export interface SeriesMarkerDataLabel { + + /**Angle of the data label in degrees. Only the text gets rotated, whereas the background and border does not rotate. + * @Default {null} + */ + angle?: number; + + /**Options for customizing the border of the data label. + */ + border?: SeriesMarkerDataLabelBorder; + + /**Options for displaying and customizing the line that connects point and data label. + */ + connectorLine?: SeriesMarkerDataLabelConnectorLine; + + /**Background color of the data label. + * @Default {null} + */ + fill?: string; + + /**Options for customizing the data label font. + */ + font?: SeriesMarkerDataLabelFont; + + /**Horizontal alignment of the data label. + * @Default {center} + */ + horizontalTextAlignment?: ej.datavisualization.Chart.HorizontalTextAlignment|string; + + /**Margin of the text to its background shape. The size of the background shape increases based on the margin applied to its text. + */ + margin?: SeriesMarkerDataLabelMargin; + + /**Opacity of the data label. + * @Default {1} + */ + opacity?: number; + + /**Background shape of the data label. + * @Default {No shape is rendered by default, so its value is ‘none’. See Shape} + */ + shape?: ej.datavisualization.Chart.Shape|string; + + /**Name of a field in data source where datalabel text is displayed. + */ + textMappingName?: string; + + /**Specifies the position of the data label. This property can be used only for the series such as column, bar, stacked column, stacked bar, 100% stacked column, 100% stacked bar, candle and OHLC. + * @Default {top. See TextPosition} + */ + textPosition?: ej.datavisualization.Chart.TextPosition|string; + + /**Vertical alignment of the data label. + * @Default {'center'} + */ + verticalTextAlignment?: ej.datavisualization.Chart.VerticalTextAlignment|string; + + /**Controls the visibility of the data labels. + * @Default {false} + */ + visible?: boolean; + + /**Custom template to format the data label content. Use “point.x” and “point.y” as a placeholder text to display the corresponding data point’s x and y value. + */ + template?: string; + + /**Moves the label vertically by some offset. + * @Default {0} + */ + offset?: number; +} + +export interface SeriesMarkerSize { + + /**Height of the marker. + * @Default {6} + */ + height?: number; + + /**Width of the marker. + * @Default {6} + */ + width?: number; +} + +export interface SeriesMarker { + + /**Options for customizing the border of the marker shape. + */ + border?: SeriesMarkerBorder; + + /**Options for displaying and customizing data labels. + */ + dataLabel?: SeriesMarkerDataLabel; + + /**Color of the marker shape. + * @Default {null} + */ + fill?: string; + + /**The URL for the Image that is to be displayed as marker. In order to display image as marker, set series.marker.shape as ‘image’. + */ + imageUrl?: string; + + /**Opacity of the marker. + * @Default {1} + */ + opacity?: number; + + /**Specifies the shape of the marker. + * @Default {circle. See Shape} + */ + shape?: ej.datavisualization.Chart.Shape|string; + + /**Options for customizing the size of the marker shape. + */ + size?: SeriesMarkerSize; + + /**Controls the visibility of the marker shape. + * @Default {false} + */ + visible?: boolean; +} + +export interface SeriesEmptyPointSettingsStyleBorder { + + /**Border color of the empty point. + */ + color?: string; + + /**Border width of the empty point. + * @Default {1} + */ + width?: number; +} + +export interface SeriesEmptyPointSettingsStyle { + + /**Color of the empty point. + */ + color?: string; + + /**Options for customizing border of the empty point in the series. + */ + border?: SeriesEmptyPointSettingsStyleBorder; +} + +export interface SeriesEmptyPointSettings { + + /**Controls the visibility of the empty point. + * @Default {true} + */ + visible?: boolean; + + /**Specifies the mode of empty point. + * @Default {gap} + */ + displayMode?: ej.datavisualization.Chart.EmptyPointMode|string; + + /**Options for customizing the color and border of the empty point in the series. + */ + style?: SeriesEmptyPointSettingsStyle; +} + +export interface SeriesConnectorLine { + + /**Width of the connector line. + * @Default {1} + */ + width?: number; + + /**Color of the connector line. + * @Default {#565656} + */ + color?: string; + + /**DashArray of the connector line. + * @Default {null} + */ + dashArray?: string; + + /**DashArray of the connector line. + * @Default {1} + */ + opacity?: number; +} + +export interface SeriesErrorBarCap { + + /**Show/Hides the error bar cap. + * @Default {true} + */ + visible?: boolean; + + /**Width of the error bar cap. + * @Default {1} + */ + width?: number; + + /**Length of the error bar cap. + * @Default {1} + */ + length?: number; + + /**Color of the error bar cap. + * @Default {#000000} + */ + fill?: string; +} + +export interface SeriesErrorBar { + + /**Show/hides the error bar + * @Default {visible} + */ + visibility?: boolean; + + /**Specifies the type of error bar. + * @Default {FixedValue} + */ + type?: ej.datavisualization.Chart.ErrorBarType|string; + + /**Specifies the mode of error bar. + * @Default {vertical} + */ + mode?: ej.datavisualization.Chart.ErrorBarMode|string; + + /**Specifies the direction of error bar. + * @Default {both} + */ + direction?: ej.datavisualization.Chart.ErrorBarDirection|string; + + /**Value of vertical error bar. + * @Default {3} + */ + verticalErrorValue?: number; + + /**Value of horizontal error bar. + * @Default {1} + */ + horizontalErrorValue?: number; + + /**Value of positive horizontal error bar. + * @Default {1} + */ + horizontalPositiveErrorValue?: number; + + /**Value of negative horizontal error bar. + * @Default {1} + */ + horizontalNegativeErrorValue?: number; + + /**Value of positive vertical error bar. + * @Default {5} + */ + verticalPositiveErrorValue?: number; + + /**Value of negative vertical error bar. + * @Default {5} + */ + verticalNegativeErrorValue?: number; + + /**Fill color of the error bar. + * @Default {#000000} + */ + fill?: string; + + /**Width of the error bar. + * @Default {1} + */ + width?: number; + + /**Options for customizing the error bar cap. + */ + cap?: SeriesErrorBarCap; +} + +export interface SeriesPointsBorder { + + /**Border color of the point. + * @Default {null} + */ + color?: string; + + /**Border width of the point. + * @Default {null} + */ + width?: number; +} + +export interface SeriesPointsMarkerBorder { + + /**Border color of the marker shape. + * @Default {white} + */ + color?: string; + + /**Border width of the marker shape. + * @Default {3} + */ + width?: number; +} + +export interface SeriesPointsMarkerDataLabelBorder { + + /**Border color of the data label. + * @Default {null} + */ + color?: string; + + /**Border width of the data label. + * @Default {0.1} + */ + width?: number; +} + +export interface SeriesPointsMarkerDataLabelConnectorLine { + + /**Specifies when the connector has to be drawn as Bezier curve or straight line. This is applicable only for Pie and Doughnut chart types. + * @Default {line. See ConnectorLineType} + */ + type?: ej.datavisualization.Chart.ConnectorLineType|string; + + /**Width of the connector. + * @Default {0.5} + */ + width?: number; +} + +export interface SeriesPointsMarkerDataLabelFont { + + /**Font family of the data label. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style of the data label. + * @Default {normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the data label. + * @Default {regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of the text. + * @Default {1} + */ + opacity?: number; + + /**Font size of the data label. + * @Default {12px} + */ + size?: string; +} + +export interface SeriesPointsMarkerDataLabelMargin { + + /**Bottom margin of the text. + * @Default {5} + */ + bottom?: number; + + /**Left margin of the text. + * @Default {5} + */ + left?: number; + + /**Right margin of the text. + * @Default {5} + */ + right?: number; + + /**Top margin of the text. + * @Default {5} + */ + top?: number; +} + +export interface SeriesPointsMarkerDataLabel { + + /**Angle of the data label in degrees. Only the text gets rotated, whereas the background and border does not rotate. + * @Default {null} + */ + angle?: number; + + /**Options for customizing the border of the data label. + */ + border?: SeriesPointsMarkerDataLabelBorder; + + /**Options for displaying and customizing the line that connects point and data label. + */ + connectorLine?: SeriesPointsMarkerDataLabelConnectorLine; + + /**Background color of the data label. + * @Default {null} + */ + fill?: string; + + /**Options for customizing the data label font. + */ + font?: SeriesPointsMarkerDataLabelFont; + + /**Horizontal alignment of the data label. + * @Default {center} + */ + horizontalTextAlignment?: ej.datavisualization.Chart.HorizontalTextAlignment|string; + + /**Margin of the text to its background shape. The size of the background shape increases based on the margin applied to its text. + */ + margin?: SeriesPointsMarkerDataLabelMargin; + + /**Opacity of the data label. + * @Default {1} + */ + opacity?: number; + + /**Background shape of the data label. + * @Default {No shape is rendered by default, so its value is ‘none’. See Shape} + */ + shape?: ej.datavisualization.Chart.Shape|string; + + /**Specifies the position of the data label. This property can be used only for the series such as column, bar, stacked column, stacked bar, 100% stacked column, 100% stacked bar, candle and OHLC. + * @Default {top. See TextPosition} + */ + textPosition?: ej.datavisualization.Chart.TextPosition|string; + + /**Vertical alignment of the data label. + * @Default {'center'} + */ + verticalTextAlignment?: ej.datavisualization.Chart.VerticalTextAlignment|string; + + /**Controls the visibility of the data labels. + * @Default {false} + */ + visible?: boolean; + + /**Custom template to format the data label content. Use “point.x” and “point.y” as a placeholder text to display the corresponding data point’s x and y value. + */ + template?: string; + + /**Moves the label vertically by specified offset. + * @Default {0} + */ + offset?: number; +} + +export interface SeriesPointsMarkerSize { + + /**Height of the marker. + * @Default {6} + */ + height?: number; + + /**Width of the marker. + * @Default {6} + */ + width?: number; +} + +export interface SeriesPointsMarker { + + /**Options for customizing the border of the marker shape. + */ + border?: SeriesPointsMarkerBorder; + + /**Options for displaying and customizing data label. + */ + dataLabel?: SeriesPointsMarkerDataLabel; + + /**Color of the marker shape. + * @Default {null} + */ + fill?: string; + + /**The URL for the Image that is to be displayed as marker. In order to display image as marker, set series.marker.shape as ‘image’. + */ + imageUrl?: string; + + /**Opacity of the marker. + * @Default {1} + */ + opacity?: number; + + /**Specifies the shape of the marker. + * @Default {circle. See Shape} + */ + shape?: ej.datavisualization.Chart.Shape|string; + + /**Options for customizing the size of the marker shape. + */ + size?: SeriesPointsMarkerSize; + + /**Controls the visibility of the marker shape. + * @Default {false} + */ + visible?: boolean; +} + +export interface SeriesPoints { + + /**Options for customizing the border of a point. This is applicable only for column type series and accumulation type series. + */ + border?: SeriesPointsBorder; + + /**To show/hide the intermediate summary from the last intermediate point. + * @Default {false} + */ + showIntermediateSum?: boolean; + + /**To show/hide the total summary of the waterfall series. + * @Default {false} + */ + showTotalSum?: boolean; + + /**Close value of the point. Close value is applicable only for financial type series. + * @Default {null} + */ + close?: number; + + /**Size of a bubble in the bubble series. This is applicable only for the bubble series. + * @Default {null} + */ + size?: number; + + /**Background color of the point. This is applicable only for column type series and accumulation type series. + * @Default {null} + */ + fill?: string; + + /**High value of the point. High value is applicable only for financial type series, range area series and range column series. + * @Default {null} + */ + high?: number; + + /**Low value of the point. Low value is applicable only for financial type series, range area series and range column series. + * @Default {null} + */ + low?: number; + + /**Options for displaying and customizing marker for a data point. Marker contains shapes and/or data labels. + */ + marker?: SeriesPointsMarker; + + /**Open value of the point. This is applicable only for financial type series. + * @Default {null} + */ + open?: number; + + /**Datalabel text for the point. + * @Default {null} + */ + text?: string; + + /**X value of the point. + * @Default {null} + */ + x?: number; + + /**Y value of the point. + * @Default {null} + */ + y?: number; +} + +export interface SeriesTooltipBorder { + + /**Border Color of the tooltip. + * @Default {null} + */ + color?: string; + + /**Border Width of the tooltip. + * @Default {1} + */ + width?: number; +} + +export interface SeriesTooltip { + + /**Options for customizing the border of the tooltip. + */ + border?: SeriesTooltipBorder; + + /**Customize the corner radius of the tooltip rectangle. + * @Default {0} + */ + rx?: number; + + /**Customize the corner radius of the tooltip rectangle. + * @Default {0} + */ + ry?: number; + + /**Specifies the duration, the tooltip has to be displayed. + * @Default {500ms} + */ + duration?: string; + + /**Enables/disables the animation of the tooltip when moving from one point to another. + * @Default {true} + */ + enableAnimation?: boolean; + + /**Background color of the tooltip. + * @Default {null} + */ + fill?: string; + + /**Format of the tooltip content. + * @Default {#point.x# : #point.y#} + */ + format?: string; + + /**Opacity of the tooltip. + * @Default {0.95} + */ + opacity?: number; + + /**Custom template to format the tooltip content. Use “point.x” and “point.y” as a placeholder text to display the corresponding data point’s x and y value. + * @Default {null} + */ + template?: string; + + /**Controls the visibility of the tooltip. + * @Default {false} + */ + visible?: boolean; +} + +export interface SeriesTrendlines { + + /**Show/hides the trendline. + */ + visibility?: boolean; + + /**Specifies the type of trendline for the series. + * @Default {linear. See TrendlinesType} + */ + type?: string; + + /**Name for the trendlines that is to be displayed in legend text. + * @Default {Trendline} + */ + name?: string; + + /**Fill color of the trendlines. + * @Default {#0000FF} + */ + fill?: string; + + /**Width of the trendlines. + * @Default {1} + */ + width?: number; + + /**Opacity of the trendline. + * @Default {1} + */ + opacity?: number; + + /**Pattern of dashes and gaps used to stroke the trendline. + */ + dashArray?: string; + + /**Future trends of the current series. + * @Default {0} + */ + forwardForecast?: number; + + /**Past trends of the current series. + * @Default {0} + */ + backwardForecast?: number; + + /**Specifies the order of polynomial trendlines. + * @Default {0} + */ + polynomialOrder?: number; + + /**Specifies the moving average starting period value. + * @Default {2} + */ + period?: number; +} + +export interface SeriesHighlightSettingsBorder { + + /**Border color of the series/point on highlight. + */ + color?: string; + + /**Border width of the series/point on highlight. + * @Default {2} + */ + width?: string; +} + +export interface SeriesHighlightSettings { + + /**Enables/disables the ability to highlight series or data point interactively. + * @Default {false} + */ + enable?: boolean; + + /**Specifies whether series or data point has to be highlighted. + * @Default {series. See Mode} + */ + mode?: ej.datavisualization.Chart.Mode|string; + + /**Color of the series/point on highlight. + */ + color?: string; + + /**Opacity of the series/point on highlight. + * @Default {0.6} + */ + opacity?: number; + + /**Options for customizing the border of series on highlight. + */ + border?: SeriesHighlightSettingsBorder; + + /**Specifies the pattern for the series/point on highlight. + * @Default {none. See Pattern} + */ + pattern?: string; + + /**Custom pattern for the series on highlight. + */ + customPattern?: string; +} + +export interface SeriesSelectionSettingsBorder { + + /**Border color of the series/point on selection. + */ + color?: string; + + /**Border width of the series/point on selection. + * @Default {2} + */ + width?: string; +} + +export interface SeriesSelectionSettings { + + /**Enables/disables the ability to select a series/data point interactively. + * @Default {false} + */ + enable?: boolean; + + /**Specifies whether series or data point has to be selected. + * @Default {series. See Mode} + */ + mode?: ej.datavisualization.Chart.Mode|string; + + /**Specifies the type of selection. + * @Default {single} + */ + type?: ej.datavisualization.Chart.SelectionType|string; + + /**Color of the series/point on selection. + */ + color?: string; + + /**Opacity of the series/point on selection. + * @Default {0.6} + */ + opacity?: number; + + /**Options for customizing the border of series on selection. + */ + border?: SeriesSelectionSettingsBorder; + + /**Specifies the pattern for the series/point on selection. + * @Default {none. See Pattern} + */ + pattern?: string; + + /**Custom pattern for the series on selection. + */ + customPattern?: string; +} + +export interface Series { + + /**Color of the point, where the close is up in financial chart. + * @Default {null} + */ + bearFillColor?: string; + + /**Options for customizing the border of the series. + */ + border?: SeriesBorder; + + /**Color of the point, where the close is down in financial chart. + * @Default {null} + */ + bullFillColor?: string; + + /**Pattern of dashes and gaps used to stroke the line type series. + */ + dashArray?: string; + + /**Specifies the dataSource for the series. It can be an array of JSON objects or an instance of ej.DataManager. + * @Default {null} + */ + dataSource?: any; + + /**Controls the size of the hole in doughnut series. Value ranges from 0 to 1. + * @Default {0.4} + */ + doughnutCoefficient?: number; + + /**Controls the size of the doughnut series. Value ranges from 0 to 1. + * @Default {0.8} + */ + doughnutSize?: number; + + /**Type of series to be drawn in radar or polar series. + * @Default {line. See DrawType} + */ + drawType?: boolean; + + /**Enable/disable the animation of series. + * @Default {false} + */ + enableAnimation?: boolean; + + /**To avoid overlapping of data labels smartly. + * @Default {null} + */ + enableSmartLabels?: number; + + /**End angle of pie/doughnut series. For a complete circle, it has to be 360, by default. + * @Default {null} + */ + endAngle?: number; + + /**Explodes the pie/doughnut slices on mouse move. + * @Default {false} + */ + explode?: boolean; + + /**Explodes all the slice of pie/doughnut on render. + * @Default {null} + */ + explodeAll?: boolean; + + /**Index of the point to be exploded from pie/doughnut/pyramid/funnel. + * @Default {null} + */ + explodeIndex?: number; + + /**Specifies the distance of the slice from the center, when it is exploded. + * @Default {25} + */ + explodeOffset?: number; + + /**Fill color of the series. + * @Default {null} + */ + fill?: string; + + /**Options for customizing the series font. + */ + font?: SeriesFont; + + /**Specifies the height of the funnel in funnel series. Values can be in both pixel and percentage. + * @Default {32.7%} + */ + funnelHeight?: string; + + /**Specifies the width of the funnel in funnel series. Values can be in both pixel and percentage. + * @Default {11.6%} + */ + funnelWidth?: string; + + /**Gap between the slices of pyramid/funnel series. + * @Default {0} + */ + gapRatio?: number; + + /**Specifies whether to join start and end point of a line/area series used in polar/radar chart to form a closed path. + * @Default {true} + */ + isClosed?: boolean; + + /**Specifies whether to stack the column series in polar/radar charts. + * @Default {true} + */ + isStacking?: boolean; + + /**Renders the chart vertically. This is applicable only for cartesian type series. + * @Default {false} + */ + isTransposed?: boolean; + + /**Position of the data label in pie/doughnut/pyramid/funnel series. OutsideExtended position is not applicable for pyramid/funnel. + * @Default {inside. See LabelPosition} + */ + labelPosition?: ej.datavisualization.Chart.LabelPosition|string; + + /**Specifies the line cap of the series. + * @Default {Butt. See LineCap} + */ + lineCap?: ej.datavisualization.Chart.LineCap|string; + + /**Specifies the type of shape to be used where two lines meet. + * @Default {Round. See LineJoin} + */ + lineJoin?: ej.datavisualization.Chart.LineJoin|string; + + /**Options for displaying and customizing marker for individual point in a series. Marker contains shapes and/or data labels. + */ + marker?: SeriesMarker; + + /**Opacity of the series. + * @Default {1} + */ + opacity?: number; + + /**Name of a field in data source where fill color for all the data points is generated. + */ + palette?: string; + + /**Controls the size of pie series. Value ranges from 0 to 1. + * @Default {0.8} + */ + pieCoefficient?: number; + + /**Options for customizing the empty point in the series. + */ + emptyPointSettings?: SeriesEmptyPointSettings; + + /**Fill color for the positive column of the waterfall. + * @Default {null} + */ + positiveFill?: string; + + /**Options for customizing the waterfall connector line. + */ + connectorLine?: SeriesConnectorLine; + + /**Options to customize the error bar in series. + */ + errorBar?: SeriesErrorBar; + + /**Option to add data points; each point should have x and y property. Also, optionally, you can customize the points color, border, marker by using fill, border and marker options. + */ + points?: Array; + + /**Specifies the mode of the pyramid series. + * @Default {linear} + */ + pyramidMode?: ej.datavisualization.Chart.PyramidMode|string; + + /**Specifies ej.Query to select data from dataSource. This property is applicable only when the dataSource is ej.DataManager. + * @Default {null} + */ + query?: any; + + /**Start angle from where the pie/doughnut series renders. It starts from 0, by default. + * @Default {null} + */ + startAngle?: number; + + /**Options for customizing the tooltip of chart. + */ + tooltip?: SeriesTooltip; + + /**Specifies the type of the series to render in chart. + * @Default {column. see Type} + */ + type?: ej.datavisualization.Chart.Type|string; + + /**Controls the visibility of the series. + * @Default {visible} + */ + visibility?: string; + + /**Specifies the name of the x-axis that has to be associated with this series. Add an axis instance with this name to axes collection. + * @Default {null} + */ + xAxisName?: string; + + /**Name of the property in the datasource that contains x value for the series. + * @Default {null} + */ + xName?: string; + + /**Specifies the name of the y-axis that has to be associated with this series. Add an axis instance with this name to axes collection. + * @Default {null} + */ + yAxisName?: string; + + /**Name of the property in the datasource that contains y value for the series. + * @Default {null} + */ + yName?: string; + + /**Name of the property in the datasource that contains high value for the series. + * @Default {null} + */ + high?: string; + + /**Name of the property in the datasource that contains low value for the series. + * @Default {null} + */ + low?: string; + + /**Name of the property in the datasource that contains open value for the series. + * @Default {null} + */ + open?: string; + + /**Name of the property in the datasource that contains close value for the series. + * @Default {null} + */ + close?: string; + + /**Name of the property in the datasource that contains the size value for the bubble series. + * @Default {null} + */ + size?: string; + + /**Option to add trendlines to chart. + */ + trendlines?: Array; + + /**Options for customizing the appearance of the series or data point while highlighting. + */ + highlightSettings?: SeriesHighlightSettings; + + /**Options for customizing the appearance of the series/data point on selection. + */ + selectionSettings?: SeriesSelectionSettings; +} + +export interface Size { + + /**Height of the Chart. Height can be specified in either pixel or percentage. + * @Default {'450'} + */ + height?: string; + + /**Width of the Chart. Width can be specified in either pixel or percentage. + * @Default {'450'} + */ + width?: string; +} + +export interface TitleBorder { + + /**Width of the title border. + * @Default {1} + */ + width?: number; + + /**color of the title border. + * @Default {transparent} + */ + color?: string; + + /**opacity of the title border. + * @Default {0.8} + */ + opacity?: number; + + /**opacity of the title border. + * @Default {0.8} + */ + cornerRadius?: number; +} + +export interface TitleFont { + + /**Font family for Chart title. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style for Chart title. + * @Default {Normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight for Chart title. + * @Default {Regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of the Chart title. + * @Default {0.5} + */ + opacity?: number; + + /**Font size for Chart title. + * @Default {20px} + */ + size?: string; +} + +export interface TitleSubTitleFont { + + /**Font family of sub title. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style for sub title. + * @Default {Normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight for sub title. + * @Default {Regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of the sub title. + * @Default {1} + */ + opacity?: number; + + /**Font size for sub title. + * @Default {12px} + */ + size?: string; +} + +export interface TitleSubTitleBorder { + + /**Width of the subtitle border. + * @Default {1} + */ + width?: number; + + /**color of the subtitle border. + * @Default {transparent} + */ + color?: string; + + /**opacity of the subtitle border. + * @Default {0.8} + */ + opacity?: number; + + /**opacity of the subtitle border. + * @Default {0.8} + */ + cornerRadius?: number; +} + +export interface TitleSubTitle { + + /**Options for customizing the font of sub title. + */ + font?: TitleSubTitleFont; + + /**Background color for the chart subtitle. + * @Default {transparent} + */ + background?: string; + + /**Options to customize the border of the title. + */ + border?: TitleSubTitleBorder; + + /**Text to be displayed in sub title. + */ + text?: string; + + /**Alignment of sub title text. + * @Default {far. See TextAlignment} + */ + textAlignment?: ej.datavisualization.Chart.Alignment|string; +} + +export interface Title { + + /**Background color for the chart title. + * @Default {transparent} + */ + background?: string; + + /**Options to customize the border of the title. + */ + border?: TitleBorder; + + /**Options for customizing the font of Chart title. + */ + font?: TitleFont; + + /**Options to customize the sub title of Chart. + */ + subTitle?: TitleSubTitle; + + /**Text to be displayed in Chart title. + */ + text?: string; + + /**Alignment of the title text. + * @Default {Center. See TextAlignment} + */ + textAlignment?: ej.datavisualization.Chart.Alignment|string; +} + +export interface Zooming { + + /**Enables or disables zooming. + * @Default {false} + */ + enable?: boolean; + + /**Enable or disables the differed zooming. When it is enabled, chart is updated only on mouse up action while zooming and panning. + * @Default {false} + */ + enableDeferredZoom?: boolean; + + /**Enables/disables the ability to zoom the chart on moving the mouse wheel. + * @Default {false} + */ + enableMouseWheel?: boolean; + + /**Specifies whether to allow zooming the chart vertically or horizontally or in both ways. + * @Default {'x,y'} + */ + type?: string; + + /**To display user specified buttons in zooming toolbar. + * @Default {[zoomIn, zoomOut, zoom, pan, reset]} + */ + toolbarItems?: Array; +} +} +module Chart +{ +enum CoordinateUnit +{ +//string +None, +//string +Pixels, +//string +Points, +} +} +module Chart +{ +enum HorizontalAlignment +{ +//string +Left, +//string +Right, +//string +Middle, +} +} +module Chart +{ +enum Region +{ +//string +Chart, +//string +Series, +} +} +module Chart +{ +enum VerticalAlignment +{ +//string +Top, +//string +Bottom, +//string +Middle, +} +} +module Chart +{ +enum Unit +{ +//string +Percentage, +//string +Pixel, +} +} +module Chart +{ +enum DrawType +{ +//string +Line, +//string +Area, +//string +Column, +} +} +module Chart +{ +enum FontStyle +{ +//string +Normal, +//string +Italic, +} +} +module Chart +{ +enum FontWeight +{ +//string +Regular, +//string +Bold, +//string +Lighter, +} +} +module Chart +{ +enum LabelPosition +{ +//string +Inside, +//string +Outside, +//string +OutsideExtended, +} +} +module Chart +{ +enum LineCap +{ +//string +Butt, +//string +Round, +//string +Square, +} +} +module Chart +{ +enum LineJoin +{ +//string +Round, +//string +Bevel, +//string +Miter, +} +} +module Chart +{ +enum ConnectorLineType +{ +//string +Line, +//string +Bezier, +} +} +module Chart +{ +enum HorizontalTextAlignment +{ +//string +Center, +//string +Near, +//string +Far, +} +} +module Chart +{ +enum Shape +{ +//string +None, +//string +LeftArrow, +//string +RightArrow, +//string +Circle, +//string +Cross, +//string +HorizLine, +//string +VertLine, +//string +Diamond, +//string +Rectangle, +//string +Triangle, +//string +Hexagon, +//string +Pentagon, +//string +Star, +//string +Ellipse, +//string +Trapezoid, +//string +UpArrow, +//string +DownArrow, +//string +Image, +//string +SeriesType, +} +} +module Chart +{ +enum TextPosition +{ +//string +Top, +//string +Bottom, +//string +Middle, +} +} +module Chart +{ +enum VerticalTextAlignment +{ +//string +Center, +//string +Near, +//string +Far, +} +} +module Chart +{ +enum PyramidMode +{ +//string +Linear, +//string +Surface, +} +} +module Chart +{ +enum Type +{ +//string +Area, +//string +Line, +//string +Spline, +//string +Column, +//string +Scatter, +//string +Bubble, +//string +SplineArea, +//string +StepArea, +//string +StepLine, +//string +Pie, +//string +Hilo, +//string +HiloOpenClose, +//string +Candle, +//string +Bar, +//string +StackingArea, +//string +StackingArea100, +//string +RangeColumn, +//string +StackingColumn, +//string +StackingColumn100, +//string +StackingBar, +//string +StackingBar100, +//string +Pyramid, +//string +Funnel, +//string +Doughnut, +//string +Polar, +//string +Radar, +//string +RangeArea, +} +} +module Chart +{ +enum EmptyPointMode +{ +//string +Gap, +//string +Zero, +//string +Average, +} +} +module Chart +{ +enum ErrorBarType +{ +//string +FixedValue, +//string +Percentage, +//string +StandardDeviation, +//string +StandardError, +} +} +module Chart +{ +enum ErrorBarMode +{ +//string +Both, +//string +Vertical, +//string +Horizontal, +} +} +module Chart +{ +enum ErrorBarDirection +{ +//string +Both, +//string +Plus, +//string +Minus, +} +} +module Chart +{ +enum Mode +{ +//string +Series, +//string +Point, +//string +Cluster, +} +} +module Chart +{ +enum SelectionType +{ +//string +Single, +//string +Multiple, +} +} +module Chart +{ +enum CrosshairType +{ +//string +Crosshair, +//string +Trackball, +} +} +module Chart +{ +enum Alignment +{ +//string +Center, +//string +Near, +//string +Far, +} +} +module Chart +{ +enum Position +{ +//string +Left, +//string +Right, +//string +Top, +//string +Bottom, +} +} +module Chart +{ +enum TextOverflow +{ +//string +None, +//string +Trim, +//string +Wrap, +//string +WrapAndTrim, +} +} +module Chart +{ +enum EdgeLabelPlacement +{ +//string +None, +//string +Shift, +//string +Hide, +} +} +module Chart +{ +enum IntervalType +{ +//string +Days, +//string +Hours, +//string +Seconds, +//string +Milliseconds, +//string +Minutes, +//string +Months, +//string +Years, +} +} +module Chart +{ +enum LabelIntersectAction +{ +//string +None, +//string +Rotate90, +//string +Rotate45, +//string +Wrap, +//string +WrapByword, +//string +Trim, +//string +Hide, +//string +MultipleRows, +} +} +module Chart +{ +enum RangePadding +{ +//string +Additional, +//string +Normal, +//string +None, +//string +Round, +} +} +module Chart +{ +enum TextAlignment +{ +//string +MiddleTop, +//string +MiddleCenter, +//string +MiddleBottom, +} +} +module Chart +{ +enum ZIndex +{ +//string +Inside, +//string +Over, +} +} +module Chart +{ +enum TickLinesPosition +{ +//string +Inside, +//string +Outside, +} +} +module Chart +{ +enum ValueType +{ +//string +Double, +//string +Category, +//string +DateTime, +//string +Logarithmic, +} +} +module Chart +{ +enum Theme +{ +//string +Azure, +//string +FlatLight, +//string +FlatDark, +//string +Azuredark, +//string +Lime, +//string +LimeDark, +//string +Saffron, +//string +SaffronDark, +//string +GradientLight, +//string +GradientDark, +} +} + +class RangeNavigator extends ej.Widget { + static fn: RangeNavigator; + constructor(element: JQuery, options?: RangeNavigator.Model); + constructor(element: Element, options?: RangeNavigator.Model); + model:RangeNavigator.Model; + defaults:RangeNavigator.Model; + + /** destroy the range navigator widget + * @returns {void} + */ + _destroy (): void; +} +export module RangeNavigator{ + +export interface Model { + + /**Toggles the placement of slider exactly on the place it left or on the nearest interval. + * @Default {false} + */ + allowSnapping?: boolean; + + /**Specifies the data source for range navigator. + */ + dataSource?: any; + + /**Sets a value whether to make the range navigator responsive on resize. + * @Default {false} + */ + enableAutoResizing?: boolean; + + /**Toggles the redrawing of chart on moving the sliders. + * @Default {true} + */ + enableDeferredUpdate?: boolean; + + /**Toggles the direction of rendering the range navigator control. + * @Default {false} + */ + enableRTL?: boolean; + + /**Options for customizing the labels colors, font, style, size, horizontalAlignment and opacity. + */ + labelSettings?: LabelSettings; + + /**This property is to specify the localization of range navigator. + * @Default {en-US} + */ + locale?: string; + + /**Options for customizing the range navigator. + */ + navigatorStyleSettings?: NavigatorStyleSettings; + + /**Padding specifies the gap between the container and the range navigator. + * @Default {0} + */ + padding?: string; + + /**If the range is not given explicitly, range will be calculated automatically. + * @Default {none} + */ + rangePadding?: ej.datavisualization.RangeNavigator.RangePadding|string; + + /**Options for customizing the starting and ending ranges. + */ + rangeSettings?: RangeSettings; + + /**selectedData is for getting the data when the "rangeChanged" event trigger from client side. + */ + selectedData?: any; + + /**Options for customizing the start and end range values. + */ + selectedRangeSettings?: SelectedRangeSettings; + + /**Contains property to customize the hight and width of range navigator. + */ + sizeSettings?: SizeSettings; + + /**By specifying this property the user can change the theme of the range navigator. + * @Default {null} + */ + theme?: string; + + /**Options for customizing the tooltip in range navigator. + */ + tooltipSettings?: TooltipSettings; + + /**Options for configuring minor grid lines, major grid lines, axis line of axis. + */ + valueAxisSettings?: ValueAxisSettings; + + /**You can plot data of type date time or numeric. This property determines the type of data that this axis will handle. + * @Default {datetime} + */ + valueType?: ej.datavisualization.RangeNavigator.ValueType|string; + + /**Specifies the xName for dataSource. This is used to take the x values from dataSource + */ + xName?: any; + + /**Specifies the yName for dataSource. This is used to take the y values from dataSource + */ + yName?: any; + + /**Fires on load of range navigator.*/ + load? (e: LoadEventArgs): void; + + /**Fires after range navigator is loaded.*/ + loaded? (e: LoadedEventArgs): void; + + /**Fires on changing the range of range navigator.*/ + rangeChanged? (e: RangeChangedEventArgs): void; +} + +export interface LoadEventArgs { + + /**parameters from range navigator + */ + Data?: any; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the range navigator model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface LoadedEventArgs { + + /**parameters from range navigator + */ + Data?: any; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the range navigator model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface RangeChangedEventArgs { + + /**parameters from range navigator + */ + Data?: any; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the range navigator model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface LabelSettingsHigherLevelBorder { + + /**Specifies the border color of grid lines. + * @Default {transparent} + */ + color?: string; + + /**Specifies the border width of grid lines. + * @Default {0.5} + */ + width?: string; +} + +export interface LabelSettingsHigherLevelGridLineStyle { + + /**Specifies the color of grid lines in higher level. + * @Default {#B5B5B5} + */ + color?: string; + + /**Specifies the dashArray of grid lines in higher level. + * @Default {20 5 0} + */ + dashArray?: string; + + /**Specifies the width of grid lines in higher level. + * @Default {#B5B5B5} + */ + width?: string; +} + +export interface LabelSettingsHigherLevelStyleFont { + + /**Specifies the label font color. Labels render with the specified font color. + * @Default {black} + */ + color?: string; + + /**Specifies the label font family. Labels render with the specified font family. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Specifies the label font style. Labels render with the specified font style. + * @Default {Normal} + */ + fontStyle?: string; + + /**Specifies the label font weight. Labels render with the specified font weight. + * @Default {regular} + */ + fontWeight?: string; + + /**Specifies the label opacity. Labels render with the specified opacity. + * @Default {1} + */ + opacity?: number; + + /**Specifies the label font size. Labels render with the specified font size. + * @Default {12px} + */ + size?: string; +} + +export interface LabelSettingsHigherLevelStyle { + + /**Options for customizing the font properties. + */ + font?: LabelSettingsHigherLevelStyleFont; + + /**Specifies the horizontal text alignment of the text in label. + * @Default {middle} + */ + horizontalAlignment?: string; +} + +export interface LabelSettingsHigherLevel { + + /**Options for customizing the border of grid lines in higher level. + */ + border?: LabelSettingsHigherLevelBorder; + + /**Specifies the fill color of higher level labels. + * @Default {transparent} + */ + fill?: string; + + /**Options for customizing the grid line colors, width, dashArray, border. + */ + gridLineStyle?: LabelSettingsHigherLevelGridLineStyle; + + /**Specifies the intervalType for higher level labels. See IntervalType + * @Default {years} + */ + intervalType?: ej.datavisualization.RangeNavigator.IntervalType|string; + + /**Specifies the position of the labels to render either inside or outside of plot area + * @Default {outside} + */ + labelPlacement?: ej.datavisualization.RangeNavigator.LabelPlacement|string; + + /**Specifies the position of the labels in higher level + * @Default {top} + */ + position?: ej.datavisualization.RangeNavigator.Position|string; + + /**Options for customizing the style of higher level labels. + */ + style?: LabelSettingsHigherLevelStyle; + + /**Toggles the visibility of higher level labels. + * @Default {true} + */ + visible?: boolean; +} + +export interface LabelSettingsLowerLevelBorder { + + /**Specifies the border color of grid lines. + * @Default {transparent} + */ + color?: string; + + /**Specifies the border width of grid lines. + * @Default {0.5} + */ + width?: string; +} + +export interface LabelSettingsLowerLevelGridLineStyle { + + /**Specifies the color of grid lines in lower level. + * @Default {#B5B5B5} + */ + color?: string; + + /**Specifies the dashArray of gridLines in lowerLevel. + * @Default {20 5 0} + */ + dashArray?: string; + + /**Specifies the width of grid lines in lower level. + * @Default {#B5B5B5} + */ + width?: string; +} + +export interface LabelSettingsLowerLevelStyleFont { + + /**Specifies the color of labels. Label text render in this specified color. + * @Default {black} + */ + color?: string; + + /**Specifies the font family of labels. Label text render in this specified font family. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Specifies the font style of labels. Label text render in this specified font style. + * @Default {Normal} + */ + fontStyle?: string; + + /**Specifies the font weight of labels. Label text render in this specified font weight. + * @Default {regular} + */ + fontWeight?: string; + + /**Specifies the opacity of labels. Label text render in this specified opacity. + * @Default {12px} + */ + opacity?: string; + + /**Specifies the size of labels. Label text render in this specified size. + * @Default {12px} + */ + size?: string; +} + +export interface LabelSettingsLowerLevelStyle { + + /**Options for customizing the font of labels. + */ + font?: LabelSettingsLowerLevelStyleFont; + + /**Specifies the horizontal text alignment of the text in label. + * @Default {middle} + */ + horizontalAlignment?: string; +} + +export interface LabelSettingsLowerLevel { + + /**Options for customizing the border of grid lines in lower level. + */ + border?: LabelSettingsLowerLevelBorder; + + /**Specifies the fill color of labels in lower level. + * @Default {transparent} + */ + fill?: string; + + /**Options for customizing the grid lines in lower level. + */ + gridLineStyle?: LabelSettingsLowerLevelGridLineStyle; + + /**Specifies the intervalType of the labels in lower level.See IntervalType + * @Default {years} + */ + intervalType?: ej.datavisualization.RangeNavigator.IntervalType|string; + + /**Specifies the position of the labels to render either inside or outside of plot area. See LabelPlacement + * @Default {outside} + */ + labelPlacement?: ej.datavisualization.RangeNavigator.LabelPlacement|string; + + /**Specifies the position of the labels in lower level.See Position + * @Default {bottom} + */ + position?: ej.datavisualization.RangeNavigator.Position|string; + + /**Options for customizing the style of labels. + */ + style?: LabelSettingsLowerLevelStyle; + + /**Toggles the visibility of labels in lower level. + * @Default {true} + */ + visible?: boolean; +} + +export interface LabelSettingsStyleFont { + + /**Specifies the label color. This color is applied to the labels in range navigator. + * @Default {#FFFFFF} + */ + color?: string; + + /**Specifies the label font family. Labels render with the specified font family. + * @Default {Segoe UI} + */ + family?: string; + + /**Specifies the label font opacity. Labels render with the specified font opacity. + * @Default {1} + */ + opacity?: number; + + /**Specifies the label font size. Labels render with the specified font size. + * @Default {1px} + */ + size?: string; + + /**Specifies the label font style. Labels render with the specified font style.. + * @Default {Normal} + */ + style?: ej.datavisualization.RangeNavigator.FontStyle|string; + + /**Specifies the lable font weight + * @Default {regular} + */ + weight?: ej.datavisualization.RangeNavigator.FontWeight|string; +} + +export interface LabelSettingsStyle { + + /**Options for customizing the font of labels in range navigator. + */ + font?: LabelSettingsStyleFont; + + /**Specifies the horizontalAlignment of the label in RangeNavigator + * @Default {middle} + */ + horizontalAlignment?: ej.datavisualization.RangeNavigator.HorizontalAlignment|string; +} + +export interface LabelSettings { + + /**Options for customizing the higher level labels in range navigator. + */ + higherLevel?: LabelSettingsHigherLevel; + + /**Options for customizing the labels in lower level. + */ + lowerLevel?: LabelSettingsLowerLevel; + + /**Options for customizing the style of labels in range navigator. + */ + style?: LabelSettingsStyle; +} + +export interface NavigatorStyleSettingsBorder { + + /**Specifies the border color of range navigator. + * @Default {transparent} + */ + color?: string; + + /**Specifies the dash array of range navigator. + * @Default {null} + */ + dashArray?: string; + + /**Specifies the border width of range navigator. + * @Default {0.5} + */ + width?: number; +} + +export interface NavigatorStyleSettingsMajorGridLineStyle { + + /**Specifies the color of major grid lines in range navigator. + * @Default {#B5B5B5} + */ + color?: string; + + /**Toggles the visibility of major grid lines. + * @Default {true} + */ + visible?: boolean; +} + +export interface NavigatorStyleSettingsMinorGridLineStyle { + + /**Specifies the color of minor grid lines in range navigator. + * @Default {#B5B5B5} + */ + color?: string; + + /**Toggles the visibility of minor grid lines. + * @Default {true} + */ + visible?: boolean; +} + +export interface NavigatorStyleSettings { + + /**Specifies the background color of range navigator. + * @Default {#dddddd} + */ + background?: string; + + /**Options for customizing the border color and width of range navigator. + */ + border?: NavigatorStyleSettingsBorder; + + /**Specifies the left side thumb template in range navigator we can give either div id or html string + * @Default {null} + */ + leftThumbTemplate?: string; + + /**Options for customizing the major grid lines. + */ + majorGridLineStyle?: NavigatorStyleSettingsMajorGridLineStyle; + + /**Options for customizing the minor grid lines. + */ + minorGridLineStyle?: NavigatorStyleSettingsMinorGridLineStyle; + + /**Specifies the opacity of RangeNavigator. + * @Default {1} + */ + opacity?: number; + + /**Specifies the right side thumb template in range navigator we can give either div id or html string + * @Default {null} + */ + rightThumbTemplate?: string; + + /**Specifies the color of the selected region in range navigator. + * @Default {#EFEFEF} + */ + selectedRegionColor?: string; + + /**Specifies the opacity of Selected Region. + * @Default {0} + */ + selectedRegionOpacity?: number; + + /**Specifies the color of the thumb in range navigator. + * @Default {#2382C3} + */ + thumbColor?: string; + + /**Specifies the radius of the thumb in range navigator. + * @Default {10} + */ + thumbRadius?: number; + + /**Specifies the stroke color of the thumb in range navigator. + * @Default {#303030} + */ + thumbStroke?: string; + + /**Specifies the color of the unselected region in range navigator. + * @Default {#5EABDE} + */ + unselectedRegionColor?: string; + + /**Specifies the opacity of Unselected Region. + * @Default {0.3} + */ + unselectedRegionOpacity?: number; +} + +export interface RangeSettings { + + /**Specifies the ending range of range navigator. + * @Default {null} + */ + end?: string; + + /**Specifies the starting range of range navigator. + * @Default {null} + */ + start?: string; +} + +export interface SelectedRangeSettings { + + /**Specifies the ending range of range navigator. + * @Default {null} + */ + end?: string; + + /**Specifies the starting range of range navigator. + * @Default {null} + */ + start?: string; +} + +export interface SizeSettings { + + /**Specifies height of the range navigator. + * @Default {null} + */ + height?: string; + + /**Specifies width of the range navigator. + * @Default {null} + */ + width?: string; +} + +export interface TooltipSettingsFont { + + /**Specifies the color of text in tooltip. Tooltip text render in the specified color. + * @Default {#FFFFFF} + */ + color?: string; + + /**Specifies the font family of text in tooltip. Tooltip text render in the specified font family. + * @Default {Segoe UI} + */ + family?: string; + + /**Specifies the font style of text in tooltip. Tooltip text render in the specified font style. + * @Default {ej.datavisualization.RangeNavigator.fontStyle.Normal} + */ + fontStyle?: string; + + /**Specifies the opacity of text in tooltip. Tooltip text render in the specified opacity. + * @Default {1} + */ + opacity?: number; + + /**Specifies the size of text in tooltip. Tooltip text render in the specified size. + * @Default {10px} + */ + size?: string; + + /**Specifies the weight of text in tooltip. Tooltip text render in the specified weight. + * @Default {ej.datavisualization.RangeNavigator.weight.Regular} + */ + weight?: string; +} + +export interface TooltipSettings { + + /**Specifies the background color of tooltip. + * @Default {#303030} + */ + backgroundColor?: string; + + /**Options for customizing the font in tooltip. + */ + font?: TooltipSettingsFont; + + /**Specifies the format of text to be displayed in tooltip. + * @Default {MM/dd/yyyy} + */ + labelFormat?: string; + + /**Specifies the mode of displaying the tooltip. Neither to display the tooltip always nor on demand. + * @Default {null} + */ + tooltipDisplayMode?: string; + + /**Toggles the visibility of tooltip. + * @Default {true} + */ + visible?: boolean; +} + +export interface ValueAxisSettingsAxisLine { + + /**Toggles the visibility of axis line. + * @Default {none} + */ + visible?: string; +} + +export interface ValueAxisSettingsFont { + + /**Text in axis render with the specified size. + * @Default {0px} + */ + size?: string; +} + +export interface ValueAxisSettingsMajorGridLines { + + /**Toggles the visibility of major grid lines. + * @Default {false} + */ + visible?: boolean; +} + +export interface ValueAxisSettingsMajorTickLines { + + /**Specifies the size of the majorTickLines in range navigator + * @Default {0} + */ + size?: number; + + /**Toggles the visibility of major tick lines. + * @Default {true} + */ + visible?: boolean; + + /**Specifies width of the major tick lines. + * @Default {0} + */ + width?: number; +} + +export interface ValueAxisSettings { + + /**Options for customizing the axis line. + */ + axisLine?: ValueAxisSettingsAxisLine; + + /**Options for customizing the font of the axis. + */ + font?: ValueAxisSettingsFont; + + /**Options for customizing the major grid lines. + */ + majorGridLines?: ValueAxisSettingsMajorGridLines; + + /**Options for customizing the major tick lines in axis. + */ + majorTickLines?: ValueAxisSettingsMajorTickLines; + + /**If the range is not given explicitly, range will be calculated automatically. You can customize the automatic range calculation using rangePadding. + * @Default {none} + */ + rangePadding?: string; + + /**Toggles the visibility of axis in range navigator. + * @Default {false} + */ + visible?: boolean; +} +} +module RangeNavigator +{ +enum IntervalType +{ +//string +Years, +//string +Quarters, +//string +Months, +//string +Weeks, +//string +Days, +//string +Hours, +} +} +module RangeNavigator +{ +enum LabelPlacement +{ +//string +Inside, +//string +Outside, +} +} +module RangeNavigator +{ +enum Position +{ +//string +Top, +//string +Bottom, +} +} +module RangeNavigator +{ +enum FontStyle +{ +//string +Normal, +//string +Bold, +//string +Italic, +} +} +module RangeNavigator +{ +enum FontWeight +{ +//string +Regular, +//string +Lighter, +} +} +module RangeNavigator +{ +enum HorizontalAlignment +{ +//string +Middle, +//string +Left, +//string +Right, +} +} +module RangeNavigator +{ +enum RangePadding +{ +//string +Additional, +//string +Normal, +//string +None, +//string +Round, +} +} +module RangeNavigator +{ +enum ValueType +{ +//string +Numeric, +//string +DateTime, +} +} + +class BulletGraph extends ej.Widget { + static fn: BulletGraph; + constructor(element: JQuery, options?: BulletGraph.Model); + constructor(element: Element, options?: BulletGraph.Model); + model:BulletGraph.Model; + defaults:BulletGraph.Model; + + /** To destroy the bullet graph + * @returns {void} + */ + destroy (): void; + + /** To redraw the bulet graph + * @returns {void} + */ + redraw(): void; + + /** To set the value for comparative measure in bullet graph. + * @returns {void} + */ + setComparativeMeasureSymbol(): void; + + /** To set the value for feature measure bar. + * @returns {void} + */ + setFeatureMeasureBarValue(): void; +} +export module BulletGraph{ + +export interface Model { + + /**Toggles the visibility of the range stroke color of the labels. + * @Default {false} + */ + applyRangeStrokeToLabels?: boolean; + + /**Toggles the visibility of the range stroke color of the ticks. + * @Default {false} + */ + applyRangeStrokeToTicks?: boolean; + + /**Contains property to customize the caption in bullet graph. + */ + captionSettings?: CaptionSettings; + + /**Comparative measure bar in bullet graph render till the specified value. + * @Default {0} + */ + comparativeMeasureValue?: number; + + /**Toggles the animation of bullet graph. + * @Default {true} + */ + enableAnimation?: boolean; + + /**Sets a value whether to make the bullet graph responsive on resize. + * @Default {true} + */ + enableResizing?: boolean; + + /**Specifies the direction of flow in bullet graph. Neither it may be backward nor forward. + * @Default {forward} + */ + flowDirection?: ej.datavisualization.BulletGraph.FlowDirection|string; + + /**Specifies the height of the bullet graph. + * @Default {90} + */ + height?: number; + + /**Bullet graph will render in the specified orientation. + * @Default {horizontal} + */ + orientation?: ej.datavisualization.BulletGraph.Orientation|string; + + /**Contains property to customize the qualitative ranges. + */ + qualitativeRanges?: Array; + + /**Size of the qualitative range depends up on the specified value. + * @Default {32} + */ + qualitativeRangeSize?: number; + + /**Length of the quantitative range depends up on the specified value. + * @Default {475} + */ + quantitativeScaleLength?: number; + + /**Contains all the properties to customize quantitative scale. + */ + quantitativeScaleSettings?: QuantitativeScaleSettings; + + /**By specifying this property the user can change the theme of the bullet graph. + * @Default {flatlight} + */ + theme?: string; + + /**Contains all the properties to customize tooltip. + */ + tooltipSettings?: TooltipSettings; + + /**Feature measure bar in bullet graph render till the specified value. + * @Default {0} + */ + value?: number; + + /**Specifies the width of the bullet graph. + * @Default {595} + */ + width?: number; + + /**Fires on rendering the caption of bullet graph.*/ + drawCaption? (e: DrawCaptionEventArgs): void; + + /**Fires on rendering the category.*/ + drawCategory? (e: DrawCategoryEventArgs): void; + + /**Fires on rendering the comparative measure symbol.*/ + drawComparativeMeasureSymbol? (e: DrawComparativeMeasureSymbolEventArgs): void; + + /**Fires on rednering the feature measure bar.*/ + drawFeatureMeasureBar? (e: DrawFeatureMeasureBarEventArgs): void; + + /**Fires on rendering the indicator of bullet graph.*/ + drawIndicator? (e: DrawIndicatorEventArgs): void; + + /**Fires on rendering the labels.*/ + drawLabels? (e: DrawLabelsEventArgs): void; + + /**Fires on rendering the qualitative ranges.*/ + drawQualitativeRanges? (e: DrawQualitativeRangesEventArgs): void; + + /**Fires on loading bullet graph.*/ + load? (e: LoadEventArgs): void; +} + +export interface DrawCaptionEventArgs { + + /**returns the object of the bullet graph. + */ + Object?: any; + + /**returns the options of the scale element. + */ + scaleElement?: HTMLElement; + + /**returns the current captionSettings element. + */ + captionElement?: HTMLElement; + + /**returns the type of the captionSettings. + */ + captionType?: string; +} + +export interface DrawCategoryEventArgs { + + /**returns the object of the bullet graph. + */ + Object?: any; + + /**returns the options of the scale element. + */ + scaleElement?: HTMLElement; + + /**returns the options of category element. + */ + categoryElement?: HTMLElement; + + /**returns the text value of the category that is drawn. + */ + Value?: string; +} + +export interface DrawComparativeMeasureSymbolEventArgs { + + /**returns the object of the bullet graph. + */ + Object?: any; + + /**returns the options of the scale element. + */ + scaleElement?: HTMLElement; + + /**returns the options of comparative measure element. + */ + targetElement?: HTMLElement; + + /**returns the value of the comparative measure symbol. + */ + Value?: number; +} + +export interface DrawFeatureMeasureBarEventArgs { + + /**returns the object of the bullet graph. + */ + Object?: any; + + /**returns the options of the scale element. + */ + scaleElement?: HTMLElement; + + /**returns the options of feature measure element. + */ + currentElement?: HTMLElement; + + /**returns the value of the feature measure bar. + */ + Value?: number; +} + +export interface DrawIndicatorEventArgs { + + /**returns an object to customize bullet graph indicator text and symbol before rendering it. + */ + indicatorSettings?: any; + + /**returns the object of bullet graph. + */ + model?: any; + + /**returns the type of event. + */ + type?: string; + + /**for cancelling the event. + */ + cancel?: boolean; +} + +export interface DrawLabelsEventArgs { + + /**returns the object of the bullet graph. + */ + Object?: any; + + /**returns the options of the scale element. + */ + scaleElement?: HTMLElement; + + /**returns the current label element. + */ + tickElement?: HTMLElement; + + /**returns the label type. + */ + labelType?: string; +} + +export interface DrawQualitativeRangesEventArgs { + + /**returns the object of the bullet graph. + */ + Object?: any; + + /**returns the index of current range. + */ + rangeIndex?: number; + + /**returns the settings for current range. + */ + rangeOptions?: any; + + /**returns the end value of current range. + */ + rangeEndValue?: number; +} + +export interface LoadEventArgs { +} + +export interface CaptionSettingsFont { + + /**Specifies the color of the text in caption. + * @Default {null} + */ + color?: string; + + /**Specifies the fontFamily of caption. Caption text render with this fontFamily + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Specifies the fontStyle of caption + * @Default {Normal} + */ + fontStyle?: ej.datavisualization.BulletGraph.FontStyle|string; + + /**Specifies the fontWeight of caption + * @Default {regular} + */ + fontWeight?: ej.datavisualization.BulletGraph.FontWeight|string; + + /**Specifies the opacity of caption. Caption text render with this opacity. + * @Default {1} + */ + opacity?: number; + + /**Specifies the size of caption. Caption text render with this size + * @Default {12px} + */ + size?: string; +} + +export interface CaptionSettingsIndicatorFont { + + /**Specifies the color of the indicator's text. + * @Default {null} + */ + color?: string; + + /**Specifies the fontFamily of indicator. Indicator text render with this fontFamily. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Specifies the fontStyle of indicator. Indicator text render with this fontStyle. See FontStyle + * @Default {Normal} + */ + fontStyle?: ej.datavisualization.BulletGraph.FontStyle|string; + + /**Specifies the fontWeight of indicator. Indicator text render with this fontWeight. See FontWeight + * @Default {regular} + */ + fontWeight?: ej.datavisualization.BulletGraph.FontWeight|string; + + /**Specifies the opacity of indicator text. Indicator text render with this Opacity. + * @Default {1} + */ + opacity?: number; + + /**Specifies the size of indicator. Indicator text render with this size. + * @Default {12px} + */ + size?: string; +} + +export interface CaptionSettingsIndicatorLocation { + + /**Specifies the horizontal position of the indicator. + * @Default {10} + */ + x?: number; + + /**Specifies the vertical position of the indicator. + * @Default {60} + */ + y?: number; +} + +export interface CaptionSettingsIndicatorSymbolBorder { + + /**Specifies the border color of indicator symbol. + * @Default {null} + */ + color?: string; + + /**Specifies the border width of indicator symbol. + * @Default {1} + */ + width?: number; +} + +export interface CaptionSettingsIndicatorSymbolSize { + + /**Specifies the height of indicator symbol. + * @Default {10} + */ + height?: number; + + /**Specifies the width of indicator symbol. + * @Default {10} + */ + width?: number; +} + +export interface CaptionSettingsIndicatorSymbol { + + /**Contains property to customize the border of indicator symbol. + */ + border?: CaptionSettingsIndicatorSymbolBorder; + + /**Specifies the color of indicator symbol. + * @Default {null} + */ + color?: string; + + /**Specifies the url of image that represents indicator symbol. + */ + imageURL?: string; + + /**Specifies the opacity of indicator symbol. + * @Default {1} + */ + opacity?: number; + + /**Specifies the shape of indicator symbol. + */ + shape?: string; + + /**Contains property to customize the size of indicator symbol. + */ + size?: CaptionSettingsIndicatorSymbolSize; +} + +export interface CaptionSettingsIndicator { + + /**Contains property to customize the font of indicator. + */ + font?: CaptionSettingsIndicatorFont; + + /**Contains property to customize the location of indicator. + */ + location?: CaptionSettingsIndicatorLocation; + + /**Specifies the padding to be applied when text position is used. + * @Default {2} + */ + padding?: number; + + /**Contains property to customize the symbol of indicator. + */ + symbol?: CaptionSettingsIndicatorSymbol; + + /**Specifies the text to be displayed as indicator text. By default difference between current value and target will be displayed + */ + text?: string; + + /**Specifies the alignement of indicator with respect to scale based on text position + * @Default {'Near'} + */ + textAlignment?: ej.datavisualization.BulletGraph.TextAlignment|string; + + /**Specifies where indicator text should be anchored when indicator overlaps with other caption group text. Text will be anchored when overlapping caption group text are at same position. Anchoring is not applicable for float position. + * @Default {'start'} + */ + textAnchor?: ej.datavisualization.BulletGraph.TextAnchor|string; + + /**indicator text render in the specified angle. + * @Default {0} + */ + textAngle?: number; + + /**Specifies where indicator should be placed + * @Default {'float'} + */ + textPosition?: ej.datavisualization.BulletGraph.TextPosition|string; + + /**Specifies the space between indicator symbol and text. + * @Default {3} + */ + textSpacing?: number; + + /**Specifies whether indicator will be visible or not. + * @Default {false} + */ + visibile?: boolean; +} + +export interface CaptionSettingsLocation { + + /**Specifies the position in horizontal direction + * @Default {17} + */ + x?: number; + + /**Specifies the position in horizontal direction + * @Default {30} + */ + y?: number; +} + +export interface CaptionSettingsSubTitleFont { + + /**Specifies the color of the subtitle's text. + * @Default {null} + */ + color?: string; + + /**Specifies the fontFamily of subtitle. Subtitle text render with this fontFamily. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Specifies the fontStyle of subtitle. Subtitle text render with this fontStyle. See FontStyle + * @Default {Normal} + */ + fontStyle?: ej.datavisualization.BulletGraph.FontStyle|string; + + /**Specifies the fontWeight of subtitle. Subtitle text render with this fontWeight. See FontWeight + * @Default {regular} + */ + fontWeight?: ej.datavisualization.BulletGraph.FontWeight|string; + + /**Specifies the opacity of subtitle. Subtitle text render with this opacity. + * @Default {1} + */ + opacity?: number; + + /**Specifies the size of subtitle. Subtitle text render with this size. + * @Default {12px} + */ + size?: string; +} + +export interface CaptionSettingsSubTitleLocation { + + /**Specifies the horizontal position of the subtitle. + * @Default {10} + */ + x?: number; + + /**Specifies the vertical position of the subtitle. + * @Default {45} + */ + y?: number; +} + +export interface CaptionSettingsSubTitle { + + /**Contains property to customize the font of subtitle. + */ + font?: CaptionSettingsSubTitleFont; + + /**Contains property to customize the location of subtitle. + */ + location?: CaptionSettingsSubTitleLocation; + + /**Specifies the padding to be applied when text position is used. + * @Default {5} + */ + padding?: number; + + /**Specifies the text to be displayed as subtitle. + */ + text?: string; + + /**Specifies the alignment of sub title text with respect to scale. Alignment will not be applied in float position. + * @Default {'Near'} + */ + textAlignment?: ej.datavisualization.BulletGraph.TextAlignment|string; + + /**Specifies where subtitle text should be anchored when sub title text overlaps with other caption group text. Text will be anchored when overlapping caption group text are at same position. Anchoring is not applicable for float position. + * @Default {'start'} + */ + textAnchor?: ej.datavisualization.BulletGraph.TextAnchor|string; + + /**Subtitle render in the specified angle. + * @Default {0} + */ + textAngle?: number; + + /**Specifies where sub title text should be placed. + * @Default {'float'} + */ + textPosition?: ej.datavisualization.BulletGraph.TextPosition|string; +} + +export interface CaptionSettings { + + /**Specifies whether trim the labels will be true or false. + * @Default {true} + */ + enableTrim?: boolean; + + /**Contains property to customize the font of caption. + */ + font?: CaptionSettingsFont; + + /**Contains property to customize the indicator. + */ + indicator?: CaptionSettingsIndicator; + + /**Contains property to customize the location. + */ + location?: CaptionSettingsLocation; + + /**Specifies the padding to be applied when text position is used. + * @Default {5} + */ + padding?: number; + + /**Contains property to customize the subtitle. + */ + subTitle?: CaptionSettingsSubTitle; + + /**Specifies the text to be displayed on bullet graph. + */ + text?: string; + + /**Specifies the alignment of caption text with respect to scale. This property will not be applied when text position is float. + * @Default {'Near'} + */ + textAlignment?: ej.datavisualization.BulletGraph.TextAlignment|string; + + /**Specifies caption text anchoring when caption text overlaps with other caption group text. Text will be anchored when overlapping caption group text are at same position. Anchoring is not applicable for float position. + * @Default {'start'} + */ + textAnchor?: ej.datavisualization.BulletGraph.TextAnchor|string; + + /**Specifies the angel in which the caption is rendered. + * @Default {0} + */ + textAngle?: number; + + /**Specifies how caption text should be placed. + * @Default {'float'} + */ + textPosition?: ej.datavisualization.BulletGraph.TextPosition|string; +} + +export interface QualitativeRanges { + + /**Specifies the ending range to which the qualitative ranges will render. + * @Default {3} + */ + rangeEnd?: number; + + /**Specifies the opacity for the qualitative ranges. + * @Default {1} + */ + rangeOpacity?: number; + + /**Specifies the stroke for the qualitative ranges. + * @Default {null} + */ + rangeStroke?: string; +} + +export interface QuantitativeScaleSettingsComparativeMeasureSettings { + + /**Specifies the stroke of the comparative measure. + * @Default {null} + */ + stroke?: number; + + /**Specifies the width of the comparative measure. + * @Default {5} + */ + width?: number; +} + +export interface QuantitativeScaleSettingsFeaturedMeasureSettings { + + /**Specifies the Stroke of the featured measure in bullet graph. + * @Default {null} + */ + stroke?: number; + + /**Specifies the width of the featured measure in bullet graph. + * @Default {2} + */ + width?: number; +} + +export interface QuantitativeScaleSettingsFeatureMeasures { + + /**Specifies the category of feature measure. + * @Default {null} + */ + category?: string; + + /**Comparative measure render till the specified value. + * @Default {null} + */ + comparativeMeasureValue?: number; + + /**Feature measure render till the specified value. + * @Default {null} + */ + value?: number; +} + +export interface QuantitativeScaleSettingsFields { + + /**Specifies the category of the bullet graph. + * @Default {null} + */ + category?: string; + + /**Comparative measure render based on the values in the specified field. + * @Default {null} + */ + comparativeMeasure?: string; + + /**Specifies the dataSource for the bullet graph. + * @Default {null} + */ + dataSource?: any; + + /**Feature measure render based on the values in the specified field. + * @Default {null} + */ + featureMeasures?: string; + + /**Specifies the query for fetching the values form data source to render the bullet graph. + * @Default {null} + */ + query?: string; + + /**Specifies the name of the table. + * @Default {null} + */ + tableName?: string; +} + +export interface QuantitativeScaleSettingsLabelSettingsFont { + + /**Specifies the fontFamily of labels in bullet graph. Labels render with this fontFamily. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Specifies the fontStyle of labels in bullet graph. Labels render with this fontStyle. See FontStyle + * @Default {Normal} + */ + fontStyle?: ej.datavisualization.BulletGraph.FontStyle|string; + + /**Specifies the fontWeight of labels in bullet graph. Labels render with this fontWeight. See FontWeight + * @Default {regular} + */ + fontWeight?: ej.datavisualization.BulletGraph.FontWeight|string; + + /**Specifies the opacity of labels in bullet graph. Labels render with this opacity + * @Default {1} + */ + opacity?: number; +} + +export interface QuantitativeScaleSettingsLabelSettings { + + /**Contains property to customize the font of the labels in bullet graph. + */ + font?: QuantitativeScaleSettingsLabelSettingsFont; + + /**Specifies the placement of labels in bullet graph scale. + * @Default {outside} + */ + labelPlacement?: ej.datavisualization.BulletGraph.LabelPlacement|string; + + /**Specifies the prefix to be added with labels in bullet graph. + * @Default {Empty string} + */ + labelPrefix?: string; + + /**Specifies the suffix to be added after labels in bullet graph. + * @Default {Empty string} + */ + labelSuffix?: string; + + /**Specifies the horizontal/vertical padding of labels. + * @Default {15} + */ + offset?: number; + + /**Specifies the position of the labels to render either above or below the graph. See Position + * @Default {below} + */ + position?: ej.datavisualization.BulletGraph.LabelPosition|string; + + /**Specifies the Size of the labels. + * @Default {12} + */ + size?: number; + + /**Specifies the stroke color of the labels in bullet graph. + * @Default {null} + */ + stroke?: string; +} + +export interface QuantitativeScaleSettingsLocation { + + /**This property specifies the x position for rendering quantitative scale. + * @Default {10} + */ + x?: number; + + /**This property specifies the y position for rendering quantitative scale. + * @Default {10} + */ + y?: number; +} + +export interface QuantitativeScaleSettingsMajorTickSettings { + + /**Specifies the size of the major ticks. + * @Default {13} + */ + size?: number; + + /**Specifies the stroke color of the major tick lines. + * @Default {null} + */ + stroke?: string; + + /**Specifies the width of the major tick lines. + * @Default {2} + */ + width?: number; +} + +export interface QuantitativeScaleSettingsMinorTickSettings { + + /**Specifies the size of minor ticks. + * @Default {7} + */ + size?: number; + + /**Specifies the stroke color of minor ticks in bullet graph. + * @Default {null} + */ + stroke?: string; + + /**Specifies the width of the minor ticks in bullet graph. + * @Default {2} + */ + width?: number; +} + +export interface QuantitativeScaleSettings { + + /**Contains property to customize the comparative measure. + */ + comparativeMeasureSettings?: QuantitativeScaleSettingsComparativeMeasureSettings; + + /**Contains property to customize the featured measure. + */ + featuredMeasureSettings?: QuantitativeScaleSettingsFeaturedMeasureSettings; + + /**Contains property to customize the featured measure. + */ + featureMeasures?: Array; + + /**Contains property to customize the fields. + */ + fields?: QuantitativeScaleSettingsFields; + + /**Specifies the interval for the Graph. + * @Default {1} + */ + interval?: number; + + /**Contains property to customize the labels. + */ + labelSettings?: QuantitativeScaleSettingsLabelSettings; + + /**Contains property to customize the position of the quantitative scale + */ + location?: QuantitativeScaleSettingsLocation; + + /**Contains property to customize the major tick lines. + */ + majorTickSettings?: QuantitativeScaleSettingsMajorTickSettings; + + /**Specifies the maximum value of the Graph. + * @Default {10} + */ + maximum?: number; + + /**Specifies the minimum value of the Graph. + * @Default {0} + */ + minimum?: number; + + /**Contains property to customize the minor ticks. + */ + minorTickSettings?: QuantitativeScaleSettingsMinorTickSettings; + + /**The specified number of minor ticks will be rendered per interval. + * @Default {4} + */ + minorTicksPerInterval?: number; + + /**Specifies the placement of ticks to render either inside or outside the scale. + * @Default {ej.datavisualization.BulletGraph.TickPlacement.Outside} + */ + tickPlacement?: ej.datavisualization.BulletGraph.TickPlacement|string; + + /**Specifies the position of the ticks to render either above,below or inside + * @Default {ej.datavisualization.BulletGraph.TickPosition.Far} + */ + tickPosition?: ej.datavisualization.BulletGraph.TickPosition|string; +} + +export interface TooltipSettings { + + /**Specifies template for caption tooltip + * @Default {null} + */ + captionTemplate?: string; + + /**Toggles the visibility of caption tooltip + * @Default {false} + */ + enableCaptionTooltip?: boolean; + + /**Specifies the ID of a div, which is to be displayed as tooltip. + * @Default {null} + */ + template?: string; + + /**Toggles the visibility of tooltip + * @Default {true} + */ + visible?: boolean; +} +} +module BulletGraph +{ +enum FontStyle +{ +//string +Normal, +//string +Italic, +//string +Oblique, +} +} +module BulletGraph +{ +enum FontWeight +{ +//string +Normal, +//string +Bold, +//string +Bolder, +//string +Lighter, +} +} +module BulletGraph +{ +enum TextAlignment +{ +//string +Near, +//string +Far, +//string +Center, +} +} +module BulletGraph +{ +enum TextAnchor +{ +//string +Start, +//string +Middle, +//string +End, +} +} +module BulletGraph +{ +enum TextPosition +{ +//string +Top, +//string +Right, +//string +Left, +//string +Bottom, +//string +Float, +} +} +module BulletGraph +{ +enum FlowDirection +{ +//string +Forward, +//string +Backward, +} +} +module BulletGraph +{ +enum Orientation +{ +//string +Horizontal, +//string +Vertical, +} +} +module BulletGraph +{ +enum LabelPlacement +{ +//string +Inside, +//string +Outside, +} +} +module BulletGraph +{ +enum LabelPosition +{ +//string +Above, +//string +Below, +} +} +module BulletGraph +{ +enum TickPlacement +{ +//string +Inside, +//string +Outside, +} +} +module BulletGraph +{ +enum TickPosition +{ +//string +Below, +//string +Above, +//string +Cross, +} +} + +class Barcode extends ej.Widget { + static fn: Barcode; + constructor(element: JQuery, options?: Barcode.Model); + constructor(element: Element, options?: Barcode.Model); + model:Barcode.Model; + defaults:Barcode.Model; + + /** To disable the barcode + * @returns {void} + */ + disable(): void; + + /** To enable the barcode + * @returns {void} + */ + enable(): void; +} +export module Barcode{ + +export interface Model { + + /**Specifies the distance between the barcode and text below it. + */ + barcodeToTextGapHeight?: number; + + /**Specifies the height of bars in the Barcode. By modifying the barHeight, the entire barcode height can be customized. Please refer to xDimension for two dimensional barcode height customization. + */ + barHeight?: number; + + /**Specifies the dark bar color of the Barcode. One dimensional barcode contains a series of dark and light bars which are usually colored as black and white respectively. + */ + darkBarColor?: any; + + /**Specifies whether the text below the barcode is visible or hidden. + */ + displayText?: boolean; + + /**Specifies whether the control is enabled. + */ + enabled?: boolean; + + /**Specifies the start and stop encode symbol in the Barcode. In one dimensional barcodes, an additional character is added as start and stop delimiters. These symbols are optional and the unique of the symbol allows the reader to determine the direction of the barcode being scanned. + */ + encodeStartStopSymbol?: number; + + /**Specifies the light bar color of the Barcode. One dimensional barcode contains a series of dark and light bars which are usually colored as black and white respectively. + */ + lightBarColor?: any; + + /**Specifies the width of the narrow bars in the barcode. The dark bars in the one dimensional barcode contains random narrow and wide bars based on the provided input which can be specified during initialization. + */ + narrowBarWidth?: number; + + /**Specifies the width of the quiet zone. In barcode, a quiet zone is the blank margin on either side of a barcode which informs the reader where a barcode's symbology starts and stops. The purpose of a quiet zone is to prevent the reader from picking up unrelated information. + */ + quietZone?: QuietZone; + + /**Specifies the type of the Barcode. See SymbologyType + */ + symbologyType?: ej.datavisualization.Barcode.SymbologyType|string; + + /**Specifies the text to be encoded in the barcode. + */ + text?: string; + + /**Specifies the color of the text/data at the bottom of the barcode. + */ + textColor?: any; + + /**Specifies the width of the wide bars in the barcode. One dimensional barcode usually contains random narrow and wide bars based on the provided which can be customized during initialization. + */ + wideBarWidth?: number; + + /**Specifies the width of the narrowest element(bar or space) in a barcode. The greater the x dimension, the more easily a barcode reader will scan. + */ + xDimension?: number; + + /**Fires after Barcode control is loaded.*/ + load? (e: LoadEventArgs): void; +} + +export interface LoadEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the barcode model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; + + /**return the barcode state + */ + status?: boolean; +} + +export interface QuietZone { + + /**Specifies the quiet zone around the Barcode. + */ + all?: number; + + /**Specifies the bottom quiet zone of the Barcode. + */ + bottom?: number; + + /**Specifies the left quiet zone of the Barcode. + */ + left?: number; + + /**Specifies the right quiet zone of the Barcode. + */ + right?: number; + + /**Specifies the top quiet zone of the Barcode. + */ + top?: number; +} +} +module Barcode +{ +enum SymbologyType +{ +//Represents the QR code +QRBarcode, +//Represents the Data Matrix barcode +DataMatrix, +//Represents the Code 39 barcode +Code39, +//Represents the Code 39 Extended barcode +Code39Extended, +//Represents the Code 11 barcode +Code11, +//Represents the Codabar barcode +Codabar, +//Represents the Code 32 barcode +Code32, +//Represents the Code 93 barcode +Code93, +//Represents the Code 93 Extended barcode +Code93Extended, +//Represents the Code 128 A barcode +Code128A, +//Represents the Code 128 B barcode +Code128B, +//Represents the Code 128 C barcode +Code128C, +} +} + +class Map extends ej.Widget { + static fn: Map; + constructor(element: JQuery, options?: Map.Model); + constructor(element: Element, options?: Map.Model); + model:Map.Model; + defaults:Map.Model; + + /** Method for navigating to specific shape based on latitude, longitude and zoomlevel. + * @param {number} Pass the latitude value for map + * @param {number} Pass the longitude value for map + * @param {number} Pass the zoom level for map + * @returns {void} + */ + navigateTo(latitude: number, longitude: number, level: number): void; + + /** Method to perform map panning + * @param {string} Pass the direction in which map should be panned + * @returns {void} + */ + pan(direction: string): void; + + /** Method to reload the map. + * @returns {void} + */ + refresh(): void; + + /** Method to reload the shapeLayers with updated values + * @returns {void} + */ + refreshLayers(): void; + + /** Method to reload the navigation control with updated values. + * @param {any} Pass the navigation control instance + * @returns {void} + */ + refreshNavigationControl(navigation: any): void; + + /** Method to perform map zooming. + * @param {number} Pass the zoom level for map to be zoomed + * @param {boolean} Pass the boolean value to enable or disable animation while zooming + * @returns {void} + */ + zoom(level: number, isAnimate: boolean): void; +} +export module Map{ + +export interface Model { + + /**Specifies the background color for map + * @Default {white} + */ + background?: string; + + /**Specifies the base map-index of the map to determine the shapelayer to be displayed + * @Default {0} + */ + baseMapIndex?: number; + + /**Specify the center position where map should be displayed + * @Default {[0,0]} + */ + centerPosition?: any; + + /**Enables or Disables the map animation + * @Default {false} + */ + enableAnimation?: boolean; + + /**Enables or Disables the animation for layer change in map + * @Default {false} + */ + enableLayerChangeAnimation?: boolean; + + /**Enables or Disables the map panning + * @Default {true} + */ + enablePan?: boolean; + + /**Determines whether map need to resize when container is resized + * @Default {true} + */ + enableResize?: boolean; + + /**Enables or Disables the zooming of map + * @Default {true} + */ + enableZoom?: boolean; + + /**Enables or Disables the zoom on selecting the map shape + * @Default {false} + */ + enableZoomOnSelection?: boolean; + + /**Specifies the zoom factor for map zoom value. + * @Default {1} + */ + factor?: number; + + /**Hold the shapelayers to be displayed in map + * @Default {[]} + */ + layers?: Array; + + /**Specifies the zoom level value for which map to be zoomed + * @Default {1} + */ + level?: number; + + /**Specifies the maximum zoom level of the map + * @Default {100} + */ + maxValue?: number; + + /**Specifies the minimum zoomSettings level of the map + * @Default {1} + */ + minValue?: number; + + /**Enables or Disables the navigation control for map to perform zooming and panning on map shapes. + */ + navigationControl?: any; + + /**Layer for holding the map shapes + */ + shapeLayer?: ShapeLayer; + + /**Enables or Disables the Zooming for map. + */ + zoomSettings?: any; + + /**Triggered on selecting the map markers.*/ + markerSelected? (e: MarkerSelectedEventArgs): void; + + /**Triggers while leaving the hovered map shape*/ + mouseleave? (e: MouseleaveEventArgs): void; + + /**Triggers while hovering the map shape.*/ + mouseover? (e: MouseoverEventArgs): void; + + /**Triggers once map render completed.*/ + onRenderComplete? (e: OnRenderCompleteEventArgs): void; + + /**Triggers when map panning ends.*/ + panned? (e: PannedEventArgs): void; + + /**Triggered on selecting the map shapes.*/ + shapeSelected? (e: ShapeSelectedEventArgs): void; + + /**Triggered when map is zoomed-in.*/ + zoomedIn? (e: ZoomedInEventArgs): void; + + /**Triggers when map is zoomed out.*/ + zoomedOut? (e: ZoomedOutEventArgs): void; +} + +export interface MarkerSelectedEventArgs { + + /**Returns marker object. + */ + originalEvent?: any; +} + +export interface MouseleaveEventArgs { + + /**Returns hovered map shape object. + */ + originalEvent?: any; +} + +export interface MouseoverEventArgs { + + /**Returns hovered map shape object. + */ + originalEvent?: any; +} + +export interface OnRenderCompleteEventArgs { + + /**Event parameters from map + */ + originalEvent?: any; +} + +export interface PannedEventArgs { + + /**Event parameters from map + */ + originalEvent?: any; +} + +export interface ShapeSelectedEventArgs { + + /**Returns selected shape object. + */ + originalEvent?: any; +} + +export interface ZoomedInEventArgs { + + /**Event parameters from map + */ + originalEvent?: any; + + /**Returns zoom level value for which the map is zoomed. + */ + zoomLevel?: any; +} + +export interface ZoomedOutEventArgs { + + /**Event parameters from map + */ + originalEvent?: any; + + /**Returns zoom level value for which the map is zoomed. + */ + zoomLevel?: any; +} + +export interface ShapeLayerBubbleSettings { + + /**Specifies the bubble Opacity value of bubbles for shape layer in map + * @Default {0.9} + */ + bubbleOpacity?: number; + + /**Specifies the mouse hover color of the shape layer in map + * @Default {gray} + */ + color?: string; + + /**Specifies the colorMappings of the shape layer in map + * @Default {null} + */ + colorMappings?: any; + + /**Specifies the bubble color valuePath of the shape layer in map + * @Default {null} + */ + colorValuePath?: string; + + /**Specifies the maximum size value of bubbles for shape layer in map + * @Default {20} + */ + maxValue?: number; + + /**Specifies the minimum size value of bubbles for shape layer in map + * @Default {10} + */ + minValue?: number; + + /**Specifies the showBubble visibility status map + * @Default {true} + */ + showBubble?: boolean; + + /**Specifies the tooltip visibility status of the shape layer in map + * @Default {false} + */ + showTooltip?: boolean; + + /**Specifies the bubble tooltip template of the shape layer in map + * @Default {null} + */ + tooltipTemplate?: string; + + /**Specifies the bubble valuePath of the shape layer in map + * @Default {null} + */ + valuePath?: string; +} + +export interface ShapeLayerLabelSettings { + + /**enable or disable the enableSmartLabel property + * @Default {false} + */ + enableSmartLabel?: boolean; + + /**set the labelLength property + * @Default {'2'} + */ + labelLength?: number; + + /**set the labelPath property + * @Default {null} + */ + labelPath?: string; + + /**enable or disable the showlabel property + * @Default {false} + */ + showLabels?: boolean; + + /**set the smartLabelSize property + * @Default {fixed} + */ + smartLabelSize?: ej.datavisualization.Map.LabelSize|string; +} + +export interface ShapeLayerLegendSettings { + + /**Determines whether the legend should be placed outside or inside the map bounds + * @Default {false} + */ + dockOnMap?: boolean; + + /**Determines the legend placement and it is valid only when dockOnMap is true + * @Default {top} + */ + dockPosition?: ej.datavisualization.Map.DockPosition|string; + + /**height value for legend setting + * @Default {0} + */ + height?: number; + + /**to get icon value for legend setting + * @Default {rectangle} + */ + icon?: ej.datavisualization.Map.LegendIcons|string; + + /**icon height value for legend setting + * @Default {20} + */ + iconHeight?: number; + + /**icon Width value for legend setting + * @Default {20} + */ + iconWidth?: number; + + /**set the orientation of legend labels + * @Default {vertical} + */ + labelOrientation?: ej.datavisualization.Map.LabelOrientation|string; + + /**to get leftLabel value for legend setting + * @Default {null} + */ + leftLabel?: string; + + /**to get mode of legend setting + * @Default {default} + */ + mode?: ej.datavisualization.Map.LegendMode|string; + + /**set the position of legend settings + * @Default {topleft} + */ + position?: ej.datavisualization.Map.Position|string; + + /**x position value for legend setting + * @Default {0} + */ + positionX?: number; + + /**y position value for legend setting + * @Default {0} + */ + positionY?: number; + + /**to get rightLabel value for legend setting + * @Default {null} + */ + rightLabel?: string; + + /**Enables or Disables the showLabels + * @Default {false} + */ + showLabels?: boolean; + + /**Enables or Disables the showLegend + * @Default {false} + */ + showLegend?: boolean; + + /**to get title of legend setting + * @Default {null} + */ + title?: string; + + /**to get type of legend setting + * @Default {layers} + */ + type?: ej.datavisualization.Map.LegendType|string; + + /**width value for legend setting + * @Default {0} + */ + width?: number; +} + +export interface ShapeLayerShapeSettings { + + /**Enables or Disables the auto fill colors for shape layer in map. When this property value set to true, shapes will be filled with palette colors. + * @Default {false} + */ + autoFill?: boolean; + + /**Specifies the colorMappings of the shape layer in map + * @Default {null} + */ + colorMappings?: any; + + /**Specifies the shape color palette value of the shape layer in map. Accepted colorPalette values are palette1, palette2, palette3 and custompalette. + * @Default {palette1} + */ + colorPalette?: string; + + /**Specifies the shape color valuePath of the shape layer in map + * @Default {null} + */ + colorValuePath?: string; + + /**Enables or Disables the gradient colors for map shapes. + * @Default {false} + */ + enableGradient?: boolean; + + /**Specifies the shape fill color of the shape layer in map + * @Default {#E5E5E5} + */ + fill?: string; + + /**Specifies the mouse over width of the shape layer in map + * @Default {1} + */ + highlightBorderWidth?: number; + + /**Specifies the mouse hover color of the shape layer in map + * @Default {gray} + */ + highlightColor?: string; + + /**Specifies the mouse over stroke color of the shape layer in map + * @Default {#C1C1C1} + */ + highlightStroke?: string; + + /**Specifies the shape selection color of the shape layer in map + * @Default {gray} + */ + selectionColor?: string; + + /**Specifies the shape selection stroke color of the shape layer in map + * @Default {#C1C1C1} + */ + selectionStroke?: string; + + /**Specifies the shape selection stroke width of the shape layer in map + * @Default {1} + */ + selectionStrokeWidth?: number; + + /**Specifies the shape stroke color of the shape layer in map + * @Default {#C1C1C1} + */ + stroke?: string; + + /**Specifies the shape stroke thickness value of the shape layer in map + * @Default {0.2} + */ + strokeThickness?: number; + + /**Specifies the shape valuePath of the shape layer in map + * @Default {null} + */ + valuePath?: string; +} + +export interface ShapeLayer { + + /**to get the type of bing map. + * @Default {aerial} + */ + bingMapType?: ej.datavisualization.Map.BingMapType|string; + + /**Specifies the bubble settings for map + */ + bubbleSettings?: ShapeLayerBubbleSettings; + + /**Specifies the datasource for the shape layer + */ + dataSource?: any; + + /**Enables or disables the animation + * @Default {false} + */ + enableAnimation?: boolean; + + /**Enables or disables the shape mouse hover + * @Default {false} + */ + enableMouseHover?: boolean; + + /**Enables or disables the shape selection + * @Default {true} + */ + enableSelection?: boolean; + + /**to get the key of bing map + * @Default {null} + */ + key?: string; + + /**Options for enabling and configuring labelSettings labelPath, smartLabelSize, labelLength etc., + */ + labelSettings?: ShapeLayerLabelSettings; + + /**Specifies the map type. + * @Default {'geometry'} + */ + layerType?: ej.datavisualization.Map.LayerType|string; + + /**Options for enabling and configuring legendSettings position, height, width, mode, type etc., + */ + legendSettings?: ShapeLayerLegendSettings; + + /**Specifies the map items template for shapes. + */ + mapItemsTemplate?: string; + + /**Specify markers for shape layer. + * @Default {[]} + */ + markers?: Array; + + /**Specifies the map marker template for map layer. + * @Default {null} + */ + markerTemplate?: string; + + /**Specify selectedMapShapes for shape layer + * @Default {[]} + */ + selectedMapShapes?: Array; + + /**Specifies the selection mode of the map. Accepted selection mode values are Default and Multiple. + * @Default {default} + */ + selectionMode?: ej.datavisualization.Map.SelectionMode|string; + + /**Specifies the shape data for the shape layer + */ + shapeDataobject?: any; + + /**Specifies the shape settings of map layer + */ + shapeSettings?: ShapeLayerShapeSettings; + + /**Shows or hides the map items. + * @Default {false} + */ + showMapItems?: boolean; + + /**Shows or hides the tooltip for shapes + * @Default {false} + */ + showTooltip?: boolean; + + /**Specifies the sub shape layers + * @Default {[]} + */ + subLayers?: Array; + + /**Specifies the tooltip template for shapes. + */ + tooltipTemplate?: string; + + /**Specifies the url template for the OSM type map. + * @Default {'http://a.tile.openstreetmap.org/level/tileX/tileY.png'} + */ + urlTemplate?: string; +} +} +module Map +{ +enum Position +{ +//specifies the none position +None, +//specifies the topleft position +Topleft, +//specifies the topcenter position +Topcenter, +//specifies the topright position +Topright, +//specifies the centerleft position +Centerleft, +//specifies the center position +Center, +//specifies the centerright position +Centerright, +//specifies the bottomleft position +Bottomleft, +//specifies the bottomcenter position +Bottomcenter, +//specifies the bottomright position +Bottomright, +} +} +module Map +{ +enum Orientation +{ +//specifies the horizontal position +Horizontal, +//specifies the vertical position +Vertical, +} +} +module Map +{ +enum BingMapType +{ +//specifies the aerial type +Aerial, +//specifies the aerialwithlabel type +Aerialwithlabel, +//specifies the road type +Road, +} +} +module Map +{ +enum LabelSize +{ +//specifies the fixed size +Fixed, +//specifies the default size +Default, +} +} +module Map +{ +enum LayerType +{ +//specifies the geometry type +Geometry, +//specifies the osm type +Osm, +//specifies the bing type +Bing, +} +} +module Map +{ +enum DockPosition +{ +//specifies the top position +Top, +//specifies the bottom position +Bottom, +//specifies the bottom position +Right, +//specifies the left position +Left, +} +} +module Map +{ +enum LegendIcons +{ +//specifies the rectangle position +Rectangle, +//specifies the circle position +Circle, +} +} +module Map +{ +enum LabelOrientation +{ +//specifies the horizontal position +Horizontal, +//specifies the vertical position +Vertical, +} +} +module Map +{ +enum LegendMode +{ +//specifies the default mode +Default, +//specifies the interactive mode +Interactive, +} +} +module Map +{ +enum LegendType +{ +//specifies the layers type +Layers, +//specifies the bubbles type +Bubbles, +} +} +module Map +{ +enum SelectionMode +{ +//specifies the default position +Default, +//specifies the multiple position +Multiple, +} +} + +class TreeMap extends ej.Widget { + static fn: TreeMap; + constructor(element: JQuery, options?: TreeMap.Model); + constructor(element: Element, options?: TreeMap.Model); + model:TreeMap.Model; + defaults:TreeMap.Model; + + /** Method to reload treemap with updated values. + * @returns {void} + */ + refresh(): void; +} +export module TreeMap{ + +export interface Model { + + /**Specifies the border brush color of the treemap + * @Default {white} + */ + borderBrush?: string; + + /**Specifies the border thickness of the treemap + * @Default {1} + */ + borderThickness?: number; + + /**Specifies the colors of the paletteColorMapping + * @Default {[]} + */ + colors?: Array; + + /**Specifies the color valuepath of the treemap + * @Default {null} + */ + colorValuePath?: string; + + /**Specifies the datasource of the treemap + * @Default {null} + */ + dataSource?: any; + + /**Specifies the desaturationColorMapping settings of the treemap + */ + desaturationColorMapping?: any; + + /**Specifies the dockPosition for legend + * @Default {top} + */ + dockPosition?: ej.datavisualization.TreeMap.DockPosition|string; + + /**specifies the drillDown header color + * @Default {'null'} + */ + drillDownHeaderColor?: string; + + /**specifies the drillDown selection color + * @Default {'#000000'} + */ + drillDownSelectionColor?: string; + + /**Enable/Disable the drillDown for treemap + * @Default {false} + */ + enableDrillDown?: boolean; + + /**Specifies whether treemap need to resize when container is resized + * @Default {true} + */ + enableResize?: boolean; + + /**Specifies the from value for desaturation color mapping + * @Default {0} + */ + from?: number; + + /**Specifies the group color mapping of the treemap + * @Default {[]} + */ + groupColorMapping?: Array; + + /**Specifies the height for legend + * @Default {30} + */ + height?: number; + + /**Specifies the highlight border brush of treemap + * @Default {gray} + */ + highlightBorderBrush?: string; + + /**Specifies the border thickness when treemap items is highlighted in the treemap + * @Default {5} + */ + highlightBorderThickness?: number; + + /**Specifies the highlight border brush of treemap + * @Default {gray} + */ + highlightGroupBorderBrush?: string; + + /**Specifies the border thickness when treemap items is highlighted in the treemap + * @Default {5} + */ + highlightGroupBorderThickness?: number; + + /**Specifies whether treemap item need to highlighted on selection + * @Default {false} + */ + highlightGroupOnSelection?: boolean; + + /**Specifies whether treemap item need to highlighted on selection + * @Default {false} + */ + highlightOnSelection?: boolean; + + /**Specifies the iconHeight for legend + * @Default {15} + */ + iconHeight?: number; + + /**Specifies the iconWidth for legend + * @Default {15} + */ + iconWidth?: number; + + /**Specifies the items layout mode of the treemap. Accepted itemsLayoutMode values are Squarified, SliceAndDiceHorizontal, SliceAndDiceVertical and SliceAndDiceAuto + * @Default {Squarified} + */ + itemsLayoutMode?: ej.datavisualization.TreeMap.ItemsLayoutMode|string; + + /**Specifies the leaf settings of the treemap + */ + leafItemSettings?: LeafItemSettings; + + /**Specifies the legend settings of the treemap + */ + legendSettings?: any; + + /**Specify levels of treemap for grouped visualization of datas + * @Default {[]} + */ + levels?: Array; + + /**Specifies the paletteColorMapping of the treemap + */ + paletteColorMapping?: any; + + /**Specifies the rangeColorMapping settings of the treemap + */ + rangeColorMapping?: Array; + + /**Specifies the rangeMaximum value for desaturation color mapping + * @Default {0} + */ + rangeMaximum?: number; + + /**Specifies the rangeMinimum value for desaturation color mapping + * @Default {0} + */ + rangeMinimum?: number; + + /**Specifies the legend visibility status of the treemap + * @Default {false} + */ + showLegend?: boolean; + + /**Specifies whether treemap tooltip need to be visible + * @Default {false} + */ + showTooltip?: boolean; + + /**Specifies the template for legendSettings + * @Default {null} + */ + template?: string; + + /**Specifies the to value for desaturation color mapping + * @Default {0} + */ + to?: number; + + /**Specifies the tooltip template of the treemap + * @Default {null} + */ + tooltipTemplate?: string; + + /**Hold the treeMapItems to be displayed in treemap + * @Default {[]} + */ + treeMapItems?: Array; + + /**Hold the Level settings of TreeMap + */ + treeMapLevel?: TreeMapLevel; + + /**Specifies the uniColorMapping settings of the treemap + */ + uniColorMapping?: any; + + /**Specifies the weight valuepath of the treemap + * @Default {null} + */ + weightValuePath?: string; + + /**Specifies the width for legend + * @Default {100} + */ + width?: number; + + /**Triggers on treemap item selected.*/ + treeMapItemSelected? (e: TreeMapItemSelectedEventArgs): void; +} + +export interface TreeMapItemSelectedEventArgs { + + /**Returns selected treeMapItem object. + */ + originalEvent?: any; +} + +export interface LeafItemSettings { + + /**Specifies the border bruch color of the leaf item. + * @Default {white} + */ + borderBrush?: string; + + /**Specifies the border thickness of the leaf item. + * @Default {1} + */ + borderThickness?: number; + + /**Specifies the label template of the leaf item. + * @Default {null} + */ + itemTemplate?: string; + + /**Specifies the label path of the leaf item. + * @Default {null} + */ + labelPath?: string; + + /**Specifies the position of the leaf labels. + * @Default {center} + */ + labelPosition?: ej.datavisualization.TreeMap.Position|string; + + /**Specifies the mode of label visibility + * @Default {visible} + */ + labelVisibilityMode?: ej.datavisualization.TreeMap.VisibilityMode|string; + + /**Shows or hides the label of the leaf item. + * @Default {false} + */ + showLabels?: boolean; +} + +export interface TreeMapLevel { + + /**specifies the group background + * @Default {null} + */ + groupBackground?: string; + + /**Specifies the group border color for tree map level. + * @Default {null} + */ + groupBorderColor?: string; + + /**Specifies the group border thickness for tree map level. + * @Default {1} + */ + groupBorderThickness?: number; + + /**Specifies the group gap for tree map level. + * @Default {1} + */ + groupGap?: number; + + /**Specifies the group padding for tree map level. + * @Default {4} + */ + groupPadding?: number; + + /**Specifies the group path for tree map level. + */ + groupPath?: string; + + /**Specifies the header height for tree map level. + * @Default {0} + */ + headerHeight?: number; + + /**Specifies the header template for tree map level. + * @Default {null} + */ + headerTemplate?: string; + + /**Specifies the mode of header visibility + * @Default {visible} + */ + headerVisibilityMode?: ej.datavisualization.TreeMap.VisibilityMode|string; + + /**Specifies the position of the labels. + * @Default {center} + */ + labelPosition?: ej.datavisualization.TreeMap.Position|string; + + /**Specifies the label template for tree map level. + * @Default {null} + */ + labelTemplate?: string; + + /**Specifies the mode of label visibility + * @Default {visible} + */ + labelVisibilityMode?: ej.datavisualization.TreeMap.VisibilityMode|string; + + /**Shows or hides the header for tree map level. + * @Default {false} + */ + showHeader?: boolean; + + /**Shows or hides the labels for tree map level. + * @Default {false} + */ + showLabels?: boolean; +} +} +module TreeMap +{ +enum DockPosition +{ +//specifies the top position +Top, +//specifies the bottom position +Bottom, +//specifies the bottom position +Right, +//specifies the left position +Left, +} +} +module TreeMap +{ +enum ItemsLayoutMode +{ +//specifies the squarified as layout type position +Squarified, +//specifies the sliceanddicehorizontal as layout type position +Sliceanddicehorizontal, +//specifies the sliceanddicevertical as layout type position +Sliceanddicevertical, +//specifies the sliceanddiceauto as layout type position +Sliceanddiceauto, +} +} +module TreeMap +{ +enum Position +{ +//specifies the none position +None, +//specifies the topleft position +Topleft, +//specifies the topcenter position +Topcenter, +//specifies the topright position +Topright, +//specifies the centerleft position +Centerleft, +//specifies the center position +Center, +//specifies the centerright position +Centerright, +//specifies the bottomleft position +Bottomleft, +//specifies the bottomcenter position +Bottomcenter, +//specifies the bottomright position +Bottomright, +} +} +module TreeMap +{ +enum VisibilityMode +{ +//specifies the visible mode +Top, +//specifies the hideonexceededlength mode +Hideonexceededlength, +} +} +module TreeMap +{ +enum groupSelectionMode +{ +//specifies the default mode +Default, +//specifies the multiple mode +Multiple, +} +} + +class Diagram extends ej.Widget { + static fn: Diagram; + constructor(element: JQuery, options?: Diagram.Model); + constructor(element: Element, options?: Diagram.Model); + model:Diagram.Model; + defaults:Diagram.Model; + + /** Add nodes and connectors to diagram at runtime + * @param {any} a JSON to define a node/connector or an array of nodes and connector + * @returns {void} + */ + add(node: any): void; + + /** Add a label to a node at runtime + * @param {string} name of the node to which label will be added + * @param {any} JSON for the new label to be added + * @returns {void} + */ + addLabel(nodeName: string, newLabel: any): void; + + /** Add a phase to a swimlane at runtime + * @param {string} name of the swimlane to which the phase will be added + * @param {any} JSON object to define the phase to be added + * @returns {void} + */ + addPhase(name: string, options: any): void; + + /** Add a collection of ports to the node specified by name + * @param {string} name of the node to which the ports have to be added + * @param {Array} a collection of ports to be added to the specified node + * @returns {void} + */ + addPorts(name: string, ports: Array): void; + + /** Add the specified node to selection list + * @param {any} the node to be selected + * @param {boolean} to define whether to clear the existing selection or not + * @returns {void} + */ + addSelection(node: any, clearSelection: boolean): void; + + /** Align the selected objects based on the reference object and direction + * @param {string} to specify the direction towards which the selected objects are to be aligned("left","right",top","bottom") + * @returns {void} + */ + align(direction: string): void; + + /** Bring the specified portion of the diagram content to the diagram viewport + * @param {any} the rectangular region that is to be brought into diagram viewport + * @returns {void} + */ + bringIntoView(rect: any): void; + + /** Bring the specified portion of the diagram content to the center of the diagram viewport + * @param {any} the rectangular region that is to be brought to the center of diagram viewport + * @returns {void} + */ + bringToCenter(rect: any): void; + + /** Visually move the selected object over all other intersected objects + * @returns {void} + */ + bringToFront(): void; + + /** Remove all the elements from diagram + * @returns {void} + */ + clear(): void; + + /** Remove the current selection in diagram + * @returns {void} + */ + clearSelection(): void; + + /** Copy the selected object to internal clipboard and get the copied object + * @returns {any} + */ + copy(): any; + + /** Cut the selected object from diagram to diagram internal clipboard + * @returns {void} + */ + cut(): void; + + /** Export the diagram as downloadable files or as data + * @param {Diagram.Options} options to export the desired region of diagram to the desired formats.NameTypeDescriptionfileNamestringname of the file to be downloaded.formatstringformat of the exported file/data. See [File Formats](/js/api/global#fileformats).modestringto set whether to export diagram as a file or as raw data. See [Export Modes](/js/api/global#exportmodes).regionstringto set the region of the diagram to be exported. See [Region](/js/api/global#region).boundsobjectto export any custom region of diagram.marginobjectto set margin to the exported data. + * @returns {string} + */ + exportDiagram(options: Diagram.Options): string; + + /** Read a node/connector object by its name + * @param {string} name of the node/connector that is to be identified + * @returns {any} + */ + findNode(name: string): any; + + /** Fit the diagram content into diagram viewport + * @param {string} to set the mode of fit to command. See [Fit Mode](/js/api/global#fitmode) + * @param {string} to set whether the region to be fit will be based on diagram elements or page settings [Region](/js/api/global#region) + * @param {any} to set the required margin + * @returns {void} + */ + fitToPage(mode: string, region: string, margin: any): void; + + /** Group the selected nodes and connectors + * @returns {void} + */ + group(): void; + + /** Insert a label into a node's label collection at runtime + * @param {string} name of the node to which the label has to be inserted + * @param {any} JSON to define the new label + * @param {number} index to insert the label into the node + * @returns {void} + */ + insertLabel(name: string, label: any, index: number): void; + + /** Refresh the diagram with the specified layout + * @returns {void} + */ + layout(): void; + + /** Load the diagram + * @param {any} JSON data to load the diagram + * @returns {void} + */ + load(data: any): void; + + /** Visually move the selected object over its closest intersected object + * @returns {void} + */ + moveForward(): void; + + /** Move the selected objects by either one pixel or by the pixels specified through argument + * @param {string} specifies the direction to move the selected objects ("left","right",top","bottom") + * @param {number} specifies the number of pixels by which the selected objects have to be moved + * @returns {void} + */ + nudge(direction: string, delta: number): void; + + /** Paste the selected object from internal clipboard to diagram + * @param {any} object to be added to diagram + * @param {boolean} to define whether the specified object is to be renamed or not + * @returns {void} + */ + paste(object: any, rename: boolean): void; + + /** Print the diagram as image + * @returns {void} + */ + print(): void; + + /** Restore the last action that was reverted + * @returns {void} + */ + redo(): void; + + /** Refresh the diagram at runtime + * @returns {void} + */ + refresh(): void; + + /** Remove either the given node/connector or the selected element from diagram + * @param {any} the node/connector to be removed from diagram + * @returns {void} + */ + remove(node: any): void; + + /** Remove a particular object from selection list + * @param {any} the node/connector to be removed from selection list + * @returns {void} + */ + removeSelection(node: any): void; + + /** Scale the selected objects to the height of the first selected object + * @returns {void} + */ + sameHeight(): void; + + /** Scale the selected objects to the size of the first selected object + * @returns {void} + */ + sameSize(): void; + + /** Scale the selected objects to the width of the first selected object + * @returns {void} + */ + sameWidth(): void; + + /** Returns the diagram as serialized JSON + * @returns {any} + */ + save(): any; + + /** Bring the node into view + * @param {any} the node/connector to be brought into view + * @returns {void} + */ + scrollToNode(node: any): void; + + /** Select all nodes and connector in diagram + * @returns {void} + */ + selectAll(): void; + + /** Visually move the selected object behind its closest intersected object + * @returns {void} + */ + sendBackward(): void; + + /** Visually move the selected object behind all other intersected objects + * @returns {void} + */ + sendToBack(): void; + + /** Update the horizontal space between the selected objects as equal and within the selection boundary + * @returns {void} + */ + spaceAcross(): void; + + /** Update the vertical space between the selected objects as equal and within the selection boundary + * @returns {void} + */ + spaceDown(): void; + + /** Move the specified label to edit mode + * @param {any} node/connector that contains the label to be edited + * @param {any} to be edited + * @returns {void} + */ + startLabelEdit(node: any, label: any): void; + + /** Reverse the last action that was performed + * @returns {void} + */ + undo(): void; + + /** Ungroup the selected group + * @returns {void} + */ + ungroup(): void; + + /** Update diagram at runtime + * @param {any} JSON to specify the diagram properties that have to be modified + * @returns {void} + */ + update(options: any): void; + + /** Update Connectors at runtime + * @param {string} name of the connector to be updated + * @param {any} JSON to specify the connector properties that have to be updated + * @returns {void} + */ + updateConnector(name: string, options: any): void; + + /** Update the given label at runtime + * @param {string} the name of node/connector which contains the label to be updated + * @param {any} the label to be modified + * @param {any} JSON to specify the label properties that have to be updated + * @returns {any} + */ + updateLabel(nodeName: string, label: any, options: any): any; + + /** Update nodes at runtime + * @param {string} name of the node that is to be updated + * @param {any} JSON to specify the properties of node that have to be updated + * @returns {void} + */ + updateNode(name: string, options: any): void; + + /** Update a port with its modified properties at runtime + * @param {string} the name of node which contains the port to be updated + * @param {any} the port to be updated + * @param {any} JSON to specify the properties of the port that have to be updated + * @returns {void} + */ + updatePort(nodeName: string, port: any, options: any): void; + + /** Update the specified node as selected object + * @param {string} name of the node to be updated as selected object + * @returns {void} + */ + updateSelectedObject(name: string): void; + + /** Update the selection at runtime + * @param {boolean} to specify whether to show the user handles or not + * @returns {void} + */ + updateSelection(showUserHandles: boolean): void; + + /** Update userhandles with respect to the given node + * @param {any} node/connector with respect to which, the user handles have to be updated + * @returns {void} + */ + updateUserHandles(node: any): void; + + /** Update the diagram viewport at runtime + * @returns {void} + */ + updateViewPort(): void; + + /** Upgrade the diagram from old version + * @param {any} to be upgraded + * @returns {void} + */ + upgrade(data: any): void; + + /** Used to zoomIn/zoomOut diagram + * @param {any} options to zoom the diagram(zoom factor, zoomIn/zoomOut) + * @returns {void} + */ + zoomTo(zoom: any): void; +} +export module Diagram{ + +export interface Options { + + /**name of the file to be downloaded. + */ + fileName?: string; + + /**format of the exported file/data. See [File Formats](/js/api/global#fileformats). + */ + format?: string; + + /**to set whether to export diagram as a file or as raw data. See [Export Modes](/js/api/global#exportmodes). + */ + mode?: string; + + /**to set the region of the diagram to be exported. See [Region](/js/api/global#region). + */ + region?: string; + + /**to export any custom region of diagram. + */ + bounds?: any; + + /**to set margin to the exported data. + */ + margin?: any; +} + +export interface Model { + + /**Defines the background color of diagram elements + * @Default {transparent} + */ + backgroundColor?: string; + + /**Defines the path of the background image of diagram elements + * @Default {null} + */ + backgroundImage?: string; + + /**Sets the direction of line bridges. + * @Default {ej.datavisualization.Diagram.BridgeDirection.Top} + */ + bridgeDirection?: ej.datavisualization.Diagram.BridgeDirection|string; + + /**Defines a set of custom commands and binds them with a set of desired key gestures. + */ + commandManager?: CommandManager; + + /**A collection of JSON objects where each object represents a connector + * @Default {[]} + */ + connectors?: Array; + + /**Binds the custom JSON data with connector properties + * @Default {null} + */ + connectorTemplate?: any; + + /**Enables/Disables the default behaviors of the diagram. + * @Default {ej.datavisualization.Diagram.DiagramConstraints.All} + */ + constraints?: ej.datavisualization.Diagram.DiagramConstraints|string; + + /**An object to customize the context menu of diagram + */ + contextMenu?: ContextMenu; + + /**Configures the data source that is to be bound with diagram + */ + dataSourceSettings?: DataSourceSettings; + + /**Initializes the default values for nodes and connectors + * @Default {{}} + */ + defaultSettings?: DefaultSettings; + + /**Sets the type of Json object to be drawn through drawing tool + * @Default {{}} + */ + drawType?: any; + + /**Enables or disables auto scroll in diagram + * @Default {true} + */ + enableAutoScroll?: boolean; + + /**Enables or disables diagram context menu + * @Default {true} + */ + enableContextMenu?: boolean; + + /**Specifies the height of the diagram + * @Default {null} + */ + height?: string; + + /**Customizes the undo redo functionality + */ + historyManager?: HistoryManager; + + /**Automatically arranges the nodes and connectors in a predefined manner + */ + layout?: Layout; + + /**Defines the current culture of diagram + * @Default {en-US} + */ + locale?: string; + + /**Array of JSON objects where each object represents a node + * @Default {[]} + */ + nodes?: Array; + + /**Binds the custom JSON data with node properties + * @Default {null} + */ + nodeTemplate?: any; + + /**Defines the size and appearance of diagram page + */ + pageSettings?: PageSettings; + + /**Defines the zoom value, zoom factor, scroll status and view port size of the diagram + */ + scrollSettings?: ScrollSettings; + + /**Defines the size and position of selected items and defines the appearance of selector + */ + selectedItems?: SelectedItems; + + /**Enables or disables tooltip of diagram + * @Default {true} + */ + showTooltip?: boolean; + + /**Defines the gridlines and defines how and when the objects have to be snapped + */ + snapSettings?: SnapSettings; + + /**Enables/Disables the interactive behaviors of diagram. + * @Default {ej.datavisualization.Diagram.Tool.All} + */ + tool?: ej.datavisualization.Diagram.Tool|string; + + /**An object that defines the description, appearance and alignments of tooltips + * @Default {null} + */ + tooltip?: Tooltip; + + /**Specifies the width of the diagram + * @Default {null} + */ + width?: string; + + /**Sets the factor by which we can zoom in or zoom out + * @Default {0.2} + */ + zoomFactor?: number; + + /**Triggers When auto scroll is changed*/ + autoScrollChange? (e: AutoScrollChangeEventArgs): void; + + /**Triggers when a node, connector or diagram is clicked*/ + click? (e: ClickEventArgs): void; + + /**Triggers when the connection is changed*/ + connectionChange? (e: ConnectionChangeEventArgs): void; + + /**Triggers when the connector collection is changed*/ + connectorCollectionChange? (e: ConnectorCollectionChangeEventArgs): void; + + /**Triggers when the connectors' source point is changed*/ + connectorSourceChange? (e: ConnectorSourceChangeEventArgs): void; + + /**Triggers when the connectors' target point is changed*/ + connectorTargetChange? (e: ConnectorTargetChangeEventArgs): void; + + /**Triggers before opening the context menu*/ + contextMenuBeforeOpen? (e: ContextMenuBeforeOpenEventArgs): void; + + /**Triggers when a context menu item is clicked*/ + contextMenuClick? (e: ContextMenuClickEventArgs): void; + + /**Triggers when a node, connector or diagram model is clicked twice*/ + doubleClick? (e: DoubleClickEventArgs): void; + + /**Triggers while dragging the elements in diagram*/ + drag? (e: DragEventArgs): void; + + /**Triggers when a symbol is dragged into diagram from symbol palette*/ + dragEnter? (e: DragEnterEventArgs): void; + + /**Triggers when a symbol is dragged outside of the diagram.*/ + dragLeave? (e: DragLeaveEventArgs): void; + + /**Triggers when a symbol is dragged over diagram*/ + dragOver? (e: DragOverEventArgs): void; + + /**Triggers when a symbol is dragged and dropped from symbol palette to drawing area*/ + drop? (e: DropEventArgs): void; + + /**Triggers when a child is added to or removed from a group*/ + groupChange? (e: GroupChangeEventArgs): void; + + /**Triggers when a diagram element is clicked*/ + itemClick? (e: ItemClickEventArgs): void; + + /**Triggers when mouse enters a node/connector*/ + mouseEnter? (e: MouseEnterEventArgs): void; + + /**Triggers when mouse leaves node/connector*/ + mouseLeave? (e: MouseLeaveEventArgs): void; + + /**Triggers when mouse hovers over a node/connector*/ + mouseOver? (e: MouseOverEventArgs): void; + + /**Triggers when node collection is changed*/ + nodeCollectionChange? (e: NodeCollectionChangeEventArgs): void; + + /**Triggers when the node properties(x, y,width and height alone) are changed using nudge commands or updateNode API.*/ + propertyChange? (e: PropertyChangeEventArgs): void; + + /**Triggers when the diagram elements are rotated*/ + rotationChange? (e: RotationChangeEventArgs): void; + + /**Triggers when the diagram is zoomed or panned*/ + scrollChange? (e: ScrollChangeEventArgs): void; + + /**Triggers when a connector segment is edited*/ + segmentChange? (e: SegmentChangeEventArgs): void; + + /**Triggers when the selection is changed in diagram*/ + selectionChange? (e: SelectionChangeEventArgs): void; + + /**Triggers when a node is resized*/ + sizeChange? (e: SizeChangeEventArgs): void; + + /**Triggers when label editing is ended*/ + textChange? (e: TextChangeEventArgs): void; +} + +export interface AutoScrollChangeEventArgs { + + /**Returns the delay between subsequent auto scrolls + */ + delay?: string; +} + +export interface ClickEventArgs { + + /**parameter returns the clicked node, connector or diagram + */ + element?: any; + + /**parameter returns the object that is actually clicked + */ + actualObject?: number; + + /**parameter returns the horizontal coordinate of the mouse pointer, relative to the diagram + */ + offsetX?: number; + + /**parameter returns the vertical coordinate of the mouse pointer, relative to the diagram + */ + offsetY?: number; + + /**parameter returns the count of how many times the mouse button is pressed + */ + count?: number; + + /**parameter returns the actual click event arguments that explains which button is clicked + */ + event?: any; +} + +export interface ConnectionChangeEventArgs { + + /**parameter returns the connection that is changed between nodes, ports or points + */ + element?: any; + + /**parameter returns the new source node or target node of the connector + */ + connection?: string; + + /**parameter returns the new source port or target port of the connector + */ + port?: any; + + /**parameter defines whether to cancel the change or not + */ + cancel?: boolean; +} + +export interface ConnectorCollectionChangeEventArgs { + + /**parameter returns whether the connector is inserted or removed + */ + changeType?: string; + + /**parameter returns the connector that is to be added or deleted + */ + element?: any; + + /**parameter defines whether to cancel the collection change or not + */ + cancel?: boolean; +} + +export interface ConnectorSourceChangeEventArgs { + + /**returns the connector, the source point of which is being dragged + */ + element?: any; + + /**returns the source node of the element + */ + node?: any; + + /**returns the source point of the element + */ + point?: any; + + /**returns the source port of the element + */ + port?: any; + + /**returns the state of connection end point dragging(starting, dragging, completed) + */ + dragState?: string; + + /**parameter defines whether to cancel the change or not + */ + cancel?: boolean; +} + +export interface ConnectorTargetChangeEventArgs { + + /**parameter returns the connector, the target point of which is being dragged + */ + element?: any; + + /**returns the target node of the element + */ + node?: any; + + /**returns the target point of the element + */ + point?: any; + + /**returns the target port of the element + */ + port?: any; + + /**returns the state of connection end point dragging(starting, dragging, completed) + */ + dragState?: string; + + /**parameter defines whether to cancel the change or not + */ + cancel?: boolean; +} + +export interface ContextMenuBeforeOpenEventArgs { + + /**parameter returns the diagram object + */ + diagram?: any; + + /**parameter returns the actual arguments from context menu + */ + contextmenu?: any; + + /**parameter returns the object that was clicked + */ + target?: any; +} + +export interface ContextMenuClickEventArgs { + + /**parameter returns the id of the selected context menu item + */ + id?: string; + + /**parameter returns the text of the selected context menu item + */ + text?: string; + + /**parameter returns the parent id of the selected context menu item + */ + parentId?: string; + + /**parameter returns the parent text of the selected context menu item + */ + parentText?: string; + + /**parameter returns the object that was clicked + */ + target?: any; + + /**parameter defines whether to execute the click event or not + */ + canExecute?: boolean; +} + +export interface DoubleClickEventArgs { + + /**parameter returns the object that is actually clicked + */ + actualObject?: any; + + /**parameter returns the selected object + */ + element?: any; +} + +export interface DragEventArgs { + + /**parameter returns the node or connector that is being dragged + */ + element?: any; + + /**parameter returns the previous position of the node/connector + */ + oldValue?: any; + + /**parameter returns the new position of the node/connector + */ + newValue?: any; + + /**parameter returns the state of drag event (Starting, dragging, completed) + */ + dragState?: string; + + /**parameter returns whether or not to cancel the drag event + */ + cancel?: boolean; +} + +export interface DragEnterEventArgs { + + /**parameter returns the node or connector that is dragged into diagram + */ + element?: any; + + /**parameter returns whether to add or remove the symbol from diagram + */ + cancel?: boolean; +} + +export interface DragLeaveEventArgs { + + /**parameter returns the node or connector that is dragged outside of the diagram + */ + element?: any; +} + +export interface DragOverEventArgs { + + /**parameter returns the node or connector that is dragged over diagram + */ + element?: any; + + /**parameter defines whether the symbol can be dropped at the current mouse position + */ + allowDrop?: boolean; + + /**parameter returns the node/connector over which the symbol is dragged + */ + target?: any; + + /**parameter returns the previous position of the node/connector + */ + oldValue?: any; + + /**parameter returns the new position of the node/connector + */ + newValue?: any; + + /**parameter returns whether or not to cancel the dragOver event + */ + cancel?: boolean; +} + +export interface DropEventArgs { + + /**parameter returns node or connector that is being dropped + */ + element?: any; + + /**parameter returns whether or not to cancel the drop event + */ + cancel?: boolean; + + /**parameter returns the object from where the element is dragged + */ + source?: any; + + /**parameter returns the object over which the object will be dropped + */ + target?: any; + + /**parameter returns the enum which defines the type of the source + */ + sourceType?: string; +} + +export interface GroupChangeEventArgs { + + /**parameter returns the object that is added to/removed from a group + */ + element?: any; + + /**parameter returns the old parent group(if any) of the object + */ + oldParent?: any; + + /**parameter returns the new parent group(if any) of the object + */ + newParent?: any; + + /**parameter returns the cause of group change("group", unGroup") + */ + cause?: string; +} + +export interface ItemClickEventArgs { + + /**parameter returns the object that was actually clicked + */ + actualObject?: any; + + /**parameter returns the object that is selected + */ + selectedObject?: any; + + /**parameter returns whether or not to cancel the drop event + */ + cancel?: boolean; + + /**parameter returns the actual click event arguments that explains which button is clicked + */ + event?: any; +} + +export interface MouseEnterEventArgs { + + /**parameter returns the target node or connector + */ + element?: any; + + /**parameter returns the object from where the selected object is dragged + */ + source?: any; + + /**parameter returns the target object over which the selected object is dragged + */ + target?: any; +} + +export interface MouseLeaveEventArgs { + + /**parameter returns the target node or connector + */ + element?: any; + + /**parameter returns the object from where the selected object is dragged + */ + source?: any; + + /**parameter returns the target object over which the selected object is dragged + */ + target?: any; +} + +export interface MouseOverEventArgs { + + /**parameter returns the target node or connector + */ + element?: any; + + /**parameter returns the object from where the element is dragged + */ + source?: any; + + /**parameter returns the object over which the element is being dragged. + */ + target?: any; +} + +export interface NodeCollectionChangeEventArgs { + + /**parameter returns whether the node is to be added or removed + */ + changeType?: string; + + /**parameter returns the node which needs to be added or deleted + */ + element?: any; + + /**parameter defines whether to cancel the collection change or not + */ + cancel?: boolean; +} + +export interface PropertyChangeEventArgs { + + /**parameter returns the selected element + */ + element?: any; + + /**parameter returns the action is nudge or not + */ + cause?: string; + + /**parameter returns the new value of the node property that is being changed + */ + newValue?: any; + + /**parameter returns the old value of the property that is being changed + */ + oldValue?: any; + + /**parameter returns the name of the property that is changed + */ + propertyName?: string; +} + +export interface RotationChangeEventArgs { + + /**parameter returns the node that is rotated + */ + element?: any; + + /**parameter returns the previous rotation angle + */ + oldValue?: any; + + /**parameter returns the new rotation angle + */ + newValue?: any; + + /**parameter to specify whether or not to cancel the event + */ + cancel?: boolean; +} + +export interface ScrollChangeEventArgs { + + /**Parameter returns the new zoom value, horizontal and vertical scroll offsets. + */ + newValues?: any; + + /**parameter returns the previous zoom value, horizontal and vertical scroll offsets. + */ + oldValues?: any; +} + +export interface SegmentChangeEventArgs { + + /**Parameter returns the connector that is being edited + */ + element?: any; + + /**parameter returns the state of editing (starting, dragging, completed) + */ + dragState?: string; + + /**parameter returns the current mouse position + */ + point?: any; + + /**parameter to specify whether or not to cancel the event + */ + cancel?: boolean; +} + +export interface SelectionChangeEventArgs { + + /**parameter returns whether the item is selected or removed selection + */ + changeType?: string; + + /**parameter returns the item which is selected or to be selected + */ + element?: any; + + /**parameter returns the collection of nodes and connectors that have to be removed from selection list + */ + oldItems?: Array; + + /**parameter returns the collection of nodes and connectors that have to be added to selection list + */ + newItems?: Array; + + /**parameter returns the collection of nodes and connectors that will be selected after selection change + */ + selectedItems?: Array; + + /**parameter to specify whether or not to cancel the selection change event + */ + cancel?: boolean; +} + +export interface SizeChangeEventArgs { + + /**parameter returns node that was resized + */ + element?: any; + + /**parameter to cancel the size change + */ + cancel?: boolean; + + /**parameter returns the new width, height, offsetX and offsetY values of the element that is being resized + */ + newValue?: any; + + /**parameter returns the previous width,height,offsetX and offsetY values of the element that is being resized + */ + oldValue?: any; + + /**parameter returns the state of resizing(starting,resizing,completed) + */ + resizeState?: string; + + /**parameter returns the difference between new and old value + */ + offset?: any; +} + +export interface TextChangeEventArgs { + + /**parameter returns the node that contains the text being edited + */ + element?: any; + + /**parameter returns the new text + */ + value?: string; + + /**parameter returns the keyCode of the key entered + */ + keyCode?: string; +} + +export interface CommandManagerCommandsGesture { + + /**Sets the key value, on recognition of which the command will be executed. + * @Default {ej.datavisualization.Diagram.Keys.None} + */ + key?: ej.datavisualization.Diagram.Keys|string; + + /**Sets a combination of key modifiers, on recognition of which the command will be executed. + * @Default {ej.datavisualization.Diagram.KeyModifiers.None} + */ + keyModifiers?: ej.datavisualization.Diagram.KeyModifiers|string; +} + +export interface CommandManagerCommands { + + /**A method that defines whether the command is executable at the moment or not. + */ + canExecute?: Function; + + /**A method that defines what to be executed when the key combination is recognized. + */ + execute?: Function; + + /**Defines a combination of keys and key modifiers, on recognition of which the command will be executed + */ + gesture?: CommandManagerCommandsGesture; + + /**Defines any additional parameters that are required at runtime + * @Default {null} + */ + parameter?: any; +} + +export interface CommandManager { + + /**An object that maps a set of command names with the corresponding command objects + * @Default {{}} + */ + commands?: CommandManagerCommands; +} + +export interface ConnectorsSegments { + + /**Sets the direction of orthogonal segment + */ + direction?: string; + + /**Describes the length of orthogonal segment + * @Default {undefined} + */ + length?: number; + + /**Describes the end point of bezier/straight segment + * @Default {Diagram.Point()} + */ + point?: ej.datavisualization.Diagram.ConnectorsSourcePoint|string; + + /**Defines the first control point of the bezier segment + * @Default {null} + */ + point1?: ej.datavisualization.Diagram.ConnectorsSourcePoint|string; + + /**Defines the second control point of bezier segment + * @Default {null} + */ + point2?: ej.datavisualization.Diagram.ConnectorsSourcePoint|string; + + /**Sets the type of the segment. + * @Default {ej.datavisualization.Diagram.Segments.Straight} + */ + type?: ej.datavisualization.Diagram.Segments|string; + + /**Describes the length and angle between the first control point and the start point of bezier segment + * @Default {null} + */ + vector1?: any; + + /**Describes the length and angle between the second control point and end point of bezier segment + * @Default {null} + */ + vector2?: any; +} + +export interface ConnectorsSourceDecorator { + + /**Sets the border color of the source decorator + * @Default {black} + */ + borderColor?: string; + + /**Sets the border width of the decorator + * @Default {1} + */ + borderWidth?: number; + + /**Sets the fill color of the source decorator + * @Default {black} + */ + fillColor?: string; + + /**Sets the height of the source decorator + * @Default {8} + */ + height?: number; + + /**Defines the custom shape of the source decorator + */ + pathData?: string; + + /**Defines the shape of the source decorator. + * @Default {ej.datavisualization.Diagram.DecoratorShapes.Arrow} + */ + shape?: ej.datavisualization.Diagram.DecoratorShapes|string; + + /**Defines the width of the source decorator + * @Default {8} + */ + width?: number; +} + +export interface ConnectorsSourcePoint { + + /**Defines the x-coordinate of a position + * @Default {0} + */ + x?: number; + + /**Defines the y-coordinate of a position + * @Default {0} + */ + y?: number; +} + +export interface ConnectorsTargetDecorator { + + /**Sets the border color of the decorator + * @Default {black} + */ + borderColor?: string; + + /**Sets the color with which the decorator will be filled + * @Default {black} + */ + fillColor?: string; + + /**Defines the height of the target decorator + * @Default {8} + */ + height?: number; + + /**Defines the custom shape of the target decorator + */ + pathData?: string; + + /**Defines the shape of the target decorator. + * @Default {ej.datavisualization.Diagram.DecoratorShapes.Arrow} + */ + shape?: ej.datavisualization.Diagram.DecoratorShapes|string; + + /**Defines the width of the target decorator + * @Default {8} + */ + width?: number; +} + +export interface Connectors { + + /**To maintain additional information about connectors + * @Default {null} + */ + addInfo?: any; + + /**Defines the width of the line bridges + * @Default {10} + */ + bridgeSpace?: number; + + /**Enables or disables the behaviors of connectors. + * @Default {ej.datavisualization.Diagram.ConnectorConstraints.Default} + */ + constraints?: ej.datavisualization.Diagram.ConnectorConstraints|string; + + /**Defines the radius of the rounded corner + * @Default {0} + */ + cornerRadius?: number; + + /**Configures the styles of shapes + */ + cssClass?: string; + + /**Sets the horizontal alignment of the connector. Applicable, if the parent of the connector is a container. + * @Default {ej.datavisualization.Diagram.HorizontalAlignment.Left} + */ + horizontalAlign?: ej.datavisualization.Diagram.HorizontalAlignment|string; + + /**A collection of JSON objects where each object represents a label. For label properties, refer Labels + * @Default {[]} + */ + labels?: Array; + + /**Sets the stroke color of the connector + * @Default {black} + */ + lineColor?: string; + + /**Sets the pattern of dashes and gaps used to stroke the path of the connector + */ + lineDashArray?: string; + + /**Defines the padding value to ease the interaction with connectors + * @Default {10} + */ + lineHitPadding?: number; + + /**Sets the width of the line + * @Default {1} + */ + lineWidth?: number; + + /**Defines the minimum space to be left between the bottom of parent bounds and the connector. Applicable, if the parent is a container. + * @Default {0} + */ + marginBottom?: number; + + /**Defines the minimum space to be left between the left of parent bounds and the connector. Applicable, if the parent is a container. + * @Default {0} + */ + marginLeft?: number; + + /**Defines the minimum space to be left between the right of parent bounds and the connector. Applicable, if the parent is a container. + * @Default {0} + */ + marginRight?: number; + + /**Defines the minimum space to be left between the top of parent bounds and the connector. Applicable, if the parent is a container. + * @Default {0} + */ + marginTop?: number; + + /**Sets a unique name for the connector + */ + name?: string; + + /**Defines the transparency of the connector + * @Default {1} + */ + opacity?: number; + + /**Defines the size and preview size of the node to add that to symbol palette. To explore palette item, refer Palette Item + * @Default {null} + */ + paletteItem?: any; + + /**Sets the parent name of the connector. + */ + parent?: string; + + /**An array of JSON objects where each object represents a segment + * @Default {[ { type:straight } ]} + */ + segments?: Array; + + /**Defines the source decorator of the connector + * @Default {{ shape:arrow, width: 8, height:8, borderColor:black, fillColor:black }} + */ + sourceDecorator?: ConnectorsSourceDecorator; + + /**Sets the source node of the connector + */ + sourceNode?: string; + + /**Defines the space to be left between the source node and the source point of a connector + * @Default {0} + */ + sourcePadding?: number; + + /**Describes the start point of the connector + * @Default {ej.datavisualization.Diagram.Point()} + */ + sourcePoint?: ConnectorsSourcePoint; + + /**Sets the source port of the connector + */ + sourcePort?: string; + + /**Defines the target decorator of the connector + * @Default {{ shape:arrow, width: 8, height:8, borderColor:black, fillColor:black }} + */ + targetDecorator?: ConnectorsTargetDecorator; + + /**Sets the target node of the connector + */ + targetNode?: string; + + /**Defines the space to be left between the target node and the target point of the connector + * @Default {0} + */ + targetPadding?: number; + + /**Describes the end point of the connector + * @Default {ej.datavisualization.Diagram.Point()} + */ + targetPoint?: ej.datavisualization.Diagram.ConnectorsSourcePoint|string; + + /**Sets the targetPort of the connector + */ + targetPort?: string; + + /**Defines the tooltip that should be shown when the mouse hovers over connector. For tooltip properties, refer Tooltip + * @Default {null} + */ + tooltip?: any; + + /**To set the vertical alignment of connector (Applicable,if the parent is group). + * @Default {ej.datavisualization.Diagram.VerticalAlignment.Top} + */ + verticalAlign?: ej.datavisualization.Diagram.VerticalAlignment|string; + + /**Enables or disables the visibility of connector + * @Default {true} + */ + visible?: boolean; + + /**Sets the z-index of the connector + * @Default {0} + */ + zOrder?: number; +} + +export interface ContextMenu { + + /**Defines the collection of context menu items + * @Default {[]} + */ + items?: Array; + + /**To set whether to display the default context menu items or not + * @Default {false} + */ + showCustomMenuItemsOnly?: boolean; +} + +export interface DataSourceSettings { + + /**Defines the data source either as a collection of objects or as an instance of ej.DataManager + * @Default {null} + */ + dataSource?: any; + + /**Sets the unique id of the data source items + */ + id?: string; + + /**Defines the parent id of the data source item + * @Default {''} + */ + parent?: string; + + /**Describes query to retrieve a set of data from the specified datasource + * @Default {null} + */ + query?: string; + + /**Sets the unique id of the root data source item + */ + root?: string; + + /**Describes the name of the table on which the specified query has to be executed + * @Default {null} + */ + tableName?: string; +} + +export interface DefaultSettings { + + /**Initializes the default connector properties + * @Default {null} + */ + connector?: any; + + /**Initializes the default properties of groups + * @Default {null} + */ + group?: any; + + /**Initializes the default properties for nodes + * @Default {null} + */ + node?: any; +} + +export interface HistoryManager { + + /**A method that takes a history entry as argument and returns whether the specific entry can be popped or not + */ + canPop?: Function; + + /**A method that ends grouping the changes + */ + closeGroupAction?: Function; + + /**A method that removes the history of a recent change made in diagram + */ + pop?: Function; + + /**A method that allows to track the custom changes made in diagram + */ + push?: Function; + + /**Defines what should be happened while trying to restore a custom change + * @Default {null} + */ + redo?: Function; + + /**A method that starts to group the changes to revert/restore them in a single undo or redo + */ + startGroupAction?: Function; + + /**Defines what should be happened while trying to revert a custom change + */ + undo?: Function; +} + +export interface Layout { + + /**Defines the fixed node with reference to which, the layout will be arranged and fixed node will not be repositioned + */ + fixedNode?: string; + + /**Customizes the orientation of trees/sub trees. For orientations, see Chart Orientations. For chart types, see Chart Types + * @Default {null} + */ + getLayoutInfo?: any; + + /**Sets the space to be horizontally left between nodes + * @Default {30} + */ + horizontalSpacing?: number; + + /**Sets the margin value to be horizontally left between the layout and diagram + * @Default {0} + */ + marginX?: number; + + /**Sets the margin value to be vertically left between layout and diagram + * @Default {0} + */ + marginY?: number; + + /**Sets the orientation/direction to arrange the diagram elements. + * @Default {ej.datavisualization.Diagram.LayoutOrientations.TopToBottom} + */ + orientation?: ej.datavisualization.Diagram.LayoutOrientations|string; + + /**Sets the type of the layout based on which the elements will be arranged. + * @Default {ej.datavisualization.Diagram.LayoutTypes.None} + */ + type?: ej.datavisualization.Diagram.LayoutTypes|string; + + /**Sets the space to be vertically left between nodes + * @Default {30} + */ + verticalSpacing?: number; +} + +export interface NodesContainer { + + /**Defines the orientation of the container. Applicable, if the group is a container. + * @Default {vertical} + */ + orientation?: string; + + /**Sets the type of the container. Applicable if the group is a container. + * @Default {ej.datavisualization.Diagram.ContainerType.Canvas} + */ + type?: ej.datavisualization.Diagram.ContainerType|string; +} + +export interface NodesGradientLinearGradient { + + /**Defines the different colors and the region of color transitions + * @Default {[]} + */ + stops?: Array; + + /**Defines the left most position(relative to node) of the rectangular region that needs to be painted + * @Default {0} + */ + x1?: number; + + /**Defines the right most position(relative to node) of the rectangular region that needs to be painted + * @Default {0} + */ + x2?: number; + + /**Defines the top most position(relative to node) of the rectangular region that needs to be painted + * @Default {0} + */ + y1?: number; + + /**Defines the bottom most position(relative to node) of the rectangular region that needs to be painted + * @Default {0} + */ + y2?: number; +} + +export interface NodesGradientRadialGradient { + + /**Defines the position of the outermost circle + * @Default {0} + */ + cx?: number; + + /**Defines the outer most circle of the radial gradient + * @Default {0} + */ + cy?: number; + + /**Defines the innermost circle of the radial gradient + * @Default {0} + */ + fx?: number; + + /**Defines the innermost circle of the radial gradient + * @Default {0} + */ + fy?: number; + + /**Defines the different colors and the region of color transitions. + * @Default {[]} + */ + stops?: Array; +} + +export interface NodesGradientStop { + + /**Sets the color to be filled over the specified region + */ + color?: string; + + /**Sets the position where the previous color transition ends and a new color transition starts + * @Default {0} + */ + offset?: number; + + /**Describes the transparency level of the region + * @Default {1} + */ + opacity?: number; +} + +export interface NodesGradient { + + /**Paints the node with linear color transitions + */ + LinearGradient?: NodesGradientLinearGradient; + + /**Paints the node with radial color transitions. A focal point defines the beginning of the gradient, and a circle defines the end point of the gradient. + */ + RadialGradient?: NodesGradientRadialGradient; + + /**Defines the color and a position where the previous color transition ends and a new color transition starts + */ + Stop?: NodesGradientStop; +} + +export interface NodesLabels { + + /**Enables/disables the bold style + * @Default {false} + */ + bold?: boolean; + + /**Sets the border color of the label + * @Default {transparent} + */ + borderColor?: string; + + /**Sets the border width of the label + * @Default {0} + */ + borderWidth?: number; + + /**Sets the fill color of the text area + * @Default {transparent} + */ + fillColor?: string; + + /**Sets the font color of the text + * @Default {black} + */ + fontColor?: string; + + /**Sets the font family of the text + * @Default {Arial} + */ + fontFamily?: string; + + /**Defines the font size of the text + * @Default {12} + */ + fontSize?: number; + + /**Sets the horizontal alignment of the label. + * @Default {ej.datavisualization.Diagram.HorizontalAlignment.Center} + */ + horizontalAlignment?: ej.datavisualization.Diagram.HorizontalAlignment|string; + + /**Enables/disables the italic style + * @Default {false} + */ + italic?: boolean; + + /**To set the margin of the label + * @Default {ej.datavisualization.Diagram.Margin()} + */ + margin?: any; + + /**Gets whether the label is currently being edited or not. + * @Default {ej.datavisualization.Diagram.LabelEditMode.Edit} + */ + mode?: ej.datavisualization.Diagram.LabelEditMode|string; + + /**Sets the unique identifier of the label + */ + name?: string; + + /**Sets the fraction/ratio(relative to node) that defines the position of the label + * @Default {ej.datavisualization.Diagram.Point(0.5, 0.5)} + */ + offset?: any; + + /**Defines whether the label is editable or not + * @Default {false} + */ + readOnly?: boolean; + + /**Defines the angle to which the label needs to be rotated + * @Default {0} + */ + rotateAngle?: number; + + /**Defines the label text + */ + text?: string; + + /**Defines how to align the text inside the label. + * @Default {ej.datavisualization.Diagram.TextAlign.Center} + */ + textAlign?: ej.datavisualization.Diagram.TextAlign|string; + + /**Sets how to decorate the label text. + * @Default {ej.datavisualization.Diagram.TextDecorations.None} + */ + textDecoration?: ej.datavisualization.Diagram.TextDecorations|string; + + /**Sets the vertical alignment of the label. + * @Default {ej.datavisualization.Diagram.VerticalAlignment.Center} + */ + verticalAlignment?: ej.datavisualization.Diagram.VerticalAlignment|string; + + /**Enables or disables the visibility of the label + * @Default {true} + */ + visible?: boolean; + + /**Sets the width of the label(the maximum value of label width and the node width will be considered as label width) + * @Default {50} + */ + width?: number; + + /**Defines how the label text needs to be wrapped. + * @Default {ej.datavisualization.Diagram.TextWrapping.WrapWithOverflow} + */ + wrapping?: ej.datavisualization.Diagram.TextWrapping|string; +} + +export interface NodesLanes { + + /**Allows to maintain additional information about lane + * @Default {{}} + */ + addInfo?: any; + + /**An array of objects where each object represents a child node of the lane + * @Default {[]} + */ + children?: Array; + + /**Defines the fill color of the lane + * @Default {white} + */ + fillColor?: string; + + /**Defines the header of the lane + * @Default {{ text: Function, fontSize: 11 }} + */ + header?: any; + + /**Defines the object as a lane + * @Default {false} + */ + isLane?: boolean; + + /**Sets the unique identifier of the lane + */ + name?: string; + + /**Sets the orientation of the lane. + * @Default {vertical} + */ + orientation?: string; +} + +export interface NodesPaletteItem { + + /**Defines whether the symbol should be drawn at its actual size regardless of precedence factors or not + * @Default {true} + */ + enableScale?: boolean; + + /**Defines the height of the symbol + * @Default {0} + */ + height?: number; + + /**Defines the margin of the symbol item + * @Default {{ left: 4, right: 4, top: 4, bottom: 4 }} + */ + margin?: any; + + /**Defines the preview height of the symbol + * @Default {undefined} + */ + previewHeight?: number; + + /**Defines the preview width of the symbol + * @Default {undefined} + */ + previewWidth?: number; + + /**Defines the width of the symbol + * @Default {0} + */ + width?: number; +} + +export interface NodesPhases { + + /**Defines the header of the smaller regions + * @Default {null} + */ + label?: any; + + /**Defines the line color of the splitter that splits adjacent phases. + * @Default {#606060} + */ + lineColor?: string; + + /**Sets the dash array that used to stroke the phase splitter + * @Default {3,3} + */ + lineDashArray?: string; + + /**Sets the lineWidth of the phase + * @Default {1} + */ + lineWidth?: number; + + /**Sets the unique identifier of the phase + */ + name?: string; + + /**Sets the length of the smaller region(phase) of a swimlane + * @Default {100} + */ + offset?: number; + + /**Sets the orientation of the phase + * @Default {horizontal} + */ + orientation?: string; + + /**Sets the type of the object as phase + * @Default {phase} + */ + type?: string; +} + +export interface NodesPorts { + + /**Sets the border color of the port + * @Default {#1a1a1a} + */ + borderColor?: string; + + /**Sets the stroke width of the port + * @Default {1} + */ + borderWidth?: number; + + /**Defines the space to be left between the port bounds and its incoming and outgoing connections. + * @Default {0} + */ + connectorPadding?: number; + + /**Defines whether connections can be created with the port + * @Default {ej.datavisualization.Diagram.PortConstraints.Connect} + */ + constraints?: ej.datavisualization.Diagram.PortConstraints|string; + + /**Sets the fill color of the port + * @Default {white} + */ + fillColor?: string; + + /**Sets the unique identifier of the port + */ + name?: string; + + /**Defines the position of the port as fraction/ ratio relative to node + * @Default {ej.datavisualization.Diagram.Point(0, 0)} + */ + offset?: any; + + /**Defines the path data to draw the port. Applicable, if the port shape is path. + */ + pathData?: string; + + /**Defines the shape of the port. + * @Default {ej.datavisualization.Diagram.PortShapes.Square} + */ + shape?: ej.datavisualization.Diagram.PortShapes|string; + + /**Defines the size of the port + * @Default {8} + */ + size?: number; + + /**Defines when the port should be visible. + * @Default {ej.datavisualization.Diagram.PortVisibility.Default} + */ + visibility?: ej.datavisualization.Diagram.PortVisibility|string; +} + +export interface NodesShadow { + + /**Defines the angle of the shadow relative to node + * @Default {45} + */ + angle?: number; + + /**Sets the distance to move the shadow relative to node + * @Default {5} + */ + distance?: number; + + /**Defines the opaque of the shadow + * @Default {0.7} + */ + opacity?: number; +} + +export interface NodesSubProcess { + + /**Defines whether the bpmn sub process is without any prescribed order or not + * @Default {false} + */ + adhoc?: boolean; + + /**Sets the boundary of the BPMN process + * @Default {ej.datavisualization.Diagram.BPMNBoundary.Default} + */ + boundary?: ej.datavisualization.Diagram.BPMNBoundary|string; + + /**Sets whether the bpmn subprocess is triggered as a compensation of a specific activity + * @Default {false} + */ + compensation?: boolean; + + /**Defines the loop type of a sub process. + * @Default {ej.datavisualization.Diagram.BPMNLoops.None} + */ + loop?: ej.datavisualization.Diagram.BPMNLoops|string; +} + +export interface NodesTask { + + /**To set whether the task is a global task or not + * @Default {false} + */ + call?: boolean; + + /**Sets whether the task is triggered as a compensation of another specific activity + * @Default {false} + */ + compensation?: boolean; + + /**Sets the loop type of a bpmn task. + * @Default {ej.datavisualization.Diagram.BPMNLoops.None} + */ + loop?: ej.datavisualization.Diagram.BPMNLoops|string; + + /**Sets the type of the BPMN task. + * @Default {ej.datavisualization.Diagram.BPMNTasks.None} + */ + type?: ej.datavisualization.Diagram.BPMNTasks|string; +} + +export interface Nodes { + + /**Defines the type of BPMN Activity. Applicable, if the node is a bpmn activity. + * @Default {ej.datavisualization.Diagram.BPMNActivity.Task} + */ + activity?: ej.datavisualization.Diagram.BPMNActivity|string; + + /**To maintain additional information about nodes + * @Default {{}} + */ + addInfo?: any; + + /**Sets the border color of node + * @Default {black} + */ + borderColor?: string; + + /**Sets the pattern of dashes and gaps to stroke the border + */ + borderDashArray?: string; + + /**Sets the border width of the node + * @Default {1} + */ + borderWidth?: number; + + /**Defines whether the group can be ungrouped or not + * @Default {true} + */ + canUngroup?: boolean; + + /**Array of JSON objects where each object represents a child node/connector + * @Default {[]} + */ + children?: Array; + + /**Defines whether the BPMN data object is a collection or not + * @Default {false} + */ + collection?: boolean; + + /**Defines the distance to be left between a node and its connections(In coming and out going connections). + * @Default {0} + */ + connectorPadding?: number; + + /**Enables or disables the default behaviors of the node. + * @Default {ej.datavisualization.Diagram.NodeConstraints.Default} + */ + constraints?: ej.datavisualization.Diagram.NodeConstraints|string; + + /**Defines how the child objects need to be arranged(Either in any predefined manner or automatically). Applicable, if the node is a group. + * @Default {null} + */ + container?: NodesContainer; + + /**Defines the corner radius of rectangular shapes. + * @Default {0} + */ + cornerRadius?: number; + + /**Configures the styles of shapes + */ + cssClass?: string; + + /**Sets the type of the BPMN Events. Applicable, if the node is a bpmn event. + * @Default {ej.datavisualization.Diagram.BPMNEvents.Start} + */ + event?: ej.datavisualization.Diagram.BPMNEvents|string; + + /**Defines whether the node can be automatically arranged using layout or not + * @Default {false} + */ + excludeFromLayout?: boolean; + + /**Defines the fill color of the node + * @Default {white} + */ + fillColor?: string; + + /**Sets the type of the BPMN Gateway. Applicable, if the node is a bpmn gateway. + * @Default {ej.datavisualization.Diagram.BPMNGateways.None} + */ + gateway?: ej.datavisualization.Diagram.BPMNGateways|string; + + /**Paints the node with a smooth transition from one color to another color + */ + gradient?: NodesGradient; + + /**Defines the header of a swimlane/lane + * @Default {{ text: Title, fontSize: 11 }} + */ + header?: any; + + /**Defines the height of the node + * @Default {0} + */ + height?: number; + + /**Sets the horizontal alignment of the node. Applicable, if the parent of the node is a container. + * @Default {ej.datavisualization.Diagram.HorizontalAlignment.Left} + */ + horizontalAlign?: ej.datavisualization.Diagram.HorizontalAlignment|string; + + /**A read only collection of the incoming connectors/edges of the node + * @Default {[]} + */ + inEdges?: Array; + + /**Defines whether the sub tree of the node is expanded or collapsed + * @Default {true} + */ + isExpanded?: boolean; + + /**Sets the node as a swimlane + * @Default {false} + */ + isSwimlane?: boolean; + + /**A collection of objects where each object represents a label + * @Default {[]} + */ + labels?: Array; + + /**An array of objects where each object represents a lane. Applicable, if the node is a swimlane. + * @Default {[]} + */ + lanes?: Array; + + /**Defines the minimum space to be left between the bottom of parent bounds and the node. Applicable, if the parent is a container. + * @Default {0} + */ + marginBottom?: number; + + /**Defines the minimum space to be left between the left of parent bounds and the node. Applicable, if the parent is a container. + * @Default {0} + */ + marginLeft?: number; + + /**Defines the minimum space to be left between the right of the parent bounds and the node. Applicable, if the parent is a container. + * @Default {0} + */ + marginRight?: number; + + /**Defines the minimum space to be left between the top of parent bounds and the node. Applicable, if the parent is a container. + * @Default {0} + */ + marginTop?: number; + + /**Defines the maximum height limit of the node + * @Default {0} + */ + maxHeight?: number; + + /**Defines the maximum width limit of the node + * @Default {0} + */ + maxWidth?: number; + + /**Defines the minimum height limit of the node + * @Default {0} + */ + minHeight?: number; + + /**Defines the minimum width limit of the node + * @Default {0} + */ + minWidth?: number; + + /**Sets the unique identifier of the node + */ + name?: string; + + /**Defines the position of the node on X-Axis + * @Default {0} + */ + offsetX?: number; + + /**Defines the position of the node on Y-Axis + * @Default {0} + */ + offsetY?: number; + + /**Defines the opaque of the node + * @Default {1} + */ + opacity?: number; + + /**Defines the orientation of nodes. Applicable, if the node is a swimlane. + * @Default {vertical} + */ + orientation?: string; + + /**A read only collection of outgoing connectors/edges of the node + * @Default {[]} + */ + outEdges?: Array; + + /**Defines the minimum padding value to be left between the bottom most position of a group and its children. Applicable, if the group is a container. + * @Default {0} + */ + paddingBottom?: number; + + /**Defines the minimum padding value to be left between the left most position of a group and its children. Applicable, if the group is a container. + * @Default {0} + */ + paddingLeft?: number; + + /**Defines the minimum padding value to be left between the right most position of a group and its children. Applicable, if the group is a container. + * @Default {0} + */ + paddingRight?: number; + + /**Defines the minimum padding value to be left between the top most position of a group and its children. Applicable, if the group is a container. + * @Default {0} + */ + paddingTop?: number; + + /**Defines the size and preview size of the node to add that to symbol palette + * @Default {null} + */ + paletteItem?: NodesPaletteItem; + + /**Sets the name of the parent group + */ + parent?: string; + + /**Sets the path geometry that defines the shape of a path node + */ + pathData?: string; + + /**An array of objects, where each object represents a smaller region(phase) of a swimlane. + * @Default {[]} + */ + phases?: Array; + + /**Sets the height of the phase headers + * @Default {0} + */ + phaseSize?: number; + + /**Sets the ratio/ fractional value relative to node, based on which the node will be transformed(positioning, scaling and rotation) + * @Default {ej.datavisualization.Diagram.Points(0.5,0.5)} + */ + pivot?: any; + + /**Defines a collection of points to draw a polygon. Applicable, if the shape is a polygon. + * @Default {[]} + */ + points?: Array; + + /**An array of objects where each object represents a port + * @Default {[]} + */ + ports?: Array; + + /**Sets the angle to which the node should be rotated + * @Default {0} + */ + rotateAngle?: number; + + /**Defines the opacity and the position of shadow + * @Default {ej.datavisualization.Diagram.Shadow()} + */ + shadow?: NodesShadow; + + /**Sets the shape of the node. It depends upon the type of node. + * @Default {ej.datavisualization.Diagram.BasicShapes.Rectangle} + */ + shape?: ej.datavisualization.Diagram.BasicShapes|string; + + /**Sets the source path of the image. Applicable, if the type of the node is image. + */ + source?: string; + + /**Defines the sub process of a BPMN Activity. Applicable, if the type of the bpmn activity is sub process. + * @Default {ej.datavisualization.Diagram.BPMNSubProcess()} + */ + subProcess?: NodesSubProcess; + + /**Defines the task of the bpmn activity. Applicable, if the type of activity is set as task. + * @Default {ej.datavisualization.Diagram.BPMNTask()} + */ + task?: NodesTask; + + /**Sets the id of svg/html templates. Applicable, if the node is html or native. + */ + templateId?: string; + + /**Defines the textBlock of a text node + * @Default {null} + */ + textBlock?: any; + + /**Defines the tooltip that should be shown when the mouse hovers over node. For tooltip properties, refer Tooltip + * @Default {null} + */ + tooltip?: any; + + /**Sets the type of BPMN Event Triggers. + * @Default {ej.datavisualization.Diagram.BPMNTriggers.None} + */ + trigger?: ej.datavisualization.Diagram.BPMNTriggers|string; + + /**Defines the type of the node. + * @Default {ej.datavisualization.Diagram.Shapes.Basic} + */ + type?: ej.datavisualization.Diagram.Shapes|string; + + /**Sets the vertical alignment of a node. Applicable, if the parent of a node is a container. + * @Default {ej.datavisualization.Diagram.VerticalAlignment.Top} + */ + verticalAlign?: ej.datavisualization.Diagram.VerticalAlignment|string; + + /**Defines the visibility of the node + * @Default {true} + */ + visible?: boolean; + + /**Defines the width of the node + * @Default {0} + */ + width?: number; + + /**Defines the z-index of the node + * @Default {0} + */ + zOrder?: number; +} + +export interface PageSettings { + + /**Defines the maximum distance to be left between the object and the scroll bar to trigger auto scrolling + * @Default {{ left: 15, top: 15, right: 15, bottom: 15 }} + */ + autoScrollBorder?: any; + + /**Sets whether multiple pages can be created to fit all nodes and connectors + * @Default {false} + */ + multiplePage?: boolean; + + /**Defines the background color of diagram pages + * @Default {#ffffff} + */ + pageBackgroundColor?: string; + + /**Defines the page border color + * @Default {#565656} + */ + pageBorderColor?: string; + + /**Sets the border width of diagram pages + * @Default {0} + */ + pageBorderWidth?: number; + + /**Defines the height of a page + * @Default {null} + */ + pageHeight?: number; + + /**Defines the page margin + * @Default {24} + */ + pageMargin?: number; + + /**Sets the orientation of the page. + * @Default {ej.datavisualization.Diagram.PageOrientations.Portrait} + */ + pageOrientation?: ej.datavisualization.Diagram.PageOrientations|string; + + /**Defines the height of a diagram page + * @Default {null} + */ + pageWidth?: number; + + /**Defines the scrollable area of diagram. Applicable, if the scroll limit is "limited". + * @Default {null} + */ + scrollableArea?: any; + + /**Defines the scrollable region of diagram. + * @Default {ej.datavisualization.Diagram.ScrollLimit.Infinite} + */ + scrollLimit?: ej.datavisualization.Diagram.ScrollLimit|string; + + /**Enables or disables the page breaks + * @Default {false} + */ + showPageBreak?: boolean; +} + +export interface ScrollSettings { + + /**Allows to read the zoom value of diagram + * @Default {0} + */ + currentZoom?: number; + + /**Sets the horizontal scroll offset + * @Default {0} + */ + horizontalOffset?: number; + + /**Allows to extend the scrollable region that is based on the scroll limit + * @Default {{left: 0, right: 0, top:0, bottom: 0}} + */ + padding?: any; + + /**Sets the vertical scroll offset + * @Default {0} + */ + verticalOffset?: number; + + /**Allows to read the view port height of the diagram + * @Default {0} + */ + viewPortHeight?: number; + + /**Allows to read the view port width of the diagram + * @Default {0} + */ + viewPortWidth?: number; +} + +export interface SelectedItems { + + /**A read only collection of the selected items + * @Default {[]} + */ + children?: Array; + + /**Controls the visibility of selector. + * @Default {ej.datavisualization.Diagram.SelectorConstraints.All} + */ + constraints?: ej.datavisualization.Diagram.SelectorConstraints|string; + + /**Defines a method that dynamically enables/ disables the interaction with multiple selection. + * @Default {null} + */ + getConstraints?: any; + + /**Sets the height of the selected items + * @Default {0} + */ + height?: number; + + /**Sets the x position of the selector + * @Default {0} + */ + offsetX?: number; + + /**Sets the y position of the selector + * @Default {0} + */ + offsetY?: number; + + /**Sets the angle to rotate the selected items + * @Default {0} + */ + rotateAngle?: number; + + /**Sets the angle to rotate the selected items. For tooltip properties, refer Tooltip + * @Default {ej.datavisualization.Diagram.Tooltip()} + */ + tooltip?: any; + + /**A collection of frequently using commands that have to be added around the selector. + * @Default {[]} + */ + userHandles?: Array; + + /**Sets the width of the selected items + * @Default {0} + */ + width?: number; +} + +export interface SnapSettingsHorizontalGridLines { + + /**Defines the line color of horizontal grid lines + * @Default {lightgray} + */ + lineColor?: string; + + /**Specifies the pattern of dashes and gaps used to stroke horizontal grid lines + */ + lineDashArray?: string; + + /**A pattern of lines and gaps that defines a set of horizontal gridlines + * @Default {[1.25, 18.75, 0.25, 19.75, 0.25, 19.75, 0.25, 19.75, 0.25, 19.75]} + */ + linesInterval?: Array; + + /**Specifies a set of intervals to snap the objects + * @Default {[20]} + */ + snapInterval?: Array; +} + +export interface SnapSettingsVerticalGridLines { + + /**Defines the line color of horizontal grid lines + * @Default {lightgray} + */ + lineColor?: string; + + /**Specifies the pattern of dashes and gaps used to stroke horizontal grid lines + */ + lineDashArray?: string; + + /**A pattern of lines and gaps that defines a set of horizontal gridlines + * @Default {[1.25, 18.75, 0.25, 19.75, 0.25, 19.75, 0.25, 19.75, 0.25, 19.75]} + */ + linesInterval?: Array; + + /**Specifies a set of intervals to snap the objects + * @Default {[20]} + */ + snapInterval?: Array; +} + +export interface SnapSettings { + + /**Enables or disables snapping nodes/connectors to objects + * @Default {true} + */ + enableSnapToObject?: boolean; + + /**Defines the appearance of horizontal gridlines + */ + horizontalGridLines?: SnapSettingsHorizontalGridLines; + + /**Defines the angle by which the object needs to be snapped + * @Default {5} + */ + snapAngle?: number; + + /**Defines the minimum distance between the selected object and the nearest object + * @Default {5} + */ + snapObjectDistance?: number; + + /**Defines the appearance of horizontal gridlines + */ + verticalGridLines?: SnapSettingsVerticalGridLines; +} + +export interface TooltipAlignment { + + /**Defines the horizontal alignment of tooltip. + * @Default {ej.datavisualization.Diagram.HorizontalAlignment.Center} + */ + horizontal?: ej.datavisualization.Diagram.HorizontalAlignment|string; + + /**Defines the vertical alignment of tooltip. + * @Default {ej.datavisualization.Diagram.VerticalAlignment.Bottom} + */ + vertical?: ej.datavisualization.Diagram.VerticalAlignment|string; +} + +export interface Tooltip { + + /**Aligns the tooltip around nodes/connectors + */ + alignment?: TooltipAlignment; + + /**Sets the margin of the tooltip + * @Default {{ left: 5, right: 5, top: 5, bottom: 5 }} + */ + margin?: any; + + /**Defines whether the tooltip should be shown at the mouse position or around node. + * @Default {ej.datavisualization.Diagram.RelativeMode.Object} + */ + relativeMode?: ej.datavisualization.Diagram.RelativeMode|string; + + /**Sets the svg/html template to be bound with tooltip + */ + templateId?: string; +} +} +module Diagram +{ +enum BridgeDirection +{ +//Used to set the direction of line bridges as left +Left, +//Used to set the direction of line bridges as right +Right, +//Used to set the direction of line bridges as top +Top, +//Used to set the direction of line bridges as bottom +Bottom, +} +} +module Diagram +{ +enum Keys +{ +//No key pressed. +None, +//The A key. +A, +//The B key. +B, +//The C key. +C, +//The D Key. +D, +//The E key. +E, +//The F key. +F, +//The G key. +G, +//The H Key. +H, +//The I key. +I, +//The J key. +J, +//The K key. +K, +//The L Key. +L, +//The M key. +M, +//The N key. +N, +//The O key. +O, +//The P Key. +P, +//The Q key. +Q, +//The R key. +R, +//The S key. +S, +//The T Key. +T, +//The U key. +U, +//The V key. +V, +//The W key. +W, +//The X key. +X, +//The Y key. +Y, +//The Z key. +Z, +//The 0 key. +Number0, +//The 1 key. +Number1, +//The 2 key. +Number2, +//The 3 key. +Number3, +//The 4 key. +Number4, +//The 5 key. +Number5, +//The 6 key. +Number6, +//The 7 key. +Number7, +//The 8 key. +Number8, +//The 9 key. +Number9, +//The LEFT ARROW key. +Left, +//The UP ARROW key. +Up, +//The RIGHT ARROW key. +Right, +//The DOWN ARROW key. +Down, +//The ESC key. +Escape, +//The DEL key. +Delete, +//The TAB key. +Tab, +//The ENTER key. +Enter, +} +} +module Diagram +{ +enum KeyModifiers +{ +//No modifiers are pressed. +None, +//The ALT key. +Alt, +//The CTRL key. +Control, +//The SHIFT key. +Shift, +} +} +module Diagram +{ +enum ConnectorConstraints +{ +//Disable all connector Constraints +None, +//Enables connector to be selected +Select, +//Enables connector to be Deleted +Delete, +//Enables connector to be Dragged +Drag, +//Enables connectors source end to be selected +DragSourceEnd, +//Enables connectors target end to be selected +DragTargetEnd, +//Enables control point and end point of every segment in a connector for editing +DragSegmentThumb, +//Enables bridging to the connector +Bridging, +//Enables label of node to be Dragged +DragLabel, +//Enables bridging to the connector +InheritBridging, +//Enables all constraints +Default, +} +} +module Diagram +{ +enum HorizontalAlignment +{ +//Used to align text horizontally on left side of node/connector +Left, +//Used to align text horizontally on center of node/connector +Center, +//Used to align text horizontally on right side of node/connector +Right, +} +} +module Diagram +{ +enum Segments +{ +//Used to specify the lines as Straight +Straight, +//Used to specify the lines as Orthogonal +Orthogonal, +//Used to specify the lines as Bezier +Bezier, +} +} +module Diagram +{ +enum DecoratorShapes +{ +//Used to set decorator shape as none +None, +//Used to set decorator shape as Arrow +Arrow, +//Used to set decorator shape as Open Arrow +OpenArrow, +//Used to set decorator shape as Circle +Circle, +//Used to set decorator shape as Diamond +Diamond, +//Used to set decorator shape as path +Path, +} +} +module Diagram +{ +enum VerticalAlignment +{ +//Used to align text Vertically on left side of node/connector +Top, +//Used to align text Vertically on center of node/connector +Center, +//Used to align text Vertically on bottom of node/connector +Bottom, +} +} +module Diagram +{ +enum DiagramConstraints +{ +//Disables all DiagramConstraints +None, +//Enables/Disables PageEditing +PageEditable, +//Enables/Disables Bridging +Bridging, +//Enables/Disables Zooming +Zoomable, +//Enables/Disables panning on horizontal axis +PannableX, +//Enables/Disables panning on vertical axis +PannableY, +//Enables/Disables Panning +Pannable, +//Enables/Disables undo actions +Undoable, +//Enables all Constraints +Default, +} +} +module Diagram +{ +enum LayoutOrientations +{ +//Used to set LayoutOrientation from top to bottom +TopToBottom, +//Used to set LayoutOrientation from bottom to top +BottomToTop, +//Used to set LayoutOrientation from left to right +LeftToRight, +//Used to set LayoutOrientation from right to left +RightToLeft, +} +} +module Diagram +{ +enum LayoutTypes +{ +//Used not to set any specific layout +None, +//Used to set layout type as hierarchical layout +HierarchicalTree, +//Used to set layout type as organnizational chart +OrganizationalChart, +} +} +module Diagram +{ +enum BPMNActivity +{ +//Used to set BPMN Activity as None +None, +//Used to set BPMN Activity as Task +Task, +//Used to set BPMN Activity as SubProcess +SubProcess, +} +} +module Diagram +{ +enum NodeConstraints +{ +//Disable all node Constraints +None, +//Enables node to be selected +Select, +//Enables node to be Deleted +Delete, +//Enables node to be Dragged +Drag, +//Enables node to be Rotated +Rotate, +//Enables node to be connected +Connect, +//Enables node to be resize north east +ResizeNorthEast, +//Enables node to be resize east +ResizeEast, +//Enables node to be resize south east +ResizeSouthEast, +//Enables node to be resize south +ResizeSouth, +//Enables node to be resize south west +ResizeSouthWest, +//Enables node to be resize west +ResizeWest, +//Enables node to be resize north west +ResizeNorthWest, +//Enables node to be resize north +ResizeNorth, +//Enables node to be Resized +Resize, +//Enables shadow +Shadow, +//Enables label of node to be Dragged +DragLabel, +//Enables panning should be done while node dragging +AllowPan, +//Enables Proportional resize for node +AspectRatio, +//Enables all node constraints +Default, +} +} +module Diagram +{ +enum ContainerType +{ +//Sets the container type as Canvas +Canvas, +//Sets the container type as Stack +Stack, +} +} +module Diagram +{ +enum BPMNEvents +{ +//Used to set BPMN Event as Start +Start, +//Used to set BPMN Event as Intermediate +Intermediate, +//Used to set BPMN Event as End +End, +//Used to set BPMN Event as NonInterruptingStart +NonInterruptingStart, +//Used to set BPMN Event as NonInterruptingIntermediate +NonInterruptingIntermediate, +} +} +module Diagram +{ +enum BPMNGateways +{ +//Used to set BPMN Gateway as None +None, +//Used to set BPMN Gateway as Exclusive +Exclusive, +//Used to set BPMN Gateway as Inclusive +Inclusive, +//Used to set BPMN Gateway as Parallel +Parallel, +//Used to set BPMN Gateway as Complex +Complex, +//Used to set BPMN Gateway as EventBased +EventBased, +} +} +module Diagram +{ +enum LabelEditMode +{ +//Used to set label edit mode as edit +Edit, +//Used to set label edit mode as view +View, +} +} +module Diagram +{ +enum TextAlign +{ +//Used to align text on left side of node/connector +Left, +//Used to align text on center of node/connector +Center, +//Used to align text on Right side of node/connector +Right, +} +} +module Diagram +{ +enum TextDecorations +{ +//Used to set text decoration of the label as Underline +Underline, +//Used to set text decoration of the label as Overline +Overline, +//Used to set text decoration of the label as LineThrough +LineThrough, +//Used to set text decoration of the label as None +None, +} +} +module Diagram +{ +enum TextWrapping +{ +//Disables wrapping +NoWrap, +//Enables Line-break at normal word break points +Wrap, +//Enables Line-break at normal word break points with longer word overflows +WrapWithOverflow, +} +} +module Diagram +{ +enum PortConstraints +{ +//Disable all constraints +None, +//Enables connections with connector +Connect, +} +} +module Diagram +{ +enum PortShapes +{ +//Used to set port shape as X +X, +//Used to set port shape as Circle +Circle, +//Used to set port shape as Square +Square, +//Used to set port shape as Path +Path, +} +} +module Diagram +{ +enum PortVisibility +{ +//Set the port visibility as Visible +Visible, +//Set the port visibility as Hidden +Hidden, +//Port get visible when hover connector on node +Hover, +//Port gets visible when connect connector to node +Connect, +//Specifies the port visibility as default +Default, +} +} +module Diagram +{ +enum BasicShapes +{ +//Used to specify node Shape as Rectangle +Rectangle, +//Used to specify node Shape as Ellipse +Ellipse, +//Used to specify node Shape as Path +Path, +//Used to specify node Shape as Polygon +Polygon, +//Used to specify node Shape as Triangle +Triangle, +//Used to specify node Shape as Plus +Plus, +//Used to specify node Shape as Star +Star, +//Used to specify node Shape as Pentagon +Pentagon, +//Used to specify node Shape as Heptagon +Heptagon, +//Used to specify node Shape as Octagon +Octagon, +//Used to specify node Shape as Trapezoid +Trapezoid, +//Used to specify node Shape as Decagon +Decagon, +//Used to specify node Shape as RightTriangle +RightTriangle, +//Used to specify node Shape as Cylinder +Cylinder, +} +} +module Diagram +{ +enum BPMNBoundary +{ +//Used to set BPMN SubProcess's Boundary as Default +Default, +//Used to set BPMN SubProcess's Boundary as Call +Call, +//Used to set BPMN SubProcess's Boundary as Event +Event, +} +} +module Diagram +{ +enum BPMNLoops +{ +//Used to set BPMN Activity's Loop as None +None, +//Used to set BPMN Activity's Loop as Standard +Standard, +//Used to set BPMN Activity's Loop as ParallelMultiInstance +ParallelMultiInstance, +//Used to set BPMN Activity's Loop as SequenceMultiInstance +SequenceMultiInstance, +} +} +module Diagram +{ +enum BPMNTasks +{ +//Used to set BPMN Task Type as None +None, +//Used to set BPMN Task Type as Service +Service, +//Used to set BPMN Task Type as Receive +Receive, +//Used to set BPMN Task Type as Send +Send, +//Used to set BPMN Task Type as InstantiatingReceive +InstantiatingReceive, +//Used to set BPMN Task Type as Manual +Manual, +//Used to set BPMN Task Type as BusinessRule +BusinessRule, +//Used to set BPMN Task Type as User +User, +//Used to set BPMN Task Type as Script +Script, +//Used to set BPMN Task Type as Parallel +Parallel, +} +} +module Diagram +{ +enum BPMNTriggers +{ +//Used to set Event Trigger as None +None, +//Used to set Event Trigger as Message +Message, +//Used to set Event Trigger as Timer +Timer, +//Used to set Event Trigger as Escalation +Escalation, +//Used to set Event Trigger as Link +Link, +//Used to set Event Trigger as Error +Error, +//Used to set Event Trigger as Compensation +Compensation, +//Used to set Event Trigger as Signal +Signal, +//Used to set Event Trigger as Multiple +Multiple, +//Used to set Event Trigger as Parallel +Parallel, +} +} +module Diagram +{ +enum Shapes +{ +//Used to set decorator shape as none +None, +//Used to set decorator shape as Arrow +Arrow, +//Used to set decorator shape as Open Arrow +OpenArrow, +//Used to set decorator shape as Circle +Circle, +//Used to set decorator shape as Diamond +Diamond, +//Used to set decorator shape as path +Path, +} +} +module Diagram +{ +enum PageOrientations +{ +//Used to set orientation as Landscape +Landscape, +//Used to set orientation as portrait +Portrait, +} +} +module Diagram +{ +enum ScrollLimit +{ +//Used to set scrollLimit as Infinite +Infinite, +//Used to set scrollLimit as Diagram +Diagram, +//Used to set scrollLimit as Limited +Limited, +} +} +module Diagram +{ +enum SelectorConstraints +{ +//Hides the selector +None, +//Sets the visibility of rotation handle as visible +Rotator, +//Sets the visibility of resize handles as visible +Resizer, +//Sets the visibility of user handles as visible +UserHandles, +//Sets the visibility of all selection handles as visible +All, +} +} +module Diagram +{ +enum Tool +{ +//Disables all Tools +None, +//Enables/Disables SingleSelect tool +SingleSelect, +//Enables/Disables MultiSelect tool +MultipleSelect, +//Enables/Disables ZoomPan tool +ZoomPan, +//Enables/Disables DrawOnce tool +DrawOnce, +//Enables/Disables ContinuousDraw tool +ContinuesDraw, +} +} +module Diagram +{ +enum RelativeMode +{ +//Shows tooltip around the node +Object, +//Shows tooltip at the mouse position +Mouse, +} +} + +} + +interface JQueryXHR { +} +interface JQueryPromise { +} +interface JQueryDeferred extends JQueryPromise { +} +interface JQueryParam { +} +interface JQuery { + data(key: any): any; +} +interface JQuery { + + ejButton(): JQuery; + ejButton(options?: ej.Button.Model): JQuery; + data(key: "ejButton"): ej.Button; + + ejCaptcha(): JQuery; + ejCaptcha(options?: ej.Captcha.Model): JQuery; + data(key: "ejCaptcha"): ej.Captcha; + + ejAccordion(): JQuery; + ejAccordion(options?: ej.Accordion.Model): JQuery; + data(key: "ejAccordion"): ej.Accordion; + + ejAutocomplete(): JQuery; + ejAutocomplete(options?: ej.Autocomplete.Model): JQuery; + data(key: "ejAutocomplete"): ej.Autocomplete; + + ejDatePicker(): JQuery; + ejDatePicker(options?: ej.DatePicker.Model): JQuery; + data(key: "ejDatePicker"): ej.DatePicker; + + ejDateTimePicker(): JQuery; + ejDateTimePicker(options?: ej.DateTimePicker.Model): JQuery; + data(key: "ejDateTimePicker"): ej.DateTimePicker; + + ejDialog(): JQuery; + ejDialog(options?: ej.Dialog.Model): JQuery; + data(key: "ejDialog"): ej.Dialog; + + ejDropDownList(): JQuery; + ejDropDownList(options?: ej.DropDownList.Model): JQuery; + data(key: "ejDropDownList"): ej.DropDownList; + + ejFileExplorer(): JQuery; + ejFileExplorer(options?: ej.FileExplorer.Model): JQuery; + data(key: "ejFileExplorer"): ej.FileExplorer; + + ejListBox(): JQuery; + ejListBox(options?: ej.ListBox.Model): JQuery; + data(key: "ejListBox"): ej.ListBox; + + ejListView(): JQuery; + ejListView(options?: ej.ListView.Model): JQuery; + data(key: "ejListView"): ej.ListView; + + ejNumericTextbox(): JQuery; + ejNumericTextbox(options?: ej.Editor.Model): JQuery; + data(key: "ejNumericTextbox"): ej.NumericTextbox; + + ejCurrencyTextbox(): JQuery; + ejCurrencyTextbox(options?: ej.Editor.Model): JQuery; + data(key: "ejCurrencyTextbox"): ej.CurrencyTextbox; + + ejPercentageTextbox(): JQuery; + ejPercentageTextbox(options?: ej.Editor.Model): JQuery; + data(key: "ejPercentageTextbox"): ej.PercentageTextbox; + + ejMaskEdit(): JQuery; + ejMaskEdit(options?: ej.MaskEdit.Model): JQuery; + data(key: "ejMaskEdit"): ej.MaskEdit; + + ejMenu(): JQuery; + ejMenu(options?: ej.Menu.Model): JQuery; + data(key: "ejMenu"): ej.Menu; + + ejPager(): JQuery; + ejPager(options?: ej.Pager.Model): JQuery; + data(key: "ejPager"): ej.Pager; + + ejProgressBar(): JQuery; + ejProgressBar(options?: ej.ProgressBar.Model): JQuery; + data(key: "ejProgressBar"): ej.ProgressBar; + + ejRadioButton(): JQuery; + ejRadioButton(options?: ej.RadioButton.Model): JQuery; + data(key: "ejRadioButton"): ej.RadioButton; + + ejCheckBox(): JQuery; + ejCheckBox(options?: ej.CheckBox.Model): JQuery; + data(key: "ejCheckBox"): ej.CheckBox; + + ejRibbon(): JQuery; + ejRibbon(options?: ej.Ribbon.Model): JQuery; + data(key: "ejRibbon"): ej.Ribbon; + + ejKanban(): JQuery; + ejKanban(options?: ej.Kanban.Model): JQuery; + data(key: "ejKanban"): ej.Kanban; + + ejRating(): JQuery; + ejRating(options?: ej.Rating.Model): JQuery; + data(key: "ejRating"): ej.Rating; + + ejRotator(): JQuery; + ejRotator(options?: ej.Rotator.Model): JQuery; + data(key: "ejRotator"): ej.Rotator; + + ejRTE(): JQuery; + ejRTE(options?: ej.RTE.Model): JQuery; + data(key: "ejRTE"): ej.RTE; + + ejSlider(): JQuery; + ejSlider(options?: ej.Slider.Model): JQuery; + data(key: "ejSlider"): ej.Slider; + + ejSplitButton(): JQuery; + ejSplitButton(options?: ej.SplitButton.Model): JQuery; + data(key: "ejSplitButton"): ej.SplitButton; + + ejSplitter(): JQuery; + ejSplitter(options?: ej.Splitter.Model): JQuery; + data(key: "ejSplitter"): ej.Splitter; + + ejTab(): JQuery; + ejTab(options?: ej.Tab.Model): JQuery; + data(key: "ejTab"): ej.Tab; + + ejTagCloud(): JQuery; + ejTagCloud(options?: ej.TagCloud.Model): JQuery; + data(key: "ejTagCloud"): ej.TagCloud; + + ejTimePicker(): JQuery; + ejTimePicker(options?: ej.TimePicker.Model): JQuery; + data(key: "ejTimePicker"): ej.TimePicker; + + ejTile(): JQuery; + ejTile(options?: ej.Tile.Model): JQuery; + data(key: "ejTile"): ej.Tile; + + ejToggleButton(): JQuery; + ejToggleButton(options?: ej.ToggleButton.Model): JQuery; + data(key: "ejToggleButton"): ej.ToggleButton; + + ejToolbar(): JQuery; + ejToolbar(options?: ej.Toolbar.Model): JQuery; + data(key: "ejToolbar"): ej.Toolbar; + + ejNavigationDrawer(): JQuery; + ejNavigationDrawer(options?: ej.NavigationDrawer.Model): JQuery; + data(key: "ejNavigationDrawer"): ej.NavigationDrawer; + + ejRadialMenu(): JQuery; + ejRadialMenu(options?: ej.RadialMenu.Model): JQuery; + data(key: "ejRadialMenu"): ej.RadialMenu; + + ejTreeView(): JQuery; + ejTreeView(options?: ej.TreeView.Model): JQuery; + data(key: "ejTreeView"): ej.TreeView; + + ejUploadbox(): JQuery; + ejUploadbox(options?: ej.Uploadbox.Model): JQuery; + data(key: "ejUploadbox"): ej.Uploadbox; + + ejWaitingPopup(): JQuery; + ejWaitingPopup(options?: ej.WaitingPopup.Model): JQuery; + data(key: "ejWaitingPopup"): ej.WaitingPopup; + + ejSchedule(): JQuery; + ejSchedule(options?: ej.Schedule.Model): JQuery; + data(key: "ejSchedule"): ej.Schedule; + + ejRecurrenceEditor(): JQuery; + ejRecurrenceEditor(options?: ej.RecurrenceEditorOptions): JQuery; + data(key: "ejRecurrenceEditor"): ej.RecurrenceEditor; + + ejGrid(): JQuery; + ejGrid(options?: ej.Grid.Model): JQuery; + data(key: "ejGrid"): ej.Grid; + + /*ReportViewer*/ + ejReportViewer(): JQuery; + ejReportViewer(options?: ej.ReportViewer.Model): JQuery; + data(key: "ejReportViewer"): ej.ReportViewer; + /*ReportViewer*/ + + ejLinearGauge(): JQuery; + ejLinearGauge(options?: ej.datavisualization.LinearGauge.Model): JQuery; + data(key: "ejLinearGauge"): ej.datavisualization.LinearGauge; + + ejDigitalGauge(): JQuery; + ejDigitalGauge(options?: ej.datavisualization.DigitalGauge.Model): JQuery; + data(key: "ejDigitalGauge"): ej.datavisualization.DigitalGauge; + + ejCircularGauge(): JQuery; + ejCircularGauge(options?: ej.datavisualization.CircularGauge.Model): JQuery; + data(key: "ejCircularGauge"): ej.datavisualization.CircularGauge; + + ejChart(): JQuery; + ejChart(options?: ej.datavisualization.Chart.Model): JQuery; + data(key: "ejChart"): ej.datavisualization.Chart; + + ejRangeNavigator(): JQuery; + ejRangeNavigator(options?: ej.datavisualization.RangeNavigator.Model): JQuery; + data(key: "ejRangeNavigator"): ej.datavisualization.RangeNavigator; + + ejBulletGraph(): JQuery; + ejBulletGraph(options?: ej.datavisualization.BulletGraph.Model): JQuery; + data(key: "ejBulletGraph"): ej.datavisualization.BulletGraph; + + ejGantt(): JQuery; + ejGantt(options?: ej.Gantt.Model): JQuery; + data(key: "ejGantt"): ej.Gantt; + + ejTreeGrid(): JQuery; + ejTreeGrid(options?: ej.TreeGrid.Model): JQuery; + data(key: "ejTreeGrid"): ej.TreeGrid; + + ejMap(): JQuery; + ejMap(options?: ej.datavisualization.Map.Model): JQuery; + data(key: "ejMap"): ej.datavisualization.Map; + + ejTreeMap(): JQuery; + ejTreeMap(options?: ej.datavisualization.TreeMap.Model): JQuery; + data(key: "ejTreeMap"): ej.datavisualization.TreeMap; + + ejBarcode(): JQuery; + ejBarcode(options?: ej.datavisualization.Barcode.Model): JQuery; + data(key: "ejBarcode"): ej.datavisualization.Barcode; + + ejDiagram(): JQuery; + ejDiagram(options?: ej.datavisualization.Diagram.Model): JQuery; + data(key: "ejDiagram"): ej.datavisualization.Diagram; + + // ejSymbolPalette(): JQuery; + // ejSymbolPalette(options?: ej.datavisualization.SymbolPalette.Model): JQuery; + // data(key: "ejSymbolPalette"): ej.datavisualization.SymbolPalette; + + ejOlapChart(): JQuery; + ejOlapChart(options?: ej.olap.OlapChart.Model): JQuery; + data(key: "ejOlapChart"): ej.olap.OlapChart; + + ejPivotGrid(): JQuery; + ejPivotGrid(options?: ej.PivotGrid.Model): JQuery; + data(key: "ejPivotGrid"): ej.PivotGrid; + + ejPivotSchemaDesigner(): JQuery; + ejPivotSchemaDesigner(options?: ej.PivotSchemaDesigner.Model): JQuery; + data(key: "ejPivotSchemaDesigner"): ej.PivotSchemaDesigner; + + ejOlapClient(): JQuery; + ejOlapClient(options?: ej.olap.OlapClient.Model): JQuery; + data(key: "ejOlapClient"): ej.olap.OlapClient; + + ejOlapGauge(): JQuery; + ejOlapGauge(options?: ej.olap.OlapGauge.Model): JQuery; + data(key: "ejOlapGauge"): ej.olap.OlapGauge; + + ejPivotPager(): JQuery; + ejPivotPager(options?: ej.PivotPager.Model): JQuery; + data(key: "ejPivotPager"): ej.PivotPager; + + /* Spreadsheet */ + ejSpreadsheet(): JQuery; + ejSpreadsheet(options?: ej.Spreadsheet.Model): JQuery; + data(key: "ejSpreadsheet"): ej.Spreadsheet; + /* Spreadsheet */ + + ejScroller(): JQuery; + ejScroller(options?: ej.Scroller.Model): JQuery; + data(key: "ejScroller"): ej.Scroller; + + ejDraggable(): JQuery; + ejDraggable(options?: ej.DraggableOptions): JQuery; + data(key: "ejDraggable"): ej.Draggable; + + ejDroppable(): JQuery; + ejDroppable(options?: ej.DroppableOptions): JQuery; + data(key: "ejDroppable"): ej.Droppable; + + ejResizable(): JQuery; + ejResizable(options?: ej.ResizableOptions): JQuery; + data(key: "ejResizable"): ej.Resizable; + + ejColorPicker(): JQuery; + ejColorPicker(options?: ej.ColorPicker.Model): JQuery; + data(key: "ejColorPicker"): ej.ColorPicker; + + ejRadialSlider(): JQuery; + ejRadialSlider(options?: ej.RadialSliderOptions): JQuery; + data(key: "ejRadialSlider"): ej.RadialSlider; + +} \ No newline at end of file diff --git a/ej.widgets.all/ej.widgets.all-tests.ts b/ej.widgets.all/ej.widgets.all-tests.ts new file mode 100644 index 0000000000..1f8412ad8d --- /dev/null +++ b/ej.widgets.all/ej.widgets.all-tests.ts @@ -0,0 +1,1260 @@ +/// +/// + +$(document).ready(function () { + + //Properties + $("#draggable1").ejDraggable({ + drag: ondrag1, dragStart: ondragstart1, dragStop: ondragstop1 + }); + $("#droppable1").ejDroppable(); + +}); +//Events + +function ondrag1() { + console.log("The mouse is moved during the dragging."); +} +function ondragstart1() { + console.log("To handle the drag start event as an init option."); +} +function ondragstop1() { + console.log("The mouse is moved during the dragging.."); +} + + + + + +$(document).ready(function () { + + //Properties + $("#draggable1").ejDraggable({ + drag: ondrag2, dragStart: ondragstart2, dragStop: ondragstop2 + }); + $("#droppable1").ejDroppable(); + +}); +//Events + +function ondrag2() { + console.log("The mouse is moved during the dragging."); +} +function ondragstart2() { + console.log("To handle the drag start event as an init option."); +} +function ondragstop2() { + console.log("The mouse is moved during the dragging.."); +} + + + + + +$(document).ready(function () { + + //Properties + $("#resizable1").ejResizable({resizeStart: onresizestart , resizeStop: onresizestop }); + +}); +//Events +function onresizestart() { + console.log("The resizing is start"); +} +function onresizestop() { + console.log("The resizing is stop"); +} + + + + + +$(document).ready(function () { + + //Properties + $("#scroller1").ejScroller({ height: 300, width: 500, create: onScrollCreate }); + $("#scroller2").ejScroller({ height: 300, width: 500,scrollTop:40 }); + +}); +//Events +function onScrollCreate() { + console.log("control created"); +} + +$(document).ready(function () { + + $("#accordion1").ejAccordion({cssClass: "gradient-lime" , create: AccordionCreate }); + $("#accordion2").ejAccordion({ enabled: true , activate: AccordionActivate }); + +}); + +function AccordionCreate() { + console.log("create"); +} +function AccordionActivate(){ + console.log("activate") +} + +$(document).ready(function () { + + $("#Text1").ejButton({ text: "Button", enabled: false , create: onButtoncreate }); + $("#Text2").ejButton({ text: "Button", cssClass: "customclass" , click: onButtonclick }); +}); + +function onButtoncreate() { + console.log("create"); +} +function onButtonclick(){ + console.log("click") +} +$(document).ready(function () { + + //Properties + $("#listbox1").ejListBox({ allowMultiSelection: true, create: onlistBoxcreate }); + $("#listbox2").ejListBox({ showCheckbox: true,checkChange: onlistBoxcheckchange }); + +}); +//Events +function onlistBoxcreate() { + console.log("control created"); +} +function onlistBoxcheckchange() { + console.log("list item is checked or unchecked"); +} + + + + + +$(document).ready(function () { + + $("#checkbox1").ejCheckBox({ enableTriState: true, create: onCheckboxcreate }); + $("#checkbox2").ejCheckBox({ checked: true , change: onCheckboxchange }); + +}); + +function onCheckboxcreate() { + console.log("create"); +} +function onCheckboxchange(){ + console.log("change") +} + + + +$(document).ready(function () { + + $("#colorpicker1").ejColorPicker({ value: "#278787" , open: oncolorPickeropen }); + $("#colorpicker2").ejColorPicker({ enabled: true, create: oncolorPickercreate }); + +}); +function oncolorPickeropen() { + console.log("open"); +} +function oncolorPickercreate(){ + console.log("create") +} + + +$(document).ready(function () { + + $("#fileExplorer").ejFileExplorer({ + isResponsive: true, + fileTypes: "*.png, *.gif, *.jpg, *.jpeg, *.docx", + layout: "largeicons", + path: "http://mvc.syncfusion.com/ODataServices/FileBrowser/", + ajaxAction: "http://mvc.syncfusion.com/OdataServices/fileExplorer/fileoperation/doJSONPAction", + ajaxDataType: "jsonp", + }); +}); + + +$(document).ready(function () { + + $("#datepicker1").ejDatePicker({dateFormat: "dd/MM/yyyy" ,open: ondatePickeropen }); + $("#datepicker3").ejDatePicker({value: "21/2/2010" , select: ondatePickerselect }); + +}); +function ondatePickeropen() { + console.log("open"); +} +function ondatePickerselect(){ + console.log("select") +} + + +$(document).ready(function () { + + $("#datetimepicker1").ejDateTimePicker({width:"100%" , create: ondatetimePickercreate }); + $("#datetimepicker2").ejDateTimePicker({enableRTL: true , open: ondatetimePickeropen }); +}); +function ondatetimePickercreate() { + console.log("create"); +} +function ondatetimePickeropen(){ + console.log("open") +} + + +$(document).ready(function () { + $("#Div1").ejDialog({ enabled: true , open : ondialogOpen }); + $("#Div2").ejDialog({ title: "Low battery" , beforeClose : ondialogbeforeClose }); +}); +function ondialogbeforeClose() { + console.log("beforeClose"); +} +function ondialogOpen() { + console.log("open"); +} +$(document).ready(function () { + + $("#dropdownlist1").ejDropDownList({ targetID: "carsList", create: ondropDowncreate }); + $("#dropdownlist2").ejDropDownList({ watermarkText: "Select a car", change: ondropDownchange }); +}); + +function ondropDowncreate() { + console.log("create"); +} +function ondropDownchange(){ + console.log("change") +} +$(document).ready(function () { + $("#num1").ejNumericTextbox({ value:"35" ,create: onEditorcreate }); + $("#num2").ejNumericTextbox({ width:"100%" , change: onEditorchange }); + + $("#num3").ejPercentageTextbox({ value:"3" ,create: onEditorcreate }); + $("#num4").ejPercentageTextbox({ width:"100%" , change: onEditorchange }); + + $("#num5").ejCurrencyTextbox({ value:"555" ,create: onEditorcreate }); + $("#num6").ejCurrencyTextbox({ width:"100%" , change: onEditorchange }); + +}); + +function onEditorcreate() { + console.log("create"); +} +function onEditorchange(){ + console.log("change") +} + +$(document).ready(function () { + + //Properties + $("#listview1").ejListView({ width: 200,mouseUP: onlistViewmouseup }); + $("#listview2").ejListView({ height: 300, mouseDown: onlistViewmousedown }); + +}); +//Events +function onlistViewmouseup() { + console.log("mouse up happens on the item."); +} +function onlistViewmousedown() { + console.log("mouse down happens on the item."); +} + + + + + + + + + +$(document).ready(function () { + $("#num1").ejMaskEdit({ maskFormat: "99-999-99999" ,create: onmaskEditcreate }); + $("#num2").ejMaskEdit({ watermarkText: "99-999-99999", width:"100%" , change: onmaskEditchange }); +}); + +function onmaskEditcreate() { + console.log("create"); +} +function onmaskEditchange(){ + console.log("change") +} +$(document).ready(function () { + + //Properties + $("#menu1").ejMenu({ enabled: false ,create: onMenucreate }); + $("#menu2").ejMenu({ width: "800px",click: onMenuclick }); + +}); +//Events +function onMenucreate() { + console.log("control created"); +} +function onMenuclick() { + console.log("mouse click on menu items"); +} + + + + + +$(document).ready(function () { + $("#pager1").ejPager({ click : onclickpager }); + $("#pager2").ejPager({ enableRTL: true }); +}); + +function onclickpager(){ + console.log("click") +} +$(document).ready(function () { + + $("#progress1").ejProgressBar({ text: 'loading...' , value: 50 , create: ProgressBarCreate }); + $("#progress2").ejProgressBar({ width: 200, value: 50 , change: ProgressBarChange }); + +}); + +function ProgressBarCreate() { + console.log("create"); +} +function ProgressBarChange(){ + console.log("change"); +} + +$(document).ready(function () { + $("#r1").ejRadioButton({ create: onradioButtoncreate }); + $("#r2").ejRadioButton({ text: "RadioButton",change: onradioButtonchange }); + $("#r3").ejRadioButton({ text: "RadioButton1", enabled: false }); +}); + +function onradioButtonchange() { + console.log("Change triggered"); +} +function onradioButtoncreate() { + console.log("Create triggered"); +} +$(document).ready(function () { + $("#Div1").ejRating({ enabled: true, click: onRatingclick }); + $("#Div2").ejRating({ incrementStep: 1, change: RatingvalueChanged }); +}); + +function RatingvalueChanged() { + console.log("Value changed"); +} +function onRatingclick() { + console.log("Entered"); +} +$(document).ready(function () { + + + $("#test1").ejRibbon({ + allowResizing:true,applicationTab: { + menuSettings: { + openOnClick: false + } + }, + tabs: [{ + id: "home", + text: "HOME", + groups: [{ + text: "New", + type: "custom", + contentID: "btn" + }] + }], + }); + $("#test2").ejRibbon({ + width: "100%", + applicationTab: { + menuSettings: { + openOnClick: false + } + }, + tabs: [{ + id: "home", + text: "HOME", + groups: [{ + text: "New", + type: "custom", + contentID: "btn" + }] + }], tabClick: onRibbonTabClick + }); +}); + +function onRibbonTabClick() { + console.log("Tab Clicked.."); +} + +$(function() { + $("#Kanban").ejKanban( + { + enableRTL: true, + columns: [ + { headerText: "Backlog", key: "Open" }, + { headerText: "In Progress", key: "InProgress" }, + { headerText: "Testing", key: "Testing" }, + { headerText: "Done", key: "Close" } + ], + keyField: "Status", + + + }); + }); + +$(document).ready(function () { + var imageData = [ + { + "imageurl": "../themes/images/rose.jpg", + }, + { + "imageurl": "../themes/images/rose.jpg", + } + + ]; + $("#test1").ejRotator({ + dataSource:imageData, allowKeyboardNavigation : false,create: onRotatorCreate + }); + $("#test2").ejRotator({ + dataSource:imageData, displayItemsCount : "1",pagerClick: onRotatorpagerClick + + }); + + +}); + +function onRotatorCreate() { + console.log("created"); +} +function onRotatorpagerClick() { + console.log("page clicked.."); +} + + +$(document).ready(function () { + $("#rteSample").ejRTE({ allowEditing: false , enableRTL: true }); + $("#rteSample").ejRTE({ change: onRtechange , execute: onRteExecute }); +}); + +function onRtechange() { + console.log("Change triggered"); +} +function onRteExecute() { + console.log("Executed"); +} +$(document).ready(function() { + $("#test1").ejSlider({ showRoundedCorner: true }); + $("#test2").ejSlider({ orientation: ej.Orientation.Vertical }); + $("#test3").ejSlider({ minValue: 20, maxValue: 80 }); + $("#test4").ejSlider({ start: Sliderstart }); + $("#test5").ejSlider({ enabled: false }); + $("#test6").ejSlider({ slide: onSliderslide }); +}); +function Sliderstart() { + console.log("Slider Started"); +} +function onSliderslide() { + console.log("Moving"); +} + +$(document).ready(function () { + $("#sbutton").ejSplitButton({ + width: "120px", + height: "50px", + buttonMode: ej.ButtonMode.Dropdown, + create: splitButtonopen, + targetID: "target", + }); +}); + +function splitButtonopen() +{ +alert("Opened"); +} + + + +$(document).ready(function () { + + $("#splitter1").ejSplitter({ enableRTL: true , create: onSplitterCreate }); + $("#splitter2").ejSplitter({allowKeyboardNavigation: false , expandCollapse: onSplitterExpandCollapse }); + +}); +function onSplitterCreate() { + console.log("Created"); +} +function onSplitterExpandCollapse(){ + console.log("expand and collapsed") +} + +$(document).ready(function () { + + $("#tab1").ejTab({ enableRTL: true , create: onTabCreate }); + $("#tab2").ejTab({ showRoundedCorner: true , ajaxSuccess: onTabAjaxSuccess }); + +}); +function onTabCreate() { + console.log("created"); +} + +function onTabAjaxSuccess() { + console.log("ajaxsuccess"); +} + + +$(function () { + // declaration + var websiteCollection = [ + { text: "Google", url: "http://www.google.com", frequency: 12 }, + { text: "All Things Digital", url: "http://allthingsd.com/", frequency: 3 }, + + ]; + $("#tagtest").ejTagCloud({ + titleText: "Tech Sites", + dataSource: websiteCollection, + enableRTL: true, mouseout: onTagMouseout + }); + $("#tagtest1").ejTagCloud({ + titleText: "Tech Sites", + dataSource: websiteCollection, + maxFontSize: "10px", create: onTagCreate + }); + function onTagCreate() { + console.log("created"); + } + function onTagMouseout() { + console.log("mouseout"); + } +}); + + + + $(function () { + $("#time").ejTimePicker({ enabled : true, height : "35",close: TimeClose,create: TimeCreate}); + }); + + function TimeClose() { + console.log("close"); + } + function TimeCreate() { + console.log("create"); + } + + + $(function () { + $("#tbutton").ejToggleButton({ + size: "large", + height: "28px", + click:ToggleClick, + create:ToggleCreate + }); + }); + + function ToggleClick() { + console.log("click"); + } + function ToggleCreate() { + console.log("create"); + } + +$(function () {// document ready + // Toolbar control creation + $("#ToolbarItem").ejToolbar({ + width: "auto", // width of the Toolbar + height: "33px", // height of the Toolbar + create:ToolBarCreate, + click:ToolBarClick + }); + }); + +function ToolBarCreate() { + console.log("click"); +} +function ToolBarClick() { + console.log("create"); +} + +$(document).ready(function () { + + $("#treeView").ejTreeView({ width: 300 , cssClass: 'customclass' , create: TreeViewCreate }); + + $("#treeView1").ejTreeView({ height: 300 , enabled: true , nodeClick: TreeViewClick }); +}); + + +function TreeViewCreate() { + console.log("create"); +} +function TreeViewClick(){ + console.log("click"); +} + +$(document).ready(function () { + + //Properties + $("#uploadbbox1").ejUploadbox({ height: "60px", create: onuploadBoxcreate }); + $("#uploadbbox2").ejUploadbox({ enableRTL: true, fileSelect: onuploadBoxfileselect }); + +}); +//Events +function onuploadBoxcreate() { + console.log("control created"); +} +function onuploadBoxfileselect() { + console.log("file has been selected"); +} + + + + + + + + + +$(document).ready(function () { + + //Properties + $("#waitingpopup1").ejWaitingPopup({ showOnInit: true, create: onwaitingPopupcreate }); + $("#waitingpopup2").ejWaitingPopup({ showOnInit: true, showImage: false }); + +}); +//Events +function onwaitingPopupcreate() { + console.log("control created"); +} + + + + + +$(function () { + $("#Grid").ejGrid({ + allowPaging: true, + allowSorting: true, + rowSelected: onGridRowSelect, + columnSelected: onGridColumnSelect, + rightClick: onGridRightClick, + columns: [ + { field: "OrderID", headerText: "Order ID", width: 75 , textAlign: ej.TextAlign.Right }, + { field: "CustomerID", headerText: "Customer ID", width: 80 }, + { field: "EmployeeID", headerText: "Employee ID", width: 75, textAlign: ej.TextAlign.Right }, + { field: "Freight", width: 75, format: "{0:C}", textAlign: ej.TextAlign.Right }, + { field: "OrderDate", headerText: "Order Date", width: 80, format: "{0:MM/dd/yyyy}", textAlign: ej.TextAlign.Right }, + { field: "ShipCity", headerText: "Ship City", width: 110 } + ] + }); + }); + +function onGridRowSelect() +{ +console.log("Row Selected"); +} +function onGridRightClick() +{ +console.log("Right Click Button Clicked"); +} +function onGridColumnSelect() +{ +console.log("Column Selected"); +} + + $(function () { + $("#PivotGrid").ejPivotGrid({ + load: PivotGridload, + renderComplete: PivotGridrenderComplete, + url: "/wcf/PivotGridService.svc", + isResponsive: true + + }); + }); + + function PivotGridload() { + console.log("load"); + } + function PivotGridrenderComplete() { + console.log("rendercomplete"); + } + + + $(function () { + $("#PivotSchemaDesigner1").ejPivotSchemaDesigner({ + height: "630px", + url: "/wcf/PivotService.svc" + }); + }); + + + +$(document).ready(function () { + $("#pivotpager1").ejPivotPager({ categoricalCurrentPage: 1 }); + $("#pivotpager2").ejPivotPager({ seriesPageCount: 0 }); +}); + +$(document).ready(function () { + $("#test1").ejSchedule({ + cellHeight:"35px", cellClick: onScheduleCellClick + }); + $("#test2").ejSchedule({ + enableRTL: true, menuItemClick: onScheduleMenuItemClick + }); +}); +function onScheduleCellClick() { + console.log("cell clicked.."); +} +function onScheduleMenuItemClick() { + console.log("Menu Item Clicked.."); +} + + + $(function () { + $("#RecurrenceEditor").ejRecurrenceEditor({ + selectedRecurrenceType: 0, + create: RecurrenceEditorOncreate + }); + + }); + + function RecurrenceEditorOncreate() { + this.element.find("#recurrencetype_wrapper").css("width", "33%"); + } + +$(document).ready(function () { + +$("#GanttContainer").ejGantt({ + allowSelection: true, + allowColumnResize: true, + taskIdMapping: "TaskID", + taskNameMapping: "TaskName", + scheduleStartDate: "02/23/2014", + scheduleEndDate: "03/31/2014", + startDateMapping: "StartDate", + endDateMapping: "EndDate", + progressMapping: "Progress", + childMapping: "Children", + allowGanttChartEditing: false, + treeColumnIndex: 1, + enableResize: true, + expanded: onGanttExpand, + load: onGanttLoad + }); +}); + +function onGanttExpand() +{ +console.log("Expanded"); +} +function onGanttLoad() +{ +console.log("Loading"); +} +$(document).ready(function () { + + + $("#test1").ejReportViewer({ reportServiceUrl: "../api/RDLReport",enablePageCache: false,reportLoaded: onReportReportLoaded }); + $("#test2").ejReportViewer({ + renderMode: ej.ReportViewer.RenderMode.Default,reportServiceUrl: "../api/RDLReport",renderingBegin: onReportRenderingBegin }); +}); +function onReportRenderingBegin() { + console.log("Rendering Begin.."); +} +function onReportReportLoaded() { + console.log("Report Loaded.."); +} + +$(document).ready(function () { + var dataManager = [ + { + taskID: 1, + taskName: "Planning", + startDate: "02/03/2014", + endDate: "02/07/2014", + progress: 100, + duration: 5, + priority: "Normal", + approved: false, + subtasks: [ + { taskID: 2, taskName: "Plan timeline", startDate: "02/03/2014", endDate: "02/07/2014", duration: 5, progress: 100, priority: "Normal", approved: false }, + { taskID: 3, taskName: "Plan budget", startDate: "02/03/2014", endDate: "02/07/2014", duration: 5, progress: 100, approved: true }, + { taskID: 4, taskName: "Allocate resources", startDate: "02/03/2014", endDate: "02/07/2014", duration: 5, progress: 100, priority: "Critical", approved: false }, + { taskID: 5, taskName: "Planning complete", startDate: "02/07/2014", endDate: "02/07/2014", duration: 0, progress: 0, priority: "Low", approved: true } + ] + }]; + +$("#test1").ejTreeGrid({ + dataSource:dataManager,allowColumnResize: true, + columns: [ + { field: "taskID", headerText: "Task Id", editType: "numericedit" }, + { field: "taskName", headerText: "Task Name", editType: "stringedit" }, + { field: "startDate", headerText: "Start Date", editType: "datepicker" }, + { field: "endDate", headerText: "End Date", editType: "datepicker" }, + { field: "duration", headerText: "Duration", editType: "numericedit" }, + { field: "progress", headerText: "Progress", editType: "numericedit" } + ],load: onTreeLoad + }); + $("#test2").ejTreeGrid({ + dataSource:dataManager,rowHeight : 30, + columns: [ + { field: "taskID", headerText: "Task Id", editType: "numericedit" }, + { field: "taskName", headerText: "Task Name", editType: "stringedit" }, + { field: "startDate", headerText: "Start Date", editType: "datepicker" }, + { field: "endDate", headerText: "End Date", editType: "datepicker" }, + { field: "duration", headerText: "Duration", editType: "numericedit" }, + { field: "progress", headerText: "Progress", editType: "numericedit" } + ],rowSelected: onTreeRowSelected + + }); + + +}); +function onTreeLoad() { + console.log("loaded.."); +} +function onTreeRowSelected() { + console.log("row Selected.."); +} + + +$(document).ready(function () { + $("#navpane").ejNavigationDrawer({ type: "overlay", direction: "left", position: "fixed",open: NavigationDrawerOpen }); +}); + +function NavigationDrawerOpen() +{ + console.log("open"); +} + + + $(function () { + $('#radialmenu').ejRadialMenu({ targetElementId: "radialtarget", "autoOpen":true,select: RadialMenuSelect , mouseUp: RadialMenuMouseUp }); + }); + + function RadialMenuMouseUp() { + console.log("mouseUp"); + } + function RadialMenuSelect() { + console.log("select"); + } + + + +$(function () +{ + $("#tile1").ejTile({ text: "Map", tileSize: "medium", imageUrl: 'http://js.syncfusion.com/ug/web/content/tile/map.png', mouseUp: TileMouseUp, mouseDown: TileMouseDown }); +}); + +function TileMouseUp() { + console.log("mouseUp"); +} + +function TileMouseDown() { + console.log("mousedown"); +} + + + + + $(function () { + $("#radialSlider").ejRadialSlider({ innerCircleImageUrl: "chevron-right.png",autoOpen:true, create: RadialSliderCreate , start: RadialSliderStart }); + }); + + function RadialSliderCreate() { + console.log("create"); + } + function RadialSliderStart() { + console.log("start"); + } + +$(document).ready(function () { + $("#test1").ejSpreadsheet({ + allowDelete: true, cellEdit: onSpreadsheetCellEdit + }); + $("#test2").ejSpreadsheet({ + cssClass: "gradient-lime", drag: onSpreadsheetDrag + }); +}); +function onSpreadsheetDrag() { + console.log("item drag.."); +} +function onSpreadsheetCellEdit() { + console.log("cell edited.."); +} + + + $(function() + { + $("#OlapChart").ejOlapChart( + { + url: "OlapChartService.svc", + renderFailure: OlapChartRenderFailure, + renderSuccess: OlapChartRenderSuccess + }); + }); + + function OlapChartRenderFailure() { + console.log("failure"); + } + function OlapChartRenderSuccess() { + console.log("success"); + } + + + $(function() + { + $("#OlapClient").ejOlapClient( + { + url: "/wcf/OlapClientService.svc", + title: "OLAP Browser", + renderFailure: OlapClientRenderFailure, + renderSuccess: OlapClientRenderSuccess + }); + }); + + function OlapClientRenderFailure() { + console.log("failure"); + } + function OlapClientRenderSuccess() { + console.log("success"); + } + +$(document).ready(function() + { + $("#olapgauge1").ejOlapGauge( + { + url: "../wcf/OlapGaugeService.svc", + enableTooltip: true, + renderFailure: olapGaugerenderFailure, + renderSuccess: olapGaugerenderSuccess + }); + }); +function olapGaugerenderFailure() { + console.log("failure"); + } +function olapGaugerenderSuccess() { + console.log("success"); + } + +$(document).ready(function () { + + $("#CoreLinearGauge").ejLinearGauge({ + labelColor: "#8c8c8c", width: 500, + scales: [{ + width: 4, border: { color: "transparent",width:0 }, showBarPointers: false, showRanges: true, length: 310, + position: { x: 52, y: 50 }, markerPointers: [{ + value: 50, length: 10, width: 10, backgroundColor: "#4D4D4D", border: { color: "#4D4D4D" } + }], + labels: [{ font: { size: "11px", fontFamily: "Segoe UI", fontStyle: "bold" }, distanceFromScale:{x: -13} }], + ticks: [{ type: "majorinterval", width: 1, color: "#8c8c8c" }], + ranges: [{ + endValue: 60, + startValue: 0, + backgroundColor: "#F6B53F", + border: { color: "#F6B53F" }, startWidth: 4, endWidth: 4 + }, { + endValue: 100, + startValue: 60, + backgroundColor: "#E94649", + border: { color: "#E94649" }, startWidth: 4, endWidth: 4 + }] + }], + init:onLinearGaugeinit, + mouseClick:onLinearGaugemouseClick + }); +}); + +function onLinearGaugeinit() +{ + console.log("init"); +} +function onLinearGaugemouseClick() +{ + console.log("mouseClick"); +} + +$(document).ready(function () { + + $("#CoreCircularGauge").ejCircularGauge({ + backgroundColor: "transparent", width: 500, + scales: [{ + showRanges: true, + startAngle: 122, sweepAngle: 296, radius: 130, showScaleBar: true, size: 1, maximum: 120, majorIntervalValue: 20, minorIntervalValue: 10, + border: { + width: 0.5, + }, + pointers: [{ + value: 60, + showBackNeedle: true, + backNeedleLength: 20, + length: 95, + width: 7, + pointerCap: { radius: 12 } + }], + ticks: [{ + type: "major", + distanceFromScale: 2, + height: 16, + width: 1, color: "#8c8c8c" + }, { type: "minor", height: 8, width: 1, distanceFromScale: 2, color: "#8c8c8c" }], + labels: [{ + color: "#8c8c8c" + }], + ranges: [{ + distanceFromScale: -30, + startValue: 0, + endValue: 70 + }, { + distanceFromScale: -30, + startValue: 70, + endValue: 110, + backgroundColor: "#fc0606", + border: { color: "#fc0606" } + }, + { + distanceFromScale: -30, + startValue: 110, + endValue: 120, + backgroundColor: "#f5b43f", + border: { color: "#f5b43f" } + }] + }], + mouseClick:onCircularMouseClick + }); + +}); + +function onCircularMouseClick() +{ + console.log("Mouse click.."); +} + +$(document).ready(function () { + + $("#DigitalCore").ejDigitalGauge({ + width: 525, + height: 305, + items: [{ + segmentSettings: { + width: 1, + spacing: 0, + color: "#8c8c8c" + }, + characterSettings: { + opacity: 0.8, + }, + value: "123456789", + position: { x: 52, y: 52 } + }], + init:onDigitalGaugeinit, + itemRendering:onDigitalGaugeItemRendering + }); +}); + +function onDigitalGaugeinit() +{ + console.log("init"); +} +function onDigitalGaugeItemRendering() +{ + console.log("itemRendering"); +} + +$(document).ready(function () { + + $("#container").ejChart( + { + + + + //Initializing Common Properties for all the series + commonSeriesOptions: + { + type: 'line', enableAnimation: true, + tooltip:{ visible :true, template:'Tooltip'}, + marker: + { + shape: 'circle', + size: + { + height: 10, width: 10 + }, + visible: true + }, + border : {width: 2} + }, + + + + title :{text: 'Efficiency of oil-fired power production'}, + size: { height: "600" }, + legend: { visible: true}, + create:onChartCreate + }); + +}); + +function onChartCreate() +{ + console.log("create"); +} + +$(document).ready(function () { + + $("#scrollcontent").ejRangeNavigator({ + + enableDeferredUpdate: true, + padding: "15", + allowSnapping:true, + selectedRangeSettings: { + start:"2015/5/25", end:"2016/5/25" + }, + + }) +}); + +$(document).ready(function () { + $("#BulletGraph1").ejBulletGraph({ + qualitativeRangeSize: 32, + quantitativeScaleLength: 475, tooltipSettings: {template: "Tooltip", visible: true}, orientation: ej.datavisualization.BulletGraph.Orientation.Horizontal, + flowDirection: ej.datavisualization.BulletGraph.FlowDirection.Forward, + quantitativeScaleSettings: { + location: { x: 110, y: 10 }, + minimum: 0, + maximum: 10, + interval: 1, + minorTicksPerInterval: 4, + majorTickSettings:{ size: 13, width: 1, stroke: 'gray'}, + minorTickSettings:{ size: 5, width: 1, stroke: 'gray'}, + + labelSettings: { + position: ej.datavisualization.BulletGraph.LabelPosition.Below, offset: 14, size: 10 + }, + featuredMeasureSettings: { width: 6 }, + comparativeMeasureSettings:{ + width: 5 + }, + featureMeasures: [{ value: 8, comparativeMeasureValue: 6.7, category: ""}] + }, + qualitativeRanges: [{ + rangeEnd: 4.3 + }, { + rangeEnd: 7.3 + }, { + rangeEnd: 10 + }], + captionSettings: { textAngle: 0, + location: { x: 17, y: 20 }, text: "Revenue YTD", font: { color: null, fontFamily: 'Segoe UI', fontStyle: ej.datavisualization.BulletGraph.FontStyle.Normal, size: '12px', fontWeight: ej.datavisualization.BulletGraph.FontWeight.Normal, opacity: 1 }, //'#707070' + subTitle: { textAngle: 0, + text: "$ in Thousands", location: { x: 10, y: 35 }, font: { color: null, fontFamily: 'Segoe UI', fontStyle: ej.datavisualization.BulletGraph.FontStyle.Normal, size: '12px', fontWeight: ej.datavisualization.BulletGraph.FontWeight.Normal, opacity: 1} //'#707070' + } + } + + + + }); + + $("#BulletGraph2").ejBulletGraph({ qualitativeRangeSize: 32, height:140, + quantitativeScaleLength: 475, orientation: ej.datavisualization.BulletGraph.Orientation.Horizontal, + flowDirection: ej.datavisualization.BulletGraph.FlowDirection.Forward, + quantitativeScaleSettings: { + location: { x: 110, y: 10 }, + minimum: -10, + maximum: 10, + interval: 2, + minorTicksPerInterval: 4, + majorTickSettings:{ size: 13, width: 1}, + minorTickSettings:{ size: 5, width: 1}, + + labelSettings: { + position: ej.datavisualization.BulletGraph.LabelPosition.Below, offset: 14, size: 10, labelSuffix: ' %' + }, + featuredMeasureSettings: { width: 6 }, + comparativeMeasureSettings:{ width: 5 }, + featureMeasures: [{ value: 8, comparativeMeasureValue: 6.7}] + }, + qualitativeRanges: [{ + rangeEnd: -4, rangeStroke: "#61a301" + }, { + rangeEnd: 3, rangeStroke: "#fcda21" + }, { + rangeEnd: 10, rangeStroke: "#d61e3f" + }], + captionSettings: { textAngle: 0, + location: { x: 60, y: 25 }, text: "Profit", font: { color: null, fontFamily: 'Segoe UI', fontStyle: ej.datavisualization.BulletGraph.FontStyle.Normal, size: '13px', fontWeight: ej.datavisualization.BulletGraph.FontWeight.Normal, opacity: 1 }, //'#707070' + //subTitle: { textAngle: 0, + // text: "profit in %", location: { x: 35, y: 35 }, font: { color: null, fontFamily: 'Segoe UI', fontStyle: ej.datavisualization.BulletGraph.FontStyle.Normal, size: '12px', fontWeight: ej.datavisualization.BulletGraph.FontWeight.Normal, opacity: 1} //'#707070' + //} + }, + drawLabels:onBulletDrawLabel + }); + +}); + + function onBulletDrawLabel() + { + console.log("drawLabel"); + } + + +$(document).ready(function () { + + $("#barcode").ejBarcode({ text: "HTTP://WWW.SYNCFUSION.COM", symbologyType: "qrbarcode", xDimension: 8, displayText: true, load:onBarcodeLoad }); + +}); + +function onBarcodeLoad() + { + console.log("load"); + } + + jQuery(function ($) { + $("#container").ejMap({ + mouseover:MapMouseOver, + onRenderComplete:MapOnRenderComplete, + navigationControl:{enableNavigation:true,orientation:'vertical',absolutePosition:{x:5,y:15},dockPosition: 'none'}, + background:'white', + enableAnimation: true, + layers: [ + { + layerType: "geometry", + enableSelection: false, + enableMouseHover:false, + + showMapItems: false, + markerTemplate: 'template', + shapeSettings: { + fill: "#626171", + strokeThickness: "1", + stroke: "#6F6F79", + highlightStroke:"#6F6F79", + valuePath: "name", + highlightColor: "gray" + + }, + + } + ] + + }); + }); + function MapMouseOver() { + console.log("mouseover"); + } + function MapOnRenderComplete() { + console.log("onRenderComplete"); + } + + + jQuery(function ($) { + $("#treemapContainer").ejTreeMap({ + treeMapItemSelected:onTreeMapItemSelected, + + levels: [ + { groupPath: "Continent", groupGap: 5} + ], + colorValuePath: "Growth", + rangeColorMapping: [ + { color: "#DC562D", from: "0", to: "1" }, + { color: "#FED124", from: "1", to: "1.5" }, + { color: "#487FC1", from: "1.5", to: "2" }, + { color: "#0E9F49", from: "2", to: "3" } + ], + showTooltip:true, + leafItemSettings: { labelPath: "Region" } + }); + }); + function onTreeMapItemSelected() { + console.log("TreeMapItemSelected"); + } + + \ No newline at end of file diff --git a/ej.widgets.all/ej.widgets.all.d.ts b/ej.widgets.all/ej.widgets.all.d.ts new file mode 100644 index 0000000000..bd73834e52 --- /dev/null +++ b/ej.widgets.all/ej.widgets.all.d.ts @@ -0,0 +1,49995 @@ +// Type definitions for ej.widgets.all v14.1.0.41 +// Project: http://help.syncfusion.com/js/typescript +// Definitions by: Syncfusion +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/*! +* filename: ej.widgets.all.d.ts +* version : 14.1.0.41 +* Copyright Syncfusion Inc. 2001 - 2016. All rights reserved. +* Use of this code is subject to the terms of our license. +* A copy of the current license can be obtained at any time by e-mailing +* licensing@syncfusion.com. Any infringement will be prosecuted under +* applicable laws. +*/ +declare module ej { + + var dataUtil: dataUtil; + function isMobile(): boolean; + function isIOS(): boolean; + function isAndroid(): boolean; + function isFlat(): boolean; + function isWindows(): boolean; + function isCssCalc(): boolean; + function getCurrentPage(): JQuery; + function isLowerResolution(): boolean; + function browserInfo(): browserInfoOptions; + function isTouchDevice(): boolean; + function addPrefix(style: string): string; + function animationEndEvent(): string; + function blockDefaultActions(e: Object): void; + function buildTag(tag: string, innerHtml: string, styles: Object, attrs: Object): JQuery; + function cancelEvent(): string; + function copyObject(): string; + function createObject(nameSpace: string, value: Object, initIn: string): JQuery; + function defineClass(className: string, constructor:any, proto: Object, replace: boolean): Object; + function destroyWidgets(element: Object): void; + function endEvent(): string; + function event(type: string, data: any, eventProp: Object): Object; + function getAndroidVersion(): Object; + function getAttrVal(ele: Object, val: string, option: Object): Object; + function getBooleanVal(ele: Object, val: string, option: Object): Object; + function getClearString(): string; + function getDimension(element: Object, method: string): Object; + function getFontString(fontObj: Object): string; + function getFontStyle(style: string): string; + function getMaxZindex(): number; + function getNameSpace(className: string): string; + function getObject(nameSpace: string): Object; + function getOffset(ele: string): Object; + function getRenderMode(): string; + function getScrollableParents(element: Object): void; + function getTheme(): string; + function getZindexPartial(element: Object, popupEle: string): number; + function hasRenderMode(element: string): void; + function hasStyle(prop: string): boolean; + function hasTheme(element: string): string; + function hexFromRGB(color: string): string; + function ieClearRemover(element: string): void; + function isAndroidWebView(): string; + function isDevice(): boolean; + function isIOS7(): boolean; + function isIOSWebView(): boolean; + function isLowerAndroid(): boolean; + function isNullOrUndefined(value: Object): boolean; + function isPlainObject(): JQuery; + function isPortrait(): any; + function isTablet(): boolean; + function isWindowsWebView(): string; + function listenEvents(selectors:any, eventTypes: any, handlers: any, remove?: any, pluginObj?: any, disableMouse?: boolean): void; + function listenTouchEvent(selectors:any, eventTypes: any, handlers: any, remove?: any, pluginObj?: any, disableMouse?: boolean): void; + function logBase(val: string, base: string): number; + function measureText(text: string, maxwidth: number, font: string): string; + function moveEvent(): string; + function print(element: string): void; + function proxy(fn: Object, context: string, arg: string): boolean; + function round(value: string, div: string, up: string): any; + function sendAjaxRequest(ajaxOptions: Object): void; + function setCaretToPos(nput: string, pos1: string, pos2: string): void; + function setRenderMode(element: string): void; + function setTheme(): Object; + function startEvent(): string; + function tapEvent(): string; + function tapHoldEvent(): string; + function throwError(): Object; + function transitionEndEvent(): Object; + function userAgent(): boolean; + function widget(pluginName: string, className: string, proto: Object): Object; + function avg(json: Object, filedName: string): any; + function getGuid(prefix: string): number; + function group(jsonArray: any, field: string, agg: string, level: number, groupDs: string): Object; + function isJson(jsonData: string): string; + function max(jsonArray: any, fieldName: string, comparer: string): any; + function min(jsonArray: any, fieldName: string, comparer: string): any; + function merge(first: string, second: string): any; + function mergeshort(jsonArray: any, fieldName: string, comparer: string): any; + function parseJson(jsonText: string): string; + function parseTable(table: number, headerOption: string, headerRowIndex: string): Object; + function select(jsonArray: any, fields: string): any; + function setTransition(): boolean; + function sum(json: string, fieldName: string): string; + function swap(array: any, x: string, y: string): any; + var cssUA: string; + var serverTimezoneOffset: number; + var transform: string; + var transformOrigin: string; + var transformStyle: string; + var transition: string; + var transitionDelay: string; + var transitionDuration: string; + var transitionProperty: string; + var transitionTimingFunction: string; + export module device { + function isAndroid(): boolean; + function isIOS(): boolean; + function isFlat(): boolean; + function isIOS7(): boolean; + function isWindows(): boolean; + } + export module widget { + var autoInit: boolean; + var registeredInstances: Array; + var registeredWidgets: Array; + function register(pluginName: string, className: string, prototype: any): void; + function destroyAll(elements: Element): void; + function init(element: Element): void; + function registerInstance(element: Element, pluginName: string, className: string, prototype: any):void; + } + + interface browserInfoOptions { + name: string; + version: string; + culture: Object; + isMSPointerEnabled: boolean; + } + class WidgetBase { + destroy(): void; + element: JQuery; + setModel(options: Object, forceSet?: boolean):any; + option(prop?: Object, value?: Object, forceSet?: boolean): any; + persistState(): void; + restoreState(silent: boolean): void; + } + + class Widget extends WidgetBase { + constructor(pluginName: string, className: string, proto: any); + static fn: Widget; + static extend(widget: Widget): any; + register(pluginName: string, className: string, prototype: any): void; + destroyAll(elements: Element): void; + model: any; + } + + + interface BaseEvent { + cancel: boolean; + type: string; + } + class DataManager { + constructor(dataSource?: any, query?: ej.Query, adaptor?: any); + setDefaultQuery(query: ej.Query): void; + executeQuery(query?: ej.Query, done?: any, fail?: any, always?: any): JQueryPromise; + executeLocal(query?: ej.Query): ej.DataManager; + saveChanges(changes?: Changes, key?: string, tableName?: string): JQueryDeferred; + insert(data: Object, tableName: string): JQueryPromise; + remove(keyField: string, value: any, tableName: string): Object; + update(keyField: string, value: any, tableName: string): Object; + } + + class Query { + constructor(); + static fn: Query; + static extend(prototype: Object): Query; + key(field: string): ej.Query; + using(dataManager: ej.DataManager): ej.Query; + execute(dataManager: ej.DataManager, done: any, fail?: string, always?: string): any; + executeLocal(dataManager: ej.DataManager): ej.DataManager; + clone(): ej.Query; + from(tableName: any): ej.Query; + addParams(key: string, value: string): ej.Query; + expand(tables: any): ej.Query; + where(fieldName: string, operator: ej.FilterOperators, value: string, ignoreCase?: boolean): ej.Query; + where(predicate:ej.Predicate):ej.Query; + search(searchKey: any, fieldNames?: any, operator?: string, ignoreCase?: boolean): ej.Query; + sortBy(fieldName: string, comparer?: ej.SortOrder, isFromGroup?: boolean): ej.Query; + sortByDesc(fieldName: string): ej.Query; + group(fieldName: string): ej.Query; + page(pageIndex: number, pageSize: number): ej.Query; + take(nos: number): ej.Query; + skip(nos: number): ej.Query; + select(fieldNames: any): ej.Query; + hierarchy(query: ej.Query, selectorFn: any): ej.Query; + foreignKey(key: string): ej.Query; + requiresCount(): ej.Query; + range(start:number, end:number): ej.Query; + } + + class Adaptor { + constructor(ds: any); + pvt: Object; + type: ej.Adaptor; + options: AdaptorOptions; + extend(overrides: any): ej.Adaptor; + processQuery(dm: ej.DataManager, query: ej.Query):any; + processResponse(data: Object, ds: any, query: ej.Query, xhr: JQueryXHR, request?: Object, changes?: Changes): Object; + convertToQueryString(req: any, query: ej.Query, dm: ej.DataManager): JQueryParam; + } + + interface AdaptorOptions { + from?: string; + requestType?: string; + sortBy?: string; + select?: string; + skip?: string; + group?: string; + take?: string; + search?: string; + count?: string; + where?: string; + aggregates?: string; + } + + class UrlAdaptor extends ej.Adaptor { + constructor(); + processQuery(dm: ej.DataManager, query: ej.Query, hierarchyFilters?: Object): { + type: string; url: string; ejPvtData: Object; contentType?: string; data?: Object; + } + convertToQueryString(req: Object, query: ej.Query, dm: ej.DataManager): JQueryParam; + processResponse(data: Object, ds: any, query: ej.Query, xhr: JQueryXHR, request?: Object, changes?: Changes): Object; + onGroup(e: any): void; + batchRequest(dm: ej.DataManager, changes: Changes, e: any): void; + beforeSend(dm: ej.DataManager, request: any, settings?:any): void; + insert(dm: ej.DataManager, data: Object, tableName: string): { url: string; data: any }; + remove(dm: ej.DataManager, keyField: string, value: any, tableName: string): { type: string; url: string; data?: any }; + update(dm: ej.DataManager, keyField: string, value: any, tableName: string): { type: string; url: string; data: any }; + getFiltersFrom(data: Object, query: ej.Query): ej.Predicate; + } + + class ODataAdaptor extends ej.UrlAdaptor { + constructor(); + options: UrlAdaptorOptions; + onEachWhere(filter: any, requiresCast: boolean): any; + onPredicate(pred: ej.Predicate, query: ej.Query, requiresCast: boolean): string; + onComplexPredicate(pred: ej.Predicate, requiresCast: boolean): string; + onWhere(filters: Array): string; + onEachSearch(e: Object): void; + onSearch(e: Object): string; + onEachSort(e: Object): string; + onSortBy(e: Object): string; + onGroup(e: Object): string; + onSelect(e: Object): string; + onCount(e: Object): string; + beforeSend(dm: ej.DataManager, request: any, settings?: any): void; + processResponse(data: Object, ds: Object, query: ej.Query, xhr:any, request: any, changes: Changes): { + result: Object; count: number + }; + convertToQueryString(req: Object, query: ej.Query, dm: ej.DataManager): JQueryParam; + insert(dm: ej.DataManager, data: Object, tableName: string): { url: string; data: Object; } + remove(dm: ej.DataManager, keyField: string, value: any, tableName: string): { url: string; type: string; } + update(dm: ej.DataManager, keyField: string, value: any, tableName: string): { url: string; type: string; data: Object; accept: string; } + batchRequest(dm: ej.DataManager, changes: Changes, e: any): { url: string; type: string; data: Object; contentType: string; } + generateDeleteRequest(arr: Array, e: any): string; + generateInsertRequest(arr: Array, e: any): string; + generateUpdateRequest(arr: Array, e: any): string; + } + interface UrlAdaptorOptions { + requestType?: string; + accept?: string; + multipartAccept?: string; + sortBy?: string; + select?: string; + skip?: string; + take?: string; + count?: string; + where?: string; + expand?: string; + batch?: string; + changeSet?: string; + batchPre?: string; + contentId?: string; + batchContent?: string; + changeSetContent?: string; + batchChangeSetContentType?: string; + } + + class ODataV4Adaptor extends ej.ODataAdaptor { + constructor(); + options: ODataAdaptorOptions; + onCount(e: Object): string; + onEachSearch(e: Object): void; + onSearch(e: Object): string; + beforeSend(dm: ej.DataManager, request: any, settings?: any): void; + processResponse(data: Object, ds: Object, query: ej.Query, xhr:any, request: any, changes: Changes): { + result: Object; count: number + }; + + } + interface ODataAdaptorOptions { + requestType?: string; + accept?: string; + multipartAccept?: string; + sortBy?: string; + select?: string; + skip?: string; + take?: string; + count?: string; + search?: string; + where?: string; + expand?: string; + batch?: string; + changeSet?: string; + batchPre?: string; + contentId?: string; + batchContent?: string; + changeSetContent?: string; + batchChangeSetContentType?: string; + } + + class JsonAdaptor extends ej.Adaptor { + constructor(); + processQuery(ds: Object, query: ej.Query): string; + batchRequest(dm: ej.DataManager, changes: Changes, e:any): Changes; + onWhere(ds: Object, e: any): any; + onSearch(ds: Object, e: any): any + onSortBy(ds: Object, e: any, query: ej.Query): Object; + onGroup(ds: Object, e: any, query: ej.Query): Object; + onPage(ds: Object, e: any, query: ej.Query): Object; + onRange(ds: Object, e: any): Object; + onTake(ds: Object, e: any): Object; + onSkip(ds: Object, e: any): Object; + onSelect(ds: Object, e: any): Object; + insert(dm: ej.DataManager, data: any): Object; + remove(dm: ej.DataManager, keyField: string, value:any, tableName: string): Object; + update(dm: ej.DataManager, keyField: string, value:any, tableName: string): Object; + } + class TableModel { + constructor(name: string, jsonArray: Array, dataManager: ej.DataManager, modelComputed: any); + on(eventName: string, handler: any): void; + off(eventName: string, handler: any): void; + setDataManager(dataManager: DataManager): void; + saveChanges(): void; + rejectChanges(): void; + insert(json: any): void; + update(value: any): void; + remove(key: string): void; + isDirty(): boolean; + getChanges(): Changes; + toArray(): Array; + setDirty(dirty:any, model:any): void; + get(index: number): void; + length(): number; + bindTo(element: any): void; + } + class Model { + constructor(json: any, table: string, name: string); + formElements: Array; + computes(value: any): void; + on(eventName: string, handler: any): void; + off(eventName: string, handler: any): void; + set(field: string, value: any): void; + get(field: string): any; + revert(suspendEvent: any): void; + save(dm: ej.DataManager, key: string): void; + markCommit(): void; + markDelete(): void; + changeState(state: boolean, args: any): void; + properties(): any; + bindTo(element: any): void; + unbind(element: any): void; + } + interface Changes { + changed?: Array; + added?: Array; + deleted?: Array; + } + class Predicate { + constructor(field: string, operator: ej.FilterOperators, value: any, ignoreCase: boolean); + and(field: string, operator: any, value:any, ignoreCase:boolean): void; + or(field: string, operator: any, value: any, ignoreCase: boolean): void; + validate(record: Object): boolean; + toJSON(): { + isComplex: boolean; + field: string; + operator: string; + value: any; + ignoreCase: boolean; + condition: string; + predicates: any; + }; + } + interface dataUtil { + swap(array: Array, x: number, y: number): void; + mergeSort(jsonArray: Array, fieldName: string, comparer:any): Array; + max(jsonArray: Array, fieldName: string, comparer: string): Array; + min(jsonArray: Array, fieldName: string, comparer: string): Array; + distinct(jsonArray: Array, fieldName: string, requiresCompleteRecord:any): Array; + sum(json:any, fieldName: string): number; + avg(json:any, fieldName: string): number; + select(jsonArray: Array, fieldName: string, fields:string): Array; + group(jsonArray: Array, field: string, /* internal */ level: number): Array; + parseTable(table: string, headerOption: ej.headerOption, headerRowIndex: number): Object; + } + interface AjaxSettings { + type?: string; + cache: boolean; + data?: any; + dataType?: string; + contentType?: any; + async?: boolean; + } + enum FilterOperators { + contains, + endsWith, + equal, + greaterThan, + greaterThanOrEqual, + lessThan, + lessThanOrEqual, + notEqual, + startsWith + } + + enum MatrixDefaults { + m11, + m12, + m21, + m22, + offsetX, + offsetY, + type + } + enum MatrixTypes { + Identity, + Scaling, + Translation, + Unknown + } + + enum Orientation { + Horizontal, + Vertical + } + + enum SliderType { + Default, + MinRange, + Range + } + + enum eventType { + click, + mouseDown, + mouseLeave, + mouseMove, + mouseUp + } + enum headerOption { + row, + tHead + } + + enum filterType{ + StartsWith, + Contains, + EndsWith, + LessThan, + GreaterThan, + LessThanOrEqual , + GreaterThanOrEqual, + Equal, + NotEqual + } + enum Animation{ + Fade, + None, + Slide + } + enum Type{ + Overlay, + Slide + } +class Draggable extends ej.Widget { + static fn: Draggable; + constructor(element: JQuery, options?: DraggableOptions); + constructor(element: Element, options?: DraggableOptions); + model: DraggableOptions; +} + +interface DraggableOptions { + scope?: string; + handle?: Object; + dragArea?: Object; + clone?: boolean; + distance?: number; + helper?: any; + cursorAt?: DragAtPositon; + destroy? (e: DraggableEvent): void; + drag? (e: DraggableDragEvent): void; + dragStart? (e: DraggableDragStartEvent): void; + dragStop? (e: DraggableDragStopEvent): void; + +} + +interface DragAtPositon { + top?: number; + left?: number; +} + +interface DraggableEvent extends ej.BaseEvent { + model: DraggableOptions; +} +interface DraggableDragStartEvent extends ej.BaseEvent, DraggableEvent { + element: Object; + target: Object; +} +interface DraggableDragStopEvent extends ej.BaseEvent, DraggableEvent { + element: Object; + target: Object; +} +interface DraggableDragEvent extends ej.BaseEvent, DraggableEvent { + element: Object; + target: Object; +} +class Droppable extends ej.Widget { + static fn: Droppable; + constructor(element: JQuery, options?: DroppableOptions); + constructor(element: Element, options?: DroppableOptions); + model: DroppableOptions; +} + +interface DroppableOptions { + scope?: string; + accept?: Object; + drop? (e: DroppableDropEvent): void; + over? (e: DroppableOverEvent): void; + out? (e: DroppableOutEvent): void; +} + +interface DroppableEvent extends ej.BaseEvent { + model: DroppableOptions; +} +interface DroppableDropEvent extends ej.BaseEvent, DraggableEvent { + targetElement: Object; +} +interface DroppableOverEvent extends ej.BaseEvent, DraggableEvent { + targetElement: Object; +} +interface DroppableOutEvent extends ej.BaseEvent, DraggableEvent { + targetElement: Object; +} +class Resizable extends ej.Widget { + static fn: Resizable; + constructor(element: JQuery, options?: ResizableOptions); + constructor(element: Element, options?: ResizableOptions); + model: ResizableOptions; +} + +interface ResizableOptions { + scope?: string; + handle?: Object; + distance?: number; + cursorAt?: resizeAtPositon; + helper?: any; + maxHeight?: (number|string); + maxWidth?: (number|string); + minHeight?: (number|string); + minWidth?: (number|string); + destroy? (e: ResizeEvent): void; + resizeStart? (e: ResizableStartEvent): void; + resize? (e: ResizableEvent): void; + resizeStop? (e: ResizableStopEvent): void; +} + +interface resizeAtPositon { + top?: number; + left?: number; +} + +interface ResizeEvent extends ej.BaseEvent { + model: ResizableOptions; +} +interface ResizableStartEvent extends ej.BaseEvent, ResizeEvent { + targetElement: Object; +} +interface ResizableEvent extends ej.BaseEvent, ResizeEvent { + targetElement: Object; +} +interface ResizableStopEvent extends ej.BaseEvent, ResizeEvent { + targetElement: Object; +} + + var globalize:globalize; + var cultures:culture; + function addCulture(name: string, culture ?: any): void; + function preferredCulture(culture ?: string): culture; + function format(value: any, format: string, culture ?: string): string; + function parseInt(value: string, radix?: any, culture ?: string): number; + function parseFloat(value: string, radix?: any, culture ?: string): number; + function parseDate(value: string, format: string, culture ?: string): Date; + function getLocalizedConstants(controlName: string, culture ?: string): any; + +interface globalize { + addCulture(name: string, culture?: any): void; + preferredCulture(culture?: string): culture; + format(value: any, format: string, culture?: string): string; + parseInt(value: string, radix?: any, culture?: string): number; + parseFloat(value: string, radix?: any, culture?: string): number; + parseDate(value: string, format: string, culture?: string): Date; + getLocalizedConstants(controlName: string, culture?: string): any; + } + interface culture { + name?: string; + englishName?: string; + namtiveName?: string; + language?: string; + isRTL: boolean; + numberFormat?: formatSettings; + calendars?: calendarsSettings; + } + interface formatSettings { + pattern: Array; + decimals: number; + groupSizes: Array; + percent: percentSettings; + currency: currencySettings; + } + interface percentSettings { + pattern: Array; + decimals: number; + groupSizes: Array; + symbol: string; + } + interface currencySettings { + pattern: Array; + decimals: number; + groupSizes: Array; + symbol: string; + } + interface calendarsSettings { + standard: standardSettings; + } + interface standardSettings { + firstDay: number; + days: daySettings; + months: monthSettings; + AM: Array; + PM: Array; + twoDigitYearMax: number; + patterns: patternSettings; + } + interface daySettings { + names: Array; + namesAbbr: Array; + namesShort: Array; + } + interface monthSettings { + names: Array; + namesAbbr: Array; + } + interface patternSettings { + d: string; + D: string; + t: string; + T: string; + f: string; + F: string; + M: string; + Y: string; + S: string; + } +class Scroller extends ej.Widget { + static fn: Scroller; + constructor(element: JQuery, options?: Scroller.Model); + constructor(element: Element, options?: Scroller.Model); + model:Scroller.Model; + defaults:Scroller.Model; + + /** destroy the Scroller control, unbind the all ej control related events automatically and bring the control to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** User disables the Scroller control at any time. + * @returns {void} + */ + disable(): void; + + /** User enables the Scroller control at any time. + * @returns {void} + */ + enable(): void; + + /** Returns true if horizontal scrollbar is shown, else return false. + * @returns {boolean} + */ + isHScroll(): boolean; + + /** Returns true if vertical scrollbar is shown, else return false. + * @returns {boolean} + */ + isVScroll(): boolean; + + /** User refreshes the Scroller control at any time. + * @returns {void} + */ + refresh(): void; + + /** Scroller moves to given pixel in X (left) position. We can also specify the animation speed,in which the scroller has to move while re-positioning it. + * @returns {void} + */ + scrollX(): void; + + /** Scroller moves to given pixel in Y (top) position. We can also specify the animation speed,in which the scroller has to move while re-positioning it. + * @returns {void} + */ + scrollY(): void; +} +export module Scroller{ + +export interface Model { + + /**Set true to hides the scrollbar, when mouseout the content area. + * @Default {false} + */ + autoHide?: boolean; + + /**Specifies the height and width of button in the scrollbar. + * @Default {18} + */ + buttonSize?: number; + + /**Specifies to enable or disable the scroller + * @Default {true} + */ + enabled?: boolean; + + /**Save current model value to browser cookies for state maintenance. While refresh the page Rating control values are retained. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Indicates the Right to Left direction to scroller + * @Default {undefined} + */ + enableRTL?: boolean; + + /**Enables or Disable the touch Scroll + * @Default {true} + */ + enableTouchScroll?: boolean; + + /**Specifies the height of Scroll panel and scrollbars. + * @Default {250} + */ + height?: number; + + /**If the scrollbar has vertical it set as width, else it will set as height of the handler. + * @Default {18} + */ + scrollerSize?: number; + + /**The Scroller content and scrollbars move left with given value. + * @Default {0} + */ + scrollLeft?: number; + + /**While press on the arrow key the scrollbar position added to the given pixel value. + * @Default {57} + */ + scrollOneStepBy?: number; + + /**The Scroller content and scrollbars move to top position with specified value. + * @Default {0} + */ + scrollTop?: number; + + /**Indicates the target area to which scroller have to appear. + * @Default {null} + */ + targetPane?: string; + + /**Specifies the width of Scroll panel and scrollbars. + * @Default {0} + */ + width?: number; + + /**Fires when Scroller control is created.*/ + create? (e: CreateEventArgs): void; + + /**Fires when Scroller control is destroyed.*/ + destroy? (e: DestroyEventArgs): void; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the scroller model + */ + model?: ej.Scroller.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the scroller model + */ + model?: ej.Scroller.Model; + + /**returns the name of the event. + */ + type?: string; +} +} + +class Accordion extends ej.Widget { + static fn: Accordion; + constructor(element: JQuery, options?: Accordion.Model); + constructor(element: Element, options?: Accordion.Model); + model:Accordion.Model; + defaults:Accordion.Model; + + /** AddItem method is used to add the panel in dynamically. It receives the following parameters + * @param {string} specify the name of the header + * @param {string} content of the new panel + * @param {number} insertion place of the new panel + * @param {boolean} Enable or disable the ajax request to the added panel + * @returns {void} + */ + addItem(header_name: string, content: string, index: number, isAjaxReq: boolean): void; + + /** This method used to collapse the all the expanded items in accordion at a time. + * @returns {void} + */ + collapseAll(): void; + + /** destroy the Accordion widget all events bound using this._on will be unbind automatically and bring the control to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** Disables the accordion widget includes all the headers and content panels. + * @returns {void} + */ + disable(): void; + + /** Disable the accordion widget item based on specified header index. + * @param {Array} index values to disable the panels + * @returns {void} + */ + disableItems(index: Array): void; + + /** Enable the accordion widget includes all the headers and content panels. + * @returns {void} + */ + enable(): void; + + /** Enable the accordion widget item based on specified header index. + * @param {Array} index values to enable the panels + * @returns {void} + */ + enableItems(index: Array): void; + + /** To expand all the accordion widget items. + * @returns {void} + */ + expandAll(): void; + + /** Returns the total number of panels in the control. + * @returns {number} + */ + getItemsCount(): number; + + /** Hides the visible Accordion control. + * @returns {void} + */ + hide(): void; + + /** The refresh method is used to adjust the control size based on the parent element dimension. + * @returns {void} + */ + refresh(): void; + + /** RemoveItem method is used to remove the specified index panel.It receives the parameter as number. + * @param {number} specify the index value for remove the accordion panel. + * @returns {void} + */ + removeItem( index : number): void; + + /** Shows the hidden Accordion control. + * @returns {void} + */ + show(): void; +} +export module Accordion{ + +export interface Model { + + /**Specifies the ajaxSettings option to load the content to the accordion control. + * @Default {null} + */ + ajaxSettings?: AjaxSettings; + + /**Accordion headers can be expanded and collapsed on keyboard action. + * @Default {true} + */ + allowKeyboardNavigation?: boolean; + + /**To set the Accordion headers Collapse Speed. + * @Default {300} + */ + collapseSpeed?: number; + + /**Specifies the collapsible state of accordion control. + * @Default {false} + */ + collapsible?: boolean; + + /**Sets the root CSS class for Accordion theme, which is used customize. + */ + cssClass?: string; + + /**Allows you to set the custom header Icon. It accepts two key values “header”, ”selectedHeader”. + * @Default {{ header: e-collapse, selectedHeader: e-expand }} + */ + customIcon?: CustomIcon; + + /**Disables the specified indexed items in accordion. + * @Default {[]} + */ + disabledItems?: number[]; + + /**Specifies the animation behavior in accordion. + * @Default {true} + */ + enableAnimation?: boolean; + + /**With this enabled property, you can enable or disable the Accordion. + * @Default {true} + */ + enabled?: boolean; + + /**Used to enable the disabled items in accordion. + * @Default {[]} + */ + enabledItems?: number[]; + + /**Multiple content panels to activate at a time. + * @Default {false} + */ + enableMultipleOpen?: boolean; + + /**Save current model value to browser cookies for maintaining states. When refreshing the accordion control page, the model value is applied from browser cookies or HTML 5local storage. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Display headers and panel text from right-to-left. + * @Default {false} + */ + enableRTL?: boolean; + + /**The events API binds the action for activating the accordion header. Users can activate the header by using mouse actions such as mouse-over, mouse-up, mouse-down, and soon. + * @Default {click} + */ + events?: string; + + /**To set the Accordion headers Expand Speed. + * @Default {300} + */ + expandSpeed?: number; + + /**Sets the height for Accordion items header. + */ + headerSize?: number|string; + + /**Specifies height of the accordion. + * @Default {null} + */ + height?: number|string; + + /**Adjusts the content panel height based on the given option (content, auto, or fill). By default, the panel heights are adjusted based on the content. + * @Default {content} + */ + heightAdjustMode?: ej.Accordion.HeightAdjustMode|string; + + /**It allows to define the characteristics of the Accordion control. It will helps to extend the capability of an HTML element. + * @Default {{}} + */ + htmlAttributes?: any; + + /**The given index header will activate (open). If collapsible is set to true, and a negative value is given, then all headers are collapsed. Otherwise, the first panel isactivated. + * @Default {0} + */ + selectedItemIndex?: number|string; + + /**Activate the specified indexed items of the accordion + * @Default {[0]} + */ + selectedItems?: number[]; + + /**Used to determines the close button visibility an each accordion items. This close button helps to remove the accordion item from the control. + * @Default {false} + */ + showCloseButton?: boolean; + + /**Displays rounded corner borders on the Accordion control's panels and headers. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Specifies width of the accordion. + * @Default {null} + */ + width?: number|string; + + /**Triggered after a Accordion item is active or inactive. Argument values are activeIndex, activeHeader, inActiveHeader, inActiveIndex and current model value.*/ + activate? (e: ActivateEventArgs): void; + + /**Triggered before the AJAX content is loaded in a content panel. Arguments have location of the content (URL) and current model value.*/ + ajaxBeforeLoad? (e: AjaxBeforeLoadEventArgs): void; + + /**Triggered after AJAX load failed action. Arguments have URL, error message, and current model value.*/ + ajaxError? (e: AjaxErrorEventArgs): void; + + /**Triggered after the AJAX content loads. Arguments have current model values.*/ + ajaxLoad? (e: AjaxLoadEventArgs): void; + + /**Triggered after AJAX success action. Arguments have URL, content, and current model values.*/ + ajaxSuccess? (e: AjaxSuccessEventArgs): void; + + /**Triggered before a tab item is active. Arguments have active index and model values.*/ + beforeActivate? (e: BeforeActivateEventArgs): void; + + /**Triggered after a Accordion item is active or inactive. Argument values are activeIndex, activeHeader, inActiveHeader, inActiveIndex and current model value.*/ + beforeInactivate? (e: BeforeInactivateEventArgs): void; + + /**Triggered after Accordion control creation.*/ + create? (e: CreateEventArgs): void; + + /**Triggered after Accordion control destroy.*/ + destroy? (e: DestroyEventArgs): void; + + /**Triggered after a Accordion item is active or inactive. Argument values are activeIndex, activeHeader, inActiveHeader, inActiveIndex and current model value.*/ + inActivate? (e: InActivateEventArgs): void; +} + +export interface ActivateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the accordion model + */ + model ?: ej.Accordion.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns active index + */ + activeIndex ?: number; + + /**returns current active header + */ + activeHeader ?: any; + + /**returns true when the Accordion index activated by user interaction otherwise returns false + */ + isInteraction ?: boolean; +} + +export interface AjaxBeforeLoadEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the accordion model + */ + model ?: ej.Accordion.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns current ajax content location + */ + url ?: string; +} + +export interface AjaxErrorEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the accordion model + */ + model ?: ej.Accordion.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns current ajax content location + */ + url ?: string; + + /**returns the failed data sent. + */ + data ?: string; +} + +export interface AjaxLoadEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the accordion model + */ + model ?: ej.Accordion.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the name of the url + */ + url ?: string; +} + +export interface AjaxSuccessEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the accordion model + */ + model ?: ej.Accordion.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns current ajax content location + */ + url ?: string; + + /**returns the successful data sent. + */ + data ?: string; + + /**returns the ajax content. + */ + content ?: string; +} + +export interface BeforeActivateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the accordion model + */ + model ?: ej.Accordion.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns active index + */ + activeIndex ?: number; + + /**returns true when the Accordion index activated by user interaction otherwise returns false + */ + isInteraction ?: boolean; +} + +export interface BeforeInactivateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the accordion model + */ + model ?: ej.Accordion.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns active index + */ + inActiveIndex ?: number; + + /**returns true when the Accordion index activated by user interaction otherwise returns false + */ + isInteraction ?: boolean; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the accordion model + */ + model ?: ej.Accordion.Model; + + /**returns the name of the event + */ + type ?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the accordion model + */ + model ?: ej.Accordion.Model; + + /**returns the name of the event + */ + type ?: string; +} + +export interface InActivateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the accordion model + */ + model ?: ej.Accordion.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns active index + */ + inActiveIndex ?: number; + + /**returns in active element + */ + inActiveHeader ?: any; + + /**returns true when the Accordion index activated by user interaction otherwise returns false + */ + isInteraction ?: boolean; +} + +export interface AjaxSettings { + + /**It specifies, whether to enable or disable asynchronous request. + */ + async?: boolean; + + /**It specifies the page will be cached in the web browser. + */ + cache?: boolean; + + /**It specifies the type of data is send in the query string. + */ + contentType?: string; + + /**It specifies the data as an object, will be passed in the query string. + */ + data?: any; + + /**It specifies the type of data that you're expecting back from the response. + */ + dataType?: string; + + /**It specifies the HTTP request type. + */ + type?: string; +} + +export interface CustomIcon { + + /**This class name set to collapsing header. + */ + header?: string; + + /**This class name set to expanded (active) header. + */ + selectedHeader?: string; +} + +enum HeightAdjustMode{ + + ///Height fit to the content in the panel + Content, + + ///Height set to the largest content in the panel + Auto, + + ///Height filled to the content of the panel + Fill +} + +} + +class Autocomplete extends ej.Widget { + static fn: Autocomplete; + constructor(element: JQuery, options?: Autocomplete.Model); + constructor(element: Element, options?: Autocomplete.Model); + model:Autocomplete.Model; + defaults:Autocomplete.Model; + + /** Clears the text in the Autocomplete textbox. + * @returns {void} + */ + clearText(): void; + + /** Destroys the Autocomplete widget. + * @returns {void} + */ + destroy(): void; + + /** Disables the autocomplete widget. + * @returns {void} + */ + disable(): void; + + /** Enables the autocomplete widget. + * @returns {void} + */ + enable(): void; + + /** Returns objects (data object) of all the selected items in the autocomplete textbox. + * @returns {void} + */ + getSelectedItems(): void; + + /** Returns the current selected value from the Autocomplete textbox. + * @returns {void} + */ + getValue(): void; + + /** Search the entered text and show it in the suggestion list if available. + * @returns {void} + */ + search(): void; + + /** Open up the autocomplete suggestion popup with all list items. + * @returns {void} + */ + open(): void; + + /** Sets the value of the Autocomplete textbox based on the given key value. + * @param {string} The key value of the specific suggestion item. + * @returns {void} + */ + selectValueByKey(Key: string): void; + + /** Sets the value of the Autocomplete textbox based on the given input text value. + * @param {string} The text (label) value of the specific suggestion item. + * @returns {void} + */ + selectValueByText(Text: string): void; +} +export module Autocomplete{ + +export interface Model { + + /**Customize "Add New" text (label) to be added in the autocomplete popup list for the entered text when there are no suggestions for it. + * @Default {Add New} + */ + addNewText?: boolean; + + /**Allows new values to be added to the autocomplete input other than the values in the suggestion list. Normally, when there are no suggestions it will display “No suggestions” label in the popup. + * @Default {false} + */ + allowAddNew?: boolean; + + /**Enables or disables the sorting of suggestion list item. The default sort order is ascending order. You customize sort order. + * @Default {true} + */ + allowSorting?: boolean; + + /**To focus the items in the suggestion list when the popup is shown. By default first item will be focused. + * @Default {false} + */ + autoFocus?: boolean; + + /**Enables or disables the case sensitive search. + * @Default {false} + */ + caseSensitiveSearch?: boolean; + + /**The root class for the Autocomplete textbox widget which helps in customizing its theme. + * @Default {””} + */ + cssClass?: string; + + /**The data source contains the list of data for the suggestions list. It can be a string array or json array. + * @Default {null} + */ + dataSource?: any|Array; + + /**The time delay (in milliseconds) after which the suggestion popup will be shown. + * @Default {200} + */ + delaySuggestionTimeout?: number; + + /**The special character which acts as a separator for the given words for multi-mode search i.e. the text after the delimiter are considered as a separate word or query for search operation. + * @Default {’,’} + */ + delimiterChar?: string; + + /**The text to be displayed in the popup when there are no suggestions available for the entered text. + * @Default {“No suggestions”} + */ + emptyResultText?: string; + + /**Fills the autocomplete textbox with the first matched item from the suggestion list automatically based on the entered text when enabled. + * @Default {false} + */ + enableAutoFill?: boolean; + + /**Enables or disables the Autocomplete textbox widget. + * @Default {true} + */ + enabled?: boolean; + + /**Enables or disables displaying the duplicate names present in the search result. + * @Default {false} + */ + enableDistinct?: boolean; + + /**Allows the current model values to be saved in local storage or browser cookies for state maintenance when it is set to true. While refreshing the page, it retains the model value from browser cookies or local storage. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Displays the Autocomplete widget’s content from right to left when enabled. + * @Default {false} + */ + enableRTL?: boolean; + + /**Mapping fields for the suggestion items of the Autocomplete textbox widget. + * @Default {null} + */ + fields?: any; + + /**Specifies the search filter type. There are several types of search filter available such as ‘startswith’, ‘contains’, ‘endswith’, ‘lessthan’, ‘lessthanorequal’, ‘greaterthan’, ‘greaterthanorequal’, ‘equal’, ‘notequal’. + * @Default {ej.filterType.StartsWith} + */ + filterType?: string; + + /**The height of the Autocomplete textbox. + * @Default {null} + */ + height?: string; + + /**The search text can be highlighted in the AutoComplete suggestion list when enabled. + * @Default {false} + */ + highlightSearch?: boolean; + + /**Number of items to be displayed in the suggestion list. + * @Default {0} + */ + itemsCount?: number; + + /**Minimum number of character to be entered in the Autocomplete textbox to show the suggestion list. + * @Default {1} + */ + minCharacter?: number; + + /**Enables or disables selecting multiple values from the suggestion list. Multiple values can be selected through either of the following options, + * @Default {ej.MultiSelectMode.None} + */ + multiSelectMode?: ej.Autocomplete.MultiSelectMode|string; + + /**The height of the suggestion list. + * @Default {“152px”} + */ + popupHeight?: string; + + /**The width of the suggestion list. + * @Default {“auto”} + */ + popupWidth?: string; + + /**The query to retrieve the data from the data source. + * @Default {null} + */ + query?: ej.Query|string; + + /**Indicates that the autocomplete textbox values can only be readable. + * @Default {false} + */ + readOnly?: boolean; + + /**Enables or disables showing the message when there are no suggestions for the entered text. + * @Default {true} + */ + showEmptyResultText?: boolean; + + /**Enables or disables the loading icon to intimate the searching operation. The loading icon is visible when there is a time delay to perform the search. + * @Default {true} + */ + showLoadingIcon?: boolean; + + /**Enables the showPopup button in autocomplete textbox. When the Showpopup button is clicked, it displays all the available data from the data source. + * @Default {false} + */ + showPopupButton?: boolean; + + /**Enables or disables rounded corner. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Sort order specifies whether the suggestion list values has to be displayed in ascending or descending order. + * @Default {ej.SortOrder.Ascending} + */ + sortOrder?: ej.Autocomplete.SortOrder|string; + + /**The template to display the suggestion list items with customized appearance. + * @Default {null} + */ + template?: string; + + /**The jQuery validation error message to be displayed on form validation. + * @Default {null} + */ + validationMessage?: any; + + /**The jQuery validation rules for form validation. + * @Default {null} + */ + validationRules?: any; + + /**The value to be displayed in the autocomplete textbox. + * @Default {null} + */ + value?: string; + + /**Enables or disables the visibility of the autocomplete textbox. + * @Default {true} + */ + visible?: boolean; + + /**The text to be displayed when the value of the autocomplete textbox is empty. + * @Default {null} + */ + watermarkText?: string; + + /**The width of the Autocomplete textbox. + * @Default {null} + */ + width?: string; + + /**Triggers when the data requested from AJAX will get successfully loaded in the Autocomplete widget.*/ + actionSuccess? (e: ActionSuccessEventArgs): void; + + /**Triggers when the AJAX requests complete. The request may get failed or succeed.*/ + actionComplete? (e: ActionCompleteEventArgs): void; + + /**Triggers when the data requested from AJAX get failed.*/ + actionFailure? (e: ActionFailureEventArgs): void; + + /**Triggers when the text box value is changed.*/ + change? (e: ChangeEventArgs): void; + + /**Triggers after the suggestion popup is closed.*/ + close? (e: CloseEventArgs): void; + + /**Triggers when Autocomplete widget is created.*/ + create? (e: CreateEventArgs): void; + + /**Triggers after the Autocomplete widget is destroyed.*/ + destroy? (e: DestroyEventArgs): void; + + /**Triggers after the autocomplete textbox is focused.*/ + focusIn? (e: FocusInEventArgs): void; + + /**Triggers after the Autocomplete textbox gets out of the focus.*/ + focusOut? (e: FocusOutEventArgs): void; + + /**Triggers after the suggestion list is opened.*/ + open? (e: OpenEventArgs): void; + + /**Triggers when an item has been selected from the suggestion list.*/ + select? (e: SelectEventArgs): void; +} + +export interface ActionSuccessEventArgs { +} + +export interface ActionCompleteEventArgs { +} + +export interface ActionFailureEventArgs { +} + +export interface ChangeEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the autocomplete model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; + + /**Value of the autocomplete textbox. + */ + value?: string; +} + +export interface CloseEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the autocomplete model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; +} + +export interface CreateEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the autocomplete model object. + */ + model?: ej.Autocomplete.Model; + + /**Name of the event. + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the autocomplete model object. + */ + model?: ej.Autocomplete.Model; + + /**Name of the event. + */ + type?: string; +} + +export interface FocusInEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the autocomplete model object. + */ + model?: ej.Autocomplete.Model; + + /**Name of the event. + */ + type?: string; + + /**Value of the autocomplete textbox. + */ + value?: string; +} + +export interface FocusOutEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the autocomplete model object. + */ + model?: ej.Autocomplete.Model; + + /**Name of the event. + */ + type?: string; + + /**Value of the autocomplete textbox. + */ + value?: string; +} + +export interface OpenEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the autocomplete model object. + */ + model?: ej.Autocomplete.Model; + + /**Name of the event. + */ + type?: string; +} + +export interface SelectEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the autocomplete model object. + */ + model?: ej.Autocomplete.Model; + + /**Name of the event. + */ + type?: string; + + /**Value of the autocomplete textbox. + */ + value?: string; + + /**Text of the selected item. + */ + text?: string; + + /**Key of the selected item. + */ + key?: string; + + /**Data object of the selected item. + */ + Item?: ej.Autocomplete.Model; +} + +enum MultiSelectMode{ + + ///Multiple values are separated using a given special character. + Delimiter, + + ///Each values are displayed in separate box with close button. + VisualMode +} + + +enum SortOrder{ + + ///Items to be displayed in the suggestion list in ascending order. + Ascending, + + ///Items to be displayed in the suggestion list in descending order. + Descending +} + +} + +class Button extends ej.Widget { + static fn: Button; + constructor(element: JQuery, options?: Button.Model); + constructor(element: Element, options?: Button.Model); + model:Button.Model; + defaults:Button.Model; + + /** destroy the button widget all events bound using this._on will be unbind automatically and bring the control to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** To disable the button + * @returns {void} + */ + disable(): void; + + /** To enable the button + * @returns {void} + */ + enable(): void; +} +export module Button{ + +export interface Model { + + /**Specifies the contentType of the Button. See below to know available ContentType + * @Default {ej.ContentType.TextOnly} + */ + contentType?: ej.ContentType|string; + + /**Sets the root CSS class for Button theme, which is used customize. + */ + cssClass?: string; + + /**Specifies the button control state. + * @Default {true} + */ + enabled?: boolean; + + /**Specify the Right to Left direction to button + * @Default {false} + */ + enableRTL?: boolean; + + /**Specifies the height of the Button. + * @Default {28} + */ + height?: number; + + /**It allows to define the characteristics of the Button control. It will helps to extend the capability of an HTML element. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Specifies the image position of the Button. This image position is applicable only with the textandimage contentType property. The images can be positioned in both imageLeft and imageRight options. See below to know about available ImagePosition + * @Default {ej.ImagePosition.ImageLeft} + */ + imagePosition?: ej.ImagePosition|string; + + /**Specifies the primary icon for Button. This icon will be displayed from the left margin of the button. + * @Default {null} + */ + prefixIcon?: string; + + /**Convert the button as repeat button. It raises the 'Click' event repeatedly from the it is pressed until it is released. + * @Default {false} + */ + repeatButton?: boolean; + + /**Displays the Button with rounded corners. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Specifies the size of the Button. See below to know available ButtonSize + * @Default {ej.ButtonSize.Normal} + */ + size?: ej.ButtonSize|string; + + /**Specifies the secondary icon for Button. This icon will be displayed from the right margin of the button. + * @Default {null} + */ + suffixIcon?: string; + + /**Specifies the text content for Button. + * @Default {null} + */ + text?: string; + + /**Specified the time interval between two consecutive 'click' event on the button. + * @Default {150} + */ + timeInterval?: string; + + /**Specifies the Type of the Button. See below to know available ButtonType + * @Default {ej.ButtonType.Submit} + */ + type?: ej.ButtonType|string; + + /**Specifies the width of the Button. + * @Default {100} + */ + width?: number; + + /**Fires when Button control is clicked successfully.Consider the scenario to perform any validation,modification of content or any other operations click on button,we can make use of this click event to achieve the scenario.*/ + click? (e: ClickEventArgs): void; + + /**Fires after Button control is created.If the user want to perform any operation after the button control creation then the user can make use of this create event.*/ + create? (e: CreateEventArgs): void; + + /**Fires when the button is destroyed successfully.If the user want to perform any operation after the destroy button control then the user can make use of this destroy event.*/ + destroy? (e: DestroyEventArgs): void; +} + +export interface ClickEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the button model + */ + model?: ej.Button.Model; + + /**returns the name of the event + */ + type?: string; + + /**return the button state + */ + status?: boolean; + + /**return the event model for sever side processing. + */ + e?: any; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the button model + */ + model?: ej.Button.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the button model + */ + model?: ej.Button.Model; + + /**returns the name of the event + */ + type?: string; +} +} +enum ContentType +{ +//To display the text content only in button +TextOnly, +//To display the image only in button +ImageOnly, +//Supports to display image for both ends of the button +ImageBoth, +//Supports to display image with the text content +TextAndImage, +//Supports to display image with both ends of the text +ImageTextImage, +} +enum ImagePosition +{ +//support for aligning text in left and image in right +ImageRight, +//support for aligning text in right and image in left +ImageLeft, +//support for aligning text in bottom and image in top. +ImageTop, +//support for aligning text in top and image in bottom +ImageBottom, +} +enum ButtonSize +{ +//Creates button with inbuilt default size height, width specified +Normal, +//Creates button with inbuilt mini size height, width specified +Mini, +//Creates button with inbuilt small size height, width specified +Small, +//Creates button with inbuilt medium size height, width specified +Medium, +//Creates button with inbuilt large size height, width specified +Large, +} +enum ButtonType +{ +//Creates button with inbuilt button type specified +Button, +//Creates button with inbuilt reset type specified +Reset, +//Creates button with inbuilt submit type specified +Submit, +} + +class Captcha extends ej.Widget { + static fn: Captcha; + constructor(element: JQuery, options?: Captcha.Model); + constructor(element: Element, options?: Captcha.Model); + model:Captcha.Model; + defaults:Captcha.Model; +} +export module Captcha{ + +export interface Model { + + /**Specifies the character set of the Captcha that will be used to generate captcha text randomly. + */ + characterSet?: string; + + /**Specifies the error message to be displayed when the Captcha mismatch. + */ + customErrorMessage?: string; + + /**Set the Captcha validation automatically. + */ + enableAutoValidation?: boolean; + + /**Specifies the case sensitivity for the characters typed in the Captcha. + */ + enableCaseSensitivity?: boolean; + + /**Specifies the background patterns for the Captcha. + */ + enablePattern?: boolean; + + /**Sets the Captcha direction as right to left alignment. + */ + enableRTL?: boolean; + + /**Specifies the background apperance for the captcha. + */ + hatchStyle?: ej.HatchStyle|string; + + /**Specifies the height of the Captcha. + */ + height?: number; + + /**Specifies the method with values to be mapped in the Captcha. + */ + mapper?: string; + + /**Specifies the maximum number of characters used in the Captcha. + */ + maximumLength?: number; + + /**Specifies the minimum number of characters used in the Captcha. + */ + minimumLength?: number; + + /**Specifies the method to map values to Captcha. + */ + requestMapper?: string; + + /**Sets the Captcha with audio support, that enables to dictate the captcha text. + */ + showAudioButton?: boolean; + + /**Sets the Captcha with a refresh button. + */ + showRefreshButton?: boolean; + + /**Specifies the target button of the Captcha to validate the entered text and captcha text. + */ + targetButton?: string; + + /**Specifies the target input element that will verify the Captcha. + */ + targetInput?: string; + + /**Specifies the width of the Captcha. + */ + width?: number; + + /**Fires when captch refresh begins.*/ + refreshBegin? (e: RefreshBeginEventArgs): void; + + /**Fires after captch refresh completed.*/ + refreshComplete? (e: RefreshCompleteEventArgs): void; + + /**Fires when captch refresh fails to load.*/ + refreshFailure? (e: RefreshFailureEventArgs): void; + + /**Fires after captch refresh succeeded.*/ + refreshSuccess? (e: RefreshSuccessEventArgs): void; +} + +export interface RefreshBeginEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Captcha model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface RefreshCompleteEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Captcha model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface RefreshFailureEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Captcha model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface RefreshSuccessEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Captcha model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} +} +enum HatchStyle +{ +//Set background as None to Captcha +None, +//Set background as BackwardDiagonal to Captcha +BackwardDiagonal, +//Set background as Cross to Captcha +Cross, +//Set background as DarkDownwardDiagonal to Captcha +DarkDownwardDiagonal, +//Set background as DarkHorizontal to Captcha +DarkHorizontal, +//Set background as DarkUpwardDiagonal to Captcha +DarkUpwardDiagonal, +//Set background as DarkVertical to Captcha +DarkVertical, +//Set background as DashedDownwardDiagonal to Captcha +DashedDownwardDiagonal, +//Set background as DashedHorizontal to Captcha +DashedHorizontal, +//Set background as DashedUpwardDiagonal to Captcha +DashedUpwardDiagonal, +//Set background as DashedVertical to Captcha +DashedVertical, +//Set background as DiagonalBrick to Captcha +DiagonalBrick, +//Set background as DiagonalCross to Captcha +DiagonalCross, +//Set background as Divot to Captcha +Divot, +//Set background as DottedDiamond to Captcha +DottedDiamond, +//Set background as DottedGrid to Captcha +DottedGrid, +//Set background as ForwardDiagonal to Captcha +ForwardDiagonal, +//Set background as Horizontal to Captcha +Horizontal, +//Set background as HorizontalBrick to Captcha +HorizontalBrick, +//Set background as LargeCheckerBoard to Captcha +LargeCheckerBoard, +//Set background as LargeConfetti to Captcha +LargeConfetti, +//Set background as LargeGrid to Captcha +LargeGrid, +//Set background as LightDownwardDiagonal to Captcha +LightDownwardDiagonal, +//Set background as LightHorizontal to Captcha +LightHorizontal, +//Set background as LightUpwardDiagonal to Captcha +LightUpwardDiagonal, +//Set background as LightVertical to Captcha +LightVertical, +//Set background as Max to Captcha +Max, +//Set background as Min to Captcha +Min, +//Set background as NarrowHorizontal to Captcha +NarrowHorizontal, +//Set background as NarrowVertical to Captcha +NarrowVertical, +//Set background as OutlinedDiamond to Captcha +OutlinedDiamond, +//Set background as Percent90 to Captcha +Percent90, +//Set background as Wave to Captcha +Wave, +//Set background as Weave to Captcha +Weave, +//Set background as WideDownwardDiagonal to Captcha +WideDownwardDiagonal, +//Set background as WideUpwardDiagonal to Captcha +WideUpwardDiagonal, +//Set background as ZigZag to Captcha +ZigZag, +} + +class ListBox extends ej.Widget { + static fn: ListBox; + constructor(element: JQuery, options?: ListBox.Model); + constructor(element: Element, options?: ListBox.Model); + model:ListBox.Model; + defaults:ListBox.Model; + + /** Adds a given list items in the ListBox widget at a specified index. It accepts two parameters. + * @param {any|string} This can be a list item object (for JSON binding) or a string (for UL and LI rendering). Also we can the specify this as an array of list item object or an array of strings to add multiple items. + * @param {number} The index value to add the given items at the specified index. If index is not specified, the given items will be added at the end of the list. + * @returns {void} + */ + addItem(listItem: any|string, index: number): void; + + /** Checks all the list items in the ListBox widget. It is dependent on showCheckbox property. + * @returns {void} + */ + checkAll(): void; + + /** Checks a list item by using its index. It is dependent on showCheckbox property. + * @param {number} Index of the listbox item to be checked. If index is not specified, the given items will be added at the end of the list. + * @returns {void} + */ + checkItemByIndex(index: number): void; + + /** Checks multiple list items by using its index values. It is dependent on showCheckbox property. + * @param {number[]} Index/Indices of the listbox items to be checked. If index is not specified, the given items will be added at the end of the list. + * @returns {void} + */ + checkItemsByIndices(indices: number[]): void; + + /** Disables the ListBox widget. + * @returns {void} + */ + disable(): void; + + /** Disables a list item by passing the item text as parameter. + * @param {string} Text of the listbox item to be disabled. + * @returns {void} + */ + disableItem(text: string): void; + + /** Disables a list Item using its index value. + * @param {number} Index of the listbox item to be disabled. + * @returns {void} + */ + disableItemByIndex(index: number): void; + + /** Disables set of list Items using its index values. + * @param {number[]|string} Indices of the listbox items to be disabled. + * @returns {void} + */ + disableItemsByIndices(Indices: number[]|string): void; + + /** Enables the ListBox widget when it is disabled. + * @returns {void} + */ + enable(): void; + + /** Enables a list Item using its item text value. + * @param {string} Text of the listbox item to be enabled. + * @returns {void} + */ + enableItem(text: string): void; + + /** Enables a list item using its index value. + * @param {number} Index of the listbox item to be enabled. + * @returns {void} + */ + enableItemByIndex(index: number): void; + + /** Enables a set of list Items using its index values. + * @param {number[]|string} Indices of the listbox items to be enabled. + * @returns {void} + */ + enableItemsByIndices(indices: number[]|string): void; + + /** Returns the list of checked items in the ListBox widget. It is dependent on showCheckbox property. + * @returns {any} + */ + getCheckedItems(): any; + + /** Returns the list of selected items in the ListBox widget. + * @returns {any} + */ + getSelectedItems(): any; + + /** Returns an item’s index based on the given text. + * @param {string} The list item text (label) + * @returns {number} + */ + getIndexByText(text: string): number; + + /** Returns an item’s index based on the value given. + * @param {string} The list item’s value + * @returns {number} + */ + getIndexByValue(indices: string): number; + + /** Returns an item’s text (label) based on the index given. + * @returns {string} + */ + getTextByIndex(): string; + + /** Returns a list item’s object using its index. + * @returns {any} + */ + getItemByIndex(): any; + + /** Returns a list item’s object based on the text given. + * @param {string} The list item text. + * @returns {any} + */ + getItemByText(text: string): any; + + /** Merges the given data with the existing data items in the listbox. + * @param {Array} Data to merge in listbox. + * @returns {void} + */ + mergeData(data: Array): void; + + /** Selects the next item based on the current selection. + * @returns {void} + */ + moveDown(): void; + + /** Selects the previous item based on the current selection. + * @returns {void} + */ + moveUp(): void; + + /** Refreshes the ListBox widget. + * @param {boolean} Refreshes both the datasource and the dimensions of the ListBox widget when the parameter is passed as true, otherwise only the ListBox dimensions will be refreshed. + * @returns {void} + */ + refresh(refreshData: boolean): void; + + /** Removes all the list items from listbox. + * @returns {void} + */ + removeAll(): void; + + /** Removes the selected list items from the listbox. + * @returns {void} + */ + removeSelectedItems(): void; + + /** Removes a list item by using its text. + * @param {string} Text of the listbox item to be removed. + * @returns {void} + */ + removeItemByText(text: string): void; + + /** Removes a list item by using its index value. + * @param {number} Index of the listbox item to be removed. + * @returns {void} + */ + removeItemByIndex(index: number): void; + + /** + * @returns {void} + */ + selectAll(): void; + + /** Selects the list tem using its text value. + * @param {string} Text of the listbox item to be selected. + * @returns {void} + */ + selectItemByText(text: string): void; + + /** Selects list tem using its value property. + * @param {string} Value of the listbox item to be selected. + * @returns {void} + */ + selectItemByValue(value: string): void; + + /** Selects list item using its index value. + * @param {number} Index of the listbox item to be selected. + * @returns {void} + */ + selectItemByIndex(index: number): void; + + /** Selects a set of list items through its index values. + * @param {number|number[]} Index/Indices of the listbox item to be selected. + * @returns {void} + */ + selectItemsByIndices(Indices: number|number[]): void; + + /** Unchecks all the checked list items in the ListBox widget. To use this method showCheckbox property to be set as true. + * @returns {void} + */ + uncheckAll(): void; + + /** Unchecks a checked list item using its index value. To use this method showCheckbox property to be set as true. + * @param {number} Index of the listbox item to be unchecked. + * @returns {void} + */ + uncheckItemByIndex(index: number): void; + + /** Unchecks the set of checked list items using its index values. To use this method showCheckbox property must be set to true. + * @param {number[]|string} Indices of the listbox item to be unchecked. + * @returns {void} + */ + uncheckItemsByIndices(indices: number[]|string): void; + + /** + * @returns {void} + */ + unselectAll(): void; + + /** Unselects a selected list item using its index value + * @param {number} Index of the listbox item to be unselected. + * @returns {void} + */ + unselectItemByIndex(index: number): void; + + /** Unselects a selected list item using its text value. + * @param {string} Text of the listbox item to be unselected. + * @returns {void} + */ + unselectItemByText(text: string): void; + + /** Unselects a selected list item using its value. + * @param {string} Value of the listbox item to be unselected. + * @returns {void} + */ + unselectItemByValue(value: string): void; + + /** Unselects a set of list items using its index values. + * @param {number[]|string} Indices of the listbox item to be unselected. + * @returns {void} + */ + unselectItemsByIndices(indices: number[]|string): void; + + /** Hides all the checked items in the listbox. + * @returns {void} + */ + hideCheckedItems (): void; + + /** Shows a set of hidden list Items using its index values. + * @param {number[]|string} Indices of the listbox items to be shown. + * @returns {void} + */ + showItemByIndices(indices: number[]|string): void; + + /** Hides a set of list Items using its index values. + * @param {number[]|string} Indices of the listbox items to be hidden. + * @returns {void} + */ + hideItemsByIndices(indices: number[]|string): void; + + /** Shows the hidden list items using its values. + * @param {Array} Values of the listbox items to be shown. + * @returns {void} + */ + showItemsByValues(values: Array): void; + + /** Hides the list item using its values. + * @param {Array} Values of the listbox items to be hidden. + * @returns {void} + */ + hideItemsByValues(values: Array): void; + + /** Shows a hidden list item using its value. + * @param {string} Value of the listbox item to be shown. + * @returns {void} + */ + showItemByValue(value: string): void; + + /** Hide a list item using its value. + * @param {string} Value of the listbox item to be hidden. + * @returns {void} + */ + hideItemByValue(value: string): void; + + /** Shows a hidden list item using its index value. + * @param {number} Index of the listbox item to be shown. + * @returns {void} + */ + showItemByIndex(index: number): void; + + /** Hides a list item using its index value. + * @param {number} Index of the listbox item to be hidden. + * @returns {void} + */ + hideItemByIndex (index: number): void; + + /** + * @returns {void} + */ + show(): void; + + /** Hides the listbox. + * @returns {void} + */ + hide(): void; + + /** Hides all the listbox items in the listbox. + * @returns {void} + */ + hideAllItems(): void; + + /** Shows all the listbox items in the listbox. + * @returns {void} + */ + showAllItems(): void; +} +export module ListBox{ + +export interface Model { + + /**Enables/disables the dragging behavior of the items in ListBox widget. + * @Default {false} + */ + allowDrag?: boolean; + + /**Accepts the items which are dropped in to it, when it is set to true. + * @Default {false} + */ + allowDrop?: boolean; + + /**Enables or disables multiple selection. + * @Default {false} + */ + allowMultiSelection?: boolean; + + /**Loads the list data on demand via scrolling behavior to improve the application’s performance. There are two ways to load data which can be defined using “virtualScrollMode” property. + * @Default {false} + */ + allowVirtualScrolling?: boolean; + + /**Enables or disables the case sensitive search for list item by typing the text (search) value. + * @Default {false} + */ + caseSensitiveSearch?: boolean; + + /**Dynamically populate data of a list box while selecting an item in another list box i.e. rendering child list box based on the item selection in parent list box. This property accepts the id of the child ListBox widget to populate the data. + * @Default {null} + */ + cascadeTo?: string; + + /**Set of list items to be checked by default using its index. It works only when the showCheckbox property is set to true. + * @Default {null} + */ + checkedIndices?: string; + + /**The root class for the ListBox widget to customize the existing theme. + * @Default {“”} + */ + cssClass?: string; + + /**Contains the list of data for generating the list items. + * @Default {null} + */ + dataSource?: any; + + /**Enables or disables the ListBox widget. + * @Default {true} + */ + enabled?: boolean; + + /**Enables or disables the search behavior to find the specific list item by typing the text value. + * @Default {false} + */ + enableIncrementalSearch?: boolean; + + /**Allows the current model values to be saved in local storage or browser cookies for state maintenance when it is set to true. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Displays the ListBox widget’s content from right to left when enabled. + * @Default {false} + */ + enableRTL?: boolean; + + /**Mapping fields for the data items of the ListBox widget. + * @Default {null} + */ + fields?: any; + + /**Defines the height of the ListBox widget. + * @Default {null} + */ + height?: string; + + /**The number of list items to be shown in the ListBox widget. The remaining list items will be scrollable. + * @Default {null} + */ + itemsCount?: number; + + /**The total number of list items to be rendered in the ListBox widget. + * @Default {null} + */ + totalItemsCount?: number; + + /**The number of list items to be loaded in the list box while enabling virtual scrolling and when virtualScrollMode is set to continuous. + * @Default {5} + */ + itemRequestCount?: number; + + /**Loads data for the listbox by default (i.e. on initialization) when it is set to true. It creates empty ListBox if it is set to false. + */ + loadDataOnInit?: boolean; + + /**The query to retrieve required data from the data source. + * @Default {ej.Query()} + */ + query?: ej.Query|string; + + /**The list item to be selected by default using its index. + * @Default {null} + */ + selectedIndex?: number; + + /**The list items to be selected by default using its indices. To use this property allowMultiSelection should be enabled. + * @Default {[]} + */ + selectedIndices?: Array; + + /**Enables/Disables the multi selection option with the help of checkbox control. + * @Default {false} + */ + showCheckbox?: boolean; + + /**To display the ListBox container with rounded corners. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**The template to display the ListBox widget with customized appearance. + * @Default {null} + */ + template?: string; + + /**Holds the selected items values and used to bind value to the list item using angular and knockout. + * @Default {“”} + */ + value?: number; + + /**Specifies the virtual scroll mode to load the list data on demand via scrolling behavior. There are two types of mode. + */ + virtualScrollMode?: ej.VirtualScrollMode|string; + + /**Defines the width of the ListBox widget. + * @Default {null} + */ + width?: string; + + /**Specifies the targetID for the listbox items. + */ + targetID?: string; + + /**Triggers before the AJAX request begins to load data in the ListBox widget.*/ + actionBegin? (e: ActionBeginEventArgs): void; + + /**Triggers after the data requested via AJAX is successfully loaded in the ListBox widget.*/ + actionSuccess? (e: ActionSuccessEventArgs): void; + + /**Triggers when the AJAX requests complete. The request may get failed or succeed.*/ + actionComplete? (e: ActionCompleteEventArgs): void; + + /**Triggers when the data requested from AJAX get failed.*/ + actionFailure? (e: ActionFailureEventArgs): void; + + /**Event will be triggered before the requested data via AJAX once loaded in successfully.*/ + actionBeforeSuccess? (e: ActionBeforeSuccessEventArgs): void; + + /**Triggers when the item selection is changed.*/ + change? (e: ChangeEventArgs): void; + + /**Triggers when the list item is checked or unchecked.*/ + checkChange? (e: CheckChangeEventArgs): void; + + /**Triggers when the ListBox widget is created successfully.*/ + create? (e: CreateEventArgs): void; + + /**Triggers when the ListBox widget is destroyed successfully.*/ + destroy? (e: DestroyEventArgs): void; + + /**Triggers when focus the listbox items.*/ + focusIn? (e: FocusInEventArgs): void; + + /**Triggers when focus out from listbox items.*/ + focusOut? (e: FocusOutEventArgs): void; + + /**Triggers when the list item is being dragged.*/ + itemDrag? (e: ItemDragEventArgs): void; + + /**Triggers when the list item is ready to be dragged.*/ + itemDragStart? (e: ItemDragStartEventArgs): void; + + /**Triggers when the list item stops dragging.*/ + itemDragStop? (e: ItemDragStopEventArgs): void; + + /**Triggers when the list item is dropped.*/ + itemDrop? (e: ItemDropEventArgs): void; + + /**Triggers when a list item gets selected.*/ + select? (e: SelectEventArgs): void; + + /**Triggers when a list item gets unselected.*/ + unselect? (e: UnselectEventArgs): void; +} + +export interface ActionBeginEventArgs { +} + +export interface ActionSuccessEventArgs { +} + +export interface ActionCompleteEventArgs { +} + +export interface ActionFailureEventArgs { +} + +export interface ActionBeforeSuccessEventArgs { + + /**Instance of the listbox model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; + + /**List of actual object. + */ + actual?: any; + + /**Object of ListBox widget which contains DataManager arguments + */ + request?: any; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**List of array object + */ + result?: Array; + + /**ExcuteQuery object of DataManager + */ + xhr?: any; +} + +export interface ChangeEventArgs { + + /**Instance of the listbox model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; + + /**List item object. + */ + item?: any; + + /**The Datasource of the listbox. + */ + data?: any; + + /**List item’s index. + */ + index?: number; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Boolean value based on whether the list item is checked or not. + */ + isChecked?: boolean; + + /**Boolean value based on whether the list item is selected or not. + */ + isSelected?: boolean; + + /**Boolean value based on the list item is enabled or not. + */ + isEnabled?: boolean; + + /**List item’s text (label). + */ + text?: string; + + /**List item’s value. + */ + value?: string; +} + +export interface CheckChangeEventArgs { + + /**Instance of the listbox model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; + + /**List item object. + */ + item?: any; + + /**The Datasource of the listbox. + */ + data?: any; + + /**List item’s index. + */ + index?: number; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Boolean value based on whether the list item is checked or not. + */ + isChecked?: boolean; + + /**Boolean value based on whether the list item is selected or not. + */ + isSelected?: boolean; + + /**Boolean value based on the list item is enabled or not. + */ + isEnabled?: boolean; + + /**List item’s text (label). + */ + text?: string; + + /**List item’s value. + */ + value?: string; +} + +export interface CreateEventArgs { + + /**Instance of the listbox model object. + */ + model?: ej.ListBox.Model; + + /**Name of the event. + */ + type?: string; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; +} + +export interface DestroyEventArgs { + + /**Instance of the listbox model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; +} + +export interface FocusInEventArgs { + + /**Instance of the listbox model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; +} + +export interface FocusOutEventArgs { + + /**Instance of the listbox model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; +} + +export interface ItemDragEventArgs { + + /**Instance of the listbox model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**The Datasource of the listbox. + */ + data?: any; + + /**List item’s index. + */ + index?: number; + + /**Boolean value based on whether the list item is checked or not. + */ + isChecked?: boolean; + + /**Boolean value based on whether the list item is selected or not. + */ + isSelected?: boolean; + + /**Boolean value based on whether the list item is enabled or not. + */ + isEnabled?: boolean; + + /**List item’s text (label). + */ + text?: string; + + /**List item’s value. + */ + value?: string; +} + +export interface ItemDragStartEventArgs { + + /**Instance of the listbox model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**The Datasource of the listbox. + */ + data?: any; + + /**List item’s index. + */ + index?: number; + + /**Boolean value based on whether the list item is checked or not. + */ + isChecked?: boolean; + + /**Boolean value based on whether the list item is selected or not. + */ + isSelected?: boolean; + + /**Boolean value based on whether the list item is enabled or not. + */ + isEnabled?: boolean; + + /**List item’s text (label). + */ + text?: string; + + /**List item’s value. + */ + value?: string; +} + +export interface ItemDragStopEventArgs { + + /**Instance of the listbox model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**The Datasource of the listbox. + */ + data?: any; + + /**List item’s index. + */ + index?: number; + + /**Boolean value based on whether the list item is checked or not. + */ + isChecked?: boolean; + + /**Boolean value based on whether the list item is selected or not. + */ + isSelected?: boolean; + + /**Boolean value based on whether the list item is enabled or not. + */ + isEnabled?: boolean; + + /**List item’s text (label). + */ + text?: string; + + /**List item’s value. + */ + value?: string; +} + +export interface ItemDropEventArgs { + + /**Instance of the listbox model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**The Datasource of the listbox. + */ + data?: any; + + /**List item’s index. + */ + index?: number; + + /**Boolean value based on whether the list item is checked or not. + */ + isChecked?: boolean; + + /**Boolean value based on whether the list item is selected or not. + */ + isSelected?: boolean; + + /**Boolean value based on whether the list item is enabled or not. + */ + isEnabled?: boolean; + + /**List item’s text (label). + */ + text?: string; + + /**List item’s value. + */ + value?: string; +} + +export interface SelectEventArgs { + + /**Instance of the listbox model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; + + /**List item object. + */ + item?: any; + + /**The Datasource of the listbox. + */ + data?: any; + + /**List item’s index. + */ + index?: number; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Boolean value based on whether the list item is checked or not. + */ + isChecked?: boolean; + + /**Boolean value based on whether the list item is selected or not. + */ + isSelected?: boolean; + + /**Boolean value based on the list item is enabled or not. + */ + isEnabled?: boolean; + + /**List item’s text (label). + */ + text?: string; + + /**List item’s value. + */ + value?: string; +} + +export interface UnselectEventArgs { + + /**Instance of the listbox model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; + + /**List item object. + */ + item?: any; + + /**The Datasource of the listbox. + */ + data?: any; + + /**List item’s index. + */ + index?: number; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Boolean value based on whether the list item is checked or not. + */ + isChecked?: boolean; + + /**Boolean value based on whether the list item is selected or not. + */ + isSelected?: boolean; + + /**Boolean value based on the list item is enabled or not. + */ + isEnabled?: boolean; + + /**List item’s text (label). + */ + text?: string; + + /**List item’s value. + */ + value?: string; +} +} + +class Calculate extends ej.Widget { + static fn: Calculate; + constructor(element: JQuery, options?: Calculate.Model); + constructor(element: Element, options?: Calculate.Model); + model:Calculate.Model; + defaults:Calculate.Model; + + /** Add the custom formuls with function in CalcEngine library + * @param {string} pass the formula name + * @param {string} pass the custom function name to call + * @returns {void} + */ + addCustomFunction(FormulaName: string, FunctionName: string): void; + + /** Adds a named range to the NamedRanges collection + * @param {string} pass the namedRange's name + * @param {string} pass the cell range of NamedRange + * @returns {void} + */ + addNamedRange(Name: string, cellRange: string): void; + + /** Accepts a possible parsed formula and returns the calculated value without quotes. + * @param {string} pass the cell range to adjust its range + * @returns {string} + */ + adjustRangeArg(Name: string): string; + + /** When a formula cell changes, call this method to clear it from its dependent cells. + * @param {string} pass the changed cell address + * @returns {void} + */ + clearFormulaDependentCells(Cell: string): void; + + /** Call this method to clear whether an exception was raised during the computation of a library function. + * @returns {void} + */ + clearLibraryComputationException(): void; + + /** Get the column index from a cell reference passed in. + * @param {string} pass the cell address + * @returns {void} + */ + colIndex(Cell: string): void; + + /** Evaluates a parsed formula. + * @param {string} pass the parsed formula + * @returns {string} + */ + computedValue(Formula: string): string; + + /** Evaluates a parsed formula. + * @param {string} pass the parsed formula + * @returns {string} + */ + computeFormula(Formula: string): string; +} +export module Calculate{ + +export interface Model { +} +} + +class CheckBox extends ej.Widget { + static fn: CheckBox; + constructor(element: JQuery, options?: CheckBox.Model); + constructor(element: Element, options?: CheckBox.Model); + model:CheckBox.Model; + defaults:CheckBox.Model; + + /** Destroy the CheckBox widget all events bound using this._on will be unbind automatically and bring the control to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** Disable the CheckBox to prevent all user interactions. + * @returns {void} + */ + disable(): void; + + /** To enable the CheckBox + * @returns {void} + */ + enable(): void; + + /** To Check the status of CheckBox + * @returns {boolean} + */ + isChecked(): boolean; +} +export module CheckBox{ + +export interface Model { + + /**Specifies whether CheckBox has to be in checked or not. We can also specify array of string as value for this property. If any of the value in the specified array matches the value of the textbox, then it will be considered as checked. It will be useful in MVVM binding, specify array type to identify the values of the checked CheckBoxes. + * @Default {false} + */ + checked?: boolean|string[]; + + /**Specifies the State of CheckBox.See below to get available CheckState + * @Default {null} + */ + checkState?: ej.CheckState|string; + + /**Sets the root CSS class for CheckBox theme, which is used customize. + */ + cssClass?: string; + + /**Specifies the checkbox control state. + * @Default {true} + */ + enabled?: boolean; + + /**Specifies the persist property for CheckBox while initialization. The persist API save current model value to browser cookies for state maintains. While refreshing the CheckBox control page the model value apply from browser cookies. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Specify the Right to Left direction to Checkbox + * @Default {false} + */ + enableRTL?: boolean; + + /**Specifies the enable or disable Tri-State for checkbox control. + * @Default {false} + */ + enableTriState?: boolean; + + /**It allows to define the characteristics of the CheckBox control. It will helps to extend the capability of an HTML element. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Specified value to be added an id attribute of the CheckBox. + * @Default {null} + */ + id?: string; + + /**Specify the prefix value of id to be added before the current id of the CheckBox. + * @Default {ej} + */ + idPrefix?: string; + + /**Specifies the name attribute of the CheckBox. + * @Default {null} + */ + name?: string; + + /**Displays rounded corner borders to CheckBox + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Specifies the size of the CheckBox.See below to know available CheckboxSize + * @Default {small} + */ + size?: ej.CheckboxSize|string; + + /**Specifies the text content to be displayed for CheckBox. + */ + text?: string; + + /**Set the jQuery validation error message in CheckBox. + * @Default {null} + */ + validationMessage?: any; + + /**Set the jQuery validation rules in CheckBox. + * @Default {null} + */ + validationRules?: any; + + /**Specifies the value attribute of the CheckBox. + * @Default {null} + */ + value?: string; + + /**Fires before the CheckBox is going to changed its state successfully*/ + beforeChange? (e: BeforeChangeEventArgs): void; + + /**Fires when the CheckBox state is changed successfully*/ + change? (e: ChangeEventArgs): void; + + /**Fires when the CheckBox state is created successfully*/ + create? (e: CreateEventArgs): void; + + /**Fires when the CheckBox state is destroyed successfully*/ + destroy? (e: DestroyEventArgs): void; +} + +export interface BeforeChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the CheckBox model + */ + model?: ej.CheckBox.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the event model values + */ + event?: any; + + /**returns the status whether the element is checked or not. + */ + isChecked?: boolean; +} + +export interface ChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the CheckBox model + */ + model?: ej.CheckBox.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the event arguments + */ + event?: any; + + /**returns the status whether the element is checked or not. + */ + isChecked?: boolean; + + /**returns the state of the checkbox + */ + checkState?: string; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the CheckBox model + */ + model?: ej.CheckBox.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the CheckBox model + */ + model?: ej.CheckBox.Model; + + /**returns the name of the event + */ + type?: string; +} +} +enum CheckState +{ +//string +Uncheck, +//string +Check, +//string +Indeterminate, +} +enum CheckboxSize +{ +//Displays the CheckBox in medium size +Medium, +//Displays the CheckBox in small size +Small, +} + +class ColorPicker extends ej.Widget { + static fn: ColorPicker; + constructor(element: JQuery, options?: ColorPicker.Model); + constructor(element: Element, options?: ColorPicker.Model); + model:ColorPicker.Model; + defaults:ColorPicker.Model; + + /** Disables the color picker control + * @returns {void} + */ + disable(): void; + + /** Enable the color picker control + * @returns {void} + */ + enable(): void; + + /** Gets the selected color in RGB format + * @returns {any} + */ + getColor(): any; + + /** Gets the selected color value as string + * @returns {string} + */ + getValue(): string; + + /** To Convert color value from hexCode to RGB + * @returns {any} + */ + hexCodeToRGB(): any; + + /** Hides the ColorPicker popup, if in opened state. + * @returns {void} + */ + hide(): void; + + /** Convert color value from HSV to RGB + * @returns {any} + */ + HSVToRGB(): any; + + /** Convert color value from RGB to HEX + * @returns {string} + */ + RGBToHEX(): string; + + /** Convert color value from RGB to HSV + * @returns {any} + */ + RGBToHSV(): any; + + /** Open the ColorPicker popup. + * @returns {void} + */ + show(): void; +} +export module ColorPicker{ + +export interface Model { + + /**The ColorPicker control allows to define the customized text to displayed in button elements. Using the property to achieve the customized culture values. + * @Default {buttonText.apply= Apply, buttonText.cancel= Cancel,buttonText.swatches=Swatches} + */ + buttonText?: any; + + /**Allows to change the mode of the button. Please refer below to know available button mode + * @Default {ej.ButtonMode.Split} + */ + buttonMode?: ej.ButtonMode|string; + + /**Specifies the number of columns to be displayed color palette model. + * @Default {10} + */ + columns?: number; + + /**This property allows you to customize its appearance using user-defined CSS and custom skin options such as colors and backgrounds. + */ + cssClass?: string; + + /**This property allows to define the custom colors in the palette model.Custom palettes are created by passing a comma delimited string of HEX values or an array of colors. + * @Default {empty} + */ + custom?: Array; + + /**This property allows to embed the popup in the order of DOM element flow . When we set the value as true, the color picker popup is always in visible state. + * @Default {false} + */ + displayInline?: boolean; + + /**This property allows to change the control in enabled or disabled state. + * @Default {true} + */ + enabled?: boolean; + + /**This property allows to enable or disable the opacity slider in the color picker control + * @Default {true} + */ + enableOpacity?: boolean; + + /**It allows to define the characteristics of the ColorPicker control. It will helps to extend the capability of an HTML element. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Specifies the model type to be rendered initially in the color picker control. See below to get available ModelType + * @Default {ej.ColorPicker.ModelType.Default} + */ + modelType?: ej.ColorPicker.ModelType|string; + + /**This property allows to change the opacity value .The selected color opacity will be adjusted by using this opacity value. + * @Default {100} + */ + opacityValue?: number; + + /**Specifies the palette type to be displayed at initial time in palette model.There two types of palette model available in ColorPicker control. See below available Palette + * @Default {ej.ColorPicker.Palette.BasicPalette} + */ + palette?: ej.ColorPicker.Palette|string; + + /**This property allows to define the preset model to be rendered initially in palette type.It consists of 12 different types of presets. Each presets have 50 colors. See below available Presets + * @Default {ej.ColorPicker.Presets.Basic} + */ + presetType?: ej.ColorPicker.Presets|string; + + /**Allows to show/hides the apply and cancel buttons in ColorPicker control + * @Default {true} + */ + showApplyCancel?: boolean; + + /**Allows to show/hides the clear button in ColorPicker control + * @Default {true} + */ + showClearButton?: boolean; + + /**This property allows to provides live preview support for current cursor selection color and selected color. + * @Default {true} + */ + showPreview?: boolean; + + /**This property allows to store the color values in custom list.The ColorPicker will keep up to 11 colors in a custom list.By clicking the add button, the selected color from picker or palette will get added in the recent color list. + * @Default {false} + */ + showRecentColors?: boolean; + + /**This property allows to shows tooltip to notify the slider value in color picker control. + * @Default {false} + */ + showTooltip?: boolean; + + /**Specifies the toolIcon to be displayed in dropdown control color area. + * @Default {null} + */ + toolIcon?: string; + + /**This property allows to define the customized text or content to displayed when mouse over the following elements. This property also allows to use the culture values. + * @Default {tooltipText: { switcher: Switcher, addbutton: Add Color, basic: Basic, monochrome: Mono Chrome, flatcolors: Flat Color, seawolf: Sea Wolf, webcolors: Web Colors, sandy: Sandy, pinkshades: Pink Shades, misty: Misty, citrus: Citrus, vintage: Vintage, moonlight: Moon Light, candycrush: Candy Crush, currentcolor: Current Color, selectedcolor: Selected Color }} + */ + tooltipText?: any; + + /**Specifies the color value for color picker control, the value is in hexadecimal form with prefix of "#". + * @Default {null} + */ + value?: string; + + /**Fires after Color value has been changed successfully.If the user want to perform any operation after the color value changed then the user can make use of this change event.*/ + change? (e: ChangeEventArgs): void; + + /**Fires after closing the color picker popup.*/ + close? (e: CloseEventArgs): void; + + /**Fires after Color picker control is created. If the user want to perform any operation after the color picker control creation then the user can make use of this create event.*/ + create? (e: CreateEventArgs): void; + + /**Fires after Color picker control is destroyed. If the user want to perform any operation after the color picker control destroyed then the user can make use of this destroy event.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires after opening the color picker popup*/ + open? (e: OpenEventArgs): void; + + /**Fires after Color value has been selected successfully. If the user want to perform any operation after the color value selected then the user can make use of this select event.*/ + select? (e: SelectEventArgs): void; +} + +export interface ChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the color picker model + */ + model?: ej.ColorPicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**return the changed color value + */ + value?: string; +} + +export interface CloseEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the color picker model + */ + model?: ej.ColorPicker.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the color picker model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the color picker model + */ + model?: ej.ColorPicker.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface OpenEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the color picker model + */ + model?: ej.ColorPicker.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface SelectEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the color picker model + */ + model?: ej.ColorPicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**return the selected color value + */ + value?: string; +} + +enum ModelType{ + + ///support palette type mode in color picker. + Palette, + + ///support palette type mode in color picker. + Picker +} + + +enum Palette{ + + ///used to show the basic palette + BasicPalette, + + ///used to show the custompalette + CustomPalette +} + + +enum Presets{ + + ///used to show the basic presets + Basic, + + ///used to show the CandyCrush colors presets + CandyCrush, + + ///used to show the Citrus colors presets + Citrus, + + ///used to show the FlatColors presets + FlatColors, + + ///used to show the Misty presets + Misty, + + ///used to show the MoonLight presets + MoonLight, + + ///used to show the PinkShades presets + PinkShades, + + ///used to show the Sandy presets + Sandy, + + ///used to show the Seawolf presets + SeaWolf, + + ///used to show the Vintage presets + Vintage, + + ///used to show the WebColors presets + WebColors +} + +} +enum ButtonMode +{ +//Displays the button in split mode +Split, +//Displays the button in Dropdown mode +Dropdown, +} + +class FileExplorer extends ej.Widget { + static fn: FileExplorer; + constructor(element: JQuery, options?: FileExplorer.Model); + constructor(element: Element, options?: FileExplorer.Model); + model:FileExplorer.Model; + defaults:FileExplorer.Model; + + /** Refresh the size of FileExplorer control. + * @returns {void} + */ + adjustSize(): void; + + /** Disable the particular context menu item. + * @param {string|HTMLElement} Id of the menu item/ Menu element to be disabled + * @returns {void} + */ + disableMenuItem(item: string|HTMLElement): void; + + /** Disable the particular toolbar item. + * @param {string|HTMLElement} Id of the toolbar item/ Tool item element to be disabled + * @returns {void} + */ + disableToolbarItem(item: string|HTMLElement): void; + + /** Enable the particular context menu item. + * @param {string|HTMLElement} Id of the menu item/ Menu element to be Enabled + * @returns {void} + */ + enableMenuItem(item: string|HTMLElement): void; + + /** Enable the particular toolbar item + * @param {string|HTMLElement} Id of the tool item/ Tool item element to be Enabled + * @returns {void} + */ + enableToolbarItem(item: string|HTMLElement): void; + + /** Refresh the content of the selected folder in FileExplorer control. + * @returns {void} + */ + refresh(): void; + + /** Remove the particular toolbar item. + * @param {string|HTMLElement} Id of the tool item/ tool item element to be removed + * @returns {void} + */ + removeToolbarItem(item: string|HTMLElement): void; +} +export module FileExplorer{ + +export interface Model { + + /**Sets the URL of server side ajax handling method that handles file operation like Read, Remove, Rename, Create, Upload, Download, Copy and Move in File Explorer. + */ + ajaxAction?: string; + + /**Specifies the data type of server side ajax handling method. + * @Default {json} + */ + ajaxDataType?: string; + + /**By using ajaxSettings property, you can customize the ajax configurations. Normally you can customize the following option in ajax handling data, url, type, async, contentType, dataType and success. For upload, download and getImage API, you can only customize url. + * @Default {{ read: {}, createFolder: {}, remove: {}, rename: {}, paste: {}, getDetails: {}, download: {}, upload: {}, getImage: {}}} + */ + ajaxSettings?: any; + + /**The FileExplorer allows to select multiple files by enabling the allowMultiSelection property. You can perform multi selection by pressing the Ctrl key or Shift key. + * @Default {true} + */ + allowMultiSelection?: boolean; + + /**Sets the root class for FileExplorer theme. This cssClass API allows to use custom skinning option for File Explorer control. By defining the root class by using this API, you have to include this root class in CSS. + */ + cssClass?: string; + + /**Enables or disables the resize support in FileExplorer control. + * @Default {false} + */ + enableResize?: boolean; + + /**Enables or disables the Right to Left alignment support in FileExplorer control. + * @Default {false} + */ + enableRTL?: boolean; + + /**Allows specified type of files only to display in FileExplorer control. + * @Default {.} + */ + fileTypes?: string; + + /**By using filterSettings property, you can customize the search functionality of the search bar in FileExplorer control. + */ + filterSettings?: FilterSettings; + + /**By using the gridSettings property, you can customize the grid behavior in the FileExplorer control. + */ + gridSettings?: GridSettings; + + /**Specifies the height of FileExplorer control. + * @Default {400} + */ + height?: string|number; + + /**Enables or disables the responsive support for FileExplorer control during the window resizing time. + * @Default {false} + */ + isResponsive?: boolean; + + /**Sets the file view type. There are two view types available, such as grid, tile. See layoutType. + * @Default {ej.FileExplorer.layoutType.Grid} + */ + layout?: ej.FileExplorer.layoutType|string; + + /**Sets the culture in FileExplorer. + * @Default {en-US} + */ + locale?: string; + + /**Sets the maximum height of FileExplorer control. + * @Default {null} + */ + maxHeight?: string|number; + + /**Sets the maximum width of FileExplorer control. + * @Default {null} + */ + maxWidth?: string|number; + + /**Sets the minimum height of FileExplorer control. + * @Default {250} + */ + minHeight?: string|number; + + /**Sets the minimum width of FileExplorer control. + * @Default {400} + */ + minWidth?: string|number; + + /**The property path denotes the filesystem path that are to be explored. The path for the filesystem can be physical path or relative path, but it has to be relevant to where the Web API is hosted. + */ + path?: string; + + /**The selectedFolder is used to select the specified folder of FileExplorer control. + */ + selectedFolder?: string; + + /**The selectedItems is used to select the specified items (file, folder) of FileExplorer control. + */ + selectedItems?: string|Array; + + /**Enables or disables the context menu option in FileExplorer control. + * @Default {true} + */ + showContextMenu?: boolean; + + /**Enables or disables the footer in FileExplorer control. The footer element displays the details of the current selected files and folders. And also the footer having the switcher to change the layout view. + * @Default {true} + */ + showFooter?: boolean; + + /**Shows or disables the toolbar in FileExplorer control. + * @Default {true} + */ + showToolbar?: boolean; + + /**Enables or disables the navigation pane in FileExplorer control. The navigation pane contains a tree view element that displays all the folders from the filesystem in a hierarchical manner. This is useful to a quick navigation of any folder in the filesystem. + * @Default {true} + */ + showNavigationPane?: boolean; + + /**The tools property is used to configure and group required toolbar items in FileExplorer control. + * @Default {{ creation:[NewFolder, Open], navigation: [Back, Forward, Upward], addressBar: [Addressbar], editing: [Refresh, Upload, Delete, Rename, Download], copyPaste: [Cut, Copy, Paste], getProperties: [Details], searchBar: [Searchbar] }} + */ + tools?: any; + + /**The toolsList property is used to arrange the toolbar items in the FileExplorer control. + * @Default {[creation, navigation, addressBar, editing, copyPaste, getProperties, searchBar]} + */ + toolsList?: Array; + + /**Gets or sets an object that indicates whether to customize the upload behavior in the FileExplorer. + */ + uploadSettings?: UploadSettings; + + /**Specifies the width of FileExplorer control. + * @Default {850} + */ + width?: string|number; + + /**Fires before the ajax request is performed.*/ + beforeAjaxRequest? (e: BeforeAjaxRequestEventArgs): void; + + /**Fires before downloading the files.*/ + beforeDownload? (e: BeforeDownloadEventArgs): void; + + /**Fires before files or folders open.*/ + beforeOpen? (e: BeforeOpenEventArgs): void; + + /**Fires before uploading the files.*/ + beforeUpload? (e: BeforeUploadEventArgs): void; + + /**Fires when file or folder is copied successfully.*/ + copy? (e: CopyEventArgs): void; + + /**Fires when new folder is created successfully in file system.*/ + createFolder? (e: CreateFolderEventArgs): void; + + /**Fires when file or folder is cut successfully.*/ + cut? (e: CutEventArgs): void; + + /**Fires when the file view type is changed.*/ + layoutChange? (e: LayoutChangeEventArgs): void; + + /**Fires when files are successfully opened.*/ + open? (e: OpenEventArgs): void; + + /**Fires when a file or folder is pasted successfully.*/ + paste? (e: PasteEventArgs): void; + + /**Fires when file or folder is deleted successfully.*/ + remove? (e: RemoveEventArgs): void; + + /**Fires when resizing is performed for FileExplorer.*/ + resize? (e: ResizeEventArgs): void; + + /**Fires when resizing is started for FileExplorer.*/ + resizeStart? (e: ResizeStartEventArgs): void; + + /**Fires this event when the resizing is stopped for FileExplorer.*/ + resizeStop? (e: ResizeStopEventArgs): void; + + /**Fires when the items from grid view or tile view of FileExplorer control is selected.*/ + select? (e: SelectEventArgs): void; +} + +export interface BeforeAjaxRequestEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ajax response data + */ + data?: any; + + /**returns the FileExplorer model + */ + model?: ej.FileExplorer.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface BeforeDownloadEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the downloaded file names. + */ + files?: string[]; + + /**returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /**returns the path of currently opened item. + */ + path?: string; + + /**returns the selected item details. + */ + selectedItems?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface BeforeOpenEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the opened item type. + */ + itemType?: string; + + /**returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /**returns the path of currently opened item. + */ + path?: string; + + /**returns the selected item details. + */ + selectedItems?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface BeforeUploadEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /**returns the path of currently opened item. + */ + path?: string; + + /**returns the selected item details. + */ + selectedItems?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface CopyEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /**returns the name of copied file/folder. + */ + name?: string[]; + + /**returns the selected item details. + */ + selectedItems?: any; + + /**returns the source path. + */ + sourcePath?: string; + + /**returns the name of the event. + */ + type?: string; +} + +export interface CreateFolderEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ajax response data + */ + data?: any; + + /**returns the FileExplorer model + */ + model?: ej.FileExplorer.Model; + + /**returns the selected item details + */ + selectedItems?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface CutEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /**returns the name of moved file or folder. + */ + name?: string[]; + + /**returns the selected item details. + */ + selectedItems?: any; + + /**returns the source path. + */ + sourcePath?: string; + + /**returns the name of the event. + */ + type?: string; +} + +export interface LayoutChangeEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the current view type. + */ + layoutType?: string; + + /**returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface OpenEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the opened item type. + */ + itemType?: any; + + /**returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /**returns the path of currently opened item. + */ + path?: string; + + /**returns the selected item details. + */ + selectedItems?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface PasteEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /**returns the name of moved file or folder. + */ + name?: string[]; + + /**returns the selected item details. + */ + selectedItems?: any; + + /**returns the target folder item details. + */ + targetFolder?: any; + + /**returns the target path. + */ + targetPath?: string; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RemoveEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ajax response data. + */ + data?: any; + + /**returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /**returns the names of deleted items. + */ + name?: string; + + /**returns the path of deleted item. + */ + path?: string; + + /**returns the selected item details. + */ + selectedItems?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface ResizeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the mouse move event args. + */ + event?: any; + + /**returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface ResizeStartEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the mouse down event args. + */ + event?: any; + + /**returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface ResizeStopEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the mouse leave event args. + */ + event?: any; + + /**returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface SelectEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /**returns the name of clicked item. + */ + name?: string; + + /**returns the path of clicked item. + */ + path?: string; + + /**returns the selected item details + */ + selectedItems?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface FilterSettings { + + /**Enables or disables to perform the filter operation with case sensitive. + * @Default {false} + */ + caseSensitiveSearch?: boolean; + + /**Sets the search filter type. There are several filter types available, such as "startswith", "contains", "endswith". See filterType + * @Default {ej.FileExplorer.filterType.Contains} + */ + filterType?: ej.FilterType|string; +} + +export interface GridSettings { + + /**Gets or sets a value that indicates whether to enable the dynamic sorting behavior on grid data. Sorting can be done through clicking on particular column header. + * @Default {true} + */ + allowSorting?: boolean; + + /**Gets or sets an object that indicates to render the grid with specified columns. You can use this property same as the column property in Grid control. + * @Default {[{ field: name, headerText: Name, width: 25% }, { field: type, headerText: Type, width: 20% }, { field: dateModified, headerText: Date Modified, width: 35% }, { field: size, headerText: Size, width: 15%, textAlign: right, headerTextAlign: left }]} + */ + columns?: Array; +} + +export interface UploadSettings { + + /**Specifies the maximum file size allowed to upload. It accepts the value in bytes. + * @Default {31457280} + */ + maxFileSize?: number; + + /**Enables or disables the multiple files upload. When it is enabled, you can upload multiple files at a time and when disabled, you can upload only one file at a time. + * @Default {true} + */ + allowMultipleFile?: boolean; + + /**Enables or disables the auto upload option while uploading files in FileExplorer control. + * @Default {false} + */ + autoUpload?: boolean; +} + +enum layoutType{ + + ///Supports to display files in tile view + Tile, + + ///Supports to display files in grid view + Grid, + + ///Supports to display files as large icons + LargeIcons +} + +} + +class DatePicker extends ej.Widget { + static fn: DatePicker; + constructor(element: JQuery, options?: DatePicker.Model); + constructor(element: Element, options?: DatePicker.Model); + model:DatePicker.Model; + defaults:DatePicker.Model; + + /** Disables the DatePicker control. + * @returns {void} + */ + disable(): void; + + /** Enable the DatePicker control, if it is in disabled state. + * @returns {void} + */ + enable(): void; + + /** Returns the current date value in the DatePicker control. + * @returns {string} + */ + getValue(): string; + + /** Close the DatePicker popup, if it is in opened state. + * @returns {void} + */ + hide(): void; + + /** Opens the DatePicker popup. + * @returns {void} + */ + show(): void; +} +export module DatePicker{ + +export interface Model { + + /**Used to allow or restrict the editing in DatePicker input field directly. By setting false to this API, You can only pick the date from DatePicker popup. + * @Default {true} + */ + allowEdit?: boolean; + + /**allow or restrict the drill down to multiple levels of view (month/year/decade) in DatePicker calendar + * @Default {true} + */ + allowDrillDown?: boolean; + + /**Sets the specified text value to the today button in the DatePicker calendar. + * @Default {Today} + */ + buttonText?: string; + + /**Sets the root CSS class for Accordion theme, which is used customize. + */ + cssClass?: string; + + /**Formats the value of the DatePicker in to the specified date format. If this API is not specified, dateFormat will be set based on the current culture of DatePicker. + * @Default {MM/dd/yyyy} + */ + dateFormat?: string; + + /**Specifies the header format of days in DatePicker calendar. See below to get available Headers options + * @Default {ej.DatePicker.Header.Min} + */ + dayHeaderFormat?: string | ej.DatePicker.Header; + + /**Specifies the navigation depth level in DatePicker calendar. This option is not applied when start level view option is lower than depth level view. See below to know available levels in DatePicker Calendar + */ + depthLevel?: string | ej.DatePicker.Level; + + /**Allows to embed the DatePicker calendar in the page. Also associates DatePicker with div element instead of input. + * @Default {false} + */ + displayInline?: boolean; + + /**Enables or disables the animation effect with DatePicker calendar. + * @Default {true} + */ + enableAnimation?: boolean; + + /**Enable or disable the DatePicker control. + * @Default {true} + */ + enabled?: boolean; + + /**Sustain the entire widget model of DatePicker even after form post or browser refresh + * @Default {false} + */ + enablePersistence?: boolean; + + /**Displays DatePicker calendar along with DatePicker input field in Right to Left direction. + * @Default {false} + */ + enableRTL?: boolean; + + /**Allows to enter valid or invalid date in input textbox and indicate as error if it is invalid value, when this API value is set to true. For false value, invalid date is not allowed to input field and corrected to valid date automatically, even if invalid date is given. + * @Default {false} + */ + enableStrictMode?: boolean; + + /**Used the required fields for special Dates in DatePicker in order to customize the special dates in a calendar. + * @Default {null} + */ + fields?: Fields; + + /**Specifies the header format to be displayed in the DatePicker calendar. + * @Default {MMMM yyyy} + */ + headerFormat?: string; + + /**Specifies the height of the DatePicker input text. + * @Default {28px} + */ + height?: string; + + /**HighlightSection is used to highlight currently selected date's month/week/workdays. See below to get available HighlightSection options + * @Default {none} + */ + highlightSection?: string | ej.DatePicker.HighlightSection; + + /**Weekend dates will be highlighted when this property is set to true. + * @Default {false} + */ + highlightWeekend?: boolean; + + /**Specifies the HTML Attributes of the DatePicker. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Change the DatePicker calendar and date format based on given culture. + * @Default {en-US} + */ + locale?: string; + + /**Specifies the maximum date in the calendar that the user can select. + * @Default {new Date(2099, 11, 31)} + */ + maxDate?: string|Date; + + /**Specifies the minimum date in the calendar that the user can select. + * @Default {new Date(1900, 00, 01)} + */ + minDate?: string|Date; + + /**Allows to toggles the read only state of the DatePicker. When the widget is readOnly, it doesn't allow your input. + * @Default {false} + */ + readOnly?: boolean; + + /**It allows to display footer in DatePicker calendar. + * @Default {true} + */ + showFooter?: boolean; + + /**It allows to display/hides the other months days from the current month calendar in a DatePicker. + * @Default {true} + */ + showOtherMonths?: boolean; + + /**Shows/hides the date icon button at right side of textbox, which is used to open or close the DatePicker calendar popup. + * @Default {true} + */ + showPopupButton?: boolean; + + /**DatePicker input is displayed with rounded corner when this property is set to true. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Used to show the tooltip when hovering on the days in the DatePicker calendar. + * @Default {true} + */ + showTooltip?: boolean; + + /**Specifies the special dates in DatePicker. + * @Default {null} + */ + specialDates?: any; + + /**Specifies the start day of the week in DatePicker calendar. + * @Default {0} + */ + startDay?: number; + + /**Specifies the start level view in DatePicker calendar. See below available Levels + * @Default {ej.DatePicker.Level.Month} + */ + startLevel?: string | ej.DatePicker.Level; + + /**Specifies the number of months to be navigate for one click of next and previous button in a DatePicker Calendar. + * @Default {1} + */ + stepMonths?: number; + + /**Provides option to customize the tooltip format. + * @Default {ddd MMM dd yyyy} + */ + tooltipFormat?: string; + + /**Sets the jQuery validation support to DatePicker Date value. See validation + * @Default {null} + */ + validationMessage?: any; + + /**Sets the jQuery validation custom rules to the DatePicker. see validation + * @Default {null} + */ + validationRules?: any; + + /**sets or returns the current value of DatePicker + * @Default {null} + */ + value?: string|Date; + + /**Specifies the water mark text to be displayed in input text. + * @Default {Select date} + */ + watermarkText?: string; + + /**Specifies the width of the DatePicker input text. + * @Default {160px} + */ + width?: string; + + /**Fires before closing the DatePicker popup.*/ + beforeClose? (e: BeforeCloseEventArgs): void; + + /**Fires when each date is created in the DatePicker popup calendar.*/ + beforeDateCreate? (e: BeforeDateCreateEventArgs): void; + + /**Fires before opening the DatePicker popup.*/ + beforeOpen? (e: BeforeOpenEventArgs): void; + + /**Fires when the DatePicker input value is changed.*/ + change? (e: ChangeEventArgs): void; + + /**Fires when DatePicker popup is closed.*/ + close? (e: CloseEventArgs): void; + + /**Fires when the DatePicker is created successfully.*/ + create? (e: CreateEventArgs): void; + + /**Fires when the DatePicker is destroyed successfully.*/ + destroy? (e: DestroyEventArgs): void; + + /**NameTypeDescriptioncancelbooleanSet to true when the event has to be canceled, else false.modelobjectreturns the DatePicker model.typestringreturns the name of the event.valuestringreturns the currently selected date value.*/ + focusIn? (e: FocusInEventArgs): void; + + /**Fires when DatePicker input loses the focus.*/ + focusOut? (e: FocusOutEventArgs): void; + + /**Fires when DatePicker popup is opened.*/ + open? (e: OpenEventArgs): void; + + /**Fires when a date is selected from the DatePicker popup.*/ + select? (e: SelectEventArgs): void; +} + +export interface BeforeCloseEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the DatePicker model. + */ + model?: ej.DatePicker.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns the event parameters from DatePicker. + */ + events?: any; + + /**returns the DatePicker popup. + */ + element?: HTMLElement; +} + +export interface BeforeDateCreateEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the DatePicker model. + */ + model?: ej.DatePicker.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns the currently created date object. + */ + date?: any; + + /**returns the current DOM object of the date from the Calendar. + */ + element?: HTMLElement; +} + +export interface BeforeOpenEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the DatePicker model. + */ + model?: ej.DatePicker.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns the event parameters from DatePicker. + */ + events?: any; + + /**returns the DatePicker popup. + */ + element?: HTMLElement; +} + +export interface ChangeEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the DatePicker model. + */ + model?: ej.DatePicker.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns the DatePicker input value. + */ + value?: string; + + /**returns the previously selected value. + */ + prevDate?: string; +} + +export interface CloseEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the DatePicker model. + */ + model?: ej.DatePicker.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns the current date value. + */ + value?: string; + + /**returns the previously selected value. + */ + prevDate?: string; +} + +export interface CreateEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the DatePicker model. + */ + model?: ej.DatePicker.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the DatePicker model. + */ + model?: ej.DatePicker.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface FocusInEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the DatePicker model. + */ + model?: ej.DatePicker.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns the currently selected date value. + */ + value?: string; +} + +export interface FocusOutEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the DatePicker model. + */ + model?: ej.DatePicker.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns the currently selected date value. + */ + value?: string; + + /**returns the previously selected date value. + */ + prevDate?: string; +} + +export interface OpenEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the DatePicker model. + */ + model?: ej.DatePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the current date value. + */ + value?: string; + + /**returns the previously selected value. + */ + prevDate?: string; +} + +export interface SelectEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the DatePicker model. + */ + model?: ej.DatePicker.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns the current date value. + */ + value?: string; + + /**returns the previously selected value. + */ + prevDate?: string; + + /**returns whether the currently selected date is special date or not. + */ + isSpecialDay?: string; +} + +export interface Fields { + + /**Specifies the specials dates + */ + date?: string; + + /**Specifies the icon class to special dates. + */ + iconClass?: string; + + /**Specifies the tooltip to special dates. + */ + tooltip?: string; +} + +enum Header{ + + ///Removes day header in DatePicker + None, + + ///sets the short format of day name (like Sun) in header in DatePicker + Short, + + ///sets the Min format of day name (like su) in header format DatePicker + Min +} + + +enum Level{ + + ///allow navigation upto year level in DatePicker + Year, + + ///allow navigation upto decade level in DatePicker + Decade, + + ///allow navigation upto Century level in DatePicker + Century +} + + +enum HighlightSection{ + + ///Highlight the week of the currently selected date in DatePicker popup calendar + Week, + + ///Highlight the workdays in a currently selected date's week in DatePicker popup calendar + WorkDays, + + ///Nothing will be highlighted, remove highlights from DatePicker popup calendar if already exists + None +} + +} + +class DateTimePicker extends ej.Widget { + static fn: DateTimePicker; + constructor(element: JQuery, options?: DateTimePicker.Model); + constructor(element: Element, options?: DateTimePicker.Model); + model:DateTimePicker.Model; + defaults:DateTimePicker.Model; + + /** Disables the DateTimePicker control. + * @returns {void} + */ + disable(): void; + + /** Enables the DateTimePicker control. + * @returns {void} + */ + enable(): void; + + /** Returns the current datetime value in the DateTimePicker. + * @returns {string} + */ + getValue(): string; + + /** Hides or closes the DateTimePicker popup. + * @returns {void} + */ + hide(): void; + + /** Updates the current system date value and time value to the DateTimePicker. + * @returns {void} + */ + setCurrentDateTime(): void; + + /** Shows or opens the DateTimePicker popup. + * @returns {void} + */ + show(): void; +} +export module DateTimePicker{ + +export interface Model { + + /**Displays the custom text for the buttons inside the DateTimePicker popup. when the culture value changed, we can change the buttons text based on the culture. + * @Default {{ today: Today, timeNow: Time Now, done: Done, timeTitle: Time }} + */ + buttonText?: ButtonText; + + /**Set the root class for DateTimePicker theme. This cssClass API helps to use custom skinning option for DateTimePicker control. + */ + cssClass?: string; + + /**Defines the datetime format displayed in the DateTimePicker. The value should be a combination of date format and time format. + * @Default {M/d/yyyy h:mm tt} + */ + dateTimeFormat?: string; + + /**Specifies the header format of the datepicker inside the DateTimePicker popup. See DatePicker.Header + * @Default {ej.DatePicker.Header.Min} + */ + dayHeaderFormat?: ej.DatePicker.Header|string; + + /**Specifies the drill down level in datepicker inside the DateTimePicker popup. See ej.DatePicker.Level + */ + depthLevel?: ej.DatePicker.Level|string; + + /**Enable or disable the animation effect in DateTimePicker. + * @Default {true} + */ + enableAnimation?: boolean; + + /**When this property is set to false, it disables the DateTimePicker control. + * @Default {false} + */ + enabled?: boolean; + + /**Enables or disables the state maintenance of DateTimePicker. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Sets the DateTimePicker direction as right to left alignment. + * @Default {false} + */ + enableRTL?: boolean; + + /**When enableStrictMode true it allows the value outside of the range also but it highlights the textbox with error class, otherwise it internally changed to the correct value. + * @Default {false} + */ + enableStrictMode?: boolean; + + /**Specifies the header format to be displayed in the DatePicker calendar inside the DateTimePicker popup. + * @Default {MMMM yyyy} + */ + headerFormat?: string; + + /**Defines the height of the DateTimePicker textbox. + * @Default {30} + */ + height?: string|number; + + /**Specifies the HTML Attributes of the ejDateTimePicker + * @Default {{}} + */ + htmlAttributes?: any; + + /**Sets the time interval between the two adjacent time values in the time popup. + * @Default {30} + */ + interval?: number; + + /**Defines the localization culture for DateTimePicker. + * @Default {en-US} + */ + locale?: string; + + /**Sets the maximum value to the DateTimePicker. Beyond the maximum value an error class is added to the wrapper element when we set true to enableStrictMode. + * @Default {new Date(12/31/2099 11:59:59 PM)} + */ + maxDateTime?: string|Date; + + /**Sets the minimum value to the DateTimePicker. Behind the minimum value an error class is added to the wrapper element. + * @Default {new Date(1/1/1900 12:00:00 AM)} + */ + minDateTime?: string|Date; + + /**Specifies the popup position of DateTimePicker.See below to know available popup positions + * @Default {ej.DateTimePicker.Bottom} + */ + popupPosition?: string | ej.popupPosition; + + /**Indicates that the DateTimePicker value can only be read and can’t change. + * @Default {false} + */ + readOnly?: boolean; + + /**It allows showing days in other months of DatePicker calendar inside the DateTimePicker popup. + * @Default {true} + */ + showOtherMonths?: boolean; + + /**Shows or hides the arrow button from the DateTimePicker textbox. When the button disabled, the DateTimePicker popup opens while focus in the textbox and hides while focus out from the textbox. + * @Default {true} + */ + showPopupButton?: boolean; + + /**Changes the sharped edges into rounded corner for the DateTimePicker textbox and popup. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Specifies the start day of the week in datepicker inside the DateTimePicker popup. + * @Default {1} + */ + startDay?: number; + + /**Specifies the start level view in datepicker inside the DateTimePicker popup. See DatePicker.Level + * @Default {ej.DatePicker.Level.Month or month} + */ + startLevel?: ej.DatePicker.Level|string; + + /**Specifies the number of months to navigate at one click of next and previous button in datepicker inside the DateTimePicker popup. + * @Default {1} + */ + stepMonths?: number; + + /**Defines the time format displayed in the time dropdown inside the DateTimePicker popup. + * @Default {h:mm tt} + */ + timeDisplayFormat?: string; + + /**We can drill down up to time interval on selected date with meridian details. + * @Default {{ enabled: false, interval: 5, showMeridian: false, autoClose: true }} + */ + timeDrillDown?: TimeDrillDown; + + /**Defines the width of the time dropdown inside the DateTimePicker popup. + * @Default {100} + */ + timePopupWidth?: string|number; + + /**Set the jquery validation error message in DateTimePicker. + * @Default {null} + */ + validationMessage?: any; + + /**Set the jquery validation rules in DateTimePicker. + * @Default {null} + */ + validationRules?: any; + + /**Sets the DateTime value to the control. + */ + value?: string|Date; + + /**Defines the width of the DateTimePicker textbox. + * @Default {143} + */ + width?: string|number; + + /**Fires when the datetime value changed in the DateTimePicker textbox.*/ + change? (e: ChangeEventArgs): void; + + /**Fires when DateTimePicker popup closes.*/ + close? (e: CloseEventArgs): void; + + /**Fires after DateTimePicker control is created.*/ + create? (e: CreateEventArgs): void; + + /**Fires when the DateTimePicker is destroyed successfully*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires when the focus-in happens in the DateTimePicker textbox.*/ + focusIn? (e: FocusInEventArgs): void; + + /**Fires when the focus-out happens in the DateTimePicker textbox.*/ + focusOut? (e: FocusOutEventArgs): void; + + /**Fires when DateTimePicker popup opens.*/ + open? (e: OpenEventArgs): void; +} + +export interface ChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.DateTimePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the current value is valid or not + */ + isValidState?: boolean; + + /**returns the modified datetime value + */ + value?: string; + + /**returns the previously selected date time value + */ + prevDateTime?: string; + + /**returns true if change event triggered by interaction, otherwise returns false + */ + isInteraction?: boolean; +} + +export interface CloseEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.DateTimePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the modified datetime value + */ + value?: string; + + /**returns the previously selected date time value + */ + prevDateTime?: string; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the DateTimePicker model + */ + model?: ej.DateTimePicker.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the DateTimePicker model + */ + model?: ej.DateTimePicker.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface FocusInEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.DateTimePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the datetime value, which is in text box + */ + value?: string; +} + +export interface FocusOutEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.DateTimePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the datetime value, which is in text box + */ + value?: string; +} + +export interface OpenEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.DateTimePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the modified datetime value + */ + value?: string; + + /**returns the previously selected date time value + */ + prevDateTime?: string; +} + +export interface ButtonText { + + /**Sets the text for the Done button inside the datetime popup. + */ + done?: string; + + /**Sets the text for the Now button inside the datetime popup. + */ + timeNow?: string; + + /**Sets the header text for the Time dropdown. + */ + timeTitle?: string; + + /**Sets the text for the Today button inside the datetime popup. + */ + today?: string; +} + +export interface TimeDrillDown { + + /**This is the field to show/hide the timeDrillDown in DateTimePicker. + */ + enabled?: boolean; + + /**Sets the interval time of minutes on selected date. + */ + interval?: number; + + /**Allows the user to show or hide the meridian with time in DateTimePicker. + */ + showMeridian?: boolean; + + /**After choosing the time, the popup will close automatically if we set it as true, otherwise we focus out the DateTimePicker or choose timeNow button for closing the popup. + */ + autoClose?: boolean; +} +} +enum popupPosition +{ +//Opens the DateTimePicker popup below to the DateTimePicker input box +Bottom, +//Opens the DateTimePicker popup above to the DateTimePicker input box +Top, +} + +class Dialog extends ej.Widget { + static fn: Dialog; + constructor(element: JQuery, options?: Dialog.Model); + constructor(element: Element, options?: Dialog.Model); + model:Dialog.Model; + defaults:Dialog.Model; + + /** Closes the dialog widget dynamically. + * @returns {void} + */ + close(): void; + + /** Collapses the content area when it is expanded. + * @returns {void} + */ + collapse(): void; + + /** Destroys the Dialog widget. + * @returns {void} + */ + destroy(): void; + + /** Expands the content area when it is collapsed. + * @returns {void} + */ + expand(): void; + + /** Checks whether the Dialog widget is opened or not. This methods returns Boolean value. + * @returns {void} + */ + isOpen(): void; + + /** Maximizes the Dialog widget. + * @returns {void} + */ + maximize(): void; + + /** Minimizes the Dialog widget. + * @returns {void} + */ + minimize(): void; + + /** Opens the Dialog widget. + * @returns {void} + */ + open(): void; + + /** Pins the dialog in its current position. + * @returns {void} + */ + pin(): void; + + /** Restores the dialog. + * @returns {void} + */ + restore(): void; + + /** Unpins the Dialog widget. + * @returns {void} + */ + unpin(): void; + + /** Sets the title for the Dialog widget. + * @param {string} The title for the dialog widget. + * @returns {void} + */ + setTitle(Title: string): void; + + /** Sets the content for the Dialog widget dynamically. + * @param {string} The content for the dialog widget. It accepts both string and html string. + * @returns {void} + */ + setContent(content: string): void; + + /** Sets the focus on the Dialog widget. + * @returns {void} + */ + focus(): void; +} +export module Dialog{ + +export interface Model { + + /**Adds action buttons like close, minimize, pin, maximize in the dialog header. + */ + actionButtons?: string[]; + + /**Enables or disables draggable. + */ + allowDraggable?: boolean; + + /**Enables or disables keyboard interaction. + */ + allowKeyboardNavigation?: boolean; + + /**Customizes the Dialog widget animations. The Dialog widget can be animated while opening and closing the dialog. In order to customize animation effects, you need to set “enableAnimation” as true. It contains the following sub properties. + */ + animation?: any; + + /**The tooltip text for the dialog close button. + */ + closeIconTooltip?: string; + + /**Closes the dialog widget on pressing the ESC key when it is set to true. + */ + closeOnEscape?: boolean; + + /**The selector for the container element. If the property is set, then dialog will append to the selected element and it is restricted to move only within the specified container element. + */ + containment?: string; + + /**The content type to load the dialog content at run time. The possible values are null, ajax, iframe and image. When it is null (default value), the content inside dialog element will be displayed as content and when it is not null, the content will be loaded from the URL specified in the contentUrl property. + */ + contentType?: string; + + /**The URL to load the dialog content (such as AJAX, image, and iframe). In order to load content from URL, you need to set contentType as ‘ajax’ or ‘iframe’ or ‘image’. + */ + contentUrl?: string; + + /**The root class for the Dialog widget to customize the existing theme. + */ + cssClass?: string; + + /**Enable or disables animation when the dialog is opened or closed. + */ + enableAnimation?: boolean; + + /**Enables or disables the Dialog widget. + */ + enabled?: boolean; + + /**Enable or disables modal dialog. The modal dialog acts like a child window that is displayed on top of the main window/screen and disables the main window interaction until it is closed. + */ + enableModal?: boolean; + + /**Allows the current model values to be saved in local storage or browser cookies for state maintenance when it is set to true. + */ + enablePersistence?: boolean; + + /**Allows the dialog to be resized. The dialog cannot be resized less than the minimum height, width values and greater than the maximum height and width. + */ + enableResize?: boolean; + + /**Displays dialog content from right to left when set to true. + */ + enableRTL?: boolean; + + /**The CSS class name to display the favicon in the dialog header. In order to display favicon, you need to set showHeader as true since the favicon will be displayed in the dialog header. + */ + faviconCSS?: string; + + /**Sets the height for the dialog widget. It accepts both string and integer values. For example, it can accepts values like “auto”, “100%”, “100px” as string type and “100”, “500” as integer type. The unit of integer type value is “px”. + */ + height?: string|number; + + /**Enable or disables responsive behavior. + */ + isResponsive?: boolean; + + /**Default Value:{:.param}“en-US” + */ + locale?: number; + + /**Sets the maximum height for the dialog widget. + */ + maxHeight?: number; + + /**Sets the maximum width for the dialog widget. + */ + maxWidth?: number; + + /**Sets the minimum height for the dialog widget. + */ + minHeight?: number; + + /**Sets the minimum width for the dialog widget. + */ + minWidth?: number; + + /**Displays the Dialog widget at the given X and Y position. + */ + position?: any; + + /**Shows or hides the dialog header. + */ + showHeader?: boolean; + + /**The Dialog widget can be opened by default i.e. on initialization, when it is set to true. + */ + showOnInit?: boolean; + + /**Enables or disables the rounder corner. + */ + showRoundedCorner?: boolean; + + /**The selector for the container element. If this property is set, the dialog will be displayed (positioned) based on its container. + */ + target?: string; + + /**The title text to be displayed in the dialog header. In order to set title, you need to set showHeader as true since the title will be displayed in the dialog header. + */ + title?: string; + + /**Add or configure the tooltip text for actionButtons in the dialog header. + */ + tooltip?: any; + + /**Sets the height for the dialog widget. It accepts both string and integer values. For example, it can accepts values like “auto”, “100%”, “100px” as string type and “100”, “500” as integer type. The unit of integer type value is “px”. + */ + width?: string|number; + + /**Sets the z-index value for the Dialog widget. + */ + zIndex?: number; + + /**This event is triggered before the dialog widgets gets open.*/ + beforeOpen? (e: BeforeOpenEventArgs): void; + + /**This event is triggered whenever the Ajax request fails to retrieve the dialog content.*/ + ajaxError? (e: AjaxErrorEventArgs): void; + + /**This event is triggered whenever the Ajax request to retrieve the dialog content, gets succeed.*/ + ajaxSuccess? (e: AjaxSuccessEventArgs): void; + + /**This event is triggered before the dialog widgets get closed.*/ + beforeClose? (e: BeforeCloseEventArgs): void; + + /**This event is triggered after the dialog widget is closed.*/ + close? (e: CloseEventArgs): void; + + /**Triggered after the dialog content is loaded in DOM.*/ + contentLoad? (e: ContentLoadEventArgs): void; + + /**Triggered after the dialog is created successfully*/ + create? (e: CreateEventArgs): void; + + /**Triggered after the dialog widget is destroyed successfully*/ + destroy? (e: DestroyEventArgs): void; + + /**Triggered while the dialog is dragged.*/ + drag? (e: DragEventArgs): void; + + /**Triggered when the user starts dragging the dialog.*/ + dragStart? (e: DragStartEventArgs): void; + + /**Triggered when the user stops dragging the dialog.*/ + dragStop? (e: DragStopEventArgs): void; + + /**Triggered after the dialog is opened.*/ + open? (e: OpenEventArgs): void; + + /**Triggered while the dialog is resized.*/ + resize? (e: ResizeEventArgs): void; + + /**Triggered when the user starts resizing the dialog.*/ + resizeStart? (e: ResizeStartEventArgs): void; + + /**Triggered when the user stops resizing the dialog.*/ + resizeStop? (e: ResizeStopEventArgs): void; + + /**Triggered when the dialog content is expanded.*/ + expand? (e: ExpandEventArgs): void; + + /**Triggered when the dialog content is collapsed.*/ + collapse? (e: CollapseEventArgs): void; +} + +export interface BeforeOpenEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event + */ + type?: string; +} + +export interface AjaxErrorEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event. + */ + type?: string; + + /**URL of the content. + */ + url?: string; + + /**Error page content. + */ + responseText?: string; + + /**Error code. + */ + status?: number; + + /**The corresponding error description. + */ + statusText?: string; +} + +export interface AjaxSuccessEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event. + */ + type?: string; + + /**URL of the content. + */ + url?: string; + + /**Response content. + */ + data?: string; +} + +export interface BeforeCloseEventArgs { + + /**Current event object. + */ + event?: any; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event. + */ + type?: string; +} + +export interface CloseEventArgs { + + /**Current event object. + */ + event?: any; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event + */ + type?: string; +} + +export interface ContentLoadEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event. + */ + type?: string; + + /**URL of the content. + */ + url?: string; + + /**Content type + */ + contentType?: any; +} + +export interface CreateEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event. + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event. + */ + type?: string; +} + +export interface DragEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event. + */ + type?: string; + + /**Current event object. + */ + event?: any; +} + +export interface DragStartEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event. + */ + type?: string; + + /**Current event object. + */ + event?: any; +} + +export interface DragStopEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event. + */ + type?: string; + + /**Current event object. + */ + event?: any; +} + +export interface OpenEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event. + */ + type?: string; +} + +export interface ResizeEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event. + */ + type?: string; + + /**Current event object. + */ + event?: any; +} + +export interface ResizeStartEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event + */ + type?: string; + + /**Current event object. + */ + event?: any; +} + +export interface ResizeStopEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event + */ + type?: string; + + /**Current event object. + */ + event?: any; +} + +export interface ExpandEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event. + */ + type?: string; +} + +export interface CollapseEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event. + */ + type?: string; +} +} + +class DropDownList extends ej.Widget { + static fn: DropDownList; + constructor(element: JQuery, options?: DropDownList.Model); + constructor(element: Element, options?: DropDownList.Model); + model:DropDownList.Model; + defaults:DropDownList.Model; + + /** Adding a single item or an array of items into the DropDownList allows you to specify all the field attributes such as value, template, image URL, and html attributes for those items. + * @param {any|Array} this parameter should have field attributes with respect to mapped field attributes and it's corresponding values to fields + * @returns {void} + */ + addItem(data: any|Array): void; + + /** This method is used to select all the items in the DropDownList. + * @returns {void} + */ + checkAll(): void; + + /** Clears the text in the DropDownList textbox. + * @returns {void} + */ + clearText(): void; + + /** Destroys the DropDownList widget. + * @returns {void} + */ + destroy(): void; + + /** This property is used to disable the DropDownList widget. + * @returns {void} + */ + disable(): void; + + /** This property disables the set of items in the DropDownList. + * @param {string|number|Array} disable the given index list items + * @returns {void} + */ + disableItemsByIndices(index: string|number|Array): void; + + /** This property enables the DropDownList control. + * @returns {void} + */ + enable(): void; + + /** Enables an Item or set of Items that are disabled in the DropDownList + * @param {string|number|Array} enable the given index list items if it's disabled + * @returns {void} + */ + enableItemsByIndices(index: string|number|Array): void; + + /** This method retrieves the items using given value. + * @param {string|number|any} Return the whole object of data based on given value + * @returns {any} + */ + getItemDataByValue(value: string|number|any): any; + + /** This method is used to retrieve the items that are bound with the DropDownList. + * @returns {any} + */ + getListData(): any; + + /** This method is used to get the selected items in the DropDownList. + * @returns {HTMLElement} + */ + getSelectedItem(): HTMLElement; + + /** This method is used to retrieve the items value that are selected in the DropDownList. + * @returns {string} + */ + getSelectedValue(): string; + + /** This method hides the suggestion popup in the DropDownList. + * @returns {void} + */ + hidePopup(): void; + + /** This method is used to select the list of items in the DropDownList through the Index of the items. + * @param {string|number|Array} select the given index list items + * @returns {void} + */ + selectItemsByIndices(index: string|number|Array): void; + + /** This method is used to select an item in the DropDownList by using the given text value. + * @param {string|number|Array} select the list items relates to given text + * @returns {void} + */ + selectItemByText(index: string|number|Array): void; + + /** This method is used to select an item in the DropDownList by using the given value. + * @param {string|number|Array} select the list items relates to given values + * @returns {void} + */ + selectItemByValue(index: string|number|Array): void; + + /** This method shows the DropDownList control with the suggestion popup. + * @returns {void} + */ + showPopup(): void; + + /** This method is used to unselect all the items in the DropDownList. + * @returns {void} + */ + unCheckAll(): void; + + /** This method is used to unselect the list of items in the DropDownList through Index of the items. + * @param {string|number|Array} unselect the given index list items + * @returns {void} + */ + unselectItemsByIndices(index: string|number|Array): void; + + /** This method is used to unselect an item in the DropDownList by using the given text value. + * @param {string|number|Array} unselect the list items realtes to given text + * @returns {void} + */ + unselectItemByText(index: string|number|Array): void; + + /** This method is used to unselect an item in the DropDownList by using the given value. + * @param {string|number|Array} unselect the list items realtes to given values + * @returns {void} + */ + unselectItemByValue(index: string|number|Array): void; +} +export module DropDownList{ + +export interface Model { + + /**The cascading DropDownLists is a series of two or more DropDownLists in which each DropDownList is filtered according to the previous DropDownList’s value. + * @Default {null} + */ + cascadeTo?: string; + + /**Sets the case sensitivity of the search operation. It supports both enableFilterSearch and enableIncrementalSearch property. + * @Default {false} + */ + caseSensitiveSearch?: boolean; + + /**Dropdown widget's style and appearance can be controlled based on 13 different default built-in themes.You can customize the appearance of the dropdown by using the cssClass property. You need to specify a class name in the cssClass property and the same class name is used before the class definitions wherever the custom styles are applied. + */ + cssClass?: string; + + /**This property is used to serve data from the data services based on the query provided. To bind the data to the dropdown widget, the dataSource property is assigned with the instance of the ej.DataManager. + * @Default {null} + */ + dataSource?: any; + + /**Sets the separator when the multiSelectMode with delimiter option or checkbox is enabled with the dropdown. When you enter the delimiter value, the texts after the delimiter are considered as a separate word or query. The delimiter string is a single character and must be a symbol. Mostly, the delimiter symbol is used as comma (,) or semi-colon (;) or any other special character. + * @Default {','} + */ + delimiterChar?: string; + + /**The enabled Animation property uses the easeOutQuad animation to SlideDown and SlideUp the Popup list in 200 and 100 milliseconds, respectively. + * @Default {false} + */ + enableAnimation?: boolean; + + /**This property is used to indicate whether the DropDownList control responds to the user interaction or not. By default, the control is in the enabled mode and you can disable it by setting it to false. + * @Default {true} + */ + enabled?: boolean; + + /**Specifies to perform incremental search for the selection of items from the DropDownList with the help of this property. This helps in selecting the item by using the typed character. + * @Default {true} + */ + enableIncrementalSearch?: boolean; + + /**This property selects the item in the DropDownList when the item is entered in the Search textbox. + * @Default {false} + */ + enableFilterSearch?: boolean; + + /**Saves the current model value to the browser cookies for state maintenance. While refreshing the DropDownList control page, it retains the model value and it is applied from the browser cookies. + * @Default {false} + */ + enablePersistence?: boolean; + + /**This enables the resize handler to resize the popup to any size. + * @Default {false} + */ + enablePopupResize?: boolean; + + /**Sets the DropDownList textbox direction from right to left align. + * @Default {false} + */ + enableRTL?: boolean; + + /**This property is used to sort the Items in the DropDownList. By default, it sorts the items in an ascending order. + * @Default {false} + */ + enableSorting?: boolean; + + /**Specifies the mapping fields for the data items of the DropDownList. + * @Default {null} + */ + fields?: Fields; + + /**When the enableFilterSearch property value is set to true, the values in the DropDownList shows the items starting with or containing the key word/letter typed in the Search textbox. + * @Default {ej.FilterType.Contains} + */ + filterType?: ej.FilterType|string; + + /**Used to create visualized header for dropdown items + * @Default {null} + */ + headerTemplate?: string; + + /**Defines the height of the DropDownList textbox. + * @Default {null} + */ + height?: string|number; + + /**It sets the given HTML attributes for the DropDownList control such as ID, name, disabled, etc. + * @Default {null} + */ + htmlAttributes?: any; + + /**Data can be fetched in the DropDownList control by using the DataSource, specifying the number of items. + * @Default {5} + */ + itemsCount?: number; + + /**Defines the maximum height of the suggestion box. This property restricts the maximum height of the popup when resize is enabled. + * @Default {null} + */ + maxPopupHeight?: string|number; + + /**Defines the minimum height of the suggestion box. This property restricts the minimum height of the popup when resize is enabled. + * @Default {null} + */ + minPopupHeight?: string|number; + + /**Defines the maximum width of the suggestion box. This property restricts the maximum width of the popup when resize is enabled. + * @Default {null} + */ + maxPopupWidth?: string|number; + + /**Defines the minimum height of the suggestion box. This property restricts the minimum height of the popup when resize is enabled. + * @Default {0} + */ + minPopupWidth?: string|number; + + /**With the help of this property, you can make a single or multi selection with the DropDownList and display the text in two modes, delimiter and visual mode. In delimiter mode, you can separate the items by using the delimiter character such as comma (,) or semi-colon (;) or any other special character. In the visual mode, the items are showcased like boxes with close icon in the textbox. + * @Default {ej.MultiSelectMode.None} + */ + multiSelectMode?: ej.MultiSelectMode|string; + + /**Defines the height of the suggestion popup box in the DropDownList control. + * @Default {152px} + */ + popupHeight?: string|number; + + /**Defines the width of the suggestion popup box in the DropDownList control. + * @Default {auto} + */ + popupWidth?: string|number; + + /**Specifies the query to retrieve the data from the DataSource. + * @Default {null} + */ + query?: any; + + /**Specifies that the DropDownList textbox values should be read-only. + * @Default {false} + */ + readOnly?: boolean; + + /**Specifies an item to be selected in the DropDownList. + * @Default {null} + */ + selectedIndex?: number; + + /**Specifies the selectedItems for the DropDownList. + * @Default {[]} + */ + selectedIndices?: Array; + + /**Selects multiple items in the DropDownList with the help of the checkbox control. To achieve this, enable the showCheckbox option to true. + * @Default {false} + */ + showCheckbox?: boolean; + + /**DropDownList control is displayed with the popup seen. + * @Default {false} + */ + showPopupOnLoad?: boolean; + + /**DropDownList textbox displayed with the rounded corner style. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**When the enableSorting property value is set to true, this property helps to sort the items either in ascending or descending order + * @Default {ej.sortOrder.Ascending} + */ + sortOrder?: ej.SortOrder|string; + + /**Specifies the targetID for the DropDownList’s items. + * @Default {null} + */ + targetID?: string; + + /**By default, you can add any text or image to the DropDownList item. To customize the item layout or to create your own visualized elements, you can use this template support. + * @Default {null} + */ + template?: string; + + /**Defines the text value that is displayed in the DropDownList textbox. + * @Default {null} + */ + text?: string; + + /**Sets the jQuery validation error message in the DropDownList + * @Default {null} + */ + validationMessage?: any; + + /**Sets the jquery validation rules in the Dropdownlist. + * @Default {null} + */ + validationRules?: any; + + /**Specifies the value (text content) for the DropDownList control. + * @Default {null} + */ + value?: string; + + /**Specifies a short hint that describes the expected value of the DropDownList control. + * @Default {null} + */ + watermarkText?: string; + + /**Defines the width of the DropDownList textbox. + * @Default {null} + */ + width?: string|number; + + /**The Virtual Scrolling feature is used to display a large amount of records in the DropDownList, that is, when scrolling, an Ajax request is sent to fetch some amount of data from the server dynamically. To achieve this scenario with DropDownList, set the allowVirtualScrolling to true. You can set the itemsCount property that represents the number of items to be fetched from the server on every Ajax request. + * @Default {normal} + */ + virtualScrollMode?: ej.VirtualScrollMode|string; + + /**Fires the action before the XHR request.*/ + actionBegin? (e: ActionBeginEventArgs): void; + + /**Fires the action when the list of items is bound to the DropDownList by xhr post calling*/ + actionComplete? (e: ActionCompleteEventArgs): void; + + /**Fires the action when the xhr post calling failed on remote data binding with the DropDownList control.*/ + actionFailure? (e: ActionFailureEventArgs): void; + + /**Fires the action when the xhr post calling succeed on remote data binding with the DropDownList control*/ + actionSuccess? (e: ActionSuccessEventArgs): void; + + /**Fires the action before the popup is ready to hide.*/ + beforePopupHide? (e: BeforePopupHideEventArgs): void; + + /**Fires the action before the popup is ready to be displayed.*/ + beforePopupShown? (e: BeforePopupShownEventArgs): void; + + /**Fires when the cascading happens between two DropDownList exactly after the value changes in the first dropdown and before filtering in the second Dropdown.*/ + cascade? (e: CascadeEventArgs): void; + + /**Fires the action when the DropDownList control’s value is changed.*/ + change? (e: ChangeEventArgs): void; + + /**Fires the action when the list item checkbox value is changed.*/ + checkChange? (e: CheckChangeEventArgs): void; + + /**Fires the action once the DropDownList is created.*/ + create? (e: CreateEventArgs): void; + + /**Fires the action when the list items is bound to the DropDownList.*/ + dataBound? (e: DataBoundEventArgs): void; + + /**Fires the action when the DropDownList is destroyed.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires the action, once the popup is closed*/ + popupHide? (e: PopupHideEventArgs): void; + + /**Fires the action, when the popup is resized.*/ + popupResize? (e: PopupResizeEventArgs): void; + + /**Fires the action, once the popup is opened.*/ + popupShown? (e: PopupShownEventArgs): void; + + /**Fires the action, when resizing a popup starts.*/ + popupResizeStart? (e: PopupResizeStartEventArgs): void; + + /**Fires the action, when the popup resizing is stopped.*/ + popupResizeStop? (e: PopupResizeStopEventArgs): void; + + /**Fires the action before filtering the list items that starts in the DropDownList when the enableFilterSearch is enabled.*/ + search? (e: SearchEventArgs): void; + + /**Fires the action, when the list of item is selected.*/ + select? (e: SelectEventArgs): void; +} + +export interface ActionBeginEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the DropDownList model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface ActionCompleteEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns number of times trying to fetch the data + */ + count?: number; + + /**returns the DropDownList model + */ + model?: any; + + /**Returns the query for data retrieval + */ + query?: any; + + /**Returns the query for data retrieval from the Database + */ + request?: any; + + /**returns the name of the event + */ + type?: string; + + /**Returns the number of items fetched from remote data + */ + result?: Array; + + /**Returns the requested data + */ + xhr?: any; +} + +export interface ActionFailureEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns the error message + */ + error?: any; + + /**returns the DropDownList model + */ + model?: any; + + /**Returns the query for data retrieval + */ + query?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface ActionSuccessEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns number of times trying to fetch the data + */ + count?: number; + + /**returns the DropDownList model + */ + model?: any; + + /**Returns the query for data retrieval + */ + query?: any; + + /**Returns the query for data retrieval from the Database + */ + request?: any; + + /**returns the name of the event + */ + type?: string; + + /**Returns the number of items fetched from remote data + */ + result?: Array; + + /**Returns the requested data + */ + xhr?: any; +} + +export interface BeforePopupHideEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the DropDownList model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; + + /**returns the selected text + */ + text?: string; + + /**returns the selected value + */ + value?: string; +} + +export interface BeforePopupShownEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the DropDownList model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; + + /**returns the selected text + */ + text?: string; + + /**returns the selected value + */ + value?: string; +} + +export interface CascadeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns the cascading dropdown model. + */ + cascadeModel?: any; + + /**returns the current selected value in first dropdown. + */ + cascadeValue?: string; + + /**returns the DropDownList model + */ + model?: any; + + /**returns the default filter action for second dropdown data should happen or not. + */ + requiresDefaultFilter?: boolean; + + /**returns the name of the event + */ + type?: string; +} + +export interface ChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns the selected item with checkbox checked or not. + */ + isChecked?: boolean; + + /**Returns the selected item ID. + */ + itemId?: string; + + /**returns the DropDownList model + */ + model?: any; + + /**Returns the selected item text. + */ + selectedText?: string; + + /**returns the name of the event + */ + type?: string; + + /**Returns the selected text. + */ + text?: string; + + /**Returns the selected value. + */ + value?: string; +} + +export interface CheckChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns the selected item with checkbox checked or not. + */ + isChecked?: boolean; + + /**Returns the selected item ID. + */ + itemId?: string; + + /**returns the DropDownList model + */ + model?: any; + + /**Returns the selected item text. + */ + selectedText?: string; + + /**returns the name of the event + */ + type?: string; + + /**Returns the selected text. + */ + text?: string; + + /**Returns the selected value. + */ + value?: string; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the DropDownList model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface DataBoundEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the DropDownList model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; + + /**returns the data that is bound to DropDownList + */ + data?: any; +} + +export interface DestroyEventArgs { + + /**its value is set as true,if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the DropDownList model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface PopupHideEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the DropDownList model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; + + /**returns the selected text + */ + text?: string; + + /**returns the selected value + */ + value?: string; +} + +export interface PopupResizeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the DropDownList model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; + + /**Returns the data from the resizable plugin. + */ + event?: any; +} + +export interface PopupShownEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the DropDownList model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; + + /**returns the selected text + */ + text?: string; + + /**returns the selected value + */ + value?: string; +} + +export interface PopupResizeStartEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the DropDownList model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; + + /**Returns the data from the resizable plugin. + */ + event?: any; +} + +export interface PopupResizeStopEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the DropDownList model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; + + /**Returns the data from the resizable plugin. + */ + event?: any; +} + +export interface SearchEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns the data bound to the DropDownList. + */ + items?: any; + + /**returns the DropDownList model + */ + model?: any; + + /**Returns the selected item text. + */ + selectedText?: string; + + /**returns the name of the event + */ + type?: string; + + /**Returns the search string typed in search box. + */ + searchString?: string; +} + +export interface SelectEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns the selected item with checkbox checked or not. + */ + isChecked?: boolean; + + /**Returns the selected item ID. + */ + itemId?: string; + + /**returns the DropDownList model + */ + model?: any; + + /**Returns the selected item text. + */ + selectedText?: string; + + /**returns the name of the event + */ + type?: string; + + /**Returns the selected text. + */ + text?: string; + + /**Returns the selected value. + */ + value?: string; +} + +export interface Fields { + + /**Used to group the items. + */ + groupBy?: string; + + /**Defines the HTML attributes such as ID, class, and styles for the item. + */ + htmlAttributes?: any; + + /**Defines the ID for the tag. + */ + id?: string; + + /**Defines the image attributes such as height, width, styles, and so on. + */ + imageAttributes?: string; + + /**Defines the imageURL for the image location. + */ + imageUrl?: string; + + /**Defines the tag value to be selected initially. + */ + selected?: boolean; + + /**Defines the sprite css for the image tag. + */ + spriteCssClass?: string; + + /**Defines the table name for tag value or display text while rendering remote data. + */ + tableName?: string; + + /**Defines the text content for the tag. + */ + text?: string; + + /**Defines the tag value. + */ + value?: string; +} +} +enum FilterType +{ +//filter the data wherever contains search key +Contains, +//filter the data based on search key present at start position +StartsWith, +} +enum MultiSelectMode +{ +// can select only single item in DropDownList +None, +//can select multiple items and it's seperated by delimiterChar +Delimiter, +// can select multiple items and it's show's like visual box in textbox +VisualMode, +} +enum SortOrder +{ +// Sort the data in ascending order +Ascending, +//Sort the data in descending order +Descending, +} +enum VirtualScrollMode +{ +// The data is loaded only to the corresponding page (display items). When scrolling some other position, it enables the load on demand with the DropDownList. +Normal, +//The data items are loaded from the remote when scroll handle reaches the end of the scrollbar like infinity scrolling. +Continuous, +} + +class Editor extends ej.Widget { + static fn: Editor; + constructor(element: JQuery, options?: Editor.Model); + constructor(element: Element, options?: Editor.Model); + model:Editor.Model; + defaults:Editor.Model; + + /** destroy the editor widgets all events are unbind automatically and bring the control to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** To disable the corresponding Editors + * @returns {void} + */ + disable(): void; + + /** To enable the corresponding Editors + * @returns {void} + */ + enable(): void; + + /** To get value from corresponding Editors + * @returns {number} + */ + getValue(): number; +} + + class NumericTextbox extends Editor{ +} + + class CurrencyTextbox extends Editor{ +} + + class PercentageTextbox extends Editor{ +} +export module Editor{ + +export interface Model { + + /**Sets the root CSS class for Accordion theme, which is used customize. + */ + cssClass?: string; + + /**DecimalPlaces declares the number of digits to be displayed right side of the value. + * @Default {0} + */ + decimalPlaces?: number; + + /**Specify the editor control state. + * @Default {true} + */ + enabled?: boolean; + + /**Specify the enablePersistence to editor to save current model value to browser cookies for state maintains + * @Default {false} + */ + enablePersistence?: boolean; + + /**Specify the Right to Left Direction to editor. + * @Default {false} + */ + enableRTL?: boolean; + + /**Strict mode option to restrict entering values defined outside the range in the editor. + * @Default {false} + */ + enableStrictMode?: boolean; + + /**It provides the options to get the customized character to separate the digits. If not set, the separator defined by the current culture. + * @Default {null} + */ + groupSeparator?: string; + + /**Specifies the height of the editor. + * @Default {30} + */ + height?: number|string; + + /**It allows to define the characteristics of the Editors control. It will helps to extend the capability of an HTML element. + * @Default {{}} + */ + htmlAttributes?: any; + + /**The Editor value increment or decrement based an increment step value. + * @Default {1} + */ + incrementStep?: number; + + /**Specifies the Localization info used by the editor. + * @Default {en-US} + */ + locale?: string; + + /**Specifies the maximum value of the editor. + * @Default {Number.MAX_VALUE} + */ + maxValue?: number; + + /**Specifies the minimum value of the editor. + * @Default {-(Number.MAX_VALUE) and 0 for Currency Textbox.} + */ + minValue?: number; + + /**Specifies the name of the editor. + * @Default {Sets id as name if it is null.} + */ + name?: string; + + /**Toggles the readonly state of the editor. When the Editor is readonly it doesn't allow user interactions. + * @Default {false} + */ + readOnly?: boolean; + + /**Specify the rounded corner to editor + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Specifies whether the up and down spin buttons should be displayed in editor. + * @Default {true} + */ + showSpinButton?: boolean; + + /**Enables decimal separator position validation on type . + * @Default {false} + */ + validateOnType?: boolean; + + /**Set the jQuery validation error message in editor. + * @Default {null} + */ + validationMessage?: any; + + /**Set the jQuery validation rules to the editor. + * @Default {null} + */ + validationRules?: any; + + /**Specifies the value of the editor. + * @Default {null} + */ + value?: number|string; + + /**Specify the watermark text to editor. + */ + watermarkText?: string; + + /**Specifies the width of the editor. + * @Default {143} + */ + width?: number|string; + + /**Fires after Editor control value is changed.*/ + change? (e: ChangeEventArgs): void; + + /**Fires after Editor control is created.*/ + create? (e: CreateEventArgs): void; + + /**Fires when the Editor is destroyed successfully.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires after Editor control is focused.*/ + focusIn? (e: FocusInEventArgs): void; + + /**Fires after Editor control is loss the focus.*/ + focusOut? (e: FocusOutEventArgs): void; +} + +export interface ChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the corresponding editor model. + */ + model ?: ej.Editor.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns the corresponding editor control value. + */ + value ?: number; + + /**returns true when the value changed by user interaction otherwise returns false + */ + isInteraction ?: boolean; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the editor model + */ + model ?: ej.Editor.Model; + + /**returns the name of the event + */ + type ?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the editor model + */ + model ?: ej.Editor.Model; + + /**returns the name of the event + */ + type ?: string; +} + +export interface FocusInEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the corresponding editor model. + */ + model?: ej.Editor.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns the corresponding editor control value. + */ + value?: number; +} + +export interface FocusOutEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the corresponding editor model. + */ + model?: ej.Editor.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns the corresponding editor control value. + */ + value?: number; +} +} + +class ListView extends ej.Widget { + static fn: ListView; + constructor(element: JQuery, options?: ListView.Model); + constructor(element: Element, options?: ListView.Model); + model:ListView.Model; + defaults:ListView.Model; + + /** To add item in the given index. + * @param {string} Specifies the item to be added in ListView + * @param {number} Specifies the index where item to be added + * @returns {void} + */ + addItem(item: string, index: number): void; + + /** To check all the items. + * @returns {void} + */ + checkAllItem(): void; + + /** To check item in the given index. + * @param {number} Specifies the index of the item to be checked + * @returns {void} + */ + checkItem(index: number): void; + + /** To clear all the list item in the control before updating with new datasource. + * @returns {void} + */ + clear(): void; + + /** To make the item in the given index to be default state. + * @param {number} Specifies the index to make the item to be in default state. + * @returns {void} + */ + deActive(index: number): void; + + /** To disable item in the given index. + * @param {number} Specifies the index value to be disabled. + * @returns {void} + */ + disableItem(index: number): void; + + /** To enable item in the given index. + * @param {number} Specifies the index value to be enabled. + * @returns {void} + */ + enableItem(index: number): void; + + /** To get the active item. + * @returns {HTMLElement} + */ + getActiveItem(): HTMLElement; + + /** To get the text of the active item. + * @returns {string} + */ + getActiveItemText(): string; + + /** To get all the checked items. + * @returns {Array} + */ + getCheckedItems(): Array; + + /** To get the text of all the checked items. + * @returns {Array} + */ + getCheckedItemsText(): Array; + + /** To get the total item count. + * @returns {number} + */ + getItemsCount(): number; + + /** To get the text of the item in the given index. + * @param {string|number} Specifies the index value to get the textvalue. + * @returns {string} + */ + getItemText(index: string|number): string; + + /** To check whether the item in the given index has child item. + * @param {number} Specifies the index value to check the item has child or not. + * @returns {boolean} + */ + hasChild(index: number): boolean; + + /** To hide the list. + * @returns {void} + */ + hide(): void; + + /** To hide item in the given index. + * @param {number} Specifies the index value to hide the item. + * @returns {void} + */ + hideItem(index: number): void; + + /** To check whether item in the given index is checked. + * @returns {boolean} + */ + isChecked(): boolean; + + /** To load the ajax content while selecting the item. + * @param {string} Specifies the item to load the ajax content. + * @returns {void} + */ + loadAjaxContent(item: string): void; + + /** To remove the check mark either for specific item in the given index or for all items. + * @param {number} Specifies the index value to remove the checkbox. + * @returns {void} + */ + removeCheckMark(index: number): void; + + /** To remove item in the given index. + * @param {number} Specifies the index value to remove the item. + * @returns {void} + */ + removeItem(index: number): void; + + /** To select item in the given index. + * @param {number} Specifies the index value to select the item. + * @returns {void} + */ + selectItem(index: number): void; + + /** To make the item in the given index to be active state. + * @param {number} Specifies the index value to make the item in active state. + * @returns {void} + */ + setActive(index: number): void; + + /** To show the list. + * @returns {void} + */ + show(): void; + + /** To show item in the given index. + * @param {number} Specifies the index value to show the hided item. + * @returns {void} + */ + showItem(index: number): void; + + /** To uncheck all the items. + * @returns {void} + */ + unCheckAllItem(): void; + + /** To uncheck item in the given index. + * @param {number} Specifies the index value to uncheck the item. + * @returns {void} + */ + unCheckItem(index: number): void; +} +export module ListView{ + +export interface Model { + + /**Sets the root class for ListView theme. This cssClass API helps to use custom skinning option for ListView control. By defining the root class using this API, we need to include this root class in CSS. + */ + cssClass?: string; + + /**Contains the list of data for generating the ListView items. + * @Default {[]} + */ + dataSource?: Array; + + /**Specifies whether to load ajax content while selecting item. + * @Default {false} + */ + enableAjax?: boolean; + + /**Specifies whether to enable caching the content. + * @Default {false} + */ + enableCache?: boolean; + + /**Specifies whether to enable check mark for the item. + * @Default {false} + */ + enableCheckMark?: boolean; + + /**Specifies whether to enable the filtering feature to filter the item. + * @Default {false} + */ + enableFiltering?: boolean; + + /**Specifies whether to group the list item. + * @Default {false} + */ + enableGroupList?: boolean; + + /**Specifies to maintain the current model value to browser cookies for state maintenance. While refresh the page, the model value will get apply to the control from browser cookies. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Specifies the field settings to map the datasource. + */ + fieldSettings?: any; + + /**Specifies the text of the back button in the header. + * @Default {null} + */ + headerBackButtonText?: string; + + /**Specifies the title of the header. + * @Default {Title} + */ + headerTitle?: string; + + /**Specifies the height. + * @Default {null} + */ + height?: number; + + /**Specifies whether to retain the selection of the item. + * @Default {false} + */ + persistSelection?: boolean; + + /**Specifies whether to prevent the selection of the item. + * @Default {false} + */ + preventSelection?: boolean; + + /**Specifies the query to execute with the datasource. + * @Default {null} + */ + query?: any; + + /**Specifies whether need to render the control with the template contents. + * @Default {false} + */ + renderTemplate?: boolean; + + /**Specifies the index of item which need to be in selected state initially while loading. + * @Default {0} + */ + selectedItemIndex?: number; + + /**Specifies whether to show the header. + * @Default {true} + */ + showHeader?: boolean; + + /**Specifies ID of the element contains template contents. + * @Default {false} + */ + templateId?: boolean; + + /**Specifies the width. + * @Default {null} + */ + width?: number; + + /**Event triggers before the ajax request happens.*/ + ajaxBeforeLoad? (e: AjaxBeforeLoadEventArgs): void; + + /**Event triggers after the ajax content loaded completely.*/ + ajaxComplete? (e: AjaxCompleteEventArgs): void; + + /**Event triggers when the ajax request failed.*/ + ajaxError? (e: AjaxErrorEventArgs): void; + + /**Event triggers after the ajax content loaded successfully.*/ + ajaxSuccess? (e: AjaxSuccessEventArgs): void; + + /**Event triggers before the items loaded.*/ + load? (e: LoadEventArgs): void; + + /**Event triggers after the items loaded.*/ + loadComplete? (e: LoadCompleteEventArgs): void; + + /**Event triggers when mouse down happens on the item.*/ + mouseDown? (e: MouseDownEventArgs): void; + + /**Event triggers when mouse up happens on the item.*/ + mouseUP? (e: MouseUPEventArgs): void; +} + +export interface AjaxBeforeLoadEventArgs { + + /**returns true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the name of the event. + */ + type?: string; + + /**returns the model value of the control. + */ + model?: any; + + /**returns the ajax settings. + */ + ajaxData?: any; +} + +export interface AjaxCompleteEventArgs { + + /**returns true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the name of the event. + */ + type?: string; + + /**returns the model value of the control. + */ + model?: any; +} + +export interface AjaxErrorEventArgs { + + /**returns true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the name of the event. + */ + type?: string; + + /**returns the model value of the control. + */ + model?: any; + + /**returns the error thrown in the ajax post. + */ + errorThrown?: any; + + /**returns the status. + */ + textStatus?: any; + + /**returns the current list item. + */ + item?: any; + + /**returns the current item text. + */ + text?: string; + + /**returns the current item index. + */ + index?: number; +} + +export interface AjaxSuccessEventArgs { + + /**returns true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the name of the event. + */ + type?: string; + + /**returns the model value of the control. + */ + model?: any; + + /**returns the ajax current content. + */ + content?: string; + + /**returns the current list item. + */ + item?: any; + + /**returns the current item text. + */ + text?: string; + + /**returns the current item index. + */ + index?: number; + + /**returns the current url of the ajax post. + */ + url?: string; +} + +export interface LoadEventArgs { + + /**returns true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the name of the event. + */ + type?: string; + + /**returns the model value of the control. + */ + model?: any; +} + +export interface LoadCompleteEventArgs { + + /**returns true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the name of the event. + */ + type?: string; + + /**returns the model value of the control. + */ + model?: any; +} + +export interface MouseDownEventArgs { + + /**returns true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the name of the event. + */ + type?: string; + + /**returns the model value of the control. + */ + model?: any; + + /**If the child element exist return true; otherwise, false. + */ + hasChild?: boolean; + + /**returns the current list item. + */ + item?: string; + + /**returns the current text of item. + */ + text?: string; + + /**returns the current Index of the item. + */ + index?: number; + + /**If checked return true; otherwise, false. + */ + isChecked?: boolean; + + /**returns the list of checked items. + */ + checkedItems?: number; + + /**returns the current checked item text. + */ + checkedItemsText?: string; +} + +export interface MouseUPEventArgs { + + /**returns true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the name of the event. + */ + type?: string; + + /**returns the model value of the control. + */ + model?: any; + + /**If the child element exist return true; otherwise, false. + */ + hasChild?: boolean; + + /**returns the current list item. + */ + item?: string; + + /**returns the current text of item. + */ + text?: string; + + /**returns the current Index of the item. + */ + index?: number; + + /**If checked return true; otherwise, false. + */ + isChecked?: boolean; + + /**returns the list of checked items. + */ + checkedItems?: number; + + /**returns the current checked item text. + */ + checkedItemsText?: string; +} +} + +class MaskEdit extends ej.Widget { + static fn: MaskEdit; + constructor(element: JQuery, options?: MaskEdit.Model); + constructor(element: Element, options?: MaskEdit.Model); + model:MaskEdit.Model; + defaults:MaskEdit.Model; + + /** To clear the text in mask edit textbox control. + * @returns {void} + */ + clear(): void; + + /** To disable the mask edit textbox control. + * @returns {void} + */ + disable(): void; + + /** To enable the mask edit textbox control. + * @returns {void} + */ + enable(): void; + + /** To obtained the pure value of the text value, removes all the symbols in mask edit textbox control. + * @returns {string} + */ + get_StrippedValue(): string; + + /** To obtained the textbox value as such that, Just replace all '_' to ' '(space) in mask edit textbox control. + * @returns {string} + */ + get_UnstrippedValue(): string; +} +export module MaskEdit{ + +export interface Model { + + /**Specify the cssClass to achieve custom theme. + * @Default {null} + */ + cssClass?: string; + + /**Specify the custom character allowed to entered in mask edit textbox control. + * @Default {null} + */ + customCharacter?: string; + + /**Specify the state of the mask edit textbox control. + * @Default {true} + */ + enabled?: boolean; + + /**Specify the enablePersistence to mask edit textbox to save current model value to browser cookies for state maintains. + */ + enablePersistence?: boolean; + + /**Specifies the height for the mask edit textbox control. + * @Default {28 px} + */ + height?: string; + + /**Specifies whether hide the prompt characters with spaces on blur. Prompt chars will be shown again on focus the textbox. + * @Default {false} + */ + hidePromptOnLeave?: boolean; + + /**Specifies the list of html attributes to be added to mask edit textbox. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Specify the inputMode for mask edit textbox control. See InputMode + * @Default {ej.InputMode.Text} + */ + inputMode?: ej.InputMode|string; + + /**Specifies the input mask. + * @Default {null} + */ + maskFormat?: string; + + /**Specifies the name attribute value for the mask edit textbox. + * @Default {null} + */ + name?: string; + + /**Toggles the readonly state of the mask edit textbox. When the mask edit textbox is readonly, it doesn't allow your input. + * @Default {false} + */ + readOnly?: boolean; + + /**Specifies whether the error will show until correct value entered in the mask edit textbox control. + * @Default {false} + */ + showError?: boolean; + + /**MaskEdit input is displayed in rounded corner style when this property is set to true. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Specify the text alignment for mask edit textbox control.See TextAlign + * @Default {left} + */ + textAlign?: ej.TextAlign|string; + + /**Sets the jQuery validation error message in mask edit. This property works when the widget is present inside the form. Include jquery.validate.min.js plugin additionally. + * @Default {null} + */ + validationMessage?: any; + + /**Sets the jQuery validation rules to the MaskEdit. This property works when the widget is present inside the form. Include jquery.validate.min.js plugin additionally. + * @Default {null} + */ + validationRules?: any; + + /**Specifies the value for the mask edit textbox control. + * @Default {null} + */ + value?: string; + + /**Specifies the water mark text to be displayed in input text. + * @Default {null} + */ + watermarkText?: string; + + /**Specifies the width for the mask edit textbox control. + * @Default {143pixel} + */ + width?: string; + + /**Fires when value changed in mask edit textbox control.*/ + change? (e: ChangeEventArgs): void; + + /**Fires after MaskEdit control is created.*/ + create? (e: CreateEventArgs): void; + + /**Fires when the MaskEdit is destroyed successfully.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires when focused in mask edit textbox control.*/ + focusIn? (e: FocusInEventArgs): void; + + /**Fires when focused out in mask edit textbox control.*/ + focusOut? (e: FocusOutEventArgs): void; + + /**Fires when keydown in mask edit textbox control.*/ + keydown? (e: KeydownEventArgs): void; + + /**Fires when key press in mask edit textbox control.*/ + keyPress? (e: KeyPressEventArgs): void; + + /**Fires when keyup in mask edit textbox control.*/ + keyup? (e: KeyupEventArgs): void; + + /**Fires when mouse out in mask edit textbox control.*/ + mouseout? (e: MouseoutEventArgs): void; + + /**Fires when mouse over in mask edit textbox control.*/ + mouseover? (e: MouseoverEventArgs): void; +} + +export interface ChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the mask edit model + */ + model?: ej.MaskEdit.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the mask edit value + */ + value?: number; + + /**returns unstripped value in mask edit textbox control. + */ + unmaskedValue?: string; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the MaskEdit model + */ + model?: ej.MaskEdit.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the MaskEdit model + */ + model?: ej.MaskEdit.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface FocusInEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the mask edit model + */ + model?: ej.MaskEdit.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the mask edit value + */ + value?: number; + + /**returns unstripped value in mask edit textbox control. + */ + unmaskedValue?: string; +} + +export interface FocusOutEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the mask edit model + */ + model?: ej.MaskEdit.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the mask edit value + */ + value?: number; + + /**returns unstripped value in mask edit textbox control. + */ + unmaskedValue?: string; +} + +export interface KeydownEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the mask edit model + */ + model?: ej.MaskEdit.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the mask edit value + */ + value?: number; + + /**returns unstripped value in mask edit textbox control. + */ + unmaskedValue?: string; +} + +export interface KeyPressEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the mask edit model + */ + model?: ej.MaskEdit.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the mask edit value + */ + value?: number; + + /**returns unstripped value in mask edit textbox control. + */ + unmaskedValue?: string; +} + +export interface KeyupEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the mask edit model + */ + model?: ej.MaskEdit.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the mask edit value + */ + value?: number; + + /**returns unstripped value in mask edit textbox control. + */ + unmaskedValue?: string; +} + +export interface MouseoutEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the mask edit model + */ + model?: ej.MaskEdit.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the mask edit value + */ + value?: number; + + /**returns unstripped value in mask edit textbox control. + */ + unmaskedValue?: string; +} + +export interface MouseoverEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the mask edit model + */ + model?: ej.MaskEdit.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the mask edit value + */ + value?: number; + + /**returns unstripped value in mask edit textbox control. + */ + unmaskedValue?: string; +} +} +enum InputMode +{ +//string +Password, +//string +Text, +} +enum TextAlign +{ +//string +Center, +//string +Justify, +//string +Left, +//string +Right, +} + +class Menu extends ej.Widget { + static fn: Menu; + constructor(element: JQuery, options?: Menu.Model); + constructor(element: Element, options?: Menu.Model); + model:Menu.Model; + defaults:Menu.Model; + + /** Disables the Menu control. + * @returns {void} + */ + disable(): void; + + /** Specifies the Menu Item to be disabled by using the Menu Item Text. + * @param {string} Specifies the Menu Item Text to be disabled. + * @returns {void} + */ + disableItem(itemtext: string): void; + + /** Specifies the Menu Item to be disabled by using the Menu Item Id. + * @param {string|number} Specifies the Menu Item id to be disabled + * @returns {void} + */ + disableItembyID(itemid: string|number): void; + + /** Enables the Menu control. + * @returns {void} + */ + enable(): void; + + /** Specifies the Menu Item to be enabled by using the Menu Item Text. + * @param {string} Specifies the Menu Item Text to be enabled. + * @returns {void} + */ + enableItem(itemtext: string): void; + + /** Specifies the Menu Item to be enabled by using the Menu Item Id. + * @param {string|number} Specifies the Menu Item id to be enabled. + * @returns {void} + */ + enableItembyID(itemid: string|number): void; + + /** Hides the Context Menu control. + * @returns {void} + */ + hide(): void; + + /** Insert the menu item as child of target node. + * @param {any} Information about Menu item. + * @param {string|any} Selector of target node or Object of target node. + * @returns {void} + */ + insert(item: any, target: string|any): void; + + /** Insert the menu item after the target node. + * @param {any} Information about Menu item. + * @param {string|any} Selector of target node or Object of target node. + * @returns {void} + */ + insertAfter(item: any, target: string|any): void; + + /** Insert the menu item before the target node. + * @param {any} Information about Menu item. + * @param {string|any} Selector of target node or Object of target node. + * @returns {void} + */ + insertBefore(item: any, target: string|any): void; + + /** Remove Menu item. + * @param {any|Array} Selector of target node or Object of target node. + * @returns {void} + */ + remove(target: any|Array): void; + + /** To show the Menu control. + * @param {number} x co-ordinate position of context menu. + * @param {number} y co-ordinate position of context menu. + * @param {any} target element + * @param {any} name of the event + * @returns {void} + */ + show(locationX: number, locationY: number, targetElement: any, event: any): void; +} +export module Menu{ + +export interface Model { + + /**To enable or disable the Animation while hover or click an menu items.See AnimationType + * @Default {ej.AnimationType.Default} + */ + animationType?: ej.AnimationType|string; + + /**Specifies the target id of context menu. On right clicking the specified contextTarget element, context menu gets shown. + * @Default {null} + */ + contextMenuTarget?: string; + + /**Specify the CSS class to achieve custom theme. + */ + cssClass?: string; + + /**To enable or disable the Animation effect while hover or click an menu items. + * @Default {true} + */ + enableAnimation?: boolean; + + /**Specifies the root menu items to be aligned center in horizontal menu. + * @Default {false} + */ + enableCenterAlign?: boolean; + + /**Enable / Disable the Menu control. + * @Default {true} + */ + enabled?: boolean; + + /**Specifies the menu items to be displayed in right to left direction. + * @Default {false} + */ + enableRTL?: boolean; + + /**When this property sets to false, the menu items is displayed without any separators. + * @Default {true} + */ + enableSeparator?: boolean; + + /**Specifies the target which needs to be excluded. i.e., The context menu will not be displayed in those specified targets. + * @Default {null} + */ + excludeTarget?: string; + + /**Fields used to bind the data source and it includes following field members to make databind easier. + * @Default {null} + */ + fields?: Fields; + + /**Specifies the height of the root menu. + * @Default {auto} + */ + height?: string|number; + + /**Specifies the list of html attributes to be added to menu control. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Specifies the type of the menu. Essential JavaScript Menu consists of two type of menu, they are Normal Menu and Context Menu mode.See MenuType + * @Default {ej.MenuType.NormalMenu} + */ + menuType?: string|ej.MenuType; + + /**Specifies the sub menu items to be show or open only on click. + * @Default {false} + */ + openOnClick?: boolean; + + /**Specifies the orientation of normal menu. Normal menu can rendered in horizontal or vertical direction by using this API. See Orientation + * @Default {ej.Orientation.Horizontal} + */ + orientation?: string|ej.Orientation; + + /**Specifies the main menu items arrows only to be shown if it contains child items. + * @Default {true} + */ + showRooltLevelArrows?: boolean; + + /**Specifies the sub menu items arrows only to be shown if it contains child items. + * @Default {true} + */ + showSubLevelArrows?: boolean; + + /**Specifies position of pulldown submenus that will appear on mouse over.See Direction + * @Default {ej.Direction.Right} + */ + subMenuDirection?: string|ej.Direction; + + /**Specifies the title to responsive menu. + * @Default {Menu} + */ + titleText?: string; + + /**Specifies the width of the main menu. + * @Default {auto} + */ + width?: string|number; + + /**Fires before context menu gets open.*/ + beforeOpen? (e: BeforeOpenEventArgs): void; + + /**Fires when mouse click on menu items.*/ + click? (e: ClickEventArgs): void; + + /**Fire when context menu on close.*/ + close? (e: CloseEventArgs): void; + + /**Fires when context menu on open.*/ + open? (e: OpenEventArgs): void; + + /**Fires to create menu items.*/ + create? (e: CreateEventArgs): void; + + /**Fires to destroy menu items.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires when key down on menu items.*/ + keydown? (e: KeydownEventArgs): void; + + /**Fires when mouse out from menu items.*/ + mouseout? (e: MouseoutEventArgs): void; + + /**Fires when mouse over the Menu items.*/ + mouseover? (e: MouseoverEventArgs): void; +} + +export interface BeforeOpenEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the menu model + */ + model?: ej.Menu.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the target element + */ + target?: any; +} + +export interface ClickEventArgs { + + /**returns the menu model + */ + model?: ej.Menu.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns clicked menu item text + */ + text?: string; + + /**returns clicked menu item element + */ + element?: any; + + /**returns the event + */ + event?: any; + + /**returns the selected item + */ + selectedItem?: number; +} + +export interface CloseEventArgs { + + /**returns the menu model + */ + model?: ej.Menu.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the target element + */ + target?: any; +} + +export interface OpenEventArgs { + + /**returns the menu model + */ + model?: ej.Menu.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the target element + */ + target?: any; +} + +export interface CreateEventArgs { + + /**returns the menu model + */ + model?: ej.Menu.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**returns the menu model + */ + model?: ej.Menu.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface KeydownEventArgs { + + /**returns the menu model + */ + model?: ej.Menu.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns clicked menu item text + */ + menuText?: string; + + /**returns clicked menu item element + */ + element?: any; + + /**returns the event + */ + event?: any; +} + +export interface MouseoutEventArgs { + + /**returns the menu model + */ + model?: ej.Menu.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns clicked menu item text + */ + text?: string; + + /**returns clicked menu item element + */ + element?: any; + + /**returns the event + */ + event?: any; +} + +export interface MouseoverEventArgs { + + /**returns the menu model + */ + model?: ej.Menu.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns clicked menu item text + */ + text?: string; + + /**returns clicked menu item element + */ + element?: any; + + /**returns the event + */ + event?: any; +} + +export interface Fields { + + /**It receives the child data for the inner level. + */ + child?: any; + + /**It receives datasource as Essential DataManager object and JSON object. + */ + dataSource?: any; + + /**Specifies the html attributes to “li” item list. + */ + htmlAttribute?: string; + + /**Specifies the id to menu items list + */ + id?: string; + + /**Specifies the image attribute to “img” tag inside items list. + */ + imageAttribute?: string; + + /**Specifies the image URL to “img” tag inside item list. + */ + imageUrl?: string; + + /**Adds custom attributes like "target" to the anchor tag of the menu items. + */ + linkAttribute?: string; + + /**Specifies the parent id of the table. + */ + parentId?: string; + + /**It receives query to retrieve data from the table (query is same as SQL). + */ + query?: any; + + /**Specifies the sprite CSS class to “li” item list. + */ + spriteCssClass?: string; + + /**It receives table name to execute query on the corresponding table. + */ + tableName?: string; + + /**Specifies the text of menu items list. + */ + text?: string; + + /**Specifies the url to the anchor tag in menu item list. + */ + url?: string; +} +} +enum AnimationType +{ +//string +Default, +//string +None, +} +enum MenuType +{ +//string +ContextMenu, +//string +NormalMenu, +} +enum Direction +{ +//string +Left, +//string +None, +//string +Right, +} + +class Pager extends ej.Widget { + static fn: Pager; + constructor(element: JQuery, options?: Pager.Model); + constructor(element: Element, options?: Pager.Model); + model:Pager.Model; + defaults:Pager.Model; + + /** Send a paging request to specified page through the pagerControl. + * @returns {void} + */ + gotoPage(): void; +} +export module Pager{ + +export interface Model { + + /**Gets or sets a value that indicates whether to define the number of records displayed per page. + * @Default {12} + */ + pageSize?: number; + + /**Gets or sets a value that indicates whether to define the number of pages displayed in the pager for navigation. + * @Default {10} + */ + pageCount?: number; + + /**Gets or sets a value that indicates whether to define which page to display currently in pager. + * @Default {1} + */ + currentPage?: number; + + /**Get or sets a value of total number of pages in the pager. The totalPages value is calculated based on pagesize and totalrecords. + * @Default {null} + */ + totalPages?: number; + + /**Get the value of total number of records which is bound to a data item. + * @Default {null} + */ + totalRecordsCount?: number; + + /**Gets or sets a value that indicates whether to pass the current page information as a query string along with the url while navigating to other page. + * @Default {false} + */ + enableQueryString?: boolean; + + /**Gets or sets a value that indicates whether to customizing the user interface (UI) as locale-specific in order to display regional data i.e. in a language and culture specific to a particular country or region. + * @Default {en-US} + */ + locale?: string; + + /**Align content in the pager control from right to left by setting the property as true. + * @Default {false} + */ + enableRTL?: boolean; + + /**Triggered when pager numeric item is clicked in pager control.*/ + click? (e: ClickEventArgs): void; +} + +export interface ClickEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the current page index. + */ + currentPage?: number; + + /**Returns the pager model. + */ + model?: any; + + /**Returns the name of event + */ + type?: string; + + /**Returns current action event type and its target. + */ + event?: any; +} +} + +class ProgressBar extends ej.Widget { + static fn: ProgressBar; + constructor(element: JQuery, options?: ProgressBar.Model); + constructor(element: Element, options?: ProgressBar.Model); + model:ProgressBar.Model; + defaults:ProgressBar.Model; + + /** Destroy the progressbar widget + * @returns {void} + */ + destroy(): void; + + /** Disables the progressbar control + * @returns {void} + */ + disable(): void; + + /** Enables the progressbar control + * @returns {void} + */ + enable(): void; + + /** Returns the current progress value in percent. + * @returns {number} + */ + getPercentage(): number; + + /** Returns the current progress value + * @returns {number} + */ + getValue(): number; +} +export module ProgressBar{ + +export interface Model { + + /**Sets the root CSS class for ProgressBar theme, which is used customize. + * @Default {null} + */ + cssClass?: string; + + /**When this property sets to false, it disables the ProgressBar control + * @Default {true} + */ + enabled?: boolean; + + /**Save current model value to browser cookies for state maintains. While refresh the progressBar control page retains the model value apply from browser cookies + * @Default {false} + */ + enablePersistence?: boolean; + + /**Sets the ProgressBar direction as right to left alignment. + * @Default {false} + */ + enableRTL?: boolean; + + /**Defines the height of the ProgressBar. + * @Default {null} + */ + height?: number|string; + + /**It allows to define the characteristics of the progressBar control. It will helps to extend the capability of an HTML element. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Sets the maximum value of the ProgressBar. + * @Default {100} + */ + maxValue?: number; + + /**Sets the minimum value of the ProgressBar. + * @Default {0} + */ + minValue?: number; + + /**Sets the ProgressBar value in percentage. The value should be in between 0 to 100. + * @Default {0} + */ + percentage?: number; + + /**Displays rounded corner borders on the progressBar control. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Sets the custom text for the ProgressBar. The text placed in the middle of the ProgressBar and it can be customizable using the class 'e-progress-text'. + * @Default {null} + */ + text?: string; + + /**Sets the ProgressBar value. The value should be in between min and max values. + * @Default {0} + */ + value?: number; + + /**Defines the width of the ProgressBar. + * @Default {null} + */ + width?: number|string; + + /**Event triggers when the progress value changed*/ + change? (e: ChangeEventArgs): void; + + /**Event triggers when the process completes (at 100%)*/ + complete? (e: CompleteEventArgs): void; + + /**Event triggers when the progressbar are created*/ + create? (e: CreateEventArgs): void; + + /**Event triggers when the progressbar are destroyed*/ + destroy? (e: DestroyEventArgs): void; + + /**Event triggers when the process starts (from 0%)*/ + start? (e: StartEventArgs): void; +} + +export interface ChangeEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the ProgressBar model + */ + model?: ej.ProgressBar.Model; + + /**returns the current progress percentage + */ + percentage?: any; + + /**returns the name of the event + */ + type?: string; + + /**returns the current progress value + */ + value?: string; +} + +export interface CompleteEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the ProgressBar model + */ + model?: ej.ProgressBar.Model; + + /**returns the current progress percentage + */ + percentage?: any; + + /**returns the name of the event + */ + type?: string; + + /**returns the current progress value + */ + value?: string; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the progressbar model + */ + model?: ej.ProgressBar.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the progressbar model + */ + model?: ej.ProgressBar.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface StartEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the ProgressBar model + */ + model?: ej.ProgressBar.Model; + + /**returns the current progress percentage + */ + percentage?: any; + + /**returns the name of the event + */ + type?: string; + + /**returns the current progress value + */ + value?: string; +} +} + +class RadioButton extends ej.Widget { + static fn: RadioButton; + constructor(element: JQuery, options?: RadioButton.Model); + constructor(element: Element, options?: RadioButton.Model); + model:RadioButton.Model; + defaults:RadioButton.Model; + + /** To disable the RadioButton + * @returns {void} + */ + disable(): void; + + /** To enable the RadioButton + * @returns {void} + */ + enable(): void; +} +export module RadioButton{ + +export interface Model { + + /**Specifies the check attribute of the Radio Button. + * @Default {false} + */ + checked?: boolean; + + /**Specify the CSS class to RadioButton to achieve custom theme. + */ + cssClass?: string; + + /**Specifies the RadioButton control state. + * @Default {true} + */ + enabled?: boolean; + + /**Specifies the enablePersistence property for RadioButton while initialization. The enablePersistence API save current model value to browser cookies for state maintains. While refreshing the radio button control page the model value apply from browser cookies. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Specify the Right to Left direction to RadioButton + * @Default {false} + */ + enableRTL?: boolean; + + /**Specifies the HTML Attributes of the Checkbox + * @Default {{}} + */ + htmlAttributes?: any; + + /**Specifies the id attribute for the Radio Button while initialization. + * @Default {null} + */ + id?: string; + + /**Specify the idPrefix value to be added before the current id of the RadioButton. + * @Default {ej} + */ + idPrefix?: string; + + /**Specifies the name attribute for the Radio Button while initialization. + * @Default {Sets id as name if it is null} + */ + name?: string; + + /**Specifies the size of the RadioButton. + * @Default {small} + */ + size?: ej.RadioButtonSize|string; + + /**Specifies the text content for RadioButton. + */ + text?: string; + + /**Set the jquery validation error message in radio button. + * @Default {null} + */ + validationMessage?: any; + + /**Set the jquery validation rules in radio button. + * @Default {null} + */ + validationRules?: any; + + /**Specifies the value attribute of the Radio Button. + * @Default {null} + */ + value?: string; + + /**Fires before the RadioButton is going to changed its state successfully*/ + beforeChange? (e: BeforeChangeEventArgs): void; + + /**Fires when the RadioButton state is changed successfully*/ + change? (e: ChangeEventArgs): void; + + /**Fires when the RadioButton created successfully*/ + create? (e: CreateEventArgs): void; + + /**Fires when the RadioButton destroyed successfully*/ + destroy? (e: DestroyEventArgs): void; +} + +export interface BeforeChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the RadioButton model + */ + model?: ej.RadioButton.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns true if element is checked, otherwise returns false + */ + isChecked?: boolean; + + /**returns true if change event triggered by interaction, otherwise returns false + */ + isInteraction?: boolean; +} + +export interface ChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the RadioButton model + */ + model?: ej.RadioButton.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns true if element is checked, otherwise returns false + */ + isChecked?: boolean; + + /**returns true if change event triggered by interaction, otherwise returns false + */ + isInteraction?: boolean; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the RadioButton model + */ + model?: ej.RadioButton.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the RadioButton model + */ + model?: ej.RadioButton.Model; + + /**returns the name of the event + */ + type?: string; +} +} +enum RadioButtonSize +{ +//Shows small size radio button +Small, +//Shows medium size radio button +Medium, +} + +class Rating extends ej.Widget { + static fn: Rating; + constructor(element: JQuery, options?: Rating.Model); + constructor(element: Element, options?: Rating.Model); + model:Rating.Model; + defaults:Rating.Model; + + /** Destroy the Rating widget all events bound will be unbind automatically and bring the control to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** To get the current value of rating control. + * @returns {number} + */ + getValue(): number; + + /** To hide the rating control. + * @returns {void} + */ + hide(): void; + + /** User can refresh the rating control to identify changes. + * @returns {void} + */ + refresh(): void; + + /** To reset the rating value. + * @returns {void} + */ + reset(): void; + + /** To set the rating value. + * @param {string|number} Specifies the rating value. + * @returns {void} + */ + setValue(value: string|number): void; + + /** To show the rating control + * @returns {void} + */ + show(): void; +} +export module Rating{ + +export interface Model { + + /**Enables the rating control with reset button.It can be used to reset the rating control value. + * @Default {true} + */ + allowReset?: boolean; + + /**Specify the CSS class to achieve custom theme. + */ + cssClass?: string; + + /**When this property is set to false, it disables the rating control. + * @Default {true} + */ + enabled?: boolean; + + /**Save current model value to browser cookies for state maintenance. While refresh the page Rating control values are retained. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Specifies the height of the Rating control wrapper. + * @Default {null} + */ + height?: string; + + /**Specifies the value to be increased while navigating between shapes(stars) in Rating control. + * @Default {1} + */ + incrementStep?: number; + + /**Allow to render the maximum number of Rating shape(star). + * @Default {5} + */ + maxValue?: number; + + /**Allow to render the minimum number of Rating shape(star). + * @Default {0} + */ + minValue?: number; + + /**Specifies the orientation of Rating control. See Orientation + * @Default {ej.Rating.Orientation.Horizontal} + */ + orientation?: ej.Orientation|string; + + /**Helps to provide more precise ratings.Rating control supports three precision modes - full, half, and exact. See Precision + * @Default {full} + */ + precision?: ej.Rating.Precision|string; + + /**Interaction with Rating control can be prevented by enabling this API. + * @Default {false} + */ + readOnly?: boolean; + + /**To specify the height of each shape in Rating control. + * @Default {23} + */ + shapeHeight?: number; + + /**To specify the width of each shape in Rating control. + * @Default {23} + */ + shapeWidth?: number; + + /**Enables the tooltip option.Currently selected value will be displayed in tooltip. + * @Default {true} + */ + showTooltip?: boolean; + + /**To specify the number of stars to be selected while rendering. + * @Default {1} + */ + value?: number; + + /**Specifies the width of the Rating control wrapper. + * @Default {null} + */ + width?: string; + + /**Fires when Rating value changes.*/ + change? (e: ChangeEventArgs): void; + + /**Fires when Rating control is clicked successfully.*/ + click? (e: ClickEventArgs): void; + + /**Fires when Rating control is created.*/ + create? (e: CreateEventArgs): void; + + /**Fires when Rating control is destroyed successfully.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires when mouse hover is removed from Rating control.*/ + mouseout? (e: MouseoutEventArgs): void; + + /**Fires when mouse hovered over the Rating control.*/ + mouseover? (e: MouseoverEventArgs): void; +} + +export interface ChangeEventArgs { + + /**returns the current value. + */ + value?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the rating model + */ + model?: ej.Rating.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the mouse click event args values. + */ + event?: any; +} + +export interface ClickEventArgs { + + /**returns the current value. + */ + value?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the rating model + */ + model?: ej.Rating.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the mouse click event args values. + */ + event?: any; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the rating model + */ + model?: ej.Rating.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the rating model + */ + model?: ej.Rating.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface MouseoutEventArgs { + + /**returns the current value. + */ + value?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the rating model + */ + model?: ej.Rating.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the mouse click event args values. + */ + event?: any; +} + +export interface MouseoverEventArgs { + + /**returns the current value. + */ + value?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the rating model + */ + model?: ej.Rating.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the mouse click event args values. + */ + event?: any; + + /**returns the current index value. + */ + index?: any; +} + +enum Precision{ + + ///string + Exact, + + ///string + Full, + + ///string + Half +} + +} + +class Ribbon extends ej.Widget { + static fn: Ribbon; + constructor(element: JQuery, options?: Ribbon.Model); + constructor(element: Element, options?: Ribbon.Model); + model:Ribbon.Model; + defaults:Ribbon.Model; + + /** Adds contextual tab or contextual tab set dynamically in the ribbon control with contextual tabs object and index position. When index is null, ribbon contextual tab or contextual tab set is added at the last index. + * @param {any} contextual tab or contextual tab set object. + * @param {number} index of the contextual tab or contextual tab set, this is optional. + * @returns {void} + */ + addContextualTabs(contextualTabSet: any, index: number): void; + + /** Adds tab dynamically in the ribbon control with given name, tab group array and index position. When index is null, ribbon tab is added at the last index. + * @param {string} ribbon tab display text. + * @param {Array} groups to be displayed in ribbon tab . + * @param {number} index of the ribbon tab,this is optional. + * @returns {void} + */ + addTab(tabText: string, ribbonGroups: Array, index: number): void; + + /** Adds tab group dynamically in the ribbon control with given tab index, tab group object and group index position. When group index is null, ribbon group is added at the last index. + * @param {number} ribbon tab index. + * @param {any} group to be displayed in ribbon tab . + * @param {number} index of the ribbon group,this is optional. + * @returns {void} + */ + addTabGroup(tabIndex: number, tabGroup: any, groupIndex: number): void; + + /** Adds group content dynamically in the ribbon control with given tab index, group index, sub group index, content and content index position. When content index is null, content is added at the last index. + * @param {number} ribbon tab index. + * @param {number} ribbon group index. + * @param {number} sub group index in the ribbon group, + * @param {any} content to be displayed in the ribbon group. + * @param {number} ribbon content index .this is optional. + * @returns {void} + */ + addTabGroupContent(tabIndex: number, groupIndex: number, subGroupIndex: number, content: any, contentIndex: number): void; + + /** Hides the ribbon backstage page. + * @returns {void} + */ + hideBackstage(): void; + + /** Collapses the ribbon tab content. + * @returns {void} + */ + collapse(): void; + + /** Destroys the ribbon widget. All the events bound using this._on are unbound automatically and the ribbon control is moved to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** Expands the ribbon tab content. + * @returns {void} + */ + expand(): void; + + /** Gets text of the given index tab in the ribbon control. + * @param {number} index of the tab item. + * @returns {string} + */ + getTabText(index: number): string; + + /** Hides the given text tab in the ribbon control. + * @param {string} text of the tab item. + * @returns {void} + */ + hideTab(string: string): void; + + /** Checks whether the given text tab in the ribbon control is enabled or not. + * @param {string} text of the tab item. + * @returns {boolean} + */ + isEnable(string: string): boolean; + + /** Checks whether the given text tab in the ribbon control is visible or not. + * @param {string} text of the tab item. + * @returns {boolean} + */ + isVisible(string: string): boolean; + + /** Removes the given index tab item from the ribbon control. + * @param {number} index of tab item. + * @returns {void} + */ + removeTab(index: number): void; + + /** Sets new text to the given text tab in the ribbon control. + * @param {string} current text of the tab item. + * @param {string} new text of the tab item. + * @returns {void} + */ + setTabText(tabText: string, newText: string): void; + + /** Displays the ribbon backstage page. + * @returns {void} + */ + showBackstage(): void; + + /** Displays the given text tab in the ribbon control. + * @param {string} text of the tab item. + * @returns {void} + */ + showTab(string: string): void; +} +export module Ribbon{ + +export interface Model { + + /**Enables the ribbon resize feature. + * @Default {false} + */ + allowResizing?: boolean; + + /**Specifies the height, width, enableRTL, showRoundedCorner,enabled,cssClass property to the controls in the ribbon commonly andit will work only when those properties are not defined in buttonSettings and content defaults. + * @Default {object} + */ + buttonDefaults?: any; + + /**Property to enable the ribbon quick access toolbar. + * @Default {false} + */ + showQAT?: boolean; + + /**Sets custom setting to the collapsible pin in the ribbon. + * @Default {Object} + */ + collapsePinSettings?: CollapsePinSettings; + + /**Sets custom setting to the expandable pin in the ribbon. + * @Default {Object} + */ + expandPinSettings?: ExpandPinSettings; + + /**Specifies the application tab to contain application menu or backstage page in the ribbon control. + * @Default {Object} + */ + applicationTab?: ApplicationTab; + + /**Specifies the contextual tabs and tab set to the ribbon control with the background color and border color. Refer to the tabs section for adding tabs into the contextual tab and contextual tab set. + * @Default {array} + */ + contextualTabs?: Array; + + /**Specifies the index or indexes to disable the given index tab or indexes tabs in the ribbon control. + * @Default {0} + */ + disabledItemIndex?: Array; + + /**Specifies the index or indexes to enable the given index tab or indexes tabs in the ribbon control. + * @Default {null} + */ + enabledItemIndex?: Array; + + /**Specifies the index of the ribbon tab to select the given index tab item in the ribbon control. + * @Default {1} + */ + selectedItemIndex?: number; + + /**Specifies the tabs and its groups. Also specifies the control details that has to be placed in the tab area in the ribbon control. + * @Default {array} + */ + tabs?: Array; + + /**Gets or sets a value that indicates whether to customizing the user interface (UI) as locale-specific in order to display regional data i.e. in a language and culture specific to a particular country or region and it will need to use the user's preference. + * @Default {en-US} + */ + locale?: string; + + /**Specifies the width to the ribbon control. You can set width in string or number format. + * @Default {null} + */ + width?: string|number; + + /**Triggered before the ribbon tab item is removed.*/ + beforeTabRemove? (e: BeforeTabRemoveEventArgs): void; + + /**Triggered before the ribbon control is created.*/ + create? (e: CreateEventArgs): void; + + /**Triggered before the ribbon control is destroyed.*/ + destroy? (e: DestroyEventArgs): void; + + /**Triggered when the control in the group is clicked successfully.*/ + groupClick? (e: GroupClickEventArgs): void; + + /**Triggered when the groupexpander in the group is clicked successfully.*/ + groupExpand? (e: GroupExpandEventArgs): void; + + /**Triggered when an item in the Gallery control is clicked successfully.*/ + galleryItemClick? (e: GalleryItemClickEventArgs): void; + + /**Triggered when a tab or button in the backstage page is clicked successfully.*/ + backstageItemClick? (e: BackstageItemClickEventArgs): void; + + /**Triggered when the ribbon control is collapsed.*/ + collapse? (e: CollapseEventArgs): void; + + /**Triggered when the ribbon control is expanded.*/ + expand? (e: ExpandEventArgs): void; + + /**Triggered after adding the new ribbon tab item.*/ + tabAdd? (e: TabAddEventArgs): void; + + /**Triggered when tab is clicked successfully in the ribbon control.*/ + tabClick? (e: TabClickEventArgs): void; + + /**Triggered before the ribbon tab is created.*/ + tabCreate? (e: TabCreateEventArgs): void; + + /**Triggered after the tab item is removed from the ribbon control.*/ + tabRemove? (e: TabRemoveEventArgs): void; + + /**Triggered after the ribbon tab item is selected in the ribbon control.*/ + tabSelect? (e: TabSelectEventArgs): void; + + /**Triggered when the expand/collapse button is clicked successfully .*/ + toggleButtonClick? (e: ToggleButtonClickEventArgs): void; + + /**Triggered when the QAT menu item is clicked successfully .*/ + qatMenuItemClick? (e: QatMenuItemClickEventArgs): void; +} + +export interface BeforeTabRemoveEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns current tab item index in the ribbon control. + */ + index?: number; +} + +export interface CreateEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**Set to true when the event has to be cancelled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns current ribbon tab item index + */ + deleteIndex?: number; +} + +export interface GroupClickEventArgs { + + /**Set to true when the event has to be cancelled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns the control clicked in the group. + */ + target?: number; +} + +export interface GroupExpandEventArgs { + + /**Set to true when the event has to be cancelled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns the clicked groupexpander. + */ + target?: number; +} + +export interface GalleryItemClickEventArgs { + + /**Set to true when the event has to be cancelled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the gallery model. + */ + galleryModel?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns the item clicked in the gallery. + */ + target?: number; +} + +export interface BackstageItemClickEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns the item clicked in the gallery. + */ + target?: number; + + /**returns the id of the target item. + */ + id?: string; + + /**returns the text of the target item. + */ + text?: string; +} + +export interface CollapseEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface ExpandEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface TabAddEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns new added tab header. + */ + tabHeader?: any; + + /**returns new added tab content panel. + */ + tabContent?: any; +} + +export interface TabClickEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns previous active tab header. + */ + prevActiveHeader?: any; + + /**returns previous active index. + */ + prevActiveIndex?: number; + + /**returns current active tab header . + */ + activeHeader?: any; + + /**returns current active index. + */ + activeIndex?: number; +} + +export interface TabCreateEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns current ribbon tab item index + */ + deleteIndex?: number; +} + +export interface TabRemoveEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns the removed index. + */ + removedIndex?: number; +} + +export interface TabSelectEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns previous active tab header. + */ + prevActiveHeader?: any; + + /**returns previous active index. + */ + prevActiveIndex?: number; + + /**returns current active tab header . + */ + activeHeader?: any; + + /**returns current active index. + */ + activeIndex?: number; +} + +export interface ToggleButtonClickEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns the expand/collapse button. + */ + target?: number; +} + +export interface QatMenuItemClickEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns the clicked menu item text. + */ + text?: string; +} + +export interface CollapsePinSettings { + + /**Sets tooltip for the collapse pin . + * @Default {null} + */ + toolTip?: string; + + /**Specifies the custom tooltip for collapse pin.Refer to ejRibbon#tabs->groups->content->groups->customToolTip for its inner properties. + * @Default {Object} + */ + customToolTip?: any; +} + +export interface ExpandPinSettings { + + /**Sets tooltip for the expand pin. + * @Default {null} + */ + toolTip?: string; + + /**Specifies the custom tooltip for expand pin.Refer to ejRibbon#tabs->groups->content->groups->customToolTip for its inner properties. + * @Default {Object} + */ + customToolTip?: any; +} + +export interface ApplicationTabBackstageSettingsPages { + + /**Specifies the id for ribbon backstage page's tab and button elements. + * @Default {null} + */ + id?: string; + + /**Specifies the text for ribbon backstage page's tab header and button elements. + * @Default {null} + */ + text?: string; + + /**Specifies the type for ribbon backstage page's contents. Set "ej.Ribbon.backStageItemType.tab" to render the tab or "ej.Ribbon.backStageItemType.button" to render the button. + * @Default {ej.Ribbon.itemType.tab} + */ + itemType?: ej.Ribbon.itemType|string; + + /**Specifies the id of html elements like div, ul, etc., as ribbon backstage page's tab content. + * @Default {null} + */ + contentID?: string; + + /**Specifies the separator between backstage page's tab and button elements. + * @Default {false} + */ + enableSeparator?: boolean; +} + +export interface ApplicationTabBackstageSettings { + + /**Specifies the display text of application tab. + * @Default {null} + */ + text?: string; + + /**Specifies the height of ribbon backstage page. + * @Default {null} + */ + height?: string|number; + + /**Specifies the width of ribbon backstage page. + * @Default {null} + */ + width?: string|number; + + /**Specifies the ribbon backstage page with its tab and button elements. + * @Default {array} + */ + pages?: Array; + + /**Specifies the width of backstage page header that contains tabs and buttons. + * @Default {null} + */ + headerWidth?: string|number; +} + +export interface ApplicationTab { + + /**Specifies the ribbon backstage page items. + * @Default {object} + */ + backstageSettings?: ApplicationTabBackstageSettings; + + /**Specifies the ID of 'ul' list to create application menu in the ribbon control. + * @Default {null} + */ + menuItemID?: string; + + /**Specifies the menu members, events by using the menu settings for the menu in the application tab. + * @Default {object} + */ + menuSettings?: any; + + /**Specifies the application menu or backstage page. Specify the type of application tab as "ej.Ribbon.applicationTabType.menu" to render the application menu or "ej.Ribbon.applicationTabType.backstage" to render backstage page in the ribbon control. + * @Default {ej.Ribbon.applicationTabType.menu} + */ + type?: ej.Ribbon.applicationTabType|string; +} + +export interface ContextualTabs { + + /**Specifies the backgroundColor of the contextual tabs and tab set in the ribbon control. + * @Default {null} + */ + backgroundColor?: string; + + /**Specifies the borderColor of the contextual tabs and tab set in the ribbon control. + * @Default {null} + */ + borderColor?: string; + + /**Specifies the tabs to present in the contextual tabs and tab set. Refer to the tabs section for adding tabs into the contextual tabs and tab set. + * @Default {array} + */ + tabs?: Array; +} + +export interface TabsGroupsContentGroupsCustomGalleryItems { + + /**Specifies the syncfusion button members, events by using buttonSettings. + * @Default {object} + */ + buttonSettings?: any; + + /**Specifies the type as ej.Ribbon.customItemType.menu or ej.Ribbon.customItemType.button to render Syncfusion button and menu. + * @Default {ej.Ribbon.customItemType.button} + */ + customItemType?: ej.Ribbon.customItemType|string; + + /**Specifies the custom tooltip for gallery extra item's button. Refer to ejRibbon#tabs->groups->content->groups->customToolTip for its inner properties. + * @Default {object} + */ + customToolTip?: any; + + /**Specifies the UL list id to render menu as gallery extra item. + * @Default {null} + */ + menuId?: string; + + /**Specifies the Syncfusion menu members, events by using menuSettings. + * @Default {object} + */ + menuSettings?: any; + + /**Specifies the text for gallery extra item's button. + * @Default {null} + */ + text?: string; + + /**Specifies the tooltip for gallery extra item's button. + * @Default {null} + */ + toolTip?: string; +} + +export interface TabsGroupsContentGroupsCustomToolTip { + + /**Sets content to the custom tooltip. Text and html support are provided for content. + * @Default {null} + */ + content?: string; + + /**Sets icon to the custom tooltip content. + * @Default {null} + */ + prefixIcon?: string; + + /**Sets title to the custom tooltip. Text and html support are provided for title and the title is in bold for text format. + * @Default {null} + */ + title?: string; +} + +export interface TabsGroupsContentGroupsGalleryItems { + + /**Specifies the Syncfusion button members, events by using buttonSettings. + * @Default {object} + */ + buttonSettings?: any; + + /**Specifies the custom tooltip for gallery content. Refer to ejRibbon#tabs->groups->content->groups->customToolTip for its inner properties. + * @Default {object} + */ + customToolTip?: any; + + /**Sets text for the gallery content. + * @Default {null} + */ + text?: string; + + /**Sets tooltip for the gallery content. + * @Default {null} + */ + toolTip?: string; +} + +export interface TabsGroupsContentGroups { + + /**Specifies the Syncfusion button members, events by using this buttonSettings. + * @Default {object} + */ + buttonSettings?: any; + + /**It is used to set the count of gallery contents in a row. + * @Default {null} + */ + columns?: number; + + /**Specifies the custom items such as div, table, controls as custom controls with the type "ej.Ribbon.type.custom" in the groups. + * @Default {null} + */ + contentID?: string; + + /**Specifies the css class property to apply styles to the button, split, dropdown controls in the groups. + * @Default {null} + */ + cssClass?: string; + + /**Specifies the Syncfusion button and menu as gallery extra items. + * @Default {array} + */ + customGalleryItems?: Array; + + /**Provides custom tooltip for button, split button, dropdown list, toggle button, custom controls in the sub groups. Text and html support are also provided for title and content. + * @Default {Object} + */ + customToolTip?: TabsGroupsContentGroupsCustomToolTip; + + /**Specifies the Syncfusion dropdown list members, events by using this dropdownSettings. + * @Default {object} + */ + dropdownSettings?: any; + + /**Specifies the separator to the control that is in row type group. The separator separates the control from the next control in the group. Set "true" to enable the separator. + * @Default {false} + */ + enableSeparator?: boolean; + + /**Sets the count of gallery contents in a row, when the gallery is in expanded state. + * @Default {null} + */ + expandedColumns?: number; + + /**Defines each gallery content. + * @Default {array} + */ + galleryItems?: Array; + + /**Specifies the Id for button, split button, dropdown list, toggle button, gallery, custom controls in the sub groups. + * @Default {null} + */ + id?: string; + + /**Specifies the size for button, split button controls. Set "true" for big size and "false" for small size. + * @Default {null} + */ + isBig?: boolean; + + /**Sets the height of each gallery content. + * @Default {null} + */ + itemHeight?: string|number; + + /**Sets the width of each gallery content. + * @Default {null} + */ + itemWidth?: string|number; + + /**Specifies the Syncfusion split button members, events by using this splitButtonSettings. + * @Default {object} + */ + splitButtonSettings?: any; + + /**Specifies the text for button, split button, toggle button controls in the sub groups. + * @Default {null} + */ + text?: string; + + /**Specifies the Syncfusion toggle button members, events by using toggleButtonSettings. + * @Default {object} + */ + toggleButtonSettings?: any; + + /**Specifies the tooltip for button, split button, dropdown list, toggle button, custom controls in the sub groups. + * @Default {null} + */ + toolTip?: string; + + /**To add,show and hide controls in Quick Access toolbar. + * @Default {ej.Ribbon.quickAccessMode.none} + */ + quickAccessMode?: ej.Ribbon.quickAccessMode|string; + + /**Specifies the type as "ej.Ribbon.type.button" or "ej.Ribbon.type.splitButton" or "ej.Ribbon.type.dropDownList" or "ej.Ribbon.type.toggleButton" or "ej.Ribbon.type.custom" or "ej.Ribbon.type.gallery" to render button, split, dropdown, toggle button, gallery, custom controls. + * @Default {ej.Ribbon.type.button} + */ + type?: ej.Ribbon.type|string; +} + +export interface TabsGroupsContent { + + /**Specifies the height, width, type, isBig property to the controls in the group commonly. + * @Default {object} + */ + defaults?: any; + + /**Specifies the controls such as Syncfusion button, split button, dropdown list, toggle button, gallery, custom controls in the subgroup of the ribbon tab . + * @Default {array} + */ + groups?: Array; +} + +export interface TabsGroupsGroupExpanderSettings { + + /**Sets tooltip for the group expander of the group. + * @Default {null} + */ + toolTip?: string; + + /**Specifies the custom tooltip for group expander.Refer to ejRibbon#tabs->groups->content->groups->customToolTip for its inner properties. + * @Default {Object} + */ + customToolTip?: any; +} + +export interface TabsGroups { + + /**Specifies the alignment of controls in the groups in 'row' type or 'column' type. Value for row type is "ej.Ribbon.alignType.rows" and for column type is "ej.Ribbon.alignType.columns". + * @Default {ej.Ribbon.alignType.rows} + */ + alignType?: ej.Ribbon.alignType|string; + + /**Specifies the Syncfusion button, split button, dropdown list, toggle button, gallery, custom controls to the groups in the ribbon control. + * @Default {array} + */ + content?: Array; + + /**Specifies the ID of custom items to be placed in the groups. + * @Default {null} + */ + contentID?: string; + + /**Specifies the HTML contents to place into the groups. + * @Default {null} + */ + customContent?: string; + + /**Specifies the group expander for groups in the ribbon control. Set "true" to enable the group expander. + * @Default {false} + */ + enableGroupExpander?: boolean; + + /**Sets custom setting to the groups in the ribbon control. + * @Default {Object} + */ + groupExpanderSettings?: TabsGroupsGroupExpanderSettings; + + /**Specifies the text to the groups in the ribbon control. + * @Default {null} + */ + text?: string; + + /**Specifies the custom items such as div, table, controls by using the "custom" type. + * @Default {null} + */ + type?: string; +} + +export interface Tabs { + + /**Specifies single group or multiple groups and its contents to each tab in the ribbon control. + * @Default {array} + */ + groups?: Array; + + /**Specifies the ID for each tab's content panel. + * @Default {null} + */ + id?: string; + + /**Specifies the text of the tab in the ribbon control. + * @Default {null} + */ + text?: string; +} + +enum itemType{ + + ///To render the button for ribbon backstage page’s contents + Button, + + ///To render the tab for ribbon backstage page’s contents + Tab +} + + +enum applicationTabType{ + + ///applicationTab display as menu + Menu, + + ///applicationTab display as backstage + Backstage +} + + +enum alignType{ + + ///To align the group content's in row + Rows, + + ///To align group content's in columns + Columns +} + + +enum customItemType{ + + ///Specifies the button type in customGalleryItems + Button, + + ///Specifies the menu type in customGalleryItems + Menu +} + + +enum quickAccessMode{ + + ///Controls are hidden in Quick Access toolbar + None, + + ///Add controls in toolBar + ToolBar, + + ///Add controls in menu + Menu +} + + +enum type{ + + ///Specifies the button control + Button, + + ///Specifies the split button + SplitButton, + + ///Specifies the dropDown + DropDownList, + + ///To append external element's + Custom, + + ///Specifies the toggle button + ToggleButton, + + ///Specifies the ribbon gallery + Gallery +} + +} + +class Kanban extends ej.Widget { + static fn: Kanban; + constructor(element: JQuery, options?: Kanban.Model); + constructor(element: Element, options?: Kanban.Model); + model:Kanban.Model; + defaults:Kanban.Model; + + /** Add a new card in kanban control.If parameters are not given default dialog will be open + * @param {string} Pass the primary key field Name of the column + * @param {Array} Pass the edited json data of card need to be add. + * @returns {void} + */ + addCard(primaryKey: string, card: Array): void; + + /** Method used for send a clear search request to kanban. + * @returns {void} + */ + clearSearch(): void; + + /** It is used to clear all the card selection. + * @returns {void} + */ + clearSelection(): void; + + /** Collapse all the swimlane rows in kanban. + * @returns {void} + */ + collapseAll(): void; + + /** Add or remove columns in kanban columns collections + * @param {Array|string} Pass array of columns or string of headerText to add/remove the column in kanban + * @param {Array|string} Pass array of columns or string of keyvalue to add/remove the column in kanban + * @param {string} optional Pass add/remove action to be performed. By default "add" action will perform + * @returns {void} + */ + columns(columndetails: Array|string, keyvalue: Array|string, action: string): void; + + /** Send a cancel request of add/edit card in kanban + * @returns {void} + */ + cancelEdit(): void; + + /** Destroy the kanban widget all events bound using this._on will be unbind automatically and bring the control to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** Delete a card in kanban control. + * @param {string|number} Pass the key of card to be delete + * @returns {void} + */ + deleteCard(Key: string|number): void; + + /** Refresh the kanban with new data source. + * @param {Array} Pass new data source to the kanban + * @returns {void} + */ + dataSource(datasource: Array): void; + + /** Send a save request in kanban when any card is in edit/new add card state. + * @returns {void} + */ + endEdit(): void; + + /** toggleColumn based on the headerText in kanban. + * @param {any} Pass the header text of the column to get the corresponding column object + * @returns {void} + */ + toggleColumn( headerText : any): void; + + /** Expand or collapse the card based on the state of target "div" + * @param {string|number} Pass the key of card to be toggle + * @returns {void} + */ + toggleCard( key : string|number): void; + + /** Expand or collapse the swimlane row based on the state of target "div" + * @param {any} Pass the div object to toggleSwimlane row based on its row state + * @returns {void} + */ + toggleSwimlane( $div : any): void; + + /** Expand all the swimlane rows in kanban. + * @returns {void} + */ + expandAll(): void; + + /** used for get the names of all the visible column name collections in kanban. + * @returns {void} + */ + getVisibleColumnNames(): void; + + /** Get the scroller object of kanban. + * @returns {void} + */ + getScrollObject(): void; + + /** Get the column details based on the given header text in kanban. + * @param {string} Pass the header text of the column to get the corresponding column object + * @returns {string} + */ + getColumnByHeaderText( headerText : string): string; + + /** Hide columns from the kanban based on the header text + * @param {Array|string} you can pass either array of header text of various columns or a header text of a column to hide + * @returns {void} + */ + hideColumns( headerText : Array|string): void; + + /** Refresh the template of the kanban + * @returns {void} + */ + refreshTemplate(): void; + + /** Refresh the kanban contents.The template refreshment is based on the argument passed along with this method + * @param {boolean} optional When templateRefresh is set true, template and kanban contents both are refreshed in kanban else only kanban content is refreshed + * @returns {void} + */ + refresh( templateRefresh : boolean): void; + + /** send a search request to kanban with specified string passed in it. + * @param {string} Pass the string to search in Kanban card + * @returns {void} + */ + searchCards( searchString: string): void; + + /** Method used for set validation to a field during editing. + * @param {string} Specify the name of the column to set validation rules + * @param {any} Specify the validation rules for the field + * @returns {void} + */ + setValidationToField(name: string, rules: any): void; + + /** Send an edit card request in kanban.Parameter will be Html element or primary key + * @param {any} Pass the div selected row element to be edited in kanban + * @returns {void} + */ + startEdit( $div : any): void; + + /** Show columns in the kanban based on the header text. + * @param {Array|string} You can pass either array of header text of various columns or a header text of a column to show + * @returns {void} + */ + showColumns( headerText : Array|string): void; + + /** Update a card in kanban control based on key and json data given. + * @param {string} Pass the key field Name of the column + * @param {Array} Pass the edited json data of card need to be update. + * @returns {void} + */ + updateCard( key : string, data : Array): void; +} +export module Kanban{ + +export interface Model { + + /**Gets or sets a value that indicates whether to enable allowDragAndDrop behavior on kanban. + * @Default {true} + */ + allowDragAndDrop?: boolean; + + /**To enable or disable the title of the card. + * @Default {false} + */ + allowTitle?: boolean; + + /**Customize the settings for swimlane. + * @Default {Object} + */ + swimlaneSettings?: SwimlaneSettings; + + /**To enable or disable the column expand /collapse. + * @Default {false} + */ + allowToggleColumn?: boolean; + + /**To enable Searching operation in kanban. + * @Default {false} + */ + allowSearching?: boolean; + + /**Gets or sets a value that indicates whether to enable allowSelection behavior on kanban.User can select card and the selected card will be highlighted on kanban. + * @Default {true} + */ + allowSelection?: boolean; + + /**Gets or sets a value that indicates whether to allow card hover actions. + * @Default {true} + */ + allowHover?: boolean; + + /**To allow keyboard navigation actions. + * @Default {true} + */ + allowKeyboardNavigation?: boolean; + + /**Gets or sets a value that indicates whether to enable the scrollbar in the kanban and view the card by scroll through the kanban manually. + * @Default {false} + */ + allowScrolling?: boolean; + + /**Gets or sets an object that indicates whether to customize the context menu behavior of the kanban. + * @Default {Object} + */ + contextMenuSettings?: ContextMenuSettings; + + /**Gets or sets an object that indicates to render the kanban with specified columns. + * @Default {array} + */ + columns?: Array; + + /**Gets or sets an object that indicates whether to Customize the card based on the Mapping Fields. + * @Default {Object} + */ + cardSettings?: CardSettings; + + /**Gets or sets a value that indicates to render the kanban with custom theme. + * @Default {null} + */ + cssClass?: string; + + /**Gets or sets the data to render the kanban with card. + * @Default {Object} + */ + dataSource?: any; + + /**Align content in the kanban control from right to left by setting the property as true. + * @Default {false} + */ + enableRTL?: boolean; + + /**To show Total count of cards in each column + * @Default {true} + */ + enableTotalCount?: boolean; + + /**Gets or sets a value that indicates whether to enablehover support for performing card hover actions. + * @Default {true} + */ + enableHover?: boolean; + + /**Get or sets an object that indicates whether to customize the editing behavior of the kanban. + * @Default {Object} + */ + editSettings?: EditSettings; + + /**To customize field mappings for card , editing title and control key parameters + * @Default {Object} + */ + fields?: Fields; + + /**To map datasource field for column values mapping + * @Default {null} + */ + keyField?: string; + + /**Gets or sets a value that indicates whether the kanban design has be to made responsive. + * @Default {false} + */ + isResponsive?: boolean; + + /**Gets or sets a value that indicates whether to set the minimum width of the responsive kanban while isResponsive property is true and enableResponsiveRow property is set as false. + * @Default {null} + */ + minWidth?: number; + + /**To customize the filtering behavior based on queries given. + * @Default {array} + */ + filterSettings?: Array; + + /**The primarykey field is get as property of kanban. And this will used for Drag and drop and editing mainly + * @Default {null} + */ + primaryKeyField?: string; + + /**ej Query to query database of kanban. + * @Default {Object} + */ + query?: any; + + /**To change the key in keyboard interaction to kanban control. + * @Default {Object} + */ + keySettings?: KeySettings; + + /**Gets or sets an object that indicates whether to customize the scrolling behavior of the kanban. + * @Default {Object} + */ + scrollSettings?: any; + + /**To customize the searching behavior of the kanban. + * @Default {Object} + */ + searchSettings?: SearchSettings; + + /**To allow customize selection type. Accepting types are "single" and "multiple". + * @Default {ej.Kanban.SelectionType.Single} + */ + selectionType?: ej.Kanban.SelectionType|string; + + /**Gets or sets an object that indicates to managing the collection of stacked header rows for the kanban. + * @Default {Array} + */ + stackedHeaderRows?: Array; + + /**The tooltip allows to display card details in a tooltip while hovering on it. + */ + tooltipSettings?: TooltipSettings; + + /**Gets or sets a value that indicates whether to customizing the user interface (UI) as locale-specific in order to display regional data i.e. in a language and culture specific to a particular country or region. + * @Default {en-US} + */ + locale?: string; + + /**Triggered for every kanban action before its starts.*/ + actionBegin? (e: ActionBeginEventArgs): void; + + /**tiggered for every kanban action success event.*/ + actionComplete? (e: ActionCompleteEventArgs): void; + + /**Triggered for every kanban action server failure event.*/ + actionFailure? (e: ActionFailureEventArgs): void; + + /**Triggered before the task is going to be edited.*/ + beginEdit? (e: BeginEditEventArgs): void; + + /**Triggered before the task is going to be added*/ + beginAdd? (e: BeginAddEventArgs): void; + + /**triggered before the card is going to be selecting.*/ + beforeCardSelect? (e: BeforeCardSelectEventArgs): void; + + /**Trigger after the card is clicked.*/ + cardClick? (e: CardClickEventArgs): void; + + /**Triggered when the card is being dragged.*/ + cardDrag? (e: CardDragEventArgs): void; + + /**Triggered when card dragging start.*/ + cardDragStart? (e: CardDragStartEventArgs): void; + + /**triggered when card dragging stops.*/ + cardDragStop? (e: CardDragStopEventArgs): void; + + /**Triggered when the card is Drop.*/ + cardDrop? (e: CardDropEventArgs): void; + + /**Triggered after the card is select.*/ + cardSelect? (e: CardSelectEventArgs): void; + + /**Triggered when card is double clicked.*/ + cardDoubleClick? (e: CardDoubleClickEventArgs): void; +} + +export interface ActionBeginEventArgs { + + /**Returns the kanban model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the current action event type. + */ + originalEventType?: string; + + /**Returns primary key value. + */ + primaryKeyValue?: string; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the edited row index. + */ + rowIndex?: number; + + /**Returns the card object (JSON). + */ + data?: any; + + /**Returns current filtering object field name. + */ + currentFilteringobject?: any; + + /**Returns filter details. + */ + filterCollection?: any; +} + +export interface ActionCompleteEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the kanban model. + */ + model?: any; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns current action event type. + */ + originalEventType?: string; + + /**Returns primary key. + */ + primaryKey?: string; + + /**Returns primary key value. + */ + primaryKeyValue?: string; + + /**Returns kanban element. + */ + target?: any; + + /**Returns the card object (JSON). + */ + data?: any; + + /**Returns the selectedRow index. + */ + selectedRow?: number; + + /**Returns current filtering column field name. + */ + currentFilteringColumn?: string; + + /**Returns filter details. + */ + filterCollection?: any; +} + +export interface ActionFailureEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the kanban model. + */ + model?: any; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the error return by server. + */ + error?: any; + + /**Returns current action event type. + */ + originalEventType?: string; + + /**Returns primary key value. + */ + primaryKeyValue?: string; + + /**Returns kanban element. + */ + target?: any; + + /**Returns the card object (JSON). + */ + data?: any; + + /**Returns current filtering column field name. + */ + currentFilteringColumn?: string; + + /**Returns filter details. + */ + filterCollection?: any; +} + +export interface BeginEditEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the kanban model. + */ + model?: any; + + /**Returns primary key value. + */ + primaryKeyValue?: string; + + /**Returns beginedit data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface BeginAddEventArgs { + + /**Returns the kanban model. + */ + model?: any; + + /**Returns primary key value. + */ + primaryKeyValue?: string; + + /**Returns beginAdd data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface BeforeCardSelectEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the select cell index value. + */ + cellIndex?: number; + + /**Returns the select card index value. + */ + cardIndex?: number; + + /**Returns the select cell element + */ + currentCell?: any; + + /**Returns the previously select the card element + */ + previousCard?: any; + + /**Returns the previously select card indexes + */ + previousRowcellindex?: Array; + + /**Returns the Target item. + */ + Target?: any; + + /**Returns the kanban model. + */ + model?: any; + + /**Returns select card data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface CardClickEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns current record object (JSON). + */ + data?: any; + + /**Returns the current card to the kanban. + */ + currentCard?: string; + + /**Returns kanban element. + */ + target?: any; + + /**Returns the kanban model. + */ + model?: any; + + /**Returns the Header text of the column corresponding to the selected card. + */ + columnName?: string; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface CardDragEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns drag data. + */ + data?: any; + + /**Returns drag start element. + */ + dragtarget?: any; + + /**Returns dragged element. + */ + draggedElement?: any; + + /**Returns the kanban model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface CardDragStartEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns carddragstart data. + */ + data?: any; + + /**Returns dragged element. + */ + draggedElement?: any; + + /**Returns the kanban model. + */ + model?: any; + + /**Returns drag start element. + */ + dragtarget?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface CardDragStopEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns dragged element. + */ + draggedElement?: any; + + /**Returns the kanban model. + */ + model?: any; + + /**Returns drag stop element. + */ + droptarget?: any; + + /**Returns dragg stop data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface CardDropEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns dragged element. + */ + draggedElement?: any; + + /**Returns dragged data. + */ + data?: any; + + /**Returns the kanban model. + */ + model?: any; + + /**Returns drop element. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface CardSelectEventArgs { + + /**Returns the select cell index value. + */ + cellIndex?: number; + + /**Returns the select card index value. + */ + cardIndex?: number; + + /**Returns the select cell element + */ + currentCell?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the previously select the card element + */ + previousCard?: any; + + /**Returns the previously select card indexes + */ + previousRowcellindex?: Array; + + /**Returns the current item. + */ + currentTarget?: any; + + /**Returns the kanban model. + */ + model?: any; + + /**Returns select card data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface CardDoubleClickEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns current card object (JSON). + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface SwimlaneSettings { + + /**To enable or disable items count in swimlane + * @Default {true} + */ + showCount?: boolean; +} + +export interface ContextMenuSettingsCustomMenuItems { + + /**Sets context menu to target element. + * @Default {ej.Kanban.Target.All} + */ + target?: ej.Kanban.Target|string; + + /**Gets the name to custom menu. + * @Default {null} + */ + text?: string; + + /**Gets the template to render custom menu. + * @Default {null} + */ + template?: string; +} + +export interface ContextMenuSettings { + + /**To enable Context menu , All default context menu will show. + * @Default {false} + */ + enable?: boolean; + + /**Gets or sets a value that indicates the list of items needs to be diable from default context menu + * @Default {array} + */ + disableDefaultItems?: Array; + + /**Gets or sets a value that indicates whether to add custom contextMenu items + * @Default {array} + */ + customMenuItems?: Array; +} + +export interface ColumnsConstraints { + + /**It is used to specify the type whether the constraints based on column or swimlane. + * @Default {null} + */ + type?: string; + + /**It is used to specify the minimum amount of card in particular column cell or swimlane cell can hold. + * @Default {null} + */ + min?: number; + + /**It is used to specify the maximum amount of card in particular column cell or swimlane cell can hold. + * @Default {null} + */ + max?: number; +} + +export interface Columns { + + /**Gets or sets an object that indicates to render the kanban with specified columns headertext. + * @Default {null} + */ + headerText?: string; + + /**Gets or sets an object that indicates to render the kanban with specified columns key. + * @Default {null} + */ + key?: string|number; + + /**To set column collape or expand state + * @Default {false} + */ + isCollapsed?: boolean; + + /**To customize the column constraints whether the constraints contains minimum limit or maximum limit or both. + * @Default {object} + */ + constraints?: ColumnsConstraints; + + /**Gets or sets a value that indicates to add the template within the header element. + * @Default {null} + */ + headerTemplate?: string; + + /**Gets or sets an object that indicates to render the kanban with specified columns width. + * @Default {null} + */ + width?: string|number; + + /**Gets or sets an object that indicates to render the kanban with specified columns visible. + * @Default {true} + */ + visible?: boolean; +} + +export interface CardSettings { + + /**Gets or sets a value that indicates to add the template of card . + * @Default {null} + */ + template?: string; + + /**To customize the card bordercolor based on assinged task. Colors and corresponding values defined here will be mapped with colorField mapped data source column. + * @Default {Object} + */ + colorMapping?: any; +} + +export interface EditSettingsEditItems { + + /**It is used to map editing field in the card. + * @Default {null} + */ + field?: string; + + /**It is used to set the particular editType in the card for editing. + * @Default {ej.Kanban.EditingType.String} + */ + editType?: ej.Kanban.EditingType|string; + + /**Gets or sets a value that indicates to define constraints for saving data to the database. + * @Default {Object} + */ + validationRules?: any; + + /**It is used to set the particular editparams in the card for editing. + * @Default {Object} + */ + editParams?: any; + + /**It is used to specify defaultValue in the card. + * @Default {null} + */ + defaultValue?: string|number; +} + +export interface EditSettings { + + /**Gets or sets a value that indicates whether to enable the editing action in cards of kanban. + * @Default {false} + */ + allowEditing?: boolean; + + /**Gets or sets a value that indicates whether to enable the adding action in cards behavior on kanban. + * @Default {false} + */ + allowAdding?: boolean; + + /**This specifies the id of the template.which is require to be edited using the Dialog Box + * @Default {null} + */ + dialogTemplate?: string; + + /**Get or sets an object that indicates whether to customize the editMode of the kanban. + * @Default {ej.Kanban.EditMode.Dialog} + */ + editMode?: ej.Kanban.EditMode|string; + + /**Get or sets an object that indicates whether to customize the editing fields of kanban card. + * @Default {Array} + */ + editItems?: Array; +} + +export interface Fields { + + /**The primarykey field is get as property of kanban. And this will used for Drag and drop and editing mainly. + * @Default {null} + */ + primaryKey?: string; + + /**To enable swimlane grouping based on the given key field. + * @Default {null} + */ + swimlaneKey?: string; + + /**Priority field has been mapped data source field to maintain card priority + * @Default {null} + */ + priority?: string; + + /**ContentField has been Mapped into card text. + * @Default {null} + */ + content?: string; + + /**TagField has been Mapped into card tag. + * @Default {null} + */ + tag?: string; + + /**TitleField has been Mapped to field in datasource for title content. If titlefield specified , card expand/collapse will be enabled with header and content section + * @Default {null} + */ + title?: string; + + /**To customize the card has been Mapped into card colorfield. + * @Default {null} + */ + color?: string; + + /**ImageUrlField has been Mapped into card image. + * @Default {null} + */ + imageUrl?: string; +} + +export interface FilterSettings { + + /**Gets or sets an object of display name to filter queries. + * @Default {null} + */ + text?: string; + + /**Gets or sets an object that Queries to perform filtering + * @Default {Object} + */ + query?: any; + + /**Gets or sets an object of tooltip to filter buttons. + * @Default {null} + */ + description?: string; +} + +export interface KeySettings { + + /**To specify the focus in kanban control. + * @Default {Object} + */ + focus?: any; + + /**To specify the key value to insert the card. + * @Default {null} + */ + insertCard?: string; + + /**To specify the key value to delete the card. + * @Default {null} + */ + deleteCard?: string; + + /**TTo specify the key value to edit the card. + * @Default {null} + */ + editCard?: string; + + /**TTo specify the key value to save request. + * @Default {null} + */ + saveRequest?: string; + + /**To specify the key value to cancel request. + * @Default {null} + */ + cancelRequest?: string; + + /**To specify the key value to first card selection. + * @Default {null} + */ + firstCardSelection?: string; + + /**To specify the key value to last card selection. + * @Default {null} + */ + lastCardSelection?: string; + + /**To specify the key value to upArrow. + * @Default {null} + */ + upArrow?: string; + + /**To specify the key value to downArrow. + * @Default {null} + */ + downArrow?: string; + + /**To specify the key value to rightArrow. + * @Default {null} + */ + rightArrow?: string; + + /**To specify the key value to leftArrow. + * @Default {null} + */ + leftArrow?: string; + + /**To specify the key value to swimlane expand all. + * @Default {null} + */ + swimlaneExpandAll?: string; + + /**To specify the key value to swimlane collapse all. + * @Default {null} + */ + swimlaneCollapseAll?: string; + + /**To specify the key value to selected group expand. + * @Default {null} + */ + selectedGroupExpand?: string; + + /**To specify the key value to selected group collapse. + * @Default {null} + */ + selectedGroupCollapse?: string; + + /**To specify the key value to selected column collapse. + * @Default {null} + */ + selectedColumnCollapse?: string; + + /**To specify the key value to selected column expand. + * @Default {null} + */ + selectedColumnExpand?: string; + + /**To specify the key value to multi selection by up arrow. + * @Default {null} + */ + multiSelectionByUpArrow?: string; + + /**To specify the key value to multi selection by left arrow. + * @Default {null} + */ + multiSelectionByLeftArrow?: string; + + /**To specify the key value to multi selection by right arrow. + * @Default {null} + */ + multiSelectionByRightArrow?: string; +} + +export interface SearchSettings { + + /**To customize the fields the searching operation can be perform. + * @Default {Array} + */ + fields?: Array; + + /**To customize the searching string. + * @Default {null} + */ + key?: string; + + /**To customize the operator based on searching. + * @Default {null} + */ + operator?: string; + + /**To customize the ignorecase based on searching. + * @Default {true} + */ + ignoreCase?: boolean; +} + +export interface StackedHeaderRowsStackedHeaderColumns { + + /**Gets or sets a value that indicates the headerText for the particular stacked header column. + * @Default {null} + */ + headerText?: string; + + /**Gets or sets a value that indicates the column for the particular stacked header column. + * @Default {null} + */ + column?: string; +} + +export interface StackedHeaderRows { + + /**Gets or sets a value that indicates whether to add stacked header columns into the stacked header rows. + * @Default {Array} + */ + stackedHeaderColumns?: Array; +} + +export interface TooltipSettings { + + /**To enable or disable the tooltip display. + * @Default {false} + */ + enable?: boolean; + + /**To customize the tooltip display based on your requirements. + * @Default {null} + */ + template?: string; +} + +enum Target{ + + ///Sets context menu to kanban header + Header, + + ///Sets context menu to kanban content + Content, + + ///Sets context menu to kanban + All +} + + +enum EditMode{ + + ///Creates kanban with editMode as Dialog + Dialog, + + ///Creates kanban with editMode as DialogTemplate + DialogTemplate +} + + +enum EditingType{ + + ///Allows to set edit type as string edit type + String, + + ///Allows to set edit type as numeric edit type + Numeric, + + ///Allows to set edit type as drop down edit type + Dropdown, + + ///Allows to set edit type as date picker edit type + DatePicker, + + ///Allows to set edit type as date time picker edit type + DateTimePicker, + + ///Allows to set edit type as text area edit type + TextArea, + + ///Allows to set edit type as RTE edit type + RTE +} + + +enum SelectionType{ + + ///Support for Single selection in Kanban + Single, + + ///Support for multiple selections in Kanban + Multiple +} + +} + +class Rotator extends ej.Widget { + static fn: Rotator; + constructor(element: JQuery, options?: Rotator.Model); + constructor(element: Element, options?: Rotator.Model); + model:Rotator.Model; + defaults:Rotator.Model; + + /** Disables the Rotator control. + * @returns {void} + */ + disable(): void; + + /** Enables the Rotator control. + * @returns {void} + */ + enable(): void; + + /** This method is used to get the current slide index. + * @returns {number} + */ + getIndex(): number; + + /** This method is used to move a slide to the specified index. + * @param {number} index of an slide + * @returns {void} + */ + gotoIndex(index: number): void; + + /** This method is used to pause autoplay. + * @returns {void} + */ + pause(): void; + + /** This method is used to move slides continuously (or start autoplay) in the specified autoplay direction. + * @returns {void} + */ + play(): void; + + /** This method is used to move to the next slide from the current slide. If the current slide is the last slide, then the first slide will be treated as the next slide. + * @returns {void} + */ + slideNext(): void; + + /** This method is used to move to the previous slide from the current slide. If the current slide is the first slide, then the last slide will be treated as the previous slide. + * @returns {void} + */ + slidePrevious(): void; +} +export module Rotator{ + +export interface Model { + + /**Turns on keyboard interaction with the Rotator items. You must set this property to true to access the following keyboard shortcuts: + * @Default {true} + */ + allowKeyboardNavigation?: boolean; + + /**Sets the animationSpeed of slide transition. + * @Default {600} + */ + animationSpeed?: string|number; + + /**Specifies the animationType type for the Rotator Item. animationType options include slide, fastSlide, slowSlide, and other custom easing animationTypes. + * @Default {slide} + */ + animationType?: string; + + /**Enables the circular mode item rotation. + * @Default {true} + */ + circularMode?: boolean; + + /**Specify the CSS class to Rotator to achieve custom theme. + */ + cssClass?: string; + + /**Specify the list of data which contains a set of data fields. Each data value is used to render an item for the Rotator. + * @Default {null} + */ + dataSource?: any; + + /**Sets the delay between the Rotator Items move after the slide transition. + * @Default {500} + */ + delay?: number; + + /**Specifies the number of Rotator Items to be displayed. + * @Default {1} + */ + displayItemsCount?: string|number; + + /**Rotates the Rotator Items continuously without user interference. + * @Default {false} + */ + enableAutoPlay?: boolean; + + /**Enables or disables the Rotator control. + * @Default {true} + */ + enabled?: boolean; + + /**Specifies right to left transition of slides. + * @Default {false} + */ + enableRTL?: boolean; + + /**Defines mapping fields for the data items of the Rotator. + * @Default {null} + */ + fields?: Fields; + + /**Sets the space between the Rotator Items. + */ + frameSpace?: string|number; + + /**Resizes the Rotator when the browser is resized. + * @Default {false} + */ + isResponsive?: boolean; + + /**Specifies the number of Rotator Items to navigate on a single click (next/previous/play buttons). The navigateSteps property value must be less than or equal to the displayItemsCount property value. + * @Default {1} + */ + navigateSteps?: string|number; + + /**Specifies the orientation for the Rotator control, that is, whether it must be rendered horizontally or vertically. See Orientation + * @Default {ej.Orientation.Horizontal} + */ + orientation?: ej.Orientation|string; + + /**Specifies the position of the showPager in the Rotator Item. See PagerPosition + * @Default {outside} + */ + pagerPosition?: string|ej.Rotator.PagerPosition; + + /**Retrieves data from remote data. This property is applicable only when a remote data source is used. + * @Default {null} + */ + query?: string; + + /**If the Rotator Item is an image, you can specify a caption for the Rotator Item. The caption text for each Rotator Item must be set by using the title attribute of the respective tag. The caption cannot be displayed if multiple Rotator Items are present. + * @Default {false} + */ + showCaption?: boolean; + + /**Turns on or off the slide buttons (next and previous) in the Rotator Items. Slide buttons are used to navigate the Rotator Items. + * @Default {true} + */ + showNavigateButton?: boolean; + + /**Turns on or off the pager support in the Rotator control. The Pager is used to navigate the Rotator Items. + * @Default {true} + */ + showPager?: boolean; + + /**Enable play / pause button on rotator. + * @Default {false} + */ + showPlayButton?: boolean; + + /**Turns on or off thumbnail support in the Rotator control. Thumbnail is used to navigate between slides. Thumbnail supports only single slide transition You must specify the source for thumbnail elements through the thumbnailSourceID property. + * @Default {false} + */ + showThumbnail?: boolean; + + /**Sets the height of a Rotator Item. + */ + slideHeight?: string|number; + + /**Sets the width of a Rotator Item. + */ + slideWidth?: string|number; + + /**Sets the index of the slide that must be displayed first. + * @Default {0} + */ + startIndex?: string|number; + + /**Pause the auto play while hover on the rotator content. + * @Default {false} + */ + stopOnHover?: boolean; + + /**Specifies the source for thumbnail elements. + * @Default {null} + */ + thumbnailSourceID?: any; + + /**This event is fired when the Rotator slides are changed.*/ + change? (e: ChangeEventArgs): void; + + /**This event is fired when the Rotator control is initialized.*/ + create? (e: CreateEventArgs): void; + + /**This event is fired when the Rotator control is destroyed.*/ + destroy? (e: DestroyEventArgs): void; + + /**This event is fired when a pager is clicked.*/ + pagerClick? (e: PagerClickEventArgs): void; + + /**This event is fired when enableAutoPlay is started.*/ + start? (e: StartEventArgs): void; + + /**This event is fired when autoplay is stopped or paused.*/ + stop? (e: StopEventArgs): void; + + /**This event is fired when a thumbnail pager is clicked.*/ + thumbItemClick? (e: ThumbItemClickEventArgs): void; +} + +export interface ChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the rotator model + */ + model?: ej.Rotator.Model; + + /**returns the name of the event + */ + type?: string; + + /**the current rotator id. + */ + itemId?: string; + + /**returns the current slide index. + */ + activeItemIndex?: number; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the rotator model + */ + model?: ej.Rotator.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the rotator model + */ + model?: ej.Rotator.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface PagerClickEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the rotator model + */ + model?: ej.Rotator.Model; + + /**returns the name of the event + */ + type?: string; + + /**the current rotator id. + */ + itemId?: string; + + /**returns the current slide index. + */ + activeItemIndex?: number; +} + +export interface StartEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the rotator model + */ + model?: ej.Rotator.Model; + + /**returns the name of the event + */ + type?: string; + + /**the current rotator id. + */ + itemId?: string; + + /**returns the current slide index. + */ + activeItemIndex?: number; +} + +export interface StopEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the rotator model + */ + model?: ej.Rotator.Model; + + /**returns the name of the event + */ + type?: string; + + /**the current rotator id. + */ + itemId?: string; + + /**returns the current slide index. + */ + activeItemIndex?: number; +} + +export interface ThumbItemClickEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the rotator model + */ + model?: ej.Rotator.Model; + + /**returns the name of the event + */ + type?: string; + + /**the current rotator id. + */ + itemId?: string; + + /**returns the current slide index. + */ + activeItemIndex?: number; +} + +export interface Fields { + + /**Specifies a link for the image. + */ + linkAttribute?: string; + + /**Specifies where to open a given link. + */ + targetAttribute?: string; + + /**Specifies a caption for the image. + */ + text?: string; + + /**Specifies a caption for the thumbnail image. + */ + thumbnailText?: string; + + /**Specifies the URL for an thumbnail image. + */ + thumbnailUrl?: string; + + /**Specifies the URL for an image. + */ + url?: string; +} + +enum PagerPosition{ + + ///string + BottomLeft, + + ///string + BottomRight, + + ///string + Outside, + + ///string + TopCenter, + + ///string + TopLeft, + + ///string + TopRight +} + +} + +class RTE extends ej.Widget { + static fn: RTE; + constructor(element: JQuery, options?: RTE.Model); + constructor(element: Element, options?: RTE.Model); + model:RTE.Model; + defaults:RTE.Model; + + /** Returns the range object. + * @returns {void} + */ + createRange(): void; + + /** Disables the RTE control. + * @returns {void} + */ + disable(): void; + + /** Disables the corresponding tool in the RTE ToolBar. + * @returns {void} + */ + disableToolbarItem(): void; + + /** Enables the RTE control. + * @returns {void} + */ + enable(): void; + + /** Enables the corresponding tool in the toolbar when the tool is disabled. + * @returns {void} + */ + enableToolbarItem(): void; + + /** Performs the action value based on the given command. + * @returns {void} + */ + executeCommand(): void; + + /** Focuses the RTE control. + * @returns {void} + */ + focus(): void; + + /** Gets the command status of the selected text based on the given comment in the RTE control. + * @returns {void} + */ + getCommandStatus(): void; + + /** Gets the HTML string from the RTE control. + * @returns {void} + */ + getDocument(): void; + + /** Gets the HTML string from the RTE control. + * @returns {void} + */ + getHtml(): void; + + /** Gets the selected html string from the RTE control. + * @returns {void} + */ + getSelectedHtml(): void; + + /** Gets the content as string from the RTE control. + * @returns {void} + */ + getText(): void; + + /** Hides the RTE control. + * @returns {void} + */ + hide(): void; + + /** Inserts new item to the target contextmenu node. + * @returns {void} + */ + insertMenuOption(): void; + + /** This method helps to insert/paste the content at the current cursor (caret) position or the selected content to be replaced with our text by passing the value as parameter to the pasteContent method in the Editor. + * @returns {void} + */ + pasteContent(): void; + + /** Refreshes the RTE control. + * @returns {void} + */ + refresh(): void; + + /** Removes the target menu item from the RTE contextmenu. + * @returns {void} + */ + removeMenuOption (): void; + + /** Removes the given tool from the RTE Toolbar. + * @returns {void} + */ + removeToolbarItem(): void; + + /** Selects all the contents within the RTE. + * @returns {void} + */ + selectAll(): void; + + /** Selects the contents in the given range. + * @returns {void} + */ + selectRange(): void; + + /** Sets the color picker model type rendered initially in the RTE control. + * @returns {void} + */ + setColorPickerType(): void; + + /** Sets the HTML string from the RTE control. + * @returns {void} + */ + setHtml(): void; + + /** Displays the RTE control. + * @returns {void} + */ + show(): void; +} +export module RTE{ + +export interface Model { + + /**Enables/disables the editing of the content. + * @Default {True} + */ + allowEditing?: boolean; + + /**RTE control can be accessed through the keyboard shortcut keys. + * @Default {True} + */ + allowKeyboardNavigation?: boolean; + + /**When the property is set to true, it focuses the RTE at the time of rendering. + * @Default {false} + */ + autoFocus?: boolean; + + /**Based on the content size, its height is adjusted instead of adding the scrollbar. + * @Default {false} + */ + autoHeight?: boolean; + + /**Sets the colorCode to display the color of the fontColor and backgroundColor in the font tools of the RTE. + * @Default {[000000, FFFFFF, C4C4C4, ADADAD, 595959, 262626, 4f81bd, dbe5f1, b8cce4, 95b3d7, 366092, 244061, c0504d, f2dcdb, e5b9b7, d99694, 953734,632423, 9bbb59, ebf1dd, d7e3bc, c3d69b, 76923c, 4f6128, 8064a2, e5e0ec, ccc1d9, b2a2c7, 5f497a, 3f3151, f79646, fdeada, fbd5b5, fac08f,e36c09, 974806]} + */ + colorCode?: any; + + /**The number of columns given are rendered in the color palate popup. + * @Default {6} + */ + colorPaletteColumns?: number; + + /**The number of rows given are rendered in the color palate popup. + * @Default {6} + */ + colorPaletteRows?: number; + + /**Sets the root class for the RTE theme. This cssClass API helps the usage of custom skinning option for the RTE control by including this root class in CSS. + */ + cssClass?: string; + + /**Enables/disables the RTE control’s accessibility or interaction. + * @Default {True} + */ + enabled?: boolean; + + /**When the property is set to true, it returns the encrypted text. + * @Default {false} + */ + enableHtmlEncode?: boolean; + + /**Maintain the values of the RTE after page reload. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Shows the resize icon and enables the resize option in the RTE. + * @Default {True} + */ + enableResize?: boolean; + + /**Shows the RTE in the RTL direction. + * @Default {false} + */ + enableRTL?: boolean; + + /**Formats the contents based on the XHTML rules. + * @Default {false} + */ + enableXHTML?: boolean; + + /**Enables the tab key action with the RichTextEditor content. + * @Default {True} + */ + enableTabKeyNavigation?: boolean; + + /**Load the external CSS file inside Iframe. + * @Default {null} + */ + externalCSS?: string; + + /**This API allows to enable the file browser support in the RTE control to browse, create, delete and upload the files in the specified current directory. + * @Default {null} + */ + fileBrowser?: FileBrowser; + + /**Sets the fontName in the RTE. + * @Default {{text: Segoe UI, value: Segoe UI },{text: Arial, value: Arial,Helvetica,sans-serif },{text: Courier New, value: Courier New,Courier,Monospace },{text: Georgia, value: Georgia,serif },{text: Impact, value: Impact,Charcoal,sans-serif },{text: Lucida Console, value: Lucida Console,Monaco,Monospace },{text: Tahoma, value: Tahoma,Geneva,sans-serif },{text: Times New Roman, value: Times New Roman },{text: Trebuchet MS, value: Trebuchet MS,Helvetica,sans-serif },{text: Verdana, value: Verdana,Geneva,sans-serif}} + */ + fontName?: any; + + /**Sets the fontSize in the RTE. + * @Default {{ text: 1, value: 1 },{ text: 2 (10pt), value: 2 },{ text: 3 (12pt), value: 3 },{ text: 4 (14pt), value: 4 },{ text: 5 (18pt), value: 5 },{ text: 6 (24pt), value: 6 },{ text: 7 (36pt), value: 7 }} + */ + fontSize?: any; + + /**Sets the format in the RTE. + * @Default {{ text: Paragraph, value: <p>, spriteCssClass: e-paragraph },{ text: Quotation, value: <blockquote>, spriteCssClass: e-quotation },{ text: Heading 1, value: <h1>, spriteCssClass: e-h1 },{ text: Heading 2, value: <h2>, spriteCssClass: e-h2 },{ text: Heading 3, value: <h3>, spriteCssClass: e-h3 },{ text: Heading 4, value: <h4>, spriteCssClass: e-h4 },{ text: Heading 5, value: <h5>, spriteCssClass: e-h5 },{ text: Heading 6, value: <h6>, spriteCssClass: e-h6}} + */ + format?: string; + + /**Defines the height of the RTE textbox. + * @Default {370} + */ + height?: string|number; + + /**Specifies the HTML Attributes of the ejRTE. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Sets the given attributes to the iframe body element. + * @Default {{}} + */ + iframeAttributes?: any; + + /**This API allows the image browser to support in the RTE control to browse, create, delete, and upload the image files to the specified current directory. + * @Default {null} + */ + imageBrowser?: ImageBrowser; + + /**Enables/disables responsive support for the RTE control toolbar items during the window resizing time. + * @Default {false} + */ + isResponsive?: boolean; + + /**Sets the culture in the RTE when you set the localization values are needs to be assigned to the corresponding text as follows. + * @Default {en-US} + */ + locale?: string; + + /**Sets the maximum height for the RTE outer wrapper element. + * @Default {null} + */ + maxHeight?: string|number; + + /**Sets the maximum length for the RTE outer wrapper element. + * @Default {7000} + */ + maxLength?: number; + + /**Sets the maximum width for the RTE outer wrapper element. + * @Default {null} + */ + maxWidth?: string|number; + + /**Sets the minimum height for the RTE outer wrapper element. + * @Default {280} + */ + minHeight?: string|number; + + /**Sets the minimum width for the RTE outer wrapper element. + * @Default {400} + */ + minWidth?: string|number; + + /**Sets the name in the RTE. When the name value is not initialized, the ID value is assigned to the name. + */ + name?: string; + + /**Shows ClearAll icon in the RTE footer. + * @Default {false} + */ + showClearAll?: boolean; + + /**Shows the clear format in the RTE footer. + * @Default {true} + */ + showClearFormat?: boolean; + + /**Shows the Custom Table in the RTE. + * @Default {True} + */ + showCustomTable?: boolean; + + /**Shows custom contextmenu with the RTE. + * @Default {True} + */ + showContextMenu?: boolean; + + /**This API is used to set the default dimensions for the image and video. When this property is set to true, the image and video dialog displays the dimension option. + * @Default {false} + */ + showDimensions?: boolean; + + /**Shows the FontOption in the RTE. + * @Default {True} + */ + showFontOption?: boolean; + + /**Shows footer in the RTE. When the footer is enabled, it displays the html tag, word Count, character count, clear format, resize icon and clear all the content icons, by default. + * @Default {false} + */ + showFooter?: boolean; + + /**Shows the HtmlSource in the RTE footer. + * @Default {false} + */ + showHtmlSource?: boolean; + + /**When the cursor is placed or when the text is selected in the RTE, it displays the tag info in the footer. + * @Default {True} + */ + showHtmlTagInfo?: boolean; + + /**Shows the toolbar in the RTE. + * @Default {True} + */ + showToolbar?: boolean; + + /**Counts the total characters and displays it in the RTE footer. + * @Default {True} + */ + showCharCount?: boolean; + + /**Counts the total words and displays it in the RTE footer. + * @Default {True} + */ + showWordCount?: boolean; + + /**The given number of columns render the insert table pop. + * @Default {10} + */ + tableColumns?: number; + + /**The given number of rows render the insert table pop. + * @Default {8} + */ + tableRows?: number; + + /**Sets the tools in the RTE and gets the inner display order of the corresponding group element. Tools are dependent on the toolsList property. + * @Default {formatStyle: [format],style: [bold, italic, underline, strikethrough],alignment: [justifyLeft, justifyCenter, justifyRight, justifyFull],lists: [unorderedList, orderedList],indenting: [outdent, indent],doAction: [undo, redo],links: [createLink,removeLink],images: [image],media: [video],tables: [createTable, addRowAbove, addRowBelow, addColumnLeft, addColumnRight, deleteRow, deleteColumn, deleteTable]],view:[“fullScreen”,zoomIn,zoomOut],print:[print]} + */ + tools?: Tools; + + /**Specifies the list of groups and order of those groups displayed in the RTE toolbar. The toolsList property is used to get the root group order and tools property is used to get the inner order of the corresponding groups displayed. When the value is not specified, it gets its default display order and tools. + * @Default {[formatStyle, font, style, effects, alignment, lists, indenting, clipboard, doAction, clear, links, images, media, tables, casing,view, customTools,print,edit]} + */ + toolsList?: Array; + + /**Gets the undo stack limit. + * @Default {50} + */ + undoStackLimit?: number; + + /**The given string value is displayed in the editable area. + * @Default {null} + */ + value?: string; + + /**Sets the jquery validation rules to the Rich Text Editor. + * @Default {null} + */ + validationRules?: any; + + /**Sets the jquery validation error message to the Rich Text Editor. + * @Default {null} + */ + validationMessage?: any; + + /**Defines the width of the RTE textbox. + * @Default {786} + */ + width?: string|number; + + /**Increases and decreases the contents zoom range in percentage + * @Default {0.05} + */ + zoomStep?: string|number; + + /**Fires when changed successfully.*/ + change? (e: ChangeEventArgs): void; + + /**Fires when the RTE is created successfully*/ + create? (e: CreateEventArgs): void; + + /**Fires when mouse click on menu items.*/ + contextMenuClick? (e: ContextMenuClickEventArgs): void; + + /**Fires before the RTE is destroyed.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires when the commands are executed successfully.*/ + execute? (e: ExecuteEventArgs): void; + + /**Fires when the keydown action is successful.*/ + keydown? (e: KeydownEventArgs): void; + + /**Fires when the keyup action is successful.*/ + keyup? (e: KeyupEventArgs): void; + + /**Fires before the RTE Edit area is rendered and after the toolbar is rendered.*/ + preRender? (e: PreRenderEventArgs): void; +} + +export interface ChangeEventArgs { + + /**When the event is canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the RTE model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface CreateEventArgs { + + /**When the event is canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns the RTE model + */ + model?: any; + + /**Returns the name of the event + */ + type?: string; +} + +export interface ContextMenuClickEventArgs { + + /**returns clicked menu item text. + */ + text?: string; + + /**returns clicked menu item element. + */ + element?: any; + + /**returns the selected item. + */ + selectedItem?: number; +} + +export interface DestroyEventArgs { + + /**When the event is canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns the RTE model + */ + model?: any; + + /**Returns the name of the event + */ + type?: string; +} + +export interface ExecuteEventArgs { + + /**When the event is canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns the RTE model + */ + model?: any; + + /**Returns the name of the event + */ + type?: string; +} + +export interface KeydownEventArgs { + + /**When the event is canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns the RTE model + */ + model?: any; + + /**Returns the name of the event + */ + type?: string; +} + +export interface KeyupEventArgs { + + /**When the event is canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns the RTE model + */ + model?: any; + + /**Returns the name of the event + */ + type?: string; +} + +export interface PreRenderEventArgs { + + /**When the event is canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns the RTE model + */ + model?: any; + + /**Returns the name of the event + */ + type?: string; +} + +export interface FileBrowser { + + /**This API is used to receive the server-side handler for file related operations. + */ + ajaxAction?: string; + + /**Specifies the file type extension shown in the file browser window. + */ + extensionAllow?: string; + + /**Specifies the directory to perform operations like create, delete and rename folder and files, and upload the selected files to the current directory. + */ + filePath?: string; +} + +export interface ImageBrowser { + + /**This API is used to receive the server-side handler for the file related operations. + */ + ajaxAction?: string; + + /**Specifies the file type extension shown in the image browser window. + */ + extensionAllow?: string; + + /**Specifies the directory to perform operations like create, delete and rename folder and files, and upload the selected images to the current directory. + */ + filePath?: string; +} + +export interface ToolsCustomOrderedList { + + /**Specifies the name for customOrderedList item. + */ + name?: string; + + /**Specifies the title for customOrderedList item. + */ + tooltip?: string; + + /**Specifies the styles for customOrderedList item. + */ + css?: string; + + /**Specifies the text for customOrderedList item. + */ + text?: string; + + /**Specifies the list style for customOrderedList item. + */ + listStyle?: string; + + /**Specifies the image for customOrderedList item. + */ + listImage?: string; +} + +export interface ToolsCustomUnorderedList { + + /**Specifies the name for customUnorderedList item. + */ + name?: string; + + /**Specifies the title for customUnorderedList item. + */ + tooltip?: string; + + /**Specifies the styles for customUnorderedList item. + */ + css?: string; + + /**Specifies the text for customUnorderedList item. + */ + text?: string; + + /**Specifies the list style for customUnorderedList item. + */ + listStyle?: string; + + /**Specifies the image for customUnorderedList item. + */ + listImage?: string; +} + +export interface Tools { + + /**Specifies the alignment tools and the display order of this tool in the RTE toolbar. + */ + alignment?: any; + + /**Specifies the casing tools and the display order of this tool in the RTE toolbar. + */ + casing?: Array; + + /**Specifies the clear tools and the display order of this tool in the RTE toolbar. + */ + clear?: Array; + + /**Specifies the clipboard tools and the display order of this tool in the RTE toolbar. + */ + clipboard?: Array; + + /**Specifies the edit tools and the displays tool in the RTE toolbar. + */ + edit?: Array; + + /**Specifies the doAction tools and the display order of this tool in the RTE toolbar. + */ + doAction?: Array; + + /**Specifies the effect of tools and the display order of this tool in RTE toolbar. + */ + effects?: Array; + + /**Specifies the font tools and the display order of this tool in the RTE toolbar. + */ + font?: Array; + + /**Specifies the formatStyle tools and the display order of this tool in the RTE toolbar. + */ + formatStyle?: Array; + + /**Specifies the image tools and the display order of this tool in the RTE toolbar. + */ + images?: Array; + + /**Specifies the indent tools and the display order of this tool in the RTE toolbar. + */ + indenting?: Array; + + /**Specifies the link tools and the display order of this tool in the RTE toolbar. + */ + links?: Array; + + /**Specifies the list tools and the display order of this tool in the RTE toolbar. + */ + lists?: Array; + + /**Specifies the media tools and the display order of this tool in the RTE toolbar. + */ + media?: Array; + + /**Specifies the style tools and the display order of this tool in the RTE toolbar. + */ + style?: Array; + + /**Specifies the table tools and the display order of this tool in the RTE toolbar. + */ + tables?: Array; + + /**Specifies the view tools and the display order of this tool in the RTE toolbar. + */ + view?: Array; + + /**Specifies the print tools and the display order of this tool in the RTE toolbar. + */ + print?: Array; + + /**Specifies the customOrderedList tools and the display order of this tool in the RTE toolbar. + */ + customOrderedList?: Array; + + /**Specifies the customUnOrderedList tools and the display order of this tool in the RTE toolbar. + */ + customUnorderedList?: Array; +} +} + +class Slider extends ej.Widget { + static fn: Slider; + constructor(element: JQuery, options?: Slider.Model); + constructor(element: Element, options?: Slider.Model); + model:Slider.Model; + defaults:Slider.Model; + + /** To disable the slider + * @returns {void} + */ + disable(): void; + + /** To enable the slider + * @returns {void} + */ + enable(): void; + + /** To get value from slider handle + * @returns {number} + */ + getValue(): number; + + /** To set value to slider handle + * @returns {void} + */ + setValue(): void; +} +export module Slider{ + +export interface Model { + + /**Specifies the animationSpeed of the slider. + * @Default {500} + */ + animationSpeed?: number; + + /**Specify the CSS class to slider to achieve custom theme. + */ + cssClass?: string; + + /**Specifies the animation behavior of the slider. + * @Default {true} + */ + enableAnimation?: boolean; + + /**Specifies the state of the slider. + * @Default {true} + */ + enabled?: boolean; + + /**Specify the enablePersistence to slider to save current model value to browser cookies for state maintains + * @Default {false} + */ + enablePersistence?: boolean; + + /**Specifies the Right to Left Direction of the slider. + * @Default {false} + */ + enableRTL?: boolean; + + /**Specifies the height of the slider. + * @Default {14} + */ + height?: string; + + /**Specifies the HTML Attributes of the ejSlider. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Specifies the incremental step value of the slider. + * @Default {1} + */ + incrementStep?: number; + + /**Specifies the distance between two major (large) ticks from the scale of the slider. + * @Default {10} + */ + largeStep?: number; + + /**Specifies the ending value of the slider. + * @Default {100} + */ + maxValue?: number; + + /**Specifies the starting value of the slider. + * @Default {0} + */ + minValue?: number; + + /**Specifies the orientation of the slider. + * @Default {ej.orientation.Horizontal} + */ + orientation?: ej.Orientation|string; + + /**Specifies the readOnly of the slider. + * @Default {false} + */ + readOnly?: boolean; + + /**Specifies the rounded corner behavior for slider. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Shows/Hide the major (large) and minor (small) ticks in the scale of the slider. + * @Default {false} + */ + showScale?: boolean; + + /**Specifies the small ticks from the scale of the slider. + * @Default {true} + */ + showSmallTicks?: boolean; + + /**Specifies the showTooltip to shows the current Slider value, while moving the Slider handle or clicking on the slider handle of the slider. + * @Default {true} + */ + showTooltip?: boolean; + + /**Specifies the sliderType of the slider. + * @Default {ej.SliderType.Default} + */ + sliderType?: ej.slider.sliderType|string; + + /**Specifies the distance between two minor (small) ticks from the scale of the slider. + * @Default {1} + */ + smallStep?: number; + + /**Specifies the value of the slider. But it's not applicable for range slider. To range slider we can use values property. + * @Default {0} + */ + value?: number; + + /**Specifies the values of the range slider. But it's not applicable for default and minRange sliders. we can use value property for default and minRange sliders. + * @Default {[minValue,maxValue]} + */ + values?: Array; + + /**Specifies the width of the slider. + * @Default {100%} + */ + width?: string; + + /**Fires once Slider control value is changed successfully.*/ + change? (e: ChangeEventArgs): void; + + /**Fires once Slider control has been created successfully.*/ + create? (e: CreateEventArgs): void; + + /**Fires when Slider control has been destroyed successfully.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires once Slider control is sliding successfully.*/ + slide? (e: SlideEventArgs): void; + + /**Fires once Slider control is started successfully.*/ + start? (e: StartEventArgs): void; + + /**Fires when Slider control is stopped successfully.*/ + stop? (e: StopEventArgs): void; +} + +export interface ChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns current handle number or index + */ + sliderIndex?: number; + + /**returns slider id. + */ + id?: string; + + /**returns the slider model. + */ + model?: ej.Slider.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns the slider value. + */ + value?: number; + + /**returns true if event triggered by interaction else returns false. + */ + isInteraction?: boolean; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the slider model + */ + model?: ej.Slider.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the slider model + */ + model?: ej.Slider.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface SlideEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns current handle number or index + */ + sliderIndex?: number; + + /**returns slider id + */ + id?: string; + + /**returns the slider model + */ + model?: ej.Slider.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the slider value + */ + value?: number; +} + +export interface StartEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns current handle number or index + */ + sliderIndex?: number; + + /**returns slider id + */ + id?: string; + + /**returns the slider model + */ + model?: ej.Slider.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the slider value + */ + value?: number; +} + +export interface StopEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns current handle number or index + */ + sliderIndex?: number; + + /**returns slider id + */ + id?: string; + + /**returns the slider model + */ + model?: ej.Slider.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the slider value + */ + value?: number; +} +} +module slider +{ +enum sliderType +{ +//Shows default slider +Default, +//Shows minRange slider +MinRange, +//Shows Range slider +Range, +} +} + +class SplitButton extends ej.Widget { + static fn: SplitButton; + constructor(element: JQuery, options?: SplitButton.Model); + constructor(element: Element, options?: SplitButton.Model); + model:SplitButton.Model; + defaults:SplitButton.Model; + + /** destroy the split button widget all events bound using this._on will be unbind automatically and bring the control to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** To disable the split button + * @returns {void} + */ + disable(): void; + + /** To Enable the split button + * @returns {void} + */ + enable(): void; + + /** To Hide the list content of the split button. + * @returns {void} + */ + hide(): void; + + /** To show the list content of the split button. + * @returns {void} + */ + show(): void; +} +export module SplitButton{ + +export interface Model { + + /**Specifies the arrowPosition of the Split or Dropdown Button.See arrowPosition + * @Default {ej.ArrowPosition.Right} + */ + arrowPosition?: string|ej.ArrowPosition; + + /**Specifies the buttonMode like Split or Dropdown Button.See ButtonMode + * @Default {ej.ButtonMode.Split} + */ + buttonMode?: string|ej.ButtonMode; + + /**Specifies the contentType of the Split Button.See ContentType + * @Default {ej.ContentType.TextOnly} + */ + contentType?: string|ej.ContentType; + + /**Set the root class for Split Button control theme + */ + cssClass?: string; + + /**Specifies the disabling of Split Button if enabled is set to false. + * @Default {true} + */ + enabled?: boolean; + + /**Specifies the enableRTL property for Split Button while initialization. + * @Default {false} + */ + enableRTL?: boolean; + + /**Specifies the height of the Split Button. + * @Default {“”} + */ + height?: string|number; + + /**Specifies the HTML Attributes of the Split Button. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Specifies the imagePosition of the Split Button.See imagePositions + * @Default {ej.ImagePosition.ImageRight} + */ + imagePosition?: string|ej.ImagePosition; + + /**Specifies the image content for Split Button while initialization. + */ + prefixIcon?: string; + + /**Specifies the showRoundedCorner property for Split Button while initialization. + * @Default {false} + */ + showRoundedCorner?: string; + + /**Specifies the size of the Button. See ButtonSize + * @Default {ej.ButtonSize.Normal} + */ + size?: string|ej.ButtonSize; + + /**Specifies the image content for Split Button while initialization. + */ + suffixIcon?: string; + + /**Specifies the list content for Split Button while initialization + */ + targetID?: string; + + /**Specifies the text content for Split Button while initialization. + */ + text?: string; + + /**Specifies the width of the Split Button. + * @Default {“”} + */ + width?: string|number; + + /**Fires before menu of the split button control is opened.*/ + beforeOpen? (e: BeforeOpenEventArgs): void; + + /**Fires when Button control is clicked successfully*/ + click? (e: ClickEventArgs): void; + + /**Fires before the list content of Button control is closed*/ + close? (e: CloseEventArgs): void; + + /**Fires after Split Button control is created.*/ + create? (e: CreateEventArgs): void; + + /**Fires when the Split Button is destroyed successfully*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires when a menu item is Hovered out successfully*/ + itemMouseOut? (e: ItemMouseOutEventArgs): void; + + /**Fires when a menu item is Hovered in successfully*/ + itemMouseOver? (e: ItemMouseOverEventArgs): void; + + /**Fires when a menu item is clicked successfully*/ + itemSelected? (e: ItemSelectedEventArgs): void; + + /**Fires before the list content of Button control is opened*/ + open? (e: OpenEventArgs): void; +} + +export interface BeforeOpenEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the split button model + */ + model?: ej.SplitButton.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface ClickEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the split button model + */ + model?: ej.SplitButton.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the target of the current object. + */ + target?: any; + + /**return the button state + */ + status?: boolean; +} + +export interface CloseEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the split button model + */ + model?: ej.SplitButton.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface CreateEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the split button model + */ + model?: ej.SplitButton.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the split button model + */ + model?: ej.SplitButton.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface ItemMouseOutEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the split button model + */ + model?: ej.SplitButton.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the clicked menu item element + */ + element?: any; + + /**returns the event + */ + event?: any; +} + +export interface ItemMouseOutEvent { + + /**return the menu item id + */ + ID?: string; + + /**return the clicked menu item text + */ + Text?: string; +} + +export interface ItemMouseOverEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the split button model + */ + model?: ej.SplitButton.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the clicked menu item element + */ + element?: any; + + /**returns the event + */ + event?: any; +} + +export interface ItemMouseOverEvent { + + /**return the menu item id + */ + ID?: string; + + /**return the clicked menu item text + */ + Text?: string; +} + +export interface ItemSelectedEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the split button model + */ + model?: ej.SplitButton.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the clicked menu item element + */ + element?: any; + + /**returns the selected item + */ + selectedItem?: any; + + /**return the menu id + */ + menuId?: string; + + /**return the clicked menu item text + */ + menuText?: string; +} + +export interface OpenEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the split button model + */ + model?: ej.SplitButton.Model; + + /**returns the name of the event + */ + type?: string; +} +} +enum ArrowPosition +{ +//To set Left arrowPosition of the split button +Left, +//To set Right arrowPosition of the split button +Right, +//To set Top arrowPosition of the split button +Top, +//To set Bottom arrowPosition of the split button +Bottom, +} + +class Splitter extends ej.Widget { + static fn: Splitter; + constructor(element: JQuery, options?: Splitter.Model); + constructor(element: Element, options?: Splitter.Model); + model:Splitter.Model; + defaults:Splitter.Model; + + /** To add a new pane to splitter control. + * @param {string} content of pane. + * @param {any} pane properties. + * @param {number} index of pane. + * @returns {HTMLElement} + */ + addItem(content: string, property: any, index: number): HTMLElement; + + /** To collapse the splitter control pane. + * @param {number} index number of pane. + * @returns {void} + */ + collapse(paneIndex: number): void; + + /** To expand the splitter control pane. + * @param {number} index number of pane. + * @returns {void} + */ + expand(paneIndex: number): void; + + /** To refresh the splitter control pane resizing. + * @returns {void} + */ + refresh(): void; + + /** To remove a specified pane from the splitter control. + * @param {number} index of pane. + * @returns {void} + */ + removeItem(index: number): void; +} +export module Splitter{ + +export interface Model { + + /**Turns on keyboard interaction with the Splitter panes. You must set this property to true to access the keyboard shortcuts of ejSplitter. + * @Default {true} + */ + allowKeyboardNavigation?: boolean; + + /**Specify animation speed for the Splitter pane movement, while collapsing and expanding. + * @Default {300} + */ + animationSpeed?: number; + + /**Specify the CSS class to splitter control to achieve custom theme. + * @Default {“”} + */ + cssClass?: string; + + /**Specifies the animation behavior of the splitter. + * @Default {true} + */ + enableAnimation?: boolean; + + /**Specifies the splitter control to be displayed in right to left direction. + * @Default {false} + */ + enableRTL?: boolean; + + /**Specify height for splitter control. + * @Default {null} + */ + height?: string; + + /**Specifies the HTML Attributes of the Splitter. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Specify window resizing behavior for splitter control. + * @Default {false} + */ + isResponsive?: boolean; + + /**Specify the orientation for spliter control. See orientation + * @Default {ej.orientation.Horizontal or “horizontal”} + */ + orientation?: ej.Orientation|string; + + /**Specify properties for each pane like paneSize, minSize, maxSize, collapsible, resizable. + * @Default {[]} + */ + properties?: Array; + + /**Specify width for splitter control. + * @Default {null} + */ + width?: string; + + /**Fires before expanding / collapsing the split pane of splitter control.*/ + beforeExpandCollapse? (e: BeforeExpandCollapseEventArgs): void; + + /**Fires when splitter control pane has been created.*/ + create? (e: CreateEventArgs): void; + + /**Fires when splitter control pane has been destroyed.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires when expand / collapse operation in splitter control pane has been performed successfully.*/ + expandCollapse? (e: ExpandCollapseEventArgs): void; + + /**Fires when resize in splitter control pane.*/ + resize? (e: ResizeEventArgs): void; +} + +export interface BeforeExpandCollapseEventArgs { + + /**if the event should be cancelled; otherwise, false. + */ + cancel?: boolean; + + /**returns collapsed pane details. + */ + collapsed?: any; + + /**returns expanded pane details. + */ + expanded?: any; + + /**returns the splitter model. + */ + model?: ej.Splitter.Model; + + /**returns the current split bar index. + */ + splitbarIndex?: number; + + /**returns the name of the event. + */ + type?: string; +} + +export interface CreateEventArgs { + + /**if the event should be cancelled; otherwise, false. + */ + cancel?: boolean; + + /**returns the splitter model. + */ + model?: ej.Splitter.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be cancelled; otherwise, false. + */ + cancel?: boolean; + + /**returns the splitter model. + */ + model?: ej.Splitter.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface ExpandCollapseEventArgs { + + /**if the event should be cancelled; otherwise, false. + */ + cancel?: boolean; + + /**returns collapsed pane details. + */ + collapsed?: any; + + /**returns expanded pane details. + */ + expanded?: any; + + /**returns the splitter model. + */ + model?: ej.Splitter.Model; + + /**returns the current split bar index. + */ + splitbarIndex?: number; + + /**returns the name of the event. + */ + type?: string; +} + +export interface ResizeEventArgs { + + /**if the event should be cancelled; otherwise, false. + */ + cancel?: boolean; + + /**returns previous pane details. + */ + prevPane?: any; + + /**returns next pane details. + */ + nextPane?: any; + + /**returns the splitter model. + */ + model?: ej.Splitter.Model; + + /**returns the current split bar index. + */ + splitbarIndex?: number; + + /**returns the name of the event. + */ + type?: string; +} +} + +class Tab extends ej.Widget { + static fn: Tab; + constructor(element: JQuery, options?: Tab.Model); + constructor(element: Element, options?: Tab.Model); + model:Tab.Model; + defaults:Tab.Model; + + /** Add new tab items with given name, url and given index position, if index null it’s add last item. + * @param {string} URL name / tab id. + * @param {string} Tab Display name. + * @param {number} Index position to placed , this is optional. + * @param {string} specifies cssClass, this is optional. + * @param {string} specifies id of tab, this is optional. + * @returns {void} + */ + addItem(url: string, displayLabel: string, index: number, cssClass: string, id: string): void; + + /** To disable the tab control. + * @returns {void} + */ + disable(): void; + + /** To enable the tab control. + * @returns {void} + */ + enable(): void; + + /** This function get the number of tab rendered + * @returns {number} + */ + getItemsCount(): number; + + /** This function hides the tab control. + * @returns {void} + */ + hide(): void; + + /** This function hides the specified item tab in tab control. + * @param {number} index of tab item. + * @returns {void} + */ + hideItem(index: number): void; + + /** Remove the given index tab item. + * @param {number} index of tab item. + * @returns {void} + */ + removeItem(index: number): void; + + /** This function is to show the tab control. + * @returns {void} + */ + show(): void; + + /** This function helps to show the specified hidden tab item in tab control. + * @param {number} index of tab item. + * @returns {void} + */ + showItem(index: number): void; +} +export module Tab{ + +export interface Model { + + /**Specifies the ajaxSettings option to load the content to the Tab control. + */ + ajaxSettings?: AjaxSettings; + + /**Tab items interaction with keyboard keys, like headers active navigation. + * @Default {true} + */ + allowKeyboardNavigation?: boolean; + + /**Allow to collapsing the active item, while click on the active header. + * @Default {false} + */ + collapsible?: boolean; + + /**Set the root class for Tab theme. This cssClass API helps to use custom skinning option for Tab control. + */ + cssClass?: string; + + /**Disables the given tab headers and content panels. + * @Default {[]} + */ + disabledItemIndex?: number[]; + + /**Specifies the animation behavior of the tab. + * @Default {true} + */ + enableAnimation?: boolean; + + /**When this property is set to false, it disables the tab control. + * @Default {true} + */ + enabled?: boolean; + + /**Enables the given tab headers and content panels. + * @Default {[]} + */ + enabledItemIndex?: number[]; + + /**Save current model value to browser cookies for state maintains. While refresh the Tab control page the model value apply from browser cookies. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Display Right to Left direction for headers and panels text of tab. + * @Default {false} + */ + enableRTL?: boolean; + + /**Specify to enable scrolling for Tab header. + * @Default {false} + */ + enableTabScroll?: boolean; + + /**The event API to bind the action for active the tab items. + * @Default {click} + */ + events?: string; + + /**Specifies the position of Tab header as top, bottom, left or right. See below to get availanle Position + * @Default {top} + */ + headerPosition?: string | ej.Tab.Position; + + /**Set the height of the tab header element. Default this property value is null, so height take content height. + * @Default {null} + */ + headerSize?: string|number; + + /**Height set the outer panel element. Default this property value is null, so height take content height. + * @Default {null} + */ + height?: string|number; + + /**Adjust the content panel height for given option (content, auto and fill), by default panels height adjust based on the content.See below to get available HeightAdjustMode + * @Default {content} + */ + heightAdjustMode?: string | ej.Tab.HeightAdjustMode; + + /**Specifies to hide a pane of Tab control. + * @Default {[]} + */ + hiddenItemIndex?: Array; + + /**Specifies the HTML Attributes of the Tab. + * @Default {{}} + */ + htmlAttributes?: any; + + /**The idPrefix property appends the given string on the added tab item id’s in runtime. + * @Default {ej-tab-} + */ + idPrefix?: string; + + /**Specifies the Tab header in active for given index value. + * @Default {0} + */ + selectedItemIndex?: number; + + /**Display the close button for each tab items. While clicking on the close icon, particular tab item will be removed. + * @Default {false} + */ + showCloseButton?: boolean; + + /**Display the Reload button for each tab items. + * @Default {false} + */ + showReloadIcon?: boolean; + + /**Tab panels and headers to be displayed in rounded corner style. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Set the width for outer panel element, if not it’s take parent width. + * @Default {null} + */ + width?: string|number; + + /**Triggered after a tab item activated.*/ + itemActive? (e: ItemActiveEventArgs): void; + + /**Triggered before ajax content has been loaded.*/ + ajaxBeforeLoad? (e: AjaxBeforeLoadEventArgs): void; + + /**Triggered if error occurs in Ajax request.*/ + ajaxError? (e: AjaxErrorEventArgs): void; + + /**Triggered after ajax content load action.*/ + ajaxLoad? (e: AjaxLoadEventArgs): void; + + /**Triggered after a tab item activated.*/ + ajaxSuccess? (e: AjaxSuccessEventArgs): void; + + /**Triggered before a tab item activated.*/ + beforeActive? (e: BeforeActiveEventArgs): void; + + /**Triggered before a tab item remove.*/ + beforeItemRemove? (e: BeforeItemRemoveEventArgs): void; + + /**Triggered before a tab item Create.*/ + create? (e: CreateEventArgs): void; + + /**Triggered before a tab item destroy.*/ + destroy? (e: DestroyEventArgs): void; + + /**Triggered after new tab item add*/ + itemAdd? (e: ItemAddEventArgs): void; + + /**Triggered after tab item removed.*/ + itemRemove? (e: ItemRemoveEventArgs): void; +} + +export interface ItemActiveEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the tab model. + */ + model?: ej.Tab.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns previous active tab header. + */ + prevActiveHeader?: HTMLElement; + + /**returns previous active index. + */ + prevActiveIndex?: number; + + /**returns current active tab header . + */ + activeHeader?: HTMLElement; + + /**returns current active index. + */ + activeIndex?: number; + + /**returns, is it triggered by interaction or not. + */ + isInteraction?: boolean; +} + +export interface AjaxBeforeLoadEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the tab model. + */ + model?: ej.Tab.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns previous active tab header. + */ + prevActiveHeader?: HTMLElement; + + /**returns previous active index. + */ + prevActiveIndex?: number; + + /**returns current active tab header . + */ + activeHeader?: HTMLElement; + + /**returns current active index. + */ + activeIndex?: number; + + /**returns the url of ajax request + */ + url?: string; + + /**returns, is it triggered by interaction or not. + */ + isInteraction?: boolean; +} + +export interface AjaxErrorEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the tab model. + */ + model?: ej.Tab.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns ajax data details. + */ + data?: any; + + /**returns the url of ajax request. + */ + url?: string; +} + +export interface AjaxLoadEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the tab model. + */ + model?: ej.Tab.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns previous active tab header. + */ + prevActiveHeader?: HTMLElement; + + /**returns previous active index. + */ + prevActiveIndex?: number; + + /**returns current active tab header . + */ + activeHeader?: HTMLElement; + + /**returns current active index. + */ + activeIndex?: number; + + /**returns the url of ajax request + */ + url?: string; + + /**returns, is it triggered by interaction or not. + */ + isInteraction?: boolean; +} + +export interface AjaxSuccessEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the tab model. + */ + model?: ej.Tab.Model; + + /**returns the name of the event. + */ + type?: string; + + /**return ajax data. + */ + data?: any; + + /**returns ajax url + */ + url?: string; + + /**returns content of ajax request. + */ + content?: any; +} + +export interface BeforeActiveEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the tab model. + */ + model?: ej.Tab.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns previous active tab header. + */ + prevActiveHeader?: HTMLElement; + + /**returns previous active index. + */ + prevActiveIndex?: number; + + /**returns current active tab header . + */ + activeHeader?: HTMLElement; + + /**returns current active index. + */ + activeIndex?: number; + + /**returns, is it triggered by interaction or not. + */ + isInteraction?: boolean; +} + +export interface BeforeItemRemoveEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the tab model. + */ + model?: ej.Tab.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns current tab item index + */ + index?: number; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the tab model. + */ + model?: ej.Tab.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the tab model. + */ + model?: ej.Tab.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface ItemAddEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the tab model. + */ + model?: ej.Tab.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns new added tab header. + */ + tabHeader?: HTMLElement; + + /**returns new added tab content panel. + */ + tabContent?: any; +} + +export interface ItemRemoveEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the tab model. + */ + model?: ej.Tab.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns removed tab header. + */ + removedTab?: HTMLElement; +} + +export interface AjaxSettings { + + /**It specifies, whether to enable or disable asynchronous request. + * @Default {true} + */ + async?: boolean; + + /**It specifies the page will be cached in the web browser. + * @Default {false} + */ + cache?: boolean; + + /**It specifies the type of data is send in the query string. + * @Default {html} + */ + contentType?: string; + + /**It specifies the data as an object, will be passed in the query string. + * @Default {{}} + */ + data?: any; + + /**It specifies the type of data that you're expecting back from the response. + * @Default {html} + */ + dataType?: string; + + /**It specifies the HTTP request type. + * @Default {get} + */ + type?: string; +} + +enum Position{ + + ///Tab headers display to top position + Top, + + ///Tab headers display to bottom position + Bottom, + + ///Tab headers display to left position. + Left, + + ///Tab headers display to right position. + Right +} + + +enum HeightAdjustMode{ + + ///string + None, + + ///string + Content, + + ///string + Auto, + + ///string + Fill +} + +} + +class TagCloud extends ej.Widget { + static fn: TagCloud; + constructor(element: JQuery, options?: TagCloud.Model); + constructor(element: Element, options?: TagCloud.Model); + model:TagCloud.Model; + defaults:TagCloud.Model; + + /** Inserts a new item into the TagCloud + * @param {string} Insert new item into the TagCloud + * @returns {void} + */ + insert(name: string): void; + + /** Inserts a new item into the TagCloud at a particular position. + * @param {string} Inserts a new item into the TagCloud + * @param {number} Inserts a new item into the TagCloud with the specified position + * @returns {void} + */ + insertAt(name: string, position: number): void; + + /** Removes the item from the TagCloud based on the name. It removes all the tags which have the corresponding name + * @param {string} name of the tag. + * @returns {void} + */ + remove(name: string): void; + + /** Removes the item from the TagCloud based on the position. It removes the tags from the the corresponding position only. + * @param {number} position of tag item. + * @returns {void} + */ + removeAt(position: number): void; +} +export module TagCloud{ + +export interface Model { + + /**Specify the CSS class to button to achieve custom theme. + */ + cssClass?: string; + + /**The dataSource contains the list of data to display in a cloud format. Each data contains a link url, frequency to categorize the font size and a display text. + * @Default {null} + */ + dataSource?: any; + + /**Sets the TagCloud and tag items direction as right to left alignment. + * @Default {false} + */ + enableRTL?: boolean; + + /**Defines the mapping fields for the data items of the TagCloud. + * @Default {null} + */ + fields?: Fields; + + /**Defines the format for the TagCloud to display the tag items.See Format + * @Default {ej.Format.Cloud} + */ + format?: string|ej.Format; + + /**Sets the maximum font size value for the tag items. The font size for the tag items will be generated in between the minimum and maximum font size values. + * @Default {40px} + */ + maxFontSize?: string|number; + + /**Sets the minimum font size value for the tag items. The font size for the tag items will be generated in between the minimum and maximum font size values. + * @Default {10px} + */ + minFontSize?: string|number; + + /**Define the query to retrieve the data from online server. The query is used only when the online dataSource is used. + * @Default {null} + */ + query?: any; + + /**Shows or hides the TagCloud title. When this set to false, it hides the TagCloud header. + * @Default {true} + */ + showTitle?: boolean; + + /**Sets the title image for the TagCloud. To show the title image, the showTitle property should be enabled. + * @Default {null} + */ + titleImage?: string; + + /**Sets the title text for the TagCloud. To show the title text, the showTitle property should be enabled. + * @Default {Title} + */ + titleText?: string; + + /**Event triggers when the TagCloud items are clicked*/ + click? (e: ClickEventArgs): void; + + /**Event triggers when the TagCloud are created*/ + create? (e: CreateEventArgs): void; + + /**Event triggers when the TagCloud are destroyed*/ + destroy? (e: DestroyEventArgs): void; + + /**Event triggers when the cursor leaves out from a tag item*/ + mouseout? (e: MouseoutEventArgs): void; + + /**Event triggers when the cursor hovers on a tag item*/ + mouseover? (e: MouseoverEventArgs): void; +} + +export interface ClickEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TagCloud model + */ + model?: ej.TagCloud.Model; + + /**returns the name of the event + */ + type?: string; + + /**return current tag name + */ + text?: string; + + /**return current url link + */ + url?: string; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TagCloud model + */ + model?: ej.TagCloud.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TagCloud model + */ + model?: ej.TagCloud.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface MouseoutEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TagCloud model + */ + model?: ej.TagCloud.Model; + + /**returns the name of the event + */ + type?: string; + + /**return current tag name + */ + text?: string; + + /**return current url link + */ + url?: string; +} + +export interface MouseoverEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TagCloud model + */ + model?: ej.TagCloud.Model; + + /**returns the name of the event + */ + type?: string; + + /**return current tag name + */ + text?: string; + + /**return current url link + */ + url?: string; +} + +export interface Fields { + + /**Defines the frequency number to categorize the font size. + */ + frequency?: number; + + /**Defines the html attributes for the anchor elements inside the each tag items. + */ + htmlAttributes?: any; + + /**Defines the tag value or display text. + */ + text?: string; + + /**Defines the url link to navigate while click the tag. + */ + url?: string; +} +} +enum Format +{ +//To render the TagCloud items in cloud format +Cloud, +//To render the TagCloud items in list format +List, +} + +class TimePicker extends ej.Widget { + static fn: TimePicker; + constructor(element: JQuery, options?: TimePicker.Model); + constructor(element: Element, options?: TimePicker.Model); + model:TimePicker.Model; + defaults:TimePicker.Model; + + /** Allows you to disable the TimePicker. + * @returns {void} + */ + disable(): void; + + /** Allows you to enable the TimePicker. + * @returns {void} + */ + enable(): void; + + /** It returns the current time value. + * @returns {string} + */ + getValue(): string; + + /** This method will hide the TimePicker control popup. + * @returns {void} + */ + hide(): void; + + /** Updates the current system time in TimePicker. + * @returns {void} + */ + setCurrentTime(): void; + + /** This method will show the TimePicker control popup. + * @returns {void} + */ + show(): void; +} +export module TimePicker{ + +export interface Model { + + /**Sets the root CSS class for the TimePicker theme, which is used to customize. + */ + cssClass?: string; + + /**Specifies the animation behavior in TimePicker. + * @Default {true} + */ + enableAnimation?: boolean; + + /**When this property is set to false, it disables the TimePicker control. + * @Default {true} + */ + enabled?: boolean; + + /**Save current model value to browser cookies for maintaining states. When refreshing the TimePicker control page, the model value is applied from browser cookies or HTML 5local storage. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Displays the TimePicker as right to left alignment. + * @Default {false} + */ + enableRTL?: boolean; + + /**When the enableStrictMode is set as true it allows the value outside of the range and also indicate with red color border, otherwise it internally changed to the min or max range value based an input value. + * @Default {false} + */ + enableStrictMode?: boolean; + + /**Defines the height of the TimePicker textbox. + */ + height?: string|number; + + /**Sets the step value for increment an hour value through arrow keys or mouse scroll. + * @Default {1} + */ + hourInterval?: number; + + /**It allows to define the characteristics of the TimePicker control. It will helps to extend the capability of an HTML element. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Sets the time interval between the two adjacent time values in the popup. + * @Default {30} + */ + interval?: number; + + /**Defines the localization info used by the TimePicker. + * @Default {en-US} + */ + locale?: string; + + /**Sets the maximum time value to the TimePicker. + * @Default {11:59:59 PM} + */ + maxTime?: string; + + /**Sets the minimum time value to the TimePicker. + * @Default {12:00:00 AM} + */ + minTime?: string; + + /**Sets the step value for increment the minute value through arrow keys or mouse scroll. + * @Default {1} + */ + minutesInterval?: number; + + /**Defines the height of the TimePicker popup. + * @Default {191px} + */ + popupHeight?: string|number; + + /**Defines the width of the TimePicker popup. + * @Default {auto} + */ + popupWidth?: string|number; + + /**Toggles the readonly state of the TimePicker + * @Default {false} + */ + readOnly?: boolean; + + /**Sets the step value for increment the seconds value through arrow keys or mouse scroll. + * @Default {1} + */ + secondsInterval?: number; + + /**shows or hides the drop down button in TimePicker. + * @Default {true} + */ + showPopupButton?: boolean; + + /**TimePicker is displayed with rounded corner when this property is set to true. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Defines the time format displayed in the TimePicker. + * @Default {h:mm tt} + */ + timeFormat?: string; + + /**Sets a specified time value on the TimePicker. + * @Default {null} + */ + value?: string|Date; + + /**Defines the width of the TimePicker textbox. + */ + width?: string|number; + + /**Fires when the time value changed in the TimePicker.*/ + beforeChange? (e: BeforeChangeEventArgs): void; + + /**Fires when the TimePicker popup before opened.*/ + beforeOpen? (e: BeforeOpenEventArgs): void; + + /**Fires when the time value changed in the TimePicker.*/ + change? (e: ChangeEventArgs): void; + + /**Fires when the TimePicker popup closed.*/ + close? (e: CloseEventArgs): void; + + /**Fires when create TimePicker successfully.*/ + create? (e: CreateEventArgs): void; + + /**Fires when the TimePicker is destroyed successfully.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires when the TimePicker control gets focus.*/ + focusIn? (e: FocusInEventArgs): void; + + /**Fires when the TimePicker control get lost focus.*/ + focusOut? (e: FocusOutEventArgs): void; + + /**Fires when the TimePicker popup opened.*/ + open? (e: OpenEventArgs): void; + + /**Fires when the value is selected from the TimePicker dropdown list.*/ + select? (e: SelectEventArgs): void; +} + +export interface BeforeChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.TimePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the previously selected time value + */ + prevTime?: string; + + /**returns the modified time value + */ + value?: string; +} + +export interface BeforeOpenEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.TimePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the previously selected time value + */ + prevTime?: string; + + /**returns the time value + */ + value?: string; +} + +export interface ChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.TimePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns true when the value changed by user interaction otherwise returns false + */ + isInteraction?: boolean; + + /**returns the previously selected time value + */ + prevTime?: string; + + /**returns the modified time value + */ + value?: string; +} + +export interface CloseEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.TimePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the previously selected time value + */ + prevTime?: string; + + /**returns the time value + */ + value?: string; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.TimePicker.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.TimePicker.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface FocusInEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.TimePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the previously selected time value + */ + prevTime?: string; + + /**returns the current time value + */ + value?: string; +} + +export interface FocusOutEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.TimePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the previously selected time value + */ + prevTime?: string; + + /**returns the current time value + */ + value?: string; +} + +export interface OpenEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.TimePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the time value + */ + value?: string; +} + +export interface SelectEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.TimePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the previously selected time value + */ + prevTime?: string; + + /**returns the selected time value + */ + value?: string; +} +} + +class ToggleButton extends ej.Widget { + static fn: ToggleButton; + constructor(element: JQuery, options?: ToggleButton.Model); + constructor(element: Element, options?: ToggleButton.Model); + model:ToggleButton.Model; + defaults:ToggleButton.Model; + + /** Allows you to destroy the ToggleButton widget. + * @returns {void} + */ + destroy(): void; + + /** To disable the ToggleButton to prevent all user interactions. + * @returns {void} + */ + disable(): void; + + /** To enable the ToggleButton. + * @returns {void} + */ + enable(): void; +} +export module ToggleButton{ + +export interface Model { + + /**Specify the icon in active state to the toggle button and it will be aligned from left margin of the button. + */ + activePrefixIcon?: string; + + /**Specify the icon in active state to the toggle button and it will be aligned from right margin of the button. + */ + activeSuffixIcon?: string; + + /**Sets the text when ToggleButton is in active state i.e.,checked state. + * @Default {null} + */ + activeText?: string; + + /**Specifies the contentType of the ToggleButton. See ContentType as below + * @Default {ej.ContentType.TextOnly} + */ + contentType?: ej.ContentType|string; + + /**Specify the CSS class to the ToggleButton to achieve custom theme. + */ + cssClass?: string; + + /**Specify the icon in default state to the toggle button and it will be aligned from left margin of the button. + */ + defaultPrefixIcon?: string; + + /**Specify the icon in default state to the toggle button and it will be aligned from right margin of the button. + */ + defaultSuffixIcon?: string; + + /**Specifies the text of the ToggleButton, when the control is a default state. i.e., unChecked state. + * @Default {null} + */ + defaultText?: string; + + /**Specifies the state of the ToggleButton. + * @Default {true} + */ + enabled?: boolean; + + /**Save current model value to browser cookies for maintaining states. When refreshing the ToggleButton control page, the model value is applied from browser cookies or HTML 5local storage. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Specify the Right to Left direction of the ToggleButton. + * @Default {false} + */ + enableRTL?: boolean; + + /**Specifies the height of the ToggleButton. + * @Default {28pixel} + */ + height?: number|string; + + /**It allows to define the characteristics of the ToggleButton control. It will helps to extend the capability of an HTML element. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Specifies the image position of the ToggleButton. + * @Default {ej.ImagePosition.ImageLeft} + */ + imagePosition?: ej.ImagePosition|string; + + /**Allows to prevents the control switched to checked (active) state. + * @Default {false} + */ + preventToggle?: boolean; + + /**Displays the ToggleButton with rounded corners. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Specifies the size of the ToggleButton. See ButtonSize as below + * @Default {ej.ButtonSize.Normal} + */ + size?: ej.ButtonSize|string; + + /**It allows to define the ToggleButton state to checked(Active) or unchecked(Default) at initial time. + * @Default {false} + */ + toggleState?: boolean; + + /**Specifies the type of the ToggleButton. See ButtonType as below + * @Default {ej.ButtonType.Button} + */ + type?: ej.ButtonType|string; + + /**Specifies the width of the ToggleButton. + * @Default {100pixel} + */ + width?: number|string; + + /**Fires when ToggleButton control state is changed successfully.*/ + change? (e: ChangeEventArgs): void; + + /**Fires when ToggleButton control is clicked successfully.*/ + click? (e: ClickEventArgs): void; + + /**Fires when ToggleButton control is created successfully.*/ + create? (e: CreateEventArgs): void; + + /**Fires when ToggleButton control is destroyed successfully.*/ + destroy? (e: DestroyEventArgs): void; +} + +export interface ChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**return the toggle button checked state + */ + isChecked?: boolean; + + /**returns the toggle button model + */ + model?: ej.ToggleButton.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface ClickEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**return the toggle button checked state + */ + isChecked?: boolean; + + /**returns the toggle button model + */ + model?: ej.ToggleButton.Model; + + /**return the toggle button state + */ + status?: boolean; + + /**returns the name of the event + */ + type?: string; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the toggle button model + */ + model?: ej.ToggleButton.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the toggle button model + */ + model?: ej.ToggleButton.Model; + + /**returns the name of the event + */ + type?: string; +} +} + +class Toolbar extends ej.Widget { + static fn: Toolbar; + constructor(element: JQuery, options?: Toolbar.Model); + constructor(element: Element, options?: Toolbar.Model); + model:Toolbar.Model; + defaults:Toolbar.Model; + + /** Deselect the specified Toolbar item. + * @param {any} The element need to be deselected + * @returns {void} + */ + deselectItem(element: any): void; + + /** Deselect the Toolbar item based on specified id. + * @param {string} The ID of the element need to be deselected + * @returns {void} + */ + deselectItemByID(ID: string): void; + + /** Allows you to destroy the Toolbar widget. + * @returns {void} + */ + destroy(): void; + + /** To disable all items in the Toolbar control. + * @returns {void} + */ + disable(): void; + + /** Disable the specified Toolbar item. + * @param {any} The element need to be disabled + * @returns {void} + */ + disableItem(element: any): void; + + /** Disable the Toolbar item based on specified item id in the Toolbar. + * @param {string} The ID of the element need to be disabled + * @returns {void} + */ + disableItemByID(ID: string): void; + + /** Enable the Toolbar if it is in disabled state. + * @returns {void} + */ + enable(): void; + + /** Enable the Toolbar item based on specified item. + * @param {any} The element need to be enabled + * @returns {void} + */ + enableItem(element: any): void; + + /** Enable the Toolbar item based on specified item id in the Toolbar. + * @param {string} The ID of the element need to be enabled + * @returns {void} + */ + enableItemByID(ID: string): void; + + /** To hide the Toolbar + * @returns {void} + */ + hide(): void; + + /** Remove the item from toolbar, based on specified item. + * @param {any} The element need to be removed + * @returns {void} + */ + removeItem(element: any): void; + + /** Remove the item from toolbar, based on specified item id in the Toolbar. + * @param {string} The ID of the element need to be removed + * @returns {void} + */ + removeItemByID(ID: string): void; + + /** Selects the item from toolbar, based on specified item. + * @param {any} The element need to be selected + * @returns {void} + */ + selectItem(element: any): void; + + /** Selects the item from toolbar, based on specified item id in the Toolbar. + * @param {string} The ID of the element need to be selected + * @returns {void} + */ + selectItemByID(ID: string): void; + + /** To show the Toolbar. + * @returns {void} + */ + show(): void; +} +export module Toolbar{ + +export interface Model { + + /**Sets the root CSS class for Toolbar control to achieve the custom theme. + */ + cssClass?: string; + + /**Specifies dataSource value for the Toolbar control during initialization. + * @Default {null} + */ + dataSource?: any; + + /**Specifies the Toolbar control state. + * @Default {true} + */ + enabled?: boolean; + + /**Specifies enableRTL property to align the Toolbar control from right to left direction. + * @Default {false} + */ + enableRTL?: boolean; + + /**Allows to separate the each UL items in the Toolbar control. + * @Default {false} + */ + enableSeparator?: boolean; + + /**Specifies the mapping fields for the data items of the Toolbar + * @Default {null} + */ + fields?: string; + + /**Specifies the height of the Toolbar. + * @Default {28} + */ + height?: number|string; + + /**Specifies whether the Toolbar control is need to be show or hide. + * @Default {false} + */ + hide?: boolean; + + /**Enables/Disables the responsive support for Toolbar items during the window resizing time. + * @Default {false} + */ + isResponsive?: boolean; + + /**Specifies the Toolbar orientation. See orientation + * @Default {Horizontal} + */ + orientation?: ej.Orientation|string; + + /**Specifies the query to retrieve the data from the online server. The query is used only when the online dataSource is used. + * @Default {null} + */ + query?: any; + + /**Displays the Toolbar with rounded corners. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Specifies the width of the Toolbar. + */ + width?: number|string; + + /**Fires after Toolbar control is clicked.*/ + click? (e: ClickEventArgs): void; + + /**Fires after Toolbar control is created.*/ + create? (e: CreateEventArgs): void; + + /**Fires when the Toolbar is destroyed successfully.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires after Toolbar control item is hovered.*/ + itemHover? (e: ItemHoverEventArgs): void; + + /**Fires after mouse leave from Toolbar control item.*/ + itemLeave? (e: ItemLeaveEventArgs): void; +} + +export interface ClickEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Toolbar model + */ + model?: ej.Toolbar.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the target of the current object. + */ + target?: any; + + /**returns the target of the current object. + */ + currentTarget?: any; + + /**return the Toolbar state + */ + status?: boolean; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Toolbar model + */ + model?: ej.Toolbar.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Toolbar model + */ + model?: ej.Toolbar.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface ItemHoverEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Toolbar model + */ + model?: ej.Toolbar.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the target of the current object. + */ + target?: any; + + /**returns the target of the current object. + */ + currentTarget?: any; + + /**return the Toolbar state + */ + status?: boolean; +} + +export interface ItemLeaveEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Toolbar model + */ + model?: ej.Toolbar.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the target of the current object. + */ + target?: any; + + /**returns the target of the current object. + */ + currentTarget?: any; + + /**return the Toolbar state + */ + status?: boolean; +} + +export interface Fields { + + /**Defines the group name for the item. + */ + group?: string; + + /**Defines the html attributes such as id, class, styles for the item to extend the capability. + */ + htmlAttributes?: any; + + /**Defines id for the tag. + */ + id?: string; + + /**Defines the image attributes such as height, width, styles and so on. + */ + imageAttributes?: string; + + /**Defines the imageURL for the image location. + */ + imageUrl?: string; + + /**Defines the sprite CSS for the image tag. + */ + spriteCssClass?: string; + + /**Defines the text content for the tag. + */ + text?: string; + + /**Defines the tooltip text for the tag. + */ + tooltipText?: string; +} +} + +class TreeView extends ej.Widget { + static fn: TreeView; + constructor(element: JQuery, options?: TreeView.Model); + constructor(element: Element, options?: TreeView.Model); + model:TreeView.Model; + defaults:TreeView.Model; + + /** To add a Node or collection of nodes in TreeView. If target tree node is specified, then the given nodes are added as child of target tree node, otherwise nodes are added in TreeView. + * @param {string|any} New node text or JSON object + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + addNode(newNodeText: string|any, target: string|any): void; + + /** To add a collection of nodes in TreeView. If target tree node is specified, then the given nodes are added as child of target tree node, otherwise nodes are added in TreeView. + * @param {any|Array} New node details in JSON object + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + addNodes(collection: any|Array, target : string|any): void; + + /** To check all the nodes in TreeView. + * @returns {void} + */ + checkAll(): void; + + /** To check a node in TreeView. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + checkNode( element : string|any): void; + + /** To collapse all the TreeView nodes. + * @returns {void} + */ + collapseAll(): void; + + /** To collapse a particular node in TreeView. + * @param {string|any} ID of TreeView node|object of TreeView node + * @returns {void} + */ + collapseNode( element : string|any): void; + + /** To disable the node in the TreeView. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + disableNode( element : string|any): void; + + /** To enable the node in the TreeView. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + enableNode( element : string|any): void; + + /** To ensure that the TreeView node is visible in the TreeView. This method is useful if we need select a TreeView node dynamically. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {boolean} + */ + ensureVisible( element : string|any): boolean; + + /** To expand all the TreeView nodes. + * @returns {void} + */ + expandAll(): void; + + /** To expandNode particular node in TreeView. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + expandNode( element : string|any): void; + + /** To get currently checked nodes in TreeView. + * @returns {any} + */ + getCheckedNodes(): any; + + /** To get currently checked nodes indexes in TreeView. + * @returns {Array} + */ + getCheckedNodesIndex(): Array; + + /** To get number of nodes in TreeView. + * @returns {number} + */ + getNodeCount(): number; + + /** To get currently expanded nodes in TreeView. + * @returns {any} + */ + getExpandedNodes(): any; + + /** To get currently expanded nodes indexes in TreeView. + * @returns {Array} + */ + getExpandedNodesIndex(): Array; + + /** To get TreeView node by using index position in TreeView. + * @param {number} Index position of TreeView node + * @returns {any} + */ + getNodeByIndex( index : number): any; + + /** To get TreeView node data such as id, text, parentId, selected, checked, expanded, level, childs and index. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {any} + */ + getNode(element: string|any): any; + + /** To get current index position of TreeView node. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {number} + */ + getNodeIndex(element : string|any): number; + + /** To get immediate parent TreeView node of particular TreeView node. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {any} + */ + getParent(element : string|any): any; + + /** To get the currently selected node in TreeView. + * @returns {any} + */ + getSelectedNode(): any; + + /** To get the index position of currently selected node in TreeView. + * @returns {number} + */ + getSelectedNodeIndex(): number; + + /** To get the text of a node in TreeView. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {string} + */ + getText( element : string|any): string; + + /** To get the updated datasource of TreeView after performing some operation like drag and drop, node editing, adding and removing node. + * @returns {Array} + */ + getTreeData(): Array; + + /** To get currently visible nodes in TreeView. + * @returns {any} + */ + getVisibleNodes(): any; + + /** To check a node having child or not. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {boolean} + */ + hasChildNode( element : string|any): boolean; + + /** To show nodes in TreeView. + * @returns {void} + */ + hide(): void; + + /** To hide particular node in TreeView. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + hideNode( element : string|any): void; + + /** To add a Node or collection of nodes after the particular TreeView node. + * @param {string|any} New node text or JSON object + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + insertAfter( newNodeText : string|any, target : string|any): void; + + /** To add a Node or collection of nodes before the particular TreeView node. + * @param {string|any} New node text or JSON object + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + insertBefore( newNodeText : string|any, target : string|any): void; + + /** To check the given TreeView node is checked or unchecked. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {boolean} + */ + isNodeChecked( element : string|any): boolean; + + /** To check whether the child nodes are loaded of the given TreeView node. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {boolean} + */ + isChildLoaded( element : string|any): boolean; + + /** To check the given TreeView node is disabled or enabled. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {boolean} + */ + isDisabled( element : string|any): boolean; + + /** To check the given node is exist in TreeView. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {boolean} + */ + isExist( element : string|any): boolean; + + /** To get the expand status of the given TreeView node. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {boolean} + */ + isExpanded( element : string|any): boolean; + + /** To get the select status of the given TreeView node. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {boolean} + */ + isSelected( element : string|any): boolean; + + /** To get the visibility status of the given TreeView node. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {boolean} + */ + isVisible( element : string|any): boolean; + + /** To load the TreeView nodes from the particular URL. If target tree node is specified, then the given nodes are added as child of target tree node, otherwise nodes are added in TreeView. + * @param {string} URL location, the data returned from the URL will be loaded in TreeView + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + loadData( URL : string, target : string|any): void; + + /** To move the TreeView node with in same TreeView. The new poistion of given TreeView node will be based on destionation node and index position. + * @param {string|any} ID of TreeView node/object of TreeView node + * @param {string|any} ID of TreeView node/object of TreeView node + * @param {number} New index position of given source node + * @returns {void} + */ + moveNode( sourceNode : string|any, destinationNode : string|any, index : number): void; + + /** To refresh the TreeView + * @returns {void} + */ + refresh(): void; + + /** To remove all the nodes in TreeView. + * @returns {void} + */ + removeAll(): void; + + /** To remove a node in TreeView. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + removeNode( element : string|any): void; + + /** To select a node in TreeView. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + selectNode( element : string|any): void; + + /** To show nodes in TreeView. + * @returns {void} + */ + show(): void; + + /** To show a node in TreeView. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + showNode( element : string|any): void; + + /** To uncheck all the nodes in TreeView. + * @returns {void} + */ + unCheckAll(): void; + + /** To uncheck a node in TreeView. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + uncheckNode( element : string|any): void; + + /** To unselect the node in the TreeView. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + unselectNode( element : string|any): void; + + /** To edit or update the text of the TreeView node. + * @param {string|any} ID of TreeView node/object of TreeView node + * @param {string} New text + * @returns {void} + */ + updateText( target : string|any, newText : string): void; +} +export module TreeView{ + +export interface Model { + + /**Gets or sets a value that indicates whether to enable drag and drop a node within the same tree. + * @Default {false} + */ + allowDragAndDrop?: boolean; + + /**Gets or sets a value that indicates whether to enable drag and drop a node in inter ej.TreeView. + * @Default {true} + */ + allowDragAndDropAcrossControl?: boolean; + + /**Gets or sets a value that indicates whether to drop a node to a sibling of particular node. + * @Default {true} + */ + allowDropSibling?: boolean; + + /**Gets or sets a value that indicates whether to drop a node to a child of particular node. + * @Default {true} + */ + allowDropChild?: boolean; + + /**Gets or sets a value that indicates whether to enable node editing support for TreeView. + * @Default {false} + */ + allowEditing?: boolean; + + /**Gets or sets a value that indicates whether to enable keyboard support for TreeView actions like nodeSelection, nodeEditing, nodeExpand, nodeCollapse, nodeCut and Paste. + * @Default {true} + */ + allowKeyboardNavigation?: boolean; + + /**Allow us to specify the parent and child nodes to get auto check while we check or uncheck a node. + * @Default {true} + */ + autoCheck?: boolean; + + /**Allow us to specify the parent node to be retain in checked or unchecked state instead of going for indeterminate state. + * @Default {false} + */ + autoCheckParentNode?: boolean; + + /**Gets or sets a value that indicates the checkedNodes index collection as an array. The given array index position denotes the nodes, that are checked while rendering TreeView. + * @Default {[]} + */ + checkedNodes?: Array; + + /**Sets the root CSS class for TreeView which allow us to customize the appearance. + */ + cssClass?: string; + + /**Gets or sets a value that indicates whether to enable or disable the animation effect while expanding or collapsing a node. + * @Default {true} + */ + enableAnimation?: boolean; + + /**Gets or sets a value that indicates whether a TreeView can be enabled or disabled. No actions can be performed while this property is set as false + * @Default {true} + */ + enabled?: boolean; + + /**Allow us to prevent multiple nodes to be in expanded state. If it set to false, previously expanded node will be collapsed automatically, while we expand a node. + * @Default {true} + */ + enableMultipleExpand?: boolean; + + /**Sets a value that indicates whether to persist the TreeView model state in page using applicable medium i.e., HTML5 localStorage or cookies + * @Default {false} + */ + enablePersistence?: boolean; + + /**Gets or sets a value that indicates to align content in the TreeView control from right to left by setting the property as true. + * @Default {false} + */ + enableRTL?: boolean; + + /**Gets or sets a array of value that indicates the expandedNodes index collection as an array. The given array index position denotes the nodes, that are expanded while rendering TreeView. + * @Default {[]} + */ + expandedNodes?: Array; + + /**Gets or sets a value that indicates the TreeView node can be expand or collapse by using the specified action. + * @Default {dblclick} + */ + expandOn?: string; + + /**Gets or sets a fields object that allow us to map the data members with field properties in order to make the data binding easier. + * @Default {null} + */ + fields?: Fields; + + /**Defines the height of the TreeView. + * @Default {Null} + */ + height?: string|number; + + /**Specifies the HTML Attributes for the TreeView. Using this API we can add custom attributes in TreeView control. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Specifies the child nodes to be loaded on demand + * @Default {false} + */ + loadOnDemand?: boolean; + + /**Gets or Sets a value that indicates the index position of a tree node. The particular index tree node will be selected while rendering the TreeView. + * @Default {-1} + */ + selectedNode?: number; + + /**Gets or sets a value that indicates whether to display or hide checkbox for all TreeView nodes. + * @Default {false} + */ + showCheckbox?: boolean; + + /**By using sortSettings property, you can customize the sorting option in TreeView control. + */ + sortSettings?: SortSettings; + + /**Allow us to use custom template in order to create TreeView. + * @Default {null} + */ + template?: string; + + /**Defines the width of the TreeView. + * @Default {Null} + */ + width?: string|number; + + /**Fires before adding node to TreeView.*/ + beforeAdd? (e: BeforeAddEventArgs): void; + + /**Fires before collapse a node.*/ + beforeCollapse? (e: BeforeCollapseEventArgs): void; + + /**Fires before cut node in TreeView.*/ + beforeCut? (e: BeforeCutEventArgs): void; + + /**Fires before deleting node in TreeView.*/ + beforeDelete? (e: BeforeDeleteEventArgs): void; + + /**Fires before editing the node in TreeView.*/ + beforeEdit? (e: BeforeEditEventArgs): void; + + /**Fires before expanding the node.*/ + beforeExpand? (e: BeforeExpandEventArgs): void; + + /**Fires before loading nodes to TreeView.*/ + beforeLoad? (e: BeforeLoadEventArgs): void; + + /**Fires before paste node in TreeView.*/ + beforePaste? (e: BeforePasteEventArgs): void; + + /**Fires before selecting node in TreeView.*/ + beforeSelect? (e: BeforeSelectEventArgs): void; + + /**Fires when TreeView created successfully.*/ + create? (e: CreateEventArgs): void; + + /**Fires when TreeView destroyed successfully.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires before nodeEdit Successful.*/ + inlineEditValidation? (e: InlineEditValidationEventArgs): void; + + /**Fires when key pressed successfully.*/ + keyPress? (e: KeyPressEventArgs): void; + + /**Fires when data load fails.*/ + loadError? (e: LoadErrorEventArgs): void; + + /**Fires when data loaded successfully.*/ + loadSuccess? (e: LoadSuccessEventArgs): void; + + /**Fires once node added successfully.*/ + nodeAdd? (e: NodeAddEventArgs): void; + + /**Fires once node checked successfully.*/ + nodeCheck? (e: NodeCheckEventArgs): void; + + /**Fires when node clicked successfully.*/ + nodeClick? (e: NodeClickEventArgs): void; + + /**Fires when node collapsed successfully.*/ + nodeCollapse? (e: NodeCollapseEventArgs): void; + + /**Fires when node cut successfully.*/ + nodeCut? (e: NodeCutEventArgs): void; + + /**Fires when node deleted successfully.*/ + nodeDelete? (e: NodeDeleteEventArgs): void; + + /**Fires when node dragging.*/ + nodeDrag? (e: NodeDragEventArgs): void; + + /**Fires once node drag start successfully.*/ + nodeDragStart? (e: NodeDragStartEventArgs): void; + + /**Fires before the dragged node to be dropped.*/ + nodeDragStop? (e: NodeDragStopEventArgs): void; + + /**Fires once node dropped successfully.*/ + nodeDropped? (e: NodeDroppedEventArgs): void; + + /**Fires once node edited successfully.*/ + nodeEdit? (e: NodeEditEventArgs): void; + + /**Fires once node expanded successfully.*/ + nodeExpand? (e: NodeExpandEventArgs): void; + + /**Fires once node pasted successfully.*/ + nodePaste? (e: NodePasteEventArgs): void; + + /**Fires when node selected successfully.*/ + nodeSelect? (e: NodeSelectEventArgs): void; + + /**Fires once node unchecked successfully.*/ + nodeUncheck? (e: NodeUncheckEventArgs): void; +} + +export interface BeforeAddEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the given new node data + */ + data ?: string|any; + + /**returns the parent element, the given new nodes to be appended to the given parent element + */ + targetParent ?: any; + + /**returns the given parent node details + */ + parentDetails ?: any; +} + +export interface BeforeCollapseEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the value of the node + */ + value ?: string; + + /**returns the current element of the node clicked + */ + currentElement ?: any; + + /**returns the child nodes are loaded or not + */ + isChildLoaded ?: boolean; + + /**returns the id of currently clicked node + */ + id ?: string; + + /**returns the parent id of currently clicked node + */ + parentId ?: string; + + /**returns the format asynchronous or synchronous + */ + async ?: boolean; +} + +export interface BeforeCutEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the event object + */ + event ?: any; + + /**returns the target element, the given node to be cut + */ + target ?: any; + + /**returns the given target node values + */ + nodeDetails ?: any; + + /**returns the keypressed keycode value + */ + keyCode ?: number; +} + +export interface BeforeDeleteEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the event object + */ + event ?: any; + + /**returns the target element, the given node to be deleted + */ + target ?: any; + + /**returns the given target node values + */ + nodeDetails ?: any; + + /**returns the current parent element of the target node + */ + parentElement ?: any; + + /**returns the parent node values + */ + parentDetails ?: any; +} + +export interface BeforeEditEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the current element of the node clicked + */ + currentElement ?: any; +} + +export interface BeforeExpandEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the value of the node + */ + value ?: string; + + /**if the child node is ready to expanded state; otherwise, false. + */ + isChildLoaded ?: boolean; + + /**returns the current element of the node clicked + */ + currentElement ?: any; + + /**returns the id of currently clicked node + */ + id ?: string; + + /**returns the parent id of currently clicked node + */ + parentId ?: string; + + /**returns the format asynchronous or synchronous + */ + async ?: boolean; +} + +export interface BeforeLoadEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the AJAX settings object + */ + ajaxOptions ?: any; +} + +export interface BeforePasteEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the event object + */ + event ?: any; + + /**returns the target element, the given node to be pasted + */ + target ?: any; + + /**returns the given target node values + */ + nodeDetails ?: any; + + /**returns the keypressed keycode value + */ + keyCode ?: number; +} + +export interface BeforeSelectEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the target element, the given node to be selected + */ + target ?: any; + + /**returns the given target node values + */ + nodeDetails ?: any; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; +} + +export interface InlineEditValidationEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the new entered text for the node + */ + newText ?: string; + + /**returns the current node element id + */ + id ?: any; + + /**returns the old node text + */ + oldText ?: string; +} + +export interface KeyPressEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the event object + */ + event ?: any; + + /**returns the current element of the node clicked + */ + currentElement ?: any; + + /**returns the value of the node + */ + value ?: string; + + /**returns node path from root element + */ + path ?: string; + + /**returns the keypressed keycode value + */ + keyCode ?: number; + + /**it returns when the current node is in expanded state; otherwise, false. + */ + isExpanded ?: boolean; +} + +export interface LoadErrorEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the AJAX error object + */ + error ?: any; +} + +export interface LoadSuccessEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the success data from the URL + */ + data ?: any; + + /**returns the target parent element, the data returned from the URL to be appended to the given parent element, else in TreeView + */ + targetParent ?: any; + + /**returns the given parent node details + */ + parentDetails ?: any; +} + +export interface NodeAddEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the added data, that are given initially + */ + data ?: any; + + /**returns the newly added elements + */ + nodes ?: any; + + /**returns the target parent element of the added element + */ + parentElement ?: any; + + /**returns the given parent node details + */ + parentDetails ?: any; +} + +export interface NodeCheckEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the event object + */ + event ?: any; + + /**returns the value of the node + */ + value ?: string; + + /**returns the id of the current element of the node clicked + */ + id ?: string; + + /**returns the id of the parent element of current element of the node clicked + */ + parentId ?: string; + + /**returns the current element of the node clicked + */ + currentElement ?: any; + + /**it returns true when the node checkbox is checked; otherwise, false. + */ + isChecked ?: boolean; + + /**it returns the currently checked node name + */ + currentNode ?: Array; + + /**it returns the currently checked and its child node details + */ + currentCheckedNodes ?: Array; +} + +export interface NodeClickEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the event object + */ + event ?: any; + + /**returns the current element of the node clicked + */ + currentElement ?: any; + + /**returns the id of current element + */ + id ?: string; + + /**returns the parentId of current element + */ + parentId ?: string; +} + +export interface NodeCollapseEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the id of the current element of the node clicked + */ + id ?: string; + + /**returns the name of the event + */ + type ?: string; + + /**returns the id of the parent element of current element of the node clicked + */ + parentId ?: string; + + /**returns the value of the node + */ + value ?: string; + + /**returns the current element of the node clicked + */ + currentElement ?: any; + + /**returns the child nodes are loaded or not + */ + isChildLoaded ?: boolean; + + /**returns the format asynchronous or synchronous + */ + async ?: boolean; +} + +export interface NodeCutEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the event object + */ + event ?: any; + + /**returns the current parent element of the cut node + */ + parentElement ?: any; + + /**returns the given parent node details + */ + parentDetails ?: any; + + /**returns the keypressed keycode value + */ + keyCode ?: number; +} + +export interface NodeDeleteEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the event object + */ + event ?: any; + + /**returns the current parent element of the deleted node + */ + parentElement ?: any; + + /**returns the given parent node details + */ + parentDetails ?: any; +} + +export interface NodeDragEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the original drag target + */ + dragTarget ?: any; + + /**returns the current target TreeView node + */ + target ?: any; + + /**returns the current target details + */ + targetElementData ?: any; + + /**returns the current parent element of the target node + */ + draggedElement ?: any; + + /**returns the given parent node details + */ + draggedElementData ?: any; + + /**returns the event object + */ + event ?: any; +} + +export interface NodeDragStartEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the original drag target + */ + dragTarget ?: any; + + /**returns the current dragging parent TreeView node + */ + parentElement ?: any; + + /**returns the current dragging parent TreeView node details + */ + parentElementData ?: any; + + /**returns the current parent element of the dragging node + */ + target ?: any; + + /**returns the given parent node details + */ + targetElementData ?: any; + + /**returns the event object + */ + event ?: any; +} + +export interface NodeDragStopEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the original drop target + */ + dropTarget ?: any; + + /**returns the current dragged TreeView node + */ + draggedElement ?: any; + + /**returns the current dragged TreeView node details + */ + draggedElementData ?: any; + + /**returns the current parent element of the dragged node + */ + target ?: any; + + /**returns the given parent node details + */ + targetElementData ?: any; + + /**returns the drop position such as before, after or over + */ + position ?: string; + + /**returns the event object + */ + event ?: any; +} + +export interface NodeDroppedEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the original drop target + */ + dropTarget ?: any; + + /**returns the current dropped TreeView node + */ + droppedElement ?: any; + + /**returns the current dropped TreeView node details + */ + droppedElementData ?: any; + + /**returns the current parent element of the dropped node + */ + target ?: any; + + /**returns the given parent node details + */ + targetElementData ?: any; + + /**returns the drop position such as before, after or over + */ + position ?: string; + + /**returns the event object + */ + event ?: any; +} + +export interface NodeEditEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the id of the element + */ + id ?: string; + + /**returns the oldText of the element + */ + oldText ?: string; + + /**returns the newText of the element + */ + newText ?: string; + + /**returns the event object + */ + event ?: any; + + /**returns the target element, the given node to be cut + */ + target ?: any; + + /**returns the given target node values + */ + nodeDetails ?: any; +} + +export interface NodeExpandEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the value of the node + */ + value ?: string; + + /**if the child node is ready to expanded state; otherwise, false. + */ + isChildLoaded ?: boolean; + + /**returns the current element of the node clicked + */ + currentElement ?: any; + + /**returns the id of currently clicked node + */ + id ?: string; + + /**returns the parent id of currently clicked node + */ + parentId ?: string; + + /**returns the format asynchronous or synchronous + */ + async ?: boolean; +} + +export interface NodePasteEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the event object + */ + event ?: any; + + /**returns the pasted element + */ + target ?: any; + + /**returns the given target node values + */ + nodeDetails ?: any; + + /**returns the keypressed keycode value + */ + keyCode ?: number; +} + +export interface NodeSelectEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the id of the current element of the node clicked + */ + id ?: any; + + /**returns the id of the parent element of current element of the node clicked + */ + parentId ?: any; + + /**returns the value of the node + */ + value ?: string; + + /**returns the current element of the node clicked + */ + currentElement ?: any; +} + +export interface NodeUncheckEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the event object + */ + event ?: any; + + /**returns the id of the current element of the node clicked + */ + id ?: any; + + /**returns the id of the parent element of current element of the node clicked + */ + parentId ?: any; + + /**returns the value of the node + */ + value ?: string; + + /**returns the current element of the node clicked + */ + currentElement ?: any; + + /**it returns true when the node checkbox is checked; otherwise, false. + */ + isChecked ?: boolean; + + /**it returns currently unchecked node name + */ + currentNode ?: string; + + /**it returns currently unchecked node and its child node details. + */ + currentUncheckedNodes ?: Array; +} + +export interface Fields { + + /**It receives the child level or inner level data source such as Essential DataManager object and JSON object. + */ + child?: any; + + /**It receives Essential DataManager object and JSON object. + */ + dataSource?: any; + + /**Specifies the node to be in expanded state. + */ + expanded?: boolean; + + /**Its allow us to indicate whether the node has child or not in load on demand + */ + hasChild?: boolean; + + /**Specifies the html attributes to “li” item list. + */ + htmlAttribute?: any; + + /**Specifies the id to TreeView node items list. + */ + id?: string; + + /**Specifies the image attribute to “img” tag inside items list + */ + imageAttribute?: any; + + /**Specifies the html attributes to “li” item list. + */ + imageUrl?: string; + + /**If its true Checkbox node will be checked when rendered with checkbox. + */ + isChecked?: boolean; + + /**Specifies the link attribute to “a” tag in item list. + */ + linkAttribute?: any; + + /**Specifies the parent id of the node. The nodes are listed as child nodes of the specified parent node by using its parent id. + */ + parentId?: string; + + /**It receives query to retrieve data from the table (query is same as SQL). + */ + query?: any; + + /**Allow us to specify the node to be in selected state + */ + selected?: boolean; + + /**Specifies the sprite CSS class to “li” item list. + */ + spriteCssClass?: string; + + /**It receives the table name to execute query on the corresponding table. + */ + tableName?: string; + + /**Specifies the text of TreeView node items list. + */ + text?: string; +} + +export interface SortSettings { + + /**Enables or disables the sorting option in TreeView control + * @Default {false} + */ + allowSorting?: boolean; + + /**Sets the sorting order type. There are two sorting types available, such as "ascending", "descending". + * @Default {ej.sortOrder.Ascending} + */ + sortOrder?: ej.sortOrder|string; +} +} +enum sortOrder +{ +//Enum for Ascending sort order +Ascending, +//Enum for Descending sort order +Descending, +} + +class Uploadbox extends ej.Widget { + static fn: Uploadbox; + constructor(element: JQuery, options?: Uploadbox.Model); + constructor(element: Element, options?: Uploadbox.Model); + model:Uploadbox.Model; + defaults:Uploadbox.Model; + + /** The destroy method destroys the control and brings the control to a pre-init state. All the events of the Upload control is bound by using this._on unbinds automatically. + * @returns {void} + */ + destroy(): void; + + /** Disables the Uploadbox control + * @returns {void} + */ + disable(): void; + + /** Enables the Uploadbox control + * @returns {void} + */ + enable(): void; +} +export module Uploadbox{ + +export interface Model { + + /**Enables the file drag and drop support to the Uploadbox control. + * @Default {false} + */ + allowDragAndDrop?: boolean; + + /**Uploadbox supports both synchronous and asynchronous upload. This can be achieved by using the asyncUpload property. + * @Default {true} + */ + asyncUpload?: boolean; + + /**Uploadbox supports auto uploading of files after the file selection is done. + * @Default {false} + */ + autoUpload?: boolean; + + /**Sets the text for each action button. + * @Default {{browse: Browse, upload: Upload, cancel: Cancel, close: Close}} + */ + buttonText?: ButtonText; + + /**Sets the root class for the Uploadbox control theme. This cssClass API helps to use custom skinning option for the Uploadbox button and dialog content. + */ + cssClass?: string; + + /**Specifies the custom file details in the dialog popup on initialization. + * @Default {{ title:true, name:true, size:true, status:true, action:true}} + */ + customFileDetails?: CustomFileDetails; + + /**Specifies the actions for dialog popup while initialization. + * @Default {{ modal:false, closeOnComplete:false, content:null, drag:true}} + */ + dialogAction?: DialogAction; + + /**Displays the Uploadbox dialog at the given X and Y positions. X: Dialog sets the left position value. Y: Dialog sets the top position value. + * @Default {null} + */ + dialogPosition?: any; + + /**Property for applying the text to the Dialog title and content headers. + * @Default {{ title: Upload Box, name: Name, size: Size, status: Status}} + */ + dialogText?: DialogText; + + /**The dropAreaText is displayed when the draganddrop support is enabled in the Uploadbox control. + * @Default {Drop files or click to upload} + */ + dropAreaText?: string; + + /**Specifies the dropAreaHeight when the draganddrop support is enabled in the Uploadbox control. + * @Default {100%} + */ + dropAreaHeight?: number|string; + + /**Specifies the dropAreaWidth when the draganddrop support is enabled in the Uploadbox control. + * @Default {100%} + */ + dropAreaWidth?: number|string; + + /**Based on the property value, Uploadbox is enabled or disabled. + * @Default {true} + */ + enabled?: boolean; + + /**Sets the right-to-left direction property for the Uploadbox control. + * @Default {false} + */ + enableRTL?: boolean; + + /**Only the files with the specified extension is allowed to upload. This is mentioned in the string format. + */ + extensionsAllow?: string; + + /**Only the files with the specified extension is denied for upload. This is mentioned in the string format. + */ + extensionsDeny?: string; + + /**Sets the maximum size limit for uploading the file. This is mentioned in the number format. + * @Default {31457280} + */ + fileSize?: number; + + /**Sets the height of the browse button. + * @Default {35px} + */ + height?: string; + + /**Configures the culture data and sets the culture to the Uploadbox. + * @Default {en-US} + */ + locale?: string; + + /**Enables multiple file selection for upload. + * @Default {true} + */ + multipleFilesSelection?: boolean; + + /**You can push the file to the Uploadbox in the client-side of the XHR supported browsers alone. + * @Default {null} + */ + pushFile?: any; + + /**Specifies the remove action to be performed after the file uploading is completed. Here, mention the server address for removal. + */ + removeUrl?: string; + + /**Specifies the save action to be performed after the file is pushed for uploading. Here, mention the server address to be saved. + */ + saveUrl?: string; + + /**Enables the browse button support to the Uploadbox control. + * @Default {true} + */ + showBrowseButton?: boolean; + + /**Specifies the file details to be displayed when selected for uploading. This can be done when the showFileDetails is set to true. + * @Default {true} + */ + showFileDetails?: boolean; + + /**Sets the name for the Uploadbox control. This API helps to Map the action in code behind to retrieve the files. + */ + uploadName?: string; + + /**Sets the width of the browse button. + * @Default {100px} + */ + width?: string; + + /**Fires when the upload progress begins.*/ + begin? (e: BeginEventArgs): void; + + /**Fires when the upload progress is cancelled.*/ + cancel? (e: CancelEventArgs): void; + + /**Fires when the file upload progress is completed.*/ + complete? (e: CompleteEventArgs): void; + + /**Fires when the file upload progress is completed.*/ + success? (e: SuccessEventArgs): void; + + /**Fires when the Uploadbox control is created.*/ + create? (e: CreateEventArgs): void; + + /**Fires when the Uploadbox control is destroyed.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires when the Upload process ends in Error.*/ + error? (e: ErrorEventArgs): void; + + /**Fires when the file is selected for upload successfully.*/ + fileSelect? (e: FileSelectEventArgs): void; + + /**Fires when the uploaded file is removed successfully.*/ + remove? (e: RemoveEventArgs): void; +} + +export interface BeginEventArgs { + + /**To pass additional information to the server. + */ + data?: any; + + /**Selected FileList Object. + */ + files?: any; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Uploadbox model + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface CancelEventArgs { + + /**Canceled FileList Object. + */ + fileStatus?: any; + + /**returns the Uploadbox model + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface CompleteEventArgs { + + /**AJAX event argument for reference. + */ + e?: any; + + /**Uploaded file list. + */ + files?: any; + + /**response from the server. + */ + responseText?: string; + + /**XHR-AJAX Object for reference. + */ + xhr?: any; + + /**returns the Uploadbox model + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface SuccessEventArgs { + + /**response from the server. + */ + responseText?: string; + + /**AJAX event argument for reference. + */ + e?: any; + + /**successfully uploaded files list. + */ + success?: any; + + /**Uploaded file list. + */ + files?: any; + + /**XHR-AJAX Object for reference. + */ + xhr?: any; + + /**returns the Uploadbox model + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface CreateEventArgs { + + /**returns the Uploadbox model + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**returns the Uploadbox model + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface ErrorEventArgs { + + /**details about the error information. + */ + error?: string; + + /**returns the name of the event. + */ + type?: string; + + /**error event action details. + */ + action?: string; + + /**returns the file details of the file uploaded + */ + files?: any; +} + +export interface FileSelectEventArgs { + + /**returns Selected FileList objects + */ + files?: any; + + /**returns the Uploadbox model + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RemoveEventArgs { + + /**returns the Uploadbox model + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns the file details of the file object + */ + fileStatus?: any; +} + +export interface ButtonText { + + /**Sets the text for the browse button. + */ + browse?: string; + + /**Sets the text for the cancel button. + */ + cancel?: string; + + /**Sets the text for the close button. + */ + Close?: string; + + /**Sets the text for the Upload button inside the dialog popup. + */ + upload?: string; +} + +export interface CustomFileDetails { + + /**Enables the file upload interactions like remove/cancel in File details of the dialog popup. + */ + action?: boolean; + + /**Enables the name in the File details of the dialog popup. + */ + name?: boolean; + + /**Enables or disables the File size details of the dialog popup. + */ + size?: boolean; + + /**Enables or disables the file uploading status visibility in the dialog file details content. + */ + status?: boolean; + + /**Enables the title in File details for the dialog popup. + */ + title?: boolean; +} + +export interface DialogAction { + + /**Once uploaded successfully, the dialog popup closes immediately. + */ + closeOnComplete?: boolean; + + /**Sets the content container option to the Uploadbox dialog popup. + */ + content?: string; + + /**Enables the drag option to the dialog popup. + */ + drag?: boolean; + + /**Enables or disables the Uploadbox dialog’s modal property to the dialog popup. + */ + modal?: boolean; +} + +export interface DialogText { + + /**Sets the uploaded file’s Name (header text) to the Dialog popup. + */ + name?: string; + + /**Sets the upload file Size (header text) to the dialog popup. + */ + size?: string; + + /**Sets the upload file Status (header text) to the dialog popup. + */ + status?: string; + + /**Sets the title text of the dialog popup. + */ + title?: string; +} +} + +class WaitingPopup extends ej.Widget { + static fn: WaitingPopup; + constructor(element: JQuery, options?: WaitingPopup.Model); + constructor(element: Element, options?: WaitingPopup.Model); + model:WaitingPopup.Model; + defaults:WaitingPopup.Model; + + /** To hide the waiting popup + * @returns {void} + */ + hide(): void; + + /** Refreshes the WaitingPopup control by resetting the pop-up panel position and content position + * @returns {void} + */ + refresh(): void; + + /** To show the waiting popup + * @returns {void} + */ + show(): void; +} +export module WaitingPopup{ + +export interface Model { + + /**Sets the root class for the WaitingPopup control theme + * @Default {null} + */ + cssClass?: string; + + /**Enables or disables the default loading icon. + * @Default {true} + */ + showImage?: boolean; + + /**Enables the visibility of the WaitingPopup control + * @Default {false} + */ + showOnInit?: boolean; + + /**Loads HTML content inside the popup panel instead of the default icon + * @Default {null} + */ + template?: any; + + /**Sets the custom text in the pop-up panel to notify the waiting process + * @Default {null} + */ + text?: string; + + /**Fires after Create WaitingPopup successfully*/ + create? (e: CreateEventArgs): void; + + /**Fires after Destroy WaitingPopup successfully*/ + destroy? (e: DestroyEventArgs): void; +} + +export interface CreateEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the WaitingPopup model + */ + model?: ej.WaitingPopup.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the WaitingPopup model + */ + model?: ej.WaitingPopup.Model; + + /**returns the name of the event + */ + type?: string; +} +} + +class Grid extends ej.Widget { + static fn: Grid; + constructor(element: JQuery, options?: Grid.Model); + constructor(element: Element, options?: Grid.Model); + model:Grid.Model; + defaults:Grid.Model; + + /** Adds a grid model property which is to be ignored upon exporting. + * @returns {void} + */ + addIgnoreOnExport(): void; + + /** Add a new record in grid control when allowAdding is set as true. + * @returns {void} + */ + addRecord(): void; + + /** Cancel the modified changes in grid control when edit mode is "batch". + * @returns {void} + */ + batchCancel(): void; + + /** Save the modified changes to data source in grid control when edit mode is "batch". + * @returns {void} + */ + batchSave(): void; + + /** Send a cancel request in grid. + * @returns {void} + */ + cancelEdit(): void; + + /** Send a cancel request to the edited cell in grid. + * @returns {void} + */ + cancelEditCell(): void; + + /** It is used to clear all the cell selection. + * @returns {boolean} + */ + clearCellSelection(): boolean; + + /** It is used to clear all the row selection or at specific row selection based on the index provided. + * @param {number} optional If index of the column is specified then it will remove the selection from the particular column else it will clears all of the column selection + * @returns {boolean} + */ + clearColumnSelection(index: number): boolean; + + /** It is used to clear all the filtering done. + * @param {string} If field of the column is specified then it will clear the particular filtering column + * @returns {void} + */ + clearFiltering(field: string): void; + + /** Clear the searching from the grid + * @returns {void} + */ + clearSearching(): void; + + /** Clear all the row selection or at specific row selection based on the index provided + * @param {number} optional If index of the row is specified then it will remove the selection from the particular row else it will clears all of the row selection + * @returns {boolean} + */ + clearSelection(index: number): boolean; + + /** Clear the sorting from columns in the grid + * @returns {void} + */ + clearSorting(): void; + + /** Collapse all the group caption rows in grid + * @returns {void} + */ + collapseAll(): void; + + /** Collapse the group drop area in grid + * @returns {void} + */ + collapseGroupDropArea(): void; + + /** Add or remove columns in grid column collections + * @param {Array|string} Pass array of columns or string of field name to add/remove the column in grid + * @param {string} optional Pass add/remove action to be performed. By default "add" action will perform + * @returns {void} + */ + columns(columnDetails: Array|string, action: string): void; + + /** Refresh the grid with new data source + * @param {Array} Pass new data source to the grid + * @returns {void} + */ + dataSource(datasource: Array): void; + + /** Delete a record in grid control when allowDeleting is set as true + * @param {string} Pass the primary key field Name of the column + * @param {Array} Pass the json data of record need to be delete. + * @returns {void} + */ + deleteRecord(fieldName: string, data: Array): void; + + /** Destroy the grid widget all events bound using this._on will be unbind automatically and bring the control to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** Edit a particular cell based on the row index and field name provided in "batch" edit mode. + * @param {number} Pass row index to edit particular cell + * @param {string} Pass the field name of the column to perform batch edit + * @returns {void} + */ + editCell(index: number, fieldName: string): void; + + /** Send a save request in grid. + * @returns {void} + */ + endEdit(): void; + + /** Expand all the group caption rows in grid. + * @returns {void} + */ + expandAll(): void; + + /** Expand or collapse the row based on the row state in grid + * @param {JQuery} Pass the target object to expand/collapse the row based on its row state + * @returns {HTMLElement} + */ + expandCollapse($target: JQuery): HTMLElement; + + /** Expand the group drop area in grid. + * @returns {void} + */ + expandGroupDropArea(): void; + + /** Export the grid content to excel, word or pdf document. + * @param {string} Pass the controller action name corresponding to exporting + * @param {string} optionalASP server event name corresponding to exporting + * @param {boolean} optionalPass the multiple exporting value as true/false + * @param {Array} optionalPass the array of the gridIds to be filtered + * @returns {void} + */ + export(action: string, serverEvent: string, multipleExport: boolean, gridIds: Array): void; + + /** Send a filtering request to filter one column in grid. + * @param {string} Pass the field name of the column + * @param {string} string/integer/dateTime operator + * @param {string|number} Pass the value to be filtered in a column + * @param {string} Pass the predicate as and/or + * @param {boolean} optional Pass the match case value as true/false + * @returns {void} + */ + filterColumn(fieldName: string, filterOperator: string, filterValue: string|number, predicate: string, matchcase: boolean): void; + + /** Send a filtering request to filter single or multiple column in grid. + * @param {Array} Pass array of filterColumn query for performing filter operation + * @returns {void} + */ + filterColumn(filterQueries: Array): void; + + /** Get the batch changes of edit, delete and add operations of grid. + * @returns {any} + */ + getBatchChanges(): any; + + /** Get the browser details + * @returns {any} + */ + getBrowserDetails(): any; + + /** Get the column details based on the given field in grid + * @param {string} Pass the field name of the column to get the corresponding column object + * @returns {any} + */ + getColumnByField(fieldName: string): any; + + /** Get the column details based on the given header text in grid. + * @param {string} Pass the header text of the column to get the corresponding column object + * @returns {any} + */ + getColumnByHeaderText(headerText: string): any; + + /** Get the column details based on the given column index in grid + * @param {number} Pass the index of the column to get the corresponding column object + * @returns {any} + */ + getColumnByIndex(columnIndex: number): any; + + /** Get the list of field names from column collection in grid. + * @returns {Array} + */ + getColumnFieldNames(): Array; + + /** Get the column index of the given field in grid. + * @param {string} Pass the field name of the column to get the corresponding column index + * @returns {number} + */ + getColumnIndexByField(fieldName: string): number; + + /** Get the content div element of grid. + * @returns {HTMLElement} + */ + getContent(): HTMLElement; + + /** Get the content table element of grid + * @returns {HTMLElement} + */ + getContentTable(): HTMLElement; + + /** Get the data of currently edited cell value in "batch" edit mode + * @returns {any} + */ + getCurrentEditCellData(): any; + + /** Get the current page index in grid pager. + * @returns {number} + */ + getCurrentIndex(): number; + + /** Get the current page data source of grid. + * @returns {Array} + */ + getCurrentViewData(): Array; + + /** Get the column field name from the given header text in grid. + * @param {string} Pass header text of the column to get its corresponding field name + * @returns {string} + */ + getFieldNameByHeaderText(headerText: string): string; + + /** Get the filter bar of grid + * @returns {HTMLElement} + */ + getFilterBar(): HTMLElement; + + /** Get the records filtered or searched in Grid + * @returns {Array} + */ + getFilteredRecords(): Array; + + /** Get the footer content of grid. + * @returns {HTMLElement} + */ + getFooterContent(): HTMLElement; + + /** Get the footer table element of grid. + * @returns {HTMLElement} + */ + getFooterTable(): HTMLElement; + + /** Get the header content div element of grid. + * @returns {HTMLElement} + */ + getHeaderContent(): HTMLElement; + + /** Get the header table element of grid + * @returns {HTMLElement} + */ + getHeaderTable(): HTMLElement; + + /** Get the column header text from the given field name in grid. + * @param {string} Pass field name of the column to get its corresponding header text + * @returns {string} + */ + getHeaderTextByFieldName(field: string): string; + + /** Get the names of all the hidden column collections in grid. + * @returns {Array} + */ + getHiddenColumnNames(): Array; + + /** Get the row index based on the given tr element in grid. + * @param {JQuery} Pass the tr element in grid content to get its row index + * @returns {number} + */ + getIndexByRow($tr: JQuery): number; + + /** Get the pager of grid. + * @returns {HTMLElement} + */ + getPager(): HTMLElement; + + /** Get the names of primary key columns in Grid + * @returns {Array} + */ + getPrimaryKeyFieldNames(): Array; + + /** Get the rows(tr element) from the given from and to row index in grid + * @param {number} Pass the from index from which the rows to be returned + * @param {number} Pass the to index to which the rows to be returned + * @returns {HTMLElement} + */ + getRowByIndex(from: number, to: number): HTMLElement; + + /** Get the row height of grid. + * @returns {number} + */ + getRowHeight(): number; + + /** Get the rows(tr element)of grid which is displayed in the current page. + * @returns {HTMLElement} + */ + getRows(): HTMLElement; + + /** Get the scroller object of grid. + * @returns {any} + */ + getScrollObject(): any; + + /** Get the selected records details in grid. + * @returns {void} + */ + getSelectedRecords(): void; + + /** Get the names of all the visible column collections in grid + * @returns {Array} + */ + getVisibleColumnNames(): Array; + + /** Send a paging request to specified page in grid + * @param {number} Pass the page index to perform paging at specified page index + * @returns {void} + */ + gotoPage(pageIndex: number): void; + + /** Send a column grouping request in grid. + * @param {string} Pass the field Name of the column to be grouped in grid control + * @returns {void} + */ + groupColumn(fieldName: string): void; + + /** Hide columns from the grid based on the header text + * @param {Array|string} you can pass either array of header text of various columns or a header text of a column to hide + * @returns {void} + */ + hideColumns(headerText: Array|string): void; + + /** Print the grid control + * @returns {void} + */ + print(): void; + + /** It is used to refresh and reset the changes made in "batch" edit mode + * @returns {void} + */ + refreshBatchEditChanges(): void; + + /** Refresh the grid contents. The template refreshment is based on the argument passed along with this method + * @param {boolean} optional When templateRefresh is set true, template and grid contents both are refreshed in grid else only grid content is refreshed + * @returns {void} + */ + refreshContent(templateRefresh: boolean): void; + + /** Refresh the template of the grid + * @returns {void} + */ + refreshTemplate(): void; + + /** Refresh the toolbar items in grid. + * @returns {void} + */ + refreshToolbar(): void; + + /** Remove a column or collection of columns from a sorted column collections in grid. + * @param {Array|string} Pass array of field names of the columns to remove a collection of sorted columns or pass a string of field name to remove a column from sorted column collections + * @returns {void} + */ + removeSortedColumns(fieldName: Array|string): void; + + /** Creates a grid control + * @returns {void} + */ + render(): void; + + /** Re-order the column in grid + * @param {string} Pass the from field name of the column needs to be changed + * @param {string} Pass the to field name of the column needs to be changed + * @returns {void} + */ + reorderColumns(fromFieldName: string, toFieldName: string): void; + + /** Reset the model collections like pageSettings, groupSettings, filterSettings, sortSettings and summaryRows. + * @returns {void} + */ + resetModelCollections(): void; + + /** Resize the columns by giving column name and width for the corresponding one. + * @param {string} Pass the column name that needs to be changed + * @param {string} Pass the width to resize the particular columns + * @returns {void} + */ + resizeColumns(column: string, width: string): void; + + /** Resolves row height issue when unbound column is used with FrozenColumn + * @returns {void} + */ + rowHeightRefresh(): void; + + /** Save the particular edited cell in grid. + * @returns {boolean} + */ + saveCell(): boolean; + + /** Set dimension for grid with corresponding to grid parent. + * @returns {void} + */ + setDimension(): void; + + /** Send a request to grid to refresh the width set to columns + * @returns {void} + */ + setWidthToColumns(): void; + + /** Send a search request to grid with specified string passed in it + * @param {string} Pass the string to search in Grid records + * @returns {void} + */ + search(searchString: string): void; + + /** Select cells in grid. + * @param {any} It is used to set the starting index of row and indexes of cells for that corresponding row for selecting cells. + * @returns {void} + */ + selectCells(rowCellIndexes: any): void; + + /** Select columns in grid. + * @param {number} It is used to set the starting index of column for selecting columns. + * @returns {void} + */ + selectColumns(fromIndex: number): void; + + /** Select rows in grid. + * @param {number} It is used to set the starting index of row for selecting rows. + * @param {number} It is used to set the ending index of row for selecting rows. + * @returns {void} + */ + selectRows(fromIndex: number, toIndex: number): void; + + /** Select rows in grid. + * @param {Array} Pass array of rowIndexes for selecting rows + * @returns {void} + */ + selectRows(rowIndexes: Array): void; + + /** Used to update a particular cell value.Note: It will work only for Local Data. + * @returns {void} + */ + setCellText(): void; + + /** Used to update a particular cell value based on specified row Index and the fieldName. + * @param {number} It is used to set the index for selecting the row. + * @param {string} It is used to set the field name for selecting column. + * @param {any} It is used to set the value for the selected cell. + * @returns {void} + */ + setCellValue(Index: number, fieldName: string, value: any): void; + + /** Set validation to a field during editing. + * @param {string} Specify the field name of the column to set validation rules + * @param {any} Specify the validation rules for the field + * @returns {void} + */ + setValidationToField(fieldName: string, rules: any): void; + + /** Show columns in the grid based on the header text + * @param {Array|string} you can pass either array of header text of various columns or a header text of a column to show + * @returns {void} + */ + showColumns(headerText: Array|string): void; + + /** Send a sorting request in grid. + * @param {string} Pass the field name of the column as columnName for which sorting have to be performed + * @param {string} optional Pass the sort direction ascending/descending by which the column have to be sort. By default it is sorting in an ascending order + * @returns {void} + */ + sortColumn(columnName: string, sortingDirection: string): void; + + /** Send an edit record request in grid + * @param {JQuery} Pass the tr- selected row element to be edited in grid + * @returns {HTMLElement} + */ + startEdit($tr: JQuery): HTMLElement; + + /** Un-group a column from grouped columns collection in grid + * @param {string} Pass the field Name of the column to be ungrouped from grouped column collection + * @returns {void} + */ + ungroupColumn(fieldName: string): void; + + /** Update a edited record in grid control when allowEditing is set as true. + * @param {string} Pass the primary key field Name of the column + * @param {Array} Pass the edited json data of record need to be update. + * @returns {void} + */ + updateRecord(fieldName: string, data: Array): void; + + /** It adapts grid to its parent element or to the browsers window. + * @returns {void} + */ + windowonresize(): void; +} +export module Grid{ + +export interface Model { + + /**Gets or sets a value that indicates whether to customizing cell based on our needs. + * @Default {false} + */ + allowCellMerging?: boolean; + + /**Gets or sets a value that indicates whether to enable dynamic grouping behavior. Grouping can be done by drag on drop desired columns to grid’s GroupDropArea. This can be further customized through “groupSettings” property. + * @Default {false} + */ + allowGrouping?: boolean; + + /**Gets or sets a value that indicates whether to enable keyboard support for performing grid actions. selectionType – Gets or sets a value that indicates whether to enable single row or multiple rows selection behavior in grid. Multiple selection can be done through by holding CTRL and clicking the grid rows + * @Default {true} + */ + allowKeyboardNavigation?: boolean; + + /**Gets or sets a value that indicates whether to enable dynamic filtering behavior on grid. Filtering can be used to limit the records displayed using required criteria and this can be further customized through “filterSettings” property + * @Default {false} + */ + allowFiltering?: boolean; + + /**Gets or sets a value that indicates whether to enable the dynamic sorting behavior on grid data. Sorting can be done through clicking on particular column header. + * @Default {false} + */ + allowSorting?: boolean; + + /**Gets or sets a value that indicates whether to enable multi columns sorting behavior in grid. Sort multiple columns by holding CTRL and click on the corresponding column header. + * @Default {false} + */ + allowMultiSorting?: boolean; + + /**This specifies the grid to show the paginated data. Also enables pager control at the bottom of grid for dynamic navigation through data source. Paging can be further customized through “pageSettings” property. + * @Default {false} + */ + allowPaging?: boolean; + + /**Gets or sets a value that indicates whether to enable the columns reordering behavior in the grid. Reordering can be done through by drag and drop the particular column from one index to another index within the grid. + * @Default {false} + */ + allowReordering?: boolean; + + /**Gets or sets a value that indicates whether the column is non resizable. Column width is set automatically based on the content or header text which is large. + * @Default {false} + */ + allowResizeToFit?: boolean; + + /**Gets or sets a value that indicates whether to enable dynamic resizable of columns. Resize the width of the columns by simply click and move the particular column header line + * @Default {false} + */ + allowResizing?: boolean; + + /**Gets or sets a value that indicates whether to enable the scrollbar in the grid and view the records by scroll through the grid manually + * @Default {false} + */ + allowScrolling?: boolean; + + /**Gets or sets a value that indicates whether to enable dynamic searching behavior in grid. Currently search box can be enabled through “toolbarSettings” + * @Default {false} + */ + allowSearching?: boolean; + + /**Gets or sets a value that indicates whether user can select rows on grid. On enabling feature, selected row will be highlighted. + * @Default {true} + */ + allowSelection?: boolean; + + /**Gets or sets a value that indicates whether the Content will wrap to the next line if the content exceeds the boundary of the Column Cells. + * @Default {false} + */ + allowTextWrap?: boolean; + + /**Gets or sets a value that indicates whether to enable the multiple exporting behavior on grid data. + * @Default {false} + */ + allowMultipleExporting?: boolean; + + /**Gets or sets a value that indicates to define common width for all the columns in the grid. + */ + commonWidth?: number; + + /**Gets or sets a value that indicates to enable the visibility of the grid lines. + * @Default {ej.Grid.GridLines.Both} + */ + gridLines?: ej.Grid.GridLines|string; + + /**This specifies the grid to add the grid control inside the grid row of the parent with expand/collapse options + * @Default {null} + */ + childGrid?: any; + + /**Used to enable or disable static width settings for column. If the columnLayout is set as fixed, then column width will be static. + * @Default {ej.Grid.ColumnLayout.Auto} + */ + columnLayout?: ej.Grid.ColumnLayout|string; + + /**Gets or sets an object that indicates to render the grid with specified columns + * @Default {[]} + */ + columns?: Array; + + /**Gets or sets an object that indicates whether to customize the context menu behavior of the grid. + */ + contextMenuSettings?: ContextMenuSettings; + + /**Gets or sets a value that indicates to render the grid with custom theme. allowScrolling – Gets or sets a value that indicates whether to enable the scrollbar in the grid and view the records by scroll through the grid manually + */ + cssClass?: string; + + /**Gets or sets the data to render the grid with records + * @Default {null} + */ + dataSource?: any; + + /**Default Value: + * @Default {null} + */ + detailsTemplate?: string; + + /**Gets or sets an object that indicates whether to customize the editing behavior of the grid. + */ + editSettings?: EditSettings; + + /**Gets or sets a value that indicates whether to enable the alternative rows differentiation in the grid records based on corresponding theme. + * @Default {true} + */ + enableAltRow?: boolean; + + /**Gets or sets a value that indicates whether to enable the save action in the grid through row selection + * @Default {true} + */ + enableAutoSaveOnSelectionChange?: boolean; + + /**Gets or sets a value that indicates whether to enable mouse over effect on the corresponding column header cell of the grid + * @Default {false} + */ + enableHeaderHover?: boolean; + + /**Gets or sets a value that indicates whether to persist the grid model state in page using applicable medium i.e., HTML5 localStorage or cookies + * @Default {false} + */ + enablePersistence?: boolean; + + /**Gets or sets a value that indicates whether the grid rows has to be rendered as detail view in mobile mode + * @Default {false} + */ + enableResponsiveRow?: boolean; + + /**Gets or sets a value that indicates whether to enable mouse over effect on corresponding grid row. + * @Default {true} + */ + enableRowHover?: boolean; + + /**Align content in the grid control from right to left by setting the property as true. + * @Default {false} + */ + enableRTL?: boolean; + + /**To Disable the mouse swipe property as false. + * @Default {true} + */ + enableTouch?: boolean; + + /**Gets or sets an object that indicates whether to customize the filtering behavior of the grid + */ + filterSettings?: FilterSettings; + + /**Gets or sets an object that indicates whether to customize the grouping behavior of the grid. + */ + groupSettings?: GroupSettings; + + /**Gets or sets an object that indicates whether to auto wrap the grid header or content or both + */ + textWrapSettings?: TextWrapSettings; + + /**Gets or sets a value that indicates whether the grid design has be to made responsive. + * @Default {false} + */ + isResponsive?: boolean; + + /**This specifies to change the key in keyboard interaction to grid control + * @Default {null} + */ + keySettings?: any; + + /**Gets or sets a value that indicates whether to customizing the user interface (UI) as locale-specific in order to display regional data i.e. in a language and culture specific to a particular country or region. + * @Default {en-US} + */ + locale?: string; + + /**Gets or sets a value that indicates whether to set the minimum width of the responsive grid while isResponsive property is true and enableResponsiveRow property is set as false. + * @Default {0} + */ + minWidth?: number; + + /**Gets or sets an object that indicates whether to modify the pager default configuration. + */ + pageSettings?: PageSettings; + + /**Query the dataSource from the table for Grid. + * @Default {null} + */ + query?: any; + + /**Gets or sets a value that indicates to render the grid with template rows. The template row must be a table row. That table row must have the JavaScript render binding format ({{:columnName}}) then the grid data source binds the data to the corresponding table row of the template. + * @Default {null} + */ + rowTemplate?: string; + + /**Gets or sets an object that indicates whether to customize the scrolling behavior of the grid. + */ + scrollSettings?: ScrollSettings; + + /**Gets or sets an object that indicates whether to customize the searching behavior of the grid + */ + searchSettings?: SearchSettings; + + /**Gets a value that indicates whether the grid model to hold multiple selected records . selectedRecords can be used to displayed hold the single or multiple selected records using “selectedRecords” property + * @Default {null} + */ + selectedRecords?: Array; + + /**Gets or sets a value that indicates to select the row while initializing the grid + * @Default {-1} + */ + selectedRowIndex?: number; + + /**This property is used to configure the selection behavior of the grid. + */ + selectionSettings?: SelectionSettings; + + /**The row selection behavior of grid. Accepting types are "single" and "multiple". + * @Default {ej.Grid.SelectionType.Single} + */ + selectionType?: ej.Grid.SelectionType|string; + + /**This specifies to add new editable row dynamically at the either top or bottom of the grid. + * @Default {false} + */ + showAddNewRow?: boolean; + + /**Default Value: + * @Default {false} + */ + showColumnChooser?: boolean; + + /**Default Value: + * @Default {true} + */ + showInColumnChooser?: boolean; + + /**Gets or sets a value that indicates stacked header should be shown on grid layout when the property “stackedHeaderRows” is set. + * @Default {false} + */ + showStackedHeader?: boolean; + + /**Gets or sets a value that indicates summary rows should be shown on grid layout when the property “summaryRows” is set + * @Default {false} + */ + showSummary?: boolean; + + /**Gets or sets a value that indicates whether to customize the sorting behavior of the grid. + */ + sortSettings?: SortSettings; + + /**Gets or sets an object that indicates to managing the collection of stacked header rows for the grid. + * @Default {[]} + */ + stackedHeaderRows?: Array; + + /**Gets or sets an object that indicates to managing the collection of summary rows for the grid. + * @Default {[]} + */ + summaryRows?: Array; + + /**Gets or sets an object that indicates whether to enable the toolbar in the grid and add toolbar items + */ + toolbarSettings?: ToolbarSettings; + + /**Triggered for every grid action before its starts.*/ + actionBegin? (e: ActionBeginEventArgs): void; + + /**Triggered for every grid action success event.*/ + actionComplete? (e: ActionCompleteEventArgs): void; + + /**Triggered for every grid action server failure event.*/ + actionFailure? (e: ActionFailureEventArgs): void; + + /**Triggered when record batch add.*/ + batchAdd? (e: BatchAddEventArgs): void; + + /**Triggered when record batch delete.*/ + batchDelete? (e: BatchDeleteEventArgs): void; + + /**Triggered before the batch add.*/ + beforeBatchAdd? (e: BeforeBatchAddEventArgs): void; + + /**Triggered before the batch delete.*/ + beforeBatchDelete? (e: BeforeBatchDeleteEventArgs): void; + + /**Triggered before the batch save.*/ + beforeBatchSave? (e: BeforeBatchSaveEventArgs): void; + + /**Triggered before the record is going to be edited.*/ + beginEdit? (e: BeginEditEventArgs): void; + + /**Triggered when record cell edit.*/ + cellEdit? (e: CellEditEventArgs): void; + + /**Triggered when record cell save.*/ + cellSave? (e: CellSaveEventArgs): void; + + /**Triggered after the cell is selected.*/ + cellSelected? (e: CellSelectedEventArgs): void; + + /**Triggered before the cell is going to be selected.*/ + cellSelecting? (e: CellSelectingEventArgs): void; + + /**Triggered when the column is being dragged.*/ + columnDrag? (e: ColumnDragEventArgs): void; + + /**Triggered when column dragging begins.*/ + columnDragStart? (e: ColumnDragStartEventArgs): void; + + /**Triggered when the column is dropped.*/ + columnDrop? (e: ColumnDropEventArgs): void; + + /**Triggered after the column is selected.*/ + columnSelected? (e: ColumnSelectedEventArgs): void; + + /**Triggered before the column is going to be selected.*/ + columnSelecting? (e: ColumnSelectingEventArgs): void; + + /**Triggered when context menu item is clicked*/ + contextClick? (e: ContextClickEventArgs): void; + + /**Triggered before the context menu is opened.*/ + contextOpen? (e: ContextOpenEventArgs): void; + + /**Triggered when the grid is rendered completely.*/ + create? (e: CreateEventArgs): void; + + /**Triggered when the grid is bound with data during initial rendering.*/ + dataBound? (e: DataBoundEventArgs): void; + + /**Triggered when grid going to destroy.*/ + destroy? (e: DestroyEventArgs): void; + + /**Triggered when detail template row is clicked to collapse.*/ + detailsCollapse? (e: DetailsCollapseEventArgs): void; + + /**Triggered detail template row is initialized.*/ + detailsDataBound? (e: DetailsDataBoundEventArgs): void; + + /**Triggered when detail template row is clicked to expand.*/ + detailsExpand? (e: DetailsExpandEventArgs): void; + + /**Triggered after the record is added.*/ + endAdd? (e: EndAddEventArgs): void; + + /**Triggered after the record is deleted.*/ + endDelete? (e: EndDeleteEventArgs): void; + + /**Triggered after the record is edited.*/ + endEdit? (e: EndEditEventArgs): void; + + /**Triggered initial load.*/ + load? (e: LoadEventArgs): void; + + /**Triggered every time a request is made to access particular cell information, element and data.*/ + mergeCellInfo? (e: MergeCellInfoEventArgs): void; + + /**Triggered every time a request is made to access particular cell information, element and data.*/ + queryCellInfo? (e: QueryCellInfoEventArgs): void; + + /**Triggered when record is clicked.*/ + recordClick? (e: RecordClickEventArgs): void; + + /**Triggered when record is double clicked.*/ + recordDoubleClick? (e: RecordDoubleClickEventArgs): void; + + /**Triggered after column resized.*/ + resized? (e: ResizedEventArgs): void; + + /**Triggered when column resize end.*/ + resizeEnd? (e: ResizeEndEventArgs): void; + + /**Triggered when column resize start.*/ + resizeStart? (e: ResizeStartEventArgs): void; + + /**Triggered when right clicked on grid element.*/ + rightClick? (e: RightClickEventArgs): void; + + /**Triggered every time a request is made to access row information, element and data.*/ + rowDataBound? (e: RowDataBoundEventArgs): void; + + /**Triggered after the row is selected.*/ + rowSelected? (e: RowSelectedEventArgs): void; + + /**Triggered before the row is going to be selected.*/ + rowSelecting? (e: RowSelectingEventArgs): void; + + /**Triggered when refresh the template column elements in the Grid.*/ + templateRefresh? (e: TemplateRefreshEventArgs): void; + + /**Triggered when toolbar item is clicked in grid.*/ + toolBarClick? (e: ToolBarClickEventArgs): void; +} + +export interface ActionBeginEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the current selected page number. + */ + currentPage?: number; + + /**Returns the previous selected page number. + */ + previousPage?: number; + + /**Returns the end row index of that current page. + */ + endIndex?: number; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the start row index of that current page. + */ + startIndex?: number; + + /**Returns the current grouped column field name. + */ + columnName?: string; + + /**Returns the column sort direction. + */ + columnSortDirection?: string; + + /**Returns current edited row. + */ + row?: any; + + /**Returns the current action event type. + */ + originalEventType?: string; + + /**Returns primary key. + */ + primaryKey?: string; + + /**Returns primary key value. + */ + primaryKeyValue?: string; + + /**Returns the edited row index. + */ + rowIndex?: number; + + /**Returns the record object (JSON). + */ + data?: any; + + /**Returns the foreign key record object (JSON). + */ + foreignKeyData?: any; + + /**Returns the selected row index. + */ + selectedRow?: number; + + /**Returns selected row for delete. + */ + tr?: any; + + /**Returns current filtering column field name. + */ + currentFilteringColumn?: any; + + /**Returns filter details. + */ + filterCollection?: any; + + /**Returns type of the column like number, string and so on. + */ + columnType?: string; + + /**Returns the excel filter model. + */ + filtermodel?: any; + + /**Returns the dataSource. + */ + dataSource?: any; + + /**Returns the query manager. + */ + query?: any; + + /**Returns the customfilter option value. + */ + isCustomFilter?: boolean; +} + +export interface ActionCompleteEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the current selected page number. + */ + currentPage?: number; + + /**Returns the previous selected page number. + */ + previousPage?: number; + + /**Returns the end row index of that current page. + */ + endIndex?: number; + + /**Returns current action event type. + */ + originalEventType?: string; + + /**Returns the start row index of the current page. + */ + startIndex?: number; + + /**Returns grid element. + */ + target?: any; + + /**Returns the current sorted column field name. + */ + columnName?: string; + + /**Returns the column sort direction. + */ + columnSortDirection?: string; + + /**Returns current edited row. + */ + row?: any; + + /**Returns primary key. + */ + primaryKey?: string; + + /**Returns primary key value. + */ + primaryKeyValue?: string; + + /**Returns the edited row index. + */ + rowIndex?: number; + + /**Returns the record object (JSON). + */ + data?: any; + + /**Returns the selectedRow index. + */ + selectedRow?: number; + + /**Returns the foreign key record object (JSON). + */ + foreignKeyData?: any; + + /**Returns selected row for delete. + */ + tr?: any; + + /**Returns current filtering column field name. + */ + currentFilteringColumn?: string; + + /**Returns filter details. + */ + filterCollection?: any; + + /**Returns the dataSource. + */ + dataSource?: any; + + /**Returns the excel filter model. + */ + filtermodel?: any; + + /**Returns type of the column like number, string and so on. + */ + columnType?: string; + + /**Returns the customfilter option value. + */ + isCustomFilter?: boolean; +} + +export interface ActionFailureEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the error return by server. + */ + error?: any; + + /**Returns the current selected page number. + */ + currentPage?: number; + + /**Returns the previous selected page number. + */ + previousPage?: number; + + /**Returns the end row index of that current page. + */ + endIndex?: number; + + /**Returns current action event type. + */ + originalEventType?: string; + + /**Returns the start row index of the current page. + */ + startIndex?: number; + + /**Returns grid element. + */ + target?: any; + + /**Returns the current sorted column field name. + */ + columnName?: string; + + /**Returns the column sort direction. + */ + columnSortDirection?: string; + + /**Returns current edited row. + */ + row?: any; + + /**Returns primary key. + */ + primaryKey?: string; + + /**Returns primary key value. + */ + primaryKeyValue?: string; + + /**Returns the edited row index. + */ + rowIndex?: number; + + /**Returns the record object (JSON). + */ + data?: any; + + /**Returns the selectedRow index. + */ + selectedRow?: number; + + /**Returns the foreign key record object (JSON). + */ + foreignKeyData?: any; + + /**Returns selected row for delete. + */ + tr?: any; + + /**Returns current filtering column field name. + */ + currentFilteringColumn?: string; + + /**Returns filter details. + */ + filterCollection?: any; +} + +export interface BatchAddEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns deleted data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the column object. + */ + columnObject?: any; + + /**Returns the column index. + */ + columnIndex?: number; + + /**Returns the row element. + */ + row?: any; + + /**Returns the primaryKey. + */ + primaryKey?: any; + + /**Returns the cell object. + */ + cell?: any; +} + +export interface BatchDeleteEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns deleted data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the primary key. + */ + primaryKey?: any; + + /**Returns the row Index. + */ + rowIndex?: number; +} + +export interface BeforeBatchAddEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns deleted data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the default data object. + */ + defaultData?: any; + + /**Returns the primaryKey. + */ + primaryKey?: any; +} + +export interface BeforeBatchDeleteEventArgs { + + /**Returns the grid model. + */ + model?: any; + + /**Returns deleted data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the primaryKey. + */ + primaryKey?: any; + + /**Returns the row index. + */ + rowIndex?: number; + + /**Returns the row data. + */ + rowData?: any; + + /**Returns the row element. + */ + row?: any; +} + +export interface BeforeBatchSaveEventArgs { + + /**Returns the grid model. + */ + model?: any; + + /**Returns deleted data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the changed record object. + */ + batchChanges?: any; +} + +export interface BeginEditEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the current edited row. + */ + row?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the primary key. + */ + primaryKey?: any; + + /**Returns the primary key value. + */ + primaryKeyValue?: any; + + /**Returns the edited row index. + */ + rowIndex?: number; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface CellEditEventArgs { + + /**Returns the grid model. + */ + model?: any; + + /**Returns deleted data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the validation rules. + */ + validationRules?: any; + + /**Returns the column name. + */ + columnName?: string; + + /**Returns the cell value. + */ + value?: string; + + /**Returns the row data object. + */ + rowData?: any; + + /**Returns the previous value of the cell. + */ + previousValue?: string; + + /**Returns the column object. + */ + columnObject?: any; + + /**Returns the cell object. + */ + cell?: any; + + /**Returns isForeignKey option value. + */ + isForeignKey?: boolean; +} + +export interface CellSaveEventArgs { + + /**Returns the grid model. + */ + model?: any; + + /**Returns deleted data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the column name. + */ + columnName?: string; + + /**Returns the cell value. + */ + value?: string; + + /**Returns the row data object. + */ + rowData?: any; + + /**Returns the previous value of the cell. + */ + previousValue?: string; + + /**Returns the column object. + */ + columnObject?: any; + + /**Returns the cell object. + */ + cell?: any; + + /**Returns isForeignKey option value. + */ + isForeignKey?: boolean; +} + +export interface CellSelectedEventArgs { + + /**Returns the selected cell index value. + */ + cellIndex?: number; + + /**Returns the previous selected cell index value. + */ + previousRowCellIndex?: number; + + /**Returns the selected cell element. + */ + currentCell?: any; + + /**Returns the previous selected cell element. + */ + previousRowCell?: any; + + /**Returns current record object (JSON). + */ + data?: any; + + /**Returns the selected row cell index values. + */ + selectedRowCellIndex?: Array; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface CellSelectingEventArgs { + + /**Returns the selected cell index value. + */ + cellIndex?: number; + + /**Returns the previous selected cell index value. + */ + previousRowCellIndex?: number; + + /**Returns the selected cell element. + */ + currentCell?: any; + + /**Returns the previous selected cell element. + */ + previousRowCell?: any; + + /**Returns current record object (JSON). + */ + data?: any; + + /**Returns whether the ctrl key is pressed while selecting cell + */ + isCtrlKeyPressed?: boolean; + + /**Returns whether the shift key is pressed while selecting cell + */ + isShiftKeyPressed?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface ColumnDragEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns draggable element type. + */ + draggableType?: any; + + /**Returns the draggable column object. + */ + column?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns target elements based on mouse move position. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface ColumnDragStartEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns draggable element type. + */ + draggableType?: any; + + /**Returns the draggable column object. + */ + column?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns drag start element. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface ColumnDropEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns draggable element type. + */ + draggableType?: string; + + /**Returns the draggable column object. + */ + column?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns dropped dragged element. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface ColumnSelectedEventArgs { + + /**Returns the selected cell index value. + */ + columnIndex?: number; + + /**Returns the previous selected column index value. + */ + previousColumnIndex?: number; + + /**Returns the selected header cell element. + */ + headerCell?: any; + + /**Returns the previous selected header cell element. + */ + prevColumnHeaderCell?: any; + + /**Returns corresponding column object (JSON). + */ + column?: any; + + /**Returns the selected columns values. + */ + selectedColumnsIndex?: Array; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface ColumnSelectingEventArgs { + + /**Returns the selected column index value. + */ + columnIndex?: number; + + /**Returns the previous selected column index value. + */ + previousColumnIndex?: number; + + /**Returns the selected header cell element. + */ + headerCell?: any; + + /**Returns the previous selected header cell element. + */ + prevColumnHeaderCell?: any; + + /**Returns corresponding column object (JSON). + */ + column?: any; + + /**Returns whether the ctrl key is pressed while selecting cell + */ + isCtrlKeyPressed?: boolean; + + /**Returns whether the shift key is pressed while selecting cell + */ + isShiftKeyPressed?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface ContextClickEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the current item. + */ + currentTarget?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the status of contextmenu item which denotes its enabled state + */ + status?: boolean; + + /**Returns the target item. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface ContextOpenEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the current item. + */ + currentTarget?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the status of contextmenu item which denotes its enabled state + */ + status?: boolean; + + /**Returns the target item. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface CreateEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface DataBoundEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**Returns the grid model. + */ + model?: any; + + /**Returns deleted data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface DetailsCollapseEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns detail row element. + */ + detailsRow?: any; + + /**Returns master row of detail row record object (JSON). + */ + masterData?: any; + + /**Returns the foreign key record object (JSON). + */ + foreignKeyData?: any; + + /**Returns master row element. + */ + masterRow?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface DetailsDataBoundEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns details row element. + */ + detailsElement?: any; + + /**Returns the details row data. + */ + data?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface DetailsExpandEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns detail row element. + */ + detailsRow?: any; + + /**Returns master row of detail row record object (JSON). + */ + masterData?: any; + + /**Returns the foreign key record object (JSON). + */ + foreignKeyData?: any; + + /**Returns master row element. + */ + masterRow?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface EndAddEventArgs { + + /**Returns the grid model. + */ + model?: any; + + /**Returns added data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface EndDeleteEventArgs { + + /**Returns the grid model. + */ + model?: any; + + /**Returns deleted data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface EndEditEventArgs { + + /**Returns the grid model. + */ + model?: any; + + /**Returns modified data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface LoadEventArgs { + + /**Returns the grid model. + */ + model?: any; + + /**Returns deleted data. + */ + data?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface MergeCellInfoEventArgs { + + /**Returns grid cell. + */ + cell?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns current row record object (JSON). + */ + data?: any; + + /**Returns the text value in the cell. + */ + text?: string; + + /**Returns the column object. + */ + column?: any; + + /**Method to merge Grid rows. + */ + rowMerge?: void; + + /**Method to merge Grid columns. + */ + colMerge?: void; + + /**Method to merge Grid rows and columns. + */ + merge?: void; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface QueryCellInfoEventArgs { + + /**Returns grid cell. + */ + cell?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns current row record object (JSON). + */ + data?: any; + + /**Returns the text value in the cell. + */ + text?: string; + + /**Returns the column object. + */ + column?: any; + + /**Returns the foreign key record object (JSON). + */ + foreignKeyData?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface RecordClickEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns current record object (JSON). + */ + data?: any; + + /**Returns the row index of the selected row. + */ + rowIndex?: number; + + /**Returns the jquery object of the current selected row. + */ + row?: any; + + /**Returns the current selected cell. + */ + cell?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the cell index value. + */ + cellIndex?: number; + + /**Returns the corresponding cell value. + */ + cellValue?: string; + + /**Returns the Header text of the column corresponding to the selected cell. + */ + columnName?: string; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface RecordDoubleClickEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns current record object (JSON). + */ + data?: any; + + /**Returns the row index of the selected row. + */ + rowIndex?: number; + + /**Returns the jquery object of the current selected row. + */ + row?: any; + + /**Returns the current selected cell. + */ + cell?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the selected cell index value. + */ + cellIndex?: number; + + /**Returns the corresponding cell value. + */ + cellValue?: string; + + /**Returns the Header text of the column corresponding to the selected cell. + */ + columnName?: string; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface ResizedEventArgs { + + /**Returns the grid model. + */ + model?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns deleted data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the column index. + */ + columnIndex?: number; + + /**Returns the column object. + */ + column?: any; + + /**Returns the grid object. + */ + target?: any; + + /**Returns the old width value. + */ + oldWidth?: number; + + /**Returns the new width value. + */ + newWidth?: number; +} + +export interface ResizeEndEventArgs { + + /**Returns the grid model. + */ + model?: any; + + /**Returns deleted data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the column index. + */ + columnIndex?: number; + + /**Returns the column object. + */ + column?: any; + + /**Returns the grid object. + */ + target?: any; + + /**Returns the old width value. + */ + oldWidth?: number; + + /**Returns the new width value. + */ + newWidth?: number; + + /**Returns the extra width value. + */ + extra?: number; +} + +export interface ResizeStartEventArgs { + + /**Returns the grid model. + */ + model?: any; + + /**Returns deleted data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the column index. + */ + columnIndex?: number; + + /**Returns the column object. + */ + column?: any; + + /**Returns the grid object. + */ + target?: any; + + /**Returns the old width value. + */ + oldWidth?: number; +} + +export interface RightClickEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns current record object (JSON). + */ + currentData?: any; + + /**Returns the row index of the selected row. + */ + rowIndex?: number; + + /**Returns the current selected row. + */ + row?: any; + + /**Returns the selected row data object. + */ + data?: any; + + /**Returns the cell index of the selected cell. + */ + cellIndex?: number; + + /**Returns the cell value. + */ + cellValue?: string; + + /**Returns the cell object. + */ + cell?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface RowDataBoundEventArgs { + + /**Returns grid row. + */ + row?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns current row record object (JSON). + */ + data?: any; + + /**Returns the foreign key record object (JSON). + */ + foreignKeyData?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface RowSelectedEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns current record object (JSON). + */ + data?: any; + + /**Returns the foreign key record object (JSON). + */ + foreignKeyData?: any; + + /**Returns the row index of the selected row. + */ + rowIndex?: number; + + /**Returns the current selected row. + */ + row?: any; + + /**Returns the previous selected row element. + */ + prevRow?: any; + + /**Returns the previous selected row index. + */ + prevRowIndex?: number; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface RowSelectingEventArgs { + + /**Returns the selected row index value. + */ + rowIndex?: number; + + /**Returns the selected row element. + */ + row?: any; + + /**Returns the previous selected row element. + */ + prevRow?: any; + + /**Returns the previous selected row index. + */ + prevRowIndex?: number; + + /**Returns current record object (JSON). + */ + data?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface TemplateRefreshEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the cell object. + */ + cell?: any; + + /**Returns the column object. + */ + column?: any; + + /**Returns the current row data. + */ + data?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the current row index. + */ + rowIndex?: number; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface ToolBarClickEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the current item. + */ + currentTarget?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the status of toolbar item which denotes its enabled state + */ + status?: boolean; + + /**Returns the target item. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the grid model. + */ + gridModel?: any; + + /**Returns the toolbar object of the selected toolbar element. + */ + toolbarData?: any; +} + +export interface ColumnsCommands { + + /**Gets or sets an object that indicates to define all the button options which are available in ejButton. + */ + buttonOptions?: any; + + /**Gets or sets a value that indicates to add the command column button. See unboundType + */ + type?: ej.Grid.UnboundType|string; +} + +export interface Columns { + + /**Gets or sets a value that indicates whether to enable editing behavior for particular column. + * @Default {true} + */ + allowEditing?: boolean; + + /**Gets or sets a value that indicates whether to enable dynamic filtering behavior for particular column. + * @Default {true} + */ + allowFiltering?: boolean; + + /**Gets or sets a value that indicates whether to enable dynamic grouping behavior for particular column. + * @Default {true} + */ + allowGrouping?: boolean; + + /**Gets or sets a value that indicates whether to enable dynamic sorting behavior for particular column. + * @Default {true} + */ + allowSorting?: boolean; + + /**Gets or sets a value that indicates whether to enable dynamic resizable for particular column. + * @Default {true} + */ + allowResizing?: boolean; + + /**Used to hide the particular column in column chooser by giving value as false. + * @Default {true} + */ + showInColumnChooser?: boolean; + + /**Gets or sets an object that indicates to define a command column in the grid. + * @Default {[]} + */ + commands?: Array; + + /**Gets or sets a value that indicates to provide custom css for an individual column. + */ + cssClass?: string; + + /**Gets or sets a value that indicates the attribute values to the td element of a particular column + */ + customAttributes?: any; + + /**Gets or sets a value that indicates to bind the external datasource to the particular column when columnEditType as "dropdownedit" and also it is used to bind the datasource to the foreign key column while editing the grid. //Where data is array of JSON objects of text and value for the drop-down and array of JSON objects for foreign key column. + * @Default {null} + */ + dataSource?: Array; + + /**Gets or sets a value that indicates to display the specified default value while adding a new record to the grid + */ + defaultValue?: string|number|boolean|Date; + + /**Gets or sets a value that indicates to render the grid content and header with an html elements + * @Default {false} + */ + disableHtmlEncode?: boolean; + + /**Gets or sets a value that indicates to display a column value as checkbox or string + * @Default {true} + */ + displayAsCheckBox?: boolean; + + /**Gets or sets a value that indicates to customize ejNumericTextbox of an editable column. See editingType + */ + editParams?: any; + + /**Gets or sets a template that displays a custom editor used to edit column values. See editTemplate + * @Default {null} + */ + editTemplate?: any; + + /**Gets or sets a value that indicates to render the element(based on edit type) for editing the grid record. See editingType + * @Default {ej.Grid.EditingType.String} + */ + editType?: ej.Grid.EditingType|string; + + /**Gets or sets a value that indicates to display the columns in the grid mapping with column name of the dataSource. + */ + field?: string; + + /**Gets or sets a value that indicates to define foreign key field name of the grid datasource. + * @Default {null} + */ + foreignKeyField?: string; + + /**Gets or sets a value that indicates to bind the field which is in foreign column datasource based on the foreignKeyField + * @Default {null} + */ + foreignKeyValue?: string; + + /**Gets or sets a value that indicates the format for the text applied on the column + */ + format?: string; + + /**Gets or sets a value that indicates to add the template within the header element of the particular column. + * @Default {null} + */ + headerTemplateID?: string; + + /**Gets or sets a value that indicates to display the title of that particular column. + */ + headerText?: string; + + /**This defines the text alignment of a particular column header cell value. See headerTextAlign + * @Default {ej.TextAlign.Left} + */ + headerTextAlign?: ej.TextAlign|string; + + /**You can use this property to freeze selected columns in grid at the time of scrolling. + * @Default {false} + */ + isFrozen?: boolean; + + /**Gets or sets a value that indicates the column has an identity in the database. + * @Default {false} + */ + isIdentity?: boolean; + + /**Gets or sets a value that indicates the column is act as a primary key(read-only) of the grid. The editing is performed based on the primary key column + * @Default {false} + */ + isPrimaryKey?: boolean; + + /**Gets or sets a value that indicates whether to bind the column which are not in the datasource + * @Default {false} + */ + isUnbound?: boolean; + + /**Gets or sets a value that indicates whether to enables column template for a particular column. + * @Default {false} + */ + template?: boolean|string; + + /**Gets or sets a value that indicates to add the template as a particular column data . + * @Default {null} + */ + templateID?: string; + + /**Gets or sets a value that indicates to align the text within the column. See textAlign + * @Default {ej.TextAlign.Left} + */ + textAlign?: ej.TextAlign|string; + + /**Sets the template for Tooltip in Grid Columns(both header and content) + */ + tooltip?: string; + + /**Sets the clip mode for Grid cell as ellipsis or clipped content(both header and content) + * @Default {ej.Grid.ClipMode.Clip} + */ + clipMode?: ej.Grid.ClipMode|string; + + /**Gets or sets a value that indicates to specify the data type of the specified columns. + */ + type?: string; + + /**Gets or sets a value that indicates to define constraints for saving data to the database. + */ + validationRules?: any; + + /**Gets or sets a value that indicates whether this column is visible in the grid. + * @Default {true} + */ + visible?: boolean; + + /**Gets or sets a value that indicates to define the width for a particular column in the grid. + */ + width?: number; +} + +export interface ContextMenuSettingsSubContextMenu { + + /**Used to get or set the corresponding custom context menu item to which the submenu to be appended. + * @Default {null} + */ + contextMenuItem?: string; + + /**Used to get or set the sub menu items to the custom context menu item. + * @Default {[]} + */ + subMenu?: Array; +} + +export interface ContextMenuSettings { + + /**Gets or sets a value that indicates whether to add the default context menu actions as a context menu items If enableContextMenu is true it will show all the items related to the target, if you want selected items from contextmenu you have to mention in the contextMenuItems + * @Default {[]} + */ + contextMenuItems?: Array; + + /**Gets or sets a value that indicates whether to add custom contextMenu items within the toolbar to perform any action in the grid + * @Default {[]} + */ + customContextMenuItems?: Array; + + /**Gets or sets a value that indicates whether to enable the context menu action in the grid. + * @Default {false} + */ + enableContextMenu?: boolean; + + /**Used to get or set the subMenu to the corresponding custom context menu item. + */ + subContextMenu?: Array; + + /**Gets or sets a value that indicates whether to disable the default context menu items in the grid. + * @Default {false} + */ + disabledefaultitems?: boolean; +} + +export interface EditSettings { + + /**Gets or sets a value that indicates whether to enable insert action in the editing mode. + * @Default {false} + */ + allowAdding?: boolean; + + /**Gets or sets a value that indicates whether to enable the delete action in the editing mode. + * @Default {false} + */ + allowDeleting?: boolean; + + /**Gets or sets a value that indicates whether to enable the edit action in the editing mode. + * @Default {false} + */ + allowEditing?: boolean; + + /**Gets or sets a value that indicates whether to enable the editing action while double click on the record + * @Default {true} + */ + allowEditOnDblClick?: boolean; + + /**This specifies the id of the template. This template can be used to display the data that you require to be edited using the Dialog Box + * @Default {null} + */ + dialogEditorTemplateID?: string; + + /**Gets or sets a value that indicates whether to define the mode of editing See editMode + * @Default {ej.Grid.EditMode.Normal} + */ + editMode?: ej.Grid.EditMode|string; + + /**This specifies the id of the template. This template can be used to display the data that you require to be edited using the External edit form + * @Default {null} + */ + externalFormTemplateID?: string; + + /**This specifies to set the position of an External edit form either in the top-right or bottom-left of the grid + * @Default {ej.Grid.FormPosition.BottomLeft} + */ + formPosition?: ej.Grid.FormPosition|string; + + /**This specifies the id of the template. This template can be used to display the data that you require to be edited using the Inline edit form + * @Default {null} + */ + inlineFormTemplateID?: string; + + /**This specifies to set the position of an adding new row either in the top or bottom of the grid + * @Default {ej.Grid.RowPosition.top} + */ + rowPosition?: ej.Grid.RowPosition|string; + + /**Gets or sets a value that indicates whether the confirm dialog has to be shown while saving or discarding the batch changes + * @Default {true} + */ + showConfirmDialog?: boolean; + + /**Gets or sets a value that indicates whether the confirm dialog has to be shown while deleting record + * @Default {false} + */ + showDeleteConfirmDialog?: boolean; + + /**Gets or sets a value that indicates whether the title for edit form is different from the primarykey column. + * @Default {null} + */ + titleColumn?: string; + + /**Gets or sets a value that indicates whether to display the add new form by default in the grid. + * @Default {false} + */ + showAddNewRow?: boolean; +} + +export interface FilterSettingsFilteredColumns { + + /**Gets or sets a value that indicates whether to define the field name of the column to be filter. + */ + field?: string; + + /**Gets or sets a value that indicates whether to define the filter condition to filtered column. + */ + operator?: ej.FilterOperators|string; + + /**Gets or sets a value that indicates whether to define the predicate as and/or. + */ + predicate?: string; + + /**Gets or sets a value that indicates whether to define the value to be filtered in a column. + */ + value?: string|number; +} + +export interface FilterSettings { + + /**Gets or sets a value that indicates to perform the filter operation with case sensitive in excel styled filter menu mode + * @Default {false} + */ + enableCaseSensitivity?: boolean; + + /**This specifies the grid to starts the filter action while typing in the filterBar or after pressing the enter key. based on the filterBarMode. See filterBarMode + * @Default {ej.Grid.FilterBarMode.Immediate} + */ + filterBarMode?: ej.Grid.FilterBarMode|string; + + /**Gets or sets a value that indicates whether to define the filtered columns details programmatically at initial load + * @Default {[]} + */ + filteredColumns?: Array; + + /**This specifies the grid to show the filterBar or filterMenu to the grid records. See filterType + * @Default {ej.Grid.FilterType.FilterBar} + */ + filterType?: ej.Grid.FilterType|string; + + /**Gets or sets a value that indicates the maximum number of filter choices that can be showed in the excel styled filter menu. + * @Default {1000} + */ + maxFilterChoices?: number; + + /**This specifies the grid to show the filter text within the grid pager itself. + * @Default {true} + */ + showFilterBarMessage?: boolean; + + /**Gets or sets a value that indicates whether to enable the predicate options in the filtering menu + * @Default {false} + */ + showPredicate?: boolean; +} + +export interface GroupSettings { + + /**Gets or sets a value that customize the group caption format. + * @Default {null} + */ + captionFormat?: string; + + /**Gets or sets a value that indicates whether to enable the animation effects to the group drop area + * @Default {true} + */ + enableDropAreaAnimation?: boolean; + + /**Gets or sets a value that indicates whether to enable animation button option in the group drop area of the grid. + * @Default {false} + */ + enableDropAreaAutoSizing?: boolean; + + /**Gets or sets a value that indicates whether to add grouped columns programmatically at initial load + * @Default {[]} + */ + groupedColumns?: Array; + + /**Gets or sets a value that indicates whether to show the group drop area just above the column header. It can be used to avoid ungrouping the already grouped column using groupsettings. + * @Default {true} + */ + showDropArea?: boolean; + + /**Gets or sets a value that indicates whether to hide the grouped columns from the grid + * @Default {false} + */ + showGroupedColumn?: boolean; + + /**Gets or sets a value that indicates whether to show the group button image(toggle button)in the column header and also in the grouped column in the group drop area . It can be used to group/ungroup the columns by click on the toggle button. + * @Default {false} + */ + showToggleButton?: boolean; + + /**Gets or sets a value that indicates whether to enable the close button in the grouped column which is in the group drop area to ungroup the grouped column + * @Default {false} + */ + showUngroupButton?: boolean; +} + +export interface TextWrapSettings { + + /**This specifies the grid to apply the auto wrap for grid content or header or both. + * @Default {ej.Grid.WrapMode.Both} + */ + wrapMode?: ej.Grid.WrapMode|string; +} + +export interface PageSettings { + + /**Gets or sets a value that indicates whether to define which page to display currently in the grid + * @Default {1} + */ + currentPage?: number; + + /**Gets or sets a value that indicates whether to pass the current page information as a query string along with the url while navigating to other page. + * @Default {false} + */ + enableQueryString?: boolean; + + /**Gets or sets a value that indicates whether to enables pager template for the grid. + * @Default {false} + */ + enableTemplates?: boolean; + + /**Gets or sets a value that indicates whether to define the number of pages displayed in the pager for navigation + * @Default {8} + */ + pageCount?: number; + + /**Gets or sets a value that indicates whether to define the number of records displayed per page + * @Default {12} + */ + pageSize?: number; + + /**Gets or sets a value that indicates whether to enables default pager for the grid. + * @Default {false} + */ + showDefaults?: boolean; + + /**Gets or sets a value that indicates to add the template as a pager template for grid. + * @Default {null} + */ + template?: string; + + /**Get the value of total number of pages in the grid. The totalPages value is calculated based on page size and total records of grid + * @Default {null} + */ + totalPages?: number; + + /**Get the value of total number of records which is bound to the grid. The totalRecordsCount value is calculated based on dataSource bound to the grid. + * @Default {null} + */ + totalRecordsCount?: number; + + /**Gets or sets a value that indicates whether to define the number of pages to print + * @Default {ej.Grid.PrintMode.AllPages} + */ + printMode?: ej.Grid.PrintMode|string; +} + +export interface ScrollSettings { + + /**This specify the grid to to view data that you require without buffering the entire load of a huge database + * @Default {false} + */ + allowVirtualScrolling?: boolean; + + /**This specify the grid to enable/disable touch control for scrolling. + * @Default {true} + */ + enableTouchScroll?: boolean; + + /**This specify the grid to freeze particular columns at the time of scrolling. + * @Default {0} + */ + frozenColumns?: number; + + /**This specify the grid to freeze particular rows at the time of scrolling. + * @Default {0} + */ + frozenRows?: number; + + /**This specify the grid to show the vertical scroll bar, to scroll and view the grid contents. + * @Default {0} + */ + height?: number; + + /**This is used to define the mode of virtual scrolling in grid. See virtualScrollMode + * @Default {ej.Grid.VirtualScrollMode.Normal} + */ + virtualScrollMode?: ej.Grid.VirtualScrollMode|string; + + /**This specify the grid to show the horizontal scroll bar, to scroll and view the grid contents + * @Default {250} + */ + width?: number; + + /**This specify the scroll down pixel of mouse wheel, to scroll mouse wheel and view the grid contents. + * @Default {57} + */ + scrollOneStepBy?: number; +} + +export interface SearchSettings { + + /**This specify the grid to search for the value in particular columns that is mentioned in the field. + * @Default {[]} + */ + field?: any; + + /**This specifies the grid to search the particular data that is mentioned in the key. + */ + key?: string; + + /**It specifies the grid to search the records based on operator. + * @Default {contains} + */ + operator?: string; + + /**It enables or disables case-sensitivity while searching the search key in grid. + * @Default {true} + */ + ignoreCase?: boolean; +} + +export interface SelectionSettings { + + /**Gets or sets a value that indicates whether to enable the toggle selction behavior for row, cell and column. + * @Default {false} + */ + enableToggle?: boolean; + + /**Gets or sets a value that indicates whether to add the default selection actions as a seleciton mode.See selectionMode + * @Default {[row]} + */ + selectionMode?: ej.Grid.SelectionMode|string; +} + +export interface SortSettingsSortedColumns { + + /**Gets or sets a value that indicates whether to define the direction to sort the column. + */ + direction?: string; + + /**Gets or sets a value that indicates whether to define the field name of the column to be sort + */ + field?: string; +} + +export interface SortSettings { + + /**Gets or sets a value that indicates whether to define the direction and field to sort the column. + */ + sortedColumns?: Array; +} + +export interface StackedHeaderRowsStackedHeaderColumns { + + /**Gets or sets a value that indicates the header text for the particular stacked header column. + * @Default {null} + */ + column?: string; + + /**Gets or sets a value that indicates class to the corresponding stackedHeaderColumn. + * @Default {null} + */ + cssClass?: string; + + /**Gets or sets a value that indicates the header text for the particular stacked header column. + * @Default {null} + */ + headerText?: string; + + /**Gets or sets a value that indicates the text alignment of the corresponding headerText. + * @Default {ej.TextAlign.Left} + */ + textAlign?: string; +} + +export interface StackedHeaderRows { + + /**Gets or sets a value that indicates whether to add stacked header columns into the stacked header rows + * @Default {[]} + */ + stackedHeaderColumns?: Array; +} + +export interface SummaryRowsSummaryColumns { + + /**Gets or sets a value that indicates the text displayed in the summary column as a value + * @Default {null} + */ + customSummaryValue?: string; + + /**This specifies summary column used to perform the summary calculation + * @Default {null} + */ + dataMember?: string; + + /**Gets or sets a value that indicates to define the target column at which to display the summary. + * @Default {null} + */ + displayColumn?: string; + + /**Gets or sets a value that indicates the format for the text applied on the column + * @Default {null} + */ + format?: string; + + /**Gets or sets a value that indicates the text displayed before the summary column value + * @Default {null} + */ + prefix?: string; + + /**Gets or sets a value that indicates the text displayed after the summary column value + * @Default {null} + */ + suffix?: string; + + /**Gets or sets a value that indicates the type of calculations to be performed for the corresponding summary column + * @Default {[]} + */ + summaryType?: ej.Grid.SummaryType|string; + + /**Gets or sets a value that indicates to add the template for the summary value of dataMember given. + * @Default {null} + */ + template?: string; +} + +export interface SummaryRows { + + /**Gets or sets a value that indicates whether to show the summary value within the group caption area for the corresponding summary column while grouping the column + * @Default {false} + */ + showCaptionSummary?: boolean; + + /**Gets or sets a value that indicates whether to show the group summary value for the corresponding summary column while grouping a column + * @Default {false} + */ + showGroupSummary?: boolean; + + /**Gets or sets a value that indicates whether to show the total summary value the for the corresponding summary column. The summary row is added after the grid content. + * @Default {true} + */ + showTotalSummary?: boolean; + + /**Gets or sets a value that indicates whether to add summary columns into the summary rows. + * @Default {[]} + */ + summaryColumns?: Array; + + /**This specifies the grid to show the title for the summary rows. + */ + title?: string; + + /**This specifies the grid to show the title of summary row in the specified column. + * @Default {null} + */ + titleColumn?: string; +} + +export interface ToolbarSettings { + + /**Gets or sets a value that indicates whether to add custom toolbar items within the toolbar to perform any action in the grid + * @Default {[]} + */ + customToolbarItems?: Array; + + /**Gets or sets a value that indicates whether to enable toolbar in the grid. + * @Default {false} + */ + showToolbar?: boolean; + + /**Gets or sets a value that indicates whether to add the default editing actions as a toolbar items + * @Default {[]} + */ + toolbarItems?: ej.Grid.ToolBarItems|string; +} + +enum GridLines{ + + ///Displays both the horizontal and vertical grid lines. + Both, + + ///Displays the horizontal grid lines only. + Horizontal, + + ///Displays the vertical grid lines only. + Vertical, + + ///No grid lines are displayed. + None +} + + +enum ColumnLayout{ + + ///Column layout is auto(based on width). + Auto, + + ///Column layout is fixed(based on width). + Fixed +} + + +enum UnboundType{ + + ///Unbound type is edit. + Edit, + + ///Unbound type is save. + Save, + + ///Unbound type is delete. + Delete, + + ///Unbound type is cancel. + Cancel +} + + +enum EditingType{ + + ///Specifies editing type as string edit. + String, + + ///Specifies editing type as boolean edit. + Boolean, + + ///Specifies editing type as numeric edit. + Numeric, + + ///Specifies editing type as dropdown edit. + Dropdown, + + ///Specifies editing type as datepicker. + DatePicker, + + ///Specifies editing type as datetime picker. + DateTimePicker +} + + +enum ClipMode{ + + ///Shows ellipsis for the overflown cell. + Ellipsis, + + ///Truncate the text in the cell + Clip, + + ///Shows ellipsis and tooltip for the overflown cell. + EllipsisWithTooltip +} + + +enum EditMode{ + + ///Edit mode is normal. + Normal, + + ///Truncate the text in the cell + Clip, + + ///Edit mode is dialog. + Dialog, + + ///Edit mode is dialog template. + DialogTemplate, + + ///Edit mode is batch. + Batch, + + ///Edit mode is inline form. + InlineForm, + + ///Edit mode is inline template form. + InlineTemplateForm, + + ///Edit mode is external form. + ExternalForm, + + ///Edit mode is external form template. + ExternalFormTemplate +} + + +enum FormPosition{ + + ///Form position is bottomleft. + BottomLeft, + + ///Form position is topright. + TopRight +} + + +enum RowPosition{ + + ///Specifies position of add new row as top. + Top, + + ///Specifies position of add new row as bottom. + Bottom +} + + +enum FilterBarMode{ + + ///Initiate filter operation on typing the filter query. + Immediate, + + ///Initiate filter operation after Enter key is pressed. + OnEnter +} + + +enum FilterType{ + + ///Specifies the filter type as menu. + Menu, + + ///Specifies the filter type as excel. + Excel, + + ///Specifies the filter type as filterbar. + FilterBar +} + + +enum WrapMode{ + + ///Auto wrap is applied for both content and header. + Both, + + ///Auto wrap is applied only for content. + Content, + + ///Auto wrap is applied only for header. + Header +} + + +enum PrintMode{ + + ///Prints all pages. + AllPages, + + ///Prints curren tpage. + CurrentPage +} + + +enum VirtualScrollMode{ + + ///virtual scroll mode is normal. + Normal, + + ///virtual scroll mode is continuous. + Continuous +} + + +enum SelectionMode{ + + ///Selection is row basis. + Row, + + ///Selection is cell basis. + Cell, + + ///Selection is column basis. + Column +} + + +enum SelectionType{ + + ///Specifies the selection type as single. + Single, + + ///Specifies the selection type as multiple. + Multiple +} + + +enum SummaryType{ + + ///Summary type is average. + Average, + + ///Summary type is minimum. + Minimum, + + ///Summary type is maximum. + Maximum, + + ///Summary type is count. + Count, + + ///Summary type is sum. + Sum, + + ///Summary type is custom. + Custom, + + ///Summary type is true count. + TrueCount, + + ///Summary type is false count. + FalseCount +} + + +enum ToolBarItems{ + + ///Toolbar item is add. + Add, + + ///Toolbar item is edit. + Edit, + + ///Toolbar item is delete. + Delete, + + ///Toolbar item is update. + Update, + + ///Toolbar item is cancel. + Cancel, + + ///Toolbar item is search. + Search, + + ///Toolbar item is pdfExport. + PdfExport, + + ///Toolbar item is printGrid. + PrintGrid, + + ///Toolbar item is wordExport. + WordExport +} + +} + +class PivotGrid extends ej.Widget { + static fn: PivotGrid; + constructor(element: JQuery, options?: PivotGrid.Model); + constructor(element: Element, options?: PivotGrid.Model); + model:PivotGrid.Model; + defaults:PivotGrid.Model; + + /** Perform an asynchronous HTTP (AJAX) request. + * @returns {void} + */ + doAjaxPost(): void; + + /** Perform an asynchronous HTTP (FullPost) submit. + * @returns {void} + */ + doPostBack(): void; + + /** Exports the PivotGrid to an appropriate format based on the parameter passed. + * @returns {void} + */ + exportPivotGrid(): void; + + /** This function re-renders the PivotGrid on clicking the navigation buttons on PivotPager. + * @returns {void} + */ + refreshPagedPivotGrid(): void; + + /** This function receives the JSON formatted datasource to render the PivotGrid control. + * @returns {void} + */ + renderControlFromJSON(): void; +} +export module PivotGrid{ + +export interface Model { + + /**Sets the mode for the PivotGrid widget for binding either OLAP or relational data source. + * @Default {ej.PivotGrid.AnalysisMode.Olap} + */ + analysisMode?: any; + + /**Specifies the CSS class to PivotGrid to achieve custom theme. + * @Default {“”} + */ + cssClass?: string; + + /**Contains the serialized OlapReport at that instant. + * @Default {“”} + */ + currentReport?: string; + + /**Initializes the data source for the PivotGrid widget, when it functions completely on client-side. + * @Default {{}} + */ + dataSource?: DataSource; + + /**Used to bind the drilled members by default through report. + * @Default {[]} + */ + drilledItems?: Array; + + /**Object utilized to pass additional information between client-end and service-end. + * @Default {null} + */ + customObject?: any; + + /**Allows the user to access each cell on right-click. + * @Default {false} + */ + enableCellContext?: boolean; + + /**Enables the cell selection for a specified range of value cells. + * @Default {false} + */ + enableCellSelection?: boolean; + + /**Collapses the Pivot Items along rows and columns by default. It works only for relational data source. + * @Default {false} + */ + enableCollapseByDefault?: boolean; + + /**Enables the display of grand total for all the columns. + * @Default {true} + */ + enableColumnGrandTotal?: boolean; + + /**Allows the user to format a specific set of cells based on the condition. + * @Default {false} + */ + enableConditionalFormatting?: boolean; + + /**Allows the user to refresh the control on-demand and not during every UI operation. + * @Default {false} + */ + enableDeferUpdate?: boolean; + + /**Enables the display of GroupingBar allowing you to filter, sort and remove fields obtained from relational datasource. + * @Default {false} + */ + enableGroupingBar?: boolean; + + /**Enables the display of grand total for rows and columns. + * @Default {true} + */ + enableGrandTotal?: boolean; + + /**Allows the user to load PivotGrid using JSON data. + * @Default {false} + */ + enableJSONRendering?: boolean; + + /**Enables rendering of PivotGrid widget along with the PivotTable Field List, which allows UI operation. + * @Default {true} + */ + enablePivotFieldList?: boolean; + + /**Enables the display of grand total for all the rows. + * @Default {true} + */ + enableRowGrandTotal?: boolean; + + /**Allows the user to view PivotGrid from right to left. + * @Default {false} + */ + enableRTL?: boolean; + + /**Allows the user to enable ToolTip option. + * @Default {false} + */ + enableToolTip?: boolean; + + /**Allows the user to view large amount of data through virtual scrolling. + * @Default {false} + */ + enableVirtualScrolling?: boolean; + + /**Allows the user to configure hyperlink settings of PivotGrid control. + * @Default {{}} + */ + hyperlinkSettings?: HyperlinkSettings; + + /**This is used for identifying whether the member is Named Set or not. + * @Default {false} + */ + isNamedSets?: boolean; + + /**Allows the user to enable PivotGrid’s responsiveness in the browser layout. + * @Default {false} + */ + isResponsive?: boolean; + + /**Contains the serialized JSON string which renders PivotGrid. + * @Default {“”} + */ + jsonRecords?: string; + + /**Sets the summary layout for PivotGrid. Following are the ways in which summary can be positioned: normal summary (bottom), top summary, no summary and excel-like summary. + * @Default {ej.PivotGrid.Layout.Normal} + */ + layout?: ej.PivotGrid.Layout|string; + + /**Allows the user to set the localized language for the widget. + * @Default {en-US} + */ + locale?: string; + + /**Sets the mode for the PivotGrid widget for binding data source either in server-side or client-side. + * @Default {ej.PivotGrid.OperationalMode.ClientMode} + */ + operationalMode?: any; + + /**Allows the user to set custom name for the methods at service-end, communicated during AJAX post. + * @Default {{}} + */ + serviceMethodSettings?: ServiceMethodSettings; + + /**Connects the service using the specified URL for any server updates. + * @Default {“”} + */ + url?: string; + + /**Triggers when it reaches client-side after any AJAX request.*/ + afterServiceInvoke? (e: AfterServiceInvokeEventArgs): void; + + /**Triggers before any AJAX request is passed from PivotGrid to service methods.*/ + beforeServiceInvoke? (e: BeforeServiceInvokeEventArgs): void; + + /**Triggers when right-click action is performed on a cell.*/ + cellContext? (e: CellContextEventArgs): void; + + /**Triggers when a specific range of value cells are selected.*/ + cellSelection? (e: CellSelectionEventArgs): void; + + /**Triggers when the hyperlink of column header is clicked.*/ + columnHeaderHyperlinkClick? (e: ColumnHeaderHyperlinkClickEventArgs): void; + + /**Triggers after performing drill operation in PivotGrid.*/ + drillSuccess? (e: DrillSuccessEventArgs): void; + + /**Triggers when PivotGrid loading is initiated.*/ + load? (e: LoadEventArgs): void; + + /**Triggers when PivotGrid widget completes all operations at client-side after any AJAX request.*/ + renderComplete? (e: RenderCompleteEventArgs): void; + + /**Triggers when any error occurred during AJAX request.*/ + renderFailure? (e: RenderFailureEventArgs): void; + + /**Triggers when PivotGrid successfully reaches client-side after any AJAX request.*/ + renderSuccess? (e: RenderSuccessEventArgs): void; + + /**Triggers when the hyperlink of row header is clicked.*/ + rowHeaderHyperlinkClick? (e: RowHeaderHyperlinkClickEventArgs): void; + + /**Triggers when the hyperlink of summary cell is clicked.*/ + summaryCellHyperlinkClick? (e: SummaryCellHyperlinkClickEventArgs): void; + + /**Triggers when the hyperlink of value cell is clicked.*/ + valueCellHyperlinkClick? (e: ValueCellHyperlinkClickEventArgs): void; +} + +export interface AfterServiceInvokeEventArgs { + + /**return the current action of PivotGrid control. + */ + action?: string; + + /**return the custom object bounds with PivotGrid control. + */ + customObject?: any; + + /**return the outer HTML of PivotGrid control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the PivotGrid model + */ + model?: ej.PivotGrid.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface BeforeServiceInvokeEventArgs { + + /**return the current action of PivotGrid control. + */ + action?: string; + + /**return the custom object bounds with PivotGrid control. + */ + customObject?: any; + + /**return the outer HTML of PivotGrid control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the PivotGrid model + */ + model?: ej.PivotGrid.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface CellContextEventArgs { + + /**returns the original event args. + */ + args?: any; + + /**returns the cell position (row index and column index) in table. + */ + cellPosition?: string; + + /**returns the type of the cell. + */ + cellType?: string; + + /**returns the serialized data of the header cells. + */ + rowData?: string; + + /**returns the unique name of levels/members. + */ + uniqueName?: string; +} + +export interface CellSelectionEventArgs { + + /**returns the original event args. + */ + args?: any; + + /**Returns the selected cell values. + */ + cellvalue?: any; + + /**Returns the selected value cells row headers. + */ + rowheaders?: any; + + /**Returns the selected value cells column headers. + */ + colheaders?: any; + + /**Returns the selected value cells measure. + */ + measure?: any; + + /**Return the row and column measure count. + */ + measureValue?: any; +} + +export interface ColumnHeaderHyperlinkClickEventArgs { + + /**returns the original event args. + */ + args?: any; + + /**returns the cell position (row index and column index) in table. + */ + cellPosition?: string; + + /**returns the type of the cell. + */ + cellType?: string; + + /**returns the serialized data of the header cells. + */ + rowData?: string; + + /**returns the unique name of levels/members. + */ + uniqueName?: string; +} + +export interface DrillSuccessEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the PivotGrid model + */ + model?: ej.PivotGrid.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface LoadEventArgs { + + /**returns the original event args. + */ + args?: any; + + /**returns the current action of PivotGrid control. + */ + action?: string; + + /**returns the custom object bounded with the control. + */ + customObject?: any; + + /**returns the HTML of PivotGrid control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the PivotGrid model. + */ + model?: ej.PivotGrid.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RenderCompleteEventArgs { + + /**returns the original event args. + */ + args?: any; + + /**returns the current action of PivotGrid control. + */ + action?: string; + + /**returns the custom object bounded with the control. + */ + customObject?: any; + + /**returns the HTML of PivotGrid control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the PivotGrid model. + */ + model?: ej.PivotGrid.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RenderFailureEventArgs { + + /**returns the original event args. + */ + args?: any; + + /**returns the current action of PivotGrid control. + */ + action?: string; + + /**returns the custom object bounded with the control. + */ + customObject?: any; + + /**returns the HTML of PivotGrid control. + */ + element?: string; + + /**returns the error message with error code. + */ + message?: any; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the PivotGrid model. + */ + model?: ej.PivotGrid.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RenderSuccessEventArgs { + + /**returns the original event args. + */ + args?: any; + + /**returns the current action of PivotGrid control. + */ + action?: string; + + /**returns the custom object bounded with the control. + */ + customObject?: any; + + /**returns the HTML of PivotGrid control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the PivotGrid model. + */ + model?: ej.PivotGrid.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RowHeaderHyperlinkClickEventArgs { + + /**returns the original event args. + */ + args?: any; + + /**returns the cell position (row index and column index) in table. + */ + cellPosition?: string; + + /**returns the type of the cell. + */ + cellType?: string; + + /**returns the serialized data of the header cells. + */ + rowData?: string; + + /**returns the unique name of levels/members. + */ + uniqueName?: string; +} + +export interface SummaryCellHyperlinkClickEventArgs { + + /**returns the original event args. + */ + args?: any; + + /**returns the cell position (row index and column index) in table. + */ + cellPosition?: string; + + /**returns the type of the cell. + */ + cellType?: string; + + /**returns the serialized data of the header cells. + */ + rowData?: string; + + /**returns the unique name of levels/members. + */ + uniqueName?: string; +} + +export interface ValueCellHyperlinkClickEventArgs { + + /**returns the original event args. + */ + args?: any; + + /**returns the cell position (row index and column index) in table. + */ + cellPosition?: string; + + /**returns the type of the cell. + */ + cellType?: string; + + /**returns the serialized data of the header cells. + */ + rowData?: string; + + /**returns the unique name of levels/members. + */ + uniqueName?: string; +} + +export interface DataSourceValues { + + /**This holds the measures unique names to bind the measures from Cube. + * @Default {[]} + */ + measures?: Array; + + /**To set the axis name in-order to place the measures. + * @Default {“”} + */ + axis?: string; +} + +export interface DataSource { + + /**Contains the database name as string type to fetch the data from the given connection string. + * @Default {“”} + */ + catalog?: string; + + /**Lists out the items to be arranged in column section of PivotGrid. + * @Default {[]} + */ + columns?: Array; + + /**Contains the respective Cube name as string type. + * @Default {“”} + */ + cube?: string; + + /**Provides the raw data source for the PivotGrid. + * @Default {null} + */ + data?: any; + + /**Lists out the items to be arranged in row section of PivotGrid. + * @Default {[]} + */ + rows?: Array; + + /**Lists out the items which supports calculation in PivotGrid. + * @Default {[]} + */ + values?: Array; + + /**Lists out the items which supports filtering of values in PivotGrid. + * @Default {[]} + */ + filters?: Array; +} + +export interface HyperlinkSettings { + + /**Allows the user to enable/disable hyperlink for column header. + * @Default {false} + */ + enableColumnHeaderHyperlink?: boolean; + + /**Allows the user to enable/disable hyperlink for row header. + * @Default {false} + */ + enableRowHeaderHyperlink?: boolean; + + /**Allows the user to enable/disable hyperlink for summary cells. + * @Default {false} + */ + enableSummaryCellHyperlink?: boolean; + + /**Allows the user to enable/disable hyperlink for value cells. + * @Default {false} + */ + enableValueCellHyperlink?: boolean; +} + +export interface ServiceMethodSettings { + + /**Allows the user to set the custom name for the service method that's responsible for drill up/down operation in PivotGrid. + * @Default {DrillGrid} + */ + drillDown?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for exporting. + * @Default {Export} + */ + exportPivotGrid?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for performing server-side actions on defer update. + * @Default {DeferUpdate} + */ + deferUpdate?: string; + + /**Allows the user to set the custom name for the service method that’s responsible to getting the values for the tree-view inside filter dialog. + * @Default {FetchMembers} + */ + fetchMembers?: string; + + /**Allows the user to set the custom name for the service method that's responsible for filtering operation in PivotGrid. + * @Default {Filtering} + */ + filtering?: string; + + /**Allows the user to set the custom name for the service method that's responsible for initializing PivotGrid. + * @Default {InitializeGrid} + */ + initialize?: string; + + /**Allows the user to set the custom name for the service method that's responsible for the server-side action, on dropping a node into Field List. + * @Default {NodeDropped} + */ + nodeDropped?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for the server-side action on changing the checked state of a node in Field List. + * @Default {NodeStateModified} + */ + nodeStateModified?: string; + + /**Allows the user to set the custom name for the service method that's responsible for performing paging operation in PivotGrid. + * @Default {Paging} + */ + paging?: string; + + /**Allows the user to set the custom name for the service method that's responsible for sorting operation in PivotGrid. + * @Default {Sorting} + */ + sorting?: string; +} + +enum Layout{ + + ///To set normal summary layout in PivotGrid. + Normal, + + ///To set layout with summaries at the top in PivotGrid. + NormalTopSummary, + + ///To set layout without summaries in PivotGrid. + NoSummaries, + + ///To set excel-like layout in PivotGrid. + ExcelLikeLayout +} + +} + +class PivotSchemaDesigner extends ej.Widget { + static fn: PivotSchemaDesigner; + constructor(element: JQuery, options?: PivotSchemaDesigner.Model); + constructor(element: Element, options?: PivotSchemaDesigner.Model); + model:PivotSchemaDesigner.Model; + defaults:PivotSchemaDesigner.Model; + + /** Perform an asynchronous HTTP (AJAX) request. + * @returns {void} + */ + doAjaxPost(): void; +} +export module PivotSchemaDesigner{ + +export interface Model { + + /**Specifies the CSS class to PivotSchemaDesigner to achieve custom theme. + * @Default {“”} + */ + cssClass?: string; + + /**Object utilized to pass additional information between client-end and service-end. + * @Default {{}} + */ + customObject?: any; + + /**For ASP.NET and MVC Wrapper, Pivots Schema Designer will be initialized and rendered empty initially. Once PivotGrid widget is rendered completely, Pivots Schema Designer will just be populated with data source by setting this property to “true”. + * @Default {false} + */ + enableWrapper?: boolean; + + /**Allows the user to set the list of filters in filter section. + * @Default {newArray()} + */ + filters?: Array; + + /**Sets the height for PivotSchemaDesigner. + * @Default {“”} + */ + height?: string; + + /**Allows the user to set the localized language for the widget. + * @Default {en-US} + */ + locale?: string; + + /**Allows the user to set list of PivotCalculations in values section. + * @Default {newArray()} + */ + pivotCalculations?: Array; + + /**Allows the user to set the list of PivotItems in column section. + * @Default {newArray()} + */ + pivotColumns?: Array; + + /**Sets the Pivot control bound with this PivotSchemaDesigner. + * @Default {null} + */ + pivotControl?: any; + + /**Allows the user to set the list of PivotItems in row section. + * @Default {newArray()} + */ + pivotRows?: Array; + + /**Allows the user to arrange the fields inside Field List of PivotSchemaDesigner. + * @Default {newArray()} + */ + pivotTableFields?: Array; + + /**Allows the user to set custom name for the methods at service-end, communicated during AJAX post. + * @Default {{}} + */ + serviceMethod?: ServiceMethod; + + /**Connects the service using the specified URL for any server updates. + * @Default {“”} + */ + url?: string; + + /**Sets the width for PivotSchemaDesigner. + * @Default {“”} + */ + width?: string; + + /**Triggers when it reaches client-side after any AJAX request.*/ + afterServiceInvoke? (e: AfterServiceInvokeEventArgs): void; + + /**Triggers before any AJAX request is passed from PivotSchemaDesigner to service methods.*/ + beforeServiceInvoke? (e: BeforeServiceInvokeEventArgs): void; +} + +export interface AfterServiceInvokeEventArgs { + + /**return the current action of PivotSchemaDesigner control. + */ + action?: string; + + /**return the custom object bounds with PivotSchemaDesigner control. + */ + customObject?: any; + + /**return the outer HTML of PivotSchemaDesigner control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the PivotSchemaDesigner model + */ + model?: ej.PivotSchemaDesigner.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface BeforeServiceInvokeEventArgs { + + /**return the current action of PivotSchemaDesigner control. + */ + action?: string; + + /**return the custom object bounds with PivotSchemaDesigner control. + */ + customObject?: any; + + /**return the outer HTML of PivotSchemaDesigner control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the PivotSchemaDesigner model + */ + model?: ej.PivotSchemaDesigner.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface ServiceMethod { + + /**Allows the user to set the custom name for the service method that’s responsible for getting the values for the tree-view inside filter dialog. + * @Default {FetchMembers} + */ + fetchMembers?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for filtering operation in Field List. + * @Default {Filtering} + */ + filtering?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for the server-side action, on expanding members in Field List. + * @Default {MemberExpanded} + */ + memberExpand?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for the server-side action, on dropping a node into Field List. + * @Default {NodeDropped} + */ + nodeDropped?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for the server-side action on changing the checked state of a node in Field List. + * @Default {NodeStateModified} + */ + nodeStateModified?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for remove operation in Field List. + * @Default {RemoveButton} + */ + removeButton?: string; +} +} + +class PivotPager extends ej.Widget { + static fn: PivotPager; + constructor(element: JQuery, options?: PivotPager.Model); + constructor(element: Element, options?: PivotPager.Model); + model:PivotPager.Model; + defaults:PivotPager.Model; + + /** This function initializes the page counts and page numbers for the PivotPager. + * @returns {void} + */ + initPagerProperties(): void; +} +export module PivotPager{ + +export interface Model { + + /**Contains the current page number in categorical axis. + * @Default {1} + */ + categoricalCurrentPage?: number; + + /**Contains the total page count in categorical axis. + * @Default {1} + */ + categoricalPageCount?: number; + + /**Allows the user to set the localized language for the widget. + * @Default {en-US} + */ + locale?: string; + + /**Sets the pager mode (Only Categorical Pager/Only Series Pager/Both) for the PivotPager. + * @Default {ej.PivotPager.Mode.Both} + */ + mode?: ej.PivotPager.Mode|string; + + /**Contains the current page number in series axis. + * @Default {1} + */ + seriesCurrentPage?: number; + + /**Contains the total page count in series axis. + * @Default {1} + */ + seriesPageCount?: number; + + /**Contains the ID of the target element for which paging needs to be done. + * @Default {“”} + */ + targetControlID?: string; +} + +enum Mode{ + + ///To set both categorical and series pager for paging. + Both, + + ///To set only categorical pager for paging. + Categorical, + + ///To set only series pager for paging. + Series +} + +} + +class Schedule extends ej.Widget { + static fn: Schedule; + constructor(element: JQuery, options?: Schedule.Model); + constructor(element: Element, options?: Schedule.Model); + model:Schedule.Model; + defaults:Schedule.Model; + + /** This method is used to delete the appointment based on the guid value or the appointment data passed to it. + * @param {string|any} GUID value of an appointment element or an appointment object + * @returns {void} + */ + deleteAppointment(data: string|any): void; + + /** Destroys the Schedule widget. All the events bound using this._on are unbound automatically and the control is moved to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** Exports the appointments from the Schedule control. + * @param {string} It refers the controller action name to redirect. (For MVC) + * @param {string} It refers the server event name.(For ASP) + * @param {string|number} Pass the id of an appointment, in case if a single appointment needs to be exported. Otherwise, it takes the null value. + * @returns {void} + */ + exportSchedule(action: string, serverEvent: string, id: string|number): void; + + /** Searches the appointments from appointment list of Schedule control. + * @param {Array} Holds array of one or more conditional objects for filtering the appointments based on it. + * @returns {void} + */ + filterAppointments(filterConditions: Array): void; + + /** Gets the appointment list of Schedule control. + * @returns {void} + */ + getAppointments(): void; + + /** Prints the Scheduler. + * @returns {void} + */ + print(): void; + + /** Refreshes the Scroller within Scheduler while using it with some other controls or application. + * @returns {void} + */ + refreshScroller(): void; + + /** It is used to save the appointment. The appointment obj is based on the argument passed along with this method. + * @param {any} appointment object which includes appointment details + * @returns {void} + */ + saveAppointment(appointmentObject: any): void; + + /** Retrieves the time slot information (start/end time and resource details) of the given element. The parameter is optional - as when no element is passed to it, the currently selected cell information will be retrieved. When multiple cells are selected in the Scheduler, it is not necessary to provide the parameter. + * @param {any} TD element object rendered as Scheduler work cell + * @returns {void} + */ + getSlotByElement(element: any): void; + + /** Searches the appointments from the appointment list of Schedule control. + * @param {any|string} Defines the search word or the filter condition, based on which the appointments are filtered from the list. + * @param {string} Defines the field name on which the search is to be made. + * @param {string|string} Defines the filterOperator value for the search operation. + * @param {boolean} Defines the ignoreCase value for performing the search operation. + * @returns {void} + */ + searchAppointments(searchString: any|string, field: string, operator: string|string, ignoreCase: boolean): void; + + /** To refresh the Schedule control. + * @returns {void} + */ + refresh(): void; + + /** Refreshes only the appointments within the Schedule control. + * @returns {void} + */ + refreshAppointment(): void; +} +export module Schedule{ + +export interface Model { + + /**When set to true, Schedule allows the appointments to be dragged and dropped at required time. + * @Default {true} + */ + allowDragAndDrop?: boolean; + + /**When set to true, Scheduler allows interaction through keyboard shortcut keys. + * @Default {true} + */ + allowKeyboardNavigation?: boolean; + + /**It includes the dataSource option and the fields related to Schedule appointments. The appointment fields within the appointmentSettings can accept both string and object type values. To apply validation rules on the appointment window fields, then the appointment fields needs to be defined with object type values. + */ + appointmentSettings?: AppointmentSettings; + + /**Default Value + * @Default {null} + */ + appointmentTemplateId?: string; + + /**Default Value + */ + cssClass?: string; + + /**Sets various categorize colors to the Schedule appointments to differentiate it. + */ + categorizeSettings?: CategorizeSettings; + + /**Sets the height for Schedule cells. + * @Default {20px} + */ + cellHeight?: string; + + /**Sets the width for Schedule cells. + */ + cellWidth?: string; + + /**Holds all options related to the context menu settings of the Schedule. + */ + contextMenuSettings?: ContextMenuSettings; + + /**Sets current date of the Schedule. The Schedule displays initially with the date that is provided here. + * @Default {new Date()} + */ + currentDate?: any; + + /**Sets current view of the Schedule. Schedule renders initially with the view that is specified here. The available views are day, week, workweek, month, agenda and custom view - from which any one of the required view can be set to the Schedule. It accepts both string or enum values. The enum values that are accepted by currentView(ej.Schedule.CurrentView) are as follows, + * @Default {ej.Schedule.CurrentView.Week} + */ + currentView?: string|ej.Schedule.CurrentView; + + /**Sets the date format for Schedule. + */ + dateFormat?: string; + + /**When set to true, shows the previous/next appointment navigator button on the Scheduler. + * @Default {true} + */ + showAppointmentNavigator?: boolean; + + /**When set to true, enables the resize behavior of appointments within the Schedule. + * @Default {true} + */ + enableAppointmentResize?: boolean; + + /**When set to true, enables the loading of Schedule appointments based on your demand. With this load on demand concept, the data consumption of the Schedule can be limited. + * @Default {false} + */ + enableLoadOnDemand?: boolean; + + /**Saves the current model value to browser cookies for state maintenance. When the page gets refreshed, Schedule control values are retained. + * @Default {false} + */ + enablePersistence?: boolean; + + /**When set to true, the Schedule layout and behavior changes as per the common RTL conventions. + * @Default {false} + */ + enableRTL?: boolean; + + /**Sets the end hour time limit to be displayed on the Schedule. + * @Default {24} + */ + endHour?: number; + + /**To configure resource grouping on the Schedule. + */ + group?: Group; + + /**Sets the height of the Schedule. Accepts both pixel and percentage values. + * @Default {1120px} + */ + height?: string; + + /**To define the work hours within the Schedule control. + */ + workHours?: WorkHours; + + /**When set to true, enables the Schedule to observe Daylight Saving Time for supported timezones. + * @Default {false} + */ + isDST?: boolean; + + /**When set to true, adapts the Schedule layout to fit the screen size of devices on which it renders. + * @Default {true} + */ + isResponsive?: boolean; + + /**Sets the specific culture to the Schedule. + * @Default {en-US} + */ + locale?: string; + + /**Sets the maximum date limit to display on the Schedule. Setting maxDate with specific date value disallows the Schedule to navigate beyond that date. + * @Default {new Date(2099, 12, 31)} + */ + maxDate?: any; + + /**Sets the minimum date limit to display on the Schedule. Setting minDate with specific date value disallows the Schedule to navigate beyond that date. + * @Default {new Date(1900, 01, 01)} + */ + minDate?: any; + + /**Sets the mode of Schedule rendering either in a vertical or horizontal direction. It accepts either string("vertical" or "horizontal") or enum values. The enum values that are accepted by orientation(ej.Schedule.Orientation) are as follows, + * @Default {ej.Schedule.Orientation.Vertical} + */ + orientation?: string|ej.Schedule.Orientation; + + /**Holds all the options related to priority settings of the Schedule. + */ + prioritySettings?: PrioritySettings; + + /**When set to true, disables the interaction with the Schedule appointments, simply allowing the date and view navigation to occur. + * @Default {false} + */ + readOnly?: boolean; + + /**Holds all the options related to reminder settings of the Schedule. + */ + reminderSettings?: ReminderSettings; + + /**Defines the specific start and end dates to be rendered in the Schedule control. To render such user-specified custom date ranges in the Schedule control, set the currentView property to customview. + * @Default {null} + */ + renderDates?: RenderDates; + + /**Template design that applies on the Schedule resource header. + * @Default {null} + */ + resourceHeaderTemplateId?: string; + + /**Holds all the options related to the resources settings of the Schedule. It is a collection of one or more resource objects, where the levels of resources are rendered on the Schedule based on the order of the resource data provided within this collection. + * @Default {null} + */ + resources?: Array; + + /**When set to true, displays the all-day row cells on the Schedule. + * @Default {true} + */ + showAllDayRow?: boolean; + + /**When set to true, displays the current time indicator on the Schedule. + * @Default {true} + */ + showCurrentTimeIndicator?: boolean; + + /**When set to true, displays the header bar on the Schedule. + * @Default {true} + */ + showHeaderBar?: boolean; + + /**When set to true, displays the location field additionally on Schedule appointment window. + * @Default {false} + */ + showLocationField?: boolean; + + /**When set to true, displays the quick window for every single click made on the Schedule cells or appointments. + * @Default {true} + */ + showQuickWindow?: boolean; + + /**When set to true, displays the timescale on the left side of the Schedule. + * @Default {true} + */ + showTimeScale?: boolean; + + /**Sets the start hour time range to be displayed on the Schedule. + * @Default {0} + */ + startHour?: number; + + /**Sets either 12 or 24 hour time mode on the Schedule. It accepts either the string value("12" or "24") or the below mentioned enum values. The enum values that are accepted by timeMode(ej.Schedule.TimeMode) are as follows, + * @Default {null} + */ + timeMode?: string|ej.Schedule.TimeMode; + + /**Sets the timezone for the Schedule. + * @Default {null} + */ + timeZone?: string; + + /**Sets the collection of timezone items to be bound to the Schedule. Only the items bound to this property gets listed out in the timezone field of the appointment window. + */ + timeZoneCollection?: TimeZoneCollection; + + /**Defines the view collection to be displayed on the Schedule. By default, it displays all the views namely, Day, Week, WorkWeek and Month. + * @Default {[Day, Week, WorkWeek, Month, Agenda]} + */ + views?: Array; + + /**Sets the width of the Schedule. Accepts both pixel and percentage values. + * @Default {100%} + */ + width?: string; + + /**When set to true, Schedule allows the validation of recurrence pattern to take place before it is being assigned to the appointments. For example, when one of the instance of recurrence appointment is dragged beyond the next or previous instance of the same recurrence appointment, a pop-up is displayed with the validation message disallowing the drag functionality. + * @Default {true} + */ + enableRecurrenceValidation?: boolean; + + /**Sets the week to display more than one week appointment summary. + */ + agendaViewSettings?: AgendaViewSettings; + + /**You can change or set the starting day of the week. + * @Default {null} + */ + firstDayOfWeek?: string; + + /**You can set the workWeek days of the workWeek. + * @Default {[Monday, Tuesday, Wednesday, Thursday, Friday]} + */ + workWeek?: Array; + + /**The tooltip allows to display appointment details in a tooltip while hovering on it. + */ + tooltipSettings?: TooltipSettings; + + /**Holds all the options related to the time scale of Scheduler. The timeslots either major or minor slots can be customized with this property. + */ + timeScale?: TimeScale; + + /**When set to true, shows the delete confirmation dialog before deleting an appointment. + * @Default {true} + */ + showDeleteConfirmationDialog?: boolean; + + /**Accepts the id value of the template layout defined for the all-day cells. + * @Default {null} + */ + allDayCellsTemplateId?: string; + + /**Accepts the id value of the template layout defined for the work cells and month cells. + * @Default {null} + */ + workCellsTemplateId?: string; + + /**Accepts the id value of the template layout defined for the date header cells. + * @Default {null} + */ + dateHeaderTemplateId?: string; + + /**when set to false, allows the height of the work-cells to adjust automatically based on the number of appointment count it has. + * @Default {true} + */ + showOverflowButton?: boolean; + + /**Allows setting draggable area for the Scheduler appointments. Also, turns on the external drag and drop, when set with some specific external drag area name. + */ + appointmentDragArea?: string; + + /**When set to true, displays the other months days from the current month on the Schedule. + * @Default {true} + */ + showNextPrevMonth?: boolean; + + /**Triggers before the action begin of the Schedule.*/ + actionBegin? (e: ActionBeginEventArgs): void; + + /**Triggers after the completion of action in the Schedule.*/ + actionComplete? (e: ActionCompleteEventArgs): void; + + /**Triggers after the appointment is clicked.*/ + appointmentClick? (e: AppointmentClickEventArgs): void; + + /**Triggers before the appointment is being removed from the Scheduler.*/ + beforeAppointmentRemove? (e: BeforeAppointmentRemoveEventArgs): void; + + /**Triggers before the edited appointment is being saved.*/ + beforeAppointmentChange? (e: BeforeAppointmentChangeEventArgs): void; + + /**Triggers after the appointment is hovered.*/ + appointmentHover? (e: AppointmentHoverEventArgs): void; + + /**Triggers before the appointment gets saved.*/ + beforeAppointmentCreate? (e: BeforeAppointmentCreateEventArgs): void; + + /**Triggers before the appointment window opens.*/ + appointmentWindowOpen? (e: AppointmentWindowOpenEventArgs): void; + + /**Triggers before the context menu opens.*/ + beforeContextMenuOpen? (e: BeforeContextMenuOpenEventArgs): void; + + /**Triggers after the cell is clicked.*/ + cellClick? (e: CellClickEventArgs): void; + + /**Triggers after the cell is clicked twice.*/ + cellDoubleClick? (e: CellDoubleClickEventArgs): void; + + /**Triggers after the cell is hovered.*/ + cellHover? (e: CellHoverEventArgs): void; + + /**Triggers while the appointment is being dragged over the work cells.*/ + drag? (e: DragEventArgs): void; + + /**Triggers when the appointment dragging begins.*/ + dragStart? (e: DragStartEventArgs): void; + + /**Triggers when the appointment is dropped.*/ + dragStop? (e: DragStopEventArgs): void; + + /**Triggers after the context menu is clicked.*/ + menuItemClick? (e: MenuItemClickEventArgs): void; + + /**Triggers after the Schedule view or date is navigated.*/ + navigation? (e: NavigationEventArgs): void; + + /**Triggers every time before the elements of the scheduler such as work cells, time cells or header cells and so on renders or re-renders on a page.*/ + queryCellInfo? (e: QueryCellInfoEventArgs): void; + + /**Triggers when the reminder is raised for an appointment.*/ + reminder? (e: ReminderEventArgs): void; + + /**Triggers while resizing the appointment.*/ + resize? (e: ResizeEventArgs): void; + + /**Triggers when the appointment resizing begins.*/ + resizeStart? (e: ResizeStartEventArgs): void; + + /**Triggers when appointment resizing stops.*/ + resizeStop? (e: ResizeStopEventArgs): void; + + /**Triggers when the overflow button is clicked.*/ + overflowButtonClick? (e: OverflowButtonClickEventArgs): void; + + /**Triggers while mouse hovering on the overflow button.*/ + overflowButtonHover? (e: OverflowButtonHoverEventArgs): void; + + /**Triggers when any of the keyboard keys are pressed.*/ + keyDown? (e: KeyDownEventArgs): void; + + /**Triggers after the appointment is saved.*/ + appointmentCreated? (e: AppointmentCreatedEventArgs): void; + + /**Triggers after the appointment is edited.*/ + appointmentChanged? (e: AppointmentChangedEventArgs): void; + + /**Triggers after the appointment is deleted.*/ + appointmentRemoved? (e: AppointmentRemovedEventArgs): void; +} + +export interface ActionBeginEventArgs { + + /**Returns the current date value. + */ + currentDate?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the current view value. + */ + currentView?: string; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the action begin request type. + */ + requestType?: string; + + /**Returns the target of the click. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the save appointment value. + */ + data?: any; + + /**Returns the id of delete appointment. + */ + id?: number; +} + +export interface ActionCompleteEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the data about view change action. + */ + data?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the action complete request type. + */ + requestType?: string; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the appointment data dropped. + */ + appointment?: any; +} + +export interface AppointmentClickEventArgs { + + /**Returns the object of appointmentClick event. + */ + object?: any; + + /**Returns the clicked appointment object. + */ + appointment?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface BeforeAppointmentRemoveEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the deleted appointment object. + */ + appointment?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the Scheduler event. + */ + type?: string; +} + +export interface BeforeAppointmentChangeEventArgs { + + /**Returns the edited appointment object. + */ + appointment?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the Scheduler event. + */ + type?: string; +} + +export interface AppointmentHoverEventArgs { + + /**Returns the object of appointmentHover event. + */ + object?: any; + + /**Returns the hovered appointment object. + */ + appointment?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface BeforeAppointmentCreateEventArgs { + + /**Returns the appointment object. + */ + appointment?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the Scheduler event. + */ + type?: string; +} + +export interface AppointmentWindowOpenEventArgs { + + /**returns the object of appointmentWindowOpen event while selecting the detail option from quick window or edit appointment or edit series option. + */ + object?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the end time of the double clicked cell. + */ + endTime?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the action name that triggers window open. + */ + originalEventType?: string; + + /**Returns the start time of the double clicked cell. + */ + startTime?: any; + + /**Returns the target of the double clicked cell. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the edit appointment object. + */ + appointment?: any; + + /**Returns the edit occurrence option value. + */ + edit?: boolean; +} + +export interface BeforeContextMenuOpenEventArgs { + + /**Returns the object of beforeContextMenuOpen event. + */ + object?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the current cell index value. + */ + cellIndex?: number; + + /**Returns the current date value. + */ + currentDate?: any; + + /**Returns the current resource details, when multiple resources are present, otherwise returns null. + */ + resources?: any; + + /**Returns the current appointment details while opening the menu from appointment. + */ + appointment?: any; + + /**Returns the object of before opening menu target. + */ + events?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface CellClickEventArgs { + + /**Returns the object of cellClick event. + */ + object?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the end time of the clicked cell. + */ + endTime?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the start time of the clicked cell. + */ + startTime?: any; + + /**Returns the target of the clicked cell. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface CellDoubleClickEventArgs { + + /**Returns the object of cellDoubleClick event. + */ + object?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the end time of the double clicked cell. + */ + endTime?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the start time of the double clicked cell. + */ + startTime?: any; + + /**Returns the target of the double clicked cell. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface CellHoverEventArgs { + + /**Returns the object of cellHover event. + */ + object?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the index of the hovered cell. + */ + cellIndex?: any; + + /**Returns the current date of the hovered cell. + */ + currentDate?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the target of the clicked cell. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface DragEventArgs { + + /**Returns the object of dragOver event. + */ + object?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the target of the drag over appointment. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface DragStartEventArgs { + + /**Returns the object of dragStart event. + */ + object?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the target of the dragging appointment. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface DragStopEventArgs { + + /**Returns the object of dragDrop event. + */ + object?: any; + + /**Returns the dropped appointment object. + */ + appointment?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface MenuItemClickEventArgs { + + /**Returns the object of menuItemClick event. + */ + object?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the object of menu item event. + */ + events?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface NavigationEventArgs { + + /**Returns the current date object. + */ + currentDate?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the current view value. + */ + currentView?: string; + + /**Returns the previous view value. + */ + previousView?: string; + + /**Returns the target of the action. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the previous date of the Schedule. + */ + previousDate?: any; +} + +export interface QueryCellInfoEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the current appontment data. + */ + appointment?: any; + + /**Returns the currently rendering DOM element. + */ + element?: any; + + /**Returns the name of the currently rendering element on the scheduler. + */ + requestType?: string; + + /**Returns the cell type which is currently rendering on the Scheduler. + */ + cellType?: string; + + /**Returns the start date of the currently rendering appointment. + */ + currentAppointmentDate?: any; + + /**Returns the currently rendering cell information. + */ + cell?: any; + + /**Returns the currently rendering resource details. + */ + resource?: any; + + /**Returns the currently rendering date information. + */ + currentDay?: any; +} + +export interface ReminderEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the appointment object for which the reminder is raised. + */ + reminderAppointment?: any; +} + +export interface ResizeEventArgs { + + /**Returns the object of resizing event. + */ + object?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the resize element value. + */ + element?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface ResizeStartEventArgs { + + /**Returns the object of resizeStart event. + */ + object?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the resize element value. + */ + element?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface ResizeStopEventArgs { + + /**Returns the object of resizeStop event. + */ + object?: any; + + /**Returns the resized appointment value. + */ + appointment?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the target of the resized appointment. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface OverflowButtonClickEventArgs { + + /**Returns the object consisting of starttime, endtime and resource value of the underlying cell on which the clicked overflow button is present. + */ + object?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the object of menu item event. + */ + events?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface OverflowButtonHoverEventArgs { + + /**Returns the object consisting of starttime, endtime and resource value of the underlying cell on which the overflow button is currently hovered. + */ + object?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the object of menu item event. + */ + events?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface KeyDownEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the object of menu item event. + */ + events?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface AppointmentCreatedEventArgs { + + /**Returns the appointment object. + */ + appointment?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the Scheduler event. + */ + type?: string; +} + +export interface AppointmentChangedEventArgs { + + /**Returns the edited appointment object. + */ + appointment?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the Scheduler event. + */ + type?: string; +} + +export interface AppointmentRemovedEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the deleted appointment object. + */ + appointment?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the Scheduler event. + */ + type?: string; +} + +export interface AppointmentSettings { + + /**Default Value + * @Default {Array} + */ + dataSource?: any|Array; + + /**Default Value + * @Default {null} + */ + query?: string; + + /**Default Value + * @Default {null} + */ + tableName?: string; + + /**Binds the id field name in dataSource to the id of Schedule appointments. It denotes the unique id assigned to appointments. + */ + id?: string; + + /**Binds the name of startTime field in the dataSource with start time of the Schedule appointments. It indicates the date and Time when Schedule appointment actually starts. + */ + startTime?: string; + + /**Binds the name of endTime field in dataSource with the end time of Schedule appointments. It indicates the date and time when Schedule appointment actually ends. + */ + endTime?: string; + + /**Binds the name of subject field in the dataSource to appointment Subject. Indicates the Subject or title that gets displayed on Schedule appointments. + */ + subject?: string; + + /**Binds the description field name in dataSource. It indicates the appointment description. + */ + description?: string; + + /**Binds the name of recurrence field in dataSource. It indicates whether the appointment is a recurrence appointment or not. + */ + recurrence?: string; + + /**Binds the name of recurrenceRule field in dataSource. It indicates the recurrence pattern associated with appointments. + */ + recurrenceRule?: string; + + /**Binds the name of allDay field in dataSource. It indicates whether the appointment is an allday appointment or not. + * @Default {AllDay} + */ + allDay?: string; + + /**Default Value + * @Default {null} + */ + resourceFields?: string; + + /**Default Value + * @Default {null} + */ + categorize?: string; + + /**Default Value + * @Default {null} + */ + location?: string; + + /**Default Value + * @Default {null} + */ + priority?: string; + + /**Default Value + * @Default {StartTimeZone} + */ + startTimeZone?: string; + + /**Default Value + * @Default {EndTimeZone} + */ + endTimeZone?: string; +} + +export interface CategorizeSettings { + + /**Default Value + * @Default {false} + */ + allowMultiple?: boolean; + + /**Default Value + * @Default {false} + */ + enable?: boolean; + + /**Default Value + * @Default {Array} + */ + dataSource?: Array|any; + + /**Binds id field name in the dataSource to id of category data. + * @Default {id} + */ + id?: string; + + /**Binds text field name in the dataSource to category text. + * @Default {text} + */ + text?: string; + + /**Binds color field name in the dataSource to category color. + * @Default {color} + */ + color?: string; + + /**Binds fontColor field name in the dataSource to category font. + * @Default {fontColor} + */ + fontColor?: string; +} + +export interface ContextMenuSettings { + + /**When set to true, enables the context menu options available for the Schedule cells and appointments. + * @Default {false} + */ + enable?: boolean; + + /**Contains all the default context menu options that are applicable for both Schedule cells and appointments. It also supports adding custom menu items to cells or appointment collection. + * @Default {[]} + */ + menuItems?: any; +} + +export interface Group { + + /**Holds the array of resource names to be grouped on the Schedule. + */ + resources?: any; +} + +export interface WorkHours { + + /**When set to true, highlights the work hours of the Schedule. + * @Default {true} + */ + highlight?: boolean; + + /**Sets the start time to depict the start of working or business hour in a day. + * @Default {null} + */ + start?: number; + + /**Sets the end time to depict the end of working or business hour in a day. + * @Default {null} + */ + end?: number; +} + +export interface PrioritySettings { + + /**When set to true, enables the priority options available for the Schedule appointments. + * @Default {false} + */ + enable?: boolean; + + /**The dataSource option can accept the JSON object collection that contains the priority related data. + * @Default {Array} + */ + dataSource?: any|Array; + + /**Binds text field name in the dataSource to prioritySettings text. These text gets listed out in priority field of the appointment window. + * @Default {text} + */ + text?: string; + + /**Binds value field name in the dataSource to prioritySettings value. These field names usually accepts four priority values by default, high, low, medium and none. + * @Default {value} + */ + value?: string; + + /**Allows priority field customization in the appointment window to add custom icons denoting the priority level for the appointments. + * @Default {null} + */ + template?: string; +} + +export interface ReminderSettings { + + /**When set to true, enables the reminder option available for the Schedule appointments. + * @Default {false} + */ + enable?: boolean; + + /**Sets the timing, when the reminders are to be alerted for the Schedule appointments. + * @Default {5} + */ + alertBefore?: number; +} + +export interface RenderDates { + + /**Sets the start of custom date range to be rendered in the Schedule. + * @Default {null} + */ + start?: any; + + /**Sets the end limit of the custom date range. + * @Default {null} + */ + end?: any; +} + +export interface ResourcesResourceSettings { + + /**The dataSource option accepts either JSON object collection or DataManager (ej.DataManager) instance that contains the resources related data. + */ + dataSource?: any|Array; + + /**Binds text field name in the dataSource to resourceSettings text. These text gets listed out in resources field of the appointment window. + */ + text?: string; + + /**Binds id field name in the dataSource to resourceSettings id. + */ + id?: string; + + /**Binds groupId field name in the dataSource to resourceSettings groupId. + */ + groupId?: string; + + /**Binds color field name in the dataSource to resourceSettings color. The color specified here gets applied to the Schedule appointments denoting to the resource it belongs. + */ + color?: string; + + /**Binds the starting work hour field name in the dataSource. It's optional, but when provided with some numeric value will set the starting work hour for specific resources. + */ + start?: string; + + /**Binds the end work hour field name in the dataSource. It's optional, but when provided with some numeric value will set the end work hour for specific resources. + */ + end?: string; + + /**Binds the resources working days field name in the dataSource. It's optional, and accepts the array of strings (week day names). When provided with some values (array of day names), only those days will render for the specific resources. + */ + workWeek?: string; + + /**Binds appointmentClass field name in the dataSource. It applies custom CSS class name to appointments depicting to the resource it belongs. + */ + appointmentClass?: string; +} + +export interface Resources { + + /**It holds the name of the resource field to be bound to the Schedule appointments that contains the resource Id. + * @Default {[]} + */ + field?: string; + + /**It holds the title name of the resource field to be displayed on the Schedule appointment window. + * @Default {[]} + */ + title?: string; + + /**A unique resource name that is used for differentiating various resource objects while grouping it in various levels. + * @Default {[]} + */ + name?: string; + + /**When set to true, allows multiple selection of resource names, thus creating multiple instances of same appointment for the selected resources. + * @Default {[]} + */ + allowMultiple?: string; + + /**It holds the field names of the resources to be bound to the Schedule and also the dataSource. + */ + resourceSettings?: ResourcesResourceSettings; +} + +export interface TimeZoneCollection { + + /**Sets the collection of timezone items to the dataSource that accepts either JSON object collection or DataManager (ej.DataManager) instance that contains Schedule timezones. + */ + dataSource?: any; + + /**Binds text field name in the dataSource to timeZoneCollection text. These text gets listed out in the timezone fields of the appointment window. + */ + text?: string; + + /**Binds id field name in the dataSource to timeZoneCollection id. + */ + id?: string; + + /**Binds value field name in the dataSource to timeZoneCollection value. + */ + value?: string; +} + +export interface AgendaViewSettings { + + /**You can display the summary of multiple week's appointment by setting this value. + * @Default {7} + */ + daysInAgenda?: number; + + /**You can customize the Date column display based on the requirement. + * @Default {null} + */ + dateColumnTemplateId?: string; + + /**You can customize the time column display based on the requirement. + * @Default {null} + */ + timeColumnTemplateId?: string; +} + +export interface TooltipSettings { + + /**To enable or disable the tooltip display. + * @Default {false} + */ + enable?: boolean; + + /**To customize the tooltip display based on your requirements. + * @Default {null} + */ + templateId?: string; +} + +export interface TimeScale { + + /**When set to true, displays the timescale on the Scheduler. + * @Default {null} + */ + enable?: boolean; + + /**When set with some specific value, defines the number of time divisions split per hour(as per value given for the majorTimeSlot). Those time divisions are meant to be the minor slots. + * @Default {2} + */ + minorSlotCount?: number; + + /**Accepts the value in minutes. When provided with specific value, displays the appropriate time interval on the Scheduler + * @Default {60} + */ + majorSlot?: number; + + /**Accepts id value of the template defined for minor time slots + * @Default {null} + */ + minorSlotTemplateId?: string; + + /**Accepts id value of the template defined for major time slots. + * @Default {null} + */ + majorSlotTemplateId?: string; +} + +enum CurrentView{ + + ///Set currentView as Day to Scheduler + Day, + + ///Set currentView as Week to Scheduler + Week, + + ///Set currentView as Workweek to Scheduler + Workweek, + + ///Set currentView as Month to Scheduler + Month, + + ///Set currentView as Agenda to Scheduler + Agenda, + + ///Set currentView as CustomView to Scheduler + CustomView +} + + +enum Orientation{ + + ///Set orientation as vertical to Scheduler + Vertical, + + ///Set orientation as horizontal to Scheduler + Horizontal +} + + +enum TimeMode{ + + ///Set timeMode as 12 hours to Scheduler + Hour12, + + ///Set timeMode as 24 hours to Scheduler + Hour24 +} + +} + +class RecurrenceEditor extends ej.Widget { + static fn: RecurrenceEditor; + static Locale:any; + constructor(element: JQuery, options?: RecurrenceEditorOptions); + constructor(element: Element, options?: RecurrenceEditorOptions); + model:RecurrenceEditorOptions; + defaults:RecurrenceEditorOptions; + recurrenceDateGenerator(recurrenceString: string,strDate:Object): string; + closeRecurPublic(): string; + getRecurrenceRule(): void; + recurrenceRuleSplit(recurrenceRule: string, recurrenceExDate?: string): Object; + +} +interface RecurrenceEditorOptions { + frequencies?: Array; + firstDayOfWeek?: string; + name?: string; + enableSpinners?: boolean; + startDate?: Date; + locale?: string; + enableRTL?: boolean; + value?: string; + dateFormat?: string; + selectedRecurrenceType?: number; + enableRecurrenceValidation?: boolean; + minDate?: Date; + maxDate?: Date; + cssClass?: string; + change?(e: RecurrenceEditorChangeEvent): void; + create?(e: RecurrenceEditorBaseEvent): void; +} +interface RecurrenceEditorBaseEvent extends ej.BaseEvent { + model: RecurrenceEditorOptions; +} +interface RecurrenceEditorChangeEvent extends RecurrenceEditorBaseEvent { + requestType?: string; +} +class Gantt extends ej.Widget { + static fn: Gantt; + constructor(element: JQuery, options?: Gantt.Model); + constructor(element: Element, options?: Gantt.Model); + model:Gantt.Model; + defaults:Gantt.Model; + + /** To add item in gantt + * @param {any} Item to add in Gantt row. + * @param {string} Defines in which position the row wants to add + * @returns {void} + */ + addRecord(data: any, rowPosition: string): void; + + /** Positions the splitter by the specified column index. + * @param {number} Set the splitter position based on column index. + * @returns {void} + */ + setSplitterIndex(index: number): void; + + /** To cancel the edited state of an item in gantt + * @returns {void} + */ + cancelEdit(): void; + + /** To collapse all the parent items in gantt + * @returns {void} + */ + collapseAllItems(): void; + + /** To delete a selected item in gantt + * @returns {void} + */ + deleteItem(): void; + + /** destroy the gantt widget all events bound using this._on will be unbind automatically and bring the control to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** To Expand all the parent items in gantt + * @returns {void} + */ + expandAllItems(): void; + + /** To expand and collapse an item in gantt using item's ID + * @param {number} Exapnd or Collapse a record based on task id. + * @returns {void} + */ + expandCollapseRecord(taskId: number): void; + + /** To hide the column by using header text + * @param {string} you can pass a header text of a column to hide + * @returns {void} + */ + hideColumn(headerText: string): void; + + /** To indent a selected item in gantt + * @returns {void} + */ + indentItem(): void; + + /** To Open the dialog to add new task to the gantt + * @returns {void} + */ + openAddDialog(): void; + + /** To Open the dialog to edit existing task to the gantt + * @returns {void} + */ + openEditDialog(): void; + + /** To outdent a selected item in gantt + * @returns {void} + */ + outdentItem(): void; + + /** To save the edited state of an item in gantt + * @returns {void} + */ + saveEdit(): void; + + /** To search an item with search string provided at the run time + * @param {string} you can pass a text to search in Gantt Control. + * @returns {void} + */ + searchItem(searchString: string): void; + + /** To set the grid width in gantt + * @param {string} you can give either percentage or pixels value + * @returns {void} + */ + setSplitterPosition(width: string): void; + + /** To show the column by using header text + * @param {string} you can pass a header text of a column to show + * @returns {void} + */ + showColumn(headerText: string): void; +} +export module Gantt{ + +export interface Model { + + /**Specifies the fields to be included in the add dialog in gantt + * @Default {[]} + */ + addDialogFields?: Array; + + /**Enables or disables the ability to resize column. + * @Default {false} + */ + allowColumnResize?: boolean; + + /**Enables or Disables gantt chart editing in gantt + * @Default {true} + */ + allowGanttChartEditing?: boolean; + + /**Enables or Disables Keyboard navigation in gantt + * @Default {true} + */ + allowKeyboardNavigation?: boolean; + + /**Specifies enabling or disabling multiple sorting for Gantt columns + * @Default {false} + */ + allowMultiSorting?: boolean; + + /**Enables or disables the interactive selection of a row. + * @Default {true} + */ + allowSelection?: boolean; + + /**Enables or disables sorting. When enabled, we can sort the column by clicking on the column. + * @Default {false} + */ + allowSorting?: boolean; + + /**Enable or disable predecessor validation. When it is true, all the task's start and end dates are aligned based on its predecessors start and end dates. + * @Default {true} + */ + enablePredecessorValidation?: boolean; + + /**Specifies the baseline background color in gantt + * @Default {#fba41c} + */ + baselineColor?: string; + + /**Specifies the mapping property path for baseline end date in datasource + */ + baselineEndDateMapping?: string; + + /**Specifies the mapping property path for baseline start date of a task in datasource + */ + baselineStartDateMapping?: string; + + /**Specifies the mapping property path for sub tasks in datasource + */ + childMapping?: string; + + /**Specifies the background of connector lines in Gantt + */ + connectorLineBackground?: string; + + /**Specifies the width of the connector lines in gantt + * @Default {1} + */ + connectorlineWidth?: number; + + /**Specify the CSS class for gantt to achieve custom theme. + */ + cssClass?: string; + + /**Collection of data or hierarchical data to represent in gantt + * @Default {null} + */ + dataSource?: Array; + + /**Specifies the dateFormat for gantt , given format is displayed in tooltip , grid . + * @Default {MM/dd/yyyy} + */ + dateFormat?: string; + + /**Specifies the mapping property path for duration of a task in datasource + */ + durationMapping?: string; + + /**Specifies the duration unit for each tasks whether days or hours or minutes + * @Default {ej.Gantt.DurationUnit.Day} + */ + durationUnit?: ej.Gantt.DurationUnit|string; + + /**Specifies the fields to be included in the edit dialog in gantt + * @Default {[]} + */ + editDialogFields?: Array; + + /**Option to configure the splitter position. + */ + splitterSettings?: SplitterSettings; + + /**Specifies the editSettings options in gantt. + */ + editSettings?: EditSettings; + + /**Enables or Disables enableAltRow row effect in gantt + * @Default {true} + */ + enableAltRow?: boolean; + + /**Enables or disables the collapse all records when loading the gantt. + * @Default {false} + */ + enableCollapseAll?: boolean; + + /**Enables or disables the contextmenu for gantt , when enabled contextmenu appears on right clicking gantt + * @Default {false} + */ + enableContextMenu?: boolean; + + /**Indicates whether we can edit the progress of a task interactively in gantt chart. + * @Default {true} + */ + enableProgressBarResizing?: boolean; + + /**Enables or disables the option for dynamically updating the Gantt size on window resizing + * @Default {false} + */ + enableResize?: boolean; + + /**Enables or disables tooltip while editing (dragging/resizing) the taskbar. + * @Default {true} + */ + enableTaskbarDragTooltip?: boolean; + + /**Enables or disables tooltip for taskbar. + * @Default {true} + */ + enableTaskbarTooltip?: boolean; + + /**Enables/Disables virtualization for rendering gantt items. + * @Default {false} + */ + enableVirtualization?: boolean; + + /**Specifies the mapping property path for end Date of a task in datasource + */ + endDateMapping?: string; + + /**Specifies whether to highlight the weekends in gantt . + * @Default {true} + */ + highlightWeekends?: boolean; + + /**Collection of holidays with date, background and label information to be displayed in gantt. + * @Default {[]} + */ + holidays?: Array; + + /**Specifies whether to include weekends while calculating the duration of a task. + * @Default {true} + */ + includeWeekend?: boolean; + + /**Specify the locale for gantt + * @Default {en-US} + */ + locale?: string; + + /**Specifies the mapping property path for milestone in datasource + */ + milestoneMapping?: string; + + /**Specifies the background of parent progressbar in gantt + */ + parentProgressbarBackground?: string; + + /**Specifies the background of parent taskbar in gantt + */ + parentTaskbarBackground?: string; + + /**Specifies the mapping property path for parent task Id in self reference datasource + */ + parentTaskIdMapping?: string; + + /**Specifies the mapping property path for predecessors of a task in datasource + */ + predecessorMapping?: string; + + /**Specifies the background of progressbar in gantt + */ + progressbarBackground?: string; + + /**Specified the height of the progressbar in taskbar + * @Default {100} + */ + progressbarHeight?: number; + + /**Specifies the template for tooltip on resizing progressbar + * @Default {null} + */ + progressbarTooltipTemplate?: string; + + /**Specifies the template ID for customized tooltip for progressbar editing in gantt + * @Default {null} + */ + progressbarTooltipTemplateId?: string; + + /**Specifies the mapping property path for progress percentage of a task in datasource + */ + progressMapping?: string; + + /**It receives query to retrieve data from the table (query is same as SQL). + * @Default {null} + */ + query?: any; + + /**Enables or Disables rendering baselines in Gantt , when enabled baseline is rendered in gantt + * @Default {false} + */ + renderBaseline?: boolean; + + /**Specifies the mapping property name for resource ID in resource Collection in gantt + */ + resourceIdMapping?: string; + + /**Specifies the mapping property path for resources of a task in datasource + */ + resourceInfoMapping?: string; + + /**Specifies the mapping property path for resource name of a task in gantt + */ + resourceNameMapping?: string; + + /**Collection of data regarding resources involved in entire project + * @Default {[]} + */ + resources?: Array; + + /**Specifies whether rounding off the day working time edits + * @Default {true} + */ + roundOffDayworkingTime?: boolean; + + /**Specifies the height of a single row in gantt. Also, we need to set same height in the CSS style with class name e-rowcell. + * @Default {30} + */ + rowHeight?: number; + + /**Specifies end date of the gantt schedule. By default, end date will be rounded to its next Saturday. + * @Default {null} + */ + scheduleEndDate?: string; + + /**Specifies the options for customizing schedule header. + */ + scheduleHeaderSettings?: ScheduleHeaderSettings; + + /**Specifies start date of the gantt schedule. By default, start date will be rounded to its previous Sunday. + * @Default {null} + */ + scheduleStartDate?: string; + + /**Specifies the selected row index in gantt + * @Default {null} + */ + selectedItem?: number; + + /**Specifies the selected row Index in gantt , the row with given index will highlighted + * @Default {-1} + */ + selectedRowIndex?: number; + + /**Enables or disables the column chooser. + * @Default {false} + */ + showColumnChooser?: boolean; + + /**Specifies whether to show grid cell tooltip. + * @Default {true} + */ + showGridCellTooltip?: boolean; + + /**Specifies whether to show grid cell tooltip over expander cell alone. + * @Default {true} + */ + showGridExpandCellTooltip?: boolean; + + /**Specifies whether display task progress inside taskbar. + * @Default {true} + */ + showProgressStatus?: boolean; + + /**Specifies whether to display resource names for a task beside taskbar. + * @Default {true} + */ + showResourceNames?: boolean; + + /**Specifies whether to display task name beside task bar. + * @Default {true} + */ + showTaskNames?: boolean; + + /**Specifies the size option of gantt control. + */ + sizeSettings?: SizeSettings; + + /**Specifies the sorting options for gantt. + */ + sortSettings?: SortSettings; + + /**Specifies splitter position in gantt. + * @Default {null} + */ + splitterPosition?: string; + + /**Specifies the mapping property path for start date of a task in datasource + */ + startDateMapping?: string; + + /**Specifies the options for striplines + * @Default {[]} + */ + stripLines?: Array; + + /**Specifies the background of the taskbar in gantt + */ + taskbarBackground?: string; + + /**Specifies the template script for customized tooltip for taskbar editing in gantt + */ + taskbarEditingTooltipTemplate?: string; + + /**Specifies the template Id for customized tooltip for taskbar editing in gantt + */ + taskbarEditingTooltipTemplateId?: string; + + /**Specifies the template for tooltip on mouse action on taskbars + */ + taskbarTooltipTemplate?: string; + + /**Specifies the template id for tooltip on mouse action on taskbars + */ + taskbarTooltipTemplateId?: string; + + /**Specifies the mapping property path for task Id in datasource + */ + taskIdMapping?: string; + + /**Specifies the mapping property path for task name in datasource + */ + taskNameMapping?: string; + + /**Specifies the toolbarSettings options. + */ + toolbarSettings?: ToolbarSettings; + + /**Specifies the tree expander column in gantt + * @Default {0} + */ + treeColumnIndex?: number; + + /**Specifies the weekendBackground color in gantt + * @Default {#F2F2F2} + */ + weekendBackground?: string; + + /**Specifies the working time schedule of day + * @Default {ej.Gantt.workingTimeScale.TimeScale8Hours} + */ + workingTimeScale?: ej.Gantt.workingTimeScale|string; + + /**Triggered for every gantt action before its starts.*/ + actionBegin? (e: ActionBeginEventArgs): void; + + /**Triggered for every gantt action success event.*/ + actionComplete? (e: ActionCompleteEventArgs): void; + + /**Triggered while enter the edit mode in the tree grid cell*/ + beginEdit? (e: BeginEditEventArgs): void; + + /**Triggered after collapsed the gantt record*/ + collapsed? (e: CollapsedEventArgs): void; + + /**Triggered while collapsing the gantt record*/ + collapsing? (e: CollapsingEventArgs): void; + + /**Triggered while Context Menu is rendered in Gantt control*/ + contextMenuOpen? (e: ContextMenuOpenEventArgs): void; + + /**Triggered after save the modified cellValue in gantt.*/ + endEdit? (e: EndEditEventArgs): void; + + /**Triggered after expand the record*/ + expanded? (e: ExpandedEventArgs): void; + + /**Triggered while expanding the gantt record*/ + expanding? (e: ExpandingEventArgs): void; + + /**Triggered while gantt is loaded*/ + load? (e: LoadEventArgs): void; + + /**Triggered while rendering each cell in the tree grid*/ + queryCellInfo? (e: QueryCellInfoEventArgs): void; + + /**Triggered while rendering each taskbar in the gantt chart*/ + queryTaskbarInfo? (e: QueryTaskbarInfoEventArgs): void; + + /**Triggered while rendering each row*/ + rowDataBound? (e: RowDataBoundEventArgs): void; + + /**Triggered after the row is selected.*/ + rowSelected? (e: RowSelectedEventArgs): void; + + /**Triggered before the row is going to be selected.*/ + rowSelecting? (e: RowSelectingEventArgs): void; + + /**Triggered after completing the editing operation in taskbar*/ + taskbarEdited? (e: TaskbarEditedEventArgs): void; + + /**Triggered while editing the gantt chart (dragging, resizing the taskbar )*/ + taskbarEditing? (e: TaskbarEditingEventArgs): void; + + /**Triggered when toolbar item is clicked in Gantt.*/ + toolbarClick? (e: ToolbarClickEventArgs): void; +} + +export interface ActionBeginEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the current grouped column field name. + */ + columnName?: string; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the direction of sorting ascending or descending + */ + columnSortDirection?: string; + + /**Returns the value of searching element. + */ + keyValue?: string; + + /**Returns the data of deleting element. + */ + data?: string; + + /**Returns selected record index + */ + recordIndex?: number; +} + +export interface ActionCompleteEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the current grouped column field name. + */ + columnName?: string; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the direction of sorting ascending or descending + */ + columnSortDirection?: string; + + /**Returns the value of searched element. + */ + keyValue?: string; + + /**Returns the data of deleted element. + */ + data?: string; + + /**Returns selected record index + */ + recordIndex?: number; +} + +export interface BeginEditEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row element of editing cell. + */ + rowElement?: any; + + /**Returns the Element of editing cell. + */ + cellElement?: any; + + /**Returns the data of current cell record. + */ + data?: any; + + /**Returns the column Index of cell belongs. + */ + columnIndex?: number; +} + +export interface CollapsedEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row index of collapsed record. + */ + recordIndex?: number; + + /**Returns the data of collapsed record. + */ + data?: any; + + /**Returns Request Type. + */ + requestType?: string; + + /**Returns state of a record whether it is in expanded or collapsed state. + */ + expanded?: boolean; +} + +export interface CollapsingEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row index of collapsing record. + */ + recordIndex?: number; + + /**Returns the data of edited cell record.. + */ + data?: any; + + /**Returns state of a record whether it is in expanded or collapsed state. + */ + expanded?: boolean; +} + +export interface ContextMenuOpenEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the default context menu items to which we add custom items. + */ + contextMenuItems?: Array; + + /**Returns the gantt model. + */ + model?: any; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface EndEditEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row element of editing cell. + */ + rowElement?: any; + + /**Returns the Element of editing cell. + */ + cellElement?: any; + + /**Returns the data of edited cell record. + */ + data?: any; + + /**Returns the column name of edited cell belongs. + */ + columnName?: string; + + /**Returns the column object of edited cell belongs. + */ + columnObject?: any; +} + +export interface ExpandedEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row index of record. + */ + recordIndex?: number; + + /**Returns the data of expanded record. + */ + data?: any; + + /**Returns Request Type. + */ + requestType?: string; + + /**Returns state of a record whether it is in expanded or collapsed state. + */ + expanded?: boolean; +} + +export interface ExpandingEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row index of record. + */ + recordIndex?: any; + + /**Returns the data of edited cell record.. + */ + data?: any; + + /**Returns state of a record whether it is in expanded or collapsed state. + */ + expanded?: boolean; +} + +export interface LoadEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the gantt model + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface QueryCellInfoEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the selecting cell element. + */ + cellElement?: any; + + /**Returns the value of cell. + */ + cellValue?: string; + + /**Returns the data of current cell record. + */ + data?: any; + + /**Returns the column of cell belongs. + */ + column?: any; +} + +export interface QueryTaskbarInfoEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the taskbar background of current item. + */ + TaskbarBackground?: string; + + /**Returns the progressbar background of current item. + */ + ProgressbarBackground?: string; + + /**Returns the parent taskbar background of current item. + */ + parentTaskbarBackground?: string; + + /**Returns the parent progressbar background of current item. + */ + parentProgressbarBackground?: string; + + /**Returns the data of the record. + */ + data?: any; +} + +export interface RowDataBoundEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row element of rendering row. + */ + rowElement?: any; + + /**Returns the data of rendering row record.. + */ + data?: any; +} + +export interface RowSelectedEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the selecting row element. + */ + targetRow?: any; + + /**Returns the index of selecting row record. + */ + recordIndex?: number; + + /**Returns the data of selected record. + */ + data?: any; +} + +export interface RowSelectingEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the data selecting record. + */ + data?: any; + + /**Returns the index of selecting row record. + */ + recordIndex?: string; + + /**Returns the selecting row chart element. + */ + targetChartRow?: any; + + /**Returns the selecting row grid element. + */ + targetGridRow?: any; + + /**Returns the previous selected data. + */ + previousData?: any; + + /**Returns the previous selected row index. + */ + previousIndex?: string; + + /**Returns the previous selected row chart element. + */ + previousChartRow?: any; + + /**Returns the previous selected row grid element. + */ + previousGridRow?: any; +} + +export interface TaskbarEditedEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the data of edited record. + */ + data?: any; + + /**Returns the previous data value of edited record. + */ + previousData?: any; + + /**Returns 'true' if taskbar is dragged. + */ + dragging?: boolean; + + /**Returns 'true' if taskbar is left resized. + */ + leftResizing?: boolean; + + /**Returns 'true' if taskbar is right resized. + */ + rightResizing?: boolean; + + /**Returns 'true' if taskbar is progress resized. + */ + progressResizing?: boolean; + + /**Returns the field values of record being edited. + */ + editingFields?: any; + + /**Returns the gantt model. + */ + model?: any; +} + +export interface TaskbarEditingEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the gantt model. + */ + model?: any; + + /**Returns the row object being edited. + */ + rowData?: any; + + /**Returns the field values of record being edited. + */ + editingFields?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface ToolbarClickEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the current item. + */ + currentTarget?: any; + + /**Returns the Gantt model. + */ + model?: any; + + /**Returns the name of the toolbar item on which mouse click has been performed + */ + itemName?: string; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface SplitterSettings { + + /**Specifies position of the splitter in Gantt , splitter can be placed either based on percentage values or pixel values. + */ + position?: string; + + /**Specifies the position of splitter in Gantt, based on column index in Gantt. + */ + index?: string; +} + +export interface EditSettings { + + /**Enables or disables add record icon in gantt toolbar + * @Default {false} + */ + allowAdding?: boolean; + + /**Enables or disables delete icon in gantt toolbar + * @Default {false} + */ + allowDeleting?: boolean; + + /**Specifies the option for enabling or disabling editing in Gantt grid part + * @Default {false} + */ + allowEditing?: boolean; + + /**Specifies the edit mode in Gantt, "normal" is for dialog editing ,"cellEditing" is for cell type editing + * @Default {normal} + */ + editMode?: string; +} + +export interface ScheduleHeaderSettings { + + /**Specified the format for day view in schedule header + * @Default {ddd} + */ + dayHeaderFormat?: string; + + /**Specified the format for Hour view in schedule header + * @Default {HH} + */ + hourHeaderFormat?: string; + + /**Specifies the number of minutes per interval + * @Default {ej.Gantt.minutesPerInterval.Auto} + */ + minutesPerInterval?: ej.Gantt.minutesPerInterval|string; + + /**Specified the format for month view in schedule header + * @Default {MMM} + */ + monthHeaderFormat?: string; + + /**Specifies the schedule mode + * @Default {ej.Gantt.ScheduleHeaderType.Week} + */ + scheduleHeaderType?: ej.Gantt.ScheduleHeaderType|string; + + /**Specified the background for weekends in gantt + * @Default {#F2F2F2} + */ + weekendBackground?: string; + + /**Specified the format for week view in schedule header + * @Default {ddd} + */ + weekHeaderFormat?: string; + + /**Specified the format for year view in schedule header + * @Default {yyyy} + */ + yearHeaderFormat?: string; +} + +export interface SizeSettings { + + /**Specifies the height of gantt control + * @Default {450px} + */ + height?: string; + + /**Specifies the width of gantt control + * @Default {1000px} + */ + width?: string; +} + +export interface SortSettings { + + /**Specifies the sorted columns for gantt + * @Default {[]} + */ + sortedColumns?: Array; +} + +export interface ToolbarSettings { + + /**Specifies the state of enabling or disabling toolbar + * @Default {true} + */ + showToolBar?: boolean; + + /**Specifies the list of toolbar items to rendered in toolbar + * @Default {[]} + */ + toolbarItems?: Array; +} + +enum DurationUnit{ + + ///Sets the Duration Unit as day. + Day, + + ///Sets the Duration Unit as hour. + Hour, + + ///Sets the Duration Unit as minute. + Minute +} + + +enum minutesPerInterval{ + + ///Sets the interval automatically according with schedule start and end date. + Auto, + + ///Sets one minute intervals per hour. + OneMinute, + + ///Sets Five minute intervals per hour. + FiveMinutes, + + ///Sets fifteen minute intervals per hour. + FifteenMinutes, + + ///Sets thirty minute intervals per hour. + ThirtyMinutes +} + + +enum ScheduleHeaderType{ + + ///Sets year Schedule Mode. + Year, + + ///Sets month Schedule Mode. + Month, + + ///Sets week Schedule Mode. + Week, + + ///Sets day Schedule Mode. + Day, + + ///Sets hour Schedule Mode. + Hour +} + + +enum workingTimeScale{ + + ///Sets eight hour timescale. + TimeScale8Hours, + + ///Sets twenty four hour timescale. + TimeScale24Hours +} + +} + +class ReportViewer extends ej.Widget { + static fn: ReportViewer; + constructor(element: JQuery, options?: ReportViewer.Model); + constructor(element: Element, options?: ReportViewer.Model); + model:ReportViewer.Model; + defaults:ReportViewer.Model; + + /** Export the report to the specified format. + * @returns {void} + */ + exportReport(): void; + + /** Fit the report page to the container. + * @returns {void} + */ + fitToPage(): void; + + /** Fit the report page height to the container. + * @returns {void} + */ + fitToPageHeight(): void; + + /** Fit the report page width to the container. + * @returns {void} + */ + fitToPageWidth(): void; + + /** Get the available datasets name of the rdlc report. + * @returns {void} + */ + getDataSetNames(): void; + + /** Get the available parameters of the report. + * @returns {void} + */ + getParameters(): void; + + /** Navigate to first page of report. + * @returns {void} + */ + gotoFirstPage(): void; + + /** Navigate to last page of the report. + * @returns {void} + */ + gotoLastPage(): void; + + /** Navigate to next page from the current page. + * @returns {void} + */ + gotoNextPage(): void; + + /** Go to specific page index of the report. + * @returns {void} + */ + gotoPageIndex(): void; + + /** Navigate to previous page from the current page. + * @returns {void} + */ + gotoPreviousPage(): void; + + /** Print the report. + * @returns {void} + */ + print(): void; + + /** Apply print layout to the report. + * @returns {void} + */ + printLayout(): void; + + /** Refresh the report. + * @returns {void} + */ + refresh(): void; +} +export module ReportViewer{ + +export interface Model { + + /**Gets or sets the list of data sources for the RDLC report. + * @Default {[]} + */ + dataSources?: Array; + + /**Enables or disables the page cache of report. + * @Default {false} + */ + enablePageCache?: boolean; + + /**Specifies the export settings. + */ + exportSettings?: ExportSettings; + + /**When set to true, adapts the report layout to fit the screen size of devices on which it renders. + * @Default {true} + */ + isResponsive?: boolean; + + /**Specifies the locale for report viewer. + * @Default {en-US} + */ + locale?: string; + + /**Specifies the page settings. + */ + pageSettings?: PageSettings; + + /**Gets or sets the list of parameters associated with the report. + * @Default {[]} + */ + parameters?: Array; + + /**Enables and disables the print mode. + * @Default {false} + */ + printMode?: boolean; + + /**Specifies the print option of the report. + * @Default {ej.ReportViewer.PrintOptions.Default} + */ + printOptions?: ej.ReportViewer.PrintOptions|string; + + /**Specifies the processing mode of the report. + * @Default {ej.ReportViewer.ProcessingMode.Remote} + */ + processingMode?: ej.ReportViewer.ProcessingMode|string; + + /**Specifies the render layout. + * @Default {ej.ReportViewer.RenderMode.Default} + */ + renderMode?: ej.ReportViewer.RenderMode|string; + + /**Gets or sets the path of the report file. + * @Default {empty} + */ + reportPath?: string; + + /**Gets or sets the reports server url. + * @Default {empty} + */ + reportServerUrl?: string; + + /**Specifies the report Web API service url. + * @Default {empty} + */ + reportServiceUrl?: string; + + /**Specifies the toolbar settings. + */ + toolbarSettings?: ToolbarSettings; + + /**Gets or sets the zoom factor for report viewer. + * @Default {1} + */ + zoomFactor?: number; + + /**Fires when the report viewer is destroyed successfully.If you want to perform any operation after destroying the reportviewer control,you can make use of the destroy event.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires during drill through action done in report.If you want to perform any operation when a drill through action is performed, you can make use of the drillThrough event.*/ + drillThrough? (e: DrillThroughEventArgs): void; + + /**Fires before report rendering is completed.If you want to perform any operation before the rendering of report,you can make use of the renderingBegin event.*/ + renderingBegin? (e: RenderingBeginEventArgs): void; + + /**Fires after report rendering completed.If you want to perform any operation after the rendering of report,you can make use of this renderingComplete event.*/ + renderingComplete? (e: RenderingCompleteEventArgs): void; + + /**Fires when any error occurred while rendering the report.If you want to perform any operation when an error occurs in the report, you can make use of the reportError event.*/ + reportError? (e: ReportErrorEventArgs): void; + + /**Fires when the report is being exported.If you want to perform any operation before exporting of report, you can make use of the reportExport event.*/ + reportExport? (e: ReportExportEventArgs): void; + + /**Fires when the report is loaded.If you want to perform any operation after the successful loading of report, you can make use of the reportLoaded event.*/ + reportLoaded? (e: ReportLoadedEventArgs): void; + + /**Fires when click the View Report Button.*/ + viewReportClick? (e: ViewReportClickEventArgs): void; +} + +export interface DestroyEventArgs { + + /**true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the report model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface DrillThroughEventArgs { + + /**true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the actionInfo's parameters bookmarkLink, hyperLink, reportName, parameters. + */ + actionInfo?: any; + + /**returns the report model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RenderingBeginEventArgs { + + /**true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the report model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RenderingCompleteEventArgs { + + /**true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the report model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns the collection of parameters. + */ + reportParameters?: any; +} + +export interface ReportErrorEventArgs { + + /**true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the error details. + */ + error?: string; + + /**returns the report model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface ReportExportEventArgs { + + /**true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the report model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface ReportLoadedEventArgs { + + /**true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the report model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface ViewReportClickEventArgs { + + /**true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the parameter collection. + */ + parameters?: any; + + /**returns the report model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface DataSources { + + /**Gets or sets the name of the data source. + * @Default {empty} + */ + name?: string; + + /**Gets or sets the values of data source. + * @Default {[]} + */ + values?: Array; +} + +export interface ExportSettings { + + /**Specifies the export formats. + * @Default {ej.ReportViewer.ExportOptions.All} + */ + exportOptions?: ej.ReportViewer.ExportOptions|string; + + /**Specifies the excel export format. + * @Default {ej.ReportViewer.ExcelFormats.Excel97to2003} + */ + excelFormat?: ej.ReportViewer.ExcelFormats|string; + + /**Specifies the word export format. + * @Default {ej.ReportViewer.WordFormats.Doc} + */ + wordFormat?: ej.ReportViewer.WordFormats|string; +} + +export interface PageSettings { + + /**Specifies the print layout orientation. + * @Default {null} + */ + orientation?: ej.ReportViewer.Orientation|string; + + /**Specifies the paper size of print layout. + * @Default {null} + */ + paperSize?: ej.ReportViewer.PaperSize|string; +} + +export interface Parameters { + + /**Gets or sets the parameter labels. + * @Default {null} + */ + labels?: Array; + + /**Gets or sets the name of the parameter. + * @Default {empty} + */ + name?: string; + + /**Gets or sets whether the parameter allows nullable value or not. + * @Default {false} + */ + nullable?: boolean; + + /**Gets or sets the prompt message associated with the specified parameter. + * @Default {empty} + */ + prompt?: string; + + /**Gets or sets the parameter values. + * @Default {[]} + */ + values?: Array; +} + +export interface ToolbarSettings { + + /**Fires when user click on toolbar item in the toolbar. + * @Default {empty} + */ + click?: string; + + /**Specifies the toolbar items. + * @Default {ej.ReportViewer.ToolbarItems.All} + */ + items?: ej.ReportViewer.ToolbarItems|string; + + /**Shows or hides the toolbar. + * @Default {true} + */ + showToolbar?: boolean; + + /**Shows or hides the tooltip of toolbar items. + * @Default {true} + */ + showTooltip?: boolean; + + /**Specifies the toolbar template ID. + * @Default {empty} + */ + templateId?: string; +} + +enum ExportOptions{ + + ///Specifies the All property in ExportOptions to get all availble options. + All, + + ///Specifies the Pdf property in ExportOptions to get Pdf option. + Pdf, + + ///Specifies the Word property in ExportOptions to get Word option. + Word, + + ///Specifies the Excel property in ExportOptions to get Excel option. + Excel, + + ///Specifies the Html property in ExportOptions to get Html option. + Html +} + + +enum ExcelFormats{ + + ///Specifies the Excel97to2003 property in ExcelFormats to get specified version of exported format. + Excel97to2003, + + ///Specifies the Excel2007 property in ExcelFormats to get specified version of exported format. + Excel2007, + + ///Specifies the Excel2010 property in ExcelFormats to get specified version of exported format. + Excel2010, + + ///Specifies the Excel2013 property in ExcelFormats to get specified version of exported format. + Excel2013 +} + + +enum WordFormats{ + + ///Specifies the Doc property in WordFormats to get specified version of exported format. + Doc, + + ///Specifies the Dot property in WordFormats to get specified version of exported format. + Dot, + + ///Specifies the Docx property in WordFormats to get specified version of exported format. + Docx, + + ///Specifies the Word2007 property in WordFormats to get specified version of exported format. + Word2007, + + ///Specifies the Word2010 property in WordFormats to get specified version of exported format. + Word2010, + + ///Specifies the Word2013 property in WordFormats to get specified version of exported format. + Word2013, + + ///Specifies the Word2007Dotx property in WordFormats to get specified version of exported format. + Word2007Dotx, + + ///Specifies the Word2010Dotx property in WordFormats to get specified version of exported format. + Word2010Dotx, + + ///Specifies the Word2013Dotx property in WordFormats to get specified version of exported format. + Word2013Dotx, + + ///Specifies the Word2007Docm property in WordFormats to get specified version of exported format. + Word2007Docm, + + ///Specifies the Word2010Docm property in WordFormats to get specified version of exported format. + Word2010Docm, + + ///Specifies the Word2013Docm property in WordFormats to get specified version of exported format. + Word2013Docm, + + ///Specifies the Word2007Dotm property in WordFormats to get specified version of exported format. + Word2007Dotm, + + ///Specifies the Word2010Dotm property in WordFormats to get specified version of exported format. + Word2010Dotm, + + ///Specifies the Word2013Dotm property in WordFormats to get specified version of exported format. + Word2013Dotm, + + ///Specifies the Rtf property in WordFormats to get specified version of exported format. + Rtf, + + ///Specifies the Txt property in WordFormats to get specified version of exported format. + Txt, + + ///Specifies the EPub property in WordFormats to get specified version of exported format. + EPub, + + ///Specifies the Html property in WordFormats to get specified version of exported format. + Html, + + ///Specifies the Xml property in WordFormats to get specified version of exported format. + Xml, + + ///Specifies the Automatic property in WordFormats to get specified version of exported format. + Automatic +} + + +enum Orientation{ + + ///Specifies the Landscape property in pageSettings.orientation to get specified layout. + Landscape, + + ///Specifies the portrait property in pageSettings.orientation to get specified layout. + Portrait +} + + +enum PaperSize{ + + ///Specifies the A3 as value in pageSettings.paperSize to get specified size. + A3, + + ///Specifies the A4 as value in pageSettings.paperSize to get specified size. + Portrait, + + ///Specifies the B4(JIS) as value in pageSettings.paperSize to get specified size. + B4_JIS, + + ///Specifies the B5(JIS) as value in pageSettings.paperSize to get specified size. + B5_JIS, + + ///Specifies the Envelope #10 as value in pageSettings.paperSize to get specified size. + Envelope_10, + + ///Specifies the Envelope as value in pageSettings.paperSize to get specified size. + Envelope_Monarch, + + ///Specifies the Executive as value in pageSettings.paperSize to get specified size. + Executive, + + ///Specifies the Legal as value in pageSettings.paperSize to get specified size. + Legal, + + ///Specifies the Letter as value in pageSettings.paperSize to get specified size. + Letter, + + ///Specifies the Tabloid as value in pageSettings.paperSize to get specified size. + Tabloid, + + ///Specifies the Custom as value in pageSettings.paperSize to get specified size. + Custom +} + + +enum PrintOptions{ + + ///Specifies the Default property in printOptions. + Default, + + ///Specifies the NewTab property in printOptions. + NewTab, + + ///Specifies the None property in printOptions. + None +} + + +enum ProcessingMode{ + + ///Specifies the Remote property in processingMode. + Remote, + + ///Specifies the Local property in processingMode. + Local +} + + +enum RenderMode{ + + ///Specifies the Default property in RenderMode to get default output. + Default, + + ///Specifies the Mobile property in RenderMode to get specified output. + Mobile, + + ///Specifies the Desktop property in RenderMode to get specified output. + Desktop +} + + +enum ToolbarItems{ + + ///Specifies the Print as value in ToolbarItems to get specified item. + Print, + + ///Specifies the Refresh as value in ToolbarItems to get specified item. + Refresh, + + ///Specifies the Zoom as value in ToolbarItems to get specified item. + Zoom, + + ///Specifies the FittoPage as value in ToolbarItems to get specified item. + FittoPage, + + ///Specifies the Export as value in ToolbarItems to get specified item. + Export, + + ///Specifies the PageNavigation as value in ToolbarItems to get specified item. + PageNavigation, + + ///Specifies the Parameters as value in ToolbarItems to get specified item. + Parameters, + + ///Specifies the PrintLayout as value in ToolbarItems to get specified item. + PrintLayout, + + ///Specifies the PageSetup as value in ToolbarItems to get specified item. + PageSetup +} + +} + +class TreeGrid extends ej.Widget { + static fn: TreeGrid; + constructor(element: JQuery, options?: TreeGrid.Model); + constructor(element: Element, options?: TreeGrid.Model); + model:TreeGrid.Model; + defaults:TreeGrid.Model; + + /** To clear all the selection in TreeGrid + * @param {number} you can pass a row index to clear the row selection. + * @returns {void} + */ + clearSelection(index: number): void; + + /** To collapse all the parent items in tree grid + * @returns {void} + */ + collapseAll(): void; + + /** To hide the column by using header text + * @param {string} you can pass a header text of a column to hide. + * @returns {void} + */ + hideColumn(headerText: string): void; + + /** To refresh the changes in tree grid + * @param {Array} Pass which data source you want to show in tree grid + * @param {any} Pass which data you want to show in tree grid + * @returns {void} + */ + refresh(dataSource: Array, query: any): void; + + /** Freeze all the columns preceding to the column specified by the field name. + * @param {string} Freeze all Columns before this field column. + * @returns {void} + */ + freezePrecedingColumns (field: string): void; + + /** Freeze/unfreeze the specified column. + * @param {string} Freeze/Unfreeze this field column. + * @param {boolean} Decides to Freeze/Unfreeze this field column. + * @returns {void} + */ + freezeColumn (field: string, isFrozen: boolean): void; + + /** To save the edited cell in TreeGrid + * @returns {void} + */ + saveCell(): void; + + /** To search an item with search string provided at the run time + * @param {string} you can pass a searchString to search the tree grid + * @returns {void} + */ + search(searchString: string): void; + + /** To show the column by using header text + * @param {string} you can pass a header text of a column to show. + * @returns {void} + */ + showColumn(headerText: string): void; + + /** To sorting the data based on the particular fields + * @param {string} you can pass a name of column to sort. + * @param {string} you can pass a sort direction to sort the column. + * @returns {void} + */ + sortColumn(columnName: string, columnSortDirection: string): void; +} +export module TreeGrid{ + +export interface Model { + + /**Enables or disables the ability to resize the column width interactively. + * @Default {false} + */ + allowColumnResize?: boolean; + + /**Enables or disables the ability to drag and drop the row interactively to reorder the rows. + * @Default {false} + */ + allowDragAndDrop?: boolean; + + /**Enables or disables the ability to filter the data on all the columns. Enabling this property will display a row with editor controls corresponding to each column. You can restrict filtering on particular column by disabling this property directly on that column instance itself. + * @Default {false} + */ + allowFiltering?: boolean; + + /**Enables or disables keyboard navigation. + * @Default {true} + */ + allowKeyboardNavigation?: boolean; + + /**Enables or disables the ability to sort the rows based on multiple columns/fields by clicking on each column header. Rows will be sorted recursively on clicking the column headers. + * @Default {false} + */ + allowMultiSorting?: boolean; + + /**Enables or disables the ability to select a row interactively. + * @Default {true} + */ + allowSelection?: boolean; + + /**Enables or disables the ability to sort the rows based on a single field/column by clicking on that column header. When enabled, rows can be sorted only by single field/column. + * @Default {false} + */ + allowSorting?: boolean; + + /**Specifies the id of the template that has to be applied for alternate rows. + */ + altRowTemplateID?: string; + + /**Specifies the mapping property path for sub tasks in datasource + */ + childMapping?: string; + + /**Option for adding columns; each column has the option to bind to a field in the dataSource. + */ + columns?: Array; + + /**Options for displaying and customizing context menu items. + */ + contextMenuSettings?: ContextMenuSettings; + + /**Specifies hierarchical or self-referential data to populate the TreeGrid. + * @Default {null} + */ + dataSource?: Array; + + /**Specifies whether to wrap the header text when it is overflown i.e., when it exceeds the header width. + * @Default {none} + */ + headerTextOverflow?: string; + + /**Options for displaying and customizing the tooltip. This tooltip will show the preview of the row that is being dragged. + */ + dragTooltip?: DragTooltip; + + /**Options for enabling and configuring the editing related operations. + */ + editSettings?: EditSettings; + + /**Specifies whether to render alternate rows in different background colors. + * @Default {true} + */ + enableAltRow?: boolean; + + /**Specifies whether to load all the rows in collapsed state when the TreeGrid is rendered for the first time. + * @Default {false} + */ + enableCollapseAll?: boolean; + + /**Specifies whether to resize TreeGrid whenever window size changes. + * @Default {false} + */ + enableResize?: boolean; + + /**Specifies whether to render only the visual elements that are visible in the UI. When you enable this property, it will reduce the loading time for loading large number of records. + * @Default {false} + */ + enableVirtualization?: boolean; + + /**Specifies if the filtering should happen immediately on each key press or only on pressing enter key. + * @Default {immediate} + */ + filterBarMode?: string; + + /**Specifies the name of the field in the dataSource, which contains the id of that row. + */ + idMapping?: string; + + /**Specifies the name of the field in the dataSource, which contains the parent’s id. This is necessary to form a parent-child hierarchy, if the dataSource contains self-referential data. + */ + parentIdMapping?: string; + + /**Specifies ej.Query to select data from the dataSource. This property is applicable only when the dataSource is ej.DataManager. + * @Default {null} + */ + query?: any; + + /**Specifies the height of a single row in tree grid. Also, we need to set same height in the CSS style with class name e-rowcell. + * @Default {30} + */ + rowHeight?: number; + + /**Specifies the id of the template to be applied for all the rows. + */ + rowTemplateID?: string; + + /**Specifies the index of the selected row. + * @Default {-1} + */ + selectedRowIndex?: number; + + /**Specifies the type of selection whether to select single row or multiple rows. + * @Default {ej.TreeGrid.SelectionType.Single} + */ + selectionType?: ej.Gantt.SelectionType|string; + + /**Controls the visibility of the menu button, which is displayed on the column header. Clicking on this button will show a popup menu. When you choose “Columns” item from this popup, a list box with column names will be shown, from which you can select/deselect a column name to control the visibility of the respective columns. + * @Default {false} + */ + showColumnChooser?: boolean; + + /**Specifies whether to show tooltip when mouse is hovered on the cell. + * @Default {true} + */ + showGridCellTooltip?: boolean; + + /**Specifies whether to show tooltip for the cells, which has expander button. + * @Default {true} + */ + showGridExpandCellTooltip?: boolean; + + /**Options for setting width and height for TreeGrid. + */ + sizeSettings?: SizeSettings; + + /**Options for sorting the rows. + */ + sortSettings?: SortSettings; + + /**Options for displaying and customizing the toolbar items. + */ + toolbarSettings?: ToolbarSettings; + + /**Specifies the index of the column that needs to have the expander button. By default, cells in the first column contain the expander button. + * @Default {0} + */ + treeColumnIndex?: number; + + /**Triggered before every success event of TreeGrid action.*/ + actionBegin? (e: ActionBeginEventArgs): void; + + /**Triggered for every TreeGrid action success event.*/ + actionComplete? (e: ActionCompleteEventArgs): void; + + /**Triggered while enter the edit mode in the TreeGrid cell*/ + beginEdit? (e: BeginEditEventArgs): void; + + /**Triggered after collapsed the TreeGrid record*/ + collapsed? (e: CollapsedEventArgs): void; + + /**Triggered while collapsing the TreeGrid record*/ + collapsing? (e: CollapsingEventArgs): void; + + /**Triggered while Context Menu is rendered in TreeGrid control*/ + contextMenuOpen? (e: ContextMenuOpenEventArgs): void; + + /**Triggered after saved the modified cellValue in TreeGrid*/ + endEdit? (e: EndEditEventArgs): void; + + /**Triggered after expand the record*/ + expanded? (e: ExpandedEventArgs): void; + + /**Triggered while expanding the TreeGrid record*/ + expanding? (e: ExpandingEventArgs): void; + + /**Triggered while Treegrid is loaded*/ + load? (e: LoadEventArgs): void; + + /**Triggered while rendering each cell in the TreeGrid*/ + queryCellInfo? (e: QueryCellInfoEventArgs): void; + + /**Triggered while rendering each row*/ + rowDataBound? (e: RowDataBoundEventArgs): void; + + /**Triggered while dragging a row in TreeGrid control*/ + rowDrag? (e: RowDragEventArgs): void; + + /**Triggered while start to drag row in TreeGrid control*/ + rowDragStart? (e: RowDragStartEventArgs): void; + + /**Triggered while drop a row in TreeGrid control*/ + rowDragStop? (e: RowDragStopEventArgs): void; + + /**Triggered after the row is selected.*/ + rowSelected? (e: RowSelectedEventArgs): void; + + /**Triggered before the row is going to be selected.*/ + rowSelecting? (e: RowSelectingEventArgs): void; + + /**Triggered when toolbar item is clicked in TreeGrid.*/ + toolbarClick? (e: ToolbarClickEventArgs): void; +} + +export interface ActionBeginEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the current grouped column field name. + */ + columnName?: string; + + /**Returns the TreeGrid model. + */ + model?: any; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the direction of sorting ascending or descending. + */ + columnSortDirection?: string; + + /**Returns the value of expanding parent element. + */ + keyValue?: string; + + /**Returns the data or deleting element. + */ + data?: string; +} + +export interface ActionCompleteEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the current grouped column field name. + */ + columnName?: string; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the direction of sorting ascending or descending + */ + columnSortDirection?: string; + + /**Returns the value of searched element. + */ + keyValue?: string; + + /**Returns the data of deleted element. + */ + data?: string; + + /**Returns selected record index + */ + recordIndex?: number; +} + +export interface BeginEditEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row element of editing cell. + */ + rowElement?: any; + + /**Returns the Element of editing cell. + */ + cellElement?: any; + + /**Returns the data of current cell record. + */ + data?: any; + + /**Returns the column Index of cell belongs. + */ + columnIndex?: number; +} + +export interface CollapsedEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row index of collapsed record. + */ + recordIndex?: number; + + /**Returns the data of collpsed record.. + */ + data?: any; + + /**Returns Request Type. + */ + requestType?: string; + + /**Returns state of a record whether it is in expanded or collapsed state. + */ + expanded?: boolean; + + /**Returns the event type. + */ + type?: string; +} + +export interface CollapsingEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row index of collapsing record. + */ + recordIndex?: number; + + /**Returns the data of collapsing record.. + */ + data?: any; + + /**Returns the event Type. + */ + type?: string; + + /**Returns state of a record whether it is in expanded or collapsing state. + */ + expanded?: boolean; +} + +export interface ContextMenuOpenEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the default context menu items to which we add custom items. + */ + contextMenuItems?: Array; + + /**Returns the TreeGrid model. + */ + model?: any; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface EndEditEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row element of editing cell. + */ + rowElement?: any; + + /**Returns the Element of editing cell. + */ + cellElement?: any; + + /**Returns the data of edited cell record. + */ + data?: any; + + /**Returns the column name of edited cell belongs. + */ + columnName?: string; + + /**Returns the column object of edited cell belongs. + */ + columnObject?: any; +} + +export interface ExpandedEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row index of expanded record. + */ + recordIndex?: number; + + /**Returns the data of expanded record.. + */ + data?: any; + + /**Returns Request Type. + */ + requestType?: string; + + /**Returns state of a record whether it is in expanded or expanded state. + */ + expanded?: boolean; + + /**Returns the event type. + */ + type?: string; +} + +export interface ExpandingEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row index of expanding record. + */ + recordIndex?: number; + + /**Returns the data of expanding record.. + */ + data?: any; + + /**Returns the event Type. + */ + type?: string; + + /**Returns state of a record whether it is in expanded or collapsed state. + */ + expanded?: boolean; +} + +export interface LoadEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the TreeGrid model + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface QueryCellInfoEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the selecting cell element. + */ + cellElement?: any; + + /**Returns the value of cell. + */ + cellValue?: string; + + /**Returns the data of current cell record. + */ + data?: any; + + /**Returns the column of cell belongs. + */ + column?: any; +} + +export interface RowDataBoundEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row element of rendering row. + */ + rowElement?: any; + + /**Returns the data of rendering row record. + */ + data?: any; +} + +export interface RowDragEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row which we start to drag. + */ + draggedRow?: any; + + /**Returns the row index which we start to drag. + */ + draggedRowIndex?: number; + + /**Returns the row on which we are dragging. + */ + targetRow?: any; + + /**Returns the row index on which we are dragging. + */ + targetRowIndex?: number; + + /**Returns that we can drop over that record or not. + */ + canDrop?: boolean; + + /**Returns the TreeGrid model. + */ + model?: any; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface RowDragStartEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row which we start to drag. + */ + draggedRow?: any; + + /**Returns the row index which we start to drag. + */ + draggedRowIndex?: boolean; + + /**Returns the TreeGrid model. + */ + model?: any; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface RowDragStopEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row which we start to drag. + */ + draggedRow?: any; + + /**Returns the row index which we start to drag. + */ + draggedRowIndex?: number; + + /**Returns the row which we are dropped to row. + */ + targetRow?: any; + + /**Returns the row index which we are dropped to row. + */ + targetRowIndex?: number; + + /**Returns the TreeGrid model. + */ + model?: any; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface RowSelectedEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the selecting row element. + */ + targetRow?: any; + + /**Returns the index of selecting row record. + */ + recordIndex?: number; + + /**Returns the data of selected record. + */ + data?: any; + + /**Returns the event type. + */ + type?: string; +} + +export interface RowSelectingEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the data selecting record. + */ + data?: any; + + /**Returns the index of selecting row record. + */ + recordIndex?: string; + + /**Returns the selecting row element. + */ + targetRow?: any; + + /**Returns the previous selected data. + */ + previousData?: any; + + /**Returns the previous selected row index. + */ + previousIndex?: string; + + /**Returns the previous selected row element. + */ + previousTreeGridRow?: any; +} + +export interface ToolbarClickEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the current item. + */ + currentTarget?: any; + + /**Returns the TreeGrid model. + */ + model?: any; + + /**Returns the name of the toolbar item on which mouse click has been performed + */ + itemName?: string; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface Columns { + + /**Enables or disables the ability to filter the rows based on this column. + * @Default {false} + */ + allowFiltering?: boolean; + + /**Enables or disables the ability to sort the rows based on this column/field. + * @Default {false} + */ + allowSorting?: boolean; + + /**Specifies the edit type of the column. + * @Default {ej.TreeGrid.EditingType.String} + */ + editType?: ej.TreeGrid.EditingType|string; + + /**Specifies the name of the field from the dataSource to bind with this column. + */ + field?: string; + + /**Specifies the type of the editor control to be used to filter the rows. + * @Default {ej.TreeGrid.EditingType.String} + */ + filterEditType?: ej.TreeGrid.EditingType|string; + + /**Header text of the column. + * @Default {null} + */ + headerText?: string; + + /**Controls the visibility of the column. + * @Default {true} + */ + visible?: boolean; + + /**Specifies the header template value for the column header + */ + headerTemplateID?: string; + + /**Specifies whether the column is frozen + * @Default {false} + */ + isFrozen?: boolean; + + /**Enables or disables the ability to freeze/unfreeze the columns + * @Default {false} + */ + allowFreezing?: boolean; +} + +export interface ContextMenuSettings { + + /**Option for adding items to context menu. + * @Default {[]} + */ + contextMenuItems?: Array; + + /**Shows/hides the context menu. + * @Default {false} + */ + showContextMenu?: boolean; +} + +export interface DragTooltip { + + /**Specifies whether to show tooltip while dragging a row. + * @Default {true} + */ + showTooltip?: boolean; + + /**Option to add field names whose corresponding values in the dragged row needs to be shown in the preview tooltip. + * @Default {[]} + */ + tooltipItems?: Array; + + /**Custom template for that tooltip that is shown while dragging a row. + * @Default {null} + */ + tooltipTemplate?: string; +} + +export interface EditSettings { + + /**Enables or disables the button to add new row in context menu as well as in toolbar. + * @Default {true} + */ + allowAdding?: boolean; + + /**Enables or disables the button to delete the selected row in context menu as well as in toolbar. + * @Default {true} + */ + allowDeleting?: boolean; + + /**Enables or disables the ability to edit a row or cell. + * @Default {false} + */ + allowEditing?: boolean; + + /**specifies the edit mode in TreeGrid , "cellEditing" is for cell type editing and "rowEditing" is for entire row. + * @Default {ej.TreeGrid.EditMode.CellEditing} + */ + editMode?: ej.TreeGrid.EditMode|string; + + /**Specifies the position where the new row has to be added. + * @Default {top} + */ + rowPosition?: ej.TreeGrid.RowPosition|string; +} + +export interface SizeSettings { + + /**Height of the TreeGrid. + * @Default {null} + */ + height?: string; + + /**Width of the TreeGrid. + * @Default {null} + */ + width?: string; +} + +export interface SortSettings { + + /**Option to add columns based on which the rows have to be sorted recursively. + * @Default {[]} + */ + sortedColumns?: Array; +} + +export interface ToolbarSettings { + + /**Shows/hides the toolbar. + * @Default {false} + */ + showToolBar?: boolean; + + /**Option to add items to the toolbar. + * @Default {[]} + */ + toolbarItems?: Array; +} + +enum EditingType{ + + ///It Specifies String edit type. + String, + + ///It Specifies Boolean edit type. + Boolean, + + ///It Specifies Numeric edit type. + Numeric, + + ///It Specifies Dropdown edit type. + Dropdown, + + ///It Specifies DatePicker edit type. + DatePicker, + + ///It Specifies DateTimePicker edit type. + DateTimePicker, + + ///It Specifies Maskedit edit type. + Maskedit +} + + +enum EditMode{ + + ///you can edit a cell. + CellEditing, + + ///you can edit a row. + RowEditing +} + + +enum RowPosition{ + + ///you can add a new row at top. + Top, + + ///you can add a new row at bottom. + Bottom, + + ///you can add a new row to above selected row. + Above, + + ///you can add a new row to below selected row. + Below, + + ///you can add a new row as a child for selected row. + Child +} + +} +module Gantt +{ +enum SelectionType +{ +//you can select a single row. +Single, +//you can select a multiple row. +Multiple, +} +} + +class NavigationDrawer extends ej.Widget { + static fn: NavigationDrawer; + constructor(element: JQuery, options?: NavigationDrawer.Model); + constructor(element: Element, options?: NavigationDrawer.Model); + model:NavigationDrawer.Model; + defaults:NavigationDrawer.Model; + + /** To close the navigation drawer control + * @returns {void} + */ + close(): void; + + /** To open the navigation drawer control + * @returns {void} + */ + open(): void; + + /** To Toggle the navigation drawer control + * @returns {void} + */ + toggle(): void; +} +export module NavigationDrawer{ + +export interface Model { + + /**Specifies the contentId for navigation drawer, where the ajax content need to updated + * @Default {null} + */ + contentid?: string; + + /**Sets the root class for NavigationDrawer theme. This cssClass API helps to use custom skinning option for NavigationDrawer control. By defining the root class using this API, we need to include this root class in CSS. + */ + cssclass?: string; + + /**Sets the Direction for the control. See Direction + * @Default {left} + */ + direction?: ej.Direction|string; + + /**Sets the listview to be enabled or not + * @Default {false} + */ + enablelistview?: boolean; + + /**Specifies the listview items as an array of object. + * @Default {[]} + */ + items?: Array; + + /**Sets all the properties of listview to render in navigation drawer + */ + listviewsettings?: any; + + /**Specifies position whether it is in fixed or relative to the page. See Position + * @Default {normal} + */ + position?: string; + + /**Specifies the targetId for navigation drawer + */ + targetid?: string; + + /**Sets the rendering type of the control. See Type + * @Default {overlay} + */ + type?: string; + + /**Specifies the width of the control + * @Default {auto} + */ + width?: number; + + /**Event triggers before the control gets closed.*/ + beforeclose? (e: BeforecloseEventArgs): void; + + /**Event triggers when the control open.*/ + open? (e: OpenEventArgs): void; + + /**Event triggers when the Swipe happens.*/ + swipe? (e: SwipeEventArgs): void; +} + +export interface BeforecloseEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Navigation Drawer model + */ + model?: ej.NavigationDrawer.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the item of element + */ + item?: any; + + /**returns the name of item + */ + itemName?: string; +} + +export interface OpenEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Navigation Drawer model + */ + model?: ej.NavigationDrawer.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the item of element + */ + item?: any; + + /**returns the name of item + */ + itemName?: string; +} + +export interface SwipeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Navigation Drawer model + */ + model?: ej.NavigationDrawer.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the item of element + */ + item?: any; + + /**returns the name of item + */ + itemName?: string; +} +} + +class RadialMenu extends ej.Widget { + static fn: RadialMenu; + constructor(element: JQuery, options?: RadialMenu.Model); + constructor(element: Element, options?: RadialMenu.Model); + model:RadialMenu.Model; + defaults:RadialMenu.Model; + + /** To hide the redialmenu + * @returns {void} + */ + hide(): void; + + /** To hide the redialmenu items + * @returns {void} + */ + menuHide(): void; + + /** To Show the redialmenu + * @returns {void} + */ + show(): void; +} +export module RadialMenu{ + +export interface Model { + + /**To show the Radial in intial render. + */ + autoOpen?: boolean; + + /**Renders the back button Image for Radial using class. + */ + backImageClass?: string; + + /**Sets the root class for RadialMenu theme. This cssClass API helps to use custom skinning option for RadialMenu control. By defining the root class using this API, we need to include this root class in CSS. + */ + cssClass?: string; + + /**To enable Animation for Radial Menu. + */ + enableAnimation?: boolean; + + /**Renders the Image for Radial using Class. + */ + imageClass?: string; + + /**Specifies the radius of radial menu + */ + radius?: number; + + /**To show the Radial while clicking given target element. + */ + targetElementId?: string; + + /**Event triggers when the mouse down happens.*/ + mouseDown? (e: MouseDownEventArgs): void; + + /**Event triggers when the mouse up happens.*/ + mouseUp? (e: MouseUpEventArgs): void; + + /**Event triggers when we select an item.*/ + select? (e: SelectEventArgs): void; +} + +export interface MouseDownEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Radialmenu model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; + + /**returns the item of element + */ + item?: any; + + /**returns the name of item + */ + itemName?: string; +} + +export interface MouseUpEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Radialmenu model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; + + /**returns the item of element + */ + item?: any; + + /**returns the name of item + */ + itemName?: string; +} + +export interface SelectEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Radialmenu model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; + + /**returns the item of element + */ + item?: any; + + /**returns the name of item + */ + itemName?: string; +} +} + +class Tile extends ej.Widget { + static fn: Tile; + constructor(element: JQuery, options?: Tile.Model); + constructor(element: Element, options?: Tile.Model); + model:Tile.Model; + defaults:Tile.Model; + + /** Update the image template of tile item to another one. + * @param {string} UpdateTemplate by using id + * @returns {void} + */ + updateTemplate(name: string): void; +} +export module Tile{ + +export interface Model { + + /**Section for badge specific functionalities and it represents the notification for tile items. + */ + badge?: Badge; + + /**Specifies the tile caption in outside of template content. + * @Default {null} + */ + captionTemplateId?: string; + + /**Sets the root class for Tile theme. This cssClass API helps to use custom skinning option for Tile control. By defining the root class using this API, we need to include this root class in CSS. + */ + cssClass?: string; + + /**Saves current model value to browser cookies for state maintains. While refreshing the page retains the model value applies from browser cookies. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Customize the tile size height. + * @Default {null} + */ + height?: number; + + /**Specifies Tile imageClass, using this property we can give images for each tile through css classes. + * @Default {null} + */ + imageClass?: string; + + /**Specifies the position of tile image. See imagePosition + * @Default {center} + */ + imagePosition?: ej.Tile.ImagePosition|string; + + /**Specifies the tile image in outside of template content. + * @Default {null} + */ + imageTemplateId?: string; + + /**Specifies the url of tile image. + * @Default {null} + */ + imageUrl?: string; + + /**Section for livetile specific functionalities. + */ + livetile?: Livetile; + + /**Specifies whether the tile text to be shown or hidden. + * @Default {true} + */ + showText?: boolean; + + /**Changes the text of a tile. + * @Default {Text} + */ + text?: string; + + /**Aligns the text of a tile. See textAlignment + * @Default {normal} + */ + textAlignment?: ej.Tile.TextAlignment|string; + + /**Specifies the size of a tile. See tileSize + * @Default {small} + */ + tileSize?: ej.Tile.TileSize|string; + + /**Customize the tile size width. + * @Default {null} + */ + width?: number; + + /**Sets the rounded corner to tile. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Sets allowSelection to tile. + * @Default {false} + */ + allowSelection?: boolean; + + /**Sets the background color to tile. + * @Default {false} + */ + backgroundColor?: string; + + /**Event triggers when the mouse down happens in the tile*/ + mouseDown? (e: MouseDownEventArgs): void; + + /**Event triggers when the mouse up happens in the tile*/ + mouseUp? (e: MouseUpEventArgs): void; +} + +export interface MouseDownEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the tile model + */ + model?: boolean; + + /**returns the name of the event + */ + type?: boolean; + + /**returns the current tile text + */ + text?: string; + + /**returns the index of current tile item + */ + index?: number; +} + +export interface MouseUpEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the tile model + */ + model?: boolean; + + /**returns the name of the event + */ + type?: boolean; + + /**returns the current tile text + */ + text?: boolean; + + /**returns the index of current tile item + */ + index?: number; +} + +export interface Badge { + + /**Specifies whether to enable badge or not. + * @Default {false} + */ + enabled?: boolean; + + /**Specifies maximum value for tile badge. + * @Default {100} + */ + maxValue?: number; + + /**Specifies minimum value for tile badge. + * @Default {1} + */ + minValue?: number; + + /**Specifies text instead of number for tile badge. + * @Default {null} + */ + text?: string; + + /**Sets value for tile badge. + * @Default {1} + */ + value?: number; + + /**Sets position for tile badge. + * @Default {“bottomright”} + */ + position?: ej.Tile.BadgePosition|string; +} + +export interface Livetile { + + /**Specifies whether to enable livetile or not. + * @Default {false} + */ + enabled?: boolean; + + /**Specifies liveTile images in css classes. + * @Default {null} + */ + imageClass?: string; + + /**Specifies liveTile images in templates. + * @Default {null} + */ + imageTemplateId?: string; + + /**Specifies liveTile images in css classes. + * @Default {null} + */ + imageUrl?: string; + + /**Specifies liveTile type for Tile. See orientation + * @Default {flip} + */ + type?: ej.Tile.LiveTileType|string; + + /**Specifies time interval between two successive livetile animation + * @Default {2000} + */ + updateInterval?: number; + + /**Sets the text to each living tile + * @Default {Null} + */ + text?: Array; +} + +enum BadgePosition{ + + ///To set the topright position of tile badge + Topright, + + ///To set the bottomright of tile image + Bottomright +} + + +enum ImagePosition{ + + ///To set the center position of tile image + Center, + + ///To set the top position of tile image + Top, + + ///To set the bottom position of tile image + Bottom, + + ///To set the right position of tile image + Right, + + ///To set the left position of tile image + Left, + + ///To set the topleft position of tile image + TopLeft, + + ///To set the topright position of tile image + TopRight, + + ///To set the bottomright position of tile image + BottomRight, + + ///To set the bottomleft position of tile image + BottomLeft, + + ///To set the fill position of tile image + Fill +} + + +enum LiveTileType{ + + ///To set flip type of liveTile for tile control + Flip, + + ///To set slide type of liveTile for tile control + Slide, + + ///To set carousel type of liveTile for tile control + Carousel +} + + +enum TextAlignment{ + + ///To set the normal alignment of text for tile control + Normal, + + ///To set the left alignment of text for tile control + Left, + + ///To set the right alignment of text for tile control + Right, + + ///To set the center alignment of text for tile control + Center +} + + +enum TextPosition{ + + ///To set the innertop position of the tile text + Innertop, + + ///To set the innerbottom position of the tile text + Innerbottom, + + ///To set the outer position of the tile text + Outer +} + + +enum TileSize{ + + ///To set the medium size for tile control + Medium, + + ///To set the small size for tile control + Small, + + ///To set the large size for tile control + Large, + + ///To set the wide size for tile control + Wide +} + +} + +class RadialSlider extends ej.Widget { + static fn: RadialSlider; + element: JQuery; + constructor(element: JQuery, options?: RadialSliderOptions); + constructor(element: Element, options?: RadialSliderOptions); + model:RadialSliderOptions; + defaults:RadialSliderOptions; + show(): void; + hide(): void; +} + +interface RadialSliderOptions { + radius?: number; + endAngle?: number; + startAngle?: number; + ticks?: Int32Array; + enableRoundOff?: boolean; + value?: number; + strokeWidth?: number; + autoOpen?: boolean; + enableAnimation?: boolean; + cssClass?: string; + innerCircleImageClass?: string; + innerCircleImageUrl?: string; + showInnerCircle?: boolean; + inline?: boolean; + stop? (e: RadialSliderStopEventArgs): void; + start? (e: RadialSliderStartEventArgs): void; + slide? (e: RadialSliderSlideEventArgs): void; + change? (e: RadialSliderChangeEventArgs): void; + mouseover? (e: RadialSliderMouseOverEventArgs): void; + create? (e: RadialSliderCreateEventArgs): void; + destory? (e: RadialSliderDestroyEventArgs): void; +} +interface RadialSliderCreateEventArgs { + cancel: boolean; + model: RadialSliderOptions; + type: string; +} +interface RadialSliderDestroyEventArgs { + cancel: boolean; + model: RadialSliderOptions; + type: string; +} +interface RadialSliderStopEventArgs { + cancel: boolean; + model: RadialSliderOptions; + type: string; + value: number; +} + +interface RadialSliderStartEventArgs { + cancel: boolean; + model: RadialSliderOptions; + type: string; + value: number; +} +interface RadialSliderSlideEventArgs { + cancel: boolean; + model: RadialSliderOptions; + type: string; + value: number; + selectedValue: number; +} +interface RadialSliderChangeEventArgs { + cancel: boolean; + model: RadialSliderOptions; + type: string; + value: number; + oldValue: number; +} +interface RadialSliderMouseOverEventArgs { + cancel: boolean; + model: RadialSliderOptions; + type: string; + value: number; + selectedValue: number; +} +class Spreadsheet extends ej.Widget { + static fn: Spreadsheet; + constructor(element: JQuery, options?: Spreadsheet.Model); + constructor(element: Element, options?: Spreadsheet.Model); + model:Spreadsheet.Model; + defaults:Spreadsheet.Model; + + /** This method is used to add a new sheet in the last position of the sheet container. + * @returns {void} + */ + addNewSheet(): void; + + /** It is used to clear all the data and format in the specified range of cells in Spreadsheet. + * @param {string} Optional. If range is specified, then it will clear all content in the specified range else it will use the current selected range. + * @returns {void} + */ + clearAll(range: string): void; + + /** This property is used to clear all the formats applied in the specified range in Spreadsheet. + * @param {string} Optional. If range is specified, then it will clear all format in the specified range else it will use the current selected range. + * @returns {void} + */ + clearAllFormat(range: string): void; + + /** Used to clear the applied border in the specified range in Spreadsheet. + * @param {string} Optional. If range is specified, then it will clear border in the specified range else it will use the current selected range. + * @returns {void} + */ + clearBorder(range: string): void; + + /** This property is used to clear the contents in the specified range in Spreadsheet. + * @param {string} Optional. If the range is specified, then it will clear the content in the specified range else it will use the current selected range. + * @returns {void} + */ + clearContents(range: string): void; + + /** This method is used to remove only the data in the range denoted by the specified range name. + * @param {string} Pass the defined rangeSettings property name. + * @returns {void} + */ + clearRange(rangeName: string): void; + + /** It is used to remove data in the specified range of cells based on the defined property. + * @param {Array|string} Optional. If range is specified, it will clear data for the specified range else it will use the current selected range. + * @param {string} Optional. If property is specified, it will remove the specified property in the range else it will remove default properties + * @param {boolean} Optional. If pass true, if you want to skip the hidden rows + * @returns {void} + */ + clearRangeData(range: Array|string, property: string, skipHiddenRow: boolean): void; + + /** This method is used to copy sheets in Spreadsheet. + * @param {number} Pass the sheet index that you want to copy. + * @param {number} Pass the position index where you want to copy. + * @returns {void} + */ + copySheet(fromIdx: number, toIdx: number): void; + + /** This method is used to delete the entire column which is selected. + * @param {number} Pass the start column index. + * @param {number} Pass the end column index. + * @returns {void} + */ + deleteEntireColumn(startCol: number, endCol: number): void; + + /** This method is used to delete the entire row which is selected. + * @param {number} Pass the start row index. + * @param {number} Pass the end row index. + * @returns {void} + */ + deleteEntireRow(startRow: number, endRow: number): void; + + /** This method is used to delete a particular sheet in the Spreadsheet. + * @param {number} Pass the sheet index to perform delete action. + * @returns {void} + */ + deleteSheet(idx: number): void; + + /** This method is used to delete the selected cells and shift the remaining cells to left. + * @param {any} Row index and column index of the starting cell. + * @param {any} Row index and column index of the ending cell. + * @returns {void} + */ + deleteShiftLeft(startCell: any, endCell: any): void; + + /** This method is used to delete the selected cells and shift the remaining cells up. + * @param {any} Row index and column index of the start cell. + * @param {any} Row index and column index of the end cell. + * @returns {void} + */ + deleteShiftUp(startCell: any, endCell: any): void; + + /** This method is used to edit data in the specified range of cells based on its corresponding rangeSettings. + * @param {string} Pass the defined rangeSettings property name. + * @param {Function} Pass the function that you want to perform range edit. + * @returns {void} + */ + editRange(rangeName: string, fn: Function): void; + + /** This method is used to get the activation panel in the Spreadsheet. + * @returns {HTMLElement} + */ + getActivationPanel(): HTMLElement; + + /** This method is used to get the active cell object in Spreadsheet. It will returns object which contains rowIndex and colIndex of the active cell. + * @param {number} Optional. If sheetIdx is specified, it will return the active cell object in specified sheet index else it will use the current sheet index + * @returns {any} + */ + getActiveCell(sheetIdx: number): any; + + /** This method is used to get the active cell element based on the given sheet index in the Spreadsheet. + * @param {number} Optional. If sheetIndex is specified, it will return the active cell element in specified sheet index else it will use the current active sheet index. + * @returns {HTMLElement} + */ + getActiveCellElem(sheetIdx: number): HTMLElement; + + /** This method is used to get the current active sheet index in Spreadsheet. + * @returns {number} + */ + getActiveSheetIndex(): number; + + /** This method is used to get the auto fill element in Spreadsheet. + * @returns {HTMLElement} + */ + getAutoFillElem(): HTMLElement; + + /** This method is used to get the cell element based on specified row and column index in the Spreadsheet. + * @param {number} Pass the row index. + * @param {number} Pass the column index. + * @param {number} Optional. Pass the sheet index that you want to get cell. + * @returns {HTMLElement} + */ + getCell(rowIdx: number, colIdx: number, sheetIdx: number): HTMLElement; + + /** This method is used to get the frozen columns index in the Spreadsheet. + * @param {number} Pass the sheet index. + * @returns {number} + */ + getFrozenColumns(sheetIdx: number): number; + + /** This method is used to get the frozen row’s index in Spreadsheet. + * @param {number} Pass the sheet index. + * @returns {number} + */ + getFrozenRows(sheetIdx: number): number; + + /** This method is used to get the hyperlink data as object from the specified cell in Spreadsheet. + * @param {HTMLElement} Pass the DOM element to get hyperlink + * @returns {any} + */ + getHyperlink(cell: HTMLElement): any; + + /** This method is used to get all cell elements in the specified range. + * @param {number} Pass the row index of the start cell. + * @param {number} Pass the column index of the start cell. + * @param {number} Pass the row index of the end cell. + * @param {number} Pass the column index of the end cell. + * @param {number} Pass the index of the sheet. + * @returns {HTMLElement} + */ + getRange(startRIndex: number, startCIndex: number, endRIndex: number, endCIndex: number, sheetIdx: number): HTMLElement; + + /** This method is used to get the data in specified range in Spreadsheet. + * @param {Array|string} Optional. If range is specified, it will get range data for the specified range else it will use the current selected range. + * @param {boolean} Pass 'true' if you want cell values alone. + * @param {Array|string} Optional. If property is specified, it will get the specified property in the range else it will get default properties. + * @param {number} Optional. Pass the index of the sheet. + * @param {boolean} Optional. When skipDateTime is set as true, it return 'value2' cell value (cell type as 'datetime') + * @param {boolean} Optional. Pass true, if you want to get the calculated formula value else it return formula string. + * @param {boolean} Optional. Pass true, if you want to skip the hidden rows data. + * @param {number} Optional. Pass virtual row index of sheet. + * @param {number} Optional. Pass virtual row count of sheet. + * @returns {Array} + */ + getRangeData(range: Array|string, valueOnly: boolean, property: Array|string, sheetIdx: number, skipDateTime: boolean, skipFormula: boolean, skipHiddenRow: boolean, virtualRowIdx: number, virtualRowCount: number): Array; + + /** This method is used to get the range indices array based on the specified alpha range in Spreadsheet. + * @param {string} Pass the alpha range that you want to get range indices. + * @returns {Array} + */ + getRangeIndices(range: string): Array; + + /** This method is used to get the sheet details based on the given sheet index in Spreadsheet. + * @param {number} Pass the sheet index to get the sheet object. + * @returns {any} + */ + getSheet(sheetIdx: number): any; + + /** This method is used to get the sheet content div element of Spreadsheet. + * @param {number} Pass the sheet index to get the sheet content. + * @returns {HTMLElement} + */ + getSheetElement(sheetIdx: number): HTMLElement; + + /** This method is used to send a paging request to the specified sheet Index in the Spreadsheet. + * @param {number} Pass the sheet index to perform paging at specified sheet index + * @param {boolean} Pass 'true' to create a new sheet. If the specified sheet index is already exist, it navigate to that sheet else it create a new sheet. + * @returns {void} + */ + gotoPage(sheetIdx: number, newSheet: boolean): void; + + /** This method is used to hide the entire columns from the specified range (startCol, endCol) in Spreadsheet. + * @param {number} Index of the start column. + * @param {number} Index of the end column. + * @returns {void} + */ + hideColumn(startCol: number, endCol: number): void; + + /** This method is used to hide the formula bar in Spreadsheet. + * @returns {void} + */ + hideFormulaBar(): void; + + /** This method is used to hide the rows, based on the specified row index in Spreadsheet. + * @param {number} Index of the start row. + * @param {number} Index of the end row. + * @returns {void} + */ + hideRow(startRow: number, endRow: number): void; + + /** This method is used to hide the sheet based on the specified sheetIndex or sheet name in the Spreadsheet. + * @param {string|number} Pass the sheet name or index that you want to hide. + * @returns {void} + */ + hideSheet(sheetIdx: string|number): void; + + /** This method is used to hide the displayed waiting pop-up in Spreadsheet. + * @returns {void} + */ + hideWaitingPopUp(): void; + + /** This method is used to insert a column before the active cell's column in the Spreadsheet. + * @param {number} Pass start column. + * @param {number} Pass end column. + * @returns {void} + */ + insertEntireColumn(startCol: number, endCol: number): void; + + /** This method is used to insert a row before the active cell's row in the Spreadsheet. + * @param {number} Pass start row. + * @param {number} Pass end row. + * @returns {void} + */ + insertEntireRow(startRow: number, endRow: number): void; + + /** This method is used to insert a new sheet to the left of the current active sheet. + * @returns {void} + */ + insertSheet(): void; + + /** This method is used to insert cells in the selected or specified range and shift remaining cells to bottom. + * @param {any} Row index and column index of the start cell. + * @param {any} Row index and column index of the end cell. + * @returns {void} + */ + insertShiftBottom(startCell: any, endCell: any): void; + + /** This method is used to insert cells in the selected or specified range and shift remaining cells to right. + * @param {any} Row index and column index of the start cell. + * @param {any} Row index and column index of the end cell. + * @returns {void} + */ + insertShiftRight(startCell: any, endCell: any): void; + + /** This method is used to import excel file manually by using form data. + * @param {any} Pass the form data object to import files manually. + * @returns {void} + */ + import(importRequest: any): void; + + /** This method is used to lock/unlock the range of cells in active sheet. Lock cells are activated only after the sheet is protected. Once the sheet is protected it is unable to lock/unlock cells. + * @param {string|Array} Pass the alpha range cells or array range of cells. + * @param {string} Optional. By default is true. If it is false locked cells are unlocked. + * @returns {void} + */ + lockCells(range: string|Array, isLocked: string): void; + + /** This method is used to merge cells by across in the Spreadsheet. + * @param {string} Optional. To pass the cell range or selected cells are process. + * @param {boolean} Optional. If pass true it does not show alert. + * @returns {void} + */ + mergeAcrossCells(range: string, alertStatus: boolean): void; + + /** This method is used to merge the selected cells in the Spreadsheet. + * @param {string} Optional. To pass the cell range or selected cells are process. + * @param {boolean} Optional. If pass true it does not show alert. + * @returns {void} + */ + mergeCells(range: string, alertStatus: boolean): void; + + /** This method is used to move sheets in Spreadsheet. + * @param {number} Pass the sheet index that you want to move. + * @param {number} Pass the position index where you want to move. + * @returns {void} + */ + moveSheet(fromIdx: number, toIdx: number): void; + + /** This method is used to protect or unprotect active sheet. + * @param {boolean} Optional. By default is true. If it is false active sheet is unprotected. + * @returns {void} + */ + protectSheet(isProtected: boolean): void; + + /** This method is used to remove the hyperlink from selected cells of current sheet. + * @param {string} Hyperlink remove from the specified range. + * @param {boolean} Optional. If it is true, It will clear link only not format. + * @returns {void} + */ + removeHyperlink(range: string, isClearHLink: boolean): void; + + /** This method is used to remove the range data and its defined rangeSettings property based on the specified range name. + * @param {string} Pass the defined rangeSetting property name. + * @returns {void} + */ + removeRange(rangeName: string): void; + + /** This method is used to set the active cell in the Spreadsheet. + * @param {number} Pass the row index. + * @param {number} Pass the column index. + * @param {number} Pass the index of the sheet. + * @returns {void} + */ + setActiveCell(rowIdx: number, colIdx: number, sheetIdx: number): void; + + /** This method is used to set active sheet index for the Spreadsheet. + * @param {number} Pass the active sheet index for Spreadsheet. + * @returns {void} + */ + setActiveSheetIndex(sheetIdx: number): void; + + /** This method is used to set border for the specified range of cells in the Spreadsheet. + * @param {any} Pass the border properties that you want to set. + * @param {string} Optional. If range is specified, it will set border for the specified range else it will use the selected range. + * @returns {void} + */ + setBorder(property: any, range: string): void; + + /** This method is used to set the hyperlink in selected cells of the current sheet. + * @param {string} If range is specified, it will set the hyperlink in range of the cells. + * @param {any} Pass cellAddress or webAddress + * @param {number} If we pass cellAddress then which sheet to be navigate in the applied link. + * @returns {void} + */ + setHyperlink(range: string, link: any, sheetIdx: number): void; + + /** This method is used to set the focus to the Spreadsheet. + * @returns {void} + */ + setSheetFocus(): void; + + /** This method is used to set the width for the columns in the Spreadsheet. + * @param {Array|any} Pass the cell index and width of the cells. + * @returns {void} + */ + setWidthToColumns(widthColl: Array|any): void; + + /** This method is used to rename the active sheet. + * @param {string} Pass the sheet name that you want to change the current active sheet name. + * @returns {void} + */ + sheetRename(sheetName: string): void; + + /** This method is used to display the activationPanel for the specified range name. + * @param {string} Pass the range name that you want to display the activation panel. + * @returns {void} + */ + showActivationPanel(rangeName: string): void; + + /** This method is used to show the hidden columns within the specified range in the Spreadsheet. + * @param {number} Index of the start column. + * @param {number} Index of the end column. + * @returns {void} + */ + showColumn(startColIdx: number, endColIdx: number): void; + + /** This method is used to show the formula bar in Spreadsheet. + * @returns {void} + */ + showFormulaBar(): void; + + /** This method is used to show the hidden rows in the specified range in the Spreadsheet. + * @param {number} Index of the start row. + * @param {number} Index of the end row. + * @returns {void} + */ + showRow(startRow: number, endRow: number): void; + + /** This method is used to show waiting pop-up in Spreadsheet. + * @returns {void} + */ + showWaitingPopUp(): void; + + /** This method is used to unfreeze the frozen rows and columns in the Spreadsheet. + * @returns {void} + */ + unfreezePanes(): void; + + /** This method is used to unhide the sheet based on specified sheet name or sheet index. + * @param {string|number} Pass the sheet name or index that you want to unhide. + * @returns {void} + */ + unhideSheet(sheetInfo: string|number): void; + + /** This method is used to unmerge the selected range of cells in the Spreadsheet. + * @param {string} Optional. If the range is specified, then it will un merge the specified range else it will use the current selected range. + * @returns {void} + */ + unmergeCells(range: string): void; + + /** This method is used to unwrap the selected range of cells in the Spreadsheet. + * @param {Array|string} Optional. If the range is specified, then it will update unwrap in the specified range else it will use the current selected range. + * @returns {void} + */ + unWrapText(range: Array|string): void; + + /** This method is used to update the data for the specified range of cells in the Spreadsheet. + * @param {any} Pass the cells data that you want to update. + * @param {Array} Optional. If range is specified, it will update data for the specified range else it will use the current selected range. + * @returns {void} + */ + updateData(data: any, range: Array): void; + + /** This method is used to update the formula bar in the Spreadsheet. + * @returns {void} + */ + updateFormulaBar(): void; + + /** This method is used to update the range of cells based on the specified settings which we want to update in the Spreadsheet. + * @param {number} Pass the sheet index that you want to update. + * @param {any} Pass the dataSource, startCell and showHeader values as settings. + * @returns {void} + */ + updateRange(sheetIdx: number, settings: any): void; + + /** This method is used to update the unique data for the specified range of cells in Spreadsheet. + * @param {any} Pass the data that you want to update in the particular range + * @param {Array|string} Optional. If range is specified, it will update data for the specified range else it will use the current selected range. + * @returns {void} + */ + updateUniqueData(data: any, range: Array|string): void; + + /** This method is used to wrap the selected range of cells in the Spreadsheet. + * @param {Array|string} Optional. If the range is specified, then it will update wrap in the specified range else it will use the current selected range. + * @returns {void} + */ + wrapText(range: Array|string): void; + + XLCellType: Spreadsheet.XLCellType; + + XLCFormat: Spreadsheet.XLCFormat; + + XLChart: Spreadsheet.XLChart; + + XLClipboard: Spreadsheet.XLClipboard; + + XLComment: Spreadsheet.XLComment; + + XLDragDrop: Spreadsheet.XLDragDrop; + + XLDragFill: Spreadsheet.XLDragFill; + + XLEdit: Spreadsheet.XLEdit; + + XLExport: Spreadsheet.XLExport; + + XLFilter: Spreadsheet.XLFilter; + + XLFormat: Spreadsheet.XLFormat; + + XLFreeze: Spreadsheet.XLFreeze; + + XLPrint: Spreadsheet.XLPrint; + + XLResize: Spreadsheet.XLResize; + + XLRibbon: Spreadsheet.XLRibbon; + + XLSearch: Spreadsheet.XLSearch; + + XLSelection: Spreadsheet.XLSelection; + + XLSort: Spreadsheet.XLSort; + + XLValidate: Spreadsheet.XLValidate; +} +export module Spreadsheet{ + +export interface XLCellType { + + /** This method is used to set a cell type from the specified range of cells in the spreadsheet. + * @param {string} Pass the range where you want apply cell type. + * @param {any} Pass type of cell type and its settings. + * @param {number} Optional. Pass sheet index. + * @returns {void} + */ + addCellTypes(range: string,settings: any,sheetIdx: number): void; + + /** This method is used to remove cell type from the specified range of cells in the Spreadsheet. + * @param {string} Pass the range where you want remove cell type. + * @param {number} Optional. Pass sheet index. + * @returns {void} + */ + removeCellTypes(range: string,sheetIdx: number): void; +} + +export interface XLCFormat { + + /** This method is used to clear the applied conditional formatting rules in the Spreadsheet. + * @param {boolean} Pass true if you want to clear rules from selected cells else it will clear rules from entire sheet. + * @param {Array|string} Optional. If range is specified, it will clear rules for the specified range else it will use the current selected range. + * @returns {void} + */ + clearCF(isSelected: boolean,range: Array|string): void; + + /** This method is used to get the applied conditional formatting rules as array of objects based on the specified row Index and column Index in the Spreadsheet. + * @param {number} Pass the row index. + * @param {number} Pass the column index. + * @returns {Array} + */ + getCFRule(rowIdx: number,colIdx: number): Array; + + /** This method is used to set the conditional formatting rule in the Spreadsheet. + * @param {any} Pass the rule to set. + * @returns {void} + */ + setCFRule(rule: any): void; +} + +export interface XLChart { + + /** This method is used to create a chart for specified range in Spreadsheet. + * @param {string} Optional. If range is specified, it will create chart for the specified range else it will use the current selected range. + * @param {any} To pass the type of chart and chart name. + * @returns {void} + */ + createChart(range: string,options: any): void; + + /** This method is used to refresh the chart in the Spreadsheet. + * @param {string} To pass the chart Id. + * @param {any} To pass the type of chart and chart name. + * @returns {void} + */ + refreshChart(id: string,options: any): void; + + /** This method is used to resize the chart of specified id in the Spreadsheet. + * @param {string} To pass the chart id. + * @param {number} To pass height value. + * @param {number} To pass the width value. + * @returns {void} + */ + resizeChart(id: string,height: number,width: number): void; +} + +export interface XLClipboard { + + /** This method is used to copy the selected cells in the Spreadsheet. + * @returns {void} + */ + copy(): void; + + /** This method is used to cut the selected cells in the Spreadsheet. + * @returns {void} + */ + cut(): void; + + /** This method is used to paste the cut or copied cells data in the Spreadsheet. + * @returns {void} + */ + paste(): void; +} + +export interface XLComment { + + /** This method is used to delete the comment in the specified range in Spreadsheet. + * @param {Array|string} Optional. If range is specified, it will delete comments for the specified range else it will use the current selected range. + * @param {number} Optional. If sheetIdx is specified, it will delete comment in specified sheet else it will use active sheet. + * @param {boolean} Optional. Pass true, if you want to skip the hidden rows data. + * @returns {void} + */ + deleteComment(range: Array|string,sheetIdx: number,skipHiddenRow: boolean): void; + + /** This method is used to edit the comment in the target Cell in Spreadsheet. + * @param {any} Optional. Pass the row index and column index of the cell which contains comment. + * @returns {void} + */ + editComment(targetCell: any): void; + + /** This method is used to find the next comment from the active cell in Spreadsheet. + * @returns {boolean} + */ + findNextComment(): boolean; + + /** This method is used to find the previous comment from the active cell in Spreadsheet. + * @returns {boolean} + */ + findPrevComment(): boolean; + + /** This method is used to get comment data for the specified cell. + * @param {HTMLElement} Pass the DOM element to get comment data as object. + * @returns {any} + */ + getComment(cell: HTMLElement): any; + + /** This method is used to set new comment in Spreadsheet. + * @param {string|Array} Optional. If we pass the range comment will set in the range otherwise it will set with selected cells. + * @param {string} Pass the comment data. + * @param {boolean} Optional. Pass true to show comment in edit mode + * @returns {void} + */ + setComment(range: string|Array,data: string,showEditPanel: boolean): void; + + /** This method is used to show all the comments in the Spreadsheet. + * @returns {void} + */ + showAllComments(): void; + + /** This method is used to show or hide the specific comment in the Spreadsheet. + * @param {HTMLElement} Optional. Pass the cell DOM element to show or hide its comment. If pass empty argument active cell will processed. + * @returns {void} + */ + showHideComment(targetCell: HTMLElement): void; +} + +export interface XLDragDrop { + + /** This method is used to drag and drop the selected range of cells to destination range in the Spreadsheet. + * @param {any|Array} Pass the source range to perform drag and drop. + * @param {any|Array} Pass the destination range to drop the dragged cells. + * @returns {void} + */ + moveRangeTo(sourceRange: any|Array,destinationRange: any|Array): void; +} + +export interface XLDragFill { + + /** This method is used to perform auto fill in Spreadsheet. + * @param {any} Pass the options to perform auto fill in Spreadsheet. + * @returns {void} + */ + autoFill(options: any): void; + + /** This method is used to hide the auto fill element in the Spreadsheet. + * @returns {void} + */ + hideAutoFillElement(): void; + + /** This method is used to hide the auto fill options in the Spreadsheet. + * @returns {void} + */ + hideAutoFillOptions(): void; + + /** This method is used to set position of the auto fill element in the Spreadsheet. + * @param {boolean} Pass the drag fill status as boolean value for show auto fill options in Spreadsheet. + * @returns {void} + */ + positionAutoFillElement(isDragFill: boolean): void; +} + +export interface XLEdit { + + /** This method is used to calculate formulas in the specified sheet. + * @param {number} Optional. If sheet index is specified, then it will calculate formulas in the specified sheet only else it will calculate formulas in all sheets. + * @returns {void} + */ + calcNow(sheetIdx: number): void; + + /** This method is used to edit a particular cell based on the row index and column index in the Spreadsheet. + * @param {number} Pass the row index to edit particular cell. + * @param {number} Pass the column index to edit particular cell. + * @param {boolean} Pass true, if you want to maintain previous cell value. + * @returns {void} + */ + editCell(rowIdx: number,colIdx: number,oldData: boolean): void; + + /** This method is used to get the property value of particular cell, based on the row and column index in the Spreadsheet. + * @param {number} Pass the row index to get the property value. + * @param {number} Pass the column index to get the property value. + * @param {string} Optional. Pass the property name that you want("value", "value2", "type", "cFormatRule", "range", "thousandSeparator", "rule", "format", "border", "picture", "chart", "calcValue", "align", "hyperlink", "formats", "borders", "tformats", "tborders", "isFilterHeader", "filterState", "tableName", "comment", "formatStr", "decimalPlaces", "cellType"). + * @param {number} Optional. Pass the index of the sheet. + * @returns {any|string|Array} + */ + getPropertyValue(rowIdx: number,colIdx: number,prop: string,sheetIdx: number): any|string|Array; + + /** This method is used to get the property value in specified cell in Spreadsheet. + * @param {HTMLElement} Pass the cell element to get property value. + * @param {string} Pass the property name that you want ("value", "value2", "type", "cFormatRule", "range", "thousandSeparator", "rule", "format", "border", "picture", "chart", "calcValue", "align", "hyperlink", "formats", "borders", "tformats", "tborders", "isFilterHeader", "filterState", "tableName", "comment", "formatStr", "decimalPlaces", "cellType"). + * @param {number} Pass the index of sheet. + * @returns {void} + */ + getPropertyValueByElem(elem: HTMLElement,property: string,sheetIdx: number): void; + + /** This method is used to save the edited cell value in the Spreadsheet. + * @returns {void} + */ + saveCell(): void; + + /** This method is used to update a particular cell value in the Spreadsheet. + * @param {any} Pass row index and column index of the cell. + * @param {string|number} Pass the cell value. + * @returns {void} + */ + updateCell(cell: any,value: string|number): void; + + /** This method is used to update a particular cell value and its format in the Spreadsheet. + * @param {any} Pass row index and column index of the cell. + * @param {string|number} Pass the cell value. + * @param {string} Pass the class name to update format. + * @param {number} Pass sheet index. + * @returns {void} + */ + updateCellValue(cellIdx: any,val: string|number,formatClass: string,sheetIdx: number): void; +} + +export interface XLExport { + + /** This method is used to save the sheet data as Excel or CSV document (.xls, .xlsx and .csv) in Spreadsheet. + * @param {string} Pass the export type that you want. + * @returns {void} + */ + export(type: string): void; +} + +export interface XLFilter { + + /** This method is used to clear the filter in filtered columns in the Spreadsheet. + * @returns {void} + */ + clearFilter(): void; + + /** This method is used to apply filter for the selected range of cells in the Spreadsheet. + * @param {string} Pass the range of the selected cells. + * @returns {void} + */ + filter(range: string): void; + + /** This method is used to apply filter for the column by active cell's value in the Spreadsheet. + * @returns {void} + */ + filterByActiveCell(): void; +} + +export interface XLFormat { + + /** This method is used to create a table for the selected range of cells in the Spreadsheet. + * @param {any} Pass the table object. + * @param {string} Optional. If the range is specified, then it will create table in the specified range else it will use the current selected range. + * @returns {void} + */ + createTable(tableObject: any,range: string): void; + + /** This method is used to set format style and values in a cell or range of cells. + * @param {any} Pass the formatObject which contains style, type, format, groupSeparator and decimalPlaces. + * @param {string} Pass the range indices to format cells. + * @returns {void} + */ + format(formatObj: any,range: string): void; + + /** This method is used to remove table with specified tableId in the Spreadsheet. + * @param {number} Pass the tableId that you want to remove. + * @returns {void} + */ + removeTable(tableId: number): void; + + /** This method is used to update the decimal places for numeric value for the selected range of cells in the Spreadsheet. + * @param {string} Pass the decimal places type in increment/decrement. + * @param {string} Pass the range indices. + * @returns {void} + */ + updateDecimalPlaces(type: string,range: string): void; + + /** This method is used to update the format for the selected range of cells in the Spreadsheet. + * @param {any} Pass the format object that you want to update. + * @param {Array} Optional. If the range is specified, then it will update format in the specified range else it will use the current selected range. + * @returns {void} + */ + updateFormat(formatObj: any,range: Array): void; + + /** This method is used to update the unique format for selected range of cells in the Spreadsheet. + * @param {string} Pass the unique format class. + * @param {Array} Optional. If the range is specified, then it will update format in the specified range else it will use the current selected range. + * @returns {void} + */ + updateUniqueFormat(formatClass: string,range: Array): void; +} + +export interface XLFreeze { + + /** This method is used to freeze columns upto the specified column index in the Spreadsheet. + * @param {number} Index of the column to be freeze. + * @returns {void} + */ + freezeColumns(colIdx: number): void; + + /** This method is used to freeze the first column in the Spreadsheet. + * @returns {void} + */ + freezeLeftColumn(): void; + + /** This method is used to freeze rows and columns before the specified cell in the Spreadsheet. + * @param {any} Row index and column index of the cell which you want to freeze. + * @returns {void} + */ + freezePanes(cell: any): void; + + /** This method is used to freeze rows upto the specified row index in the Spreadsheet. + * @param {number} Index of the row to be freeze. + * @returns {void} + */ + freezeRows(rowIdx: number): void; + + /** This method is used to freeze the top row in the Spreadsheet. + * @returns {void} + */ + freezeTopRow(): void; +} + +export interface XLPrint { + + /** This method is used to print the selected contents in the Spreadsheet. + * @returns {void} + */ + printSelection(): void; + + /** This method is used to print the entire contents in the active sheet. + * @returns {void} + */ + printSheet(): void; +} + +export interface XLResize { + + /** This method is used to get the column width of the specified column index in the Spreadsheet. + * @param {number} Pass the column index. + * @returns {number} + */ + getColWidth(colIdx: number): number; + + /** This method is used to get the row height of the specified row index in the Spreadsheet. + * @param {number} Pass the row index which you want to find its height. + * @returns {number} + */ + getRowHeight(rowIdx: number): number; + + /** This method is used to set the column width of the specified column index in the Spreadsheet. + * @param {number} Pass the column index. + * @param {number} Pass the width value that you want to set. + * @returns {void} + */ + setColWidth(colIdx: number,size: number): void; + + /** This method is used to set the row height of the specified row index in the Spreadsheet. + * @param {number} Pass the row index. + * @param {number} Pass the height value that you want to set. + * @returns {void} + */ + setRowHeight(rowIdx: number,size: number): void; +} + +export interface XLRibbon { + + /** This method is used to add a new name in the Spreadsheet name manager. + * @param {string} Pass the name that you want to define in name manager. + * @param {string} Pass the cell reference. + * @param {string} Optional. Pass comment, if you want. + * @param {number} Optional. Pass the sheet index. + * @returns {void} + */ + addNamedRange(name: string,refersTo: string,comment: string,sheetIdx: number): void; + + /** This method is used to insert the few type (SUM, MAX, MIN, AVG, COUNT) of formulas in the selected range of cells in the Spreadsheet. + * @param {string} To pass the type("SUM","MAX","MIN","AVG","COUNT"). + * @param {string} If range is specified, it will apply auto sum for the specified range else it will use the current selected range. + * @returns {void} + */ + autoSum(type: string,range: string): void; + + /** This method is used to delete the defined name in the Spreadsheet name manager. + * @param {string} Pass the defined name that you want to remove from name manager. + * @returns {void} + */ + removeNamedRange(name: string): void; +} + +export interface XLSearch { + + /** This method is used to find and replace all data by workbook in the Spreadsheet. + * @param {string} Pass the search data. + * @param {string} Pass the replace data. + * @param {boolean} Pass true, if you want to match with case-sensitive. + * @param {boolean} Pass true, if you want to match with entire cell contents. + * @returns {void} + */ + replaceAllByBook(findData: string,replaceData: string,isCSen: boolean,isEMatch: boolean): void; + + /** This method is used to find and replace all data by sheet in Spreadsheet. + * @param {string} Pass the search data. + * @param {string} Pass the replace data. + * @param {boolean} Pass true, if you want to match with case-sensitive. + * @param {boolean} Pass true, if you want to match with entire cell contents. + * @returns {void} + */ + replaceAllBySheet(findData: string,replaceData: string,isCSen: boolean,isEMatch: boolean): void; +} + +export interface XLSelection { + + /** This method is used to get the selected cells element based on specified sheet index in the Spreadsheet. + * @param {number} Pass the sheet index to get the cells element. + * @returns {HTMLElement} + */ + getSelectedCells(sheetIdx: number): HTMLElement; + + /** This method is used to refresh the selection in the Spreadsheet. + * @param {Array} Optional. Pass range to refresh selection. + * @returns {void} + */ + refreshSelection(range: Array): void; + + /** This method is used to select a single column in the Spreadsheet. + * @param {number} Pass the column index value. + * @returns {void} + */ + selectColumn(colIdx: number): void; + + /** This method is used to select entire columns in a specified range (start index and end index) in the Spreadsheet. + * @param {number} Pass the column start index. + * @param {number} Pass the column end index. + * @returns {void} + */ + selectColumns(startIdx: number,endIdx: number): void; + + /** This method is used to select the specified range of cells in the Spreadsheet. + * @param {string} Pass range which want to select. + * @param {any} Pass the row and column index of the end cell. + * @returns {void} + */ + selectRange(range: string,endCell: any): void; + + /** This method is used to select a single row in the Spreadsheet. + * @param {number} Pass the row index value. + * @returns {void} + */ + selectRow(rowIdx: number): void; + + /** This method is used to select entire rows in a specified range (start index and end index) in the Spreadsheet. + * @param {number} Pass the start row index. + * @param {number} Pass the end row index. + * @returns {void} + */ + selectRows(startIdx: number,endIdx: number): void; + + /** This method is used to select all cells in active sheet. + * @returns {void} + */ + selectSheet(): void; +} + +export interface XLSort { + + /** This method is used to sort a particular range of cells based on its cell or font color in the Spreadsheet. + * @param {string} Pass 'PutCellColor' to sort by cell color or 'PutFontColor' for by font color. + * @param {any} Pass the HEX color code to sort. + * @param {string} Pass the range + * @returns {void} + */ + sortByColor(operation: string,color: any,range: string): void; + + /** This method is used to sort a particular range of cells based on its values in the Spreadsheet. + * @param {Array|string} Pass the range to sort. + * @param {string} Pass the column name. + * @param {any} Pass the direction to sort (ascending or descending). + * @returns {void} + */ + sortByRange(range: Array|string,columnName: string,direction: any): void; +} + +export interface XLValidate { + + /** This method is used to apply data validation rules in a selected range of cells based on the defined condition in the Spreadsheet. + * @param {string} If range is specified, it will apply rules for the specified range else it will use the current selected range. + * @param {Array} Pass the validation condition, value1 and value2. + * @param {string} Pass the data type. + * @param {boolean} Pass 'true' if you ignore blank values. + * @param {boolean} Pass 'true' if you want to show an error alert. + * @returns {void} + */ + applyDVRules(range: string,values: Array,type: string,required: boolean,showErrorAlert: boolean): void; + + /** This method is used to clear the applied validation rules in a specified range of cells in the Spreadsheet. + * @param {string} Optional. If range is specified, it will clear rules for the specified range else it will use the current selected range. + * @returns {void} + */ + clearDV(range: string): void; + + /** This method is used to highlight invalid data in a specified range of cells in the Spreadsheet. + * @param {string} Optional. If range is specified, it will clear rules for the specified range else it will use the current selected range. + * @returns {void} + */ + highlightInvalidData(range: string): void; +} + +export interface Model { + + /**Gets or sets an active sheet index in the Spreadsheet. By defining this value, you can specify which sheet should be active in workbook. + * @Default {1} + */ + activeSheetIndex?: number; + + /**Gets or sets a value that indicates whether to enable or disable auto rendering of cell type in the Spreadsheet. + * @Default {false} + */ + allowAutoCellType?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable auto fill feature in the Spreadsheet. + * @Default {true} + */ + allowAutoFill?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable auto sum feature in the Spreadsheet. + * @Default {true} + */ + allowAutoSum?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable cell format feature in the Spreadsheet. By enabling this, you can customize styles and number formats. + * @Default {true} + */ + allowCellFormatting?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable cell type feature in the Spreadsheet. + * @Default {false} + */ + allowCellType?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable chart feature in the Spreadsheet. By enabling this feature, you can create and customize charts in Spreadsheet. + * @Default {true} + */ + allowCharts?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable clipboard feature in the Spreadsheet. By enabling this feature, you can perform cut/copy and paste operations in Spreadsheet. + * @Default {true} + */ + allowClipboard?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable comment feature in the Spreadsheet. By enabling this, you can add/delete/modify comments in Spreadsheet. + * @Default {true} + */ + allowComments?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable Conditional Format feature in the Spreadsheet. By enabling this, you can apply formatting to the selected range of cells based on the provided conditions (Greater than, Less than, Equal, Between, Contains, etc.).Note: allowCellFormatting must be true while using conditional formatting. + * @Default {true} + */ + allowConditionalFormats?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable data validation feature in the Spreadsheet. + * @Default {true} + */ + allowDataValidation?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable the delete action in the Spreadsheet. By enabling this feature, you can delete existing rows, columns, cells and sheet. + * @Default {true} + */ + allowDelete?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable drag and drop feature in the Spreadsheet. + * @Default {true} + */ + allowDragAndDrop?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable the edit action in the Spreadsheet. + * @Default {true} + */ + allowEditing?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable filtering feature in the Spreadsheet. Filtering can be used to limit the data displayed using required criteria. + * @Default {true} + */ + allowFiltering?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable table feature in the Spreadsheet. By enabling this, you can render table in selected range. + * @Default {true} + */ + allowFormatAsTable?: boolean; + + /**Get or sets a value that indicates whether to enable or disable format painter feature in the Spreadsheet. By enabling this feature, you can copy the format from the selected range and apply it to another range. + * @Default {true} + */ + allowFormatPainter?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable formula bar in the Spreadsheet. + * @Default {true} + */ + allowFormulaBar?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable freeze pane support in Spreadsheet. After enabling this feature, you can use freeze top row, freeze first column and freeze panes options. + * @Default {true} + */ + allowFreezing?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable hyperlink feature in the Spreadsheet. By enabling this feature, you can add hyperlink which is used to easily navigate to the cell reference from one sheet to another or a web page. + * @Default {true} + */ + allowHyperlink?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable import feature in the Spreadsheet. By enabling this feature, you can open existing Spreadsheet documents. + * @Default {true} + */ + allowImport?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable the insert action in the Spreadsheet. By enabling this feature, you can insert new rows, columns, cells and sheet. + * @Default {true} + */ + allowInsert?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable keyboard navigation feature in the Spreadsheet. + * @Default {true} + */ + allowKeyboardNavigation?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable lock cell feature in the Spreadsheet. + * @Default {true} + */ + allowLockCell?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable merge feature in the Spreadsheet. + * @Default {true} + */ + allowMerging?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable resizing feature in the Spreadsheet. By enabling this feature, you can change the column width and row height by dragging its header boundaries. + * @Default {true} + */ + allowResizing?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable find and replace feature in the Spreadsheet. By enabling this, you can easily find and replace a specific value in the sheet or workbook. By using goto behavior, you can select and highlight all cells that contains specific data or data types. + * @Default {true} + */ + allowSearching?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable selection in the Spreadsheet. By enabling this feature, selected items will be highlighted. + * @Default {true} + */ + allowSelection?: boolean; + + /**Gets or sets a value that indicates whether to enable the sorting feature in the Spreadsheet. + * @Default {true} + */ + allowSorting?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable undo and redo feature in the Spreadsheet. + * @Default {true} + */ + allowUndoRedo?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable wrap text feature in the Spreadsheet. By enabling this, cell content can wrap to the next line, if the cell content exceeds the boundary of the cell. + * @Default {true} + */ + allowWrap?: boolean; + + /**Gets or sets a value that indicates to define the width of the activation panel in Spreadsheet. + * @Default {200} + */ + apWidth?: number; + + /**Gets or sets an object that indicates to customize the auto fill behavior in the Spreadsheet. + */ + autoFillSettings?: AutoFillSettings; + + /**Gets or sets an object that indicates to customize the chart behavior in the Spreadsheet. + */ + chartSettings?: ChartSettings; + + /**Gets or sets a value that defines the number of columns displayed in the sheet. + * @Default {21} + */ + columnCount?: number; + + /**Gets or sets a value that indicates to define the common width for each column in the Spreadsheet. + * @Default {60} + */ + columnWidth?: number; + + /**Gets or sets a value that indicates to render the spreadsheet with custom theme. + */ + cssClass?: string; + + /**Gets or sets a value that indicates whether to enable or disable context menu in the Spreadsheet. + * @Default {true} + */ + enableContextMenu?: boolean; + + /**Gets or sets an object that indicates to customize the exporting behavior in Spreadsheet. + */ + exportSettings?: ExportSettings; + + /**Gets or sets an object that indicates to customize the format behavior in the Spreadsheet. + */ + formatSettings?: FormatSettings; + + /**Gets or sets an object that indicates to customize the import behavior in the Spreadsheet. + */ + importSettings?: ImportSettings; + + /**Gets or sets a value that indicates whether to customizing the user interface (UI) as locale-specific in order to display regional data (i.e.) in a language and culture specific to a particular country or region. + * @Default {en-US} + */ + locale?: string; + + /**Gets or sets an object that indicates to customize the picture behavior in the Spreadsheet. + */ + pictureSettings?: PictureSettings; + + /**Gets or sets an object that indicates to customize the print option in Spreadsheet. + */ + printSettings?: PrintSettings; + + /**Gets or sets a value that indicates whether to define the number of rows to be displayed in the sheet. + * @Default {20} + */ + rowCount?: number; + + /**Gets or sets a value that indicates to define the common height for each row in the sheet. + * @Default {20} + */ + rowHeight?: number; + + /**Gets or sets an object that indicates to customize the scroll options in the Spreadsheet. + */ + scrollSettings?: ScrollSettings; + + /**Gets or sets an object that indicates to customize the selection options in the Spreadsheet. + */ + selectionSettings?: SelectionSettings; + + /**Gets or sets a value that indicates to define the number of sheets to be created at the initial load. + * @Default {1} + */ + sheetCount?: number; + + /**Gets or sets an object that indicates to customize the sheet behavior in Spreadsheet. + */ + sheets?: Array; + + /**Gets or sets a value that indicates whether to show or hide ribbon in the Spreadsheet. + * @Default {true} + */ + showRibbon?: boolean; + + /**This is used to set the number of undo-redo steps in the Spreadsheet. + * @Default {20} + */ + undoRedoStep?: number; + + /**Define the username for the Spreadsheet which is displayed in comment. + * @Default {User Name} + */ + userName?: string; + + /**Triggered for every action before its starts.*/ + actionBegin? (e: ActionBeginEventArgs): void; + + /**Triggered for every action complete.*/ + actionComplete? (e: ActionCompleteEventArgs): void; + + /**Triggered when the auto fill operation begins.*/ + autoFillBegin? (e: AutoFillBeginEventArgs): void; + + /**Triggered when the auto fill operation completes.*/ + autoFillComplete? (e: AutoFillCompleteEventArgs): void; + + /**Triggered before the cells to be formatted.*/ + beforeCellFormat? (e: BeforeCellFormatEventArgs): void; + + /**Triggered before the cell selection.*/ + beforeCellSelect? (e: BeforeCellSelectEventArgs): void; + + /**Triggered before the selected cells are dropped.*/ + beforeDrop? (e: BeforeDropEventArgs): void; + + /**Triggered before the contextmenu is open.*/ + beforeOpen? (e: BeforeOpenEventArgs): void; + + /**Triggered before the activation panel is open.*/ + beforePanelOpen? (e: BeforePanelOpenEventArgs): void; + + /**Triggered when click on sheet cell.*/ + cellClick? (e: CellClickEventArgs): void; + + /**Triggered when the cell is edited.*/ + cellEdit? (e: CellEditEventArgs): void; + + /**Triggered when mouse hover on cell in sheets.*/ + cellHover? (e: CellHoverEventArgs): void; + + /**Triggered when save the edited cell.*/ + cellSave? (e: CellSaveEventArgs): void; + + /**Triggered when click the contextmenu items.*/ + contextMenuClick? (e: ContextMenuClickEventArgs): void; + + /**Triggered when the selected cells are being dragged.*/ + drag? (e: DragEventArgs): void; + + /**Triggered when the selected cells are initiated to drag.*/ + dragStart? (e: DragStartEventArgs): void; + + /**Triggered when the selected cells are dropped.*/ + drop? (e: DropEventArgs): void; + + /**Triggered before the range editing starts.*/ + editRangeBegin? (e: EditRangeBeginEventArgs): void; + + /**Triggered after range editing completes.*/ + editRangeComplete? (e: EditRangeCompleteEventArgs): void; + + /**Triggered before the sheet is loaded.*/ + load? (e: LoadEventArgs): void; + + /**Triggered after the sheet is loaded.*/ + loadComplete? (e: LoadCompleteEventArgs): void; + + /**Triggered every click of the menu item.*/ + menuClick? (e: MenuClickEventArgs): void; + + /**Triggered when import sheet is failed to open.*/ + openFailure? (e: OpenFailureEventArgs): void; + + /**Triggered when pager item is clicked in the Spreadsheet.*/ + pagerClick? (e: PagerClickEventArgs): void; + + /**Triggered when click on the ribbon.*/ + ribbonClick? (e: RibbonClickEventArgs): void; + + /**Triggered when the chart series rendering.*/ + seriesRendering? (e: SeriesRenderingEventArgs): void; + + /**Triggered when click the ribbon tab.*/ + tabClick? (e: TabClickEventArgs): void; + + /**Triggered when select the ribbon tab.*/ + tabSelect? (e: TabSelectEventArgs): void; +} + +export interface ActionBeginEventArgs { + + /**Returns the applied style format object. + */ + afterFormat?: any; + + /**Returns the applied style format object. + */ + beforeFormat?: any; + + /**Returns the sheet index. + */ + sheetIdx?: number; + + /**Returns the cell range. + */ + range?: Array; + + /**Returns the action format. + */ + reqType?: string; + + /**Returns goto index while paging. + */ + gotoIdx?: number; + + /**Returns boolean value. If create new sheet it returns true. + */ + newSheet?: boolean; + + /**Return column name while sorting. + */ + columnName?: string; + + /**Returns selected columns while sorting or filtering begins. + */ + colSelected?: number; + + /**Returns sort direction while sort action begins. + */ + sortDirection?: string; +} + +export interface ActionCompleteEventArgs { + + /**Returns Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the applied cell format object. + */ + selectedCell?: Array|any; + + /**Returns the sheet index. + */ + sheetIdx?: number; + + /**Returns the request type. + */ + reqType?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface AutoFillBeginEventArgs { + + /**Returns auto fill begin cell range. + */ + dataRange?: Array; + + /**Returns which direction drag the auto fill. + */ + direction?: string; + + /**Returns fill cells range. + */ + fillRange?: Array; + + /**Returns the auto fill type. + */ + fillType?: string; + + /**Returns the sheet index. + */ + sheetIdx?: number; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface AutoFillCompleteEventArgs { + + /**Returns auto fill begin cell range. + */ + dataRange?: Array; + + /**Returns which direction to drag the auto fill. + */ + direction?: string; + + /**Returns fill cells range. + */ + fillRange?: Array; + + /**Returns the auto fill type. + */ + fillType?: string; + + /**Returns the sheet index. + */ + sheetIdx?: number; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface BeforeCellFormatEventArgs { + + /**Returns the sheet index. + */ + sheetIdx?: number; + + /**Returns the applied style format object. + */ + format?: any; + + /**Returns the selected cells. + */ + cells?: Array|any; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface BeforeCellSelectEventArgs { + + /**Returns the previous cell range. + */ + prevRange?: Array; + + /**Returns the current cell range. + */ + currRange?: Array; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface BeforeDropEventArgs { + + /**Returns the sheet index. + */ + sheetIdx?: number; + + /**Returns the current cell row and column index. + */ + currentCell?: any; + + /**Returns the drag cells range object. + */ + dragAndDropRange?: any; + + /**Returns the cell Overwriting alert option value. + */ + preventAlert?: boolean; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the target item. + */ + target?: HTMLElement; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface BeforeOpenEventArgs { + + /**Returns the target element. + */ + target?: HTMLElement; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface BeforePanelOpenEventArgs { + + /**Returns the sheet index. + */ + sheetIdx?: number; + + /**Returns the activation panel element. + */ + activationPanel?: any; + + /**Returns the range option value. + */ + range?: any; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface CellClickEventArgs { + + /**Returns the click cell element. + */ + cell?: HTMLElement; + + /**Returns the column index of clicked cell. + */ + columnIndex?: number; + + /**Returns the row index of clicked cell. + */ + rowIndex?: number; + + /**Returns the column name of clicked cell. + */ + columnName?: string; + + /**Returns the column information. + */ + columnObject?: any; +} + +export interface CellEditEventArgs { + + /**Returns the click cell element. + */ + cell?: HTMLElement; + + /**Returns the columnName of clicked cell. + */ + columnName?: string; + + /**Returns the column field information. + */ + columnObject?: any; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface CellHoverEventArgs { + + /**Returns the target element. + */ + target?: HTMLElement; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface CellSaveEventArgs { + + /**Returns the save cell element. + */ + cell?: HTMLElement; + + /**Returns the columnName of clicked cell. + */ + columnName?: string; + + /**Returns the column field information. + */ + columnObject?: any; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the cell previous value. + */ + pValue?: string; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the cell value. + */ + value?: string; +} + +export interface ContextMenuClickEventArgs { + + /**Returns target element Id. + */ + Id?: string; + + /**Returns the target element. + */ + element?: HTMLElement; + + /**Returns event information. + */ + event?: any; + + /**Returns target element and event information. + */ + events?: any; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns target element parent Id. + */ + parentId?: string; + + /**Returns target element parent text. + */ + parentText?: string; + + /**Returns target element text. + */ + text?: string; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface DragEventArgs { + + /**Returns the sheet index. + */ + sheetIdx?: number; + + /**Returns the current cell row and column index. + */ + currentCell?: any; + + /**Returns the drag cells range object. + */ + dragAndDropRange?: any; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the target item. + */ + target?: HTMLElement; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface DragStartEventArgs { + + /**Returns the sheet index. + */ + sheetIdx?: number; + + /**Returns the current cell row and column index. + */ + currentCell?: any; + + /**Returns the drag cells range object. + */ + dragAndDropRange?: any; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the target item. + */ + target?: HTMLElement; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface DropEventArgs { + + /**Returns the sheet index. + */ + sheetIdx?: number; + + /**Returns the current cell row and column index. + */ + currentCell?: any; + + /**Returns the drag cells range object. + */ + dragAndDropRange?: any; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the target item. + */ + target?: HTMLElement; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface EditRangeBeginEventArgs { + + /**Returns the sheet index. + */ + sheetIdx?: number; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the range option value. + */ + range?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface EditRangeCompleteEventArgs { + + /**Returns the sheet index. + */ + sheetIdx?: number; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the range option value. + */ + range?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface LoadEventArgs { + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the active sheet index. + */ + sheetIndex?: number; +} + +export interface LoadCompleteEventArgs { + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface MenuClickEventArgs { + + /**Returns menu click element. + */ + element?: HTMLElement; + + /**Returns the event information. + */ + event?: any; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns target element parent Id. + */ + parentId?: string; + + /**Returns target element parent text. + */ + parentText?: string; + + /**Returns target element text. + */ + text?: string; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface OpenFailureEventArgs { + + /**Returns the failure type. + */ + failureType?: string; + + /**Returns the status index. + */ + status?: number; + + /**Returns the status in text. + */ + statusText?: string; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface PagerClickEventArgs { + + /**Returns the active sheet index. + */ + activeSheet?: number; + + /**Returns the new sheet index. + */ + gotoSheet?: number; + + /**Returns whether new sheet icon is clicked. + */ + newSheet?: boolean; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface RibbonClickEventArgs { + + /**Returns element Id. + */ + Id?: string; + + /**Returns target information. + */ + prop?: any; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns status. + */ + status?: boolean; + + /**Returns isChecked in boolean. + */ + isChecked?: boolean; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface SeriesRenderingEventArgs { + + /**Returns chart data and chart information. + */ + data?: any; + + /**Returns the chart model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface TabClickEventArgs { + + /**Returns the active tab index. + */ + activeIndex?: number; + + /**Returns active tab header element. + */ + activeHeader?: any; + + /**Returns previous active tab header element. + */ + prevActiveHeader?: any; + + /**Returns previous active tab index. + */ + prevActiveIndex?: number; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface TabSelectEventArgs { + + /**Returns the active tab index. + */ + activeIndex?: number; + + /**Returns active tab header element. + */ + activeHeader?: any; + + /**Returns previous active tab header element. + */ + prevActiveHeader?: any; + + /**Returns previous active tab index. + */ + prevActiveIndex?: number; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface AutoFillSettings { + + /**This property is used to set fillType unit in Spreadsheet. It has five types which are CopyCells, FillSeries, FillFormattingOnly, FillWithoutFormatting and FlashFill. + * @Default {ej.Spreadsheet.AutoFillOptions.FillSeries} + */ + fillType?: ej.Spreadsheet.AutoFillOptions|string; + + /**Gets or sets a value that indicates to enable or disable auto fill options in the Spreadsheet. + * @Default {true} + */ + showFillOptions?: boolean; +} + +export interface ChartSettings { + + /**Gets or sets a value that defines the chart height in Spreadsheet. + * @Default {220} + */ + height?: number; + + /**Gets or sets a value that defines the chart width in the Spreadsheet. + * @Default {440} + */ + width?: number; +} + +export interface ExportSettings { + + /**Gets or sets a value that indicates whether to enable or disable save feature in Spreadsheet. By enabling this feature, you can save existing Spreadsheet. + * @Default {true} + */ + allowExporting?: boolean; + + /**Gets or sets a value that indicates to define csvUrl for export to csv format. + * @Default {null} + */ + csvUrl?: string; + + /**Gets or sets a value that indicates to define excelUrl for export to excel format.Note: User must specify allowExporting true while use this property. + * @Default {null} + */ + excelUrl?: string; + + /**Gets or sets a value that indicates to define password while export to excel format. + * @Default {null} + */ + password?: string; +} + +export interface FormatSettings { + + /**Gets or sets a value that indicates whether to enable or disable cell border feature in the Spreadsheet. + * @Default {true} + */ + allowCellBorder?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable decimal places in the Spreadsheet. + * @Default {true} + */ + allowDecimalPlaces?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable font family feature in Spreadsheet. + * @Default {true} + */ + allowFontFamily?: boolean; +} + +export interface ImportSettings { + + /**Sets import mapper to perform import feature in Spreadsheet. + */ + importMapper?: string; + + /**Sets import Url to access the online files in the Spreadsheet. + */ + importUrl?: string; + + /**Gets or sets a value that indicates to define password while importing in the Spreadsheet. + */ + password?: string; +} + +export interface PictureSettings { + + /**Gets or sets a value that indicates whether to enable or disable picture feature in Spreadsheet. By enabling this, you can add pictures in Spreadsheet. + * @Default {true} + */ + allowPictures?: boolean; + + /**Gets or sets a value that indicates to define height to picture in the Spreadsheet. + * @Default {220} + */ + height?: number; + + /**Gets or sets a value that indicates to define width to picture in the Spreadsheet. + * @Default {440} + */ + width?: number; +} + +export interface PrintSettings { + + /**Gets or sets a value that indicates whether to enable or disable page setup support for printing in Spreadsheet. + * @Default {true} + */ + allowPageSetup?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable page size support for printing in Spreadsheet. + * @Default {false} + */ + allowPageSize?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable print feature in the Spreadsheet. + * @Default {true} + */ + allowPrinting?: boolean; +} + +export interface ScrollSettings { + + /**Gets or sets a value that indicates whether to enable or disable scrolling in Spreadsheet. + * @Default {true} + */ + allowScrolling?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable sheet on demand. By enabling this, it render only the active sheet element while paging remaining sheets are created one by one. + * @Default {false} + */ + allowSheetOnDemand?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable virtual scrolling feature in the Spreadsheet. + * @Default {true} + */ + allowVirtualScrolling?: boolean; + + /**Gets or sets the value that indicates to define the height of spreadsheet. + * @Default {550} + */ + height?: number|string; + + /**Gets or sets the value that indicates whether to enable or disable responsive mode in the Spreadsheet. + * @Default {false} + */ + isResponsive?: boolean; + + /**Gets or sets a value that indicates to set scroll mode in Spreadsheet. It has two scroll modes, Normal and Infinite. + * @Default {ej.Spreadsheet.scrollMode.Infinite} + */ + scrollMode?: ej.Spreadsheet.scrollMode|string; + + /**Gets or sets the value that indicates to define the height off spreadsheet. + * @Default {1200} + */ + width?: number|string; +} + +export interface SelectionSettings { + + /**Gets or sets a value that indicates to define active cell in spreadsheet. + */ + activeCell?: string; + + /**Gets or sets a value that indicates to define animation time while selection in the Spreadsheet. + * @Default {0.001} + */ + animationTime?: number; + + /**Gets or sets a value that indicates to enable or disable animation while selection.Note: allowSelection must be true while using this property. + * @Default {false} + */ + enableAnimation?: boolean; + + /**Gets or sets a value that indicates to set selection type in Spreadsheet. It has three types which are Column, Row and default. + * @Default {ej.Spreadsheet.SelectionType.Default} + */ + selectionType?: ej.Spreadsheet.SelectionType|string; + + /**Gets or sets a value that indicates to set selection unit in Spreadsheet. It has three types which are Single, Range and MultiRange. + * @Default {ej.Spreadsheet.SelectionUnit.MultiRange} + */ + selectionUnit?: ej.Spreadsheet.SelectionUnit|string; +} + +export interface SheetsRangeSettings { + + /**Gets or sets the data to render the Spreadsheet. + */ + dataSource?: any; + + /**Specifies the header styles for the datasource range in Spreadsheet. + * @Default {null} + */ + headerStyles?: any; + + /**Specifies the primary key for the datasource in Spreadsheet. + */ + primaryKey?: string; + + /**Specifies the query for the datasource in Spreadsheet. + * @Default {null} + */ + query?: any; + + /**Gets or sets a value that indicates whether to enable or disable the datasource header in Spreadsheet. + * @Default {false} + */ + showHeader?: boolean; + + /**Specifies the start cell for the datasource range in Spreadsheet. + * @Default {A1} + */ + startCell?: string; +} + +export interface Sheets { + + /**Gets or sets a value that indicates to define column count in the Spreadsheet. + * @Default {21} + */ + colCount?: number; + + /**Gets or sets a value that indicates to define column width in the Spreadsheet. + * @Default {64} + */ + columnWidth?: number; + + /**Gets or sets the data to render the Spreadsheet. + */ + dataSource?: any; + + /**Gets or sets a value that indicates whether to enable or disable field as column header in the Spreadsheet. + * @Default {false} + */ + fieldAsColumnHeader?: boolean; + + /**Specifies the header styles for the datasource range in Spreadsheet. + * @Default {null} + */ + headerStyles?: any; + + /**Specifies the primary key for the datasource in Spreadsheet. + */ + primaryKey?: string; + + /**Specifies the query for the datasource in Spreadsheet. + * @Default {null} + */ + query?: any; + + /**Specifies single range or multiple range settings for a sheet in Spreadsheet. + */ + rangeSettings?: Array; + + /**Gets or sets a value that indicates to define row count in the Spreadsheet. + * @Default {20} + */ + rowCount?: number; + + /**Gets or sets a value that indicates whether to show or hide grid lines in the Spreadsheet. + * @Default {true} + */ + showGridlines?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable the datasource header in Spreadsheet. + * @Default {false} + */ + showHeader?: boolean; + + /**Gets or sets a value that indicates whether to show or hide headings in the Spreadsheet. + * @Default {true} + */ + showHeadings?: boolean; + + /**Specifies the start cell for the datasource range in Spreadsheet. + * @Default {A1} + */ + startCell?: string; +} + +enum AutoFillOptions{ + + ///Specifies the CopyCells property in AutoFillOptions. + CopyCells, + + ///Specifies the FillSeries property in AutoFillOptions. + FillSeries, + + ///Specifies the FillFormattingOnly property in AutoFillOptions. + FillFormattingOnly, + + ///Specifies the FillWithoutFormatting property in AutoFillOptions. + FillWithoutFormatting, + + ///Specifies the FlashFill property in AutoFillOptions. + FlashFill +} + + +enum scrollMode{ + + ///To enable Infinite scroll mode for Spreadsheet. + Infinite, + + ///To enable Normal scroll mode for Spreadsheet. + Normal +} + + +enum SelectionType{ + + ///To select only Column in Spreadsheet. + Column, + + ///To select only Row in Spreadsheet. + Row, + + ///To select both Column/Row in Spreadsheet. + Default +} + + +enum SelectionUnit{ + + ///To enable Single selection in Spreadsheet. + Single, + + ///To enable Range selection in Spreadsheet. + Range, + + ///To enable MultiRange selection in Spreadsheet. + MultiRange +} + +} + +} +declare module ej.olap { + +class OlapChart extends ej.Widget { + static fn: OlapChart; + constructor(element: JQuery, options?: OlapChart.Model); + constructor(element: Element, options?: OlapChart.Model); + model:OlapChart.Model; + defaults:OlapChart.Model; + + /** Perform an asynchronous HTTP (AJAX) request. + * @returns {void} + */ + doAjaxPost(): void; + + /** Perform an asynchronous HTTP (FullPost) submit. + * @returns {void} + */ + doPostBack(): void; + + /** Exports the OlapChart to an appropriate format based on the parameter passed. + * @returns {void} + */ + exportOlapChart(): void; + + /** This function receives the JSON formatted datasource to render the OlapChart control. + * @returns {void} + */ + renderChartFromJSON(): void; + + /** This function receives the update from service-end, which would be utilized for rendering the widget. + * @returns {void} + */ + renderControlSuccess(): void; +} +export module OlapChart{ + +export interface Model { + + /**Specifies the CSS class to OlapChart to achieve custom theme. + * @Default {“”} + */ + cssClass?: string; + + /**Contains the serialized OlapReport at that instant, that is, current OlapReport. + * @Default {“”} + */ + currentReport?: string; + + /**Object utilized to pass additional information between client-end and service-end. + * @Default {{}} + */ + customObject?: any; + + /**Allows the user to enable 3D view of OlapChart. + * @Default {false} + */ + enable3D?: boolean; + + /**Allows the user to enable OlapChart’s responsiveness in the browser layout. + * @Default {false} + */ + isResponsive?: boolean; + + /**Allows the user to set the localized language for the widget. + * @Default {en-US} + */ + locale?: string; + + /**Allows the user to rotate the angle of OlapChart in 3D view. + * @Default {0} + */ + rotation?: number; + + /**Allows the user to set custom name for the methods at service-end, communicated on AJAX post. + * @Default {{}} + */ + serviceMethodSettings?: ServiceMethodSettings; + + /**Connects the service using the specified URL for any server updates. + * @Default {“”} + */ + url?: string; + + /**Triggers when it reaches client-side after any AJAX request.*/ + afterServiceInvoke? (e: AfterServiceInvokeEventArgs): void; + + /**Triggers before any AJAX request is passed from OlapChart to service methods.*/ + beforeServiceInvoke? (e: BeforeServiceInvokeEventArgs): void; + + /**Triggers when drill up/down happens in OlapChart control.*/ + drillSuccess? (e: DrillSuccessEventArgs): void; + + /**Triggers when OlapChart widget completes all operations at client-side after any AJAX request.*/ + renderComplete? (e: RenderCompleteEventArgs): void; + + /**Triggers when any error occurred during AJAX request.*/ + renderFailure? (e: RenderFailureEventArgs): void; + + /**Triggers when OlapChart successfully reaches client-side after any AJAX request.*/ + renderSuccess? (e: RenderSuccessEventArgs): void; +} + +export interface AfterServiceInvokeEventArgs { + + /**return the current action of OlapChart control. + */ + action?: string; + + /**return the custom object bounds with OlapChart control. + */ + customObject?: any; + + /**return the outer HTML of OlapChart control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapChart model. + */ + model?: ej.olap.OlapChart.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface BeforeServiceInvokeEventArgs { + + /**return the current action of OlapChart control. + */ + action?: string; + + /**return the custom object bounds with OlapChart control. + */ + customObject?: any; + + /**return the outer HTML of OlapChart control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapChart model. + */ + model?: ej.olap.OlapChart.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface DrillSuccessEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapChart model. + */ + model?: ej.olap.OlapChart.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RenderCompleteEventArgs { + + /**return the current action of OlapChart control. + */ + action?: string; + + /**return the custom object bounds with OlapChart control. + */ + customObject?: any; + + /**return the outer HTML of OlapChart control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapChart model. + */ + model?: ej.olap.OlapChart.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RenderFailureEventArgs { + + /**return the current action of OlapChart control. + */ + action?: string; + + /**return the custom object bounds with OlapChart control. + */ + customObject?: any; + + /**return the error stack trace of the original exception. + */ + message?: any; + + /**return the outer HTML of OlapChart control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapChart model. + */ + model?: ej.olap.OlapChart.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RenderSuccessEventArgs { + + /**return the current action of OlapChart control. + */ + action?: string; + + /**return the custom object bounds with OlapChart control. + */ + customObject?: any; + + /**return the outer HTML of OlapChart control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapChart model. + */ + model?: ej.olap.OlapChart.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface ServiceMethodSettings { + + /**Allows the user to set the custom name for the service method that’s responsible for exporting. + * @Default {Export} + */ + exportOlapChart?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for drilling up/down operation in OlapChart. + * @Default {DrillChart} + */ + drillDown?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for initializing OlapChart. + * @Default {InitializeChart} + */ + initialize?: string; +} +} + +class OlapClient extends ej.Widget { + static fn: OlapClient; + constructor(element: JQuery, options?: OlapClient.Model); + constructor(element: Element, options?: OlapClient.Model); + model:OlapClient.Model; + defaults:OlapClient.Model; + + /** Perform an asynchronous HTTP (AJAX) request. + * @returns {void} + */ + doAjaxPost(): void; + + /** Perform an asynchronous HTTP (FullPost) submit. + * @returns {void} + */ + doPostBack(): void; +} +export module OlapClient{ + +export interface Model { + + /**Allows the user to set the specific chart type for OlapChart. + * @Default {ej.olap.OlapChart.ChartTypes.Column} + */ + chartType?: ej.olap.OlapChart.ChartTypes|string; + + /**Sets the mode to export the OLAP visualization components such as OlapChart and PivotGrid in OlapClient. Based on the option, either Chart or Grid or both gets exported. + * @Default {ej.olap.OlapClient.ClientExportMode.ChartAndGrid} + */ + clientExportMode?: string; + + /**Specifies the CSS class to OlapClient to achieve custom theme. + * @Default {“”} + */ + cssClass?: string; + + /**Object utilized to pass additional information between client-end and service-end. + * @Default {{}} + */ + customObject?: any; + + /**Allows the user to customize the widgets layout and appearance. + * @Default {{}} + */ + displaySettings?: DisplaySettings; + + /**Allows the user to refresh the control on-demand and not during every UI operation. + * @Default {false} + */ + enableDeferUpdate?: boolean; + + /**Enables/disables the visibility of measure group selector drop-down in Cube Browser. + * @Default {false} + */ + enableMeasureGroups?: boolean; + + /**Sets the summary layout for PivotGrid. Following are the ways in which summary can be positioned: normal summary (bottom), top summary, no summary and excel-like summary. + * @Default {ej.PivotGrid.Layout.Normal} + */ + gridLayout?: ej.PivotGrid.Layout|string; + + /**Allows the user to set the localized language for the widget. + * @Default {en-US} + */ + locale?: string; + + /**Allows the user to set custom name for the methods at service-end, communicated during AJAX post. + * @Default {{}} + */ + serviceMethodSettings?: ServiceMethodSettings; + + /**Sets the title for OlapClient widget. + * @Default {null} + */ + title?: string; + + /**Connects the service using the specified URL for any server updates. + * @Default {null} + */ + url?: string; + + /**Triggers when it reaches client-side after any AJAX request.*/ + afterServiceInvoke? (e: AfterServiceInvokeEventArgs): void; + + /**Triggers before any AJAX request is passed from OlapClient to service methods.*/ + beforeServiceInvoke? (e: BeforeServiceInvokeEventArgs): void; + + /**Triggers before rendering the OlapChart.*/ + chartLoad? (e: ChartLoadEventArgs): void; + + /**Triggers while we initiate loading of the widget.*/ + load? (e: LoadEventArgs): void; + + /**Triggers when OlapClient widget completes all operations at client-end after any AJAX request.*/ + renderComplete? (e: RenderCompleteEventArgs): void; + + /**Triggers when any error occurred during AJAX request.*/ + renderFailure? (e: RenderFailureEventArgs): void; + + /**Triggers when OlapClient successfully reaches client-side after any AJAX request.*/ + renderSuccess? (e: RenderSuccessEventArgs): void; +} + +export interface AfterServiceInvokeEventArgs { + + /**return the current action of OlapClient control. + */ + action?: string; + + /**return the custom object bounds with OlapClient control. + */ + customObject?: any; + + /**return the outer HTML of OlapClient control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapClient model. + */ + model?: ej.olap.OlapClient.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface BeforeServiceInvokeEventArgs { + + /**return the current action of OlapClient control. + */ + action?: string; + + /**return the custom object bounds with OlapClient control. + */ + customObject?: any; + + /**return the outer HTML of OlapClient control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapClient model. + */ + model?: ej.olap.OlapClient.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface ChartLoadEventArgs { + + /**return the current action of OlapChart control. + */ + action?: string; + + /**return the custom object bounds with OlapChart control. + */ + customObject?: any; + + /**return the outer HTML of OlapChart control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapChart model. + */ + model?: ej.olap.OlapClient.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface LoadEventArgs { + + /**returns the outer HTML of OlapClient component. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapClient model. + */ + model?: ej.olap.OlapClient.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RenderCompleteEventArgs { + + /**returns the custom object bounded with the control. + */ + customObject?: any; + + /**returns the outer HTML of OlapClient control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapClient model. + */ + model?: ej.olap.OlapClient.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RenderFailureEventArgs { + + /**returns the custom object bounded with the control. + */ + customObject?: any; + + /**returns the outer HTML of OlapClient control. + */ + element?: string; + + /**returns the error message with error code. + */ + message?: any; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapClient model. + */ + model?: ej.olap.OlapClient.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RenderSuccessEventArgs { + + /**returns the custom object bounded with the control. + */ + customObject?: any; + + /**returns the outer HTML of OlapClient control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapClient model. + */ + model?: ej.olap.OlapClient.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface DisplaySettings { + + /**Let’s the user to customize the display of OlapChart and PivotGrid widgets, either in tab view or in tile view. + * @Default {ej.olap.OlapClient.ControlPlacement.Tab} + */ + controlPlacement?: ej.olap.OlapClient.ControlPlacement|string; + + /**Let’s the user to set either Chart or Grid as the start-up widget. + * @Default {ej.olap.OlapClient.DefaultView.Grid} + */ + defaultView?: ej.olap.OlapClient.DefaultView|string; + + /**Enables/disables the full screen view of OlapChart and PivotGrid in OlapClient. + * @Default {false} + */ + enableFullScreen?: boolean; + + /**Enhances the space for PivotGrid and OlapChart, by hiding Cube Browser and Axis Element Builder. + * @Default {false} + */ + enableTogglePanel?: boolean; + + /**Allows the user to enable OlapClient’s responsiveness in the browser layout. + * @Default {false} + */ + isResponsive?: boolean; + + /**Sets the display mode (Only Chart/Only Grid/Both) in OlapClient. + * @Default {ej.olap.OlapClient.DisplayMode.ChartAndGrid} + */ + mode?: ej.olap.OlapClient.DisplayMode|string; +} + +export interface ServiceMethodSettings { + + /**Allows the user to set the custom name for the service method that’s responsible for updating the entire report and widget, while changing the Cube. + * @Default {CubeChanged} + */ + cubeChanged?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for exporting. + * @Default {Export} + */ + exportOlapClient?: string; + + /**Allows the user to set the custom name for the service method that’s responsible to get the members, for the tree-view inside member-editor dialog. + * @Default {FetchMemberTreeNodes} + */ + fetchMemberTreeNodes?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for fetching the report names from the database. + * @Default {FetchReportListFromDB} + */ + fetchReportList?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for updating report while filtering members. + * @Default {FilterElement} + */ + filterElement?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for initializing OlapClient. + * @Default {InitializeClient} + */ + initialize?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for loading the report collection from the database. + * @Default {LoadReportFromDB} + */ + loadReport?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for retrieving the MDX query for the current report. + * @Default {GetMDXQuery} + */ + mdxQuery?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for updating the tree-view inside Cube Browser, while changing the measure group. + * @Default {MeasureGroupChanged} + */ + measureGroupChanged?: string; + + /**Allows the user to set the custom name for the service method that’s responsible to get the child members, on tree-view node expansion. + * @Default {MemberExpanded} + */ + memberExpand?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for updating report while dropping a node/SplitButton inside Axis Element Builder. + * @Default {NodeDropped} + */ + nodeDropped?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for updating report while removing SplitButton from Axis Element Builder. + * @Default {RemoveSplitButton} + */ + removeSplitButton?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for saving the report collection to database. + * @Default {SaveReportToDB} + */ + saveReport?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for toggling the elements in row and column axes. + * @Default {ToggleAxis} + */ + toggleAxis?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for any toolbar operation. + * @Default {ToolbarOperations} + */ + toolbarServices?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for updating report collection. + * @Default {UpdateReport} + */ + updateReport?: string; +} +} +module OlapChart +{ +enum ChartTypes +{ +//To render a Line type for OlapChart. +Line, +//To render a Spline type for OlapChart. +Spline, +//To render a Column type for OlapChart. +Column, +//To render a Area type for OlapChart. +Area, +//To render a SplineArea type for OlapChart. +SplineArea, +//To render a StepLine type for OlapChart. +StepLine, +//To render a StepArea type for OlapChart. +StepArea, +//To render a Pie type for OlapChart. +Pie, +//To render a Bar type for OlapChart. +Bar, +//To render a StackingArea type for OlapChart. +StackingArea, +//To render a StackingColumn type for OlapChart. +StackingColumn, +//To render a StackingBar type for OlapChart. +StackingBar, +//To render a Pyramid type for OlapChart. +Pyramid, +//To render a Funnel type for OlapChart. +Funnel, +//To render a Doughnut type for OlapChart. +Doughnut, +//To render a Scatter type for OlapChart. +Scatter, +//To render a Bubble type for OlapChart. +Bubble, +} +} +module OlapClient +{ +enum ControlPlacement +{ +//To display OlapChart and PivotGrid widgets in tab view. +Tab, +//To display OlapChart and PivotGrid widgets within the same view, one below the other. +Tile, +} +} +module OlapClient +{ +enum DefaultView +{ +//To set OlapChart as a default control in view when the OlapClient widget is loaded for the first time. +Chart, +//To set PivotGrid as a default control in view when the OlapClient widget is loaded for the first time. +Grid, +} +} +module OlapClient +{ +enum DisplayMode +{ +//To display only OlapChart widget. +ChartOnly, +//To display only PivotGrid widget. +GridOnly, +//To display both OlapChart and PivotGrid widgets. +ChartAndGrid, +} +} + +class OlapGauge extends ej.Widget { + static fn: OlapGauge; + constructor(element: JQuery, options?: OlapGauge.Model); + constructor(element: Element, options?: OlapGauge.Model); + model:OlapGauge.Model; + defaults:OlapGauge.Model; + + /** Perform an asynchronous HTTP (AJAX) request. + * @returns {void} + */ + doAjaxPost(): void; + + /** This function is used to refresh the OlapGauge at client-side itself. + * @returns {void} + */ + refresh(): void; + + /** This function removes the KPI related images from OlapGauge. + * @returns {void} + */ + removeImg(): void; + + /** This function receives the JSON formatted datasource to render the OlapGauge control. + * @returns {void} + */ + renderControlFromJSON(): void; +} +export module OlapGauge{ + +export interface Model { + + /**Sets the number of column count to arrange the OlapGauge's. + * @Default {0} + */ + columnsCount?: number; + + /**Specify the CSS class to OlapGauge to achieve custom theme. + * @Default {“”} + */ + cssClass?: string; + + /**Object utilized to pass additional information between client-end and service-end. + * @Default {{}} + */ + customObject?: any; + + /**Enables/disables tooltip visibility in OlapGauge. + * @Default {false} + */ + enableTooltip?: boolean; + + /**Allows the user to enable OlapGauge’s responsiveness in the browser layout. + * @Default {false} + */ + isResponsive?: boolean; + + /**Allows the user to change the format of the label values in OlapGauge. + * @Default {ej.olap.OlapGauge.NumberFormat.Default} + */ + labelFormatSettings?: ej.olap.OlapGauge.NumberFormat|string; + + /**Allows the user to set the localized language for the widget. + * @Default {en-US} + */ + locale?: string; + + /**Sets the number of row count to arrange the OlapGauge's. + * @Default {0} + */ + rowsCount?: number; + + /**Sets the scale values such as pointers, indicators, etc... for OlapGauge. + * @Default {{}} + */ + scales?: any; + + /**Allows the user to set the custom name for the methods at service-end, communicated during AJAX post. + * @Default {{}} + */ + serviceMethodSettings?: ServiceMethodSettings; + + /**Enables/disables the header labels in OlapGauge. + * @Default {true} + */ + showHeaderLabel?: boolean; + + /**Connects the service using the specified URL for any server updates. + * @Default {“”} + */ + url?: string; + + /**Triggers when it reaches client-side after any AJAX request.*/ + afterServiceInvoke? (e: AfterServiceInvokeEventArgs): void; + + /**Triggers before any AJAX request is passed from OlapGauge to service methods.*/ + beforeServiceInvoke? (e: BeforeServiceInvokeEventArgs): void; + + /**Triggers when OlapGauge started loading at client-side.*/ + load? (e: LoadEventArgs): void; + + /**Triggers when OlapGauge widget completes all operations at client-side after any AJAX request.*/ + renderComplete? (e: RenderCompleteEventArgs): void; + + /**Triggers when any error occurred during AJAX request.*/ + renderFailure? (e: RenderFailureEventArgs): void; + + /**Triggers when OlapGauge successfully reaches client-side after any AJAX request.*/ + renderSuccess? (e: RenderSuccessEventArgs): void; +} + +export interface AfterServiceInvokeEventArgs { + + /**return the current action of OlapGauge control. + */ + action?: string; + + /**return the custom object bounds with OlapGauge control. + */ + customObject?: any; + + /**return the outer HTML of OlapGauge control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapGauge model. + */ + model?: ej.olap.OlapGauge.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface BeforeServiceInvokeEventArgs { + + /**return the current action of OlapGauge control. + */ + action?: string; + + /**return the custom object bounds with OlapGauge control. + */ + customObject?: any; + + /**return the outer HTML of OlapGauge control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapGauge model. + */ + model?: ej.olap.OlapGauge.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface LoadEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapGauge model. + */ + model?: ej.olap.OlapGauge.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RenderCompleteEventArgs { + + /**returns the outer HTML of OlapGauge control. + */ + element?: string; + + /**returns the custom object bounded with the control. + */ + customObject?: any; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapGauge model. + */ + model?: ej.olap.OlapGauge.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RenderFailureEventArgs { + + /**returns the outer HTML of OlapGauge control. + */ + element?: string; + + /**returns the custom object bounded with the control. + */ + customObject?: any; + + /**returns the error message with error code. + */ + message?: any; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapGauge model. + */ + model?: ej.olap.OlapGauge.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns the JSON formatted response while error occurs. + */ + responseJSON?: any; +} + +export interface RenderSuccessEventArgs { + + /**returns the outer HTML of OlapGauge control. + */ + element?: string; + + /**returns the custom object bounded with the control. + */ + customObject?: any; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapGauge model. + */ + model?: ej.olap.OlapGauge.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface LabelFormatSettings { + + /**Allows the user to change the number format of the label values in OlapGauge. + * @Default {ej.olap.OlapGauge.NumberFormat.Default} + */ + numberFormat?: ej.olap.OlapGauge.NumberFormat|string; + + /**Allows you to change the position of a digit on the right-hand side of the decimal point for label value. + * @Default {5} + */ + decimalPlaces?: number; + + /**Allows you to add a text at the beginning of the label. + */ + prefixText?: string; + + /**Allows you to add text at the end of the label. + */ + suffixText?: string; +} + +export interface ServiceMethodSettings { + + /**Allows the user to set the custom name for the service method that’s responsible for initializing OlapGauge. + * @Default {InitializeGauge} + */ + initialize?: string; +} +} +module OlapGauge +{ +enum NumberFormat +{ +//To set default format for label values. +Default, +//To set currency format for label values. +Currency, +//To set percentage format for label values. +Percentage, +//To set fraction format for label values. +Fraction, +//To set scientific format for label values. +Scientific, +//To set text format for label values. +Text, +//To set notation format for label values. +Notation, +} +} + +} +declare module App { + +var addMetaTags: boolean; + var allowPopState: boolean; + var allowPushState: boolean; + var activePage: JQuery; + var waitingPopUp: JQuery; + var hashMonitoring: boolean; + var pageTransition: string; + var renderEJMControlByDef: boolean; + function createPage(element: JQuery): void; + function getLoaction(): string; + function initPage(): void; + function loadView(url: string): void; + function transferPage(fromPage: Object, toPage: Object, options?: any, isFromAjax?: boolean): void; + function userAgent(): void; + + var pageHistory: { + activeHistory(): string; + add(url: string, options?: PageOption): void; + clearForward(): void; + find(url: string): number; + lastHistory(): string; + nextHistory(): string; + prevHistory(): string; + makeUrlAbsolute(hashString: string): void; + } + //Pageoption type for appview page + interface PageOption { + title?: string; + href?: string; + hash?: string; + } + var route: { + convertToRelativeUrl(): void; + hasProtocol(url: string): boolean; + setPageRenderMode(element: JQuery): void; + splitUrl(url: string): any; + } +} +declare module ej.mobile { + + //Global Interface + interface windowsOption { + renderDefault?: boolean; + } + enum RenderMode{ + Auto, + IOS7, + Android, + Windows, + Flat + } + enum Theme{ + Auto, + Dark, + Light + } +class Accordion extends ej.Widget { + static fn: Accordion; + constructor(element: JQuery, options?: AccordionOptions); + model: AccordionOptions; + validTags: Array; + defaults: AccordionOptions; + collapseAll(): void; + disableItems(itemIndexes: Array): void; + enableItems(itemIndexes: Array): void; + selectItems(activeList: Array): void; + deselectItems(activeList: Array): void; + expandAll(): void; + hide(): void; + show(): void; + destroy(): void; + getItemsCount(): number; +} +//ejmAccordion Option +interface AccordionOptions { + theme?: ej.mobile.Theme; + renderMode?: ej.mobile.RenderMode; + cssClass?: string; + enableCache?: boolean; + allowMultipleOpen?: boolean; + collapsible?: boolean; + enabled?: boolean; + enableMultipleOpen?: boolean; + heightAdjustMode?: ej.mobile.Accordion.HeightAdjustMode; + windows?: windowsOption; + enablePersistence?: boolean; + selectedItems?: Array; + disabledItems?: Array; + showHeaderIcon?: boolean; + spinnerText?: string; + items?: Array; + active? (e: AccordionActiveEventArgs): void; + ajaxBeforeLoad? (e: AccordionAjaxBeforeLoadEventArgs): void; + ajaxError? (e: AccordionAjaxErrorEventArgs): void; + ajaxLoad? (e: AccordionAjaxLoadEventArgs): void; + ajaxSuccess? (e: AccordionAjaxSuccessEventArgs): void; + beforeActive? (e: AccordionBeforeActiveEventArgs): void; + destroy? (e: AccordionEventArgs): void; + create? (e: AccordionEventArgs): void; +} + +interface itemCollection { + ajaxUrl?: string; + logoClass?: string; +} +//ejmejmAccordionEvent Arugument +interface AccordionEventArgs { + cancel: boolean; + type: string; + model: AccordionOptions; +} +interface AccordionActiveEventArgs extends AccordionEventArgs { + items: string; + lastSelectedItemIndices: number; + selectedItemIndices: number; +} +interface AccordionAjaxBeforeLoadEventArgs extends AccordionEventArgs { + url: string; +} +interface AccordionAjaxErrorEventArgs extends AccordionEventArgs { + title: string; + data: Object; + url: string; +} +interface AccordionAjaxLoadEventArgs extends AccordionEventArgs { +} +interface AccordionAjaxSuccessEventArgs extends AccordionEventArgs { + content: Object; + data: Object; + url: string; +} +interface AccordionBeforeActiveEventArgs extends AccordionEventArgs { + activeItemIndex?: number; +} +export module Accordion { + enum HeightAdjustMode { + Content, + Auto, + Fill + } +} +class Autocomplete extends ej.Widget { + static fn: Autocomplete; + element: JQuery; + constructor(element: JQuery, options?: AutocompleteOptions); + model: AutocompleteOptions; + defaults: AutocompleteOptions; + disable(): void; + enable(): void; + destroy(): void; + clearText(): void; + getSelectedItems(): Array; + getValue(): string; + +} +interface AutocompleteOptions { + allowScrolling?: boolean; + filterType?: ej.mobile.Autocomplete.FilterType; + caseSensitiveSearch?: boolean; + cssClass?: string; + enableAutoFill?: boolean; + delimiterChar?: string; + enableMultiSelect?: boolean; + enableCheckbox?: boolean; + dataSource?: any; + filterMode?: string; + itemsCount?: string|number; + templateId?: string; + fields?: fieldOptions; + imageField?: string; + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + mapper?: string; + watermarkText?: string; + imageClass?: string; + allowSorting?: boolean; + value?: string; + sortOrder?: ej.mobile.Autocomplete.SortOrder; + emptyResultText?: string; + showEmptyResultText?: boolean; + minCharacter?: number; + enableDistinct?: boolean; + enablePersistence?: boolean; + enabled?: boolean; + mode?: ej.mobile.Autocomplete.Mode; + selectedKeys?: string; + windows?: windowsOption; + touchEnd? (e: AutocompleteTouchEndEventArgs): void; + keyPress? (e: AutocompleteKeyPressEventArgs): void; + select? (e: AutocompleteSelectEventArgs): void; + change? (e: AutocompleteChangeEventArgs): void; + focusIn? (e: AutocompleteFocusInEventArgs): void; + focusOut? (e: AutocompleteFocusOutEventArgs): void; + destroy? (e: AutocompleteEventArgs): void; + create? (e: AutocompleteEventArgs): void; +} +interface fieldOptions { + text?: string; + key?: string; +} +interface AutocompleteEventArgs { + cancel: boolean; + model: AutocompleteOptions; + type: string; +} +interface AutocompleteTouchEndEventArgs extends AutocompleteEventArgs { + text: string; + isChecked: boolean; + checkedItemsText: Object; + value: string; +} +interface AutocompleteKeyPressEventArgs extends AutocompleteEventArgs { + value: string; +} +interface AutocompleteSelectEventArgs extends AutocompleteEventArgs { + text: string; + isChecked: boolean; + checkedItemsText: Object; + value: string; +} +interface AutocompleteChangeEventArgs extends AutocompleteEventArgs { + text: string; + isChecked: boolean; + checkedItemsText: Object; + value: string; +} +interface AutocompleteFocusInEventArgs extends AutocompleteEventArgs { + value: string; +} +interface AutocompleteFocusOutEventArgs extends AutocompleteEventArgs { + value: string; +} +export module Autocomplete { + enum FilterType { + StartsWith, + Contains + } + enum Mode { + Search, + Default + } + enum SortOrder { + Ascending, + Descending + } +} +class Button extends ej.Widget { + static fn: Button; + element: JQuery; + constructor(element: JQuery, options?: ButtonOptions); + model: ButtonOptions; + validTags: Array; + defaults: ButtonOptions; + disable(): void; + enable(): void; +} +class Actionlink extends ej.Widget { + static fn: Actionlink; + element: JQuery; + constructor(element: Element, options?: ButtonOptions); + model: Object; + validTags: Array; + defaults: ButtonOptions; + disable(): void; + enable(): void; +} +interface ButtonOptions { + touchStart?(e: ButtonEventArgs): void; + touchEnd?(e: ButtonEventArgs): void; + cssClass?: string; + enabled?: (boolean | string); + inline?: (boolean | string); + renderMode?: (ej.mobile.RenderMode | string); + text?: string; + theme?: (ej.mobile.Theme | string); + imageClass?: string; + imagePosition?: (ej.mobile.Button.ImagePosition | string); + contentType?: (ej.mobile.Button.ContentType | string); + ios7?: ios7ButtonOptions; + android?: androidButtonOption; + windows?: windowsButtonOptions; + flat?: flatButtonOption; +} +interface ButtonEventArgs { + element: Object; + text: string; +} +interface ios7ButtonOptions { + style?: (ej.mobile.Button.IOS7.Style | string); + color?: (ej.mobile.Button.IOS7.Color | string); +} +interface androidButtonOption { + style?: (ej.mobile.Button.Android.Style | string); +} +interface windowsButtonOptions extends windowsOption { + style?: (ej.mobile.Button.Windows.Style | string); +} +interface flatButtonOption { + style?: (ej.mobile.Button.Flat.Style | string); +} +export module Button{ +export module IOS7{ + enum Style{ + Normal, + Back, + Header, + Dialog + } + enum Color{ + Gray, + Black, + Blue, + Green, + Red + } + } +export module Android{ + enum Style{ + Normal, + Small, + Dialog + } + +} +export module Windows{ + enum Style{ + Normal, + Back + } +} +export module Flat{ + enum Style{ + Normal, + Back, + Header + } +} + enum ImagePosition{ + Left, + Right + } + enum ContentType{ + Text, + Image, + Both + } +} +class DatePicker extends ej.Widget { + static fn: DatePicker; + static Locale:any; + element: JQuery; + constructor(element: JQuery, options?: DatePickerOptions); + model: DatePickerOptions; + defaults: DatePickerOptions; + disable(): void; + enable(): void; + hide(): void; + show(): void; + setCurrentDate(date:string): void; + getValue(): string; + destroy(): void; +} + +//ejmDatePicker Options +interface DatePickerOptions { + cssClass?: string; + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + culture?: string; + dateFormat?: string; + value?: string; + enabled?: boolean; + enablePersistence?: boolean; + ios7?: ios7Option; + windows?: windowsOption; + maxDate?: string; + minDate?: string; + load? (e: DatePickerEventArgs): void; + select? (e: DatePickerEventArgs): void; + focusIn? (e: DatePickerEventArgs): void; + focusOut? (e: DatePickerEventArgs): void; + open? (e: DatePickerEventArgs): void; + close? (e: DatePickerEventArgs): void; + change? (e: DatePickerEventArgs): void; + destroy? (e: DatePickerArgs): void; + create? (e: DatePickerArgs): void; +} + +interface DatePickerArgs { + type: string; + model: DatePickerOptions; + value: string; +} +//ejmDatePickerEvent Arugument +interface DatePickerEventArgs extends DatePickerArgs { + cancel: boolean; + +} + +interface ios7Option { + renderDefault: boolean; +} + + +//Class ejmDropDownList +class DropDownList extends ej.Widget { + static fn: DropDownList; + constructor(element: JQuery, options?: DropDownListOptions); + model: DropDownListOptions; + defaults: DropDownListOptions; + show(): void; + hide(): void; + getValue():string; + selectItemByIndex(index:(number|string)): void; + unselectItemByIndex(index:(number|string)): void; + selectItemByIndices(indices:Array): void; + unselectItemByIndices(indices: Array): void; + destroy(): void; + getSelectedItemsValue(): Array; + getSelectedItemValue(): string; +} + +//ejmDropDownList WindowsOption +interface windowsDropDownListOption extends windowsOption { + type?: ej.mobile.DropDownList.WindowsType; +} + +interface androidDropDownListOption { + popUpHeight?: number|string; +} + +interface fieldsDropDownListOption { + text?: string; + groupBy?: string; + imageClass?: string; + imageUrl?: string; + checkBy?: string; + enableTemplate?: string; + templateID?: string; + value?: string; +} + +//ejmDropDownList Option +interface DropDownListOptions { + theme?: ej.mobile.Theme; + renderMode?: ej.mobile.RenderMode; + cssClass?: string; + readOnly?: boolean; + targetID?: string; + selectedItemIndex?: number|string; + dataSource?: any; + fields?: fieldsDropDownListOption; + query?: string; + allowVirtualScrolling?: boolean; + virtualScrollMode?: ej.mobile.DropDownList.VirtualScrollingMode; + itemRequestCount?: number|string; + enabled?: boolean; + enableMultiSelect?: boolean; + delimiterChar?: string; + enableGrouping?: boolean; + mode?: ej.mobile.DropDownList.Mode; + enableTemplate?: boolean; + enablePersistence?: boolean; + windows?: windowsDropDownListOption; + android?: androidDropDownListOption; + items?: Array; + focusIn? (e: DropDownArgs): void; + focusOut? (e: DropDownArgs): void; + select? (e: DropDownSelectArgs): void; + change? (e: DropDownSelectArgs): void; + checkChange? (e: DropDownListEventArgs): void; +} + +interface DropDownArgs { + cancel: boolean; + type: string; + model: DropDownListOptions; +} +//ejmDropDownListEvent Arugument +interface DropDownListEventArgs extends DropDownArgs { + checked: boolean; +} + +interface DropDownSelectArgs extends DropDownArgs { + selectedText: string; + value: string; + selectedItem: Object; +} + +export module DropDownList{ + enum VirtualScrollingMode{ + Continuous, + Normal + } + enum WindowsType{ + ComboBox, + List + } + enum Mode { + Normal, + Native + } +} + +class Numeric extends ej.Widget { + static fn: Numeric; + element: JQuery; + constructor(element: JQuery, options?: EditorOptions); + model: EditorOptions; + ValidTags: Array; + defaults: EditorOptions; + disable(): void; + enable(): void; + getValue(): any; + setValue(value:number): void; + +} + +interface EditorOptions { + cssClass?: string; + enableStrictMode?: boolean; + enabled?: boolean; + showBorder?: boolean; + showSpinButton?: boolean; + incrementStep?: number; + maxValue?: number; + minValue?: number; + name?: string; + enablePersistence?: boolean; + readOnly?: boolean; + renderMode?: ej.mobile.RenderMode; + decimalPlaces?: number; + theme?: ej.mobile.Theme; + value?: number; + watermarkText?: string; + windows?: windowsOption; + change? (e: EditorEventArgs): void; + focusIn? (e: EditorEventArgs): void; + focusOut? (e: EditorEventArgs): void; + destroy?(e:EditorBaseArgs):void; + create?(e:EditorBaseArgs):void; +} + +interface EditorBaseArgs{ + cancel: boolean; + type: string; + model: EditorOptions; +} + +interface EditorEventArgs extends EditorBaseArgs { + value: number; + element: Object; +} + + +class Grid extends ej.Widget { + static fn: Grid; + element: JQuery; + constructor(element: JQuery, options?: GridOptions); + model: GridOptions; + validTags: Array; + defaults: GridOptions; + disable(): void; + enable(): void; + destroy(): void; + getColumnByField(field:string): void; + getColumnByHeaderText(headerText:string): void; + getColumnByIndex(index:number): void; + getColumnFieldNames(): void; + getColumnIndexByField(field:string): void; + getColumnMemberByIndex(colIdx:number): void; + hideColumns(col:string): void; + refreshContent(requestType:string): void; + showColumns(col:string): void; +} +interface GridOptions { + cssClass?: string; + allowPaging?: boolean; + allowSorting?: boolean; + allowFiltering?: boolean; + allowScrolling?: boolean; + allowSelection?: boolean; + dataSource: any; + caption?: string; + enablePersistence?: boolean; + selectedRowIndex?: number; + showCaption?: boolean; + allowColumnSelector?: boolean; + transition?: string; + columns?: Array; + theme?: ej.mobile.Theme; + renderMode?: ej.mobile.RenderMode; + rowSelecting? (e: GridEventArgs): void; + rowSelected? (e: GridEventArgs): void; + actionBegin? (e: GridEventArgs): void; + actionComplete? (e: GridEventArgs): void; + actionSuccess? (e: GridEventArgs): void; + actionFailure? (e: GridEventArgs): void; + queryCellInfo? (e: GridEventArgs): void; + rowDataBound? (e: GridEventArgs): void; + modelChange? (e: GridEventArgs): void; + load? (e: GridEventArgs): void; + pageSettings?: PageSettings; + scrollSettings?: ScrollSettings; + sortSettings?: SortSettings; + filterSettings?: FilterSettings; +} + +interface PageSettings { + pageSize?: number; + currentPage?: number; + display?: ej.mobile.Grid.PagerDisplay; + type?: ej.mobile.Grid.PagerType; + totalRecordsCount?: number; +} +interface ScrollSettings { + enableColumnScrolling?: boolean; + height?: any; + width?: any; + enableRowScrolling?: boolean; + enableNativeScrolling?: boolean; +} +interface SortSettings { + allowMultiSorting?: boolean; + sortedColumns?: Array; +} +interface FilterSettings { + isCaseSensitive?: boolean; + filterBarMode?: ej.mobile.Grid.FilterBarMode; + interval?: number; + filteredColumns?: Array; +} + +//ejmGridEvent Arugument +interface GridEventArgs { + cancel: boolean; + type: string; + model: GridOptions; +} + +export module Grid +{ +enum PagerDisplay +{ +Normal, +Fixed +} + +enum PagerType +{ +Normal, +Scrollable +} + +enum FilterBarMode +{ +Immediate, +OnEnter +} +enum Actions +{ +Paging, +Sorting, +Filtering, +Refresh +} +} +class Header extends ej.Widget { + static fn: Header; + element: JQuery; + constructor(element: JQuery, options?: HeaderOptions); + model: HeaderOptions; + defaults: HeaderOptions; + getTitle(): string; + destroy(): void; +} + +interface HeaderOptions { + hideForUnSupportedDevice?: boolean; + leftButtonNavigationUrl?: string; + leftButtonImageClass: string; + leftButtonImageUrl: string; + rightButtonNavigationUrl?: string; + rightButtonImageClass?:string; + rightButtonImageUrl?:string; + cssClass?: string; + title?: string; + showTitle?: boolean; + position?: ej.mobile.Header.Position; + leftButtonCaption?: string; + rightButtonCaption?: string; + leftButtonStyle?:ej.mobile.Header.HeaderLeftButtonStyle; + rightButtonStyle?:ej.mobile.Header.HeaderRightButtonStyle; + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + showLeftButton?: boolean; + showRightButton?: boolean; + enablePersistence?:boolean; + templateId?: string; + ios7?: Headerios7Options; + flat?: HeaderFlatOptions; + windows?: HeaderWindowsOptions; + android?: HeaderAndroidOptions; + leftButtonTap? (e: HeaderLeftButtonTapEventArgs): void; + rightButtonTap? (e: HeaderRightButtonTapEventArgs): void; + destroy?(e:HeaderBaseArgs):void; + create?(e:HeaderBaseArgs):void; +} +interface HeaderWindowsOptions extends windowsOption { + enableCustomText?: boolean; + renderDefault?: boolean; + rightButtonStyle?: ej.mobile.Header.Windows.HeaderRightButtonStyle; + leftButtonStyle?: ej.mobile.Header.Windows.HeaderLeftButtonStyle; + showLeftButton?: boolean; + showRightButton?: boolean; +} +interface HeaderAndroidOptions { + backButtonImageClass?: string; + rightButtonStyle?: ej.mobile.Header.Android.HeaderRightButtonStyle; + leftButtonStyle?: ej.mobile.Header.Android.HeaderLeftButtonStyle; + showLeftButton?: boolean; + showRightButton?: boolean; +} +interface Headerios7Options { + rightButtonStyle?: ej.mobile.Header.IOS7.HeaderRightButtonStyle; + leftButtonStyle?: ej.mobile.Header.IOS7.HeaderLeftButtonStyle; + showLeftButton?: boolean; + showRightButton?: boolean; +} +interface HeaderFlatOptions { + rightButtonStyle?: ej.mobile.Header.Flat.HeaderRightButtonStyle; + leftButtonStyle?: ej.mobile.Header.Flat.HeaderLeftButtonStyle; + showLeftButton?: boolean; + showRightButton?: boolean; +} + +interface HeaderBaseArgs{ + cancel: boolean; + type: string; + model: FooterOptions; +} +interface HeaderLeftButtonTapEventArgs { + text: string; + cancel: boolean; + model: Object; + type: string; + status: boolean; +} +interface HeaderRightButtonTapEventArgs { + text: string; + cancel: boolean; + model: Object; + type: string; + status: boolean; +} + +export module Header +{ +enum Position +{ + Normal, + Fixed +} +enum HeaderLeftButtonStyle +{ + Back, + Header, + Normal + +} +enum HeaderRightButtonStyle +{ + Header, + Normal +} + +export module IOS7 +{ +enum HeaderLeftButtonStyle +{ + Auto, + Back, + Header, + Normal +} +enum HeaderRightButtonStyle +{ + Auto, + Header, + Normal +} +} + +export module Flat +{ +enum HeaderLeftButtonStyle +{ + Auto, + Back, + Normal, + Header +} +enum HeaderRightButtonStyle +{ + Auto, + Header, + Normal +} +} + +export module Android +{ +enum HeaderLeftButtonStyle +{ + Auto, + Back, + Normal, + Header +} +enum HeaderRightButtonStyle +{ + Auto, + Normal, + Header +} +} + +export module Windows +{ +enum HeaderLeftButtonStyle +{ + Auto, + Back, + Normal, + Header +} +enum HeaderRightButtonStyle +{ + Auto, + Normal, + Header +} +} +} + + + +/* ListView - Start*/ +interface ajaxSettingsOptions { + type?: string; + cache?: boolean; + async?: boolean; + dataType?: string; + contentType?: string; + url?: string; + data?: Array; +} +//Class ejmListView +class ListView extends ej.Widget { + static fn: ListView; + constructor(element: JQuery, options?: ListViewOptions); + model: ListViewOptions; + defaults: ListViewOptions; + addItem(list?:Object, index?:number,groupid?:any): void; + checkAllItem(): void; + checkItem(index:number,childId?:any): void; + deActive(index:number,childId?:any): void; + disableItem(index:number,childId?:any): void; + enableItem(index:number,childId?:any): void; + getActiveItem(): void; + getActiveItemText(): void; + getCheckedItems(): void; + getCheckedItemsText(): void; + getItemsCount(): void; + getItemText(index:number,childId?:any): void; + hasChild(index:number,childId?:any): boolean; + hide(): void; + hideItem(index:number,childId?:any): void; + isChecked(index:number,childId?:any): boolean; + loadAjaxContent(): void; + removeCheckMark(index:number,childId?:any): void; + removeItem(index:number,childId?:any): void; + selectItem(index:number,childId?:any): void; + setActive(index:number,childId?:any): void; + show(): void; + showItem(index:number,childId?:any): void; + unCheckAllItem(): void; + unCheckItem(index: number, childId?: any): void; + clear(): void; + append(data: Object): void; + getActiveItemData(): void; + getSelectedItemValue(): void; + getSelectedItemsValue(): void; + destroy(): void; +} +//ejmListView IOS7Option +interface Ios7Option { + inline?: boolean; +} +//ejmListView IOS7Option +interface windowsListViewOption extends windowsOption { + preventSkew?: boolean; + enableHeaderCustomText?: boolean; +} + +//ejmListView Option +interface ListViewOptions { + theme?: ej.mobile.Theme; + renderMode?: ej.mobile.RenderMode; + enablePullToRefresh?: boolean; + refreshThreshold?: number; + pullToRefreshSettings?: pullToRefreshSettings; + mode?: ej.mobile.ListView.Mode + cssClass?: string; + ios7?: Ios7Option; + windows?: windowsListViewOption; + adjustFixedPosition?: boolean; + ajaxSettings?: ajaxSettingsOptions; + enableCache?: boolean; + allowScrolling?: boolean; + checkDOMChanges?: boolean; + dataBinding?: boolean; + dataSource?: any; + enableAjax?: boolean; + enableCheckMark?: boolean; + enableFiltering?: boolean; + showHeader?: boolean; + showHeaderBackButton?: boolean; + enableNativeScrolling?: boolean; + showScrollbars?: boolean; + fieldSettings?: fieldSettings; + enableGroupList?: boolean; + headerBackButtonText?: string; + hideHeaderForUnSupportedDevice?: boolean; + headerTitle?: string; + height?: number; + persistSelection?: boolean; + preventSelection?: boolean; + query?: string; + renderTemplate?: boolean; + selectedItemIndex?: number; + autoAdjustHeight?: boolean; + autoAdjustScrollHeight?: boolean; + templateId?: string; + transition?: string; + width?: number; + items?: Array; + enablePersistence?: boolean; + create? (e: ListViewBaseEventArgs): void; + destroy? (e: ListViewBaseEventArgs): void; + ajaxComplete? (e: ListViewEventArgs): void; + ajaxError? (e: ListViewEventArgs): void; + ajaxSuccess? (e: ListViewEventArgs): void; + headerBackButtonTap? (e: ListViewEventArgs): void; + load? (e: ListViewBaseEventArgs): void; + loadComplete? (e: ListViewBaseEventArgs): void; + touchEnd? (e: ListViewEventArgs): void; + touchStart? (e: ListViewEventArgs): void; + refreshBegin? (e: ListViewBaseEventArgs): void; + refreshSuccess? (e: ListViewEventArgs): void; + refreshError? (e: ListViewBaseEventArgs): void; + refreshComplete? (e: ListViewBaseEventArgs): void; + ajaxBeforeLoad? (e: ListViewEventArgs): void; +} +interface pullToRefreshSettings{ + pullText?:string; + releaseText?:string; + refreshText?:string; + errorText?:string; + appendData?:boolean; + appendPosition?:ej.mobile.ListView.AppendPosition; +} +interface fieldSettings{ + navigateUrl?:string; + href?:string; + enableAjax?:string; + preventSelection?:string; + persistSelection?:string; + text?:string; + enableCheckMark?:string; + checked?:string; + primaryKey?:string; + parentPrimaryKey?:string; + imageClass?:string; + imageUrl?:string; + childHeaderTitle?:string; + childId?:string; + childHeaderBackButtonText?:string; + renderTemplate?:string; + templateId?:string; + touchStart?:string; + touchEnd?:string; + attributes?:string; + groupID?:string; + id?:string; + value?: string; +} +//ejmListViewEvent Arugument +interface ListViewBaseEventArgs { + cancel: boolean; + type: string; + model: ListViewOptions; +} +interface ListViewEventArgs extends ListViewBaseEventArgs { + ajaxData?: Object; + data?: Object; + errorData?: Object; + successData?: Object; + text?: string; + element?: Object; + id?: string; + hasChild?: boolean; + currentItem?: string; + currentText?: string; + currentItemIndex?: number; + isChecked?: boolean; + checkedItems?: number; + checkedItemsText?: string; +} +export module ListView{ + enum AppendPosition{ + Bottom, + Top + } + enum Mode { + Page, + Container + } +} + +class Menu extends ej.Widget { + static fn: Menu; + element: JQuery; + constructor(element: JQuery, options?: MenuOptions); + model: MenuOptions; + defaults: MenuOptions; + addItem(menu: any, index: number): void; + disable(): void; + disableItem(index: number): void; + disableOverFlow(): void; + disableOverFlowItem(index: number): void; + enable(): void; + enableItem(index: number): void; + enableOverFlow(): void; + enableOverFlowItem(index: number): void; + hide(): void; + removeItem(index: number): void; + show(e: any, existing?: boolean): void; + destroy(): void; +} +//ejmMenu Option +interface MenuOptions { + theme?: ej.mobile.Theme; + renderMode?: ej.mobile.RenderMode; + cssClass?: string; + allowScrolling?: boolean; + showScrollbars?: boolean; + height?: (number|string); + renderTemplate?: boolean; + showOn?: ej.mobile.Menu.ShowOn; + targetId?: string; + target?: any; + enablePersistence?: boolean; + templateId?: string; + width?: (number|string); + items?: Array; + android?: AndroidOptions; + ios7?: Ios7Options; + windows?: WindowsOptions; + hide? (e: MenuEvent): void; + load? (e: MenuEvent): void; + loadComplete? (e: MenuEvent): void; + show? (e: MenuEvent): void; + touchStart? (e: MenuTouchEventArgs): void; + touchEnd? (e: MenuTouchEventArgs): void; + create? (e: MenuEvent): void; + destroy? (e: MenuEvent): void; +} +//ejmMenu IOS7 Option +interface Ios7Options { + cancelButtonColor?: ej.mobile.Menu.IOS7.CancelButtonColor; + cancelButtonText?: string; + cancelButtonTouchEnd? (e: MenuCancelButtonTouchEndEventArgs): void; + type?: ej.mobile.Menu.IOS7.Type; + title?: string; + showTitle?: boolean; + showCancelButton?: boolean; +} + +//ejmMenu Android Option +interface AndroidOptions { + type?: ej.mobile.Menu.Android.Type; +} +interface WindowsOptions { + type?: ej.mobile.Menu.Windows.Type; + renderDefault?: boolean; +} +//ejmMenu Event Arugument +interface MenuEvent { + cancel: boolean; + type: string; + model: MenuOptions; +} +interface MenuTouchEventArgs { + item: Object; + text: string; +} +interface MenuCancelButtonTouchEndEventArgs extends MenuEvent { + item: Object; + text: string; +} + +export module Menu { + export module IOS7 { + enum Type { + Auto, + Animate, + Normal + } + enum CancelButtonColor { + Blue, + Gray, + Black, + Green, + Red + } + } + + export module Android { + enum Type { + Contextual, + Popup, + OptionsList, + OptionsMenu + } + } + export module Windows { + enum Type { + Contextual, + Popup + } + } + enum ShowOn { + Tap, + TapHold + } +} + + + +//Class ejmProgress +class Progress extends ej.Widget { + static fn: Progress; + element: JQuery; + constructor(element: JQuery, options?: ProgressOptions); + model: ProgressOptions; + defaults: ProgressOptions; + getValue(): number; + getPercentage(): number; + setCustomText(text: string): void; + destroy(): void; +} + +//ejmProgressbar Option +interface ProgressOptions { + theme?: ej.mobile.Theme; + renderMode?: ej.mobile.RenderMode; + enableCustomText?: boolean; + enabled?: boolean; + height?: number; + incrementStep?: number; + maxValue?: number; + minValue?: number; + orientation?: ej.mobile.Progress.Orientation; + percentage?: number; + enablePersistence?: boolean; + text?: string; + value?: number; + width?: number; + create? (e: ProgressEvent): void; + destroy? (e: ProgressEvent): void; + start? (e: ProgressStartEventArgs): void; + change? (e: ProgressChangeEvent): void; + complete? (e: ProgressCompleteEvent): void; +} +//ejmProgressbarEvent Arugument +interface ProgressEvent { + cancel: boolean; + type: string; + model: ProgressOptions; +} +interface ProgressStartEventArgs extends ProgressEvent { + value: number; + percentage: number; +} +interface ProgressChangeEvent extends ProgressEvent { + value: number; + element: Object; + text: string; + percentage: number; +} +interface ProgressCompleteEvent extends ProgressEvent { + value: number; + text: string; + percentage: number; +} +export module Progress { + enum Orientation { + Horizontal, + Vertical + } +} + +//Class ejmRadioButton +class RadioButton extends ej.Widget { + static fn: RadioButton; + element: JQuery; + constructor(element: JQuery, options?: RadioButtonOptions); + model: RadioButtonOptions; + defaults: RadioButtonOptions; + destroy(): void; + enable(): void; + disable(): void; +} + +//ejmRadioButton Options +interface RadioButtonOptions { + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + cssClass?: string; + checked?: boolean; + text?: string; + enabled?: boolean; + enablePersistence?: boolean; + create? (e: RadioButtonBaseEventArgs): void; + destroy? (e: RadioButtonBaseEventArgs): void; + touchStart? (e: RadioButtonEventArgs): void; + touchEnd? (e: RadioButtonEventArgs): void; + change? (e: RadioButtonEventArgs): void; +} +//ejmRadioButtonEvent Arugument +interface RadioButtonBaseEventArgs { + model: RadioButtonOptions; + cancel: boolean; + type: string; +} +interface RadioButtonEventArgs extends RadioButtonBaseEventArgs { + value: string; + isChecked: boolean; +} + class Rating extends ej.Widget { + static fn: Rating; + element: JQuery; + constructor(element?: JQuery, options?: RatingOptions); + model: RatingOptions; + defaults: RatingOptions; + show(): void; + hide(): void; + getValue(): void + reset(): void; + enable(): void; + disable(): void; + setValue(value: number): void; + destroy(): void; + } + + interface RatingOptions { + maxValue?: number; + minValue?: number; + value?: number; + incrementStep?: number; + precision?: ej.mobile.Rating.Precision; + enabled?: boolean; + theme?: ej.mobile.Theme; + renderMode?: ej.mobile.RenderMode; + shape?: ej.mobile.Rating.Shape; + shapeWidth?: number; + shapeHeight?: number; + spaceBetweenShapes?: number; + orientation?: ej.mobile.Rating.Orientation; + readOnly?: boolean; + backgroundColor?: any; + selectionColor?: any; + borderColor?: any; + hoverColor?: any; + enablePersistence?: boolean; + create? (e: RatingBaseEventArgs): void; + destroy? (e: RatingBaseEventArgs): void; + tap? (e: RatingEventArgs): void; + change? (e: RatingEventArgs): void; + touchMove? (e: RatingEventArgs): void; + } + interface RatingBaseEventArgs { + cancel: boolean; + type: string; + model: RatingOptions; + } + interface RatingEventArgs extends RatingBaseEventArgs { + value: number; + } +export module Rating{ + enum Precision{ + Full, + Exact, + Half + } + enum Shape{ + Star, + Circle, + Diamond, + Heart, + Pentagon, + Square, + Triangle + } + enum Orientation{ + Horizontal, + Vertical + } + +} + class Rotator extends ej.Widget { + static fn: Rotator; + element: JQuery; + constructor(element: JQuery, options?: RotatorOptions); + model: RotatorOptions; + validTags: Array; + defaults: RotatorOptions; + renderDatasource(data: any): void; + destroy(): void; + } + interface RotatorOptions { + create? (e: RotatorBaseEventArgs): void; + destroy? (e: RotatorBaseEventArgs): void; + swipeLeft? (e: RotatorEventArgs): void; + swipeRight? (e: RotatorEventArgs): void; + swipeUp? (e: RotatorEventArgs): void; + swipeDown? (e: RotatorEventArgs): void; + change? (e: RotatorEventArgs): void; + pagerSelect? (e: RotatorEventArgs): void; + adjustFixedPosition?: boolean; + targetId?: string; + cssClass?:string; + windows?:windowsOption; + items?:Array; + renderMode?: ej.mobile.RenderMode; + targetHeight?: (number|string); + targetWidth?: (number|string); + enablePersistence?:boolean; + theme?: ej.mobile.Theme; + currentItemIndex?: number; + showPager?: boolean; + showHeader?: boolean; + headerTitle?: string; + dataBinding?: boolean; + dataSource?: any; + orientation?: ej.mobile.Rotator.Orientation; + pagerPosition?: PagerPosition; + } + interface PagerPosition { + horizontal?: ej.mobile.Rotator.PagerPositionHorizontal; + vertical?: ej.mobile.Rotator.PagerPositionVertical; + } + interface RotatorBaseEventArgs { + cancel: boolean; + model: RotatorOptions; + type: string; + } + interface RotatorEventArgs extends RotatorBaseEventArgs { + targetElement: Object; + element: number; + } +export module Rotator{ + enum Orientation{ + Horizontal, + Vertical + } + enum PagerPositionHorizontal{ + Bottom, + Top, + } + enum PagerPositionVertical{ + Right, + Left + } + +} + class Slider extends ej.Widget { + static fn: Slider; + element: JQuery; + constructor(element: JQuery, options?: SliderOptions); + model: SliderOptions; + defaults: SliderOptions; + getValue(): void; + dispose(): void; + destroy(): void; + } + //ejmSlider Option + interface SliderOptions { + theme?: ej.mobile.Theme; + renderMode?: ej.mobile.RenderMode; + minValue?: number; + maxValue?: number; + value?: number; + values?: Array; + orientation?: ej.mobile.Slider.Orientation; + enableRange?: boolean; + readOnly?: boolean; + incrementStep?: number; + enablePersistence?: boolean; + enabled?: boolean; + enableAnimation?: boolean; + animationSpeed?: number; + ios7?: Ios7Option; + windows?: windowsOption; + create? (e: SliderBaseEventArgs): void; + destroy? (e: SliderBaseEventArgs): void; + touchStart? (e: SliderEventArgs): void; + touchEnd? (e: SliderEventArgs): void; + load? (e: SliderEventArgs): void; + change? (e: SliderEventArgs): void; + slide? (e: SliderEventArgs): void; + } + + //ejmSlider IOS7 Option + interface Ios7Option { + thumbStyle?: ej.mobile.Slider.ThumbStyle; + } + //ejmSlider Slide Event Arugument + interface SliderBaseEventArgs { + cancel: boolean; + model: SliderOptions; + type: string; + } + interface SliderEventArgs extends SliderBaseEventArgs { + value?: number; + values?: Array; + } +export module Slider{ + enum Orientation{ + Horizontal, + Vertical + } + enum ThumbStyle{ + Normal, + Small + + } + +} +class Tab extends ej.Widget { + static fn: Tab; + constructor(element: JQuery, options?: TabOptions); + model:TabOptions; + defaults: TabOptions; + showBadge(index: (number|string)): void; + hideBadge(index: (number|string)): void; + updateBadgeValue(index: (number|string), value: (number|string)): void; + selectItem(index?: (number|string)): void; + enableItem(index?: (number|string)): void; + disableItem(index?: (number|string)): void; + enableContent(index?: (number|string)): void; + disableContent(index?: (number|string)): void; + addItem(tab: Object, index: (number|string)): void; + addOverflowItem(tab: Object, index: (number|string)): void; + removeItem(index: (number|string)): void; + removeOverflowItem(index: (number|string)): void; + getItemsCount(): number; + getOverflowItemCount(): number; + getActiveItemText(): string; + getActiveItem(): Object; + destroy(): void; +} + +interface TabOptions { + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + cssClass?: string; + allowScrolling?: boolean; + enableNativeScrolling?: boolean; + showScrollbars?: boolean; + enableAjax?: boolean; + showAjaxPopup?: boolean; + badge?: badgeTabOptions; + ios7?: ios7TabOptions; + enableCache?: boolean; + selectedItemIndex?: (number|string); + enabled?: boolean; + enablePersistence?: boolean; + prefetchAjaxContent?: boolean; + items?: Array; + overflowBadge?: overflowBadgeTabOptions; + android?: androidTabOptions; + windows?: windowsTabOptions; + flat?: flatTabOptions; + ajaxSettings?: ajaxSettingsTabOptions; + prefetchContentLoaded? (e: TabPrefetchEventArgs): void; + load? (e: TabEventArgs): void; + loadComplete? (e: TabLoadCompleteEventArgs): void; + touchStart? (e: TabEventArgs): void; + touchEnd? (e: TabEventArgs): void; + ajaxSuccess? (e: TabAjaxLoadSuccessEventArgs): void; + ajaxError? (e: TabAjaxLoadErrorEventArgs): void; + ajaxComplete? (e: TabEventArgs): void; + create? (e: TabEventArgs): void; + destroy? (e: TabEventArgs): void; + ajaxBeforeLoad? (e: TabAjaxBeforeLoadEventArgs): void; +} + +interface TabItemOptions { + text?: string; + href?: string; + enableAjax?: boolean; + badge?: badgeTabOptions; + touchStart? (e: TabEventArgs): void; + touchEnd? (e: TabEventArgs): void; + ios7?: ios7TabOptions; + android?: ios7TabOptions; +} + +interface TabEventArgs { + cancel: boolean; + type: string; + model: TabOptions; +} +interface TabAjaxBeforeLoadEventArgs extends TabEventArgs { + content?: any; + item?: any; + index?: number; + text?: string; + url?: string; +} +interface TabLoadCompleteEventArgs extends TabEventArgs { + element: Object; + id: string; +} +interface TabPrefetchEventArgs extends TabEventArgs { + item: Object; + content: string; + text: string; + url: string; + index: number; +} +interface TabAjaxLoadSuccessEventArgs extends TabEventArgs { + element: Object; + currentContent: string; +} + +interface TabAjaxLoadErrorEventArgs extends TabEventArgs { + status: boolean; + error: string; +} +interface badgeTabOptions { + enabled?: boolean; + value?: (number|string); + maxValue?: (number|string); + minValue?: (number|string); +} +interface ios7TabOptions { + imageClass?: string; +} +interface overflowBadgeTabOptions { + enabled?: boolean; + value?: (number|string); + maxValue?: (number|string); + minValue?: (number|string); +} +interface androidTabOptions { + contentType?: ej.mobile.Tab.Android.ContentType; + imageClass?: string; + position?: ej.mobile.Tab.Position; +} +interface windowsTabOptions extends windowsOption { + enableCustomText?: boolean; + position?: ej.mobile.Tab.Position; + enableTouchMove?: boolean; + preventContentSwipe?: boolean; +} +interface flatTabOptions { + position?: ej.mobile.Tab.Position; +} +interface ajaxSettingsTabOptions { + type?: string; + cache?: boolean; + async?: boolean; + dataType?: string; + contentType?: string; + url?: string; + data?: {}; +} + +export module Tab{ +export module Android{ +enum ContentType{ +Text, +Image, +Both +} +} +enum Position{ +Fixed, +Normal +} +} + +class Tile extends ej.Widget { + static fn: Tile; + constructor(element: JQuery, options?: TileOptions); + model: TileOptions; + defaults: TileOptions; + updateTemplate(id: string, index: (number|string)): void; + destroy(): void; +} + +interface TileOptions { + android?: androidTileOptions; + badge?: tileBadgeOptions; + cssClass?: string; + captionTemplateId?: string; + enablePersistence?: boolean; + imageClass?: string; + imagePath?: string; + imagePosition?: ej.mobile.Tile.ImagePosition; + imageTemplateId?: string; + imageUrl?: string; + backgroundColor?: string; + ios7?: ios7TileOptions; + liveTile?: liveTileOptions; + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + showText?: boolean; + text?: string; + textAlignment?: ej.mobile.Tile.TextAlignment; + tileSize?: ej.mobile.Tile.TileSize; + width?: (number|string); + height?: (number|string); + touchEnd? (e: tileTouchEventArgs): void; + touchStart? (e: tileTouchEventArgs): void; + create? (e: TileEventArgs): void; + destroy? (e: TileEventArgs): void; +} +interface TileEventArgs { + cancel?: boolean; + model?: TileOptions; + type?: string; +} +interface tileBadgeOptions { + enabled?: boolean; + value?: (number|string); + maxValue?: (number|string); + minValue?: (number|string); + text?: string; +} + +interface liveTileOptions { + enabled?: boolean; + imageClass?: string; + imageTemplateId?: string; + imageUrl?: string[]; + type?: string; + updateInterval?: number; +} + +interface ios7TileOptions { + textPosition?: ej.mobile.Tile.TextPosition; +} + +interface androidTileOptions { + textPosition?: ej.mobile.Tile.TextPosition; +} + +interface tileTouchEventArgs extends TileEventArgs { + text?: string; +} + +export module Tile +{ +enum TextPosition +{ + Inner, + Outer +} +enum TileSize +{ + Medium, + Small, + Large, + Wide +} +enum TextAlignment +{ + + Normal, + Left, + Right, + Center +} +enum ImagePosition +{ + Center, + Top, + Bottom, + Right, + Left, + TopLeft, + TopRight, + BottomRight, + BottomLeft, + Fill +} +} + + +class TimePicker extends ej.Widget { + static fn: TimePicker; + static Locale:any; + constructor(element: JQuery, options?: TimePickerOptions); + model: TimePickerOptions; + defaults: TimePickerOptions; + show(e?:any): void; + hide(e?:any): void; + enable(): void; + disable(): void; + getValue(): string; + setCurrentTime(time: any): void; + destroy(): void; +} +interface TimePickerOptions { + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + cssClass?: string; + hourFormat?: ej.mobile.TimePicker.HourFormat; + value?: string; + culture?: string; + timeFormat?: string; + enabled?: boolean; + enablePersistence?:boolean; + ios7?: ios7TimepickerOptions; + windows?: windowsOption; + select? (e: TimepickerEventArgs): void; + load? (e: TimepickerEventArgs): void; + focusIn? (e: TimepickerEventArgs): void; + focusOut? (e: TimepickerEventArgs): void; + open? (e: TimepickerEventArgs): void; + close? (e: TimepickerEventArgs): void; + change? (e: TimepickerEventArgs): void; + create? (e: TimePickerCommonEventArgs): void; + destroy? (e: TimePickerCommonEventArgs): void; +} +interface TimePickerCommonEventArgs { + cancel: boolean; + type: string; + model: TimePickerOptions; +} +interface TimepickerEventArgs extends TimePickerCommonEventArgs { + value: string; +} +interface ios7TimepickerOptions { + renderDefault?: boolean; +} + +export module TimePicker{ +enum HourFormat{ + TwentyFour, + Twelve +} +} + +//Class ejmToggleButton +class ToggleButton extends ej.Widget { + static fn: ToggleButton; + constructor(element: JQuery, options?: ToggleButtonOptions); + model: ToggleButtonOptions; + defaults: ToggleButtonOptions; + enable(): void; + disable(): void; + destroy(): void; +} + +//ejmToggleButton Option +interface ToggleButtonOptions { + theme?: ej.mobile.Theme; + renderMode?: ej.mobile.RenderMode; + cssClass?: string; + animate?: boolean; + toggleState?: boolean; + windows?: windowsOption; + enablePersistence?: boolean; + enabled?: boolean; + change? (e: ToggleButtonEventArgs): void; + touchStart? (e: ToggleButtonEventArgs): void; + touchEnd? (e: ToggleButtonEventArgs): void; + create? (e: ToggleButtonCommonEventArgs): void; + destroy? (e: ToggleButtonCommonEventArgs): void; +} + +interface ToggleButtonCommonEventArgs { + cancel: boolean; + type: string; + model: ToggleButtonOptions; +} +//ToggleButtonEvent Arugument +interface ToggleButtonEventArgs extends ToggleButtonCommonEventArgs { + state: boolean; +} +//Class ejmToolbar +class Toolbar extends ej.Widget { + static fn: Toolbar; + constructor(element: JQuery, options?: ToolbarOptions); + model: ToolbarOptions; + validTags: Array; + defaults: ToolbarOptions; + removeItem(index:number): void; + addItem(newitem:string): void; + showEllipsis(): void; + disableItem(disableIcon:string): void; + enableItem(enableIcon:string): void; + hideItem(iconName:string): void; + hideEllipsis(): void; + showItem(iconName:string): void; + hideMenu(): void; + showMenu(): void; + destroy(): void; +} + +//ejmToolbar Android Options +interface ToolbarAndroidOptions { + title?: string; + titleIconUrl?: string; + showBackNavigator?: boolean; + showTitleIcon?: boolean; + enableSplitView?: boolean; + showEllipsis?: boolean; + position?: ej.mobile.Toolbar.Position; + +} +//ejmToolbar IOS7 Options +interface ToolbarIOS7Options { + position?: ej.mobile.Toolbar.Position; +} +//ejmToolbar Flat Options +interface ToolbarFlatOptions { + position?: ej.mobile.Toolbar.Position; +} +//ejmToolbar Windows Options +interface ToolbarWindowsOptions { + position?: ej.mobile.Toolbar.Position; +} +//ejmToolbar Option +interface ToolbarOptions { + theme?: ej.mobile.Theme; + renderMode?: ej.mobile.RenderMode; + cssClass?: string; + items?: Array; + enabled?: boolean; + enablePersistence?:boolean; + hide?: boolean; + position?: ej.mobile.Toolbar.Position; + android?: ToolbarAndroidOptions; + windows?: windowsOption; + ios7?: ToolbarIOS7Options; + Flat?: ToolbarFlatOptions; + templateId?: any; + titleIconUrl?: any; + touchStart? (e: ToolbarEventArgs): void; + touchEnd? (e: ToolbarEventArgs): void; + create? (e: ToolbarEventArgs): void; + destroy? (e: ToolbarEventArgs): void; + +} +interface ToolbarItems{ + iconName?: ej.mobile.Toolbar.IconName; + iconUrl?: string; +} +//ejmToolbarEvent Arugument +interface ToolbarEventArgs { + cancel: boolean; + type: string; + model: ToolbarOptions; +} + +export module Toolbar{ + enum Position{ + Normal, + Fixed + } + enum IconName{ + Add, + Back, + Bookmark, + Close, + Compose, + Copy, + Cut, + Delete, + Done, + Edit, + Mail, + Next, + Refresh, + Overflow, + Paste, + Reply, + Save, + Search, + Settings, + Share + } +} +/*Group button*/ +class GroupButton extends ej.Widget { + static fn: GroupButton; + element: JQuery; + constructor(element?: JQuery, options?: GroupButtonOptions); + model: GroupButtonOptions; + defaults: GroupButtonOptions; + destroy(): void; + //add public functions +} +interface GroupButtonOptions { + selectedItemIndex?: (number|string); + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + cssClass?: string; + enablePersistence?: boolean; + items?: Array; + windows?: windowsOption; + touchStart? (e: GroupButtonEventArgs): void; + touchEnd? (e: GroupButtonEventArgs): void; + destroy? (e: GroupButtonEventArgs): void; + create? (e: GroupButtonEventArgs): void; +} +interface GroupButtonItemsOptions { + text?: string; + type?: string; + imageClass?: string; + imageUrl?: string; +} +interface GroupButtonEventArgs { + cancel: boolean; + type: string; + model: GroupButtonOptions; +} +/* SplitPane */ +class SplitPane extends ej.Widget { + static fn: SplitPane; + constructor(element: JQuery, options?: SplitPaneOptions); + model:SplitPaneOptions; + defaults: SplitPaneOptions; + loadContent(toPage: string, options?: any): void; + transferPage(toPage: any, options: any, existing: any, newPage: any): void; + refreshRightScroller(): void; + refreshLeftScroller(): void; + destroy(): void; +} +interface SplitPaneOptions { + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + cssClass?: string; + allowLeftPaneScrolling?: boolean; + allowRightPaneScrolling?: boolean; + android?: SplitPaneAndroidOptions; + windows?: SplitPaneWindowsOptions; + ios7?: SplitPaneIOS7Options; + flat?: SplitPaneFlatOptions; + enablePersistence?: boolean; + enableSwipe?: boolean; + overlayLeftPane?: boolean; + overlayDirection?: ej.mobile.SplitPane.OverlayDirection; + leftPaneScrollSettings?: Object; + rightPaneScrollSettings?: Object; + leftHeaderSettings?: Object; + rightHeaderSettings?: Object; + toolbarSettings?: Object; + create? (e: SplitPaneBaseEventArgs): void; + destroy? (e: SplitPaneBaseEventArgs): void; + beforeTransfer? (e: SplitPaneEventArgs): void; + afterLoadSuccess? (e: SplitPaneEventArgs): void; +} +interface SplitPaneBaseEventArgs { + cancel: boolean; + type: string; + model: SplitPaneOptions; +} +interface SplitPaneEventArgs extends SplitPaneBaseEventArgs { + element: Object; + toPage: Object; + leftPaneheader: Object; + rightPaneheader: Object; + toolbar: Object; +} +interface SplitPaneAndroidOptions { + showToolbar?: boolean; +} +interface SplitPaneWindowsOptions { + showLeftPaneHeader?: boolean; + showRightPaneHeader?: boolean; +} +interface SplitPaneIOS7Options { + showLeftPaneHeader?: boolean; + showRightPaneHeader?: boolean; +} +interface SplitPaneFlatOptions { + showLeftPaneHeader?: boolean; + showRightPaneHeader?: boolean; +} + +export module SplitPane{ +enum OverlayDirection{ +Left, +Right +} +} + +class Dialog extends ej.Widget { + static fn: Dialog; + element: JQuery; + constructor(element: JQuery, options?: DialogOptions); + model: DialogOptions; + defaults: DialogOptions; + open(): void; + close(): void; + isOpened(): boolean; + destroy(): void; +} +interface DialogOptions { + cssClass?: string; + enableAutoOpen?: boolean; + title?: string; + beforeClose? (e: DialogBeforeClose): void; + open? (e: DialogOpen): void; + close? (e: DialogClose): void; + buttonTap? (e: DialogButtonTap): void; + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + enableModal?: boolean; + showButtons?: boolean; + allowScrolling?: boolean; + enableNativeScrolling?: boolean; + mode?: ej.mobile.Dialog.Mode; + leftButtonCaption?: string; + rightButtonCaption?: string; + checkDOMChanges?: boolean; + templateId?: string; + targetHeight?: string|number; + enablePersistence?: boolean; + enableAnimation?: boolean; + windows?: windowsOption; + destroy? (e: DialogEventArgs): void; + create? (e: DialogEventArgs): void; +} +interface DialogEventArgs { + cancel: boolean; + type: string; + model: DialogOptions; +} +interface DialogBeforeClose extends DialogEventArgs{ + title: string; +} +interface DialogOpen extends DialogEventArgs { + element: Object; + title: string; +} +interface DialogClose extends DialogEventArgs { + title: string; + element: Object; +} +interface DialogButtonTap extends DialogEventArgs { + text: string; +} + +export module Dialog{ +enum Mode{ + Alert, + Confirm, + Normal, + FullView +} +} + +class TextboxCommon extends ej.Widget { + model: TextBoxOptions; + disable(): void; + enable(): void; + getStrippedValue(): string; + getUnstrippedValue(): string; + getValue(): string; + getWatermarkText(): string; + refresh(): void; + destroy(): void; +} +class TextBox extends TextboxCommon { + static fn: TextBox; + constructor(element: JQuery, options?: TextBoxOptions); + defaults: TextBoxOptions; +} +/* Password */ +class Password extends TextboxCommon { + static fn: Password; + constructor(element: JQuery, options?: TextBoxOptions); + defaults: TextBoxOptions; +} +/* MaskEdit */ +class MaskEdit extends TextboxCommon { + static fn: MaskEdit; + constructor(element: JQuery, options?: MaskEditOptions); + defaults: MaskEditOptions; + +} +/* TextArea */ +class TextArea extends TextboxCommon { + static fn: TextArea; + constructor(element: JQuery, options?: TextBoxOptions); + defaults: TextBoxOptions; + +} +interface TextBoxOptions { + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + cssClass?: string; + showBorder?: boolean; + windows?: WindowsTextBoxOptions; + value?: string; + watermarkText?: string; + change? (e: TextBoxChangeEventArgs): void; + create? (e: TextBoxEventArgs): void; + destroy? (e: TextBoxEventArgs): void; + enabled?: boolean; + enablePersistence?: boolean; + readOnly?: boolean; +} +interface TextBoxEventArgs { + cancel: boolean; + type: string; + model: TextBoxOptions; +} +interface MaskEditOptions extends TextBoxOptions { + mask?: string; +} +interface WindowsTextBoxOptions extends windowsOption { + allowReset?: boolean; +} +interface TextBoxChangeEventArgs extends TextBoxEventArgs { + element: Object; + value: string; + isChecked: boolean; +} +class Footer extends ej.Widget { + static fn: Footer; + element: JQuery; + constructor(element: JQuery, options?: FooterOptions); + model: FooterOptions; + defaults: FooterOptions; + getTitle(): string; + destroy(): void; + +} + +interface FooterOptions { + hideForUnSupportedDevice?: boolean; + leftButtonNavigationUrl?: string; + rightButtonNavigationUrl?: string; + title?: string; + cssClass?: string; + showTitle?: boolean; + position?: ej.mobile.Footer.Position; + leftButtonCaption?: string; + rightButtonCaption?: string; + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + showLeftButton?: boolean; + showRightButton?: boolean; + enablePersistence?:boolean; + leftButtonStyle?:ej.mobile.Footer.FooterLeftButtonStyle; + rightButtonStyle?:ej.mobile.Footer.FooterRightButtonStyle; + ios7?: Footerios7Options; + flat?: FooterFlatOptions; + android?: FooterAndroidOptions; + templateId?: string; + windows?: FooterWindowsOptions; + leftButtonTap? (e: FooterLeftButtonTapEventArgs): void; + rightButtonTap? (e: FooterRightButtonTapEventArgs): void; + destroy?(e:FooterBaseArgs):void; + create?(e:FooterBaseArgs):void; +} + +interface FooterWindowsOptions extends windowsOption { + renderDefault?: boolean; + rightButtonStyle?: ej.mobile.Footer.Windows.FooterRightButtonStyle; + leftButtonStyle?: ej.mobile.Footer.Windows.FooterLeftButtonStyle; + showLeftButton?: boolean; + showRightButton?: boolean; +} +interface Footerios7Options { + rightButtonStyle?: ej.mobile.Footer.IOS7.FooterRightButtonStyle; + leftButtonStyle?: ej.mobile.Footer.IOS7.FooterLeftButtonStyle; + showLeftButton?: boolean; + showRightButton?: boolean; +} +interface FooterFlatOptions { + rightButtonStyle?: ej.mobile.Footer.Flat.FooterRightButtonStyle; + leftButtonStyle?: ej.mobile.Footer.Flat.FooterLeftButtonStyle; + showLeftButton?: boolean; + showRightButton?: boolean; +} +interface FooterAndroidOptions { + rightButtonStyle?: ej.mobile.Footer.Android.FooterRightButtonStyle; + leftButtonStyle?: ej.mobile.Footer.Android.FooterLeftButtonStyle; + showLeftButton?: boolean; + showRightButton?: boolean; +} + +interface FooterBaseArgs{ + cancel: boolean; + type: string; + model: FooterOptions; +} + +interface FooterLeftButtonTapEventArgs { + text: string; + cancel: boolean; + model: Object; + type: string; + status: boolean; +} +interface FooterRightButtonTapEventArgs { + text: string; + cancel: boolean; + model: Object; + type: string; + status: boolean; +} + +export module Footer{ +export module IOS7 +{ +enum FooterLeftButtonStyle +{ + Auto, + Back, + Header, + Normal +} +enum FooterRightButtonStyle +{ + Auto, + Header, + Normal +} +} + +export module Flat +{ +enum FooterLeftButtonStyle +{ + Auto, + Back, + Normal, + Header +} +enum FooterRightButtonStyle +{ + Auto, + Header, + Normal +} +} + +export module Android +{ +enum FooterLeftButtonStyle +{ + Auto, + Back, + Normal, + Header +} +enum FooterRightButtonStyle +{ + Auto, + Normal, + Header +} +} + +export module Windows +{ +enum FooterLeftButtonStyle +{ + Auto, + Back, + Normal, + Header +} +enum FooterRightButtonStyle +{ + Auto, + Normal, + Header +} +} +enum Position{ + Normal, + Fixed +} +enum FooterLeftButtonStyle{ +Back, +Header, +Normal +} +enum FooterRightButtonStyle{ +Header, +Normal +} +} + +class CheckBox extends ej.Widget { + static fn: CheckBox; + constructor(element: JQuery, options?: CheckBoxOptions); + model: CheckBoxOptions; + defaults: CheckBoxOptions; + isChecked(): boolean; + destroy(): void; + +} +interface CheckBoxOptions { + touchStart? (e: CheckBoxTouchStart): void; + touchEnd? (e: CheckBoxTouchEnd): void; + renderMode?: ej.mobile.RenderMode; + cssClass?: string; + preventDefault?: boolean; + theme?: ej.mobile.Theme; + enabled?: boolean; + checked?: boolean; + enableTriState?: boolean; + checkState?: ej.mobile.CheckBox.CheckState; + windows?: windowsOption; + enablePersistence?: boolean; + text?: string; + destroy? (e: checkBoxEventArgs): void; + create? (e: checkBoxEventArgs): void; +} +interface checkBoxEventArgs { + cancel: boolean; + type: string; + model: CheckBoxOptions; +} +interface CheckBoxTouchStart extends checkBoxEventArgs{ + element: Object; + value: string; + isChecked: boolean; +} +interface CheckBoxTouchEnd extends checkBoxEventArgs{ + element: Object; + value: string; + isChecked: boolean; +} +export module CheckBox{ + enum CheckState{ + Uncheck, + Check, + Indeterminate + } +} +class ScrollPanel extends ej.Widget { + static fn: ScrollPanel; + constructor(element: JQuery, target: any, options?: ScrollPanelOptions); + model: ScrollPanelOptions; + defaults: ScrollPanelOptions; + refresh(): void; + disable(): void; + enable(): void; + getComputedPosition(): void; + stop(): void; + getScrollPosition(): void; + destroy(): void; + } + interface ScrollPanelOptions { + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + enableResize?: boolean; + targetHeight?: number; + targetWidth?: number; + scrollHeight?: number; + scrollWidth?: number; + target: any; + enableFade?: boolean; + enableShrink?: (boolean|string); + autoAdjustHeight?: boolean; + isRelative?: boolean; + wheelSpeed?: number; + enableInteraction?: boolean; + enabled?: boolean; + eventPassthrough?:any; + translateZ?:string; + mode?:ej.mobile.ScrollPanel.Mode; + checkDOMChanges?: boolean; + enableHrScroll?: boolean; + enableVrScroll?: boolean; + zoomMin?: number; + zoomMax?: number; + adjustFixedPosition?: boolean; + startZoom?: number; + startX?: number; + startY?: number; + bounceEasing?:string; + enableDisplacement?:boolean; + displacementValue?:number; + displacementTime?:number; + preventDefaultException?:{tagName?:any} + deceleration?:any; + disablePointer?: boolean; + disableMouse?: boolean; + disableTouch?: boolean; + directionLockThreshold?: number; + momentum?: boolean; + enableBounce?: boolean; + bounceTime?: number; + preventDefault?: boolean; + enableTransform?: boolean; + enableTransition?: boolean; + showScrollbars?: boolean; + enableMouseWheel?: boolean; + enableKeys?: boolean; + enableZoom?: boolean; + enableNativeScrolling?: boolean; + invertWheel?: boolean; + enablePersistence?: boolean; + create? (e: ScrollPanelBaseEventArgs): void; + destroy? (e: ScrollPanelBaseEventArgs): void; + scrollStart? (e: ScrollPanelEventArgs): void; + scroll? (e: ScrollPanelEventArgs): void; + scrollEnd? (e: ScrollPanelEventArgs): void; + zoomStart? (e: ScrollPanelEventArgs): void; + zoomEnd? (e: ScrollPanelEventArgs): void; + } +interface ScrollPanelBaseEventArgs { + cancel: boolean; + type: string; + model: ScrollPanelOptions; +} +interface ScrollPanelEventArgs extends ScrollPanelBaseEventArgs { + x: number; + y: number; + object: Object; +} +export module ScrollPanel{ + enum Mode{ + Page, + Container + } +} +class NavigationDrawer extends ej.Widget { + static fn: NavigationDrawer; + element: JQuery; + constructor(element: JQuery, options?: NavigationDrawerOptions); + model: NavigationDrawerOptions; + defaults: NavigationDrawerOptions; + open(e: any): void; + close(e: any): void; + toggle(e: any): void; + destroy(): void; +} +//ejmNavigationDrawer Option +interface NavigationDrawerOptions { + theme?: ej.mobile.Theme; + renderMode?: ej.mobile.RenderMode; + cssClass?: string; + contentId?: string; + allowScrolling?: boolean; + scrollSettings?: {}; + considerSubPage?: boolean; + direction?: ej.mobile.NavigationDrawer.Direction; + showScrollbars?: boolean; + targetId?: string; + position?: ej.mobile.NavigationDrawer.Position; + enableListView?: boolean; + listViewSettings?: {}; + type?: ej.mobile.NavigationDrawer.Type; + width?: string; + items?: Array; + swipe? (e: NavigationDrawerSwipeEventArgs): void; + open? (e: NavigationDrawerOpenBeforeCloseEventArgs): void; + beforeClose? (e: NavigationDrawerOpenBeforeCloseEventArgs): void; + create? (e: NavigationDrawerEvent): void; + destroy? (e: NavigationDrawerEvent): void; +} + +interface NavigationDrawerEvent { + type: string; + cancel: boolean; + model: NavigationDrawerOptions; +} + +//ejmNavigationDrawer Swipe Event Arugument +interface NavigationDrawerSwipeEventArgs extends NavigationDrawerEvent { + element: Object; + targetElement: Object; + direction: string; +} +//ejmNavigationDrawer Open and BeforeClose Event Arugument +interface NavigationDrawerOpenBeforeCloseEventArgs extends NavigationDrawerEvent { + element: Object; +} + +export module NavigationDrawer { + enum Direction { + Left, + Right + } + enum Position { + Normal, + Fixed + } + enum Type { + Overlay, + Slide + } +} + + +class RadialMenu extends ej.Widget { + static fn: RadialMenu; + constructor(element: JQuery, options?: RadialMenuOptions); + model: RadialMenuOptions; + defaults: RadialMenuOptions; + show(): void; + hide(): void; + menuHide(): void; + hideMenu(): void; + showMenu(): void; + enableItemByIndex(index: number): void; + enableItemsByIndices(itemIndices: Array): void; + disableItemByIndex(itemIndex: number): void; + disableItemsByIndices(itemIndices: Array): void; + updateBadgeValue(index: number, value: number): void; + showBadge(index: number): void; + hideBadge(index: number): void; +} + +interface RadialMenuOptions { + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + radius?: number; + cssClass?: string; + imageClass?: string; + backImageClass?: string; + position?: ej.mobile.RadialMenu.Position; + enableAnimation?: boolean; + windows?: windowsOption; + items?: any; + touch? (e: RadialMenuEventArgs): void; + open? (e: RadialMenuEventArgs): void; + close? (e: RadialMenuEventArgs): void; + select? (e: RadialMenuEventArgs): void; +} +interface RadialMenuEventArgs { + cancel: boolean; + model: RadialMenuOptions; + type: string; + index: number; + childIndex: number; +} +export module RadialMenu{ + enum Position{ + RightCenter, + RightTop, + RightBottom, + LeftCenter, + LeftTop, + LeftBottom + } +} + + +class RadialSlider extends ej.Widget { + static fn: RadialSlider; + constructor(element: JQuery, options?: RadialSliderOptions); + constructor(element: Element, options?: RadialSliderOptions); + model:RadialSliderOptions; + defaults:RadialSliderOptions; + show(): void; + hide(): void; + destroy(): void; +} + +interface RadialSliderOptions { + radius?: number; + endAngle?: number; + startAngle?: number; + ticks?: Array; + enableRoundOff?: boolean; + value?: number|string; + strokeWidth?: number; + autoOpen?: boolean; + enableAnimation?: boolean; + cssClass?: string; + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + position?: ej.mobile.RadialSlider.Position; + labelSpace?: string|number; + innerCircleImageClass?: string; + innerCircleImageUrl?: string; + showInnerCircle?: boolean; + inline?: boolean; + stop? (e: RadialSliderStopEventArgs): void; + start? (e: RadialSliderStartEventArgs): void; + slide? (e: RadialSliderSlideEventArgs): void; + change? (e: RadialSliderChangeEventArgs): void; + mouseover? (e: RadialSliderMouseOverEventArgs): void; + create? (e: RadialSliderCreateEventArgs): void; + destroy? (e: RadialSliderCreateEventArgs): void; +} +interface RadialSliderCreateEventArgs { + cancel: boolean; + model: RadialSliderOptions; + type: string; +} +interface RadialSliderStopEventArgs extends RadialSliderCreateEventArgs { + value: number; +} + +interface RadialSliderStartEventArgs extends RadialSliderCreateEventArgs { + value: number; +} +interface RadialSliderSlideEventArgs extends RadialSliderCreateEventArgs { + value: number; + selectedValue: number; +} +interface RadialSliderChangeEventArgs extends RadialSliderCreateEventArgs { + value: number; + oldValue: number; +} +interface RadialSliderMouseOverEventArgs extends RadialSliderCreateEventArgs { + value: number; + selectedValue: number; +} +export module RadialSlider { + enum Position { + RightCenter, + RightTop, + RightBottom, + LeftCenter, + LeftTop, + LeftBottom, + TopLeft, + TopRight, + TopCenter, + BottomLeft, + BottomRight, + BottomCenter + } +} +} +declare module ej.datavisualization { + +class LinearGauge extends ej.Widget { + static fn: LinearGauge; + constructor(element: JQuery, options?: LinearGauge.Model); + constructor(element: Element, options?: LinearGauge.Model); + model:LinearGauge.Model; + defaults:LinearGauge.Model; + + /** destroy the linear gauge all events bound using this._on will be unbind automatically and bring the control to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** To export Image + * @returns {void} + */ + exportImage(): void; + + /** To get Bar Distance From Scale in number + * @returns {void} + */ + getBarDistanceFromScale(): void; + + /** To get Bar Pointer Value in number + * @returns {void} + */ + getBarPointerValue(): void; + + /** To get Bar Width in number + * @returns {void} + */ + getBarWidth(): void; + + /** To get CustomLabel Angle in number + * @returns {void} + */ + getCustomLabelAngle(): void; + + /** To get CustomLabel Value in string + * @returns {void} + */ + getCustomLabelValue(): void; + + /** To get Label Angle in number + * @returns {void} + */ + getLabelAngle(): void; + + /** To get LabelPlacement in number + * @returns {void} + */ + getLabelPlacement(): void; + + /** To get LabelStyle in number + * @returns {void} + */ + getLabelStyle(): void; + + /** To get Label XDistance From Scale in number + * @returns {void} + */ + getLabelXDistanceFromScale(): void; + + /** To get PointerValue in number + * @returns {void} + */ + getLabelYDistanceFromScale(): void; + + /** To get Major Interval Value in number + * @returns {void} + */ + getMajorIntervalValue(): void; + + /** To get MarkerStyle in number + * @returns {void} + */ + getMarkerStyle(): void; + + /** To get Maximum Value in number + * @returns {void} + */ + getMaximumValue(): void; + + /** To get PointerValue in number + * @returns {void} + */ + getMinimumValue(): void; + + /** To get Minor Interval Value in number + * @returns {void} + */ + getMinorIntervalValue(): void; + + /** To get Pointer Distance From Scale in number + * @returns {void} + */ + getPointerDistanceFromScale(): void; + + /** To get PointerHeight in number + * @returns {void} + */ + getPointerHeight(): void; + + /** To get Pointer Placement in String + * @returns {void} + */ + getPointerPlacement(): void; + + /** To get PointerValue in number + * @returns {void} + */ + getPointerValue(): void; + + /** To get PointerWidth in number + * @returns {void} + */ + getPointerWidth(): void; + + /** To get Range Border Width in number + * @returns {void} + */ + getRangeBorderWidth(): void; + + /** To get Range Distance From Scale in number + * @returns {void} + */ + getRangeDistanceFromScale(): void; + + /** To get Range End Value in number + * @returns {void} + */ + getRangeEndValue(): void; + + /** To get Range End Width in number + * @returns {void} + */ + getRangeEndWidth(): void; + + /** To get Range Position in number + * @returns {void} + */ + getRangePosition(): void; + + /** To get Range Start Value in number + * @returns {void} + */ + getRangeStartValue(): void; + + /** To get Range Start Width in number + * @returns {void} + */ + getRangeStartWidth(): void; + + /** To get ScaleBarLength in number + * @returns {void} + */ + getScaleBarLength(): void; + + /** To get Scale Bar Size in number + * @returns {void} + */ + getScaleBarSize(): void; + + /** To get Scale Border Width in number + * @returns {void} + */ + getScaleBorderWidth(): void; + + /** To get Scale Direction in number + * @returns {void} + */ + getScaleDirection(): void; + + /** To get Scale Location in object + * @returns {void} + */ + getScaleLocation(): void; + + /** To get Scale Style in string + * @returns {void} + */ + getScaleStyle(): void; + + /** To get Tick Angle in number + * @returns {void} + */ + getTickAngle(): void; + + /** To get Tick Height in number + * @returns {void} + */ + getTickHeight(): void; + + /** To get getTickPlacement in number + * @returns {void} + */ + getTickPlacement(): void; + + /** To get Tick Style in string + * @returns {void} + */ + getTickStyle(): void; + + /** To get Tick Width in number + * @returns {void} + */ + getTickWidth(): void; + + /** To get get Tick XDistance From Scale in number + * @returns {void} + */ + getTickXDistanceFromScale(): void; + + /** To get Tick YDistance From Scale in number + * @returns {void} + */ + getTickYDistanceFromScale(): void; + + /** Specifies the scales. + * @returns {void} + */ + scales(): void; + + /** To set setBarDistanceFromScale + * @returns {void} + */ + setBarDistanceFromScale(): void; + + /** To set setBarPointerValue + * @returns {void} + */ + setBarPointerValue(): void; + + /** To set setBarWidth + * @returns {void} + */ + setBarWidth(): void; + + /** To set setCustomLabelAngle + * @returns {void} + */ + setCustomLabelAngle(): void; + + /** To set setCustomLabelValue + * @returns {void} + */ + setCustomLabelValue(): void; + + /** To set setLabelAngle + * @returns {void} + */ + setLabelAngle(): void; + + /** To set setLabelPlacement + * @returns {void} + */ + setLabelPlacement(): void; + + /** To set setLabelStyle + * @returns {void} + */ + setLabelStyle(): void; + + /** To set setLabelXDistanceFromScale + * @returns {void} + */ + setLabelXDistanceFromScale(): void; + + /** To set setLabelYDistanceFromScale + * @returns {void} + */ + setLabelYDistanceFromScale(): void; + + /** To set setMajorIntervalValue + * @returns {void} + */ + setMajorIntervalValue(): void; + + /** To set setMarkerStyle + * @returns {void} + */ + setMarkerStyle(): void; + + /** To set setMaximumValue + * @returns {void} + */ + setMaximumValue(): void; + + /** To set setMinimumValue + * @returns {void} + */ + setMinimumValue(): void; + + /** To set setMinorIntervalValue + * @returns {void} + */ + setMinorIntervalValue(): void; + + /** To set setPointerDistanceFromScale + * @returns {void} + */ + setPointerDistanceFromScale(): void; + + /** To set PointerHeight + * @returns {void} + */ + setPointerHeight(): void; + + /** To set setPointerPlacement + * @returns {void} + */ + setPointerPlacement(): void; + + /** To set PointerValue + * @returns {void} + */ + setPointerValue(): void; + + /** To set PointerWidth + * @returns {void} + */ + setPointerWidth(): void; + + /** To set setRangeBorderWidth + * @returns {void} + */ + setRangeBorderWidth(): void; + + /** To set setRangeDistanceFromScale + * @returns {void} + */ + setRangeDistanceFromScale(): void; + + /** To set setRangeEndValue + * @returns {void} + */ + setRangeEndValue(): void; + + /** To set setRangeEndWidth + * @returns {void} + */ + setRangeEndWidth(): void; + + /** To set setRangePosition + * @returns {void} + */ + setRangePosition(): void; + + /** To set setRangeStartValue + * @returns {void} + */ + setRangeStartValue(): void; + + /** To set setRangeStartWidth + * @returns {void} + */ + setRangeStartWidth(): void; + + /** To set setScaleBarLength + * @returns {void} + */ + setScaleBarLength(): void; + + /** To set setScaleBarSize + * @returns {void} + */ + setScaleBarSize(): void; + + /** To set setScaleBorderWidth + * @returns {void} + */ + setScaleBorderWidth(): void; + + /** To set setScaleDirection + * @returns {void} + */ + setScaleDirection(): void; + + /** To set setScaleLocation + * @returns {void} + */ + setScaleLocation(): void; + + /** To set setScaleStyle + * @returns {void} + */ + setScaleStyle(): void; + + /** To set setTickAngle + * @returns {void} + */ + setTickAngle(): void; + + /** To set setTickHeight + * @returns {void} + */ + setTickHeight(): void; + + /** To set setTickPlacement + * @returns {void} + */ + setTickPlacement(): void; + + /** To set setTickStyle + * @returns {void} + */ + setTickStyle(): void; + + /** To set setTickWidth + * @returns {void} + */ + setTickWidth(): void; + + /** To set setTickXDistanceFromScale + * @returns {void} + */ + setTickXDistanceFromScale(): void; + + /** To set setTickYDistanceFromScale + * @returns {void} + */ + setTickYDistanceFromScale(): void; +} +export module LinearGauge{ + +export interface Model { + + /**Specifies the animationSpeed + * @Default {500} + */ + animationSpeed?: number; + + /**Specifies the backgroundColor for Linear gauge. + * @Default {null} + */ + backgroundColor?: string; + + /**Specifies the borderColor for Linear gauge. + * @Default {null} + */ + borderColor?: string; + + /**Specifies the animate state + * @Default {true} + */ + enableAnimation?: boolean; + + /**Specifies the animate state for marker pointer + * @Default {true} + */ + enableMarkerPointerAnimation?: boolean; + + /**Specifies the can resize state. + * @Default {false} + */ + enableResize?: boolean; + + /**Specify frame of linear gauge + * @Default {null} + */ + frame?: Frame; + + /**Specifies the height of Linear gauge. + * @Default {400} + */ + height?: number; + + /**Specifies the labelColor for Linear gauge. + * @Default {null} + */ + labelColor?: string; + + /**Specifies the maximum value of Linear gauge. + * @Default {100} + */ + maximum?: number; + + /**Specifies the minimum value of Linear gauge. + * @Default {0} + */ + minimum?: number; + + /**Specifies the orientation for Linear gauge. + * @Default {Vertical} + */ + orientation?: string; + + /**Specify labelPosition value of Linear gauge See OuterCustomLabelPosition + * @Default {bottom} + */ + outerCustomLabelPosition?: ej.datavisualization.LinearGauge.OuterCustomLabelPosition|string; + + /**Specifies the pointerGradient1 for Linear gauge. + * @Default {null} + */ + pointerGradient1?: any; + + /**Specifies the pointerGradient2 for Linear gauge. + * @Default {null} + */ + pointerGradient2?: any; + + /**Specifies the read only state. + * @Default {true} + */ + readOnly?: boolean; + + /**Specifies the scales + * @Default {null} + */ + scales?: Scales; + + /**Specifies the theme for Linear gauge. See LinearGauge.Themes + * @Default {flatlight} + */ + theme?: ej.datavisualization.LinearGauge.Themes|string; + + /**Specifies the tick Color for Linear gauge. + * @Default {null} + */ + tickColor?: string; + + /**Specify tooltip options of linear gauge + * @Default {false} + */ + tooltip?: Tooltip; + + /**Specifies the value of the Gauge. + * @Default {0} + */ + value?: number; + + /**Specifies the width of Linear gauge. + * @Default {150} + */ + width?: number; + + /**Triggers while the bar pointer are being drawn on the gauge.*/ + drawBarPointers? (e: DrawBarPointersEventArgs): void; + + /**Triggers while the customLabel are being drawn on the gauge.*/ + drawCustomLabel? (e: DrawCustomLabelEventArgs): void; + + /**Triggers while the Indicator are being drawn on the gauge.*/ + drawIndicators? (e: DrawIndicatorsEventArgs): void; + + /**Triggers while the label are being drawn on the gauge.*/ + drawLabels? (e: DrawLabelsEventArgs): void; + + /**Triggers while the marker are being drawn on the gauge.*/ + drawMarkerPointers? (e: DrawMarkerPointersEventArgs): void; + + /**Triggers while the range are being drawn on the gauge.*/ + drawRange? (e: DrawRangeEventArgs): void; + + /**Triggers while the ticks are being drawn on the gauge.*/ + drawTicks? (e: DrawTicksEventArgs): void; + + /**Triggers when the gauge is initialized.*/ + init? (e: InitEventArgs): void; + + /**Triggers while the gauge start to Load.*/ + load? (e: LoadEventArgs): void; + + /**Triggers when the left mouse button is clicked.*/ + mouseClick? (e: MouseClickEventArgs): void; + + /**Triggers when clicking and dragging the mouse pointer over the gauge pointer.*/ + mouseClickMove? (e: MouseClickMoveEventArgs): void; + + /**Triggers when the mouse click is released.*/ + mouseClickUp? (e: MouseClickUpEventArgs): void; + + /**Triggers while the rendering of the gauge completed.*/ + renderComplete? (e: RenderCompleteEventArgs): void; +} + +export interface DrawBarPointersEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the pointer + */ + position?: any; + + /**returns the gauge model + */ + Model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the pointer style + */ + style?: string; + + /**returns the current Bar pointer element. + */ + barElement?: any; + + /**returns the index of the bar pointer. + */ + barPointerIndex?: number; + + /**returns the value of the bar pointer. + */ + PointerValue?: number; + + /**returns the name of the event + */ + type?: any; +} + +export interface DrawCustomLabelEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the customLabel + */ + position?: any; + + /**returns the gauge model + */ + Model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the customLabel style + */ + style?: any; + + /**returns the current customLabel element. + */ + customLabelElement?: any; + + /**returns the index of the customLabel. + */ + customLabelIndex?: number; + + /**returns the name of the event + */ + type?: any; +} + +export interface DrawIndicatorsEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the Indicator + */ + position?: any; + + /**returns the gauge model + */ + Model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the Indicator style + */ + style?: string; + + /**returns the current Indicator element. + */ + IndicatorElement?: any; + + /**returns the index of the Indicator. + */ + IndicatorIndex?: number; + + /**returns the name of the event + */ + type?: any; +} + +export interface DrawLabelsEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the label + */ + position?: any; + + /**returns the gauge model + */ + Model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the label belongs. + */ + scaleIndex?: number; + + /**returns the label style + */ + style?: string; + + /**returns the angle of the label. + */ + angle?: number; + + /**returns the current label element. + */ + element?: any; + + /**returns the index of the label. + */ + index?: number; + + /**returns the label value of the label. + */ + value?: number; + + /**returns the name of the event + */ + type?: any; +} + +export interface DrawMarkerPointersEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the pointer + */ + position?: any; + + /**returns the gauge model + */ + Model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the ticks style + */ + style?: string; + + /**returns the current marker pointer element. + */ + markerElement?: any; + + /**returns the index of the marker pointer. + */ + markerPointerIndex?: number; + + /**returns the value of the marker pointer. + */ + pointerValue?: number; + + /**returns the angle of the marker pointer. + */ + pointerAngle?: number; + + /**returns the name of the event + */ + type?: any; +} + +export interface DrawRangeEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the range + */ + position?: any; + + /**returns the gauge model + */ + Model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the range style + */ + style?: string; + + /**returns the current range element. + */ + rangeElement?: any; + + /**returns the index of the range. + */ + rangeIndex?: number; + + /**returns the name of the event + */ + type?: any; +} + +export interface DrawTicksEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the ticks + */ + position?: any; + + /**returns the gauge model + */ + Model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the tick belongs. + */ + scaleIndex?: number; + + /**returns the ticks style + */ + style?: string; + + /**returns the angle of the tick. + */ + angle?: number; + + /**returns the current tick element. + */ + element?: any; + + /**returns the index of the tick. + */ + index?: number; + + /**returns the tick value of the tick. + */ + value?: number; + + /**returns the name of the event + */ + type?: any; +} + +export interface InitEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + Model?: any; + + /**returns the entire scale element. + */ + scaleElement?: any; + + /**returns the context element + */ + context?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface LoadEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + Model?: any; + + /**returns the entire scale element. + */ + scaleElement?: any; + + /**returns the context element + */ + context?: any; + + /**returns the name of the event + */ + type?: any; +} + +export interface MouseClickEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: any; + + /**returns the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the context element* @param {Object} args.markerpointer returns the context element + */ + context?: any; + + /**returns the pointer Index + */ + markerpointerindex?: number; + + /**returns the pointer element. + */ + markerpointerelement?: any; + + /**returns the value of the pointer. + */ + markerpointervalue?: number; + + /**returns the pointer style + */ + style?: string; + + /**returns the startX and startY of the pointer. + */ + position?: any; +} + +export interface MouseClickMoveEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: any; + + /**returns the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the context element + */ + context?: any; + + /**returns the pointer Index + */ + index?: number; + + /**returns the pointer element. + */ + element?: any; + + /**returns the value of the pointer. + */ + value?: number; + + /**returns the pointer style + */ + style?: string; + + /**returns the startX and startY of the pointer. + */ + position?: any; +} + +export interface MouseClickUpEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: any; + + /**returns the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the context element* @param {Object} args.markerpointer returns the context element + */ + context?: any; + + /**returns the pointer Index + */ + markerpointerIndex?: number; + + /**returns the pointer element. + */ + markerpointerElement?: any; + + /**returns the value of the pointer. + */ + markerpointerValue?: number; + + /**returns the pointer style + */ + style?: string; + + /**returns the startX and startY of the pointer. + */ + position?: any; +} + +export interface RenderCompleteEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + Model?: any; + + /**returns the entire scale element. + */ + scaleElement?: any; + + /**returns the context element + */ + context?: any; + + /**returns the name of the event + */ + type?: any; +} + +export interface Frame { + + /**Specifies the frame background image url of linear gauge + * @Default {null} + */ + backgroundImageUrl?: string; + + /**Specifies the frame InnerWidth + * @Default {8} + */ + innerWidth?: number; + + /**Specifies the frame OuterWidth + * @Default {12} + */ + outerWidth?: number; +} + +export interface ScalesBarPointersBorder { + + /**Specifies the border Color of bar pointer + * @Default {null} + */ + color?: string; + + /**Specifies the border Width of bar pointer + * @Default {1.5} + */ + width?: number; +} + +export interface ScalesBarPointers { + + /**Specifies the backgroundColor of bar pointer + * @Default {null} + */ + backgroundColor?: string; + + /**Specifies the border of bar pointer + * @Default {null} + */ + border?: ScalesBarPointersBorder; + + /**Specifies the distanceFromScale of bar pointer + * @Default {0} + */ + distanceFromScale?: number; + + /**Specifies the scaleBar Gradient of bar pointer + * @Default {null} + */ + gradients?: any; + + /**Specifies the opacity of bar pointer + * @Default {1} + */ + opacity?: number; + + /**Specifies the value of bar pointer + * @Default {null} + */ + value?: number; + + /**Specifies the pointer Width of bar pointer + * @Default {width=30} + */ + width?: number; +} + +export interface ScalesBorder { + + /**Specifies the border color of the Scale. + * @Default {null} + */ + color?: string; + + /**Specifies the border width of the Scale. + * @Default {1.5} + */ + width?: number; +} + +export interface ScalesCustomLabelsFont { + + /**Specifies the fontFamily in customLabels + * @Default {Arial} + */ + fontFamily?: string; + + /**Specifies the fontStyle in customLabels. See FontStyle + * @Default {Bold} + */ + fontStyle?: ej.datavisualization.LinearGauge.FontStyle|string; + + /**Specifies the font size in customLabels + * @Default {11px} + */ + size?: string; +} + +export interface ScalesCustomLabelsPosition { + + /**Specifies the position x in customLabels + * @Default {0} + */ + x?: number; + + /**Specifies the y in customLabels + * @Default {0} + */ + y?: number; +} + +export interface ScalesCustomLabels { + + /**Specifies the label Color in customLabels + * @Default {null} + */ + color?: number; + + /**Specifies the font in customLabels + * @Default {null} + */ + font?: ScalesCustomLabelsFont; + + /**Specifies the opacity in customLabels + * @Default {0} + */ + opacity?: string; + + /**Specifies the position in customLabels + * @Default {null} + */ + position?: ScalesCustomLabelsPosition; + + /**Specifies the positionType in customLabels.See CustomLabelPositionType + * @Default {null} + */ + positionType?: any; + + /**Specifies the textAngle in customLabels + * @Default {0} + */ + textAngle?: number; + + /**Specifies the label Value in customLabels + */ + value?: string; +} + +export interface ScalesIndicatorsBorder { + + /**Specifies the border Color in bar indicators + * @Default {null} + */ + color?: string; + + /**Specifies the border Width in bar indicators + * @Default {1.5} + */ + width?: number; +} + +export interface ScalesIndicatorsFont { + + /**Specifies the fontFamily of font in bar indicators + * @Default {Arial} + */ + fontFamily?: string; + + /**Specifies the fontStyle of font in bar indicators. See FontStyle + * @Default {ej.datavisualization.LinearGauge.FontStyle.Bold} + */ + fontStyle?: ej.datavisualization.LinearGauge.FontStyle|string; + + /**Specifies the size of font in bar indicators + * @Default {11px} + */ + size?: string; +} + +export interface ScalesIndicatorsPosition { + + /**Specifies the x position in bar indicators + * @Default {0} + */ + x?: number; + + /**Specifies the y position in bar indicators + * @Default {0} + */ + y?: number; +} + +export interface ScalesIndicatorsStateRanges { + + /**Specifies the backgroundColor in bar indicators state ranges + * @Default {null} + */ + backgroundColor?: string; + + /**Specifies the borderColor in bar indicators state ranges + * @Default {null} + */ + borderColor?: string; + + /**Specifies the endValue in bar indicators state ranges + * @Default {60} + */ + endValue?: number; + + /**Specifies the startValue in bar indicators state ranges + * @Default {50} + */ + startValue?: number; + + /**Specifies the text in bar indicators state ranges + */ + text?: string; + + /**Specifies the textColor in bar indicators state ranges + * @Default {null} + */ + textColor?: string; +} + +export interface ScalesIndicatorsTextLocation { + + /**Specifies the textLocation position in bar indicators + * @Default {0} + */ + x?: number; + + /**Specifies the Y position in bar indicators + * @Default {0} + */ + y?: number; +} + +export interface ScalesIndicators { + + /**Specifies the backgroundColor in bar indicators + * @Default {null} + */ + backgroundColor?: string; + + /**Specifies the border in bar indicators + * @Default {null} + */ + border?: ScalesIndicatorsBorder; + + /**Specifies the font of bar indicators + * @Default {null} + */ + font?: ScalesIndicatorsFont; + + /**Specifies the indicator Height of bar indicators + * @Default {30} + */ + height?: number; + + /**Specifies the opacity in bar indicators + * @Default {NaN} + */ + opacity?: number; + + /**Specifies the position in bar indicators + * @Default {null} + */ + position?: ScalesIndicatorsPosition; + + /**Specifies the state ranges in bar indicators + * @Default {Array} + */ + stateRanges?: Array; + + /**Specifies the textLocation in bar indicators + * @Default {null} + */ + textLocation?: ScalesIndicatorsTextLocation; + + /**Specifies the indicator Style of font in bar indicators + * @Default {ej.datavisualization.LinearGauge.IndicatorType.Rectangle} + */ + type?: ej.datavisualization.LinearGauge.IndicatorTypes|string; + + /**Specifies the indicator Width in bar indicators + * @Default {30} + */ + width?: number; +} + +export interface ScalesLabelsDistanceFromScale { + + /**Specifies the xDistanceFromScale of labels. + * @Default {-10} + */ + x?: number; + + /**Specifies the yDistanceFromScale of labels. + * @Default {0} + */ + y?: number; +} + +export interface ScalesLabelsFont { + + /**Specifies the fontFamily of font. + * @Default {Arial} + */ + fontFamily?: string; + + /**Specifies the fontStyle of font.See FontStyle + * @Default {ej.datavisualization.LinearGauge.FontStyle.Bold} + */ + fontStyle?: ej.datavisualization.LinearGauge.FontStyle|string; + + /**Specifies the size of font. + * @Default {11px} + */ + size?: string; +} + +export interface ScalesLabels { + + /**Specifies the angle of labels. + * @Default {0} + */ + angle?: number; + + /**Specifies the DistanceFromScale of labels. + * @Default {null} + */ + distanceFromScale?: ScalesLabelsDistanceFromScale; + + /**Specifies the font of labels. + * @Default {null} + */ + font?: ScalesLabelsFont; + + /**need to includeFirstValue. + * @Default {true} + */ + includeFirstValue?: boolean; + + /**Specifies the opacity of label. + * @Default {0} + */ + opacity?: number; + + /**Specifies the label Placement of label. See LabelPlacement + * @Default {Near} + */ + placement?: ej.datavisualization.LinearGauge.PointerPlacement|string; + + /**Specifies the textColor of font. + * @Default {null} + */ + textColor?: string; + + /**Specifies the label Style of label. See LabelType + * @Default {ej.datavisualization.LinearGauge.LabelType.Major} + */ + type?: ej.datavisualization.LinearGauge.ScaleType|string; + + /**Specifies the unitText of label. + */ + unitText?: string; + + /**Specifies the unitText Position of label.See UnitTextPlacement + * @Default {Back} + */ + unitTextPlacement?: ej.datavisualization.LinearGauge.UnitTextPlacement|string; +} + +export interface ScalesMarkerPointersBorder { + + /**Specifies the border color of marker pointer + * @Default {null} + */ + color?: string; + + /**Specifies the border of marker pointer + * @Default {number} + */ + width?: number; +} + +export interface ScalesMarkerPointers { + + /**Specifies the backgroundColor of marker pointer + * @Default {null} + */ + backgroundColor?: string; + + /**Specifies the border of marker pointer + * @Default {null} + */ + border?: ScalesMarkerPointersBorder; + + /**Specifies the distanceFromScale of marker pointer + * @Default {0} + */ + distanceFromScale?: number; + + /**Specifies the pointer Gradient of marker pointer + * @Default {null} + */ + gradients?: any; + + /**Specifies the pointer Length of marker pointer + * @Default {30} + */ + length?: number; + + /**Specifies the opacity of marker pointer + * @Default {1} + */ + opacity?: number; + + /**Specifies the pointer Placement of marker pointer See PointerPlacement + * @Default {Far} + */ + placement?: ej.datavisualization.LinearGauge.PointerPlacement|string; + + /**Specifies the marker Style of marker pointerSee MarkerType + * @Default {Triangle} + */ + type?: ej.datavisualization.LinearGauge.MarkerType|string; + + /**Specifies the value of marker pointer + * @Default {null} + */ + value?: number; + + /**Specifies the pointer Width of marker pointer + * @Default {30} + */ + width?: number; +} + +export interface ScalesPosition { + + /**Specifies the Horizontal position + * @Default {50} + */ + x?: number; + + /**Specifies the vertical position + * @Default {50} + */ + y?: number; +} + +export interface ScalesRangesBorder { + + /**Specifies the border color in the ranges. + * @Default {null} + */ + color?: string; + + /**Specifies the border width in the ranges. + * @Default {1.5} + */ + width?: number; +} + +export interface ScalesRanges { + + /**Specifies the backgroundColor in the ranges. + * @Default {null} + */ + backgroundColor?: string; + + /**Specifies the border in the ranges. + * @Default {null} + */ + border?: ScalesRangesBorder; + + /**Specifies the distanceFromScale in the ranges. + * @Default {0} + */ + distanceFromScale?: number; + + /**Specifies the endValue in the ranges. + * @Default {60} + */ + endValue?: number; + + /**Specifies the endWidth in the ranges. + * @Default {10} + */ + endWidth?: number; + + /**Specifies the range Gradient in the ranges. + * @Default {null} + */ + gradients?: any; + + /**Specifies the opacity in the ranges. + * @Default {null} + */ + opacity?: number; + + /**Specifies the range Position in the ranges. See RangePlacement + * @Default {Center} + */ + placement?: ej.datavisualization.LinearGauge.PointerPlacement|string; + + /**Specifies the startValue in the ranges. + * @Default {20} + */ + startValue?: number; + + /**Specifies the startWidth in the ranges. + * @Default {10} + */ + startWidth?: number; +} + +export interface ScalesTicksDistanceFromScale { + + /**Specifies the xDistanceFromScale in the tick. + * @Default {0} + */ + x?: number; + + /**Specifies the yDistanceFromScale in the tick. + * @Default {0} + */ + y?: number; +} + +export interface ScalesTicks { + + /**Specifies the angle in the tick. + * @Default {0} + */ + angle?: number; + + /**Specifies the tick Color in the tick. + * @Default {null} + */ + color?: string; + + /**Specifies the DistanceFromScale in the tick. + * @Default {null} + */ + distanceFromScale?: ScalesTicksDistanceFromScale; + + /**Specifies the tick Height in the tick. + * @Default {10} + */ + height?: number; + + /**Specifies the opacity in the tick. + * @Default {0} + */ + opacity?: number; + + /**Specifies the tick Placement in the tick. See TickPlacement + * @Default {Near} + */ + placement?: ej.datavisualization.LinearGauge.PointerPlacement|string; + + /**Specifies the tick Style in the tick. See TickType + * @Default {MajorInterval} + */ + type?: ej.datavisualization.LinearGauge.TicksType|string; + + /**Specifies the tick Width in the tick. + * @Default {3} + */ + width?: number; +} + +export interface Scales { + + /**Specifies the backgroundColor of the Scale. + * @Default {null} + */ + backgroundColor?: string; + + /**Specifies the scaleBar Gradient of bar pointer + * @Default {Array} + */ + barPointers?: Array; + + /**Specifies the border of the Scale. + * @Default {null} + */ + border?: ScalesBorder; + + /**Specifies the customLabel + * @Default {Array} + */ + customLabels?: Array; + + /**Specifies the scale Direction of the Scale. See Directions + * @Default {CounterClockwise} + */ + direction?: ej.datavisualization.LinearGauge.Direction|string; + + /**Specifies the indicator + * @Default {Array} + */ + indicators?: Array; + + /**Specifies the labels. + * @Default {Array} + */ + labels?: Array; + + /**Specifies the scaleBar Length. + * @Default {290} + */ + length?: number; + + /**Specifies the majorIntervalValue of the Scale. + * @Default {10} + */ + majorIntervalValue?: number; + + /**Specifies the markerPointers + * @Default {Array} + */ + markerPointers?: Array; + + /**Specifies the maximum of the Scale. + * @Default {null} + */ + maximum?: number; + + /**Specifies the minimum of the Scale. + * @Default {null} + */ + minimum?: number; + + /**Specifies the minorIntervalValue of the Scale. + * @Default {2} + */ + minorIntervalValue?: number; + + /**Specifies the opacity of the Scale. + * @Default {NaN} + */ + opacity?: number; + + /**Specifies the position + * @Default {null} + */ + position?: ScalesPosition; + + /**Specifies the ranges in the tick. + * @Default {Array} + */ + ranges?: Array; + + /**Specifies the shadowOffset. + * @Default {0} + */ + shadowOffset?: number; + + /**Specifies the showBarPointers state. + * @Default {true} + */ + showBarPointers?: boolean; + + /**Specifies the showCustomLabels state. + * @Default {false} + */ + showCustomLabels?: boolean; + + /**Specifies the showIndicators state. + * @Default {false} + */ + showIndicators?: boolean; + + /**Specifies the showLabels state. + * @Default {true} + */ + showLabels?: boolean; + + /**Specifies the showMarkerPointers state. + * @Default {true} + */ + showMarkerPointers?: boolean; + + /**Specifies the showRanges state. + * @Default {false} + */ + showRanges?: boolean; + + /**Specifies the showTicks state. + * @Default {true} + */ + showTicks?: boolean; + + /**Specifies the ticks in the scale. + * @Default {Array} + */ + ticks?: Array; + + /**Specifies the scaleBar type .See ScaleType + * @Default {Rectangle} + */ + type?: ej.datavisualization.LinearGauge.ScaleType|string; + + /**Specifies the scaleBar width. + * @Default {30} + */ + width?: number; +} + +export interface Tooltip { + + /**Specify showCustomLabelTooltip value of linear gauge + * @Default {false} + */ + showCustomLabelTooltip?: boolean; + + /**Specify showLabelTooltip value of linear gauge + * @Default {false} + */ + showLabelTooltip?: boolean; + + /**Specify templateID value of linear gauge + * @Default {false} + */ + templateID?: string; +} +} +module LinearGauge +{ +enum OuterCustomLabelPosition +{ +//string +Left, +//string +Right, +//string +Top, +//string +Bottom, +} +} +module LinearGauge +{ +enum FontStyle +{ +//string +Bold, +//string +Italic, +//string +Regular, +//string +Strikeout, +//string +Underline, +} +} +module LinearGauge +{ +enum Direction +{ +//string +Clockwise, +//string +CounterClockwise, +} +} +module LinearGauge +{ +enum IndicatorTypes +{ +//string +Rectangle, +//string +Circle, +//string +RoundedRectangle, +//string +Text, +} +} +module LinearGauge +{ +enum PointerPlacement +{ +//string +Near, +//string +Far, +//string +Center, +} +} +module LinearGauge +{ +enum ScaleType +{ +//string +Major, +//string +Minor, +} +} +module LinearGauge +{ +enum UnitTextPlacement +{ +//string +Back, +//string +From, +} +} +module LinearGauge +{ +enum MarkerType +{ +//string +Rectangle, +//string +Triangle, +//string +Ellipse, +//string +Diamond, +//string +Pentagon, +//string +Circle, +//string +Star, +//string +Slider, +//string +Pointer, +//string +Wedge, +//string +Trapezoid, +//string +RoundedRectangle, +} +} +module LinearGauge +{ +enum TicksType +{ +//string +Majorinterval, +//string +Minorinterval, +} +} +module LinearGauge +{ +enum Themes +{ +//string +FlatLight, +//string +FlatDark, +} +} + +class CircularGauge extends ej.Widget { + static fn: CircularGauge; + constructor(element: JQuery, options?: CircularGauge.Model); + constructor(element: Element, options?: CircularGauge.Model); + model:CircularGauge.Model; + defaults:CircularGauge.Model; + + /** destroy the circular gauge widget. all events bound using this._on will be unbind automatically and bring the control to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** To export Image + * @returns {void} + */ + exportImage(): void; + + /** To get BackNeedleLength + * @returns {void} + */ + getBackNeedleLength(): void; + + /** To get CustomLabelAngle + * @returns {void} + */ + getCustomLabelAngle(): void; + + /** To get CustomLabelValue + * @returns {void} + */ + getCustomLabelValue(): void; + + /** To get LabelAngle + * @returns {void} + */ + getLabelAngle(): void; + + /** To get LabelDistanceFromScale + * @returns {void} + */ + getLabelDistanceFromScale(): void; + + /** To get LabelPlacement + * @returns {void} + */ + getLabelPlacement(): void; + + /** To get LabelStyle + * @returns {void} + */ + getLabelStyle(): void; + + /** To get MajorIntervalValue + * @returns {void} + */ + getMajorIntervalValue(): void; + + /** To get MarkerDistanceFromScale + * @returns {void} + */ + getMarkerDistanceFromScale(): void; + + /** To get MarkerStyle + * @returns {void} + */ + getMarkerStyle(): void; + + /** To get MaximumValue + * @returns {void} + */ + getMaximumValue(): void; + + /** To get MinimumValue + * @returns {void} + */ + getMinimumValue(): void; + + /** To get MinorIntervalValue + * @returns {void} + */ + getMinorIntervalValue(): void; + + /** To get NeedleStyle + * @returns {void} + */ + getNeedleStyle(): void; + + /** To get PointerCapBorderWidth + * @returns {void} + */ + getPointerCapBorderWidth(): void; + + /** To get PointerCapRadius + * @returns {void} + */ + getPointerCapRadius(): void; + + /** To get PointerLength + * @returns {void} + */ + getPointerLength(): void; + + /** To get PointerNeedleType + * @returns {void} + */ + getPointerNeedleType(): void; + + /** To get PointerPlacement + * @returns {void} + */ + getPointerPlacement(): void; + + /** To get PointerValue + * @returns {void} + */ + getPointerValue(): void; + + /** To get PointerWidth + * @returns {void} + */ + getPointerWidth(): void; + + /** To get RangeBorderWidth + * @returns {void} + */ + getRangeBorderWidth(): void; + + /** To get RangeDistanceFromScale + * @returns {void} + */ + getRangeDistanceFromScale(): void; + + /** To get RangeEndValue + * @returns {void} + */ + getRangeEndValue(): void; + + /** To get RangePosition + * @returns {void} + */ + getRangePosition(): void; + + /** To get RangeSize + * @returns {void} + */ + getRangeSize(): void; + + /** To get RangeStartValue + * @returns {void} + */ + getRangeStartValue(): void; + + /** To get ScaleBarSize + * @returns {void} + */ + getScaleBarSize(): void; + + /** To get ScaleBorderWidth + * @returns {void} + */ + getScaleBorderWidth(): void; + + /** To get ScaleDirection + * @returns {void} + */ + getScaleDirection(): void; + + /** To get ScaleRadius + * @returns {void} + */ + getScaleRadius(): void; + + /** To get StartAngle + * @returns {void} + */ + getStartAngle(): void; + + /** To get SubGaugeLocation + * @returns {void} + */ + getSubGaugeLocation(): void; + + /** To get SweepAngle + * @returns {void} + */ + getSweepAngle(): void; + + /** To get TickAngle + * @returns {void} + */ + getTickAngle(): void; + + /** To get TickDistanceFromScale + * @returns {void} + */ + getTickDistanceFromScale(): void; + + /** To get TickHeight + * @returns {void} + */ + getTickHeight(): void; + + /** To get TickPlacement + * @returns {void} + */ + getTickPlacement(): void; + + /** To get TickStyle + * @returns {void} + */ + getTickStyle(): void; + + /** To get TickWidth + * @returns {void} + */ + getTickWidth(): void; + + /** To set includeFirstValue + * @returns {void} + */ + includeFirstValue(): void; + + /** Switching the redraw option for the gauge + * @returns {void} + */ + redraw(): void; + + /** To set BackNeedleLength + * @returns {void} + */ + setBackNeedleLength(): void; + + /** To set CustomLabelAngle + * @returns {void} + */ + setCustomLabelAngle(): void; + + /** To set CustomLabelValue + * @returns {void} + */ + setCustomLabelValue(): void; + + /** To set LabelAngle + * @returns {void} + */ + setLabelAngle(): void; + + /** To set LabelDistanceFromScale + * @returns {void} + */ + setLabelDistanceFromScale(): void; + + /** To set LabelPlacement + * @returns {void} + */ + setLabelPlacement(): void; + + /** To set LabelStyle + * @returns {void} + */ + setLabelStyle(): void; + + /** To set MajorIntervalValue + * @returns {void} + */ + setMajorIntervalValue(): void; + + /** To set MarkerDistanceFromScale + * @returns {void} + */ + setMarkerDistanceFromScale(): void; + + /** To set MarkerStyle + * @returns {void} + */ + setMarkerStyle(): void; + + /** To set MaximumValue + * @returns {void} + */ + setMaximumValue(): void; + + /** To set MinimumValue + * @returns {void} + */ + setMinimumValue(): void; + + /** To set MinorIntervalValue + * @returns {void} + */ + setMinorIntervalValue(): void; + + /** To set NeedleStyle + * @returns {void} + */ + setNeedleStyle(): void; + + /** To set PointerCapBorderWidth + * @returns {void} + */ + setPointerCapBorderWidth(): void; + + /** To set PointerCapRadius + * @returns {void} + */ + setPointerCapRadius(): void; + + /** To set PointerLength + * @returns {void} + */ + setPointerLength(): void; + + /** To set PointerNeedleType + * @returns {void} + */ + setPointerNeedleType(): void; + + /** To set PointerPlacement + * @returns {void} + */ + setPointerPlacement(): void; + + /** To set PointerValue + * @returns {void} + */ + setPointerValue(): void; + + /** To set PointerWidth + * @returns {void} + */ + setPointerWidth(): void; + + /** To set RangeBorderWidth + * @returns {void} + */ + setRangeBorderWidth(): void; + + /** To set RangeDistanceFromScale + * @returns {void} + */ + setRangeDistanceFromScale(): void; + + /** To set RangeEndValue + * @returns {void} + */ + setRangeEndValue(): void; + + /** To set RangePosition + * @returns {void} + */ + setRangePosition(): void; + + /** To set RangeSize + * @returns {void} + */ + setRangeSize(): void; + + /** To set RangeStartValue + * @returns {void} + */ + setRangeStartValue(): void; + + /** To set ScaleBarSize + * @returns {void} + */ + setScaleBarSize(): void; + + /** To set ScaleBorderWidth + * @returns {void} + */ + setScaleBorderWidth(): void; + + /** To set ScaleDirection + * @returns {void} + */ + setScaleDirection(): void; + + /** To set ScaleRadius + * @returns {void} + */ + setScaleRadius(): void; + + /** To set StartAngle + * @returns {void} + */ + setStartAngle(): void; + + /** To set SubGaugeLocation + * @returns {void} + */ + setSubGaugeLocation(): void; + + /** To set SweepAngle + * @returns {void} + */ + setSweepAngle(): void; + + /** To set TickAngle + * @returns {void} + */ + setTickAngle(): void; + + /** To set TickDistanceFromScale + * @returns {void} + */ + setTickDistanceFromScale(): void; + + /** To set TickHeight + * @returns {void} + */ + setTickHeight(): void; + + /** To set TickPlacement + * @returns {void} + */ + setTickPlacement(): void; + + /** To set TickStyle + * @returns {void} + */ + setTickStyle(): void; + + /** To set TickWidth + * @returns {void} + */ + setTickWidth(): void; +} +export module CircularGauge{ + +export interface Model { + + /**Specifies animationSpeed of circular gauge + * @Default {500} + */ + animationSpeed?: number; + + /**Specifies the background color of circular gauge. + * @Default {null} + */ + backgroundColor?: string; + + /**Specify distanceFromCorner value of circular gauge + * @Default {center} + */ + distanceFromCorner?: number; + + /**Specify animate value of circular gauge + * @Default {true} + */ + enableAnimation?: boolean; + + /**Specify enableResize value of circular gauge + * @Default {false} + */ + enableResize?: boolean; + + /**Specify the frame of circular gauge + * @Default {Object} + */ + frame?: Frame; + + /**Specify gaugePosition value of circular gauge See GaugePosition + * @Default {center} + */ + gaugePosition?: ej.datavisualization.CircularGauge.gaugePosition|string; + + /**Specifies the height of circular gauge. + * @Default {360} + */ + height?: number; + + /**Specifies the interiorGradient of circular gauge. + * @Default {null} + */ + interiorGradient?: any; + + /**Specify isRadialGradient value of circular gauge + * @Default {false} + */ + isRadialGradient?: boolean; + + /**Specifies the maximum value of circular gauge. + * @Default {100} + */ + maximum?: number; + + /**Specifies the minimum value of circular gauge. + * @Default {0} + */ + minimum?: number; + + /**Specify outerCustomLabelPosition value of circular gauge See OuterCustomLabelPosition + * @Default {bottom} + */ + outerCustomLabelPosition?: ej.datavisualization.CircularGauge.CustomLabelPositionType|string; + + /**Specifies the radius of circular gauge. + * @Default {180} + */ + radius?: number; + + /**Specify readonly value of circular gauge + * @Default {true} + */ + readOnly?: boolean; + + /**Specify the pointers, ticks, labels, indicators, ranges of circular gauge + * @Default {null} + */ + scales?: Scales; + + /**Specify the theme of circular gauge. + * @Default {flatlight} + */ + theme?: string; + + /**Specify tooltip option of circular gauge + * @Default {object} + */ + tooltip?: Tooltip; + + /**Specifies the value of circular gauge. + * @Default {0} + */ + value?: number; + + /**Specifies the width of circular gauge. + * @Default {360} + */ + width?: number; + + /**Triggers while the custom labels are being drawn on the gauge.*/ + drawCustomLabel? (e: DrawCustomLabelEventArgs): void; + + /**Triggers while the indicators are being started to drawn on the gauge.*/ + drawIndicators? (e: DrawIndicatorsEventArgs): void; + + /**Triggers while the labels are being drawn on the gauge.*/ + drawLabels? (e: DrawLabelsEventArgs): void; + + /**Triggers while the pointer cap is being drawn on the gauge.*/ + drawPointerCap? (e: DrawPointerCapEventArgs): void; + + /**Triggers while the pointers are being drawn on the gauge.*/ + drawPointers? (e: DrawPointersEventArgs): void; + + /**Triggers when the ranges begin to be getting drawn on the gauge.*/ + drawRange? (e: DrawRangeEventArgs): void; + + /**Triggers while the ticks are being drawn on the gauge.*/ + drawTicks? (e: DrawTicksEventArgs): void; + + /**Triggers while the gauge start to Load.*/ + load? (e: LoadEventArgs): void; + + /**Triggers when the left mouse button is clicked.*/ + mouseClick? (e: MouseClickEventArgs): void; + + /**Triggers when clicking and dragging the mouse pointer over the gauge pointer.*/ + mouseClickMove? (e: MouseClickMoveEventArgs): void; + + /**Triggers when the mouse click is released.*/ + mouseClickUp? (e: MouseClickUpEventArgs): void; + + /**Triggers when the rendering of the gauge is completed.*/ + renderComplete? (e: RenderCompleteEventArgs): void; +} + +export interface DrawCustomLabelEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the custom label + */ + position?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the custom label belongs. + */ + scaleIndex?: number; + + /**returns the custom label style + */ + style?: string; + + /**returns the current custom label element. + */ + customLabelElement?: any; + + /**returns the index of the custom label. + */ + customLabelIndex?: number; + + /**returns the name of the event + */ + type?: string; +} + +export interface DrawIndicatorsEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the indicator + */ + position?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the indicator belongs. + */ + scaleIndex?: number; + + /**returns the indicator style + */ + style?: string; + + /**returns the current indicator element. + */ + indicatorElement?: any; + + /**returns the index of the indicator. + */ + indicatorIndex?: number; + + /**returns the name of the event + */ + type?: string; +} + +export interface DrawLabelsEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the labels + */ + position?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the label belongs. + */ + scaleIndex?: number; + + /**returns the label style + */ + style?: string; + + /**returns the angle of the labels. + */ + angle?: number; + + /**returns the current label element. + */ + element?: any; + + /**returns the index of the label. + */ + index?: number; + + /**returns the value of the label. + */ + pointerValue?: number; + + /**returns the name of the event + */ + type?: string; +} + +export interface DrawPointerCapEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the startX and startY of the pointer cap. + */ + position?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the pointer cap style + */ + style?: string; + + /**returns the name of the event + */ + type?: string; +} + +export interface DrawPointersEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the pointer + */ + position?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the pointer style + */ + style?: string; + + /**returns the angle of the pointer. + */ + angle?: number; + + /**returns the current pointer element. + */ + element?: any; + + /**returns the index of the pointer. + */ + index?: number; + + /**returns the value of the pointer. + */ + value?: number; + + /**returns the name of the event + */ + type?: string; +} + +export interface DrawRangeEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the range + */ + position?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the range belongs. + */ + scaleIndex?: number; + + /**returns the range style + */ + style?: string; + + /**returns the current range element. + */ + rangeElement?: any; + + /**returns the index of the range. + */ + rangeIndex?: number; + + /**returns the name of the event + */ + type?: string; +} + +export interface DrawTicksEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the ticks + */ + position?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the tick belongs. + */ + scaleIndex?: number; + + /**returns the ticks style + */ + style?: string; + + /**returns the angle of the tick. + */ + angle?: number; + + /**returns the current tick element. + */ + element?: any; + + /**returns the index of the tick. + */ + index?: number; + + /**returns the label value of the tick. + */ + pointerValue?: number; + + /**returns the name of the event + */ + type?: string; +} + +export interface LoadEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + Model?: any; + + /**returns the entire scale element. + */ + scaleElement?: any; + + /**returns the context element + */ + context?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface MouseClickEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: any; + + /**returns the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the context element + */ + context?: any; + + /**returns the pointer Index + */ + index?: number; + + /**returns the pointer element. + */ + element?: any; + + /**returns the value of the pointer. + */ + value?: number; + + /**returns the angle of the pointer. + */ + angle?: number; + + /**returns the pointer style + */ + style?: string; + + /**returns the startX and startY of the pointer. + */ + position?: any; +} + +export interface MouseClickMoveEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: any; + + /**returns the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the context element + */ + context?: any; + + /**returns the pointer Index + */ + index?: number; + + /**returns the pointer element. + */ + element?: any; + + /**returns the value of the pointer. + */ + value?: number; + + /**returns the angle of the pointer. + */ + angle?: number; + + /**returns the pointer style + */ + style?: string; + + /**returns the startX and startY of the pointer. + */ + position?: any; +} + +export interface MouseClickUpEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: any; + + /**returns the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the context element + */ + context?: any; + + /**returns the pointer Index + */ + index?: number; + + /**returns the pointer element. + */ + element?: any; + + /**returns the value of the pointer. + */ + value?: number; + + /**returns the angle of the pointer. + */ + angle?: number; + + /**returns the pointer style + */ + style?: string; + + /**returns the startX and startY of the pointer. + */ + position?: any; +} + +export interface RenderCompleteEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the entire scale element. + */ + scaleElement?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface Frame { + + /**Specify the url of the frame background image for circular gauge + * @Default {null} + */ + backgroundImageUrl?: string; + + /**Specifies the frameType of circular gauge. See Frame + * @Default {FullCircle} + */ + frameType?: ej.datavisualization.CircularGauge.FrameType|string; + + /**Specifies the end angle for the half circular frame. + * @Default {360} + */ + halfCircleFrameEndAngle?: number; + + /**Specifies the start angle for the half circular frame. + * @Default {180} + */ + halfCircleFrameStartAngle?: number; +} + +export interface ScalesBorder { + + /**Specify border color for scales of circular gauge + * @Default {null} + */ + color?: string; + + /**Specify border width of circular gauge + * @Default {1.5} + */ + width?: number; +} + +export interface ScalesIndicatorsPosition { + + /**Specify x-axis of position of circular gauge + * @Default {0} + */ + x?: number; + + /**Specify y-axis of position of circular gauge + * @Default {0} + */ + y?: number; +} + +export interface ScalesIndicatorsStateRanges { + + /**Specify backgroundColor for indicator of circular gauge + * @Default {null} + */ + backgroundColor?: string; + + /**Specify borderColor for indicator of circular gauge + * @Default {null} + */ + borderColor?: string; + + /**Specify end value for each specified state of circular gauge + * @Default {0} + */ + endValue?: number; + + /**Specify value of the font as the indicator when the indicator style is set with the value "text" of circular gauge + * @Default {null} + */ + font?: any; + + /**Specify start value for each specified state of circular gauge + * @Default {0} + */ + startValue?: number; + + /**Specify value of the text as the indicator when the indicator style is set with the value "text" of circular gauge + */ + text?: string; + + /**Specify value of the textColor as the indicator when the indicator style is set with the value "text" of circular gauge + * @Default {null} + */ + textColor?: string; +} + +export interface ScalesIndicators { + + /**Specify indicator height of circular gauge + * @Default {15} + */ + height?: number; + + /**Specify imageUrl of circular gauge + * @Default {null} + */ + imageUrl?: string; + + /**Specify position of circular gauge + * @Default {Object} + */ + position?: ScalesIndicatorsPosition; + + /**Specify the various states of circular gauge + * @Default {Array} + */ + stateRanges?: Array; + + /**Specify indicator style of circular gauge. See IndicatorType + * @Default {Circle} + */ + type?: ej.datavisualization.CircularGauge.IndicatorTypes|string; + + /**Specify indicator width of circular gauge + * @Default {15} + */ + width?: number; +} + +export interface ScalesLabelsFont { + + /**Specify font fontFamily for labels of circular gauge + * @Default {Arial} + */ + fontFamily?: string; + + /**Specify font Style for labels of circular gauge + * @Default {Bold} + */ + fontStyle?: string; + + /**Specify font size for labels of circular gauge + * @Default {11px} + */ + size?: string; +} + +export interface ScalesLabels { + + /**Specify the angle for the labels of circular gauge + * @Default {0} + */ + angle?: number; + + /**Specify labels autoAngle value of circular gauge + * @Default {false} + */ + autoAngle?: boolean; + + /**Specify label color of circular gauge + * @Default {null} + */ + color?: string; + + /**Specify distanceFromScale value for labels of circular gauge + * @Default {0} + */ + distanceFromScale?: number; + + /**Specify font for labels of circular gauge + * @Default {Object} + */ + font?: ScalesLabelsFont; + + /**Specify includeFirstValue of circular gauge + * @Default {true} + */ + includeFirstValue?: boolean; + + /**Specify opacity value for labels of circular gauge + * @Default {null} + */ + opacity?: number; + + /**Specify label placement of circular gauge. See LabelPlacement + * @Default {Near} + */ + placement?: ej.datavisualization.CircularGauge.Placement|string; + + /**Specify label Style of circular gauge. See LabelType + * @Default {Major} + */ + type?: ej.datavisualization.CircularGauge.LabelType|string; + + /**Specify unitText of circular gauge + */ + unitText?: string; + + /**Specify unitTextPosition of circular gauge. See UnitTextPosition + * @Default {Back} + */ + unitTextPosition?: ej.datavisualization.CircularGauge.UnitTextPlacement|string; +} + +export interface ScalesPointerCap { + + /**Specify cap backgroundColor of circular gauge + * @Default {null} + */ + backgroundColor?: string; + + /**Specify cap borderColor of circular gauge + * @Default {null} + */ + borderColor?: string; + + /**Specify pointerCap borderWidth value of circular gauge + * @Default {3} + */ + borderWidth?: number; + + /**Specify cap interiorGradient value of circular gauge + * @Default {null} + */ + interiorGradient?: any; + + /**Specify pointerCap Radius value of circular gauge + * @Default {7} + */ + radius?: number; +} + +export interface ScalesPointersBorder { + + /**Specify border color for pointer of circular gauge + * @Default {null} + */ + color?: string; + + /**Specify border width for pointers of circular gauge + * @Default {1.5} + */ + width?: number; +} + +export interface ScalesPointersPointerValueTextFont { + + /**Specify pointer value text font family of circular gauge. + * @Default {Arial} + */ + fontFamily?: string; + + /**Specify pointer value text font style of circular gauge. + * @Default {Bold} + */ + fontStyle?: string; + + /**Specify pointer value text size of circular gauge. + * @Default {11px} + */ + size?: string; +} + +export interface ScalesPointersPointerValueText { + + /**Specify pointer text angle of circular gauge. + * @Default {0} + */ + angle?: number; + + /**Specify pointer text auto angle of circular gauge. + * @Default {false} + */ + autoAngle?: boolean; + + /**Specify pointer value text color of circular gauge. + * @Default {#8c8c8c} + */ + color?: string; + + /**Specify pointer value text distance from pointer of circular gauge. + * @Default {20} + */ + distance?: number; + + /**Specify pointer value text font option of circular gauge. + * @Default {object} + */ + font?: ScalesPointersPointerValueTextFont; + + /**Specify pointer value text opacity of circular gauge. + * @Default {1} + */ + opacity?: number; + + /**enable pointer value text visibility of circular gauge. + * @Default {false} + */ + showValue?: boolean; +} + +export interface ScalesPointers { + + /**Specify backgroundColor for the pointer of circular gauge + * @Default {null} + */ + backgroundColor?: string; + + /**Specify backNeedleLength of circular gauge + * @Default {10} + */ + backNeedleLength?: number; + + /**Specify the border for pointers of circular gauge + * @Default {Object} + */ + border?: ScalesPointersBorder; + + /**Specify distanceFromScale value for pointers of circular gauge + * @Default {0} + */ + distanceFromScale?: number; + + /**Specify pointer gradients of circular gauge + * @Default {null} + */ + gradients?: any; + + /**Specify pointer image of circular gauge.It is applicable for both marker as well as needle type pointers. + * @Default {NULL} + */ + imageUrl?: string; + + /**Specify pointer length of circular gauge + * @Default {150} + */ + length?: number; + + /**Specify marker Style value of circular gauge. See MarkerType + * @Default {Rectangle} + */ + markerType?: ej.datavisualization.CircularGauge.MarkerType|string; + + /**Specify needle Style value of circular gauge. See NeedleType + * @Default {Triangle} + */ + needleType?: ej.datavisualization.CircularGauge.NeedleType|string; + + /**Specify opacity value for pointer of circular gauge + * @Default {1} + */ + opacity?: number; + + /**Specify pointer Placement value of circular gauge. See PointerPlacement + * @Default {Near} + */ + placement?: ej.datavisualization.CircularGauge.Placement|string; + + /**Specify pointer value text of circular gauge. + * @Default {Object} + */ + pointerValueText?: ScalesPointersPointerValueText; + + /**Specify showBackNeedle value of circular gauge + * @Default {false} + */ + showBackNeedle?: boolean; + + /**Specify pointer type value of circular gauge. See PointerType + * @Default {Needle} + */ + type?: ej.datavisualization.CircularGauge.PointerType|string; + + /**Specify value of the pointer of circular gauge + * @Default {null} + */ + value?: number; + + /**Specify pointer width of circular gauge + * @Default {7} + */ + width?: number; +} + +export interface ScalesRangesBorder { + + /**Specify border color for ranges of circular gauge + * @Default {#32b3c6} + */ + color?: string; + + /**Specify border width for ranges of circular gauge + * @Default {1.5} + */ + width?: number; +} + +export interface ScalesRanges { + + /**Specify backgroundColor for the ranges of circular gauge + * @Default {#32b3c6} + */ + backgroundColor?: string; + + /**Specify border for ranges of circular gauge + * @Default {Object} + */ + border?: ScalesRangesBorder; + + /**Specify distanceFromScale value for ranges of circular gauge + * @Default {25} + */ + distanceFromScale?: number; + + /**Specify endValue for ranges of circular gauge + * @Default {null} + */ + endValue?: number; + + /**Specify endWidth for ranges of circular gauge + * @Default {10} + */ + endWidth?: number; + + /**Specify range gradients of circular gauge + * @Default {null} + */ + gradients?: any; + + /**Specify opacity value for ranges of circular gauge + * @Default {null} + */ + opacity?: number; + + /**Specify placement of circular gauge. See RangePlacement + * @Default {Near} + */ + placement?: ej.datavisualization.CircularGauge.Placement|string; + + /**Specify size of the range value of circular gauge + * @Default {5} + */ + size?: number; + + /**Specify startValue for ranges of circular gauge + * @Default {null} + */ + startValue?: number; + + /**Specify startWidth of circular gauge + * @Default {[Array.number] scale.ranges.startWidth = 10} + */ + startWidth?: number; +} + +export interface ScalesSubGaugesPosition { + + /**Specify x-axis position for sub-gauge of circular gauge + * @Default {0} + */ + x?: number; + + /**Specify y-axis position for sub-gauge of circular gauge + * @Default {0} + */ + y?: number; +} + +export interface ScalesSubGauges { + + /**Specify subGauge Height of circular gauge + * @Default {150} + */ + height?: number; + + /**Specify position for sub-gauge of circular gauge + * @Default {Object} + */ + position?: ScalesSubGaugesPosition; + + /**Specify subGauge Width of circular gauge + * @Default {150} + */ + width?: number; +} + +export interface ScalesTicks { + + /**Specify the angle for the ticks of circular gauge + * @Default {0} + */ + angle?: number; + + /**Specify tick color of circular gauge + * @Default {null} + */ + color?: string; + + /**Specify distanceFromScale value for ticks of circular gauge + * @Default {0} + */ + distanceFromScale?: number; + + /**Specify tick height of circular gauge + * @Default {16} + */ + height?: number; + + /**Specify tick placement of circular gauge. See TickPlacement + * @Default {Near} + */ + placement?: ej.datavisualization.CircularGauge.Placement|string; + + /**Specify tick Style of circular gauge. See TickType + * @Default {Major} + */ + type?: ej.datavisualization.CircularGauge.LabelType|string; + + /**Specify tick width of circular gauge + * @Default {3} + */ + width?: number; +} + +export interface Scales { + + /**Specify backgroundColor for the scale of circular gauge + * @Default {null} + */ + backgroundColor?: string; + + /**Specify border for scales of circular gauge + * @Default {Object} + */ + border?: ScalesBorder; + + /**Specify scale direction of circular gauge. See Directions + * @Default {Clockwise} + */ + direction?: ej.datavisualization.CircularGauge.Direction|string; + + /**Specify representing state of circular gauge + * @Default {Array} + */ + indicators?: Array; + + /**Specify the text values displayed in a meaningful manner alongside the ticks of circular gauge + * @Default {Array} + */ + labels?: Array; + + /**Specify majorIntervalValue of circular gauge + * @Default {10} + */ + majorIntervalValue?: number; + + /**Specify maximum scale value of circular gauge + * @Default {null} + */ + maximum?: number; + + /**Specify minimum scale value of circular gauge + * @Default {null} + */ + minimum?: number; + + /**Specify minorIntervalValue of circular gauge + * @Default {2} + */ + minorIntervalValue?: number; + + /**Specify opacity value of circular gauge + * @Default {1} + */ + opacity?: number; + + /**Specify pointer cap of circular gauge + * @Default {Object} + */ + pointerCap?: ScalesPointerCap; + + /**Specify pointers value of circular gauge + * @Default {Array} + */ + pointers?: Array; + + /**Specify scale radius of circular gauge + * @Default {170} + */ + radius?: number; + + /**Specify ranges value of circular gauge + * @Default {Array} + */ + ranges?: Array; + + /**Specify shadowOffset value of circular gauge + * @Default {0} + */ + shadowOffset?: number; + + /**Specify showIndicators of circular gauge + * @Default {false} + */ + showIndicators?: boolean; + + /**Specify showLabels of circular gauge + * @Default {true} + */ + showLabels?: boolean; + + /**Specify showPointers of circular gauge + * @Default {true} + */ + showPointers?: boolean; + + /**Specify showRanges of circular gauge + * @Default {false} + */ + showRanges?: boolean; + + /**Specify showScaleBar of circular gauge + * @Default {false} + */ + showScaleBar?: boolean; + + /**Specify showTicks of circular gauge + * @Default {true} + */ + showTicks?: boolean; + + /**Specify scaleBar size of circular gauge + * @Default {6} + */ + size?: number; + + /**Specify startAngle of circular gauge + * @Default {115} + */ + startAngle?: number; + + /**Specify subGauge of circular gauge + * @Default {Array} + */ + subGauges?: Array; + + /**Specify sweepAngle of circular gauge + * @Default {310} + */ + sweepAngle?: number; + + /**Specify ticks of circular gauge + * @Default {Array} + */ + ticks?: Array; +} + +export interface Tooltip { + + /**enable showCustomLabelTooltip of circular gauge + * @Default {false} + */ + showCustomLabelTooltip?: boolean; + + /**enable showLabelTooltip of circular gauge + * @Default {false} + */ + showLabelTooltip?: boolean; + + /**Specify tooltip templateID of circular gauge + * @Default {false} + */ + templateID?: string; +} +} +module CircularGauge +{ +enum FrameType +{ +//string +FullCircle, +//string +HalfCircle, +} +} +module CircularGauge +{ +enum gaugePosition +{ +//string +TopLeft, +//string +TopRight, +//string +TopCenter, +//string +MiddleLeft, +//string +MiddleRight, +//string +Center, +//string +BottomLeft, +//string +BottomRight, +//string +BottomCenter, +} +} +module CircularGauge +{ +enum CustomLabelPositionType +{ +//string +Top, +//string +Bottom, +//string +Right, +//string +Left, +} +} +module CircularGauge +{ +enum Direction +{ +//string +Clockwise, +//string +CounterClockwise, +} +} +module CircularGauge +{ +enum IndicatorTypes +{ +//string +Rectangle, +//string +Circle, +//string +Text, +//string +RoundedRectangle, +//string +Image, +} +} +module CircularGauge +{ +enum Placement +{ +//string +Near, +//string +Far, +} +} +module CircularGauge +{ +enum LabelType +{ +//string +Major, +//string +Minor, +} +} +module CircularGauge +{ +enum UnitTextPlacement +{ +//string +Back, +//string +Front, +} +} +module CircularGauge +{ +enum MarkerType +{ +//string +Rectangle, +//string +Circle, +//string +Triangle, +//string +Ellipse, +//string +Diamond, +//string +Pentagon, +//string +Slider, +//string +Pointer, +//string +Wedge, +//string +Trapezoid, +//string +RoundedRectangle, +//string +Image, +} +} +module CircularGauge +{ +enum NeedleType +{ +//string +Triangle, +//string +Rectangle, +//string +Arrow, +//string +Image, +//string +Trapezoid, +} +} +module CircularGauge +{ +enum PointerType +{ +//string +Needle, +//string +Marker, +} +} + +class DigitalGauge extends ej.Widget { + static fn: DigitalGauge; + constructor(element: JQuery, options?: DigitalGauge.Model); + constructor(element: Element, options?: DigitalGauge.Model); + model:DigitalGauge.Model; + defaults:DigitalGauge.Model; + + /** To destroy the digital gauge + * @returns {void} + */ + destroy(): void; + + /** To export Digital Gauge as Image + * @param {string} fileName for the Image + * @param {string} fileType for the Image + * @returns {void} + */ + exportImage(fileName: string, fileType: string): void; + + /** Gets the location of an item that is displayed on the gauge. + * @param {number} Position value of an item that is displayed on the gauge. + * @returns {void} + */ + getPosition(itemIndex: number): void; + + /** ClientSideMethod getValue Gets the value of an item that is displayed on the gauge + * @param {number} Index value of an item that displayed on the gauge + * @returns {void} + */ + getValue(itemIndex: number): void; + + /** Refresh the digital gauge widget + * @returns {void} + */ + refresh(): void; + + /** ClientSideMethod Set Position Sets the location of an item to be displayed in the gauge + * @param {number} Index value of the digital gauge item + * @param {any} Location value of the digital gauge + * @returns {void} + */ + setPosition(itemIndex: number, value: any): void; + + /** ClientSideMethod SetValue Sets the value of an item to be displayed in the gauge. + * @param {number} Index value of the digital gauge item + * @param {string} Text value to be displayed in the gaugeS + * @returns {void} + */ + setValue(itemIndex: number, value: string): void; +} +export module DigitalGauge{ + +export interface Model { + + /**Specifies the resize option of the DigitalGauge. + * @Default {false} + */ + enableResize?: boolean; + + /**Specifies the frame of the Digital gauge. + * @Default {{backgroundImageUrl: null, innerWidth: 6, outerWidth: 10}} + */ + frame?: Frame; + + /**Specifies the height of the DigitalGauge. + * @Default {150} + */ + height?: number; + + /**Specifies the items for the DigitalGauge. + * @Default {null} + */ + items?: Items; + + /**Specifies the matrixSegmentData for the DigitalGauge. + */ + matrixSegmentData?: any; + + /**Specifies the segmentData for the DigitalGauge. + */ + segmentData?: any; + + /**Specifies the themes for the Digital gauge. See Themes + * @Default {flatlight} + */ + themes?: string; + + /**Specifies the value to the DigitalGauge. + * @Default {text} + */ + value?: string; + + /**Specifies the width for the Digital gauge. + * @Default {400} + */ + width?: number; + + /**Triggers when the gauge is initialized.*/ + init? (e: InitEventArgs): void; + + /**Triggers when the gauge item rendering.*/ + itemRendering? (e: ItemRenderingEventArgs): void; + + /**Triggers when the gauge is start to load.*/ + load? (e: LoadEventArgs): void; + + /**Triggers when the gauge render is completed.*/ + renderComplete? (e: RenderCompleteEventArgs): void; +} + +export interface InitEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the all the options of the items. + */ + items?: any; + + /**returns the context element + */ + context?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface ItemRenderingEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the all the options of the items. + */ + items?: any; + + /**returns the context element + */ + context?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface LoadEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the all the options of the items. + */ + items?: any; + + /**returns the context element + */ + context?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface RenderCompleteEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the all the options of the items. + */ + items?: any; + + /**returns the context element + */ + context?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface Frame { + + /**Specifies the url of an image to be displayed as background of the Digital gauge. + * @Default {null} + */ + backgroundImageUrl?: string; + + /**Specifies the inner width for the frame, when the background image has been set for the Digital gauge.. + * @Default {6} + */ + innerWidth?: number; + + /**Specifies the outer width of the frame, when the background image has been set for the Digital gauge. + * @Default {10} + */ + outerWidth?: number; +} + +export interface ItemsCharacterSettings { + + /**Specifies the CharacterCount value for the DigitalGauge. + * @Default {4} + */ + count?: number; + + /**Specifies the opacity value for the DigitalGauge. + * @Default {1} + */ + opacity?: number; + + /**Specifies the value for spacing between the characters + * @Default {2} + */ + spacing?: number; + + /**Specifies the character type for the text to be displayed. + * @Default {ej.datavisualization.DigitalGauge.CharacterType.EightCrossEightDotMatrix} + */ + type?: ej.datavisualization.DigitalGauge.CharacterType|string; +} + +export interface ItemsFont { + + /**Set the font family value + * @Default {Arial} + */ + fontFamily?: string; + + /**Set the font style for the font + * @Default {italic} + */ + fontStyle?: ej.datavisualization.DigitalGauge.FontStyle|string; + + /**Set the font size value + * @Default {11px} + */ + size?: string; +} + +export interface ItemsPosition { + + /**Set the horizontal location for the text, where it needs to be placed within the gauge. + * @Default {0} + */ + x?: number; + + /**Set the vertical location for the text, where it needs to be placed within the gauge. + * @Default {0} + */ + y?: number; +} + +export interface ItemsSegmentSettings { + + /**Set the color for the text segments. + * @Default {null} + */ + color?: string; + + /**Set the gradient for the text segments. + * @Default {null} + */ + gradient?: any; + + /**Set the length for the text segments. + * @Default {2} + */ + length?: number; + + /**Set the opacity for the text segments. + * @Default {0} + */ + opacity?: number; + + /**Set the spacing for the text segments. + * @Default {1} + */ + spacing?: number; + + /**Set the width for the text segments. + * @Default {1} + */ + width?: number; +} + +export interface Items { + + /**Specifies the Character settings for the DigitalGauge. + * @Default {null} + */ + characterSettings?: ItemsCharacterSettings; + + /**Enable/Disable the custom font to be applied to the text in the gauge. + * @Default {false} + */ + enableCustomFont?: boolean; + + /**Set the specific font for the text, when the enableCustomFont is set to true + * @Default {null} + */ + font?: ItemsFont; + + /**Set the location for the text, where it needs to be placed within the gauge. + * @Default {null} + */ + position?: ItemsPosition; + + /**Set the segment settings for the digital gauge. + * @Default {null} + */ + segmentSettings?: ItemsSegmentSettings; + + /**Set the value for enabling/disabling the blurring effect for the shadows of the text + * @Default {0} + */ + shadowBlur?: number; + + /**Specifies the color of the text shadow. + * @Default {null} + */ + shadowColor?: string; + + /**Set the x offset value for the shadow of the text, indicating the location where it needs to be displayed. + * @Default {1} + */ + shadowOffsetX?: number; + + /**Set the y offset value for the shadow of the text, indicating the location where it needs to be displayed. + * @Default {1} + */ + shadowOffsetY?: number; + + /**Set the alignment of the text that is displayed within the gauge.See TextAlign + * @Default {left} + */ + textAlign?: string; + + /**Specifies the color of the text. + * @Default {null} + */ + textColor?: string; + + /**Specifies the text value. + * @Default {null} + */ + value?: string; +} +} +module DigitalGauge +{ +enum CharacterType +{ +//string +SevenSegment, +//string +FourteenSegment, +//string +SixteenSegment, +//string +EightCrossEightDotMatrix, +//string +EightCrossEightSquareMatrix, +} +} +module DigitalGauge +{ +enum FontStyle +{ +//string +Normal, +//string +Bold, +//string +Italic, +//string +Underline, +//string +Strikeout, +} +} + +class Chart extends ej.Widget { + static fn: Chart; + constructor(element: JQuery, options?: Chart.Model); + constructor(element: Element, options?: Chart.Model); + model:Chart.Model; + defaults:Chart.Model; + + /** Animates the series and/or indicators in Chart. When parameter is not passed to this method, then all the series and indicators present in Chart are animated. + * @param {Array} Series and indicator objects passed in the array collection are animated.Example + * @param {any} Series or indicator object passed to this method are animated.Example, + * @returns {void} + */ + animate(options: Array, option: any): void; + + /** Exports chart as an image or to an excel file. Chart can be exported as an image only when exportCanvasRendering option is set to true. + * @param {string} Type of the export operation to be performed. Following are the two export types that are supported now,1. 'image'2. 'excel'Example + * @param {string} URL of the service, where the chart will be exported to excel.Example, + * @param {boolean} When this parameter is true, all the chart objects initialized to the same document are exported to a single excel file. This is an optional parameter. By default, it is false.Example, + * @returns {void} + */ + export(type: string, url: string, exportMultipleChart: boolean): void; + + /** Redraws the entire chart. You can call this method whenever you update, add or remove points from the data source or whenever you want to refresh the UI. + * @returns {void} + */ + redraw(): void; +} +export module Chart{ + +export interface Model { + + /**Options for adding and customizing annotations in Chart. + */ + annotations?: Array; + + /**Url of the image to be used as chart background. + * @Default {null} + */ + backGroundImageUrl?: string; + + /**Options for customizing the color, opacity and width of the chart border. + */ + border?: Border; + + /**Controls whether Chart has to be responsive or not. + * @Default {false} + */ + canResize?: boolean; + + /**Options for configuring the border and background of the plot area. + */ + chartArea?: ChartArea; + + /**Options to split Chart into multiple plotting areas vertically. Each object in the collection represents a plotting area in Chart. + */ + columnDefinitions?: Array; + + /**Options for configuring the properties of all the series. You can also override the options for specific series by using series collection. + */ + commonSeriesOptions?: CommonSeriesOptions; + + /**Options for displaying and customizing the crosshair. + */ + crosshair?: Crosshair; + + /**Depth of the 3D Chart from front view of series to background wall. This property is applicable only for 3D view. + * @Default {100} + */ + depth?: number; + + /**Controls whether 3D view has to be enabled or not. 3D view is supported only for column, bar. Stacking column, stacking bar, pie and doughnut series types. + * @Default {false} + */ + enable3D?: boolean; + + /**Controls whether Chart has to be rendered as Canvas or SVG. Canvas rendering supports all functionalities in SVG rendering except 3D Charts. + * @Default {false} + */ + enableCanvasRendering?: boolean; + + /**Controls whether 3D view has to be rotated on dragging. This property is applicable only for 3D view. + * @Default {false} + */ + enableRotation?: boolean; + + /**Options to customize the technical indicators. + */ + indicators?: Array; + + /**Options to customize the legend items and legend title. + */ + legend?: Legend; + + /**Name of the culture based on which chart should be localized. Number and date time values are localized with respect to the culture name.String type properties like title text are not localized automatically. Provide localized text as value to string type properties. + * @Default {en-US} + */ + locale?: string; + + /**Palette is used to store the series fill color in array and apply the color to series collection in the order of series index. + * @Default {null} + */ + palette?: Array; + + /**Options to customize the left, right, top and bottom margins of chart area. + */ + Margin?: any; + + /**Perspective angle of the 3D view. Chart appears closer when perspective angle is decreased, and distant when perspective angle is increased.This property is applicable only when 3D view is enabled + * @Default {90} + */ + perspectiveAngle?: number; + + /**This is a horizontal axis that contains options to configure axis and it is the primary x axis for all the series in series array. To override x axis for particular series, create an axis object by providing unique name by using name property and add it to axes array. Then, assign the name to the series’s xAxisName property to link both axis and series. + */ + primaryXAxis?: PrimaryXAxis; + + /**This is a vertical axis that contains options to configure axis. This is the primary y axis for all the series in series array. To override y axis for particular series, create an axis object by providing unique name by using name property and add it to axes array. Then, assign the name to the series’s yAxisName property to link both axis and series. + */ + primaryYAxis?: PrimaryYAxis; + + /**Rotation angle of the 3D view. This property is applicable only when 3D view is enabled. + * @Default {0} + */ + rotation?: number; + + /**Options to split Chart into multiple plotting areas horizontally. Each object in the collection represents a plotting area in Chart. + */ + rowDefinitions?: Array; + + /**Specifies the properties used for customizing the series. + */ + series?: Array; + + /**Controls whether data points has to be displayed side by side or along the depth of the axis. + * @Default {false} + */ + sideBySideSeriesPlacement?: boolean; + + /**Options to customize the Chart size. + */ + size?: Size; + + /**Specifies the theme for Chart. + * @Default {Flatlight. See Theme} + */ + theme?: ej.datavisualization.Chart.Theme|string; + + /**Slope angle of 3D Chart. This property is applicable only when 3D view is enabled. + * @Default {0} + */ + tilt?: number; + + /**Options for customizing the title and subtitle of Chart. + */ + title?: Title; + + /**Width of the wall used in 3D Chart. Wall is present only in Cartesian type 3D series and not in 3D pie or Doughnut series. This property is applicable only when 3D view is enabled. + * @Default {2} + */ + wallSize?: number; + + /**Options for enabling zooming feature of chart. + */ + zooming?: Zooming; + + /**Fires after the series animation is completed. This event will be triggered for each series when animation is enabled.*/ + animationComplete? (e: AnimationCompleteEventArgs): void; + + /**Fires before rendering the labels. This event is fired for each label in axis. You can use this event to add custom text to axis labels.*/ + axesLabelRendering? (e: AxesLabelRenderingEventArgs): void; + + /**Fires during the initialization of axis labels.*/ + axesLabelsInitialize? (e: AxesLabelsInitializeEventArgs): void; + + /**Fires during axes range calculation. This event is fired for each axis present in Chart. You can use this event to customize axis range as required.*/ + axesRangeCalculate? (e: AxesRangeCalculateEventArgs): void; + + /**Fires before rendering the axis title. This event is triggered for each axis with title. You can use this event to add custom text to axis title.*/ + axesTitleRendering? (e: AxesTitleRenderingEventArgs): void; + + /**Fires during the calculation of chart area bounds. You can use this event to customize the bounds of chart area.*/ + chartAreaBoundsCalculate? (e: ChartAreaBoundsCalculateEventArgs): void; + + /**Fires after chart is created.*/ + create? (e: CreateEventArgs): void; + + /**Fires when chart is destroyed completely.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires before rendering the data labels. This event is triggered for each data label in the series. You can use this event to add custom text in data labels.*/ + displayTextRendering? (e: DisplayTextRenderingEventArgs): void; + + /**Fires during the calculation of legend bounds. You can use this event to customize the bounds of legend.*/ + legendBoundsCalculate? (e: LegendBoundsCalculateEventArgs): void; + + /**Fires on clicking the legend item.*/ + legendItemClick? (e: LegendItemClickEventArgs): void; + + /**Fires when moving mouse over legend item. You can use this event for hit testing on legend items.*/ + legendItemMouseMove? (e: LegendItemMouseMoveEventArgs): void; + + /**Fires before rendering the legend item. This event is fired for each legend item in Chart. You can use this event to customize legend item shape or add custom text to legend item.*/ + legendItemRendering? (e: LegendItemRenderingEventArgs): void; + + /**Fires before loading the chart.*/ + load? (e: LoadEventArgs): void; + + /**Fires on clicking a point in chart. You can use this event to handle clicks made on points.*/ + pointRegionClick? (e: PointRegionClickEventArgs): void; + + /**Fires when mouse is moved over a point.*/ + pointRegionMouseMove? (e: PointRegionMouseMoveEventArgs): void; + + /**Fires before rendering chart.*/ + preRender? (e: PreRenderEventArgs): void; + + /**Fires after selecting a series. This event is triggered after selecting a series only if selection mode is series.*/ + seriesRegionClick? (e: SeriesRegionClickEventArgs): void; + + /**Fires before rendering a series. This event is fired for each series in Chart.*/ + seriesRendering? (e: SeriesRenderingEventArgs): void; + + /**Fires before rendering the marker symbols. This event is triggered for each marker in Chart.*/ + symbolRendering? (e: SymbolRenderingEventArgs): void; + + /**Fires before rendering the Chart title. You can use this event to add custom text in Chart title.*/ + titleRendering? (e: TitleRenderingEventArgs): void; + + /**Fires before rendering the tooltip. This event is fired when tooltip is enabled and mouse is hovered on a Chart point. You can use this event to customize tooltip before rendering.*/ + toolTipInitialize? (e: ToolTipInitializeEventArgs): void; + + /**Fires before rendering crosshair tooltip in axis. This event is fired for each axis with crosshair label enabled. You can use this event to customize crosshair label before rendering*/ + trackAxisToolTip? (e: TrackAxisToolTipEventArgs): void; + + /**Fires before rendering trackball tooltip. This event is fired for each series in Chart because trackball tooltip is displayed for all the series. You can use this event to customize the text displayed in trackball tooltip.*/ + trackToolTip? (e: TrackToolTipEventArgs): void; + + /**Fires, on clicking the axis label.*/ + axisLabelClick? (e: AxisLabelClickEventArgs): void; + + /**Fires on moving mouse over the axis label.*/ + axisLabelMouseMove? (e: AxisLabelMouseMoveEventArgs): void; + + /**Fires, on the clicking the chart.*/ + chartClick? (e: ChartClickEventArgs): void; + + /**Fires on moving mouse over the chart.*/ + chartMouseMove? (e: ChartMouseMoveEventArgs): void; + + /**Fires, on double clicking the chart.*/ + chartDoubleClick? (e: ChartDoubleClickEventArgs): void; + + /**Fires on clicking the annotation.*/ + annotationClick? (e: AnnotationClickEventArgs): void; + + /**Fires, after the chart is resized.*/ + afterResize? (e: AfterResizeEventArgs): void; + + /**Fires, when chart size is changing.*/ + beforeResize? (e: BeforeResizeEventArgs): void; + + /**Fires, when error bar is rendering.*/ + errorBarRendering? (e: ErrorBarRenderingEventArgs): void; +} + +export interface AnimationCompleteEventArgs { + + /**Instance of the series that completed has animation. + */ + series?: any; + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface AxesLabelRenderingEventArgs { + + /**Instance of the corresponding axis. + */ + Axis?: any; + + /**Formatted text of the respective label. You can also add custom text to the label. + */ + LabelText?: string; + + /**Actual value of the label. + */ + LabelValue?: string; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the chart model object. + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface AxesLabelsInitializeEventArgs { + + /**Collection of axes in Chart + */ + dataAxes?: any; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the chart model object. + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface AxesRangeCalculateEventArgs { + + /**Difference between minimum and maximum value of axis range. + */ + delta?: number; + + /**Interval value of axis range. Grid lines, tick lines and axis labels are drawn based on this interval value. + */ + interval?: number; + + /**Maximum value of axis range. + */ + max?: number; + + /**Minimum value of axis range. + */ + min?: number; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the chart model object. + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface AxesTitleRenderingEventArgs { + + /**Instance of the axis whose title is being rendered + */ + axes?: any; + + /**X-coordinate of title location + */ + locationX?: number; + + /**Y-coordinate of title location + */ + locationY?: number; + + /**Axis title text. You can add custom text to the title. + */ + title?: string; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the chart model object. + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface ChartAreaBoundsCalculateEventArgs { + + /**Height of the chart area. + */ + areaBoundsHeight?: number; + + /**Width of the chart area. + */ + areaBoundsWidth?: number; + + /**X-coordinate of the chart area. + */ + areaBoundsX?: number; + + /**Y-coordinate of the chart area. + */ + areaBoundsY?: number; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the chart model object. + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface CreateEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the chart model object. + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the chart model object. + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface DisplayTextRenderingEventArgs { + + /**Text displayed in data label. You can add custom text to the data label + */ + text?: string; + + /**X-coordinate of data label location + */ + locationX?: number; + + /**Y-coordinate of data label location + */ + locationY?: number; + + /**Index of the series in series Collection whose data label is being rendered + */ + seriesIndex?: number; + + /**Index of the point in series whose data label is being rendered + */ + pointIndex?: number; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the chart model object. + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface LegendBoundsCalculateEventArgs { + + /**Height of the legend. + */ + legendBoundsHeight?: number; + + /**Width of the legend. + */ + legendBoundsWidth?: number; + + /**Number of rows to display the legend items + */ + legendBoundsRows?: number; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the chart model object. + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface LegendItemClickEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X-coordinate of legend item in pixel + */ + startX?: number; + + /**Y-coordinate of legend item in pixel + */ + startY?: number; + + /**Instance of the legend item object that is about to be rendered + */ + LegendItem?: any; + + /**Options to customize the legend item styles such as border, color, size, etc…, + */ + style?: any; + + /**Instance that holds information about legend bounds and legend item bounds. + */ + Bounds?: any; + + /**Name of the legend item shape. Use this option to customize legend item shape before rendering + */ + symbolShape?: string; + + /**Instance of the series object corresponding to the legend item + */ + series?: any; +} + +export interface LegendItemMouseMoveEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X-coordinate of legend item in pixel + */ + startX?: number; + + /**Y-coordinate of legend item in pixel + */ + startY?: number; + + /**Instance of the legend item object that is about to be rendered + */ + LegendItem?: any; + + /**Options to customize the legend item styles such as border, color, size, etc…, + */ + style?: any; + + /**Options to customize the legend item styles such as border, color, size, etc…, + */ + Bounds?: any; + + /**Name of the legend item shape. Use this option to customize legend item shape before rendering + */ + symbolShape?: string; + + /**Instance of the series object corresponding to the legend item + */ + series?: any; +} + +export interface LegendItemRenderingEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X-coordinate of legend item in pixel + */ + startX?: number; + + /**Y-coordinate of legend item in pixel + */ + startY?: number; + + /**Instance of the legend item object that is about to be rendered + */ + legendItem?: any; + + /**Options to customize the legend item styles such as border, color, size, etc. + */ + style?: any; + + /**Name of the legend item shape. Use this option to customize legend item shape before rendering + */ + symbolShape?: string; +} + +export interface LoadEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface PointRegionClickEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X-coordinate of point in pixel + */ + locationX?: number; + + /**Y-coordinate of point in pixel + */ + locationY?: number; + + /**Index of the point in series + */ + pointIndex?: number; + + /**Index of the series in series collection to which the point belongs + */ + seriesIndex?: number; +} + +export interface PointRegionMouseMoveEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X-coordinate of point in pixel + */ + locationX?: number; + + /**Y-coordinate of point in pixel + */ + locationY?: number; + + /**Index of the point in series + */ + pointIndex?: number; + + /**Index of the series in series collection to which the point belongs + */ + seriesIndex?: number; +} + +export interface PreRenderEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface SeriesRegionClickEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Instance of the selected series + */ + series?: any; + + /**Index of the selected series + */ + seriesIndex?: number; +} + +export interface SeriesRenderingEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Instance of the series which is about to get rendered + */ + series?: any; +} + +export interface SymbolRenderingEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Instance that holds the location of marker symbol + */ + location?: any; + + /**Options to customize the marker style such as color, border and size + */ + style?: any; +} + +export interface TitleRenderingEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Option to customize the title location in pixels + */ + location?: any; + + /**Read-only option to find the size of the title + */ + size?: any; + + /**Use this option to add custom text in title + */ + title?: string; +} + +export interface ToolTipInitializeEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Text to be displayed in tooltip. Set this option to customize the text displayed in tooltip + */ + currentText?: string; + + /**Index of the point on which mouse is hovered + */ + pointIndex?: number; + + /**Index of the series in series collection whose point is hovered by mouse + */ + seriesIndex?: number; +} + +export interface TrackAxisToolTipEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Location of the crosshair label in pixels + */ + location?: any; + + /**Index of the axis for which crosshair label is displayed + */ + axisIndex?: number; + + /**Instance of the chart axis object for which cross hair label is displayed + */ + crossAxis?: number; + + /**Text to be displayed in crosshair label. Use this option to add custom text in crosshair label + */ + currentTrackText?: string; +} + +export interface TrackToolTipEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Location of the trackball tooltip in pixels + */ + location?: any; + + /**Index of the point for which trackball tooltip is displayed + */ + pointIndex?: number; + + /**Index of the series in series collection + */ + seriesIndex?: number; + + /**Text to be displayed in trackball tooltip. Use this option to add custom text in trackball tooltip + */ + currentText?: string; + + /**Instance of the series object for which trackball tooltip is displayed. + */ + series?: any; +} + +export interface AxisLabelClickEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X and Y co-ordinate of the labels in chart area. + */ + location?: any; + + /**Index of the label. + */ + index?: number; + + /**Instance of the corresponding axis. + */ + axis?: any; + + /**Label that is clicked. + */ + text?: string; +} + +export interface AxisLabelMouseMoveEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X and Y co-ordinate of the labels in chart area. + */ + location?: any; + + /**Index of the label. + */ + index?: number; + + /**Instance of the corresponding axis. + */ + axis?: any; + + /**Label that is hovered. + */ + text?: string; +} + +export interface ChartClickEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X and Y co-ordinate of the points with respect to chart area. + */ + location?: any; + + /**ID of the target element. + */ + id?: string; + + /**Width and height of the chart. + */ + size?: any; + + /**x-coordinate of the pointer, relative to the page + */ + pageX?: number; + + /**y-coordinate of the pointer, relative to the page + */ + pageY?: number; +} + +export interface ChartMouseMoveEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X and Y co-ordinate of the points with respect to chart area. + */ + location?: any; + + /**ID of the target element. + */ + id?: string; + + /**Width and height of the chart. + */ + size?: any; + + /**x-coordinate of the pointer, relative to the page + */ + pageX?: number; + + /**y-coordinate of the pointer, relative to the page + */ + pageY?: number; +} + +export interface ChartDoubleClickEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X and Y co-ordinate of the points with respect to chart area. + */ + location?: any; + + /**ID of the target element. + */ + id?: string; + + /**Width and height of the chart. + */ + size?: any; + + /**x-coordinate of the pointer, relative to the page + */ + pageX?: number; + + /**y-coordinate of the pointer, relative to the page + */ + pageY?: number; +} + +export interface AnnotationClickEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X and Y co-ordinate of the annotation in chart area. + */ + location?: any; + + /**Information about the annotation, like Coordinate unit, Region, content + */ + contentData?: any; + + /**x-coordinate of the pointer, relative to the page + */ + pageX?: number; + + /**y-coordinate of the pointer, relative to the page + */ + pageY?: number; +} + +export interface AfterResizeEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Chart width, after resize + */ + width?: number; + + /**Chart height, after resize + */ + height?: number; + + /**Chart width, before resize + */ + prevWidth?: number; + + /**Chart height, before resize + */ + prevHeight?: number; + + /**Chart width, when the chart was first rendered + */ + originalWidth?: number; + + /**Chart height, when the chart was first rendered + */ + originalHeight?: number; +} + +export interface BeforeResizeEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Chart width, before resize + */ + currentWidth?: number; + + /**Chart height, before resize + */ + currentHeight?: number; + + /**Chart width, after resize + */ + newWidth?: number; + + /**Chart height, after resize + */ + newHeight?: number; +} + +export interface ErrorBarRenderingEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Error bar Object + */ + errorbar?: any; +} + +export interface AnnotationsMargin { + + /**Annotation is placed at the specified value above its original position. + * @Default {0} + */ + bottom?: number; + + /**Annotation is placed at the specified value from left side of its original position. + * @Default {0} + */ + left?: number; + + /**Annotation is placed at the specified value from the right side of its original position. + * @Default {0} + */ + right?: number; + + /**Annotation is placed at the specified value under its original position. + * @Default {0} + */ + top?: number; +} + +export interface Annotations { + + /**Angle to rotate the annotation in degrees. + * @Default {'0'} + */ + angle?: number; + + /**Text content or id of a HTML element to be displayed as annotation. + */ + content?: string; + + /**Specifies how annotations have to be placed in Chart. + * @Default {none. See CoordinateUnit} + */ + coordinateUnit?: ej.datavisualization.Chart.CoordinateUnit|string; + + /**Specifies the horizontal alignment of the annotation. + * @Default {middle. See HorizontalAlignment} + */ + horizontalAlignment?: ej.datavisualization.Chart.HorizontalAlignment|string; + + /**Options to customize the margin of annotation. + */ + margin?: AnnotationsMargin; + + /**Controls the opacity of the annotation. + * @Default {1} + */ + opacity?: number; + + /**Specifies whether annotation has to be placed with respect to chart or series. + * @Default {chart. See Region} + */ + region?: ej.datavisualization.Chart.Region|string; + + /**Specifies the vertical alignment of the annotation. + * @Default {middle. See VerticalAlignment} + */ + verticalAlignment?: ej.datavisualization.Chart.VerticalAlignment|string; + + /**Controls the visibility of the annotation. + * @Default {false} + */ + visible?: boolean; + + /**Represents the horizontal offset when coordinateUnit is pixels.when coordinateUnit is points, it represents the x-coordinate of axis bounded with xAxisName property or primary X axis when xAxisName is not provided.This property is not applicable when coordinateUnit is none. + * @Default {0} + */ + x?: number; + + /**Name of the horizontal axis to be used for positioning the annotation. This property is applicable only when coordinateUnit is points. + */ + xAxisName?: string; + + /**Represents the vertical offset when coordinateUnit is pixels.When coordinateUnit is points, it represents the y-coordinate of axis bounded with yAxisName property or primary Y axis when yAxisName is not provided.This property is not applicable when coordinateUnit is none. + * @Default {0} + */ + y?: number; + + /**Name of the vertical axis to be used for positioning the annotation.This property is applicable only when coordinateUnit is points. + */ + yAxisName?: string; +} + +export interface Border { + + /**Border color of the chart. + * @Default {null} + */ + color?: string; + + /**Opacity of the chart border. + * @Default {0.3} + */ + opacity?: number; + + /**Width of the Chart border. + * @Default {0} + */ + width?: number; +} + +export interface ChartAreaBorder { + + /**Border color of the plot area. + * @Default {Gray} + */ + color?: string; + + /**Opacity of the plot area border. + * @Default {0.3} + */ + opacity?: number; + + /**Border width of the plot area. + * @Default {0.5} + */ + width?: number; +} + +export interface ChartArea { + + /**Background color of the plot area. + * @Default {transparent} + */ + background?: string; + + /**Options for customizing the border of the plot area. + */ + border?: ChartAreaBorder; +} + +export interface ColumnDefinitions { + + /**Specifies the unit to measure the width of the column in plotting area. + * @Default {'pixel'. See Unit} + */ + unit?: ej.datavisualization.Chart.Unit|string; + + /**Width of the column in plotting area. Width is measured in either pixel or percentage based on the value of unit property. + * @Default {50} + */ + columnWidth?: number; + + /**Color of the line that indicates the starting point of the column in plotting area. + * @Default {transparent} + */ + lineColor?: string; + + /**Width of the line that indicates the starting point of the column in plot area. + * @Default {1} + */ + lineWidth?: number; +} + +export interface CommonSeriesOptionsBorder { + + /**Border color of all series. + * @Default {transparent} + */ + color?: string; + + /**DashArray for border of the series. + * @Default {null} + */ + dashArray?: string; + + /**Border width of all series. + * @Default {1} + */ + width?: number; +} + +export interface CommonSeriesOptionsFont { + + /**Font color of the text in all series. + * @Default {#707070} + */ + color?: string; + + /**Font Family for all the series. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Specifies the font Style for all the series. + * @Default {normal} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Specifies the font weight for all the series. + * @Default {regular} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity for text in all the series. + * @Default {1} + */ + opacity?: number; + + /**Font size for text in all the series. + * @Default {12px} + */ + size?: string; +} + +export interface CommonSeriesOptionsMarkerBorder { + + /**Border color of the marker shape. + * @Default {white} + */ + color?: string; + + /**Border width of the marker shape. + * @Default {3} + */ + width?: number; +} + +export interface CommonSeriesOptionsMarkerDataLabelBorder { + + /**Border color of the data label. + * @Default {null} + */ + color?: string; + + /**Border width of the data label. + * @Default {0.1} + */ + width?: number; +} + +export interface CommonSeriesOptionsMarkerDataLabelConnectorLine { + + /**Specifies when the connector has to be drawn as Bezier curve or straight line. This is applicable only for Pie and Doughnut chart types. + * @Default {line. See ConnectorLineType} + */ + type?: ej.datavisualization.Chart.ConnectorLineType|string; + + /**Width of the connector. + * @Default {0.5} + */ + width?: number; +} + +export interface CommonSeriesOptionsMarkerDataLabelFont { + + /**Font family of the data label. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style of the data label. + * @Default {normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the data label. + * @Default {regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of the text. + * @Default {1} + */ + opacity?: number; + + /**Font size of the data label. + * @Default {12px} + */ + size?: string; +} + +export interface CommonSeriesOptionsMarkerDataLabelMargin { + + /**Bottom margin of the text. + * @Default {5} + */ + bottom?: number; + + /**Left margin of the text. + * @Default {5} + */ + left?: number; + + /**Right margin of the text. + * @Default {5} + */ + right?: number; + + /**Top margin of the text. + * @Default {5} + */ + top?: number; +} + +export interface CommonSeriesOptionsMarkerDataLabel { + + /**Angle of the data label in degrees. Only the text gets rotated, whereas the background and border does not rotate. + * @Default {null} + */ + angle?: number; + + /**Options for customizing the border of the data label. + */ + border?: CommonSeriesOptionsMarkerDataLabelBorder; + + /**Options for displaying and customizing the line that connects point and data label. + */ + connectorLine?: CommonSeriesOptionsMarkerDataLabelConnectorLine; + + /**Background color of the data label. + * @Default {null} + */ + fill?: string; + + /**Options for customizing the data label font. + */ + font?: CommonSeriesOptionsMarkerDataLabelFont; + + /**Horizontal alignment of the data label. + * @Default {center} + */ + horizontalTextAlignment?: ej.datavisualization.Chart.HorizontalTextAlignment|string; + + /**Margin of the text to its background shape. The size of the background shape increases based on the margin applied to its text. + */ + margin?: CommonSeriesOptionsMarkerDataLabelMargin; + + /**Opacity of the data label. + * @Default {1} + */ + opacity?: number; + + /**Background shape of the data label. + * @Default {none. See Shape} + */ + shape?: ej.datavisualization.Chart.Shape|string; + + /**Name of a field in data source, where datalabel text is displayed. + */ + textMappingName?: string; + + /**Specifies the position of the data label. This property can be used only for the series such as column, bar, stacked column, stacked bar, 100% stacked column, 100% stacked bar, candle and OHLC. + * @Default {top. See TextPosition} + */ + textPosition?: ej.datavisualization.Chart.TextPosition|string; + + /**Vertical alignment of the data label. + * @Default {center} + */ + verticalTextAlignment?: ej.datavisualization.Chart.VerticalTextAlignment|string; + + /**Controls the visibility of the data labels. + * @Default {false} + */ + visible?: boolean; +} + +export interface CommonSeriesOptionsMarkerSize { + + /**Height of the marker. + * @Default {6} + */ + height?: number; + + /**Width of the marker. + * @Default {6} + */ + width?: number; +} + +export interface CommonSeriesOptionsMarker { + + /**Options for customizing the border of the marker shape. + */ + border?: CommonSeriesOptionsMarkerBorder; + + /**Options for displaying and customizing data labels. + */ + dataLabel?: CommonSeriesOptionsMarkerDataLabel; + + /**Color of the marker shape. + * @Default {null} + */ + fill?: string; + + /**The URL for the Image to be displayed as marker. In order to display image as marker, set series.marker.shape as ‘image’. + */ + imageUrl?: string; + + /**Opacity of the marker. + * @Default {1} + */ + opacity?: number; + + /**Specifies the shape of the marker. + * @Default {circle. See Shape} + */ + shape?: ej.datavisualization.Chart.Shape|string; + + /**Options for customizing the size of the marker shape. + */ + size?: CommonSeriesOptionsMarkerSize; + + /**Controls the visibility of the marker shape. + * @Default {false} + */ + visible?: boolean; +} + +export interface CommonSeriesOptionsTooltipBorder { + + /**Border color of the tooltip. + * @Default {null} + */ + color?: string; + + /**Border width of the tooltip. + * @Default {1} + */ + width?: number; +} + +export interface CommonSeriesOptionsTooltip { + + /**Options for customizing the border of the tooltip. + */ + border?: CommonSeriesOptionsTooltipBorder; + + /**Customize the corner radius of the tooltip rectangle. + * @Default {0} + */ + rx?: number; + + /**Customize the corner radius of the tooltip rectangle. + * @Default {0} + */ + ry?: number; + + /**Specifies the duration, the tooltip has to be displayed. + * @Default {500ms} + */ + duration?: string; + + /**Enables/disables the animation of the tooltip when moving from one point to other. + * @Default {true} + */ + enableAnimation?: boolean; + + /**Background color of the tooltip. + * @Default {null} + */ + fill?: string; + + /**Format of the tooltip content. + * @Default {#point.x# : #point.y#} + */ + format?: string; + + /**Opacity of the tooltip. + * @Default {0.5} + */ + opacity?: number; + + /**Custom template to format the tooltip content. Use “point.x” and “point.y” as a placeholder text to display the corresponding data point’s x and y value. + * @Default {null} + */ + template?: string; + + /**Controls the visibility of the tooltip. + * @Default {false} + */ + visible?: boolean; +} + +export interface CommonSeriesOptionsEmptyPointSettingsStyleBorder { + + /**Border color of the empty point. + */ + color?: string; + + /**Border width of the empty point. + * @Default {1} + */ + width?: number; +} + +export interface CommonSeriesOptionsEmptyPointSettingsStyle { + + /**Color of the empty point. + */ + color?: string; + + /**Options for customizing border of the empty point in the series. + */ + border?: CommonSeriesOptionsEmptyPointSettingsStyleBorder; +} + +export interface CommonSeriesOptionsEmptyPointSettings { + + /**Controls the visibility of the empty point. + * @Default {true} + */ + visible?: boolean; + + /**Specifies the mode of empty point. + * @Default {gap} + */ + displayMode?: ej.datavisualization.Chart.EmptyPointMode|string; + + /**Options for customizing the color and border of the empty point in the series. + */ + style?: CommonSeriesOptionsEmptyPointSettingsStyle; +} + +export interface CommonSeriesOptionsConnectorLine { + + /**Width of the connector line. + * @Default {1} + */ + width?: number; + + /**Color of the connector line. + * @Default {#565656} + */ + color?: string; + + /**DashArray of the connector line. + * @Default {null} + */ + dashArray?: string; + + /**DashArray of the connector line. + * @Default {1} + */ + opacity?: number; +} + +export interface CommonSeriesOptionsErrorBarCap { + + /**Show/Hides the error bar cap. + * @Default {true} + */ + visible?: boolean; + + /**Width of the error bar cap. + * @Default {1} + */ + width?: number; + + /**Length of the error bar cap. + * @Default {1} + */ + length?: number; + + /**Color of the error bar cap. + * @Default {“#000000”} + */ + fill?: string; +} + +export interface CommonSeriesOptionsErrorBar { + + /**Show/hides the error bar + * @Default {visible} + */ + visibility?: boolean; + + /**Specifies the type of error bar. + * @Default {FixedValue} + */ + type?: ej.datavisualization.Chart.ErrorBarType|string; + + /**Specifies the mode of error bar. + * @Default {vertical} + */ + mode?: ej.datavisualization.Chart.ErrorBarMode|string; + + /**Specifies the direction of error bar. + * @Default {both} + */ + direction?: ej.datavisualization.Chart.ErrorBarDirection|string; + + /**Value of vertical error bar. + * @Default {3} + */ + verticalErrorValue?: number; + + /**Value of horizontal error bar. + * @Default {1} + */ + horizontalErrorValue?: number; + + /**Value of positive horizontal error bar. + * @Default {1} + */ + horizontalPositiveErrorValue?: number; + + /**Value of negative horizontal error bar. + * @Default {1} + */ + horizontalNegativeErrorValue?: number; + + /**Value of positive vertical error bar. + * @Default {5} + */ + verticalPositiveErrorValue?: number; + + /**Value of negative vertical error bar. + * @Default {5} + */ + verticalNegativeErrorValue?: number; + + /**Fill color of the error bar. + * @Default {#000000} + */ + fill?: string; + + /**Width of the error bar. + * @Default {1} + */ + width?: number; + + /**Options for customizing the error bar cap. + */ + cap?: CommonSeriesOptionsErrorBarCap; +} + +export interface CommonSeriesOptionsTrendlines { + + /**Show/hides the trendline. + */ + visibility?: boolean; + + /**Specifies the type of the trendline for the series. + * @Default {linear. See TrendlinesType} + */ + type?: string; + + /**Name for the trendlines that is to be displayed in the legend text. + * @Default {trendline} + */ + name?: string; + + /**Fill color of the trendlines. + * @Default {#0000FF} + */ + fill?: string; + + /**Width of the trendlines. + * @Default {1} + */ + width?: number; + + /**Opacity of the trendline. + * @Default {1} + */ + opacity?: number; + + /**Pattern of dashes and gaps used to stroke the trendline. + */ + dashArray?: string; + + /**Future trends of the current series. + * @Default {0} + */ + forwardForecast?: number; + + /**Past trends of the current series. + * @Default {0} + */ + backwardForecast?: number; + + /**Specifies the order of the polynomial trendlines. + * @Default {0} + */ + polynomialOrder?: number; + + /**Specifies the moving average starting period value. + * @Default {2} + */ + period?: number; +} + +export interface CommonSeriesOptionsHighlightSettingsBorder { + + /**Border color of the series/point on highlight. + */ + color?: string; + + /**Border width of the series/point on highlight. + * @Default {2} + */ + width?: string; +} + +export interface CommonSeriesOptionsHighlightSettings { + + /**Enables/disables the ability to highlight the series or data point interactively. + * @Default {false} + */ + enable?: boolean; + + /**Specifies whether the series or data point has to be highlighted. + * @Default {series. See Mode} + */ + mode?: ej.datavisualization.Chart.Mode|string; + + /**Color of the series/point on highlight. + */ + color?: string; + + /**Opacity of the series/point on highlight. + * @Default {0.6} + */ + opacity?: number; + + /**Options for customizing the border of series on highlight. + */ + border?: CommonSeriesOptionsHighlightSettingsBorder; + + /**Specifies the pattern for the series/point on highlight. + * @Default {none. See Pattern} + */ + pattern?: string; + + /**Custom pattern for the series on highlight. + */ + customPattern?: string; +} + +export interface CommonSeriesOptionsSelectionSettingsBorder { + + /**Border color of the series/point on selection. + */ + color?: string; + + /**Border width of the series/point on selection. + * @Default {2} + */ + width?: string; +} + +export interface CommonSeriesOptionsSelectionSettings { + + /**Enables/disables the ability to select a series/data point interactively. + * @Default {false} + */ + enable?: boolean; + + /**Specifies the type of selection. + * @Default {single} + */ + type?: ej.datavisualization.Chart.SelectionType|string; + + /**Specifies whether the series or data point has to be selected. + * @Default {series. See Mode} + */ + mode?: ej.datavisualization.Chart.Mode|string; + + /**Color of the series/point on selection. + */ + color?: string; + + /**Opacity of the series/point on selection. + * @Default {0.6} + */ + opacity?: number; + + /**Options for customizing the border of the series on selection. + */ + border?: CommonSeriesOptionsSelectionSettingsBorder; + + /**Specifies the pattern for the series/point on selection. + * @Default {none. See Pattern} + */ + pattern?: string; + + /**Custom pattern for the series on selection. + */ + customPattern?: string; +} + +export interface CommonSeriesOptions { + + /**Options to customize the border of all the series. + */ + border?: CommonSeriesOptionsBorder; + + /**Pattern of dashes and gaps used to stroke all the line type series. + */ + dashArray?: string; + + /**Set the dataSource for all series. It can be an array of JSON objects or an instance of ej.DataManager. + * @Default {null} + */ + dataSource?: any; + + /**Controls the size of the hole in doughnut series. Value ranges from 0 to 1 + * @Default {0.4} + */ + doughnutCoefficient?: number; + + /**Controls the size of the doughnut series. Value ranges from 0 to 1. + * @Default {0.8} + */ + doughnutSize?: number; + + /**Specifies the type of series to be drawn in radar or polar series. + * @Default {line. See DrawType} + */ + drawType?: ej.datavisualization.Chart.DrawType|string; + + /**Enable/disable the animation for all the series. + * @Default {true} + */ + enableAnimation?: boolean; + + /**To avoid overlapping of data labels smartly. + * @Default {true} + */ + enableSmartLabels?: boolean; + + /**Start angle of pie/doughnut series. + * @Default {null} + */ + endAngle?: number; + + /**Explodes the pie/doughnut slices on mouse move. + * @Default {false} + */ + explode?: boolean; + + /**Explodes all the slice of pie/doughnut on render. + * @Default {false} + */ + explodeAll?: boolean; + + /**Index of the point to be exploded from pie/doughnut/pyramid/funnel. + * @Default {null} + */ + explodeIndex?: number; + + /**Specifies the distance of the slice from the center, when it is exploded. + * @Default {0.4} + */ + explodeOffset?: number; + + /**Fill color for all the series. + * @Default {null} + */ + fill?: string; + + /**Options for customizing the font of all the series. + */ + font?: CommonSeriesOptionsFont; + + /**Sets the height of the funnel in funnel series. Values can be either pixel or percentage. + * @Default {32.7%} + */ + funnelHeight?: string; + + /**Sets the width of the funnel in funnel series. Values can be either pixel or percentage. + * @Default {11.6%} + */ + funnelWidth?: string; + + /**Gap between the slices in pyramid and funnel series. + * @Default {0} + */ + gapRatio?: number; + + /**Specifies whether to join start and end point of a line/area series used in polar/radar chart to form a closed path. + * @Default {true} + */ + isClosed?: boolean; + + /**Specifies whether to stack the column series in polar/radar charts. + * @Default {false} + */ + isStacking?: boolean; + + /**Renders the chart vertically. This is applicable only for cartesian type series. + * @Default {false} + */ + isTransposed?: boolean; + + /**Position of the data label in pie/doughnut/pyramid/funnel series. OutsideExtended position is not applicable for pyramid/funnel. + * @Default {inside. See LabelPosition} + */ + labelPosition?: ej.datavisualization.Chart.LabelPosition|string; + + /**Specifies the line cap of the series. + * @Default {butt. See LineCap} + */ + lineCap?: ej.datavisualization.Chart.LineCap|string; + + /**Specifies the type of shape to be used where two lines meet. + * @Default {round. See LineJoin} + */ + lineJoin?: ej.datavisualization.Chart.LineJoin|string; + + /**Options for displaying and customizing marker for individual point in a series. Marker contains shapes and/or data labels. + */ + marker?: CommonSeriesOptionsMarker; + + /**Opacity of the series. + * @Default {1} + */ + opacity?: number; + + /**Name of a field in data source, where the fill color for all the data points is generated. + */ + palette?: string; + + /**Controls the size of pie series. Value ranges from 0 to 1. + * @Default {0.8} + */ + pieCoefficient?: number; + + /**Specifies the mode of the pyramid series. + * @Default {linear. See PyramidMode} + */ + pyramidMode?: ej.datavisualization.Chart.PyramidMode|string; + + /**Start angle from where the pie/doughnut series renders. By default it starts from 0. + * @Default {null} + */ + startAngle?: number; + + /**Options for customizing the tooltip of chart. + */ + tooltip?: CommonSeriesOptionsTooltip; + + /**Specifies the type of the series to render in chart. + * @Default {column. See Type} + */ + type?: ej.datavisualization.Chart.Type|string; + + /**Specifies the name of the x-axis that has to be associated with this series. Add an axis instance with this name to axes collection. + * @Default {null} + */ + xAxisName?: string; + + /**Name of the property in the datasource that contains x value for the series. + * @Default {null} + */ + xName?: string; + + /**Specifies the name of the y-axis that has to be associated with this series. Add an axis instance with this name to axes collection. + * @Default {null} + */ + yAxisName?: string; + + /**Name of the property in the datasource that contains y value for the series. + * @Default {null} + */ + yName?: string; + + /**Name of the property in the datasource that contains high value for the series. + * @Default {null} + */ + high?: string; + + /**Name of the property in the datasource that contains low value for the series. + * @Default {null} + */ + low?: string; + + /**Name of the property in the datasource that contains open value for the series. + * @Default {null} + */ + open?: string; + + /**Name of the property in the datasource that contains close value for the series. + * @Default {null} + */ + close?: string; + + /**Name of the property in the datasource that contains the size value for the bubble series. + * @Default {null} + */ + size?: string; + + /**Options for customizing the empty point in the series. + */ + emptyPointSettings?: CommonSeriesOptionsEmptyPointSettings; + + /**Fill color for the positive column of the waterfall. + * @Default {null} + */ + positiveFill?: string; + + /**Options for customizing the waterfall connector line. + */ + connectorLine?: CommonSeriesOptionsConnectorLine; + + /**Options to customize the error bar in series. + */ + errorBar?: CommonSeriesOptionsErrorBar; + + /**Option to add the trendlines to chart. + */ + trendlines?: Array; + + /**Options for customizing the appearance of the series or data point while highlighting. + */ + highlightSettings?: CommonSeriesOptionsHighlightSettings; + + /**Options for customizing the appearance of the series/data point on selection. + */ + selectionSettings?: CommonSeriesOptionsSelectionSettings; +} + +export interface CrosshairMarkerBorder { + + /**Border width of the marker. + * @Default {3} + */ + width?: number; +} + +export interface CrosshairMarkerSize { + + /**Height of the marker. + * @Default {10} + */ + height?: number; + + /**Width of the marker. + * @Default {10} + */ + width?: number; +} + +export interface CrosshairMarker { + + /**Options for customizing the border. + */ + border?: CrosshairMarkerBorder; + + /**Opacity of the marker. + * @Default {true} + */ + opacity?: boolean; + + /**Options for customizing the size of the marker. + */ + size?: CrosshairMarkerSize; + + /**Show/hides the marker. + * @Default {true} + */ + visible?: boolean; +} + +export interface Crosshair { + + /**Options for customizing the marker in crosshair. + */ + marker?: CrosshairMarker; + + /**Specifies the type of the crosshair. It can be trackball or crosshair + * @Default {crosshair. See CrosshairType} + */ + type?: ej.datavisualization.Chart.CrosshairType|string; + + /**Show/hides the crosshair/trackball visibility. + * @Default {false} + */ + visible?: boolean; +} + +export interface IndicatorsHistogramBorder { + + /**Color of the histogram border in MACD indicator. + * @Default {#9999ff} + */ + color?: string; + + /**Controls the width of histogram border line in MACD indicator. + * @Default {1} + */ + width?: number; +} + +export interface IndicatorsHistogram { + + /**Options to customize the histogram border in MACD indicator. + */ + border?: IndicatorsHistogramBorder; + + /**Color of histogram columns in MACD indicator. + * @Default {#ccccff} + */ + fill?: string; + + /**Opacity of histogram columns in MACD indicator. + * @Default {1} + */ + opacity?: number; +} + +export interface IndicatorsLowerLine { + + /**Color of lower line. + * @Default {#008000} + */ + fill?: string; + + /**Width of the lower line. + * @Default {2} + */ + width?: number; +} + +export interface IndicatorsMacdLine { + + /**Color of MACD line. + * @Default {#ff9933} + */ + fill?: string; + + /**Width of the MACD line. + * @Default {2} + */ + width?: number; +} + +export interface IndicatorsPeriodLine { + + /**Color of period line in indicator. + * @Default {blue} + */ + fill?: string; + + /**Width of the period line in indicators. + * @Default {2} + */ + width?: number; +} + +export interface IndicatorsTooltipBorder { + + /**Border color of indicator tooltip. + * @Default {null} + */ + color?: string; + + /**Border width of indicator tooltip. + * @Default {1} + */ + width?: number; +} + +export interface IndicatorsTooltip { + + /**Option to customize the border of indicator tooltip. + */ + border?: IndicatorsTooltipBorder; + + /**Specifies the animation duration of indicator tooltip. + * @Default {500ms} + */ + duration?: string; + + /**Enables/disables the tooltip animation. + * @Default {true} + */ + enableAnimation?: boolean; + + /**Format of indicator tooltip. Use “point.x” and “point.y” as a placeholder text to display the corresponding data point’s x and y value. + * @Default {#point.x# : #point.y#} + */ + format?: string; + + /**Background color of indicator tooltip. + * @Default {null} + */ + fill?: string; + + /**Opacity of indicator tooltip. + * @Default {0.95} + */ + opacity?: number; + + /**Controls the visibility of indicator tooltip. + * @Default {false} + */ + visible?: boolean; +} + +export interface IndicatorsUpperLine { + + /**Fill color of the upper line in indicators + * @Default {#ff9933} + */ + fill?: string; + + /**Width of the upper line in indicators. + * @Default {2} + */ + width?: number; +} + +export interface Indicators { + + /**The dPeriod value for stochastic indicator. + * @Default {3} + */ + dPeriod?: number; + + /**Enables/disables the animation. + * @Default {false} + */ + enableAnimation?: boolean; + + /**Color of the technical indicator. + * @Default {#00008B} + */ + fill?: string; + + /**Options to customize the histogram in MACD indicator. + */ + histogram?: IndicatorsHistogram; + + /**Specifies the k period in stochastic indicator. + * @Default {3} + */ + kPeriod?: number; + + /**Specifies the long period in MACD indicator. + * @Default {26} + */ + longPeriod?: number; + + /**Options to customize the lower line in indicators. + */ + lowerLine?: IndicatorsLowerLine; + + /**Options to customize the MACD line. + */ + macdLine?: IndicatorsMacdLine; + + /**Specifies the type of the MACD indicator. + * @Default {line. See MACDType} + */ + macdType?: string; + + /**Specifies period value in indicator. + * @Default {14} + */ + period?: number; + + /**Options to customize the period line in indicators. + */ + periodLine?: IndicatorsPeriodLine; + + /**Name of the series for which indicator has to be drawn. + */ + seriesName?: string; + + /**Specifies the short period in MACD indicator. + * @Default {13} + */ + shortPeriod?: number; + + /**Specifies the standard deviation value for Bollinger band indicator. + * @Default {2} + */ + standardDeviations?: number; + + /**Options to customize the tooltip. + */ + tooltip?: IndicatorsTooltip; + + /**Trigger value of MACD indicator. + * @Default {9} + */ + trigger?: number; + + /**Specifies the visibility of indicator. + * @Default {visible} + */ + visibility?: string; + + /**Specifies the type of indicator that has to be rendered. + * @Default {sma. See IndicatorsType} + */ + type?: string; + + /**Options to customize the upper line in indicators + */ + upperLine?: IndicatorsUpperLine; + + /**Width of the indicator line. + * @Default {2} + */ + width?: number; + + /**Name of the horizontal axis used for indicator. Primary X axis is used when x axis name is not specified. + */ + xAxisName?: string; + + /**Name of the vertical axis used for indicator. Primary Y axis is used when y axis name is not specified + */ + yAxisName?: string; +} + +export interface LegendBorder { + + /**Border color of the legend. + * @Default {transparent} + */ + color?: string; + + /**Border width of the legend. + * @Default {1} + */ + width?: number; +} + +export interface LegendFont { + + /**Font family for legend item text. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style for legend item text. + * @Default {Normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight for legend item text. + * @Default {Regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Font size for legend item text. + * @Default {12px} + */ + size?: string; +} + +export interface LegendItemStyleBorder { + + /**Border color of the legend items. + * @Default {transparent} + */ + color?: string; + + /**Border width of the legend items. + * @Default {1} + */ + width?: number; +} + +export interface LegendItemStyle { + + /**Options for customizing the border of legend items. + */ + border?: LegendItemStyleBorder; + + /**Height of the shape in legend items. + * @Default {10} + */ + height?: number; + + /**Width of the shape in legend items. + * @Default {10} + */ + width?: number; +} + +export interface LegendLocation { + + /**X value or horizontal offset to position the legend in chart. + * @Default {0} + */ + x?: number; + + /**Y value or vertical offset to position the legend. + * @Default {0} + */ + y?: number; +} + +export interface LegendSize { + + /**Height of the legend. Height can be specified in either pixel or percentage. + * @Default {null} + */ + height?: string; + + /**Width of the legend. Width can be specified in either pixel or percentage. + * @Default {null} + */ + width?: string; +} + +export interface LegendTitleFont { + + /**Font family for the text in legend title. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style for legend title. + * @Default {normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight for legend title. + * @Default {normal. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Font size for legend title. + * @Default {12px} + */ + size?: string; +} + +export interface LegendTitle { + + /**Options to customize the font used for legend title + */ + font?: LegendTitleFont; + + /**Text to be displayed in legend title. + */ + text?: string; + + /**Alignment of the legend title. + * @Default {center. See Alignment} + */ + textAlignment?: ej.datavisualization.Chart.Alignment|string; +} + +export interface Legend { + + /**Horizontal alignment of the legend. + * @Default {Center. See Alignment} + */ + alignment?: ej.datavisualization.Chart.Alignment|string; + + /**Background for the legend. Use this property to add a background image or background color for the legend. + */ + background?: string; + + /**Options for customizing the legend border. + */ + border?: LegendBorder; + + /**Number of columns to arrange the legend items. + * @Default {null} + */ + columnCount?: number; + + /**Controls whether legend has to use scrollbar or not. When enabled, scroll bar appears depending upon size and position properties of legend. + * @Default {true} + */ + enableScrollbar?: boolean; + + /**Fill color for the legend items. By using this property, it displays all legend item shapes in same color.Legend items representing invisible series is displayed in gray color. + * @Default {null} + */ + fill?: string; + + /**Options to customize the font used for legend item text. + */ + font?: LegendFont; + + /**Gap or padding between the legend items. + * @Default {10} + */ + itemPadding?: number; + + /**Options to customize the style of legend items. + */ + itemStyle?: LegendItemStyle; + + /**Options to customize the location of chart legend. Legend is placed in provided location only when value of position property is custom + */ + location?: LegendLocation; + + /**Opacity of the legend. + * @Default {1} + */ + opacity?: number; + + /**Places the legend at specified position. Legend can be placed at left, right, top or bottom of the chart area.To manually specify the location of legend, set custom as value to this property. + * @Default {Bottom. See Position} + */ + position?: ej.datavisualization.Chart.Position|string; + + /**Number of rows to arrange the legend items. + * @Default {null} + */ + rowCount?: number; + + /**Shape of the legend items. Default shape for pie and doughnut series is circle and all other series uses rectangle. + * @Default {None. See Shape} + */ + shape?: ej.datavisualization.Chart.Shape|string; + + /**Options to customize the size of the legend. + */ + size?: LegendSize; + + /**Options to customize the legend title. + */ + title?: LegendTitle; + + /**Specifies the action taken when the legend width is more than the textWidth. + * @Default {none. See textOverflow} + */ + textOverflow?: ej.datavisualization.Chart.TextOverflow|string; + + /**Text width for legend item. + * @Default {34} + */ + textWidth?: number; + + /**Controls the visibility of the legend. + * @Default {true} + */ + visible?: boolean; +} + +export interface PrimaryXAxisAlternateGridBandEven { + + /**Fill color for the even grid bands. + * @Default {transparent} + */ + fill?: string; + + /**Opacity of the even grid band. + * @Default {1} + */ + opacity?: number; +} + +export interface PrimaryXAxisAlternateGridBandOdd { + + /**Fill color of the odd grid bands + * @Default {transparent} + */ + fill?: string; + + /**Opacity of odd grid band + * @Default {1} + */ + opacity?: number; +} + +export interface PrimaryXAxisAlternateGridBand { + + /**Options for customizing even grid band. + */ + even?: PrimaryXAxisAlternateGridBandEven; + + /**Options for customizing odd grid band. + */ + odd?: PrimaryXAxisAlternateGridBandOdd; +} + +export interface PrimaryXAxisAxisLine { + + /**Pattern of dashes and gaps to be applied to the axis line. + * @Default {null} + */ + dashArray?: string; + + /**Padding for axis line. Normally, it is used along with plotOffset to pad the plot area. + * @Default {null} + */ + offset?: number; + + /**Show/hides the axis line. + * @Default {true} + */ + visible?: boolean; + + /**Width of axis line. + * @Default {1} + */ + width?: number; +} + +export interface PrimaryXAxisCrosshairLabel { + + /**Show/hides the crosshair label associated with this axis. + * @Default {false} + */ + visible?: boolean; +} + +export interface PrimaryXAxisFont { + + /**Font family of labels. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style of labels. + * @Default {ej.datavisualization.Chart.FontStyle.Normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the label. + * @Default {ej.datavisualization.Chart.FontWeight.Regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of the axis labels. + * @Default {1} + */ + opacity?: number; + + /**Font size of the axis labels. + * @Default {13px} + */ + size?: string; +} + +export interface PrimaryXAxisMajorGridLines { + + /**Pattern of dashes and gaps used to stroke the major grid lines. + * @Default {null} + */ + dashArray?: string; + + /**Opacity of major grid lines. + * @Default {1} + */ + opacity?: number; + + /**Show/hides the major grid lines. + * @Default {true} + */ + visible?: boolean; + + /**Width of the major grid lines. + * @Default {1} + */ + width?: number; +} + +export interface PrimaryXAxisMajorTickLines { + + /**Length of the major tick lines. + * @Default {5} + */ + size?: number; + + /**Show/hides the major tick lines. + * @Default {true} + */ + visible?: boolean; + + /**Width of the major tick lines. + * @Default {1} + */ + width?: number; +} + +export interface PrimaryXAxisMinorGridLines { + + /**Patterns of dashes and gaps used to stroke the minor grid lines. + * @Default {null} + */ + dashArray?: string; + + /**Show/hides the minor grid lines. + * @Default {true} + */ + visible?: boolean; + + /**Width of the minorGridLines. + * @Default {1} + */ + width?: number; +} + +export interface PrimaryXAxisMinorTickLines { + + /**Length of the minor tick lines. + * @Default {5} + */ + size?: number; + + /**Show/hides the minor tick lines. + * @Default {true} + */ + visible?: boolean; + + /**Width of the minor tick line. + * @Default {1} + */ + width?: number; +} + +export interface PrimaryXAxisRange { + + /**Minimum value of the axis range. + * @Default {null} + */ + minimum?: number; + + /**Maximum value of the axis range. + * @Default {null} + */ + maximum?: number; + + /**Interval of the axis range. + * @Default {null} + */ + interval?: number; +} + +export interface PrimaryXAxisStripLineFont { + + /**Font color of the strip line text. + * @Default {black} + */ + color?: string; + + /**Font family of the strip line text. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style of the strip line text. + * @Default {Normal} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the strip line text. + * @Default {regular} + */ + fontWeight?: string; + + /**Opacity of the strip line text. + * @Default {1} + */ + opacity?: number; + + /**Font size of the strip line text. + * @Default {12px} + */ + size?: string; +} + +export interface PrimaryXAxisStripLine { + + /**Border color of the strip line. + * @Default {gray} + */ + borderColor?: string; + + /**Background color of the strip line. + * @Default {gray} + */ + color?: string; + + /**End value of the strip line. + * @Default {null} + */ + end?: number; + + /**Options for customizing the font of the text. + */ + font?: PrimaryXAxisStripLineFont; + + /**Start value of the strip line. + * @Default {null} + */ + start?: number; + + /**Indicates whether to render the strip line from the minimum/start value of the axis. This property does not work when start property is set. + * @Default {false} + */ + startFromAxis?: boolean; + + /**Specifies text to be displayed inside the strip line. + * @Default {stripLine} + */ + text?: string; + + /**Specifies the alignment of the text inside the strip line. + * @Default {middlecenter. See TextAlignment} + */ + textAlignment?: ej.datavisualization.Chart.TextAlignment|string; + + /**Show/hides the strip line. + * @Default {false} + */ + visible?: boolean; + + /**Width of the strip line. + * @Default {0} + */ + width?: number; + + /**Specifies the order where the strip line and the series have to be rendered. When zOrder is “behind”, strip line is rendered under the series and when it is “over”, it is rendered above the series. + * @Default {over. See ZIndex} + */ + zIndex?: ej.datavisualization.Chart.ZIndex|string; +} + +export interface PrimaryXAxisTitleFont { + + /**Font family of the title text. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style of the title text. + * @Default {ej.datavisualization.Chart.FontStyle.Normal} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the title text. + * @Default {ej.datavisualization.Chart.FontWeight.Regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of the axis title text. + * @Default {1} + */ + opacity?: number; + + /**Font size of the axis title. + * @Default {16px} + */ + size?: string; +} + +export interface PrimaryXAxisTitle { + + /**Specifies whether to trim the axis title when it exceeds the chart area or the maximum width of the title. + * @Default {false} + */ + enableTrim?: boolean; + + /**Options for customizing the title font. + */ + font?: PrimaryXAxisTitleFont; + + /**Maximum width of the title, when the title exceeds this width, the title gets trimmed, when enableTrim is true. + * @Default {34} + */ + maximumTitleWidth?: number; + + /**Title for the axis. + */ + text?: string; + + /**Controls the visibility of axis title. + * @Default {true} + */ + visible?: boolean; +} + +export interface PrimaryXAxis { + + /**Options for customizing horizontal axis alternate grid band. + */ + alternateGridBand?: PrimaryXAxisAlternateGridBand; + + /**Options for customizing the axis line. + */ + axisLine?: PrimaryXAxisAxisLine; + + /**Specifies the index of the column where the axis is associated, when the chart area is divided into multiple plot areas by using columnDefinitions. + * @Default {null} + */ + columnIndex?: number; + + /**Specifies the number of columns or plot areas an axis has to span horizontally. + * @Default {null} + */ + columnSpan?: number; + + /**Options to customize the crosshair label. + */ + crosshairLabel?: PrimaryXAxisCrosshairLabel; + + /**With this setting, you can request axis to calculate intervals approximately equal to your desired interval. + * @Default {null} + */ + desiredIntervals?: number; + + /**Specifies the position of labels at the edge of the axis. + * @Default {ej.datavisualization.Chart.EdgeLabelPlacement.None. See EdgeLabelPlacement} + */ + edgeLabelPlacement?: ej.datavisualization.Chart.EdgeLabelPlacement|string; + + /**Specifies whether to trim the axis label when the width of the label exceeds the maximumLabelWidth. + * @Default {false} + */ + enableTrim?: boolean; + + /**Options for customizing the font of the axis Labels. + */ + font?: PrimaryXAxisFont; + + /**Specifies the type of interval in date time axis. + * @Default {null. See IntervalType} + */ + intervalType?: ej.datavisualization.Chart.IntervalType|string; + + /**Specifies whether to inverse the axis. + * @Default {false} + */ + isInversed?: boolean; + + /**Custom formatting for axis label and supports all standard formatting type of numerical and date time values. + * @Default {null} + */ + labelFormat?: string; + + /**Specifies the action to take when the axis labels are overlapping with each other. + * @Default {ej.datavisualization.Chart.LabelIntersectAction.None. See LabelIntersectAction} + */ + labelIntersectAction?: ej.datavisualization.Chart.LabelIntersectAction|string; + + /**Specifies the position of the axis labels. + * @Default {outside. See LabelPosition} + */ + labelPosition?: ej.datavisualization.Chart.LabelPosition|string; + + /**Angle in degrees to rotate the axis labels. + * @Default {null} + */ + labelRotation?: number; + + /**Logarithmic base value. This is applicable only for logarithmic axis. + * @Default {10} + */ + logBase?: number; + + /**Options for customizing major gird lines. + */ + majorGridLines?: PrimaryXAxisMajorGridLines; + + /**Options for customizing the major tick lines. + */ + majorTickLines?: PrimaryXAxisMajorTickLines; + + /**Maximum number of labels to be displayed in every 100 pixels. + * @Default {3} + */ + maximumLabels?: number; + + /**Maximum width of the axis label. When the label exceeds the width, the label gets trimmed when the enableTrim is set to true. + * @Default {34} + */ + maximumLabelWidth?: number; + + /**Options for customizing the minor grid lines. + */ + minorGridLines?: PrimaryXAxisMinorGridLines; + + /**Options for customizing the minor tick lines. + */ + minorTickLines?: PrimaryXAxisMinorTickLines; + + /**Specifies the number of minor ticks per interval. + * @Default {null} + */ + minorTicksPerInterval?: number; + + /**Unique name of the axis. To associate an axis with the series, you have to set this name to the xAxisName/yAxisName property of the series. + * @Default {null} + */ + name?: string; + + /**Specifies whether to render the axis at the opposite side of its default position. + * @Default {false} + */ + opposedPosition?: boolean; + + /**Specifies the padding for the plot area. + * @Default {10} + */ + plotOffset?: number; + + /**Options to customize the range of the axis. + */ + range?: PrimaryXAxisRange; + + /**Specifies the padding for the axis range. + * @Default {None. See RangePadding} + */ + rangePadding?: ej.datavisualization.Chart.RangePadding|string; + + /**Rounds the number to the given number of decimals. + * @Default {null} + */ + roundingPlaces?: number; + + /**Options for customizing the strip lines. + * @Default {[ ]} + */ + stripLine?: Array; + + /**Specifies the position of the axis tick lines. + * @Default {outside. See TickLinesPosition} + */ + tickLinesPosition?: ej.datavisualization.Chart.TickLinesPosition|string; + + /**Options for customizing the axis title. + */ + title?: PrimaryXAxisTitle; + + /**Specifies the type of data the axis is handling. + * @Default {null. See ValueType} + */ + valueType?: ej.datavisualization.Chart.ValueType|string; + + /**Show/hides the axis. + * @Default {true} + */ + visible?: boolean; + + /**The axis is scaled by this factor. When zoomFactor is 0.5, the chart is scaled by 200% along this axis. Value ranges from 0 to 1. + * @Default {1} + */ + zoomFactor?: number; + + /**Position of the zoomed axis. Value ranges from 0 to 1. + * @Default {0} + */ + zoomPosition?: number; +} + +export interface PrimaryYAxisAlternateGridBandEven { + + /**Fill color for the even grid bands. + * @Default {transparent} + */ + fill?: string; + + /**Opacity of the even grid band. + * @Default {1} + */ + opacity?: number; +} + +export interface PrimaryYAxisAlternateGridBandOdd { + + /**Fill color of the odd grid bands. + * @Default {transparent} + */ + fill?: string; + + /**Opacity of odd grid band. + * @Default {1} + */ + opacity?: number; +} + +export interface PrimaryYAxisAlternateGridBand { + + /**Options for customizing even grid band. + */ + even?: PrimaryYAxisAlternateGridBandEven; + + /**Options for customizing odd grid band. + */ + odd?: PrimaryYAxisAlternateGridBandOdd; +} + +export interface PrimaryYAxisAxisLine { + + /**Pattern of dashes and gaps to be applied to the axis line. + * @Default {null} + */ + dashArray?: string; + + /**Padding for axis line. Normally, it is used along with plotOffset to pad the plot area. + * @Default {null} + */ + offset?: number; + + /**Show/hides the axis line. + * @Default {true} + */ + visible?: boolean; + + /**Width of axis line. + * @Default {1} + */ + width?: number; +} + +export interface PrimaryYAxisCrosshairLabel { + + /**Show/hides the crosshair label associated with this axis. + * @Default {false} + */ + visible?: boolean; +} + +export interface PrimaryYAxisFont { + + /**Font family of labels. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style of labels. + * @Default {ej.datavisualization.Chart.FontStyle.Normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the label. + * @Default {ej.datavisualization.Chart.FontWeight.Regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of the axis labels. + * @Default {1} + */ + opacity?: number; + + /**Font size of the axis labels. + * @Default {13px} + */ + size?: string; +} + +export interface PrimaryYAxisMajorGridLines { + + /**Pattern of dashes and gaps used to stroke the major grid lines. + * @Default {null} + */ + dashArray?: string; + + /**Opacity of major grid lines. + * @Default {1} + */ + opacity?: number; + + /**Show/hides the major grid lines. + * @Default {true} + */ + visible?: boolean; + + /**Width of the major grid lines. + * @Default {1} + */ + width?: number; +} + +export interface PrimaryYAxisMajorTickLines { + + /**Length of the major tick lines. + * @Default {5} + */ + size?: number; + + /**Show/hides the major tick lines. + * @Default {true} + */ + visible?: boolean; + + /**Width of the major tick lines. + * @Default {1} + */ + width?: number; +} + +export interface PrimaryYAxisMinorGridLines { + + /**Patterns of dashes and gaps used to stroke the minor grid lines. + * @Default {null} + */ + dashArray?: string; + + /**Show/hides the minor grid lines. + * @Default {true} + */ + visible?: boolean; + + /**Width of the minorGridLines. + * @Default {1} + */ + width?: number; +} + +export interface PrimaryYAxisMinorTickLines { + + /**Length of the minor tick lines. + * @Default {5} + */ + size?: number; + + /**Show/hides the minor tick lines. + * @Default {true} + */ + visible?: boolean; + + /**Width of the minor tick line + * @Default {1} + */ + width?: number; +} + +export interface PrimaryYAxisStripLineFont { + + /**Font color of the strip line text. + * @Default {black} + */ + color?: string; + + /**Font family of the strip line text. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style of the strip line text. + * @Default {Normal} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the strip line text. + * @Default {regular} + */ + fontWeight?: string; + + /**Opacity of the strip line text. + * @Default {1} + */ + opacity?: number; + + /**Font size of the strip line text. + * @Default {12px} + */ + size?: string; +} + +export interface PrimaryYAxisStripLine { + + /**Border color of the strip line. + * @Default {gray} + */ + borderColor?: string; + + /**Background color of the strip line. + * @Default {gray} + */ + color?: string; + + /**End value of the strip line. + * @Default {null} + */ + end?: number; + + /**Options for customizing the font of the text. + */ + font?: PrimaryYAxisStripLineFont; + + /**Start value of the strip line. + * @Default {null} + */ + start?: number; + + /**Indicates whether to render the strip line from the minimum/start value of the axis. This property won’t work when start property is set. + * @Default {false} + */ + startFromAxis?: boolean; + + /**Specifies text to be displayed inside the strip line. + * @Default {stripLine} + */ + text?: string; + + /**Specifies the alignment of the text inside the strip line. + * @Default {middlecenter. See TextAlignment} + */ + textAlignment?: ej.datavisualization.Chart.TextAlignment|string; + + /**Show/hides the strip line. + * @Default {false} + */ + visible?: boolean; + + /**Width of the strip line. + * @Default {0} + */ + width?: number; + + /**Specifies the order in which strip line and the series have to be rendered. When zOrder is “behind”, strip line is rendered below the series and when it is “over”, it is rendered above the series. + * @Default {over. See ZIndex} + */ + zIndex?: ej.datavisualization.Chart.ZIndex|string; +} + +export interface PrimaryYAxisTitleFont { + + /**Font family of the title text. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style of the title text. + * @Default {ej.datavisualization.Chart.FontStyle.Normal} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the title text. + * @Default {ej.datavisualization.Chart.FontWeight.Regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of the axis title text. + * @Default {1} + */ + opacity?: number; + + /**Font size of the axis title. + * @Default {16px} + */ + size?: string; +} + +export interface PrimaryYAxisTitle { + + /**Specifies whether to trim the axis title when it exceeds the chart area or the maximum width of the title. + * @Default {ej.datavisualization.Chart.enableTrim} + */ + enableTrim?: boolean; + + /**Options for customizing the title font. + */ + font?: PrimaryYAxisTitleFont; + + /**Maximum width of the title, when the title exceeds this width, the title gets trimmed, when enableTrim is true. + * @Default {ej.datavisualization.Chart.maximumTitleWidth.null} + */ + maximumTitleWidth?: number; + + /**Title for the axis. + */ + text?: string; + + /**Controls the visibility of axis title. + * @Default {true} + */ + visible?: boolean; +} + +export interface PrimaryYAxis { + + /**Options for customizing vertical axis alternate grid band. + */ + alternateGridBand?: PrimaryYAxisAlternateGridBand; + + /**Options for customizing the axis line. + */ + axisLine?: PrimaryYAxisAxisLine; + + /**Options to customize the crosshair label. + */ + crosshairLabel?: PrimaryYAxisCrosshairLabel; + + /**With this setting, you can request axis to calculate intervals approximately equal to your desired interval. + * @Default {null} + */ + desiredIntervals?: number; + + /**Specifies the position of labels at the edge of the axis. + * @Default {ej.datavisualization.Chart.EdgeLabelPlacement.None. See EdgeLabelPlacement} + */ + edgeLabelPlacement?: ej.datavisualization.Chart.EdgeLabelPlacement|string; + + /**Specifies whether to trim the axis label when the width of the label exceeds the maximumLabelWidth. + * @Default {false} + */ + enableTrim?: boolean; + + /**Options for customizing the font of the axis Labels. + */ + font?: PrimaryYAxisFont; + + /**Specifies the type of interval in date time axis. + * @Default {null. See IntervalType} + */ + intervalType?: ej.datavisualization.Chart.IntervalType|string; + + /**Specifies whether to inverse the axis. + * @Default {false} + */ + isInversed?: boolean; + + /**Custom formatting for axis label and supports all standard formatting type of numerical and date time values. + * @Default {null} + */ + labelFormat?: string; + + /**Specifies the action to take when the axis labels are overlapping with each other. + * @Default {ej.datavisualization.Chart.LabelIntersectAction.None} + */ + labelIntersectAction?: ej.datavisualization.Chart.LabelIntersectAction|string; + + /**Default Value + * @Default {outside. See LabelPosition} + */ + labelPosition?: ej.datavisualization.Chart.LabelPosition|string; + + /**Logarithmic base value. This is applicable only for logarithmic axis. + * @Default {10} + */ + logBase?: number; + + /**Options for customizing major gird lines. + */ + majorGridLines?: PrimaryYAxisMajorGridLines; + + /**Options for customizing the major tick lines. + */ + majorTickLines?: PrimaryYAxisMajorTickLines; + + /**Maximum number of labels to be displayed in every 100 pixels. + * @Default {3} + */ + maximumLabels?: number; + + /**Maximum width of the axis label. When the label exceeds the width, the label gets trimmed when the enableTrim is set to true. + * @Default {ej.datavisualization.Chart.maximumLabelWidth type {int}} + */ + maximumLabelWidth?: number; + + /**Options for customizing the minor grid lines. + */ + minorGridLines?: PrimaryYAxisMinorGridLines; + + /**Options for customizing the minor tick lines. + */ + minorTickLines?: PrimaryYAxisMinorTickLines; + + /**Specifies the number of minor ticks per interval. + * @Default {null} + */ + minorTicksPerInterval?: number; + + /**Unique name of the axis. To associate an axis with the series, you have to set this name to the xAxisName/yAxisName property of the series. + * @Default {null} + */ + name?: string; + + /**Specifies whether to render the axis at the opposite side of its default position. + * @Default {false} + */ + opposedPosition?: boolean; + + /**Specifies the padding for the plot area. + * @Default {10} + */ + plotOffset?: number; + + /**Specifies the padding for the axis range. + * @Default {ej.datavisualization.Chart.RangePadding.None. See RangePadding} + */ + rangePadding?: ej.datavisualization.Chart.RangePadding|string; + + /**Rounds the number to the given number of decimals. + * @Default {null} + */ + roundingPlaces?: number; + + /**Specifies the index of the row to which the axis is associated, when the chart area is divided into multiple plot areas by using rowDefinitions. + * @Default {null} + */ + rowIndex?: number; + + /**Specifies the number of row or plot areas an axis has to span vertically. + * @Default {null} + */ + rowSpan?: number; + + /**Options for customizing the strip lines. + * @Default {[ ]} + */ + stripLine?: Array; + + /**Specifies the position of the axis tick lines. + * @Default {outside. See TickLinesPosition} + */ + tickLinesPosition?: ej.datavisualization.Chart.TickLinesPosition|string; + + /**Options for customizing the axis title. + */ + title?: PrimaryYAxisTitle; + + /**Specifies the type of data the axis is handling. + * @Default {null. See ValueType} + */ + valueType?: ej.datavisualization.Chart.ValueType|string; + + /**Show/hides the axis. + * @Default {true} + */ + visible?: boolean; + + /**The axis is scaled by this factor. When zoomFactor is 0.5, the chart is scaled by 200% along this axis. Values ranges from 0 to 1. + * @Default {1} + */ + zoomFactor?: number; + + /**Position of the zoomed axis. Value ranges from 0 to 1 + * @Default {0} + */ + zoomPosition?: number; +} + +export interface RowDefinitions { + + /**Specifies the unit to measure the height of the row in plotting area. + * @Default {'pixel'. See Unit} + */ + unit?: ej.datavisualization.Chart.Unit|string; + + /**Height of the row in plotting area. Height is measured in either pixel or percentage based on the value of unit property. + * @Default {50} + */ + rowHeight?: number; + + /**Color of the line that indicates the starting point of the row in plotting area. + * @Default {transparent} + */ + lineColor?: string; + + /**Width of the line that indicates the starting point of the row in plot area. + * @Default {1} + */ + lineWidth?: number; +} + +export interface SeriesBorder { + + /**Border color of the series. + * @Default {transparent} + */ + color?: string; + + /**Border width of the series. + * @Default {1} + */ + width?: number; + + /**DashArray for border of the series. + * @Default {null} + */ + dashArray?: string; +} + +export interface SeriesFont { + + /**Font color of the series text. + * @Default {#707070} + */ + color?: string; + + /**Font Family of the series. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font Style of the series. + * @Default {Normal} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the series. + * @Default {Regular} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of series text. + * @Default {1} + */ + opacity?: number; + + /**Size of the series text. + * @Default {12px} + */ + size?: string; +} + +export interface SeriesMarkerBorder { + + /**Border color of the marker shape. + * @Default {white} + */ + color?: string; + + /**Border width of the marker shape. + * @Default {3} + */ + width?: number; +} + +export interface SeriesMarkerDataLabelBorder { + + /**Border color of the data label. + * @Default {null} + */ + color?: string; + + /**Border width of the data label. + * @Default {0.1} + */ + width?: number; +} + +export interface SeriesMarkerDataLabelConnectorLine { + + /**Specifies when the connector has to be drawn as Bezier curve or straight line. This is applicable only for Pie and Doughnut chart types. + * @Default {line. See ConnectorLineType} + */ + type?: ej.datavisualization.Chart.Type|string; + + /**Width of the connector. + * @Default {0.5} + */ + width?: number; +} + +export interface SeriesMarkerDataLabelFont { + + /**Font family of the data label. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style of the data label. + * @Default {normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the data label. + * @Default {regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of the text. + * @Default {1} + */ + opacity?: number; + + /**Font size of the data label. + * @Default {12px} + */ + size?: string; +} + +export interface SeriesMarkerDataLabelMargin { + + /**Bottom margin of the text. + * @Default {5} + */ + bottom?: number; + + /**Left margin of the text. + * @Default {5} + */ + left?: number; + + /**Right margin of the text. + * @Default {5} + */ + right?: number; + + /**Top margin of the text. + * @Default {5} + */ + top?: number; +} + +export interface SeriesMarkerDataLabel { + + /**Angle of the data label in degrees. Only the text gets rotated, whereas the background and border does not rotate. + * @Default {null} + */ + angle?: number; + + /**Options for customizing the border of the data label. + */ + border?: SeriesMarkerDataLabelBorder; + + /**Options for displaying and customizing the line that connects point and data label. + */ + connectorLine?: SeriesMarkerDataLabelConnectorLine; + + /**Background color of the data label. + * @Default {null} + */ + fill?: string; + + /**Options for customizing the data label font. + */ + font?: SeriesMarkerDataLabelFont; + + /**Horizontal alignment of the data label. + * @Default {center} + */ + horizontalTextAlignment?: ej.datavisualization.Chart.HorizontalTextAlignment|string; + + /**Margin of the text to its background shape. The size of the background shape increases based on the margin applied to its text. + */ + margin?: SeriesMarkerDataLabelMargin; + + /**Opacity of the data label. + * @Default {1} + */ + opacity?: number; + + /**Background shape of the data label. + * @Default {No shape is rendered by default, so its value is ‘none’. See Shape} + */ + shape?: ej.datavisualization.Chart.Shape|string; + + /**Name of a field in data source where datalabel text is displayed. + */ + textMappingName?: string; + + /**Specifies the position of the data label. This property can be used only for the series such as column, bar, stacked column, stacked bar, 100% stacked column, 100% stacked bar, candle and OHLC. + * @Default {top. See TextPosition} + */ + textPosition?: ej.datavisualization.Chart.TextPosition|string; + + /**Vertical alignment of the data label. + * @Default {'center'} + */ + verticalTextAlignment?: ej.datavisualization.Chart.VerticalTextAlignment|string; + + /**Controls the visibility of the data labels. + * @Default {false} + */ + visible?: boolean; + + /**Custom template to format the data label content. Use “point.x” and “point.y” as a placeholder text to display the corresponding data point’s x and y value. + */ + template?: string; + + /**Moves the label vertically by some offset. + * @Default {0} + */ + offset?: number; +} + +export interface SeriesMarkerSize { + + /**Height of the marker. + * @Default {6} + */ + height?: number; + + /**Width of the marker. + * @Default {6} + */ + width?: number; +} + +export interface SeriesMarker { + + /**Options for customizing the border of the marker shape. + */ + border?: SeriesMarkerBorder; + + /**Options for displaying and customizing data labels. + */ + dataLabel?: SeriesMarkerDataLabel; + + /**Color of the marker shape. + * @Default {null} + */ + fill?: string; + + /**The URL for the Image that is to be displayed as marker. In order to display image as marker, set series.marker.shape as ‘image’. + */ + imageUrl?: string; + + /**Opacity of the marker. + * @Default {1} + */ + opacity?: number; + + /**Specifies the shape of the marker. + * @Default {circle. See Shape} + */ + shape?: ej.datavisualization.Chart.Shape|string; + + /**Options for customizing the size of the marker shape. + */ + size?: SeriesMarkerSize; + + /**Controls the visibility of the marker shape. + * @Default {false} + */ + visible?: boolean; +} + +export interface SeriesEmptyPointSettingsStyleBorder { + + /**Border color of the empty point. + */ + color?: string; + + /**Border width of the empty point. + * @Default {1} + */ + width?: number; +} + +export interface SeriesEmptyPointSettingsStyle { + + /**Color of the empty point. + */ + color?: string; + + /**Options for customizing border of the empty point in the series. + */ + border?: SeriesEmptyPointSettingsStyleBorder; +} + +export interface SeriesEmptyPointSettings { + + /**Controls the visibility of the empty point. + * @Default {true} + */ + visible?: boolean; + + /**Specifies the mode of empty point. + * @Default {gap} + */ + displayMode?: ej.datavisualization.Chart.EmptyPointMode|string; + + /**Options for customizing the color and border of the empty point in the series. + */ + style?: SeriesEmptyPointSettingsStyle; +} + +export interface SeriesConnectorLine { + + /**Width of the connector line. + * @Default {1} + */ + width?: number; + + /**Color of the connector line. + * @Default {#565656} + */ + color?: string; + + /**DashArray of the connector line. + * @Default {null} + */ + dashArray?: string; + + /**DashArray of the connector line. + * @Default {1} + */ + opacity?: number; +} + +export interface SeriesErrorBarCap { + + /**Show/Hides the error bar cap. + * @Default {true} + */ + visible?: boolean; + + /**Width of the error bar cap. + * @Default {1} + */ + width?: number; + + /**Length of the error bar cap. + * @Default {1} + */ + length?: number; + + /**Color of the error bar cap. + * @Default {#000000} + */ + fill?: string; +} + +export interface SeriesErrorBar { + + /**Show/hides the error bar + * @Default {visible} + */ + visibility?: boolean; + + /**Specifies the type of error bar. + * @Default {FixedValue} + */ + type?: ej.datavisualization.Chart.ErrorBarType|string; + + /**Specifies the mode of error bar. + * @Default {vertical} + */ + mode?: ej.datavisualization.Chart.ErrorBarMode|string; + + /**Specifies the direction of error bar. + * @Default {both} + */ + direction?: ej.datavisualization.Chart.ErrorBarDirection|string; + + /**Value of vertical error bar. + * @Default {3} + */ + verticalErrorValue?: number; + + /**Value of horizontal error bar. + * @Default {1} + */ + horizontalErrorValue?: number; + + /**Value of positive horizontal error bar. + * @Default {1} + */ + horizontalPositiveErrorValue?: number; + + /**Value of negative horizontal error bar. + * @Default {1} + */ + horizontalNegativeErrorValue?: number; + + /**Value of positive vertical error bar. + * @Default {5} + */ + verticalPositiveErrorValue?: number; + + /**Value of negative vertical error bar. + * @Default {5} + */ + verticalNegativeErrorValue?: number; + + /**Fill color of the error bar. + * @Default {#000000} + */ + fill?: string; + + /**Width of the error bar. + * @Default {1} + */ + width?: number; + + /**Options for customizing the error bar cap. + */ + cap?: SeriesErrorBarCap; +} + +export interface SeriesPointsBorder { + + /**Border color of the point. + * @Default {null} + */ + color?: string; + + /**Border width of the point. + * @Default {null} + */ + width?: number; +} + +export interface SeriesPointsMarkerBorder { + + /**Border color of the marker shape. + * @Default {white} + */ + color?: string; + + /**Border width of the marker shape. + * @Default {3} + */ + width?: number; +} + +export interface SeriesPointsMarkerDataLabelBorder { + + /**Border color of the data label. + * @Default {null} + */ + color?: string; + + /**Border width of the data label. + * @Default {0.1} + */ + width?: number; +} + +export interface SeriesPointsMarkerDataLabelConnectorLine { + + /**Specifies when the connector has to be drawn as Bezier curve or straight line. This is applicable only for Pie and Doughnut chart types. + * @Default {line. See ConnectorLineType} + */ + type?: ej.datavisualization.Chart.ConnectorLineType|string; + + /**Width of the connector. + * @Default {0.5} + */ + width?: number; +} + +export interface SeriesPointsMarkerDataLabelFont { + + /**Font family of the data label. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style of the data label. + * @Default {normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the data label. + * @Default {regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of the text. + * @Default {1} + */ + opacity?: number; + + /**Font size of the data label. + * @Default {12px} + */ + size?: string; +} + +export interface SeriesPointsMarkerDataLabelMargin { + + /**Bottom margin of the text. + * @Default {5} + */ + bottom?: number; + + /**Left margin of the text. + * @Default {5} + */ + left?: number; + + /**Right margin of the text. + * @Default {5} + */ + right?: number; + + /**Top margin of the text. + * @Default {5} + */ + top?: number; +} + +export interface SeriesPointsMarkerDataLabel { + + /**Angle of the data label in degrees. Only the text gets rotated, whereas the background and border does not rotate. + * @Default {null} + */ + angle?: number; + + /**Options for customizing the border of the data label. + */ + border?: SeriesPointsMarkerDataLabelBorder; + + /**Options for displaying and customizing the line that connects point and data label. + */ + connectorLine?: SeriesPointsMarkerDataLabelConnectorLine; + + /**Background color of the data label. + * @Default {null} + */ + fill?: string; + + /**Options for customizing the data label font. + */ + font?: SeriesPointsMarkerDataLabelFont; + + /**Horizontal alignment of the data label. + * @Default {center} + */ + horizontalTextAlignment?: ej.datavisualization.Chart.HorizontalTextAlignment|string; + + /**Margin of the text to its background shape. The size of the background shape increases based on the margin applied to its text. + */ + margin?: SeriesPointsMarkerDataLabelMargin; + + /**Opacity of the data label. + * @Default {1} + */ + opacity?: number; + + /**Background shape of the data label. + * @Default {No shape is rendered by default, so its value is ‘none’. See Shape} + */ + shape?: ej.datavisualization.Chart.Shape|string; + + /**Specifies the position of the data label. This property can be used only for the series such as column, bar, stacked column, stacked bar, 100% stacked column, 100% stacked bar, candle and OHLC. + * @Default {top. See TextPosition} + */ + textPosition?: ej.datavisualization.Chart.TextPosition|string; + + /**Vertical alignment of the data label. + * @Default {'center'} + */ + verticalTextAlignment?: ej.datavisualization.Chart.VerticalTextAlignment|string; + + /**Controls the visibility of the data labels. + * @Default {false} + */ + visible?: boolean; + + /**Custom template to format the data label content. Use “point.x” and “point.y” as a placeholder text to display the corresponding data point’s x and y value. + */ + template?: string; + + /**Moves the label vertically by specified offset. + * @Default {0} + */ + offset?: number; +} + +export interface SeriesPointsMarkerSize { + + /**Height of the marker. + * @Default {6} + */ + height?: number; + + /**Width of the marker. + * @Default {6} + */ + width?: number; +} + +export interface SeriesPointsMarker { + + /**Options for customizing the border of the marker shape. + */ + border?: SeriesPointsMarkerBorder; + + /**Options for displaying and customizing data label. + */ + dataLabel?: SeriesPointsMarkerDataLabel; + + /**Color of the marker shape. + * @Default {null} + */ + fill?: string; + + /**The URL for the Image that is to be displayed as marker. In order to display image as marker, set series.marker.shape as ‘image’. + */ + imageUrl?: string; + + /**Opacity of the marker. + * @Default {1} + */ + opacity?: number; + + /**Specifies the shape of the marker. + * @Default {circle. See Shape} + */ + shape?: ej.datavisualization.Chart.Shape|string; + + /**Options for customizing the size of the marker shape. + */ + size?: SeriesPointsMarkerSize; + + /**Controls the visibility of the marker shape. + * @Default {false} + */ + visible?: boolean; +} + +export interface SeriesPoints { + + /**Options for customizing the border of a point. This is applicable only for column type series and accumulation type series. + */ + border?: SeriesPointsBorder; + + /**To show/hide the intermediate summary from the last intermediate point. + * @Default {false} + */ + showIntermediateSum?: boolean; + + /**To show/hide the total summary of the waterfall series. + * @Default {false} + */ + showTotalSum?: boolean; + + /**Close value of the point. Close value is applicable only for financial type series. + * @Default {null} + */ + close?: number; + + /**Size of a bubble in the bubble series. This is applicable only for the bubble series. + * @Default {null} + */ + size?: number; + + /**Background color of the point. This is applicable only for column type series and accumulation type series. + * @Default {null} + */ + fill?: string; + + /**High value of the point. High value is applicable only for financial type series, range area series and range column series. + * @Default {null} + */ + high?: number; + + /**Low value of the point. Low value is applicable only for financial type series, range area series and range column series. + * @Default {null} + */ + low?: number; + + /**Options for displaying and customizing marker for a data point. Marker contains shapes and/or data labels. + */ + marker?: SeriesPointsMarker; + + /**Open value of the point. This is applicable only for financial type series. + * @Default {null} + */ + open?: number; + + /**Datalabel text for the point. + * @Default {null} + */ + text?: string; + + /**X value of the point. + * @Default {null} + */ + x?: number; + + /**Y value of the point. + * @Default {null} + */ + y?: number; +} + +export interface SeriesTooltipBorder { + + /**Border Color of the tooltip. + * @Default {null} + */ + color?: string; + + /**Border Width of the tooltip. + * @Default {1} + */ + width?: number; +} + +export interface SeriesTooltip { + + /**Options for customizing the border of the tooltip. + */ + border?: SeriesTooltipBorder; + + /**Customize the corner radius of the tooltip rectangle. + * @Default {0} + */ + rx?: number; + + /**Customize the corner radius of the tooltip rectangle. + * @Default {0} + */ + ry?: number; + + /**Specifies the duration, the tooltip has to be displayed. + * @Default {500ms} + */ + duration?: string; + + /**Enables/disables the animation of the tooltip when moving from one point to another. + * @Default {true} + */ + enableAnimation?: boolean; + + /**Background color of the tooltip. + * @Default {null} + */ + fill?: string; + + /**Format of the tooltip content. + * @Default {#point.x# : #point.y#} + */ + format?: string; + + /**Opacity of the tooltip. + * @Default {0.95} + */ + opacity?: number; + + /**Custom template to format the tooltip content. Use “point.x” and “point.y” as a placeholder text to display the corresponding data point’s x and y value. + * @Default {null} + */ + template?: string; + + /**Controls the visibility of the tooltip. + * @Default {false} + */ + visible?: boolean; +} + +export interface SeriesTrendlines { + + /**Show/hides the trendline. + */ + visibility?: boolean; + + /**Specifies the type of trendline for the series. + * @Default {linear. See TrendlinesType} + */ + type?: string; + + /**Name for the trendlines that is to be displayed in legend text. + * @Default {Trendline} + */ + name?: string; + + /**Fill color of the trendlines. + * @Default {#0000FF} + */ + fill?: string; + + /**Width of the trendlines. + * @Default {1} + */ + width?: number; + + /**Opacity of the trendline. + * @Default {1} + */ + opacity?: number; + + /**Pattern of dashes and gaps used to stroke the trendline. + */ + dashArray?: string; + + /**Future trends of the current series. + * @Default {0} + */ + forwardForecast?: number; + + /**Past trends of the current series. + * @Default {0} + */ + backwardForecast?: number; + + /**Specifies the order of polynomial trendlines. + * @Default {0} + */ + polynomialOrder?: number; + + /**Specifies the moving average starting period value. + * @Default {2} + */ + period?: number; +} + +export interface SeriesHighlightSettingsBorder { + + /**Border color of the series/point on highlight. + */ + color?: string; + + /**Border width of the series/point on highlight. + * @Default {2} + */ + width?: string; +} + +export interface SeriesHighlightSettings { + + /**Enables/disables the ability to highlight series or data point interactively. + * @Default {false} + */ + enable?: boolean; + + /**Specifies whether series or data point has to be highlighted. + * @Default {series. See Mode} + */ + mode?: ej.datavisualization.Chart.Mode|string; + + /**Color of the series/point on highlight. + */ + color?: string; + + /**Opacity of the series/point on highlight. + * @Default {0.6} + */ + opacity?: number; + + /**Options for customizing the border of series on highlight. + */ + border?: SeriesHighlightSettingsBorder; + + /**Specifies the pattern for the series/point on highlight. + * @Default {none. See Pattern} + */ + pattern?: string; + + /**Custom pattern for the series on highlight. + */ + customPattern?: string; +} + +export interface SeriesSelectionSettingsBorder { + + /**Border color of the series/point on selection. + */ + color?: string; + + /**Border width of the series/point on selection. + * @Default {2} + */ + width?: string; +} + +export interface SeriesSelectionSettings { + + /**Enables/disables the ability to select a series/data point interactively. + * @Default {false} + */ + enable?: boolean; + + /**Specifies whether series or data point has to be selected. + * @Default {series. See Mode} + */ + mode?: ej.datavisualization.Chart.Mode|string; + + /**Specifies the type of selection. + * @Default {single} + */ + type?: ej.datavisualization.Chart.SelectionType|string; + + /**Color of the series/point on selection. + */ + color?: string; + + /**Opacity of the series/point on selection. + * @Default {0.6} + */ + opacity?: number; + + /**Options for customizing the border of series on selection. + */ + border?: SeriesSelectionSettingsBorder; + + /**Specifies the pattern for the series/point on selection. + * @Default {none. See Pattern} + */ + pattern?: string; + + /**Custom pattern for the series on selection. + */ + customPattern?: string; +} + +export interface Series { + + /**Color of the point, where the close is up in financial chart. + * @Default {null} + */ + bearFillColor?: string; + + /**Options for customizing the border of the series. + */ + border?: SeriesBorder; + + /**Color of the point, where the close is down in financial chart. + * @Default {null} + */ + bullFillColor?: string; + + /**Pattern of dashes and gaps used to stroke the line type series. + */ + dashArray?: string; + + /**Specifies the dataSource for the series. It can be an array of JSON objects or an instance of ej.DataManager. + * @Default {null} + */ + dataSource?: any; + + /**Controls the size of the hole in doughnut series. Value ranges from 0 to 1. + * @Default {0.4} + */ + doughnutCoefficient?: number; + + /**Controls the size of the doughnut series. Value ranges from 0 to 1. + * @Default {0.8} + */ + doughnutSize?: number; + + /**Type of series to be drawn in radar or polar series. + * @Default {line. See DrawType} + */ + drawType?: boolean; + + /**Enable/disable the animation of series. + * @Default {false} + */ + enableAnimation?: boolean; + + /**To avoid overlapping of data labels smartly. + * @Default {null} + */ + enableSmartLabels?: number; + + /**End angle of pie/doughnut series. For a complete circle, it has to be 360, by default. + * @Default {null} + */ + endAngle?: number; + + /**Explodes the pie/doughnut slices on mouse move. + * @Default {false} + */ + explode?: boolean; + + /**Explodes all the slice of pie/doughnut on render. + * @Default {null} + */ + explodeAll?: boolean; + + /**Index of the point to be exploded from pie/doughnut/pyramid/funnel. + * @Default {null} + */ + explodeIndex?: number; + + /**Specifies the distance of the slice from the center, when it is exploded. + * @Default {25} + */ + explodeOffset?: number; + + /**Fill color of the series. + * @Default {null} + */ + fill?: string; + + /**Options for customizing the series font. + */ + font?: SeriesFont; + + /**Specifies the height of the funnel in funnel series. Values can be in both pixel and percentage. + * @Default {32.7%} + */ + funnelHeight?: string; + + /**Specifies the width of the funnel in funnel series. Values can be in both pixel and percentage. + * @Default {11.6%} + */ + funnelWidth?: string; + + /**Gap between the slices of pyramid/funnel series. + * @Default {0} + */ + gapRatio?: number; + + /**Specifies whether to join start and end point of a line/area series used in polar/radar chart to form a closed path. + * @Default {true} + */ + isClosed?: boolean; + + /**Specifies whether to stack the column series in polar/radar charts. + * @Default {true} + */ + isStacking?: boolean; + + /**Renders the chart vertically. This is applicable only for cartesian type series. + * @Default {false} + */ + isTransposed?: boolean; + + /**Position of the data label in pie/doughnut/pyramid/funnel series. OutsideExtended position is not applicable for pyramid/funnel. + * @Default {inside. See LabelPosition} + */ + labelPosition?: ej.datavisualization.Chart.LabelPosition|string; + + /**Specifies the line cap of the series. + * @Default {Butt. See LineCap} + */ + lineCap?: ej.datavisualization.Chart.LineCap|string; + + /**Specifies the type of shape to be used where two lines meet. + * @Default {Round. See LineJoin} + */ + lineJoin?: ej.datavisualization.Chart.LineJoin|string; + + /**Options for displaying and customizing marker for individual point in a series. Marker contains shapes and/or data labels. + */ + marker?: SeriesMarker; + + /**Opacity of the series. + * @Default {1} + */ + opacity?: number; + + /**Name of a field in data source where fill color for all the data points is generated. + */ + palette?: string; + + /**Controls the size of pie series. Value ranges from 0 to 1. + * @Default {0.8} + */ + pieCoefficient?: number; + + /**Options for customizing the empty point in the series. + */ + emptyPointSettings?: SeriesEmptyPointSettings; + + /**Fill color for the positive column of the waterfall. + * @Default {null} + */ + positiveFill?: string; + + /**Options for customizing the waterfall connector line. + */ + connectorLine?: SeriesConnectorLine; + + /**Options to customize the error bar in series. + */ + errorBar?: SeriesErrorBar; + + /**Option to add data points; each point should have x and y property. Also, optionally, you can customize the points color, border, marker by using fill, border and marker options. + */ + points?: Array; + + /**Specifies the mode of the pyramid series. + * @Default {linear} + */ + pyramidMode?: ej.datavisualization.Chart.PyramidMode|string; + + /**Specifies ej.Query to select data from dataSource. This property is applicable only when the dataSource is ej.DataManager. + * @Default {null} + */ + query?: any; + + /**Start angle from where the pie/doughnut series renders. It starts from 0, by default. + * @Default {null} + */ + startAngle?: number; + + /**Options for customizing the tooltip of chart. + */ + tooltip?: SeriesTooltip; + + /**Specifies the type of the series to render in chart. + * @Default {column. see Type} + */ + type?: ej.datavisualization.Chart.Type|string; + + /**Controls the visibility of the series. + * @Default {visible} + */ + visibility?: string; + + /**Specifies the name of the x-axis that has to be associated with this series. Add an axis instance with this name to axes collection. + * @Default {null} + */ + xAxisName?: string; + + /**Name of the property in the datasource that contains x value for the series. + * @Default {null} + */ + xName?: string; + + /**Specifies the name of the y-axis that has to be associated with this series. Add an axis instance with this name to axes collection. + * @Default {null} + */ + yAxisName?: string; + + /**Name of the property in the datasource that contains y value for the series. + * @Default {null} + */ + yName?: string; + + /**Name of the property in the datasource that contains high value for the series. + * @Default {null} + */ + high?: string; + + /**Name of the property in the datasource that contains low value for the series. + * @Default {null} + */ + low?: string; + + /**Name of the property in the datasource that contains open value for the series. + * @Default {null} + */ + open?: string; + + /**Name of the property in the datasource that contains close value for the series. + * @Default {null} + */ + close?: string; + + /**Name of the property in the datasource that contains the size value for the bubble series. + * @Default {null} + */ + size?: string; + + /**Option to add trendlines to chart. + */ + trendlines?: Array; + + /**Options for customizing the appearance of the series or data point while highlighting. + */ + highlightSettings?: SeriesHighlightSettings; + + /**Options for customizing the appearance of the series/data point on selection. + */ + selectionSettings?: SeriesSelectionSettings; +} + +export interface Size { + + /**Height of the Chart. Height can be specified in either pixel or percentage. + * @Default {'450'} + */ + height?: string; + + /**Width of the Chart. Width can be specified in either pixel or percentage. + * @Default {'450'} + */ + width?: string; +} + +export interface TitleBorder { + + /**Width of the title border. + * @Default {1} + */ + width?: number; + + /**color of the title border. + * @Default {transparent} + */ + color?: string; + + /**opacity of the title border. + * @Default {0.8} + */ + opacity?: number; + + /**opacity of the title border. + * @Default {0.8} + */ + cornerRadius?: number; +} + +export interface TitleFont { + + /**Font family for Chart title. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style for Chart title. + * @Default {Normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight for Chart title. + * @Default {Regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of the Chart title. + * @Default {0.5} + */ + opacity?: number; + + /**Font size for Chart title. + * @Default {20px} + */ + size?: string; +} + +export interface TitleSubTitleFont { + + /**Font family of sub title. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style for sub title. + * @Default {Normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight for sub title. + * @Default {Regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of the sub title. + * @Default {1} + */ + opacity?: number; + + /**Font size for sub title. + * @Default {12px} + */ + size?: string; +} + +export interface TitleSubTitleBorder { + + /**Width of the subtitle border. + * @Default {1} + */ + width?: number; + + /**color of the subtitle border. + * @Default {transparent} + */ + color?: string; + + /**opacity of the subtitle border. + * @Default {0.8} + */ + opacity?: number; + + /**opacity of the subtitle border. + * @Default {0.8} + */ + cornerRadius?: number; +} + +export interface TitleSubTitle { + + /**Options for customizing the font of sub title. + */ + font?: TitleSubTitleFont; + + /**Background color for the chart subtitle. + * @Default {transparent} + */ + background?: string; + + /**Options to customize the border of the title. + */ + border?: TitleSubTitleBorder; + + /**Text to be displayed in sub title. + */ + text?: string; + + /**Alignment of sub title text. + * @Default {far. See TextAlignment} + */ + textAlignment?: ej.datavisualization.Chart.Alignment|string; +} + +export interface Title { + + /**Background color for the chart title. + * @Default {transparent} + */ + background?: string; + + /**Options to customize the border of the title. + */ + border?: TitleBorder; + + /**Options for customizing the font of Chart title. + */ + font?: TitleFont; + + /**Options to customize the sub title of Chart. + */ + subTitle?: TitleSubTitle; + + /**Text to be displayed in Chart title. + */ + text?: string; + + /**Alignment of the title text. + * @Default {Center. See TextAlignment} + */ + textAlignment?: ej.datavisualization.Chart.Alignment|string; +} + +export interface Zooming { + + /**Enables or disables zooming. + * @Default {false} + */ + enable?: boolean; + + /**Enable or disables the differed zooming. When it is enabled, chart is updated only on mouse up action while zooming and panning. + * @Default {false} + */ + enableDeferredZoom?: boolean; + + /**Enables/disables the ability to zoom the chart on moving the mouse wheel. + * @Default {false} + */ + enableMouseWheel?: boolean; + + /**Specifies whether to allow zooming the chart vertically or horizontally or in both ways. + * @Default {'x,y'} + */ + type?: string; + + /**To display user specified buttons in zooming toolbar. + * @Default {[zoomIn, zoomOut, zoom, pan, reset]} + */ + toolbarItems?: Array; +} +} +module Chart +{ +enum CoordinateUnit +{ +//string +None, +//string +Pixels, +//string +Points, +} +} +module Chart +{ +enum HorizontalAlignment +{ +//string +Left, +//string +Right, +//string +Middle, +} +} +module Chart +{ +enum Region +{ +//string +Chart, +//string +Series, +} +} +module Chart +{ +enum VerticalAlignment +{ +//string +Top, +//string +Bottom, +//string +Middle, +} +} +module Chart +{ +enum Unit +{ +//string +Percentage, +//string +Pixel, +} +} +module Chart +{ +enum DrawType +{ +//string +Line, +//string +Area, +//string +Column, +} +} +module Chart +{ +enum FontStyle +{ +//string +Normal, +//string +Italic, +} +} +module Chart +{ +enum FontWeight +{ +//string +Regular, +//string +Bold, +//string +Lighter, +} +} +module Chart +{ +enum LabelPosition +{ +//string +Inside, +//string +Outside, +//string +OutsideExtended, +} +} +module Chart +{ +enum LineCap +{ +//string +Butt, +//string +Round, +//string +Square, +} +} +module Chart +{ +enum LineJoin +{ +//string +Round, +//string +Bevel, +//string +Miter, +} +} +module Chart +{ +enum ConnectorLineType +{ +//string +Line, +//string +Bezier, +} +} +module Chart +{ +enum HorizontalTextAlignment +{ +//string +Center, +//string +Near, +//string +Far, +} +} +module Chart +{ +enum Shape +{ +//string +None, +//string +LeftArrow, +//string +RightArrow, +//string +Circle, +//string +Cross, +//string +HorizLine, +//string +VertLine, +//string +Diamond, +//string +Rectangle, +//string +Triangle, +//string +Hexagon, +//string +Pentagon, +//string +Star, +//string +Ellipse, +//string +Trapezoid, +//string +UpArrow, +//string +DownArrow, +//string +Image, +//string +SeriesType, +} +} +module Chart +{ +enum TextPosition +{ +//string +Top, +//string +Bottom, +//string +Middle, +} +} +module Chart +{ +enum VerticalTextAlignment +{ +//string +Center, +//string +Near, +//string +Far, +} +} +module Chart +{ +enum PyramidMode +{ +//string +Linear, +//string +Surface, +} +} +module Chart +{ +enum Type +{ +//string +Area, +//string +Line, +//string +Spline, +//string +Column, +//string +Scatter, +//string +Bubble, +//string +SplineArea, +//string +StepArea, +//string +StepLine, +//string +Pie, +//string +Hilo, +//string +HiloOpenClose, +//string +Candle, +//string +Bar, +//string +StackingArea, +//string +StackingArea100, +//string +RangeColumn, +//string +StackingColumn, +//string +StackingColumn100, +//string +StackingBar, +//string +StackingBar100, +//string +Pyramid, +//string +Funnel, +//string +Doughnut, +//string +Polar, +//string +Radar, +//string +RangeArea, +} +} +module Chart +{ +enum EmptyPointMode +{ +//string +Gap, +//string +Zero, +//string +Average, +} +} +module Chart +{ +enum ErrorBarType +{ +//string +FixedValue, +//string +Percentage, +//string +StandardDeviation, +//string +StandardError, +} +} +module Chart +{ +enum ErrorBarMode +{ +//string +Both, +//string +Vertical, +//string +Horizontal, +} +} +module Chart +{ +enum ErrorBarDirection +{ +//string +Both, +//string +Plus, +//string +Minus, +} +} +module Chart +{ +enum Mode +{ +//string +Series, +//string +Point, +//string +Cluster, +} +} +module Chart +{ +enum SelectionType +{ +//string +Single, +//string +Multiple, +} +} +module Chart +{ +enum CrosshairType +{ +//string +Crosshair, +//string +Trackball, +} +} +module Chart +{ +enum Alignment +{ +//string +Center, +//string +Near, +//string +Far, +} +} +module Chart +{ +enum Position +{ +//string +Left, +//string +Right, +//string +Top, +//string +Bottom, +} +} +module Chart +{ +enum TextOverflow +{ +//string +None, +//string +Trim, +//string +Wrap, +//string +WrapAndTrim, +} +} +module Chart +{ +enum EdgeLabelPlacement +{ +//string +None, +//string +Shift, +//string +Hide, +} +} +module Chart +{ +enum IntervalType +{ +//string +Days, +//string +Hours, +//string +Seconds, +//string +Milliseconds, +//string +Minutes, +//string +Months, +//string +Years, +} +} +module Chart +{ +enum LabelIntersectAction +{ +//string +None, +//string +Rotate90, +//string +Rotate45, +//string +Wrap, +//string +WrapByword, +//string +Trim, +//string +Hide, +//string +MultipleRows, +} +} +module Chart +{ +enum RangePadding +{ +//string +Additional, +//string +Normal, +//string +None, +//string +Round, +} +} +module Chart +{ +enum TextAlignment +{ +//string +MiddleTop, +//string +MiddleCenter, +//string +MiddleBottom, +} +} +module Chart +{ +enum ZIndex +{ +//string +Inside, +//string +Over, +} +} +module Chart +{ +enum TickLinesPosition +{ +//string +Inside, +//string +Outside, +} +} +module Chart +{ +enum ValueType +{ +//string +Double, +//string +Category, +//string +DateTime, +//string +Logarithmic, +} +} +module Chart +{ +enum Theme +{ +//string +Azure, +//string +FlatLight, +//string +FlatDark, +//string +Azuredark, +//string +Lime, +//string +LimeDark, +//string +Saffron, +//string +SaffronDark, +//string +GradientLight, +//string +GradientDark, +} +} + +class RangeNavigator extends ej.Widget { + static fn: RangeNavigator; + constructor(element: JQuery, options?: RangeNavigator.Model); + constructor(element: Element, options?: RangeNavigator.Model); + model:RangeNavigator.Model; + defaults:RangeNavigator.Model; + + /** destroy the range navigator widget + * @returns {void} + */ + _destroy (): void; +} +export module RangeNavigator{ + +export interface Model { + + /**Toggles the placement of slider exactly on the place it left or on the nearest interval. + * @Default {false} + */ + allowSnapping?: boolean; + + /**Specifies the data source for range navigator. + */ + dataSource?: any; + + /**Sets a value whether to make the range navigator responsive on resize. + * @Default {false} + */ + enableAutoResizing?: boolean; + + /**Toggles the redrawing of chart on moving the sliders. + * @Default {true} + */ + enableDeferredUpdate?: boolean; + + /**Toggles the direction of rendering the range navigator control. + * @Default {false} + */ + enableRTL?: boolean; + + /**Options for customizing the labels colors, font, style, size, horizontalAlignment and opacity. + */ + labelSettings?: LabelSettings; + + /**This property is to specify the localization of range navigator. + * @Default {en-US} + */ + locale?: string; + + /**Options for customizing the range navigator. + */ + navigatorStyleSettings?: NavigatorStyleSettings; + + /**Padding specifies the gap between the container and the range navigator. + * @Default {0} + */ + padding?: string; + + /**If the range is not given explicitly, range will be calculated automatically. + * @Default {none} + */ + rangePadding?: ej.datavisualization.RangeNavigator.RangePadding|string; + + /**Options for customizing the starting and ending ranges. + */ + rangeSettings?: RangeSettings; + + /**selectedData is for getting the data when the "rangeChanged" event trigger from client side. + */ + selectedData?: any; + + /**Options for customizing the start and end range values. + */ + selectedRangeSettings?: SelectedRangeSettings; + + /**Contains property to customize the hight and width of range navigator. + */ + sizeSettings?: SizeSettings; + + /**By specifying this property the user can change the theme of the range navigator. + * @Default {null} + */ + theme?: string; + + /**Options for customizing the tooltip in range navigator. + */ + tooltipSettings?: TooltipSettings; + + /**Options for configuring minor grid lines, major grid lines, axis line of axis. + */ + valueAxisSettings?: ValueAxisSettings; + + /**You can plot data of type date time or numeric. This property determines the type of data that this axis will handle. + * @Default {datetime} + */ + valueType?: ej.datavisualization.RangeNavigator.ValueType|string; + + /**Specifies the xName for dataSource. This is used to take the x values from dataSource + */ + xName?: any; + + /**Specifies the yName for dataSource. This is used to take the y values from dataSource + */ + yName?: any; + + /**Fires on load of range navigator.*/ + load? (e: LoadEventArgs): void; + + /**Fires after range navigator is loaded.*/ + loaded? (e: LoadedEventArgs): void; + + /**Fires on changing the range of range navigator.*/ + rangeChanged? (e: RangeChangedEventArgs): void; +} + +export interface LoadEventArgs { + + /**parameters from range navigator + */ + Data?: any; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the range navigator model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface LoadedEventArgs { + + /**parameters from range navigator + */ + Data?: any; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the range navigator model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface RangeChangedEventArgs { + + /**parameters from range navigator + */ + Data?: any; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the range navigator model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface LabelSettingsHigherLevelBorder { + + /**Specifies the border color of grid lines. + * @Default {transparent} + */ + color?: string; + + /**Specifies the border width of grid lines. + * @Default {0.5} + */ + width?: string; +} + +export interface LabelSettingsHigherLevelGridLineStyle { + + /**Specifies the color of grid lines in higher level. + * @Default {#B5B5B5} + */ + color?: string; + + /**Specifies the dashArray of grid lines in higher level. + * @Default {20 5 0} + */ + dashArray?: string; + + /**Specifies the width of grid lines in higher level. + * @Default {#B5B5B5} + */ + width?: string; +} + +export interface LabelSettingsHigherLevelStyleFont { + + /**Specifies the label font color. Labels render with the specified font color. + * @Default {black} + */ + color?: string; + + /**Specifies the label font family. Labels render with the specified font family. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Specifies the label font style. Labels render with the specified font style. + * @Default {Normal} + */ + fontStyle?: string; + + /**Specifies the label font weight. Labels render with the specified font weight. + * @Default {regular} + */ + fontWeight?: string; + + /**Specifies the label opacity. Labels render with the specified opacity. + * @Default {1} + */ + opacity?: number; + + /**Specifies the label font size. Labels render with the specified font size. + * @Default {12px} + */ + size?: string; +} + +export interface LabelSettingsHigherLevelStyle { + + /**Options for customizing the font properties. + */ + font?: LabelSettingsHigherLevelStyleFont; + + /**Specifies the horizontal text alignment of the text in label. + * @Default {middle} + */ + horizontalAlignment?: string; +} + +export interface LabelSettingsHigherLevel { + + /**Options for customizing the border of grid lines in higher level. + */ + border?: LabelSettingsHigherLevelBorder; + + /**Specifies the fill color of higher level labels. + * @Default {transparent} + */ + fill?: string; + + /**Options for customizing the grid line colors, width, dashArray, border. + */ + gridLineStyle?: LabelSettingsHigherLevelGridLineStyle; + + /**Specifies the intervalType for higher level labels. See IntervalType + * @Default {years} + */ + intervalType?: ej.datavisualization.RangeNavigator.IntervalType|string; + + /**Specifies the position of the labels to render either inside or outside of plot area + * @Default {outside} + */ + labelPlacement?: ej.datavisualization.RangeNavigator.LabelPlacement|string; + + /**Specifies the position of the labels in higher level + * @Default {top} + */ + position?: ej.datavisualization.RangeNavigator.Position|string; + + /**Options for customizing the style of higher level labels. + */ + style?: LabelSettingsHigherLevelStyle; + + /**Toggles the visibility of higher level labels. + * @Default {true} + */ + visible?: boolean; +} + +export interface LabelSettingsLowerLevelBorder { + + /**Specifies the border color of grid lines. + * @Default {transparent} + */ + color?: string; + + /**Specifies the border width of grid lines. + * @Default {0.5} + */ + width?: string; +} + +export interface LabelSettingsLowerLevelGridLineStyle { + + /**Specifies the color of grid lines in lower level. + * @Default {#B5B5B5} + */ + color?: string; + + /**Specifies the dashArray of gridLines in lowerLevel. + * @Default {20 5 0} + */ + dashArray?: string; + + /**Specifies the width of grid lines in lower level. + * @Default {#B5B5B5} + */ + width?: string; +} + +export interface LabelSettingsLowerLevelStyleFont { + + /**Specifies the color of labels. Label text render in this specified color. + * @Default {black} + */ + color?: string; + + /**Specifies the font family of labels. Label text render in this specified font family. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Specifies the font style of labels. Label text render in this specified font style. + * @Default {Normal} + */ + fontStyle?: string; + + /**Specifies the font weight of labels. Label text render in this specified font weight. + * @Default {regular} + */ + fontWeight?: string; + + /**Specifies the opacity of labels. Label text render in this specified opacity. + * @Default {12px} + */ + opacity?: string; + + /**Specifies the size of labels. Label text render in this specified size. + * @Default {12px} + */ + size?: string; +} + +export interface LabelSettingsLowerLevelStyle { + + /**Options for customizing the font of labels. + */ + font?: LabelSettingsLowerLevelStyleFont; + + /**Specifies the horizontal text alignment of the text in label. + * @Default {middle} + */ + horizontalAlignment?: string; +} + +export interface LabelSettingsLowerLevel { + + /**Options for customizing the border of grid lines in lower level. + */ + border?: LabelSettingsLowerLevelBorder; + + /**Specifies the fill color of labels in lower level. + * @Default {transparent} + */ + fill?: string; + + /**Options for customizing the grid lines in lower level. + */ + gridLineStyle?: LabelSettingsLowerLevelGridLineStyle; + + /**Specifies the intervalType of the labels in lower level.See IntervalType + * @Default {years} + */ + intervalType?: ej.datavisualization.RangeNavigator.IntervalType|string; + + /**Specifies the position of the labels to render either inside or outside of plot area. See LabelPlacement + * @Default {outside} + */ + labelPlacement?: ej.datavisualization.RangeNavigator.LabelPlacement|string; + + /**Specifies the position of the labels in lower level.See Position + * @Default {bottom} + */ + position?: ej.datavisualization.RangeNavigator.Position|string; + + /**Options for customizing the style of labels. + */ + style?: LabelSettingsLowerLevelStyle; + + /**Toggles the visibility of labels in lower level. + * @Default {true} + */ + visible?: boolean; +} + +export interface LabelSettingsStyleFont { + + /**Specifies the label color. This color is applied to the labels in range navigator. + * @Default {#FFFFFF} + */ + color?: string; + + /**Specifies the label font family. Labels render with the specified font family. + * @Default {Segoe UI} + */ + family?: string; + + /**Specifies the label font opacity. Labels render with the specified font opacity. + * @Default {1} + */ + opacity?: number; + + /**Specifies the label font size. Labels render with the specified font size. + * @Default {1px} + */ + size?: string; + + /**Specifies the label font style. Labels render with the specified font style.. + * @Default {Normal} + */ + style?: ej.datavisualization.RangeNavigator.FontStyle|string; + + /**Specifies the lable font weight + * @Default {regular} + */ + weight?: ej.datavisualization.RangeNavigator.FontWeight|string; +} + +export interface LabelSettingsStyle { + + /**Options for customizing the font of labels in range navigator. + */ + font?: LabelSettingsStyleFont; + + /**Specifies the horizontalAlignment of the label in RangeNavigator + * @Default {middle} + */ + horizontalAlignment?: ej.datavisualization.RangeNavigator.HorizontalAlignment|string; +} + +export interface LabelSettings { + + /**Options for customizing the higher level labels in range navigator. + */ + higherLevel?: LabelSettingsHigherLevel; + + /**Options for customizing the labels in lower level. + */ + lowerLevel?: LabelSettingsLowerLevel; + + /**Options for customizing the style of labels in range navigator. + */ + style?: LabelSettingsStyle; +} + +export interface NavigatorStyleSettingsBorder { + + /**Specifies the border color of range navigator. + * @Default {transparent} + */ + color?: string; + + /**Specifies the dash array of range navigator. + * @Default {null} + */ + dashArray?: string; + + /**Specifies the border width of range navigator. + * @Default {0.5} + */ + width?: number; +} + +export interface NavigatorStyleSettingsMajorGridLineStyle { + + /**Specifies the color of major grid lines in range navigator. + * @Default {#B5B5B5} + */ + color?: string; + + /**Toggles the visibility of major grid lines. + * @Default {true} + */ + visible?: boolean; +} + +export interface NavigatorStyleSettingsMinorGridLineStyle { + + /**Specifies the color of minor grid lines in range navigator. + * @Default {#B5B5B5} + */ + color?: string; + + /**Toggles the visibility of minor grid lines. + * @Default {true} + */ + visible?: boolean; +} + +export interface NavigatorStyleSettings { + + /**Specifies the background color of range navigator. + * @Default {#dddddd} + */ + background?: string; + + /**Options for customizing the border color and width of range navigator. + */ + border?: NavigatorStyleSettingsBorder; + + /**Specifies the left side thumb template in range navigator we can give either div id or html string + * @Default {null} + */ + leftThumbTemplate?: string; + + /**Options for customizing the major grid lines. + */ + majorGridLineStyle?: NavigatorStyleSettingsMajorGridLineStyle; + + /**Options for customizing the minor grid lines. + */ + minorGridLineStyle?: NavigatorStyleSettingsMinorGridLineStyle; + + /**Specifies the opacity of RangeNavigator. + * @Default {1} + */ + opacity?: number; + + /**Specifies the right side thumb template in range navigator we can give either div id or html string + * @Default {null} + */ + rightThumbTemplate?: string; + + /**Specifies the color of the selected region in range navigator. + * @Default {#EFEFEF} + */ + selectedRegionColor?: string; + + /**Specifies the opacity of Selected Region. + * @Default {0} + */ + selectedRegionOpacity?: number; + + /**Specifies the color of the thumb in range navigator. + * @Default {#2382C3} + */ + thumbColor?: string; + + /**Specifies the radius of the thumb in range navigator. + * @Default {10} + */ + thumbRadius?: number; + + /**Specifies the stroke color of the thumb in range navigator. + * @Default {#303030} + */ + thumbStroke?: string; + + /**Specifies the color of the unselected region in range navigator. + * @Default {#5EABDE} + */ + unselectedRegionColor?: string; + + /**Specifies the opacity of Unselected Region. + * @Default {0.3} + */ + unselectedRegionOpacity?: number; +} + +export interface RangeSettings { + + /**Specifies the ending range of range navigator. + * @Default {null} + */ + end?: string; + + /**Specifies the starting range of range navigator. + * @Default {null} + */ + start?: string; +} + +export interface SelectedRangeSettings { + + /**Specifies the ending range of range navigator. + * @Default {null} + */ + end?: string; + + /**Specifies the starting range of range navigator. + * @Default {null} + */ + start?: string; +} + +export interface SizeSettings { + + /**Specifies height of the range navigator. + * @Default {null} + */ + height?: string; + + /**Specifies width of the range navigator. + * @Default {null} + */ + width?: string; +} + +export interface TooltipSettingsFont { + + /**Specifies the color of text in tooltip. Tooltip text render in the specified color. + * @Default {#FFFFFF} + */ + color?: string; + + /**Specifies the font family of text in tooltip. Tooltip text render in the specified font family. + * @Default {Segoe UI} + */ + family?: string; + + /**Specifies the font style of text in tooltip. Tooltip text render in the specified font style. + * @Default {ej.datavisualization.RangeNavigator.fontStyle.Normal} + */ + fontStyle?: string; + + /**Specifies the opacity of text in tooltip. Tooltip text render in the specified opacity. + * @Default {1} + */ + opacity?: number; + + /**Specifies the size of text in tooltip. Tooltip text render in the specified size. + * @Default {10px} + */ + size?: string; + + /**Specifies the weight of text in tooltip. Tooltip text render in the specified weight. + * @Default {ej.datavisualization.RangeNavigator.weight.Regular} + */ + weight?: string; +} + +export interface TooltipSettings { + + /**Specifies the background color of tooltip. + * @Default {#303030} + */ + backgroundColor?: string; + + /**Options for customizing the font in tooltip. + */ + font?: TooltipSettingsFont; + + /**Specifies the format of text to be displayed in tooltip. + * @Default {MM/dd/yyyy} + */ + labelFormat?: string; + + /**Specifies the mode of displaying the tooltip. Neither to display the tooltip always nor on demand. + * @Default {null} + */ + tooltipDisplayMode?: string; + + /**Toggles the visibility of tooltip. + * @Default {true} + */ + visible?: boolean; +} + +export interface ValueAxisSettingsAxisLine { + + /**Toggles the visibility of axis line. + * @Default {none} + */ + visible?: string; +} + +export interface ValueAxisSettingsFont { + + /**Text in axis render with the specified size. + * @Default {0px} + */ + size?: string; +} + +export interface ValueAxisSettingsMajorGridLines { + + /**Toggles the visibility of major grid lines. + * @Default {false} + */ + visible?: boolean; +} + +export interface ValueAxisSettingsMajorTickLines { + + /**Specifies the size of the majorTickLines in range navigator + * @Default {0} + */ + size?: number; + + /**Toggles the visibility of major tick lines. + * @Default {true} + */ + visible?: boolean; + + /**Specifies width of the major tick lines. + * @Default {0} + */ + width?: number; +} + +export interface ValueAxisSettings { + + /**Options for customizing the axis line. + */ + axisLine?: ValueAxisSettingsAxisLine; + + /**Options for customizing the font of the axis. + */ + font?: ValueAxisSettingsFont; + + /**Options for customizing the major grid lines. + */ + majorGridLines?: ValueAxisSettingsMajorGridLines; + + /**Options for customizing the major tick lines in axis. + */ + majorTickLines?: ValueAxisSettingsMajorTickLines; + + /**If the range is not given explicitly, range will be calculated automatically. You can customize the automatic range calculation using rangePadding. + * @Default {none} + */ + rangePadding?: string; + + /**Toggles the visibility of axis in range navigator. + * @Default {false} + */ + visible?: boolean; +} +} +module RangeNavigator +{ +enum IntervalType +{ +//string +Years, +//string +Quarters, +//string +Months, +//string +Weeks, +//string +Days, +//string +Hours, +} +} +module RangeNavigator +{ +enum LabelPlacement +{ +//string +Inside, +//string +Outside, +} +} +module RangeNavigator +{ +enum Position +{ +//string +Top, +//string +Bottom, +} +} +module RangeNavigator +{ +enum FontStyle +{ +//string +Normal, +//string +Bold, +//string +Italic, +} +} +module RangeNavigator +{ +enum FontWeight +{ +//string +Regular, +//string +Lighter, +} +} +module RangeNavigator +{ +enum HorizontalAlignment +{ +//string +Middle, +//string +Left, +//string +Right, +} +} +module RangeNavigator +{ +enum RangePadding +{ +//string +Additional, +//string +Normal, +//string +None, +//string +Round, +} +} +module RangeNavigator +{ +enum ValueType +{ +//string +Numeric, +//string +DateTime, +} +} + +class BulletGraph extends ej.Widget { + static fn: BulletGraph; + constructor(element: JQuery, options?: BulletGraph.Model); + constructor(element: Element, options?: BulletGraph.Model); + model:BulletGraph.Model; + defaults:BulletGraph.Model; + + /** To destroy the bullet graph + * @returns {void} + */ + destroy (): void; + + /** To redraw the bulet graph + * @returns {void} + */ + redraw(): void; + + /** To set the value for comparative measure in bullet graph. + * @returns {void} + */ + setComparativeMeasureSymbol(): void; + + /** To set the value for feature measure bar. + * @returns {void} + */ + setFeatureMeasureBarValue(): void; +} +export module BulletGraph{ + +export interface Model { + + /**Toggles the visibility of the range stroke color of the labels. + * @Default {false} + */ + applyRangeStrokeToLabels?: boolean; + + /**Toggles the visibility of the range stroke color of the ticks. + * @Default {false} + */ + applyRangeStrokeToTicks?: boolean; + + /**Contains property to customize the caption in bullet graph. + */ + captionSettings?: CaptionSettings; + + /**Comparative measure bar in bullet graph render till the specified value. + * @Default {0} + */ + comparativeMeasureValue?: number; + + /**Toggles the animation of bullet graph. + * @Default {true} + */ + enableAnimation?: boolean; + + /**Sets a value whether to make the bullet graph responsive on resize. + * @Default {true} + */ + enableResizing?: boolean; + + /**Specifies the direction of flow in bullet graph. Neither it may be backward nor forward. + * @Default {forward} + */ + flowDirection?: ej.datavisualization.BulletGraph.FlowDirection|string; + + /**Specifies the height of the bullet graph. + * @Default {90} + */ + height?: number; + + /**Bullet graph will render in the specified orientation. + * @Default {horizontal} + */ + orientation?: ej.datavisualization.BulletGraph.Orientation|string; + + /**Contains property to customize the qualitative ranges. + */ + qualitativeRanges?: Array; + + /**Size of the qualitative range depends up on the specified value. + * @Default {32} + */ + qualitativeRangeSize?: number; + + /**Length of the quantitative range depends up on the specified value. + * @Default {475} + */ + quantitativeScaleLength?: number; + + /**Contains all the properties to customize quantitative scale. + */ + quantitativeScaleSettings?: QuantitativeScaleSettings; + + /**By specifying this property the user can change the theme of the bullet graph. + * @Default {flatlight} + */ + theme?: string; + + /**Contains all the properties to customize tooltip. + */ + tooltipSettings?: TooltipSettings; + + /**Feature measure bar in bullet graph render till the specified value. + * @Default {0} + */ + value?: number; + + /**Specifies the width of the bullet graph. + * @Default {595} + */ + width?: number; + + /**Fires on rendering the caption of bullet graph.*/ + drawCaption? (e: DrawCaptionEventArgs): void; + + /**Fires on rendering the category.*/ + drawCategory? (e: DrawCategoryEventArgs): void; + + /**Fires on rendering the comparative measure symbol.*/ + drawComparativeMeasureSymbol? (e: DrawComparativeMeasureSymbolEventArgs): void; + + /**Fires on rednering the feature measure bar.*/ + drawFeatureMeasureBar? (e: DrawFeatureMeasureBarEventArgs): void; + + /**Fires on rendering the indicator of bullet graph.*/ + drawIndicator? (e: DrawIndicatorEventArgs): void; + + /**Fires on rendering the labels.*/ + drawLabels? (e: DrawLabelsEventArgs): void; + + /**Fires on rendering the qualitative ranges.*/ + drawQualitativeRanges? (e: DrawQualitativeRangesEventArgs): void; + + /**Fires on loading bullet graph.*/ + load? (e: LoadEventArgs): void; +} + +export interface DrawCaptionEventArgs { + + /**returns the object of the bullet graph. + */ + Object?: any; + + /**returns the options of the scale element. + */ + scaleElement?: HTMLElement; + + /**returns the current captionSettings element. + */ + captionElement?: HTMLElement; + + /**returns the type of the captionSettings. + */ + captionType?: string; +} + +export interface DrawCategoryEventArgs { + + /**returns the object of the bullet graph. + */ + Object?: any; + + /**returns the options of the scale element. + */ + scaleElement?: HTMLElement; + + /**returns the options of category element. + */ + categoryElement?: HTMLElement; + + /**returns the text value of the category that is drawn. + */ + Value?: string; +} + +export interface DrawComparativeMeasureSymbolEventArgs { + + /**returns the object of the bullet graph. + */ + Object?: any; + + /**returns the options of the scale element. + */ + scaleElement?: HTMLElement; + + /**returns the options of comparative measure element. + */ + targetElement?: HTMLElement; + + /**returns the value of the comparative measure symbol. + */ + Value?: number; +} + +export interface DrawFeatureMeasureBarEventArgs { + + /**returns the object of the bullet graph. + */ + Object?: any; + + /**returns the options of the scale element. + */ + scaleElement?: HTMLElement; + + /**returns the options of feature measure element. + */ + currentElement?: HTMLElement; + + /**returns the value of the feature measure bar. + */ + Value?: number; +} + +export interface DrawIndicatorEventArgs { + + /**returns an object to customize bullet graph indicator text and symbol before rendering it. + */ + indicatorSettings?: any; + + /**returns the object of bullet graph. + */ + model?: any; + + /**returns the type of event. + */ + type?: string; + + /**for cancelling the event. + */ + cancel?: boolean; +} + +export interface DrawLabelsEventArgs { + + /**returns the object of the bullet graph. + */ + Object?: any; + + /**returns the options of the scale element. + */ + scaleElement?: HTMLElement; + + /**returns the current label element. + */ + tickElement?: HTMLElement; + + /**returns the label type. + */ + labelType?: string; +} + +export interface DrawQualitativeRangesEventArgs { + + /**returns the object of the bullet graph. + */ + Object?: any; + + /**returns the index of current range. + */ + rangeIndex?: number; + + /**returns the settings for current range. + */ + rangeOptions?: any; + + /**returns the end value of current range. + */ + rangeEndValue?: number; +} + +export interface LoadEventArgs { +} + +export interface CaptionSettingsFont { + + /**Specifies the color of the text in caption. + * @Default {null} + */ + color?: string; + + /**Specifies the fontFamily of caption. Caption text render with this fontFamily + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Specifies the fontStyle of caption + * @Default {Normal} + */ + fontStyle?: ej.datavisualization.BulletGraph.FontStyle|string; + + /**Specifies the fontWeight of caption + * @Default {regular} + */ + fontWeight?: ej.datavisualization.BulletGraph.FontWeight|string; + + /**Specifies the opacity of caption. Caption text render with this opacity. + * @Default {1} + */ + opacity?: number; + + /**Specifies the size of caption. Caption text render with this size + * @Default {12px} + */ + size?: string; +} + +export interface CaptionSettingsIndicatorFont { + + /**Specifies the color of the indicator's text. + * @Default {null} + */ + color?: string; + + /**Specifies the fontFamily of indicator. Indicator text render with this fontFamily. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Specifies the fontStyle of indicator. Indicator text render with this fontStyle. See FontStyle + * @Default {Normal} + */ + fontStyle?: ej.datavisualization.BulletGraph.FontStyle|string; + + /**Specifies the fontWeight of indicator. Indicator text render with this fontWeight. See FontWeight + * @Default {regular} + */ + fontWeight?: ej.datavisualization.BulletGraph.FontWeight|string; + + /**Specifies the opacity of indicator text. Indicator text render with this Opacity. + * @Default {1} + */ + opacity?: number; + + /**Specifies the size of indicator. Indicator text render with this size. + * @Default {12px} + */ + size?: string; +} + +export interface CaptionSettingsIndicatorLocation { + + /**Specifies the horizontal position of the indicator. + * @Default {10} + */ + x?: number; + + /**Specifies the vertical position of the indicator. + * @Default {60} + */ + y?: number; +} + +export interface CaptionSettingsIndicatorSymbolBorder { + + /**Specifies the border color of indicator symbol. + * @Default {null} + */ + color?: string; + + /**Specifies the border width of indicator symbol. + * @Default {1} + */ + width?: number; +} + +export interface CaptionSettingsIndicatorSymbolSize { + + /**Specifies the height of indicator symbol. + * @Default {10} + */ + height?: number; + + /**Specifies the width of indicator symbol. + * @Default {10} + */ + width?: number; +} + +export interface CaptionSettingsIndicatorSymbol { + + /**Contains property to customize the border of indicator symbol. + */ + border?: CaptionSettingsIndicatorSymbolBorder; + + /**Specifies the color of indicator symbol. + * @Default {null} + */ + color?: string; + + /**Specifies the url of image that represents indicator symbol. + */ + imageURL?: string; + + /**Specifies the opacity of indicator symbol. + * @Default {1} + */ + opacity?: number; + + /**Specifies the shape of indicator symbol. + */ + shape?: string; + + /**Contains property to customize the size of indicator symbol. + */ + size?: CaptionSettingsIndicatorSymbolSize; +} + +export interface CaptionSettingsIndicator { + + /**Contains property to customize the font of indicator. + */ + font?: CaptionSettingsIndicatorFont; + + /**Contains property to customize the location of indicator. + */ + location?: CaptionSettingsIndicatorLocation; + + /**Specifies the padding to be applied when text position is used. + * @Default {2} + */ + padding?: number; + + /**Contains property to customize the symbol of indicator. + */ + symbol?: CaptionSettingsIndicatorSymbol; + + /**Specifies the text to be displayed as indicator text. By default difference between current value and target will be displayed + */ + text?: string; + + /**Specifies the alignement of indicator with respect to scale based on text position + * @Default {'Near'} + */ + textAlignment?: ej.datavisualization.BulletGraph.TextAlignment|string; + + /**Specifies where indicator text should be anchored when indicator overlaps with other caption group text. Text will be anchored when overlapping caption group text are at same position. Anchoring is not applicable for float position. + * @Default {'start'} + */ + textAnchor?: ej.datavisualization.BulletGraph.TextAnchor|string; + + /**indicator text render in the specified angle. + * @Default {0} + */ + textAngle?: number; + + /**Specifies where indicator should be placed + * @Default {'float'} + */ + textPosition?: ej.datavisualization.BulletGraph.TextPosition|string; + + /**Specifies the space between indicator symbol and text. + * @Default {3} + */ + textSpacing?: number; + + /**Specifies whether indicator will be visible or not. + * @Default {false} + */ + visibile?: boolean; +} + +export interface CaptionSettingsLocation { + + /**Specifies the position in horizontal direction + * @Default {17} + */ + x?: number; + + /**Specifies the position in horizontal direction + * @Default {30} + */ + y?: number; +} + +export interface CaptionSettingsSubTitleFont { + + /**Specifies the color of the subtitle's text. + * @Default {null} + */ + color?: string; + + /**Specifies the fontFamily of subtitle. Subtitle text render with this fontFamily. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Specifies the fontStyle of subtitle. Subtitle text render with this fontStyle. See FontStyle + * @Default {Normal} + */ + fontStyle?: ej.datavisualization.BulletGraph.FontStyle|string; + + /**Specifies the fontWeight of subtitle. Subtitle text render with this fontWeight. See FontWeight + * @Default {regular} + */ + fontWeight?: ej.datavisualization.BulletGraph.FontWeight|string; + + /**Specifies the opacity of subtitle. Subtitle text render with this opacity. + * @Default {1} + */ + opacity?: number; + + /**Specifies the size of subtitle. Subtitle text render with this size. + * @Default {12px} + */ + size?: string; +} + +export interface CaptionSettingsSubTitleLocation { + + /**Specifies the horizontal position of the subtitle. + * @Default {10} + */ + x?: number; + + /**Specifies the vertical position of the subtitle. + * @Default {45} + */ + y?: number; +} + +export interface CaptionSettingsSubTitle { + + /**Contains property to customize the font of subtitle. + */ + font?: CaptionSettingsSubTitleFont; + + /**Contains property to customize the location of subtitle. + */ + location?: CaptionSettingsSubTitleLocation; + + /**Specifies the padding to be applied when text position is used. + * @Default {5} + */ + padding?: number; + + /**Specifies the text to be displayed as subtitle. + */ + text?: string; + + /**Specifies the alignment of sub title text with respect to scale. Alignment will not be applied in float position. + * @Default {'Near'} + */ + textAlignment?: ej.datavisualization.BulletGraph.TextAlignment|string; + + /**Specifies where subtitle text should be anchored when sub title text overlaps with other caption group text. Text will be anchored when overlapping caption group text are at same position. Anchoring is not applicable for float position. + * @Default {'start'} + */ + textAnchor?: ej.datavisualization.BulletGraph.TextAnchor|string; + + /**Subtitle render in the specified angle. + * @Default {0} + */ + textAngle?: number; + + /**Specifies where sub title text should be placed. + * @Default {'float'} + */ + textPosition?: ej.datavisualization.BulletGraph.TextPosition|string; +} + +export interface CaptionSettings { + + /**Specifies whether trim the labels will be true or false. + * @Default {true} + */ + enableTrim?: boolean; + + /**Contains property to customize the font of caption. + */ + font?: CaptionSettingsFont; + + /**Contains property to customize the indicator. + */ + indicator?: CaptionSettingsIndicator; + + /**Contains property to customize the location. + */ + location?: CaptionSettingsLocation; + + /**Specifies the padding to be applied when text position is used. + * @Default {5} + */ + padding?: number; + + /**Contains property to customize the subtitle. + */ + subTitle?: CaptionSettingsSubTitle; + + /**Specifies the text to be displayed on bullet graph. + */ + text?: string; + + /**Specifies the alignment of caption text with respect to scale. This property will not be applied when text position is float. + * @Default {'Near'} + */ + textAlignment?: ej.datavisualization.BulletGraph.TextAlignment|string; + + /**Specifies caption text anchoring when caption text overlaps with other caption group text. Text will be anchored when overlapping caption group text are at same position. Anchoring is not applicable for float position. + * @Default {'start'} + */ + textAnchor?: ej.datavisualization.BulletGraph.TextAnchor|string; + + /**Specifies the angel in which the caption is rendered. + * @Default {0} + */ + textAngle?: number; + + /**Specifies how caption text should be placed. + * @Default {'float'} + */ + textPosition?: ej.datavisualization.BulletGraph.TextPosition|string; +} + +export interface QualitativeRanges { + + /**Specifies the ending range to which the qualitative ranges will render. + * @Default {3} + */ + rangeEnd?: number; + + /**Specifies the opacity for the qualitative ranges. + * @Default {1} + */ + rangeOpacity?: number; + + /**Specifies the stroke for the qualitative ranges. + * @Default {null} + */ + rangeStroke?: string; +} + +export interface QuantitativeScaleSettingsComparativeMeasureSettings { + + /**Specifies the stroke of the comparative measure. + * @Default {null} + */ + stroke?: number; + + /**Specifies the width of the comparative measure. + * @Default {5} + */ + width?: number; +} + +export interface QuantitativeScaleSettingsFeaturedMeasureSettings { + + /**Specifies the Stroke of the featured measure in bullet graph. + * @Default {null} + */ + stroke?: number; + + /**Specifies the width of the featured measure in bullet graph. + * @Default {2} + */ + width?: number; +} + +export interface QuantitativeScaleSettingsFeatureMeasures { + + /**Specifies the category of feature measure. + * @Default {null} + */ + category?: string; + + /**Comparative measure render till the specified value. + * @Default {null} + */ + comparativeMeasureValue?: number; + + /**Feature measure render till the specified value. + * @Default {null} + */ + value?: number; +} + +export interface QuantitativeScaleSettingsFields { + + /**Specifies the category of the bullet graph. + * @Default {null} + */ + category?: string; + + /**Comparative measure render based on the values in the specified field. + * @Default {null} + */ + comparativeMeasure?: string; + + /**Specifies the dataSource for the bullet graph. + * @Default {null} + */ + dataSource?: any; + + /**Feature measure render based on the values in the specified field. + * @Default {null} + */ + featureMeasures?: string; + + /**Specifies the query for fetching the values form data source to render the bullet graph. + * @Default {null} + */ + query?: string; + + /**Specifies the name of the table. + * @Default {null} + */ + tableName?: string; +} + +export interface QuantitativeScaleSettingsLabelSettingsFont { + + /**Specifies the fontFamily of labels in bullet graph. Labels render with this fontFamily. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Specifies the fontStyle of labels in bullet graph. Labels render with this fontStyle. See FontStyle + * @Default {Normal} + */ + fontStyle?: ej.datavisualization.BulletGraph.FontStyle|string; + + /**Specifies the fontWeight of labels in bullet graph. Labels render with this fontWeight. See FontWeight + * @Default {regular} + */ + fontWeight?: ej.datavisualization.BulletGraph.FontWeight|string; + + /**Specifies the opacity of labels in bullet graph. Labels render with this opacity + * @Default {1} + */ + opacity?: number; +} + +export interface QuantitativeScaleSettingsLabelSettings { + + /**Contains property to customize the font of the labels in bullet graph. + */ + font?: QuantitativeScaleSettingsLabelSettingsFont; + + /**Specifies the placement of labels in bullet graph scale. + * @Default {outside} + */ + labelPlacement?: ej.datavisualization.BulletGraph.LabelPlacement|string; + + /**Specifies the prefix to be added with labels in bullet graph. + * @Default {Empty string} + */ + labelPrefix?: string; + + /**Specifies the suffix to be added after labels in bullet graph. + * @Default {Empty string} + */ + labelSuffix?: string; + + /**Specifies the horizontal/vertical padding of labels. + * @Default {15} + */ + offset?: number; + + /**Specifies the position of the labels to render either above or below the graph. See Position + * @Default {below} + */ + position?: ej.datavisualization.BulletGraph.LabelPosition|string; + + /**Specifies the Size of the labels. + * @Default {12} + */ + size?: number; + + /**Specifies the stroke color of the labels in bullet graph. + * @Default {null} + */ + stroke?: string; +} + +export interface QuantitativeScaleSettingsLocation { + + /**This property specifies the x position for rendering quantitative scale. + * @Default {10} + */ + x?: number; + + /**This property specifies the y position for rendering quantitative scale. + * @Default {10} + */ + y?: number; +} + +export interface QuantitativeScaleSettingsMajorTickSettings { + + /**Specifies the size of the major ticks. + * @Default {13} + */ + size?: number; + + /**Specifies the stroke color of the major tick lines. + * @Default {null} + */ + stroke?: string; + + /**Specifies the width of the major tick lines. + * @Default {2} + */ + width?: number; +} + +export interface QuantitativeScaleSettingsMinorTickSettings { + + /**Specifies the size of minor ticks. + * @Default {7} + */ + size?: number; + + /**Specifies the stroke color of minor ticks in bullet graph. + * @Default {null} + */ + stroke?: string; + + /**Specifies the width of the minor ticks in bullet graph. + * @Default {2} + */ + width?: number; +} + +export interface QuantitativeScaleSettings { + + /**Contains property to customize the comparative measure. + */ + comparativeMeasureSettings?: QuantitativeScaleSettingsComparativeMeasureSettings; + + /**Contains property to customize the featured measure. + */ + featuredMeasureSettings?: QuantitativeScaleSettingsFeaturedMeasureSettings; + + /**Contains property to customize the featured measure. + */ + featureMeasures?: Array; + + /**Contains property to customize the fields. + */ + fields?: QuantitativeScaleSettingsFields; + + /**Specifies the interval for the Graph. + * @Default {1} + */ + interval?: number; + + /**Contains property to customize the labels. + */ + labelSettings?: QuantitativeScaleSettingsLabelSettings; + + /**Contains property to customize the position of the quantitative scale + */ + location?: QuantitativeScaleSettingsLocation; + + /**Contains property to customize the major tick lines. + */ + majorTickSettings?: QuantitativeScaleSettingsMajorTickSettings; + + /**Specifies the maximum value of the Graph. + * @Default {10} + */ + maximum?: number; + + /**Specifies the minimum value of the Graph. + * @Default {0} + */ + minimum?: number; + + /**Contains property to customize the minor ticks. + */ + minorTickSettings?: QuantitativeScaleSettingsMinorTickSettings; + + /**The specified number of minor ticks will be rendered per interval. + * @Default {4} + */ + minorTicksPerInterval?: number; + + /**Specifies the placement of ticks to render either inside or outside the scale. + * @Default {ej.datavisualization.BulletGraph.TickPlacement.Outside} + */ + tickPlacement?: ej.datavisualization.BulletGraph.TickPlacement|string; + + /**Specifies the position of the ticks to render either above,below or inside + * @Default {ej.datavisualization.BulletGraph.TickPosition.Far} + */ + tickPosition?: ej.datavisualization.BulletGraph.TickPosition|string; +} + +export interface TooltipSettings { + + /**Specifies template for caption tooltip + * @Default {null} + */ + captionTemplate?: string; + + /**Toggles the visibility of caption tooltip + * @Default {false} + */ + enableCaptionTooltip?: boolean; + + /**Specifies the ID of a div, which is to be displayed as tooltip. + * @Default {null} + */ + template?: string; + + /**Toggles the visibility of tooltip + * @Default {true} + */ + visible?: boolean; +} +} +module BulletGraph +{ +enum FontStyle +{ +//string +Normal, +//string +Italic, +//string +Oblique, +} +} +module BulletGraph +{ +enum FontWeight +{ +//string +Normal, +//string +Bold, +//string +Bolder, +//string +Lighter, +} +} +module BulletGraph +{ +enum TextAlignment +{ +//string +Near, +//string +Far, +//string +Center, +} +} +module BulletGraph +{ +enum TextAnchor +{ +//string +Start, +//string +Middle, +//string +End, +} +} +module BulletGraph +{ +enum TextPosition +{ +//string +Top, +//string +Right, +//string +Left, +//string +Bottom, +//string +Float, +} +} +module BulletGraph +{ +enum FlowDirection +{ +//string +Forward, +//string +Backward, +} +} +module BulletGraph +{ +enum Orientation +{ +//string +Horizontal, +//string +Vertical, +} +} +module BulletGraph +{ +enum LabelPlacement +{ +//string +Inside, +//string +Outside, +} +} +module BulletGraph +{ +enum LabelPosition +{ +//string +Above, +//string +Below, +} +} +module BulletGraph +{ +enum TickPlacement +{ +//string +Inside, +//string +Outside, +} +} +module BulletGraph +{ +enum TickPosition +{ +//string +Below, +//string +Above, +//string +Cross, +} +} + +class Barcode extends ej.Widget { + static fn: Barcode; + constructor(element: JQuery, options?: Barcode.Model); + constructor(element: Element, options?: Barcode.Model); + model:Barcode.Model; + defaults:Barcode.Model; + + /** To disable the barcode + * @returns {void} + */ + disable(): void; + + /** To enable the barcode + * @returns {void} + */ + enable(): void; +} +export module Barcode{ + +export interface Model { + + /**Specifies the distance between the barcode and text below it. + */ + barcodeToTextGapHeight?: number; + + /**Specifies the height of bars in the Barcode. By modifying the barHeight, the entire barcode height can be customized. Please refer to xDimension for two dimensional barcode height customization. + */ + barHeight?: number; + + /**Specifies the dark bar color of the Barcode. One dimensional barcode contains a series of dark and light bars which are usually colored as black and white respectively. + */ + darkBarColor?: any; + + /**Specifies whether the text below the barcode is visible or hidden. + */ + displayText?: boolean; + + /**Specifies whether the control is enabled. + */ + enabled?: boolean; + + /**Specifies the start and stop encode symbol in the Barcode. In one dimensional barcodes, an additional character is added as start and stop delimiters. These symbols are optional and the unique of the symbol allows the reader to determine the direction of the barcode being scanned. + */ + encodeStartStopSymbol?: number; + + /**Specifies the light bar color of the Barcode. One dimensional barcode contains a series of dark and light bars which are usually colored as black and white respectively. + */ + lightBarColor?: any; + + /**Specifies the width of the narrow bars in the barcode. The dark bars in the one dimensional barcode contains random narrow and wide bars based on the provided input which can be specified during initialization. + */ + narrowBarWidth?: number; + + /**Specifies the width of the quiet zone. In barcode, a quiet zone is the blank margin on either side of a barcode which informs the reader where a barcode's symbology starts and stops. The purpose of a quiet zone is to prevent the reader from picking up unrelated information. + */ + quietZone?: QuietZone; + + /**Specifies the type of the Barcode. See SymbologyType + */ + symbologyType?: ej.datavisualization.Barcode.SymbologyType|string; + + /**Specifies the text to be encoded in the barcode. + */ + text?: string; + + /**Specifies the color of the text/data at the bottom of the barcode. + */ + textColor?: any; + + /**Specifies the width of the wide bars in the barcode. One dimensional barcode usually contains random narrow and wide bars based on the provided which can be customized during initialization. + */ + wideBarWidth?: number; + + /**Specifies the width of the narrowest element(bar or space) in a barcode. The greater the x dimension, the more easily a barcode reader will scan. + */ + xDimension?: number; + + /**Fires after Barcode control is loaded.*/ + load? (e: LoadEventArgs): void; +} + +export interface LoadEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the barcode model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; + + /**return the barcode state + */ + status?: boolean; +} + +export interface QuietZone { + + /**Specifies the quiet zone around the Barcode. + */ + all?: number; + + /**Specifies the bottom quiet zone of the Barcode. + */ + bottom?: number; + + /**Specifies the left quiet zone of the Barcode. + */ + left?: number; + + /**Specifies the right quiet zone of the Barcode. + */ + right?: number; + + /**Specifies the top quiet zone of the Barcode. + */ + top?: number; +} +} +module Barcode +{ +enum SymbologyType +{ +//Represents the QR code +QRBarcode, +//Represents the Data Matrix barcode +DataMatrix, +//Represents the Code 39 barcode +Code39, +//Represents the Code 39 Extended barcode +Code39Extended, +//Represents the Code 11 barcode +Code11, +//Represents the Codabar barcode +Codabar, +//Represents the Code 32 barcode +Code32, +//Represents the Code 93 barcode +Code93, +//Represents the Code 93 Extended barcode +Code93Extended, +//Represents the Code 128 A barcode +Code128A, +//Represents the Code 128 B barcode +Code128B, +//Represents the Code 128 C barcode +Code128C, +} +} + +class Map extends ej.Widget { + static fn: Map; + constructor(element: JQuery, options?: Map.Model); + constructor(element: Element, options?: Map.Model); + model:Map.Model; + defaults:Map.Model; + + /** Method for navigating to specific shape based on latitude, longitude and zoomlevel. + * @param {number} Pass the latitude value for map + * @param {number} Pass the longitude value for map + * @param {number} Pass the zoom level for map + * @returns {void} + */ + navigateTo(latitude: number, longitude: number, level: number): void; + + /** Method to perform map panning + * @param {string} Pass the direction in which map should be panned + * @returns {void} + */ + pan(direction: string): void; + + /** Method to reload the map. + * @returns {void} + */ + refresh(): void; + + /** Method to reload the shapeLayers with updated values + * @returns {void} + */ + refreshLayers(): void; + + /** Method to reload the navigation control with updated values. + * @param {any} Pass the navigation control instance + * @returns {void} + */ + refreshNavigationControl(navigation: any): void; + + /** Method to perform map zooming. + * @param {number} Pass the zoom level for map to be zoomed + * @param {boolean} Pass the boolean value to enable or disable animation while zooming + * @returns {void} + */ + zoom(level: number, isAnimate: boolean): void; +} +export module Map{ + +export interface Model { + + /**Specifies the background color for map + * @Default {white} + */ + background?: string; + + /**Specifies the base map-index of the map to determine the shapelayer to be displayed + * @Default {0} + */ + baseMapIndex?: number; + + /**Specify the center position where map should be displayed + * @Default {[0,0]} + */ + centerPosition?: any; + + /**Enables or Disables the map animation + * @Default {false} + */ + enableAnimation?: boolean; + + /**Enables or Disables the animation for layer change in map + * @Default {false} + */ + enableLayerChangeAnimation?: boolean; + + /**Enables or Disables the map panning + * @Default {true} + */ + enablePan?: boolean; + + /**Determines whether map need to resize when container is resized + * @Default {true} + */ + enableResize?: boolean; + + /**Enables or Disables the zooming of map + * @Default {true} + */ + enableZoom?: boolean; + + /**Enables or Disables the zoom on selecting the map shape + * @Default {false} + */ + enableZoomOnSelection?: boolean; + + /**Specifies the zoom factor for map zoom value. + * @Default {1} + */ + factor?: number; + + /**Hold the shapelayers to be displayed in map + * @Default {[]} + */ + layers?: Array; + + /**Specifies the zoom level value for which map to be zoomed + * @Default {1} + */ + level?: number; + + /**Specifies the maximum zoom level of the map + * @Default {100} + */ + maxValue?: number; + + /**Specifies the minimum zoomSettings level of the map + * @Default {1} + */ + minValue?: number; + + /**Enables or Disables the navigation control for map to perform zooming and panning on map shapes. + */ + navigationControl?: any; + + /**Layer for holding the map shapes + */ + shapeLayer?: ShapeLayer; + + /**Enables or Disables the Zooming for map. + */ + zoomSettings?: any; + + /**Triggered on selecting the map markers.*/ + markerSelected? (e: MarkerSelectedEventArgs): void; + + /**Triggers while leaving the hovered map shape*/ + mouseleave? (e: MouseleaveEventArgs): void; + + /**Triggers while hovering the map shape.*/ + mouseover? (e: MouseoverEventArgs): void; + + /**Triggers once map render completed.*/ + onRenderComplete? (e: OnRenderCompleteEventArgs): void; + + /**Triggers when map panning ends.*/ + panned? (e: PannedEventArgs): void; + + /**Triggered on selecting the map shapes.*/ + shapeSelected? (e: ShapeSelectedEventArgs): void; + + /**Triggered when map is zoomed-in.*/ + zoomedIn? (e: ZoomedInEventArgs): void; + + /**Triggers when map is zoomed out.*/ + zoomedOut? (e: ZoomedOutEventArgs): void; +} + +export interface MarkerSelectedEventArgs { + + /**Returns marker object. + */ + originalEvent?: any; +} + +export interface MouseleaveEventArgs { + + /**Returns hovered map shape object. + */ + originalEvent?: any; +} + +export interface MouseoverEventArgs { + + /**Returns hovered map shape object. + */ + originalEvent?: any; +} + +export interface OnRenderCompleteEventArgs { + + /**Event parameters from map + */ + originalEvent?: any; +} + +export interface PannedEventArgs { + + /**Event parameters from map + */ + originalEvent?: any; +} + +export interface ShapeSelectedEventArgs { + + /**Returns selected shape object. + */ + originalEvent?: any; +} + +export interface ZoomedInEventArgs { + + /**Event parameters from map + */ + originalEvent?: any; + + /**Returns zoom level value for which the map is zoomed. + */ + zoomLevel?: any; +} + +export interface ZoomedOutEventArgs { + + /**Event parameters from map + */ + originalEvent?: any; + + /**Returns zoom level value for which the map is zoomed. + */ + zoomLevel?: any; +} + +export interface ShapeLayerBubbleSettings { + + /**Specifies the bubble Opacity value of bubbles for shape layer in map + * @Default {0.9} + */ + bubbleOpacity?: number; + + /**Specifies the mouse hover color of the shape layer in map + * @Default {gray} + */ + color?: string; + + /**Specifies the colorMappings of the shape layer in map + * @Default {null} + */ + colorMappings?: any; + + /**Specifies the bubble color valuePath of the shape layer in map + * @Default {null} + */ + colorValuePath?: string; + + /**Specifies the maximum size value of bubbles for shape layer in map + * @Default {20} + */ + maxValue?: number; + + /**Specifies the minimum size value of bubbles for shape layer in map + * @Default {10} + */ + minValue?: number; + + /**Specifies the showBubble visibility status map + * @Default {true} + */ + showBubble?: boolean; + + /**Specifies the tooltip visibility status of the shape layer in map + * @Default {false} + */ + showTooltip?: boolean; + + /**Specifies the bubble tooltip template of the shape layer in map + * @Default {null} + */ + tooltipTemplate?: string; + + /**Specifies the bubble valuePath of the shape layer in map + * @Default {null} + */ + valuePath?: string; +} + +export interface ShapeLayerLabelSettings { + + /**enable or disable the enableSmartLabel property + * @Default {false} + */ + enableSmartLabel?: boolean; + + /**set the labelLength property + * @Default {'2'} + */ + labelLength?: number; + + /**set the labelPath property + * @Default {null} + */ + labelPath?: string; + + /**enable or disable the showlabel property + * @Default {false} + */ + showLabels?: boolean; + + /**set the smartLabelSize property + * @Default {fixed} + */ + smartLabelSize?: ej.datavisualization.Map.LabelSize|string; +} + +export interface ShapeLayerLegendSettings { + + /**Determines whether the legend should be placed outside or inside the map bounds + * @Default {false} + */ + dockOnMap?: boolean; + + /**Determines the legend placement and it is valid only when dockOnMap is true + * @Default {top} + */ + dockPosition?: ej.datavisualization.Map.DockPosition|string; + + /**height value for legend setting + * @Default {0} + */ + height?: number; + + /**to get icon value for legend setting + * @Default {rectangle} + */ + icon?: ej.datavisualization.Map.LegendIcons|string; + + /**icon height value for legend setting + * @Default {20} + */ + iconHeight?: number; + + /**icon Width value for legend setting + * @Default {20} + */ + iconWidth?: number; + + /**set the orientation of legend labels + * @Default {vertical} + */ + labelOrientation?: ej.datavisualization.Map.LabelOrientation|string; + + /**to get leftLabel value for legend setting + * @Default {null} + */ + leftLabel?: string; + + /**to get mode of legend setting + * @Default {default} + */ + mode?: ej.datavisualization.Map.LegendMode|string; + + /**set the position of legend settings + * @Default {topleft} + */ + position?: ej.datavisualization.Map.Position|string; + + /**x position value for legend setting + * @Default {0} + */ + positionX?: number; + + /**y position value for legend setting + * @Default {0} + */ + positionY?: number; + + /**to get rightLabel value for legend setting + * @Default {null} + */ + rightLabel?: string; + + /**Enables or Disables the showLabels + * @Default {false} + */ + showLabels?: boolean; + + /**Enables or Disables the showLegend + * @Default {false} + */ + showLegend?: boolean; + + /**to get title of legend setting + * @Default {null} + */ + title?: string; + + /**to get type of legend setting + * @Default {layers} + */ + type?: ej.datavisualization.Map.LegendType|string; + + /**width value for legend setting + * @Default {0} + */ + width?: number; +} + +export interface ShapeLayerShapeSettings { + + /**Enables or Disables the auto fill colors for shape layer in map. When this property value set to true, shapes will be filled with palette colors. + * @Default {false} + */ + autoFill?: boolean; + + /**Specifies the colorMappings of the shape layer in map + * @Default {null} + */ + colorMappings?: any; + + /**Specifies the shape color palette value of the shape layer in map. Accepted colorPalette values are palette1, palette2, palette3 and custompalette. + * @Default {palette1} + */ + colorPalette?: string; + + /**Specifies the shape color valuePath of the shape layer in map + * @Default {null} + */ + colorValuePath?: string; + + /**Enables or Disables the gradient colors for map shapes. + * @Default {false} + */ + enableGradient?: boolean; + + /**Specifies the shape fill color of the shape layer in map + * @Default {#E5E5E5} + */ + fill?: string; + + /**Specifies the mouse over width of the shape layer in map + * @Default {1} + */ + highlightBorderWidth?: number; + + /**Specifies the mouse hover color of the shape layer in map + * @Default {gray} + */ + highlightColor?: string; + + /**Specifies the mouse over stroke color of the shape layer in map + * @Default {#C1C1C1} + */ + highlightStroke?: string; + + /**Specifies the shape selection color of the shape layer in map + * @Default {gray} + */ + selectionColor?: string; + + /**Specifies the shape selection stroke color of the shape layer in map + * @Default {#C1C1C1} + */ + selectionStroke?: string; + + /**Specifies the shape selection stroke width of the shape layer in map + * @Default {1} + */ + selectionStrokeWidth?: number; + + /**Specifies the shape stroke color of the shape layer in map + * @Default {#C1C1C1} + */ + stroke?: string; + + /**Specifies the shape stroke thickness value of the shape layer in map + * @Default {0.2} + */ + strokeThickness?: number; + + /**Specifies the shape valuePath of the shape layer in map + * @Default {null} + */ + valuePath?: string; +} + +export interface ShapeLayer { + + /**to get the type of bing map. + * @Default {aerial} + */ + bingMapType?: ej.datavisualization.Map.BingMapType|string; + + /**Specifies the bubble settings for map + */ + bubbleSettings?: ShapeLayerBubbleSettings; + + /**Specifies the datasource for the shape layer + */ + dataSource?: any; + + /**Enables or disables the animation + * @Default {false} + */ + enableAnimation?: boolean; + + /**Enables or disables the shape mouse hover + * @Default {false} + */ + enableMouseHover?: boolean; + + /**Enables or disables the shape selection + * @Default {true} + */ + enableSelection?: boolean; + + /**to get the key of bing map + * @Default {null} + */ + key?: string; + + /**Options for enabling and configuring labelSettings labelPath, smartLabelSize, labelLength etc., + */ + labelSettings?: ShapeLayerLabelSettings; + + /**Specifies the map type. + * @Default {'geometry'} + */ + layerType?: ej.datavisualization.Map.LayerType|string; + + /**Options for enabling and configuring legendSettings position, height, width, mode, type etc., + */ + legendSettings?: ShapeLayerLegendSettings; + + /**Specifies the map items template for shapes. + */ + mapItemsTemplate?: string; + + /**Specify markers for shape layer. + * @Default {[]} + */ + markers?: Array; + + /**Specifies the map marker template for map layer. + * @Default {null} + */ + markerTemplate?: string; + + /**Specify selectedMapShapes for shape layer + * @Default {[]} + */ + selectedMapShapes?: Array; + + /**Specifies the selection mode of the map. Accepted selection mode values are Default and Multiple. + * @Default {default} + */ + selectionMode?: ej.datavisualization.Map.SelectionMode|string; + + /**Specifies the shape data for the shape layer + */ + shapeDataobject?: any; + + /**Specifies the shape settings of map layer + */ + shapeSettings?: ShapeLayerShapeSettings; + + /**Shows or hides the map items. + * @Default {false} + */ + showMapItems?: boolean; + + /**Shows or hides the tooltip for shapes + * @Default {false} + */ + showTooltip?: boolean; + + /**Specifies the sub shape layers + * @Default {[]} + */ + subLayers?: Array; + + /**Specifies the tooltip template for shapes. + */ + tooltipTemplate?: string; + + /**Specifies the url template for the OSM type map. + * @Default {'http://a.tile.openstreetmap.org/level/tileX/tileY.png'} + */ + urlTemplate?: string; +} +} +module Map +{ +enum Position +{ +//specifies the none position +None, +//specifies the topleft position +Topleft, +//specifies the topcenter position +Topcenter, +//specifies the topright position +Topright, +//specifies the centerleft position +Centerleft, +//specifies the center position +Center, +//specifies the centerright position +Centerright, +//specifies the bottomleft position +Bottomleft, +//specifies the bottomcenter position +Bottomcenter, +//specifies the bottomright position +Bottomright, +} +} +module Map +{ +enum Orientation +{ +//specifies the horizontal position +Horizontal, +//specifies the vertical position +Vertical, +} +} +module Map +{ +enum BingMapType +{ +//specifies the aerial type +Aerial, +//specifies the aerialwithlabel type +Aerialwithlabel, +//specifies the road type +Road, +} +} +module Map +{ +enum LabelSize +{ +//specifies the fixed size +Fixed, +//specifies the default size +Default, +} +} +module Map +{ +enum LayerType +{ +//specifies the geometry type +Geometry, +//specifies the osm type +Osm, +//specifies the bing type +Bing, +} +} +module Map +{ +enum DockPosition +{ +//specifies the top position +Top, +//specifies the bottom position +Bottom, +//specifies the bottom position +Right, +//specifies the left position +Left, +} +} +module Map +{ +enum LegendIcons +{ +//specifies the rectangle position +Rectangle, +//specifies the circle position +Circle, +} +} +module Map +{ +enum LabelOrientation +{ +//specifies the horizontal position +Horizontal, +//specifies the vertical position +Vertical, +} +} +module Map +{ +enum LegendMode +{ +//specifies the default mode +Default, +//specifies the interactive mode +Interactive, +} +} +module Map +{ +enum LegendType +{ +//specifies the layers type +Layers, +//specifies the bubbles type +Bubbles, +} +} +module Map +{ +enum SelectionMode +{ +//specifies the default position +Default, +//specifies the multiple position +Multiple, +} +} + +class TreeMap extends ej.Widget { + static fn: TreeMap; + constructor(element: JQuery, options?: TreeMap.Model); + constructor(element: Element, options?: TreeMap.Model); + model:TreeMap.Model; + defaults:TreeMap.Model; + + /** Method to reload treemap with updated values. + * @returns {void} + */ + refresh(): void; +} +export module TreeMap{ + +export interface Model { + + /**Specifies the border brush color of the treemap + * @Default {white} + */ + borderBrush?: string; + + /**Specifies the border thickness of the treemap + * @Default {1} + */ + borderThickness?: number; + + /**Specifies the colors of the paletteColorMapping + * @Default {[]} + */ + colors?: Array; + + /**Specifies the color valuepath of the treemap + * @Default {null} + */ + colorValuePath?: string; + + /**Specifies the datasource of the treemap + * @Default {null} + */ + dataSource?: any; + + /**Specifies the desaturationColorMapping settings of the treemap + */ + desaturationColorMapping?: any; + + /**Specifies the dockPosition for legend + * @Default {top} + */ + dockPosition?: ej.datavisualization.TreeMap.DockPosition|string; + + /**specifies the drillDown header color + * @Default {'null'} + */ + drillDownHeaderColor?: string; + + /**specifies the drillDown selection color + * @Default {'#000000'} + */ + drillDownSelectionColor?: string; + + /**Enable/Disable the drillDown for treemap + * @Default {false} + */ + enableDrillDown?: boolean; + + /**Specifies whether treemap need to resize when container is resized + * @Default {true} + */ + enableResize?: boolean; + + /**Specifies the from value for desaturation color mapping + * @Default {0} + */ + from?: number; + + /**Specifies the group color mapping of the treemap + * @Default {[]} + */ + groupColorMapping?: Array; + + /**Specifies the height for legend + * @Default {30} + */ + height?: number; + + /**Specifies the highlight border brush of treemap + * @Default {gray} + */ + highlightBorderBrush?: string; + + /**Specifies the border thickness when treemap items is highlighted in the treemap + * @Default {5} + */ + highlightBorderThickness?: number; + + /**Specifies the highlight border brush of treemap + * @Default {gray} + */ + highlightGroupBorderBrush?: string; + + /**Specifies the border thickness when treemap items is highlighted in the treemap + * @Default {5} + */ + highlightGroupBorderThickness?: number; + + /**Specifies whether treemap item need to highlighted on selection + * @Default {false} + */ + highlightGroupOnSelection?: boolean; + + /**Specifies whether treemap item need to highlighted on selection + * @Default {false} + */ + highlightOnSelection?: boolean; + + /**Specifies the iconHeight for legend + * @Default {15} + */ + iconHeight?: number; + + /**Specifies the iconWidth for legend + * @Default {15} + */ + iconWidth?: number; + + /**Specifies the items layout mode of the treemap. Accepted itemsLayoutMode values are Squarified, SliceAndDiceHorizontal, SliceAndDiceVertical and SliceAndDiceAuto + * @Default {Squarified} + */ + itemsLayoutMode?: ej.datavisualization.TreeMap.ItemsLayoutMode|string; + + /**Specifies the leaf settings of the treemap + */ + leafItemSettings?: LeafItemSettings; + + /**Specifies the legend settings of the treemap + */ + legendSettings?: any; + + /**Specify levels of treemap for grouped visualization of datas + * @Default {[]} + */ + levels?: Array; + + /**Specifies the paletteColorMapping of the treemap + */ + paletteColorMapping?: any; + + /**Specifies the rangeColorMapping settings of the treemap + */ + rangeColorMapping?: Array; + + /**Specifies the rangeMaximum value for desaturation color mapping + * @Default {0} + */ + rangeMaximum?: number; + + /**Specifies the rangeMinimum value for desaturation color mapping + * @Default {0} + */ + rangeMinimum?: number; + + /**Specifies the legend visibility status of the treemap + * @Default {false} + */ + showLegend?: boolean; + + /**Specifies whether treemap tooltip need to be visible + * @Default {false} + */ + showTooltip?: boolean; + + /**Specifies the template for legendSettings + * @Default {null} + */ + template?: string; + + /**Specifies the to value for desaturation color mapping + * @Default {0} + */ + to?: number; + + /**Specifies the tooltip template of the treemap + * @Default {null} + */ + tooltipTemplate?: string; + + /**Hold the treeMapItems to be displayed in treemap + * @Default {[]} + */ + treeMapItems?: Array; + + /**Hold the Level settings of TreeMap + */ + treeMapLevel?: TreeMapLevel; + + /**Specifies the uniColorMapping settings of the treemap + */ + uniColorMapping?: any; + + /**Specifies the weight valuepath of the treemap + * @Default {null} + */ + weightValuePath?: string; + + /**Specifies the width for legend + * @Default {100} + */ + width?: number; + + /**Triggers on treemap item selected.*/ + treeMapItemSelected? (e: TreeMapItemSelectedEventArgs): void; +} + +export interface TreeMapItemSelectedEventArgs { + + /**Returns selected treeMapItem object. + */ + originalEvent?: any; +} + +export interface LeafItemSettings { + + /**Specifies the border bruch color of the leaf item. + * @Default {white} + */ + borderBrush?: string; + + /**Specifies the border thickness of the leaf item. + * @Default {1} + */ + borderThickness?: number; + + /**Specifies the label template of the leaf item. + * @Default {null} + */ + itemTemplate?: string; + + /**Specifies the label path of the leaf item. + * @Default {null} + */ + labelPath?: string; + + /**Specifies the position of the leaf labels. + * @Default {center} + */ + labelPosition?: ej.datavisualization.TreeMap.Position|string; + + /**Specifies the mode of label visibility + * @Default {visible} + */ + labelVisibilityMode?: ej.datavisualization.TreeMap.VisibilityMode|string; + + /**Shows or hides the label of the leaf item. + * @Default {false} + */ + showLabels?: boolean; +} + +export interface TreeMapLevel { + + /**specifies the group background + * @Default {null} + */ + groupBackground?: string; + + /**Specifies the group border color for tree map level. + * @Default {null} + */ + groupBorderColor?: string; + + /**Specifies the group border thickness for tree map level. + * @Default {1} + */ + groupBorderThickness?: number; + + /**Specifies the group gap for tree map level. + * @Default {1} + */ + groupGap?: number; + + /**Specifies the group padding for tree map level. + * @Default {4} + */ + groupPadding?: number; + + /**Specifies the group path for tree map level. + */ + groupPath?: string; + + /**Specifies the header height for tree map level. + * @Default {0} + */ + headerHeight?: number; + + /**Specifies the header template for tree map level. + * @Default {null} + */ + headerTemplate?: string; + + /**Specifies the mode of header visibility + * @Default {visible} + */ + headerVisibilityMode?: ej.datavisualization.TreeMap.VisibilityMode|string; + + /**Specifies the position of the labels. + * @Default {center} + */ + labelPosition?: ej.datavisualization.TreeMap.Position|string; + + /**Specifies the label template for tree map level. + * @Default {null} + */ + labelTemplate?: string; + + /**Specifies the mode of label visibility + * @Default {visible} + */ + labelVisibilityMode?: ej.datavisualization.TreeMap.VisibilityMode|string; + + /**Shows or hides the header for tree map level. + * @Default {false} + */ + showHeader?: boolean; + + /**Shows or hides the labels for tree map level. + * @Default {false} + */ + showLabels?: boolean; +} +} +module TreeMap +{ +enum DockPosition +{ +//specifies the top position +Top, +//specifies the bottom position +Bottom, +//specifies the bottom position +Right, +//specifies the left position +Left, +} +} +module TreeMap +{ +enum ItemsLayoutMode +{ +//specifies the squarified as layout type position +Squarified, +//specifies the sliceanddicehorizontal as layout type position +Sliceanddicehorizontal, +//specifies the sliceanddicevertical as layout type position +Sliceanddicevertical, +//specifies the sliceanddiceauto as layout type position +Sliceanddiceauto, +} +} +module TreeMap +{ +enum Position +{ +//specifies the none position +None, +//specifies the topleft position +Topleft, +//specifies the topcenter position +Topcenter, +//specifies the topright position +Topright, +//specifies the centerleft position +Centerleft, +//specifies the center position +Center, +//specifies the centerright position +Centerright, +//specifies the bottomleft position +Bottomleft, +//specifies the bottomcenter position +Bottomcenter, +//specifies the bottomright position +Bottomright, +} +} +module TreeMap +{ +enum VisibilityMode +{ +//specifies the visible mode +Top, +//specifies the hideonexceededlength mode +Hideonexceededlength, +} +} +module TreeMap +{ +enum groupSelectionMode +{ +//specifies the default mode +Default, +//specifies the multiple mode +Multiple, +} +} + +class Diagram extends ej.Widget { + static fn: Diagram; + constructor(element: JQuery, options?: Diagram.Model); + constructor(element: Element, options?: Diagram.Model); + model:Diagram.Model; + defaults:Diagram.Model; + + /** Add nodes and connectors to diagram at runtime + * @param {any} a JSON to define a node/connector or an array of nodes and connector + * @returns {void} + */ + add(node: any): void; + + /** Add a label to a node at runtime + * @param {string} name of the node to which label will be added + * @param {any} JSON for the new label to be added + * @returns {void} + */ + addLabel(nodeName: string, newLabel: any): void; + + /** Add a phase to a swimlane at runtime + * @param {string} name of the swimlane to which the phase will be added + * @param {any} JSON object to define the phase to be added + * @returns {void} + */ + addPhase(name: string, options: any): void; + + /** Add a collection of ports to the node specified by name + * @param {string} name of the node to which the ports have to be added + * @param {Array} a collection of ports to be added to the specified node + * @returns {void} + */ + addPorts(name: string, ports: Array): void; + + /** Add the specified node to selection list + * @param {any} the node to be selected + * @param {boolean} to define whether to clear the existing selection or not + * @returns {void} + */ + addSelection(node: any, clearSelection: boolean): void; + + /** Align the selected objects based on the reference object and direction + * @param {string} to specify the direction towards which the selected objects are to be aligned("left","right",top","bottom") + * @returns {void} + */ + align(direction: string): void; + + /** Bring the specified portion of the diagram content to the diagram viewport + * @param {any} the rectangular region that is to be brought into diagram viewport + * @returns {void} + */ + bringIntoView(rect: any): void; + + /** Bring the specified portion of the diagram content to the center of the diagram viewport + * @param {any} the rectangular region that is to be brought to the center of diagram viewport + * @returns {void} + */ + bringToCenter(rect: any): void; + + /** Visually move the selected object over all other intersected objects + * @returns {void} + */ + bringToFront(): void; + + /** Remove all the elements from diagram + * @returns {void} + */ + clear(): void; + + /** Remove the current selection in diagram + * @returns {void} + */ + clearSelection(): void; + + /** Copy the selected object to internal clipboard and get the copied object + * @returns {any} + */ + copy(): any; + + /** Cut the selected object from diagram to diagram internal clipboard + * @returns {void} + */ + cut(): void; + + /** Export the diagram as downloadable files or as data + * @param {Diagram.Options} options to export the desired region of diagram to the desired formats.NameTypeDescriptionfileNamestringname of the file to be downloaded.formatstringformat of the exported file/data. See [File Formats](/js/api/global#fileformats).modestringto set whether to export diagram as a file or as raw data. See [Export Modes](/js/api/global#exportmodes).regionstringto set the region of the diagram to be exported. See [Region](/js/api/global#region).boundsobjectto export any custom region of diagram.marginobjectto set margin to the exported data. + * @returns {string} + */ + exportDiagram(options: Diagram.Options): string; + + /** Read a node/connector object by its name + * @param {string} name of the node/connector that is to be identified + * @returns {any} + */ + findNode(name: string): any; + + /** Fit the diagram content into diagram viewport + * @param {string} to set the mode of fit to command. See [Fit Mode](/js/api/global#fitmode) + * @param {string} to set whether the region to be fit will be based on diagram elements or page settings [Region](/js/api/global#region) + * @param {any} to set the required margin + * @returns {void} + */ + fitToPage(mode: string, region: string, margin: any): void; + + /** Group the selected nodes and connectors + * @returns {void} + */ + group(): void; + + /** Insert a label into a node's label collection at runtime + * @param {string} name of the node to which the label has to be inserted + * @param {any} JSON to define the new label + * @param {number} index to insert the label into the node + * @returns {void} + */ + insertLabel(name: string, label: any, index: number): void; + + /** Refresh the diagram with the specified layout + * @returns {void} + */ + layout(): void; + + /** Load the diagram + * @param {any} JSON data to load the diagram + * @returns {void} + */ + load(data: any): void; + + /** Visually move the selected object over its closest intersected object + * @returns {void} + */ + moveForward(): void; + + /** Move the selected objects by either one pixel or by the pixels specified through argument + * @param {string} specifies the direction to move the selected objects ("left","right",top","bottom") + * @param {number} specifies the number of pixels by which the selected objects have to be moved + * @returns {void} + */ + nudge(direction: string, delta: number): void; + + /** Paste the selected object from internal clipboard to diagram + * @param {any} object to be added to diagram + * @param {boolean} to define whether the specified object is to be renamed or not + * @returns {void} + */ + paste(object: any, rename: boolean): void; + + /** Print the diagram as image + * @returns {void} + */ + print(): void; + + /** Restore the last action that was reverted + * @returns {void} + */ + redo(): void; + + /** Refresh the diagram at runtime + * @returns {void} + */ + refresh(): void; + + /** Remove either the given node/connector or the selected element from diagram + * @param {any} the node/connector to be removed from diagram + * @returns {void} + */ + remove(node: any): void; + + /** Remove a particular object from selection list + * @param {any} the node/connector to be removed from selection list + * @returns {void} + */ + removeSelection(node: any): void; + + /** Scale the selected objects to the height of the first selected object + * @returns {void} + */ + sameHeight(): void; + + /** Scale the selected objects to the size of the first selected object + * @returns {void} + */ + sameSize(): void; + + /** Scale the selected objects to the width of the first selected object + * @returns {void} + */ + sameWidth(): void; + + /** Returns the diagram as serialized JSON + * @returns {any} + */ + save(): any; + + /** Bring the node into view + * @param {any} the node/connector to be brought into view + * @returns {void} + */ + scrollToNode(node: any): void; + + /** Select all nodes and connector in diagram + * @returns {void} + */ + selectAll(): void; + + /** Visually move the selected object behind its closest intersected object + * @returns {void} + */ + sendBackward(): void; + + /** Visually move the selected object behind all other intersected objects + * @returns {void} + */ + sendToBack(): void; + + /** Update the horizontal space between the selected objects as equal and within the selection boundary + * @returns {void} + */ + spaceAcross(): void; + + /** Update the vertical space between the selected objects as equal and within the selection boundary + * @returns {void} + */ + spaceDown(): void; + + /** Move the specified label to edit mode + * @param {any} node/connector that contains the label to be edited + * @param {any} to be edited + * @returns {void} + */ + startLabelEdit(node: any, label: any): void; + + /** Reverse the last action that was performed + * @returns {void} + */ + undo(): void; + + /** Ungroup the selected group + * @returns {void} + */ + ungroup(): void; + + /** Update diagram at runtime + * @param {any} JSON to specify the diagram properties that have to be modified + * @returns {void} + */ + update(options: any): void; + + /** Update Connectors at runtime + * @param {string} name of the connector to be updated + * @param {any} JSON to specify the connector properties that have to be updated + * @returns {void} + */ + updateConnector(name: string, options: any): void; + + /** Update the given label at runtime + * @param {string} the name of node/connector which contains the label to be updated + * @param {any} the label to be modified + * @param {any} JSON to specify the label properties that have to be updated + * @returns {any} + */ + updateLabel(nodeName: string, label: any, options: any): any; + + /** Update nodes at runtime + * @param {string} name of the node that is to be updated + * @param {any} JSON to specify the properties of node that have to be updated + * @returns {void} + */ + updateNode(name: string, options: any): void; + + /** Update a port with its modified properties at runtime + * @param {string} the name of node which contains the port to be updated + * @param {any} the port to be updated + * @param {any} JSON to specify the properties of the port that have to be updated + * @returns {void} + */ + updatePort(nodeName: string, port: any, options: any): void; + + /** Update the specified node as selected object + * @param {string} name of the node to be updated as selected object + * @returns {void} + */ + updateSelectedObject(name: string): void; + + /** Update the selection at runtime + * @param {boolean} to specify whether to show the user handles or not + * @returns {void} + */ + updateSelection(showUserHandles: boolean): void; + + /** Update userhandles with respect to the given node + * @param {any} node/connector with respect to which, the user handles have to be updated + * @returns {void} + */ + updateUserHandles(node: any): void; + + /** Update the diagram viewport at runtime + * @returns {void} + */ + updateViewPort(): void; + + /** Upgrade the diagram from old version + * @param {any} to be upgraded + * @returns {void} + */ + upgrade(data: any): void; + + /** Used to zoomIn/zoomOut diagram + * @param {any} options to zoom the diagram(zoom factor, zoomIn/zoomOut) + * @returns {void} + */ + zoomTo(zoom: any): void; +} +export module Diagram{ + +export interface Options { + + /**name of the file to be downloaded. + */ + fileName?: string; + + /**format of the exported file/data. See [File Formats](/js/api/global#fileformats). + */ + format?: string; + + /**to set whether to export diagram as a file or as raw data. See [Export Modes](/js/api/global#exportmodes). + */ + mode?: string; + + /**to set the region of the diagram to be exported. See [Region](/js/api/global#region). + */ + region?: string; + + /**to export any custom region of diagram. + */ + bounds?: any; + + /**to set margin to the exported data. + */ + margin?: any; +} + +export interface Model { + + /**Defines the background color of diagram elements + * @Default {transparent} + */ + backgroundColor?: string; + + /**Defines the path of the background image of diagram elements + * @Default {null} + */ + backgroundImage?: string; + + /**Sets the direction of line bridges. + * @Default {ej.datavisualization.Diagram.BridgeDirection.Top} + */ + bridgeDirection?: ej.datavisualization.Diagram.BridgeDirection|string; + + /**Defines a set of custom commands and binds them with a set of desired key gestures. + */ + commandManager?: CommandManager; + + /**A collection of JSON objects where each object represents a connector + * @Default {[]} + */ + connectors?: Array; + + /**Binds the custom JSON data with connector properties + * @Default {null} + */ + connectorTemplate?: any; + + /**Enables/Disables the default behaviors of the diagram. + * @Default {ej.datavisualization.Diagram.DiagramConstraints.All} + */ + constraints?: ej.datavisualization.Diagram.DiagramConstraints|string; + + /**An object to customize the context menu of diagram + */ + contextMenu?: ContextMenu; + + /**Configures the data source that is to be bound with diagram + */ + dataSourceSettings?: DataSourceSettings; + + /**Initializes the default values for nodes and connectors + * @Default {{}} + */ + defaultSettings?: DefaultSettings; + + /**Sets the type of Json object to be drawn through drawing tool + * @Default {{}} + */ + drawType?: any; + + /**Enables or disables auto scroll in diagram + * @Default {true} + */ + enableAutoScroll?: boolean; + + /**Enables or disables diagram context menu + * @Default {true} + */ + enableContextMenu?: boolean; + + /**Specifies the height of the diagram + * @Default {null} + */ + height?: string; + + /**Customizes the undo redo functionality + */ + historyManager?: HistoryManager; + + /**Automatically arranges the nodes and connectors in a predefined manner + */ + layout?: Layout; + + /**Defines the current culture of diagram + * @Default {en-US} + */ + locale?: string; + + /**Array of JSON objects where each object represents a node + * @Default {[]} + */ + nodes?: Array; + + /**Binds the custom JSON data with node properties + * @Default {null} + */ + nodeTemplate?: any; + + /**Defines the size and appearance of diagram page + */ + pageSettings?: PageSettings; + + /**Defines the zoom value, zoom factor, scroll status and view port size of the diagram + */ + scrollSettings?: ScrollSettings; + + /**Defines the size and position of selected items and defines the appearance of selector + */ + selectedItems?: SelectedItems; + + /**Enables or disables tooltip of diagram + * @Default {true} + */ + showTooltip?: boolean; + + /**Defines the gridlines and defines how and when the objects have to be snapped + */ + snapSettings?: SnapSettings; + + /**Enables/Disables the interactive behaviors of diagram. + * @Default {ej.datavisualization.Diagram.Tool.All} + */ + tool?: ej.datavisualization.Diagram.Tool|string; + + /**An object that defines the description, appearance and alignments of tooltips + * @Default {null} + */ + tooltip?: Tooltip; + + /**Specifies the width of the diagram + * @Default {null} + */ + width?: string; + + /**Sets the factor by which we can zoom in or zoom out + * @Default {0.2} + */ + zoomFactor?: number; + + /**Triggers When auto scroll is changed*/ + autoScrollChange? (e: AutoScrollChangeEventArgs): void; + + /**Triggers when a node, connector or diagram is clicked*/ + click? (e: ClickEventArgs): void; + + /**Triggers when the connection is changed*/ + connectionChange? (e: ConnectionChangeEventArgs): void; + + /**Triggers when the connector collection is changed*/ + connectorCollectionChange? (e: ConnectorCollectionChangeEventArgs): void; + + /**Triggers when the connectors' source point is changed*/ + connectorSourceChange? (e: ConnectorSourceChangeEventArgs): void; + + /**Triggers when the connectors' target point is changed*/ + connectorTargetChange? (e: ConnectorTargetChangeEventArgs): void; + + /**Triggers before opening the context menu*/ + contextMenuBeforeOpen? (e: ContextMenuBeforeOpenEventArgs): void; + + /**Triggers when a context menu item is clicked*/ + contextMenuClick? (e: ContextMenuClickEventArgs): void; + + /**Triggers when a node, connector or diagram model is clicked twice*/ + doubleClick? (e: DoubleClickEventArgs): void; + + /**Triggers while dragging the elements in diagram*/ + drag? (e: DragEventArgs): void; + + /**Triggers when a symbol is dragged into diagram from symbol palette*/ + dragEnter? (e: DragEnterEventArgs): void; + + /**Triggers when a symbol is dragged outside of the diagram.*/ + dragLeave? (e: DragLeaveEventArgs): void; + + /**Triggers when a symbol is dragged over diagram*/ + dragOver? (e: DragOverEventArgs): void; + + /**Triggers when a symbol is dragged and dropped from symbol palette to drawing area*/ + drop? (e: DropEventArgs): void; + + /**Triggers when a child is added to or removed from a group*/ + groupChange? (e: GroupChangeEventArgs): void; + + /**Triggers when a diagram element is clicked*/ + itemClick? (e: ItemClickEventArgs): void; + + /**Triggers when mouse enters a node/connector*/ + mouseEnter? (e: MouseEnterEventArgs): void; + + /**Triggers when mouse leaves node/connector*/ + mouseLeave? (e: MouseLeaveEventArgs): void; + + /**Triggers when mouse hovers over a node/connector*/ + mouseOver? (e: MouseOverEventArgs): void; + + /**Triggers when node collection is changed*/ + nodeCollectionChange? (e: NodeCollectionChangeEventArgs): void; + + /**Triggers when the node properties(x, y,width and height alone) are changed using nudge commands or updateNode API.*/ + propertyChange? (e: PropertyChangeEventArgs): void; + + /**Triggers when the diagram elements are rotated*/ + rotationChange? (e: RotationChangeEventArgs): void; + + /**Triggers when the diagram is zoomed or panned*/ + scrollChange? (e: ScrollChangeEventArgs): void; + + /**Triggers when a connector segment is edited*/ + segmentChange? (e: SegmentChangeEventArgs): void; + + /**Triggers when the selection is changed in diagram*/ + selectionChange? (e: SelectionChangeEventArgs): void; + + /**Triggers when a node is resized*/ + sizeChange? (e: SizeChangeEventArgs): void; + + /**Triggers when label editing is ended*/ + textChange? (e: TextChangeEventArgs): void; +} + +export interface AutoScrollChangeEventArgs { + + /**Returns the delay between subsequent auto scrolls + */ + delay?: string; +} + +export interface ClickEventArgs { + + /**parameter returns the clicked node, connector or diagram + */ + element?: any; + + /**parameter returns the object that is actually clicked + */ + actualObject?: number; + + /**parameter returns the horizontal coordinate of the mouse pointer, relative to the diagram + */ + offsetX?: number; + + /**parameter returns the vertical coordinate of the mouse pointer, relative to the diagram + */ + offsetY?: number; + + /**parameter returns the count of how many times the mouse button is pressed + */ + count?: number; + + /**parameter returns the actual click event arguments that explains which button is clicked + */ + event?: any; +} + +export interface ConnectionChangeEventArgs { + + /**parameter returns the connection that is changed between nodes, ports or points + */ + element?: any; + + /**parameter returns the new source node or target node of the connector + */ + connection?: string; + + /**parameter returns the new source port or target port of the connector + */ + port?: any; + + /**parameter defines whether to cancel the change or not + */ + cancel?: boolean; +} + +export interface ConnectorCollectionChangeEventArgs { + + /**parameter returns whether the connector is inserted or removed + */ + changeType?: string; + + /**parameter returns the connector that is to be added or deleted + */ + element?: any; + + /**parameter defines whether to cancel the collection change or not + */ + cancel?: boolean; +} + +export interface ConnectorSourceChangeEventArgs { + + /**returns the connector, the source point of which is being dragged + */ + element?: any; + + /**returns the source node of the element + */ + node?: any; + + /**returns the source point of the element + */ + point?: any; + + /**returns the source port of the element + */ + port?: any; + + /**returns the state of connection end point dragging(starting, dragging, completed) + */ + dragState?: string; + + /**parameter defines whether to cancel the change or not + */ + cancel?: boolean; +} + +export interface ConnectorTargetChangeEventArgs { + + /**parameter returns the connector, the target point of which is being dragged + */ + element?: any; + + /**returns the target node of the element + */ + node?: any; + + /**returns the target point of the element + */ + point?: any; + + /**returns the target port of the element + */ + port?: any; + + /**returns the state of connection end point dragging(starting, dragging, completed) + */ + dragState?: string; + + /**parameter defines whether to cancel the change or not + */ + cancel?: boolean; +} + +export interface ContextMenuBeforeOpenEventArgs { + + /**parameter returns the diagram object + */ + diagram?: any; + + /**parameter returns the actual arguments from context menu + */ + contextmenu?: any; + + /**parameter returns the object that was clicked + */ + target?: any; +} + +export interface ContextMenuClickEventArgs { + + /**parameter returns the id of the selected context menu item + */ + id?: string; + + /**parameter returns the text of the selected context menu item + */ + text?: string; + + /**parameter returns the parent id of the selected context menu item + */ + parentId?: string; + + /**parameter returns the parent text of the selected context menu item + */ + parentText?: string; + + /**parameter returns the object that was clicked + */ + target?: any; + + /**parameter defines whether to execute the click event or not + */ + canExecute?: boolean; +} + +export interface DoubleClickEventArgs { + + /**parameter returns the object that is actually clicked + */ + actualObject?: any; + + /**parameter returns the selected object + */ + element?: any; +} + +export interface DragEventArgs { + + /**parameter returns the node or connector that is being dragged + */ + element?: any; + + /**parameter returns the previous position of the node/connector + */ + oldValue?: any; + + /**parameter returns the new position of the node/connector + */ + newValue?: any; + + /**parameter returns the state of drag event (Starting, dragging, completed) + */ + dragState?: string; + + /**parameter returns whether or not to cancel the drag event + */ + cancel?: boolean; +} + +export interface DragEnterEventArgs { + + /**parameter returns the node or connector that is dragged into diagram + */ + element?: any; + + /**parameter returns whether to add or remove the symbol from diagram + */ + cancel?: boolean; +} + +export interface DragLeaveEventArgs { + + /**parameter returns the node or connector that is dragged outside of the diagram + */ + element?: any; +} + +export interface DragOverEventArgs { + + /**parameter returns the node or connector that is dragged over diagram + */ + element?: any; + + /**parameter defines whether the symbol can be dropped at the current mouse position + */ + allowDrop?: boolean; + + /**parameter returns the node/connector over which the symbol is dragged + */ + target?: any; + + /**parameter returns the previous position of the node/connector + */ + oldValue?: any; + + /**parameter returns the new position of the node/connector + */ + newValue?: any; + + /**parameter returns whether or not to cancel the dragOver event + */ + cancel?: boolean; +} + +export interface DropEventArgs { + + /**parameter returns node or connector that is being dropped + */ + element?: any; + + /**parameter returns whether or not to cancel the drop event + */ + cancel?: boolean; + + /**parameter returns the object from where the element is dragged + */ + source?: any; + + /**parameter returns the object over which the object will be dropped + */ + target?: any; + + /**parameter returns the enum which defines the type of the source + */ + sourceType?: string; +} + +export interface GroupChangeEventArgs { + + /**parameter returns the object that is added to/removed from a group + */ + element?: any; + + /**parameter returns the old parent group(if any) of the object + */ + oldParent?: any; + + /**parameter returns the new parent group(if any) of the object + */ + newParent?: any; + + /**parameter returns the cause of group change("group", unGroup") + */ + cause?: string; +} + +export interface ItemClickEventArgs { + + /**parameter returns the object that was actually clicked + */ + actualObject?: any; + + /**parameter returns the object that is selected + */ + selectedObject?: any; + + /**parameter returns whether or not to cancel the drop event + */ + cancel?: boolean; + + /**parameter returns the actual click event arguments that explains which button is clicked + */ + event?: any; +} + +export interface MouseEnterEventArgs { + + /**parameter returns the target node or connector + */ + element?: any; + + /**parameter returns the object from where the selected object is dragged + */ + source?: any; + + /**parameter returns the target object over which the selected object is dragged + */ + target?: any; +} + +export interface MouseLeaveEventArgs { + + /**parameter returns the target node or connector + */ + element?: any; + + /**parameter returns the object from where the selected object is dragged + */ + source?: any; + + /**parameter returns the target object over which the selected object is dragged + */ + target?: any; +} + +export interface MouseOverEventArgs { + + /**parameter returns the target node or connector + */ + element?: any; + + /**parameter returns the object from where the element is dragged + */ + source?: any; + + /**parameter returns the object over which the element is being dragged. + */ + target?: any; +} + +export interface NodeCollectionChangeEventArgs { + + /**parameter returns whether the node is to be added or removed + */ + changeType?: string; + + /**parameter returns the node which needs to be added or deleted + */ + element?: any; + + /**parameter defines whether to cancel the collection change or not + */ + cancel?: boolean; +} + +export interface PropertyChangeEventArgs { + + /**parameter returns the selected element + */ + element?: any; + + /**parameter returns the action is nudge or not + */ + cause?: string; + + /**parameter returns the new value of the node property that is being changed + */ + newValue?: any; + + /**parameter returns the old value of the property that is being changed + */ + oldValue?: any; + + /**parameter returns the name of the property that is changed + */ + propertyName?: string; +} + +export interface RotationChangeEventArgs { + + /**parameter returns the node that is rotated + */ + element?: any; + + /**parameter returns the previous rotation angle + */ + oldValue?: any; + + /**parameter returns the new rotation angle + */ + newValue?: any; + + /**parameter to specify whether or not to cancel the event + */ + cancel?: boolean; +} + +export interface ScrollChangeEventArgs { + + /**Parameter returns the new zoom value, horizontal and vertical scroll offsets. + */ + newValues?: any; + + /**parameter returns the previous zoom value, horizontal and vertical scroll offsets. + */ + oldValues?: any; +} + +export interface SegmentChangeEventArgs { + + /**Parameter returns the connector that is being edited + */ + element?: any; + + /**parameter returns the state of editing (starting, dragging, completed) + */ + dragState?: string; + + /**parameter returns the current mouse position + */ + point?: any; + + /**parameter to specify whether or not to cancel the event + */ + cancel?: boolean; +} + +export interface SelectionChangeEventArgs { + + /**parameter returns whether the item is selected or removed selection + */ + changeType?: string; + + /**parameter returns the item which is selected or to be selected + */ + element?: any; + + /**parameter returns the collection of nodes and connectors that have to be removed from selection list + */ + oldItems?: Array; + + /**parameter returns the collection of nodes and connectors that have to be added to selection list + */ + newItems?: Array; + + /**parameter returns the collection of nodes and connectors that will be selected after selection change + */ + selectedItems?: Array; + + /**parameter to specify whether or not to cancel the selection change event + */ + cancel?: boolean; +} + +export interface SizeChangeEventArgs { + + /**parameter returns node that was resized + */ + element?: any; + + /**parameter to cancel the size change + */ + cancel?: boolean; + + /**parameter returns the new width, height, offsetX and offsetY values of the element that is being resized + */ + newValue?: any; + + /**parameter returns the previous width,height,offsetX and offsetY values of the element that is being resized + */ + oldValue?: any; + + /**parameter returns the state of resizing(starting,resizing,completed) + */ + resizeState?: string; + + /**parameter returns the difference between new and old value + */ + offset?: any; +} + +export interface TextChangeEventArgs { + + /**parameter returns the node that contains the text being edited + */ + element?: any; + + /**parameter returns the new text + */ + value?: string; + + /**parameter returns the keyCode of the key entered + */ + keyCode?: string; +} + +export interface CommandManagerCommandsGesture { + + /**Sets the key value, on recognition of which the command will be executed. + * @Default {ej.datavisualization.Diagram.Keys.None} + */ + key?: ej.datavisualization.Diagram.Keys|string; + + /**Sets a combination of key modifiers, on recognition of which the command will be executed. + * @Default {ej.datavisualization.Diagram.KeyModifiers.None} + */ + keyModifiers?: ej.datavisualization.Diagram.KeyModifiers|string; +} + +export interface CommandManagerCommands { + + /**A method that defines whether the command is executable at the moment or not. + */ + canExecute?: Function; + + /**A method that defines what to be executed when the key combination is recognized. + */ + execute?: Function; + + /**Defines a combination of keys and key modifiers, on recognition of which the command will be executed + */ + gesture?: CommandManagerCommandsGesture; + + /**Defines any additional parameters that are required at runtime + * @Default {null} + */ + parameter?: any; +} + +export interface CommandManager { + + /**An object that maps a set of command names with the corresponding command objects + * @Default {{}} + */ + commands?: CommandManagerCommands; +} + +export interface ConnectorsSegments { + + /**Sets the direction of orthogonal segment + */ + direction?: string; + + /**Describes the length of orthogonal segment + * @Default {undefined} + */ + length?: number; + + /**Describes the end point of bezier/straight segment + * @Default {Diagram.Point()} + */ + point?: ej.datavisualization.Diagram.ConnectorsSourcePoint|string; + + /**Defines the first control point of the bezier segment + * @Default {null} + */ + point1?: ej.datavisualization.Diagram.ConnectorsSourcePoint|string; + + /**Defines the second control point of bezier segment + * @Default {null} + */ + point2?: ej.datavisualization.Diagram.ConnectorsSourcePoint|string; + + /**Sets the type of the segment. + * @Default {ej.datavisualization.Diagram.Segments.Straight} + */ + type?: ej.datavisualization.Diagram.Segments|string; + + /**Describes the length and angle between the first control point and the start point of bezier segment + * @Default {null} + */ + vector1?: any; + + /**Describes the length and angle between the second control point and end point of bezier segment + * @Default {null} + */ + vector2?: any; +} + +export interface ConnectorsSourceDecorator { + + /**Sets the border color of the source decorator + * @Default {black} + */ + borderColor?: string; + + /**Sets the border width of the decorator + * @Default {1} + */ + borderWidth?: number; + + /**Sets the fill color of the source decorator + * @Default {black} + */ + fillColor?: string; + + /**Sets the height of the source decorator + * @Default {8} + */ + height?: number; + + /**Defines the custom shape of the source decorator + */ + pathData?: string; + + /**Defines the shape of the source decorator. + * @Default {ej.datavisualization.Diagram.DecoratorShapes.Arrow} + */ + shape?: ej.datavisualization.Diagram.DecoratorShapes|string; + + /**Defines the width of the source decorator + * @Default {8} + */ + width?: number; +} + +export interface ConnectorsSourcePoint { + + /**Defines the x-coordinate of a position + * @Default {0} + */ + x?: number; + + /**Defines the y-coordinate of a position + * @Default {0} + */ + y?: number; +} + +export interface ConnectorsTargetDecorator { + + /**Sets the border color of the decorator + * @Default {black} + */ + borderColor?: string; + + /**Sets the color with which the decorator will be filled + * @Default {black} + */ + fillColor?: string; + + /**Defines the height of the target decorator + * @Default {8} + */ + height?: number; + + /**Defines the custom shape of the target decorator + */ + pathData?: string; + + /**Defines the shape of the target decorator. + * @Default {ej.datavisualization.Diagram.DecoratorShapes.Arrow} + */ + shape?: ej.datavisualization.Diagram.DecoratorShapes|string; + + /**Defines the width of the target decorator + * @Default {8} + */ + width?: number; +} + +export interface Connectors { + + /**To maintain additional information about connectors + * @Default {null} + */ + addInfo?: any; + + /**Defines the width of the line bridges + * @Default {10} + */ + bridgeSpace?: number; + + /**Enables or disables the behaviors of connectors. + * @Default {ej.datavisualization.Diagram.ConnectorConstraints.Default} + */ + constraints?: ej.datavisualization.Diagram.ConnectorConstraints|string; + + /**Defines the radius of the rounded corner + * @Default {0} + */ + cornerRadius?: number; + + /**Configures the styles of shapes + */ + cssClass?: string; + + /**Sets the horizontal alignment of the connector. Applicable, if the parent of the connector is a container. + * @Default {ej.datavisualization.Diagram.HorizontalAlignment.Left} + */ + horizontalAlign?: ej.datavisualization.Diagram.HorizontalAlignment|string; + + /**A collection of JSON objects where each object represents a label. For label properties, refer Labels + * @Default {[]} + */ + labels?: Array; + + /**Sets the stroke color of the connector + * @Default {black} + */ + lineColor?: string; + + /**Sets the pattern of dashes and gaps used to stroke the path of the connector + */ + lineDashArray?: string; + + /**Defines the padding value to ease the interaction with connectors + * @Default {10} + */ + lineHitPadding?: number; + + /**Sets the width of the line + * @Default {1} + */ + lineWidth?: number; + + /**Defines the minimum space to be left between the bottom of parent bounds and the connector. Applicable, if the parent is a container. + * @Default {0} + */ + marginBottom?: number; + + /**Defines the minimum space to be left between the left of parent bounds and the connector. Applicable, if the parent is a container. + * @Default {0} + */ + marginLeft?: number; + + /**Defines the minimum space to be left between the right of parent bounds and the connector. Applicable, if the parent is a container. + * @Default {0} + */ + marginRight?: number; + + /**Defines the minimum space to be left between the top of parent bounds and the connector. Applicable, if the parent is a container. + * @Default {0} + */ + marginTop?: number; + + /**Sets a unique name for the connector + */ + name?: string; + + /**Defines the transparency of the connector + * @Default {1} + */ + opacity?: number; + + /**Defines the size and preview size of the node to add that to symbol palette. To explore palette item, refer Palette Item + * @Default {null} + */ + paletteItem?: any; + + /**Sets the parent name of the connector. + */ + parent?: string; + + /**An array of JSON objects where each object represents a segment + * @Default {[ { type:straight } ]} + */ + segments?: Array; + + /**Defines the source decorator of the connector + * @Default {{ shape:arrow, width: 8, height:8, borderColor:black, fillColor:black }} + */ + sourceDecorator?: ConnectorsSourceDecorator; + + /**Sets the source node of the connector + */ + sourceNode?: string; + + /**Defines the space to be left between the source node and the source point of a connector + * @Default {0} + */ + sourcePadding?: number; + + /**Describes the start point of the connector + * @Default {ej.datavisualization.Diagram.Point()} + */ + sourcePoint?: ConnectorsSourcePoint; + + /**Sets the source port of the connector + */ + sourcePort?: string; + + /**Defines the target decorator of the connector + * @Default {{ shape:arrow, width: 8, height:8, borderColor:black, fillColor:black }} + */ + targetDecorator?: ConnectorsTargetDecorator; + + /**Sets the target node of the connector + */ + targetNode?: string; + + /**Defines the space to be left between the target node and the target point of the connector + * @Default {0} + */ + targetPadding?: number; + + /**Describes the end point of the connector + * @Default {ej.datavisualization.Diagram.Point()} + */ + targetPoint?: ej.datavisualization.Diagram.ConnectorsSourcePoint|string; + + /**Sets the targetPort of the connector + */ + targetPort?: string; + + /**Defines the tooltip that should be shown when the mouse hovers over connector. For tooltip properties, refer Tooltip + * @Default {null} + */ + tooltip?: any; + + /**To set the vertical alignment of connector (Applicable,if the parent is group). + * @Default {ej.datavisualization.Diagram.VerticalAlignment.Top} + */ + verticalAlign?: ej.datavisualization.Diagram.VerticalAlignment|string; + + /**Enables or disables the visibility of connector + * @Default {true} + */ + visible?: boolean; + + /**Sets the z-index of the connector + * @Default {0} + */ + zOrder?: number; +} + +export interface ContextMenu { + + /**Defines the collection of context menu items + * @Default {[]} + */ + items?: Array; + + /**To set whether to display the default context menu items or not + * @Default {false} + */ + showCustomMenuItemsOnly?: boolean; +} + +export interface DataSourceSettings { + + /**Defines the data source either as a collection of objects or as an instance of ej.DataManager + * @Default {null} + */ + dataSource?: any; + + /**Sets the unique id of the data source items + */ + id?: string; + + /**Defines the parent id of the data source item + * @Default {''} + */ + parent?: string; + + /**Describes query to retrieve a set of data from the specified datasource + * @Default {null} + */ + query?: string; + + /**Sets the unique id of the root data source item + */ + root?: string; + + /**Describes the name of the table on which the specified query has to be executed + * @Default {null} + */ + tableName?: string; +} + +export interface DefaultSettings { + + /**Initializes the default connector properties + * @Default {null} + */ + connector?: any; + + /**Initializes the default properties of groups + * @Default {null} + */ + group?: any; + + /**Initializes the default properties for nodes + * @Default {null} + */ + node?: any; +} + +export interface HistoryManager { + + /**A method that takes a history entry as argument and returns whether the specific entry can be popped or not + */ + canPop?: Function; + + /**A method that ends grouping the changes + */ + closeGroupAction?: Function; + + /**A method that removes the history of a recent change made in diagram + */ + pop?: Function; + + /**A method that allows to track the custom changes made in diagram + */ + push?: Function; + + /**Defines what should be happened while trying to restore a custom change + * @Default {null} + */ + redo?: Function; + + /**A method that starts to group the changes to revert/restore them in a single undo or redo + */ + startGroupAction?: Function; + + /**Defines what should be happened while trying to revert a custom change + */ + undo?: Function; +} + +export interface Layout { + + /**Defines the fixed node with reference to which, the layout will be arranged and fixed node will not be repositioned + */ + fixedNode?: string; + + /**Customizes the orientation of trees/sub trees. For orientations, see Chart Orientations. For chart types, see Chart Types + * @Default {null} + */ + getLayoutInfo?: any; + + /**Sets the space to be horizontally left between nodes + * @Default {30} + */ + horizontalSpacing?: number; + + /**Sets the margin value to be horizontally left between the layout and diagram + * @Default {0} + */ + marginX?: number; + + /**Sets the margin value to be vertically left between layout and diagram + * @Default {0} + */ + marginY?: number; + + /**Sets the orientation/direction to arrange the diagram elements. + * @Default {ej.datavisualization.Diagram.LayoutOrientations.TopToBottom} + */ + orientation?: ej.datavisualization.Diagram.LayoutOrientations|string; + + /**Sets the type of the layout based on which the elements will be arranged. + * @Default {ej.datavisualization.Diagram.LayoutTypes.None} + */ + type?: ej.datavisualization.Diagram.LayoutTypes|string; + + /**Sets the space to be vertically left between nodes + * @Default {30} + */ + verticalSpacing?: number; +} + +export interface NodesContainer { + + /**Defines the orientation of the container. Applicable, if the group is a container. + * @Default {vertical} + */ + orientation?: string; + + /**Sets the type of the container. Applicable if the group is a container. + * @Default {ej.datavisualization.Diagram.ContainerType.Canvas} + */ + type?: ej.datavisualization.Diagram.ContainerType|string; +} + +export interface NodesGradientLinearGradient { + + /**Defines the different colors and the region of color transitions + * @Default {[]} + */ + stops?: Array; + + /**Defines the left most position(relative to node) of the rectangular region that needs to be painted + * @Default {0} + */ + x1?: number; + + /**Defines the right most position(relative to node) of the rectangular region that needs to be painted + * @Default {0} + */ + x2?: number; + + /**Defines the top most position(relative to node) of the rectangular region that needs to be painted + * @Default {0} + */ + y1?: number; + + /**Defines the bottom most position(relative to node) of the rectangular region that needs to be painted + * @Default {0} + */ + y2?: number; +} + +export interface NodesGradientRadialGradient { + + /**Defines the position of the outermost circle + * @Default {0} + */ + cx?: number; + + /**Defines the outer most circle of the radial gradient + * @Default {0} + */ + cy?: number; + + /**Defines the innermost circle of the radial gradient + * @Default {0} + */ + fx?: number; + + /**Defines the innermost circle of the radial gradient + * @Default {0} + */ + fy?: number; + + /**Defines the different colors and the region of color transitions. + * @Default {[]} + */ + stops?: Array; +} + +export interface NodesGradientStop { + + /**Sets the color to be filled over the specified region + */ + color?: string; + + /**Sets the position where the previous color transition ends and a new color transition starts + * @Default {0} + */ + offset?: number; + + /**Describes the transparency level of the region + * @Default {1} + */ + opacity?: number; +} + +export interface NodesGradient { + + /**Paints the node with linear color transitions + */ + LinearGradient?: NodesGradientLinearGradient; + + /**Paints the node with radial color transitions. A focal point defines the beginning of the gradient, and a circle defines the end point of the gradient. + */ + RadialGradient?: NodesGradientRadialGradient; + + /**Defines the color and a position where the previous color transition ends and a new color transition starts + */ + Stop?: NodesGradientStop; +} + +export interface NodesLabels { + + /**Enables/disables the bold style + * @Default {false} + */ + bold?: boolean; + + /**Sets the border color of the label + * @Default {transparent} + */ + borderColor?: string; + + /**Sets the border width of the label + * @Default {0} + */ + borderWidth?: number; + + /**Sets the fill color of the text area + * @Default {transparent} + */ + fillColor?: string; + + /**Sets the font color of the text + * @Default {black} + */ + fontColor?: string; + + /**Sets the font family of the text + * @Default {Arial} + */ + fontFamily?: string; + + /**Defines the font size of the text + * @Default {12} + */ + fontSize?: number; + + /**Sets the horizontal alignment of the label. + * @Default {ej.datavisualization.Diagram.HorizontalAlignment.Center} + */ + horizontalAlignment?: ej.datavisualization.Diagram.HorizontalAlignment|string; + + /**Enables/disables the italic style + * @Default {false} + */ + italic?: boolean; + + /**To set the margin of the label + * @Default {ej.datavisualization.Diagram.Margin()} + */ + margin?: any; + + /**Gets whether the label is currently being edited or not. + * @Default {ej.datavisualization.Diagram.LabelEditMode.Edit} + */ + mode?: ej.datavisualization.Diagram.LabelEditMode|string; + + /**Sets the unique identifier of the label + */ + name?: string; + + /**Sets the fraction/ratio(relative to node) that defines the position of the label + * @Default {ej.datavisualization.Diagram.Point(0.5, 0.5)} + */ + offset?: any; + + /**Defines whether the label is editable or not + * @Default {false} + */ + readOnly?: boolean; + + /**Defines the angle to which the label needs to be rotated + * @Default {0} + */ + rotateAngle?: number; + + /**Defines the label text + */ + text?: string; + + /**Defines how to align the text inside the label. + * @Default {ej.datavisualization.Diagram.TextAlign.Center} + */ + textAlign?: ej.datavisualization.Diagram.TextAlign|string; + + /**Sets how to decorate the label text. + * @Default {ej.datavisualization.Diagram.TextDecorations.None} + */ + textDecoration?: ej.datavisualization.Diagram.TextDecorations|string; + + /**Sets the vertical alignment of the label. + * @Default {ej.datavisualization.Diagram.VerticalAlignment.Center} + */ + verticalAlignment?: ej.datavisualization.Diagram.VerticalAlignment|string; + + /**Enables or disables the visibility of the label + * @Default {true} + */ + visible?: boolean; + + /**Sets the width of the label(the maximum value of label width and the node width will be considered as label width) + * @Default {50} + */ + width?: number; + + /**Defines how the label text needs to be wrapped. + * @Default {ej.datavisualization.Diagram.TextWrapping.WrapWithOverflow} + */ + wrapping?: ej.datavisualization.Diagram.TextWrapping|string; +} + +export interface NodesLanes { + + /**Allows to maintain additional information about lane + * @Default {{}} + */ + addInfo?: any; + + /**An array of objects where each object represents a child node of the lane + * @Default {[]} + */ + children?: Array; + + /**Defines the fill color of the lane + * @Default {white} + */ + fillColor?: string; + + /**Defines the header of the lane + * @Default {{ text: Function, fontSize: 11 }} + */ + header?: any; + + /**Defines the object as a lane + * @Default {false} + */ + isLane?: boolean; + + /**Sets the unique identifier of the lane + */ + name?: string; + + /**Sets the orientation of the lane. + * @Default {vertical} + */ + orientation?: string; +} + +export interface NodesPaletteItem { + + /**Defines whether the symbol should be drawn at its actual size regardless of precedence factors or not + * @Default {true} + */ + enableScale?: boolean; + + /**Defines the height of the symbol + * @Default {0} + */ + height?: number; + + /**Defines the margin of the symbol item + * @Default {{ left: 4, right: 4, top: 4, bottom: 4 }} + */ + margin?: any; + + /**Defines the preview height of the symbol + * @Default {undefined} + */ + previewHeight?: number; + + /**Defines the preview width of the symbol + * @Default {undefined} + */ + previewWidth?: number; + + /**Defines the width of the symbol + * @Default {0} + */ + width?: number; +} + +export interface NodesPhases { + + /**Defines the header of the smaller regions + * @Default {null} + */ + label?: any; + + /**Defines the line color of the splitter that splits adjacent phases. + * @Default {#606060} + */ + lineColor?: string; + + /**Sets the dash array that used to stroke the phase splitter + * @Default {3,3} + */ + lineDashArray?: string; + + /**Sets the lineWidth of the phase + * @Default {1} + */ + lineWidth?: number; + + /**Sets the unique identifier of the phase + */ + name?: string; + + /**Sets the length of the smaller region(phase) of a swimlane + * @Default {100} + */ + offset?: number; + + /**Sets the orientation of the phase + * @Default {horizontal} + */ + orientation?: string; + + /**Sets the type of the object as phase + * @Default {phase} + */ + type?: string; +} + +export interface NodesPorts { + + /**Sets the border color of the port + * @Default {#1a1a1a} + */ + borderColor?: string; + + /**Sets the stroke width of the port + * @Default {1} + */ + borderWidth?: number; + + /**Defines the space to be left between the port bounds and its incoming and outgoing connections. + * @Default {0} + */ + connectorPadding?: number; + + /**Defines whether connections can be created with the port + * @Default {ej.datavisualization.Diagram.PortConstraints.Connect} + */ + constraints?: ej.datavisualization.Diagram.PortConstraints|string; + + /**Sets the fill color of the port + * @Default {white} + */ + fillColor?: string; + + /**Sets the unique identifier of the port + */ + name?: string; + + /**Defines the position of the port as fraction/ ratio relative to node + * @Default {ej.datavisualization.Diagram.Point(0, 0)} + */ + offset?: any; + + /**Defines the path data to draw the port. Applicable, if the port shape is path. + */ + pathData?: string; + + /**Defines the shape of the port. + * @Default {ej.datavisualization.Diagram.PortShapes.Square} + */ + shape?: ej.datavisualization.Diagram.PortShapes|string; + + /**Defines the size of the port + * @Default {8} + */ + size?: number; + + /**Defines when the port should be visible. + * @Default {ej.datavisualization.Diagram.PortVisibility.Default} + */ + visibility?: ej.datavisualization.Diagram.PortVisibility|string; +} + +export interface NodesShadow { + + /**Defines the angle of the shadow relative to node + * @Default {45} + */ + angle?: number; + + /**Sets the distance to move the shadow relative to node + * @Default {5} + */ + distance?: number; + + /**Defines the opaque of the shadow + * @Default {0.7} + */ + opacity?: number; +} + +export interface NodesSubProcess { + + /**Defines whether the bpmn sub process is without any prescribed order or not + * @Default {false} + */ + adhoc?: boolean; + + /**Sets the boundary of the BPMN process + * @Default {ej.datavisualization.Diagram.BPMNBoundary.Default} + */ + boundary?: ej.datavisualization.Diagram.BPMNBoundary|string; + + /**Sets whether the bpmn subprocess is triggered as a compensation of a specific activity + * @Default {false} + */ + compensation?: boolean; + + /**Defines the loop type of a sub process. + * @Default {ej.datavisualization.Diagram.BPMNLoops.None} + */ + loop?: ej.datavisualization.Diagram.BPMNLoops|string; +} + +export interface NodesTask { + + /**To set whether the task is a global task or not + * @Default {false} + */ + call?: boolean; + + /**Sets whether the task is triggered as a compensation of another specific activity + * @Default {false} + */ + compensation?: boolean; + + /**Sets the loop type of a bpmn task. + * @Default {ej.datavisualization.Diagram.BPMNLoops.None} + */ + loop?: ej.datavisualization.Diagram.BPMNLoops|string; + + /**Sets the type of the BPMN task. + * @Default {ej.datavisualization.Diagram.BPMNTasks.None} + */ + type?: ej.datavisualization.Diagram.BPMNTasks|string; +} + +export interface Nodes { + + /**Defines the type of BPMN Activity. Applicable, if the node is a bpmn activity. + * @Default {ej.datavisualization.Diagram.BPMNActivity.Task} + */ + activity?: ej.datavisualization.Diagram.BPMNActivity|string; + + /**To maintain additional information about nodes + * @Default {{}} + */ + addInfo?: any; + + /**Sets the border color of node + * @Default {black} + */ + borderColor?: string; + + /**Sets the pattern of dashes and gaps to stroke the border + */ + borderDashArray?: string; + + /**Sets the border width of the node + * @Default {1} + */ + borderWidth?: number; + + /**Defines whether the group can be ungrouped or not + * @Default {true} + */ + canUngroup?: boolean; + + /**Array of JSON objects where each object represents a child node/connector + * @Default {[]} + */ + children?: Array; + + /**Defines whether the BPMN data object is a collection or not + * @Default {false} + */ + collection?: boolean; + + /**Defines the distance to be left between a node and its connections(In coming and out going connections). + * @Default {0} + */ + connectorPadding?: number; + + /**Enables or disables the default behaviors of the node. + * @Default {ej.datavisualization.Diagram.NodeConstraints.Default} + */ + constraints?: ej.datavisualization.Diagram.NodeConstraints|string; + + /**Defines how the child objects need to be arranged(Either in any predefined manner or automatically). Applicable, if the node is a group. + * @Default {null} + */ + container?: NodesContainer; + + /**Defines the corner radius of rectangular shapes. + * @Default {0} + */ + cornerRadius?: number; + + /**Configures the styles of shapes + */ + cssClass?: string; + + /**Sets the type of the BPMN Events. Applicable, if the node is a bpmn event. + * @Default {ej.datavisualization.Diagram.BPMNEvents.Start} + */ + event?: ej.datavisualization.Diagram.BPMNEvents|string; + + /**Defines whether the node can be automatically arranged using layout or not + * @Default {false} + */ + excludeFromLayout?: boolean; + + /**Defines the fill color of the node + * @Default {white} + */ + fillColor?: string; + + /**Sets the type of the BPMN Gateway. Applicable, if the node is a bpmn gateway. + * @Default {ej.datavisualization.Diagram.BPMNGateways.None} + */ + gateway?: ej.datavisualization.Diagram.BPMNGateways|string; + + /**Paints the node with a smooth transition from one color to another color + */ + gradient?: NodesGradient; + + /**Defines the header of a swimlane/lane + * @Default {{ text: Title, fontSize: 11 }} + */ + header?: any; + + /**Defines the height of the node + * @Default {0} + */ + height?: number; + + /**Sets the horizontal alignment of the node. Applicable, if the parent of the node is a container. + * @Default {ej.datavisualization.Diagram.HorizontalAlignment.Left} + */ + horizontalAlign?: ej.datavisualization.Diagram.HorizontalAlignment|string; + + /**A read only collection of the incoming connectors/edges of the node + * @Default {[]} + */ + inEdges?: Array; + + /**Defines whether the sub tree of the node is expanded or collapsed + * @Default {true} + */ + isExpanded?: boolean; + + /**Sets the node as a swimlane + * @Default {false} + */ + isSwimlane?: boolean; + + /**A collection of objects where each object represents a label + * @Default {[]} + */ + labels?: Array; + + /**An array of objects where each object represents a lane. Applicable, if the node is a swimlane. + * @Default {[]} + */ + lanes?: Array; + + /**Defines the minimum space to be left between the bottom of parent bounds and the node. Applicable, if the parent is a container. + * @Default {0} + */ + marginBottom?: number; + + /**Defines the minimum space to be left between the left of parent bounds and the node. Applicable, if the parent is a container. + * @Default {0} + */ + marginLeft?: number; + + /**Defines the minimum space to be left between the right of the parent bounds and the node. Applicable, if the parent is a container. + * @Default {0} + */ + marginRight?: number; + + /**Defines the minimum space to be left between the top of parent bounds and the node. Applicable, if the parent is a container. + * @Default {0} + */ + marginTop?: number; + + /**Defines the maximum height limit of the node + * @Default {0} + */ + maxHeight?: number; + + /**Defines the maximum width limit of the node + * @Default {0} + */ + maxWidth?: number; + + /**Defines the minimum height limit of the node + * @Default {0} + */ + minHeight?: number; + + /**Defines the minimum width limit of the node + * @Default {0} + */ + minWidth?: number; + + /**Sets the unique identifier of the node + */ + name?: string; + + /**Defines the position of the node on X-Axis + * @Default {0} + */ + offsetX?: number; + + /**Defines the position of the node on Y-Axis + * @Default {0} + */ + offsetY?: number; + + /**Defines the opaque of the node + * @Default {1} + */ + opacity?: number; + + /**Defines the orientation of nodes. Applicable, if the node is a swimlane. + * @Default {vertical} + */ + orientation?: string; + + /**A read only collection of outgoing connectors/edges of the node + * @Default {[]} + */ + outEdges?: Array; + + /**Defines the minimum padding value to be left between the bottom most position of a group and its children. Applicable, if the group is a container. + * @Default {0} + */ + paddingBottom?: number; + + /**Defines the minimum padding value to be left between the left most position of a group and its children. Applicable, if the group is a container. + * @Default {0} + */ + paddingLeft?: number; + + /**Defines the minimum padding value to be left between the right most position of a group and its children. Applicable, if the group is a container. + * @Default {0} + */ + paddingRight?: number; + + /**Defines the minimum padding value to be left between the top most position of a group and its children. Applicable, if the group is a container. + * @Default {0} + */ + paddingTop?: number; + + /**Defines the size and preview size of the node to add that to symbol palette + * @Default {null} + */ + paletteItem?: NodesPaletteItem; + + /**Sets the name of the parent group + */ + parent?: string; + + /**Sets the path geometry that defines the shape of a path node + */ + pathData?: string; + + /**An array of objects, where each object represents a smaller region(phase) of a swimlane. + * @Default {[]} + */ + phases?: Array; + + /**Sets the height of the phase headers + * @Default {0} + */ + phaseSize?: number; + + /**Sets the ratio/ fractional value relative to node, based on which the node will be transformed(positioning, scaling and rotation) + * @Default {ej.datavisualization.Diagram.Points(0.5,0.5)} + */ + pivot?: any; + + /**Defines a collection of points to draw a polygon. Applicable, if the shape is a polygon. + * @Default {[]} + */ + points?: Array; + + /**An array of objects where each object represents a port + * @Default {[]} + */ + ports?: Array; + + /**Sets the angle to which the node should be rotated + * @Default {0} + */ + rotateAngle?: number; + + /**Defines the opacity and the position of shadow + * @Default {ej.datavisualization.Diagram.Shadow()} + */ + shadow?: NodesShadow; + + /**Sets the shape of the node. It depends upon the type of node. + * @Default {ej.datavisualization.Diagram.BasicShapes.Rectangle} + */ + shape?: ej.datavisualization.Diagram.BasicShapes|string; + + /**Sets the source path of the image. Applicable, if the type of the node is image. + */ + source?: string; + + /**Defines the sub process of a BPMN Activity. Applicable, if the type of the bpmn activity is sub process. + * @Default {ej.datavisualization.Diagram.BPMNSubProcess()} + */ + subProcess?: NodesSubProcess; + + /**Defines the task of the bpmn activity. Applicable, if the type of activity is set as task. + * @Default {ej.datavisualization.Diagram.BPMNTask()} + */ + task?: NodesTask; + + /**Sets the id of svg/html templates. Applicable, if the node is html or native. + */ + templateId?: string; + + /**Defines the textBlock of a text node + * @Default {null} + */ + textBlock?: any; + + /**Defines the tooltip that should be shown when the mouse hovers over node. For tooltip properties, refer Tooltip + * @Default {null} + */ + tooltip?: any; + + /**Sets the type of BPMN Event Triggers. + * @Default {ej.datavisualization.Diagram.BPMNTriggers.None} + */ + trigger?: ej.datavisualization.Diagram.BPMNTriggers|string; + + /**Defines the type of the node. + * @Default {ej.datavisualization.Diagram.Shapes.Basic} + */ + type?: ej.datavisualization.Diagram.Shapes|string; + + /**Sets the vertical alignment of a node. Applicable, if the parent of a node is a container. + * @Default {ej.datavisualization.Diagram.VerticalAlignment.Top} + */ + verticalAlign?: ej.datavisualization.Diagram.VerticalAlignment|string; + + /**Defines the visibility of the node + * @Default {true} + */ + visible?: boolean; + + /**Defines the width of the node + * @Default {0} + */ + width?: number; + + /**Defines the z-index of the node + * @Default {0} + */ + zOrder?: number; +} + +export interface PageSettings { + + /**Defines the maximum distance to be left between the object and the scroll bar to trigger auto scrolling + * @Default {{ left: 15, top: 15, right: 15, bottom: 15 }} + */ + autoScrollBorder?: any; + + /**Sets whether multiple pages can be created to fit all nodes and connectors + * @Default {false} + */ + multiplePage?: boolean; + + /**Defines the background color of diagram pages + * @Default {#ffffff} + */ + pageBackgroundColor?: string; + + /**Defines the page border color + * @Default {#565656} + */ + pageBorderColor?: string; + + /**Sets the border width of diagram pages + * @Default {0} + */ + pageBorderWidth?: number; + + /**Defines the height of a page + * @Default {null} + */ + pageHeight?: number; + + /**Defines the page margin + * @Default {24} + */ + pageMargin?: number; + + /**Sets the orientation of the page. + * @Default {ej.datavisualization.Diagram.PageOrientations.Portrait} + */ + pageOrientation?: ej.datavisualization.Diagram.PageOrientations|string; + + /**Defines the height of a diagram page + * @Default {null} + */ + pageWidth?: number; + + /**Defines the scrollable area of diagram. Applicable, if the scroll limit is "limited". + * @Default {null} + */ + scrollableArea?: any; + + /**Defines the scrollable region of diagram. + * @Default {ej.datavisualization.Diagram.ScrollLimit.Infinite} + */ + scrollLimit?: ej.datavisualization.Diagram.ScrollLimit|string; + + /**Enables or disables the page breaks + * @Default {false} + */ + showPageBreak?: boolean; +} + +export interface ScrollSettings { + + /**Allows to read the zoom value of diagram + * @Default {0} + */ + currentZoom?: number; + + /**Sets the horizontal scroll offset + * @Default {0} + */ + horizontalOffset?: number; + + /**Allows to extend the scrollable region that is based on the scroll limit + * @Default {{left: 0, right: 0, top:0, bottom: 0}} + */ + padding?: any; + + /**Sets the vertical scroll offset + * @Default {0} + */ + verticalOffset?: number; + + /**Allows to read the view port height of the diagram + * @Default {0} + */ + viewPortHeight?: number; + + /**Allows to read the view port width of the diagram + * @Default {0} + */ + viewPortWidth?: number; +} + +export interface SelectedItems { + + /**A read only collection of the selected items + * @Default {[]} + */ + children?: Array; + + /**Controls the visibility of selector. + * @Default {ej.datavisualization.Diagram.SelectorConstraints.All} + */ + constraints?: ej.datavisualization.Diagram.SelectorConstraints|string; + + /**Defines a method that dynamically enables/ disables the interaction with multiple selection. + * @Default {null} + */ + getConstraints?: any; + + /**Sets the height of the selected items + * @Default {0} + */ + height?: number; + + /**Sets the x position of the selector + * @Default {0} + */ + offsetX?: number; + + /**Sets the y position of the selector + * @Default {0} + */ + offsetY?: number; + + /**Sets the angle to rotate the selected items + * @Default {0} + */ + rotateAngle?: number; + + /**Sets the angle to rotate the selected items. For tooltip properties, refer Tooltip + * @Default {ej.datavisualization.Diagram.Tooltip()} + */ + tooltip?: any; + + /**A collection of frequently using commands that have to be added around the selector. + * @Default {[]} + */ + userHandles?: Array; + + /**Sets the width of the selected items + * @Default {0} + */ + width?: number; +} + +export interface SnapSettingsHorizontalGridLines { + + /**Defines the line color of horizontal grid lines + * @Default {lightgray} + */ + lineColor?: string; + + /**Specifies the pattern of dashes and gaps used to stroke horizontal grid lines + */ + lineDashArray?: string; + + /**A pattern of lines and gaps that defines a set of horizontal gridlines + * @Default {[1.25, 18.75, 0.25, 19.75, 0.25, 19.75, 0.25, 19.75, 0.25, 19.75]} + */ + linesInterval?: Array; + + /**Specifies a set of intervals to snap the objects + * @Default {[20]} + */ + snapInterval?: Array; +} + +export interface SnapSettingsVerticalGridLines { + + /**Defines the line color of horizontal grid lines + * @Default {lightgray} + */ + lineColor?: string; + + /**Specifies the pattern of dashes and gaps used to stroke horizontal grid lines + */ + lineDashArray?: string; + + /**A pattern of lines and gaps that defines a set of horizontal gridlines + * @Default {[1.25, 18.75, 0.25, 19.75, 0.25, 19.75, 0.25, 19.75, 0.25, 19.75]} + */ + linesInterval?: Array; + + /**Specifies a set of intervals to snap the objects + * @Default {[20]} + */ + snapInterval?: Array; +} + +export interface SnapSettings { + + /**Enables or disables snapping nodes/connectors to objects + * @Default {true} + */ + enableSnapToObject?: boolean; + + /**Defines the appearance of horizontal gridlines + */ + horizontalGridLines?: SnapSettingsHorizontalGridLines; + + /**Defines the angle by which the object needs to be snapped + * @Default {5} + */ + snapAngle?: number; + + /**Defines the minimum distance between the selected object and the nearest object + * @Default {5} + */ + snapObjectDistance?: number; + + /**Defines the appearance of horizontal gridlines + */ + verticalGridLines?: SnapSettingsVerticalGridLines; +} + +export interface TooltipAlignment { + + /**Defines the horizontal alignment of tooltip. + * @Default {ej.datavisualization.Diagram.HorizontalAlignment.Center} + */ + horizontal?: ej.datavisualization.Diagram.HorizontalAlignment|string; + + /**Defines the vertical alignment of tooltip. + * @Default {ej.datavisualization.Diagram.VerticalAlignment.Bottom} + */ + vertical?: ej.datavisualization.Diagram.VerticalAlignment|string; +} + +export interface Tooltip { + + /**Aligns the tooltip around nodes/connectors + */ + alignment?: TooltipAlignment; + + /**Sets the margin of the tooltip + * @Default {{ left: 5, right: 5, top: 5, bottom: 5 }} + */ + margin?: any; + + /**Defines whether the tooltip should be shown at the mouse position or around node. + * @Default {ej.datavisualization.Diagram.RelativeMode.Object} + */ + relativeMode?: ej.datavisualization.Diagram.RelativeMode|string; + + /**Sets the svg/html template to be bound with tooltip + */ + templateId?: string; +} +} +module Diagram +{ +enum BridgeDirection +{ +//Used to set the direction of line bridges as left +Left, +//Used to set the direction of line bridges as right +Right, +//Used to set the direction of line bridges as top +Top, +//Used to set the direction of line bridges as bottom +Bottom, +} +} +module Diagram +{ +enum Keys +{ +//No key pressed. +None, +//The A key. +A, +//The B key. +B, +//The C key. +C, +//The D Key. +D, +//The E key. +E, +//The F key. +F, +//The G key. +G, +//The H Key. +H, +//The I key. +I, +//The J key. +J, +//The K key. +K, +//The L Key. +L, +//The M key. +M, +//The N key. +N, +//The O key. +O, +//The P Key. +P, +//The Q key. +Q, +//The R key. +R, +//The S key. +S, +//The T Key. +T, +//The U key. +U, +//The V key. +V, +//The W key. +W, +//The X key. +X, +//The Y key. +Y, +//The Z key. +Z, +//The 0 key. +Number0, +//The 1 key. +Number1, +//The 2 key. +Number2, +//The 3 key. +Number3, +//The 4 key. +Number4, +//The 5 key. +Number5, +//The 6 key. +Number6, +//The 7 key. +Number7, +//The 8 key. +Number8, +//The 9 key. +Number9, +//The LEFT ARROW key. +Left, +//The UP ARROW key. +Up, +//The RIGHT ARROW key. +Right, +//The DOWN ARROW key. +Down, +//The ESC key. +Escape, +//The DEL key. +Delete, +//The TAB key. +Tab, +//The ENTER key. +Enter, +} +} +module Diagram +{ +enum KeyModifiers +{ +//No modifiers are pressed. +None, +//The ALT key. +Alt, +//The CTRL key. +Control, +//The SHIFT key. +Shift, +} +} +module Diagram +{ +enum ConnectorConstraints +{ +//Disable all connector Constraints +None, +//Enables connector to be selected +Select, +//Enables connector to be Deleted +Delete, +//Enables connector to be Dragged +Drag, +//Enables connectors source end to be selected +DragSourceEnd, +//Enables connectors target end to be selected +DragTargetEnd, +//Enables control point and end point of every segment in a connector for editing +DragSegmentThumb, +//Enables bridging to the connector +Bridging, +//Enables label of node to be Dragged +DragLabel, +//Enables bridging to the connector +InheritBridging, +//Enables all constraints +Default, +} +} +module Diagram +{ +enum HorizontalAlignment +{ +//Used to align text horizontally on left side of node/connector +Left, +//Used to align text horizontally on center of node/connector +Center, +//Used to align text horizontally on right side of node/connector +Right, +} +} +module Diagram +{ +enum Segments +{ +//Used to specify the lines as Straight +Straight, +//Used to specify the lines as Orthogonal +Orthogonal, +//Used to specify the lines as Bezier +Bezier, +} +} +module Diagram +{ +enum DecoratorShapes +{ +//Used to set decorator shape as none +None, +//Used to set decorator shape as Arrow +Arrow, +//Used to set decorator shape as Open Arrow +OpenArrow, +//Used to set decorator shape as Circle +Circle, +//Used to set decorator shape as Diamond +Diamond, +//Used to set decorator shape as path +Path, +} +} +module Diagram +{ +enum VerticalAlignment +{ +//Used to align text Vertically on left side of node/connector +Top, +//Used to align text Vertically on center of node/connector +Center, +//Used to align text Vertically on bottom of node/connector +Bottom, +} +} +module Diagram +{ +enum DiagramConstraints +{ +//Disables all DiagramConstraints +None, +//Enables/Disables PageEditing +PageEditable, +//Enables/Disables Bridging +Bridging, +//Enables/Disables Zooming +Zoomable, +//Enables/Disables panning on horizontal axis +PannableX, +//Enables/Disables panning on vertical axis +PannableY, +//Enables/Disables Panning +Pannable, +//Enables/Disables undo actions +Undoable, +//Enables all Constraints +Default, +} +} +module Diagram +{ +enum LayoutOrientations +{ +//Used to set LayoutOrientation from top to bottom +TopToBottom, +//Used to set LayoutOrientation from bottom to top +BottomToTop, +//Used to set LayoutOrientation from left to right +LeftToRight, +//Used to set LayoutOrientation from right to left +RightToLeft, +} +} +module Diagram +{ +enum LayoutTypes +{ +//Used not to set any specific layout +None, +//Used to set layout type as hierarchical layout +HierarchicalTree, +//Used to set layout type as organnizational chart +OrganizationalChart, +} +} +module Diagram +{ +enum BPMNActivity +{ +//Used to set BPMN Activity as None +None, +//Used to set BPMN Activity as Task +Task, +//Used to set BPMN Activity as SubProcess +SubProcess, +} +} +module Diagram +{ +enum NodeConstraints +{ +//Disable all node Constraints +None, +//Enables node to be selected +Select, +//Enables node to be Deleted +Delete, +//Enables node to be Dragged +Drag, +//Enables node to be Rotated +Rotate, +//Enables node to be connected +Connect, +//Enables node to be resize north east +ResizeNorthEast, +//Enables node to be resize east +ResizeEast, +//Enables node to be resize south east +ResizeSouthEast, +//Enables node to be resize south +ResizeSouth, +//Enables node to be resize south west +ResizeSouthWest, +//Enables node to be resize west +ResizeWest, +//Enables node to be resize north west +ResizeNorthWest, +//Enables node to be resize north +ResizeNorth, +//Enables node to be Resized +Resize, +//Enables shadow +Shadow, +//Enables label of node to be Dragged +DragLabel, +//Enables panning should be done while node dragging +AllowPan, +//Enables Proportional resize for node +AspectRatio, +//Enables all node constraints +Default, +} +} +module Diagram +{ +enum ContainerType +{ +//Sets the container type as Canvas +Canvas, +//Sets the container type as Stack +Stack, +} +} +module Diagram +{ +enum BPMNEvents +{ +//Used to set BPMN Event as Start +Start, +//Used to set BPMN Event as Intermediate +Intermediate, +//Used to set BPMN Event as End +End, +//Used to set BPMN Event as NonInterruptingStart +NonInterruptingStart, +//Used to set BPMN Event as NonInterruptingIntermediate +NonInterruptingIntermediate, +} +} +module Diagram +{ +enum BPMNGateways +{ +//Used to set BPMN Gateway as None +None, +//Used to set BPMN Gateway as Exclusive +Exclusive, +//Used to set BPMN Gateway as Inclusive +Inclusive, +//Used to set BPMN Gateway as Parallel +Parallel, +//Used to set BPMN Gateway as Complex +Complex, +//Used to set BPMN Gateway as EventBased +EventBased, +} +} +module Diagram +{ +enum LabelEditMode +{ +//Used to set label edit mode as edit +Edit, +//Used to set label edit mode as view +View, +} +} +module Diagram +{ +enum TextAlign +{ +//Used to align text on left side of node/connector +Left, +//Used to align text on center of node/connector +Center, +//Used to align text on Right side of node/connector +Right, +} +} +module Diagram +{ +enum TextDecorations +{ +//Used to set text decoration of the label as Underline +Underline, +//Used to set text decoration of the label as Overline +Overline, +//Used to set text decoration of the label as LineThrough +LineThrough, +//Used to set text decoration of the label as None +None, +} +} +module Diagram +{ +enum TextWrapping +{ +//Disables wrapping +NoWrap, +//Enables Line-break at normal word break points +Wrap, +//Enables Line-break at normal word break points with longer word overflows +WrapWithOverflow, +} +} +module Diagram +{ +enum PortConstraints +{ +//Disable all constraints +None, +//Enables connections with connector +Connect, +} +} +module Diagram +{ +enum PortShapes +{ +//Used to set port shape as X +X, +//Used to set port shape as Circle +Circle, +//Used to set port shape as Square +Square, +//Used to set port shape as Path +Path, +} +} +module Diagram +{ +enum PortVisibility +{ +//Set the port visibility as Visible +Visible, +//Set the port visibility as Hidden +Hidden, +//Port get visible when hover connector on node +Hover, +//Port gets visible when connect connector to node +Connect, +//Specifies the port visibility as default +Default, +} +} +module Diagram +{ +enum BasicShapes +{ +//Used to specify node Shape as Rectangle +Rectangle, +//Used to specify node Shape as Ellipse +Ellipse, +//Used to specify node Shape as Path +Path, +//Used to specify node Shape as Polygon +Polygon, +//Used to specify node Shape as Triangle +Triangle, +//Used to specify node Shape as Plus +Plus, +//Used to specify node Shape as Star +Star, +//Used to specify node Shape as Pentagon +Pentagon, +//Used to specify node Shape as Heptagon +Heptagon, +//Used to specify node Shape as Octagon +Octagon, +//Used to specify node Shape as Trapezoid +Trapezoid, +//Used to specify node Shape as Decagon +Decagon, +//Used to specify node Shape as RightTriangle +RightTriangle, +//Used to specify node Shape as Cylinder +Cylinder, +} +} +module Diagram +{ +enum BPMNBoundary +{ +//Used to set BPMN SubProcess's Boundary as Default +Default, +//Used to set BPMN SubProcess's Boundary as Call +Call, +//Used to set BPMN SubProcess's Boundary as Event +Event, +} +} +module Diagram +{ +enum BPMNLoops +{ +//Used to set BPMN Activity's Loop as None +None, +//Used to set BPMN Activity's Loop as Standard +Standard, +//Used to set BPMN Activity's Loop as ParallelMultiInstance +ParallelMultiInstance, +//Used to set BPMN Activity's Loop as SequenceMultiInstance +SequenceMultiInstance, +} +} +module Diagram +{ +enum BPMNTasks +{ +//Used to set BPMN Task Type as None +None, +//Used to set BPMN Task Type as Service +Service, +//Used to set BPMN Task Type as Receive +Receive, +//Used to set BPMN Task Type as Send +Send, +//Used to set BPMN Task Type as InstantiatingReceive +InstantiatingReceive, +//Used to set BPMN Task Type as Manual +Manual, +//Used to set BPMN Task Type as BusinessRule +BusinessRule, +//Used to set BPMN Task Type as User +User, +//Used to set BPMN Task Type as Script +Script, +//Used to set BPMN Task Type as Parallel +Parallel, +} +} +module Diagram +{ +enum BPMNTriggers +{ +//Used to set Event Trigger as None +None, +//Used to set Event Trigger as Message +Message, +//Used to set Event Trigger as Timer +Timer, +//Used to set Event Trigger as Escalation +Escalation, +//Used to set Event Trigger as Link +Link, +//Used to set Event Trigger as Error +Error, +//Used to set Event Trigger as Compensation +Compensation, +//Used to set Event Trigger as Signal +Signal, +//Used to set Event Trigger as Multiple +Multiple, +//Used to set Event Trigger as Parallel +Parallel, +} +} +module Diagram +{ +enum Shapes +{ +//Used to set decorator shape as none +None, +//Used to set decorator shape as Arrow +Arrow, +//Used to set decorator shape as Open Arrow +OpenArrow, +//Used to set decorator shape as Circle +Circle, +//Used to set decorator shape as Diamond +Diamond, +//Used to set decorator shape as path +Path, +} +} +module Diagram +{ +enum PageOrientations +{ +//Used to set orientation as Landscape +Landscape, +//Used to set orientation as portrait +Portrait, +} +} +module Diagram +{ +enum ScrollLimit +{ +//Used to set scrollLimit as Infinite +Infinite, +//Used to set scrollLimit as Diagram +Diagram, +//Used to set scrollLimit as Limited +Limited, +} +} +module Diagram +{ +enum SelectorConstraints +{ +//Hides the selector +None, +//Sets the visibility of rotation handle as visible +Rotator, +//Sets the visibility of resize handles as visible +Resizer, +//Sets the visibility of user handles as visible +UserHandles, +//Sets the visibility of all selection handles as visible +All, +} +} +module Diagram +{ +enum Tool +{ +//Disables all Tools +None, +//Enables/Disables SingleSelect tool +SingleSelect, +//Enables/Disables MultiSelect tool +MultipleSelect, +//Enables/Disables ZoomPan tool +ZoomPan, +//Enables/Disables DrawOnce tool +DrawOnce, +//Enables/Disables ContinuousDraw tool +ContinuesDraw, +} +} +module Diagram +{ +enum RelativeMode +{ +//Shows tooltip around the node +Object, +//Shows tooltip at the mouse position +Mouse, +} +} + +} + +interface JQueryXHR { +} +interface JQueryPromise { +} +interface JQueryDeferred extends JQueryPromise { +} +interface JQueryParam { +} +interface JQuery { + data(key: any): any; +} +interface JQuery { + + ejButton(): JQuery; + ejButton(options?: ej.Button.Model): JQuery; + data(key: "ejButton"): ej.Button; + + ejCaptcha(): JQuery; + ejCaptcha(options?: ej.Captcha.Model): JQuery; + data(key: "ejCaptcha"): ej.Captcha; + + ejAccordion(): JQuery; + ejAccordion(options?: ej.Accordion.Model): JQuery; + data(key: "ejAccordion"): ej.Accordion; + + ejAutocomplete(): JQuery; + ejAutocomplete(options?: ej.Autocomplete.Model): JQuery; + data(key: "ejAutocomplete"): ej.Autocomplete; + + ejDatePicker(): JQuery; + ejDatePicker(options?: ej.DatePicker.Model): JQuery; + data(key: "ejDatePicker"): ej.DatePicker; + + ejDateTimePicker(): JQuery; + ejDateTimePicker(options?: ej.DateTimePicker.Model): JQuery; + data(key: "ejDateTimePicker"): ej.DateTimePicker; + + ejDialog(): JQuery; + ejDialog(options?: ej.Dialog.Model): JQuery; + data(key: "ejDialog"): ej.Dialog; + + ejDropDownList(): JQuery; + ejDropDownList(options?: ej.DropDownList.Model): JQuery; + data(key: "ejDropDownList"): ej.DropDownList; + + ejFileExplorer(): JQuery; + ejFileExplorer(options?: ej.FileExplorer.Model): JQuery; + data(key: "ejFileExplorer"): ej.FileExplorer; + + ejListBox(): JQuery; + ejListBox(options?: ej.ListBox.Model): JQuery; + data(key: "ejListBox"): ej.ListBox; + + ejListView(): JQuery; + ejListView(options?: ej.ListView.Model): JQuery; + data(key: "ejListView"): ej.ListView; + + ejNumericTextbox(): JQuery; + ejNumericTextbox(options?: ej.Editor.Model): JQuery; + data(key: "ejNumericTextbox"): ej.NumericTextbox; + + ejCurrencyTextbox(): JQuery; + ejCurrencyTextbox(options?: ej.Editor.Model): JQuery; + data(key: "ejCurrencyTextbox"): ej.CurrencyTextbox; + + ejPercentageTextbox(): JQuery; + ejPercentageTextbox(options?: ej.Editor.Model): JQuery; + data(key: "ejPercentageTextbox"): ej.PercentageTextbox; + + ejMaskEdit(): JQuery; + ejMaskEdit(options?: ej.MaskEdit.Model): JQuery; + data(key: "ejMaskEdit"): ej.MaskEdit; + + ejMenu(): JQuery; + ejMenu(options?: ej.Menu.Model): JQuery; + data(key: "ejMenu"): ej.Menu; + + ejPager(): JQuery; + ejPager(options?: ej.Pager.Model): JQuery; + data(key: "ejPager"): ej.Pager; + + ejProgressBar(): JQuery; + ejProgressBar(options?: ej.ProgressBar.Model): JQuery; + data(key: "ejProgressBar"): ej.ProgressBar; + + ejRadioButton(): JQuery; + ejRadioButton(options?: ej.RadioButton.Model): JQuery; + data(key: "ejRadioButton"): ej.RadioButton; + + ejCheckBox(): JQuery; + ejCheckBox(options?: ej.CheckBox.Model): JQuery; + data(key: "ejCheckBox"): ej.CheckBox; + + ejRibbon(): JQuery; + ejRibbon(options?: ej.Ribbon.Model): JQuery; + data(key: "ejRibbon"): ej.Ribbon; + + ejKanban(): JQuery; + ejKanban(options?: ej.Kanban.Model): JQuery; + data(key: "ejKanban"): ej.Kanban; + + ejRating(): JQuery; + ejRating(options?: ej.Rating.Model): JQuery; + data(key: "ejRating"): ej.Rating; + + ejRotator(): JQuery; + ejRotator(options?: ej.Rotator.Model): JQuery; + data(key: "ejRotator"): ej.Rotator; + + ejRTE(): JQuery; + ejRTE(options?: ej.RTE.Model): JQuery; + data(key: "ejRTE"): ej.RTE; + + ejSlider(): JQuery; + ejSlider(options?: ej.Slider.Model): JQuery; + data(key: "ejSlider"): ej.Slider; + + ejSplitButton(): JQuery; + ejSplitButton(options?: ej.SplitButton.Model): JQuery; + data(key: "ejSplitButton"): ej.SplitButton; + + ejSplitter(): JQuery; + ejSplitter(options?: ej.Splitter.Model): JQuery; + data(key: "ejSplitter"): ej.Splitter; + + ejTab(): JQuery; + ejTab(options?: ej.Tab.Model): JQuery; + data(key: "ejTab"): ej.Tab; + + ejTagCloud(): JQuery; + ejTagCloud(options?: ej.TagCloud.Model): JQuery; + data(key: "ejTagCloud"): ej.TagCloud; + + ejTimePicker(): JQuery; + ejTimePicker(options?: ej.TimePicker.Model): JQuery; + data(key: "ejTimePicker"): ej.TimePicker; + + ejTile(): JQuery; + ejTile(options?: ej.Tile.Model): JQuery; + data(key: "ejTile"): ej.Tile; + + ejToggleButton(): JQuery; + ejToggleButton(options?: ej.ToggleButton.Model): JQuery; + data(key: "ejToggleButton"): ej.ToggleButton; + + ejToolbar(): JQuery; + ejToolbar(options?: ej.Toolbar.Model): JQuery; + data(key: "ejToolbar"): ej.Toolbar; + + ejNavigationDrawer(): JQuery; + ejNavigationDrawer(options?: ej.NavigationDrawer.Model): JQuery; + data(key: "ejNavigationDrawer"): ej.NavigationDrawer; + + ejRadialMenu(): JQuery; + ejRadialMenu(options?: ej.RadialMenu.Model): JQuery; + data(key: "ejRadialMenu"): ej.RadialMenu; + + ejTreeView(): JQuery; + ejTreeView(options?: ej.TreeView.Model): JQuery; + data(key: "ejTreeView"): ej.TreeView; + + ejUploadbox(): JQuery; + ejUploadbox(options?: ej.Uploadbox.Model): JQuery; + data(key: "ejUploadbox"): ej.Uploadbox; + + ejWaitingPopup(): JQuery; + ejWaitingPopup(options?: ej.WaitingPopup.Model): JQuery; + data(key: "ejWaitingPopup"): ej.WaitingPopup; + + ejSchedule(): JQuery; + ejSchedule(options?: ej.Schedule.Model): JQuery; + data(key: "ejSchedule"): ej.Schedule; + + ejRecurrenceEditor(): JQuery; + ejRecurrenceEditor(options?: ej.RecurrenceEditorOptions): JQuery; + data(key: "ejRecurrenceEditor"): ej.RecurrenceEditor; + + ejGrid(): JQuery; + ejGrid(options?: ej.Grid.Model): JQuery; + data(key: "ejGrid"): ej.Grid; + + /*ReportViewer*/ + ejReportViewer(): JQuery; + ejReportViewer(options?: ej.ReportViewer.Model): JQuery; + data(key: "ejReportViewer"): ej.ReportViewer; + /*ReportViewer*/ + + ejLinearGauge(): JQuery; + ejLinearGauge(options?: ej.datavisualization.LinearGauge.Model): JQuery; + data(key: "ejLinearGauge"): ej.datavisualization.LinearGauge; + + ejDigitalGauge(): JQuery; + ejDigitalGauge(options?: ej.datavisualization.DigitalGauge.Model): JQuery; + data(key: "ejDigitalGauge"): ej.datavisualization.DigitalGauge; + + ejCircularGauge(): JQuery; + ejCircularGauge(options?: ej.datavisualization.CircularGauge.Model): JQuery; + data(key: "ejCircularGauge"): ej.datavisualization.CircularGauge; + + ejChart(): JQuery; + ejChart(options?: ej.datavisualization.Chart.Model): JQuery; + data(key: "ejChart"): ej.datavisualization.Chart; + + ejRangeNavigator(): JQuery; + ejRangeNavigator(options?: ej.datavisualization.RangeNavigator.Model): JQuery; + data(key: "ejRangeNavigator"): ej.datavisualization.RangeNavigator; + + ejBulletGraph(): JQuery; + ejBulletGraph(options?: ej.datavisualization.BulletGraph.Model): JQuery; + data(key: "ejBulletGraph"): ej.datavisualization.BulletGraph; + + ejGantt(): JQuery; + ejGantt(options?: ej.Gantt.Model): JQuery; + data(key: "ejGantt"): ej.Gantt; + + ejTreeGrid(): JQuery; + ejTreeGrid(options?: ej.TreeGrid.Model): JQuery; + data(key: "ejTreeGrid"): ej.TreeGrid; + + ejMap(): JQuery; + ejMap(options?: ej.datavisualization.Map.Model): JQuery; + data(key: "ejMap"): ej.datavisualization.Map; + + ejTreeMap(): JQuery; + ejTreeMap(options?: ej.datavisualization.TreeMap.Model): JQuery; + data(key: "ejTreeMap"): ej.datavisualization.TreeMap; + + ejBarcode(): JQuery; + ejBarcode(options?: ej.datavisualization.Barcode.Model): JQuery; + data(key: "ejBarcode"): ej.datavisualization.Barcode; + + ejDiagram(): JQuery; + ejDiagram(options?: ej.datavisualization.Diagram.Model): JQuery; + data(key: "ejDiagram"): ej.datavisualization.Diagram; + + // ejSymbolPalette(): JQuery; + // ejSymbolPalette(options?: ej.datavisualization.SymbolPalette.Model): JQuery; + // data(key: "ejSymbolPalette"): ej.datavisualization.SymbolPalette; + + ejOlapChart(): JQuery; + ejOlapChart(options?: ej.olap.OlapChart.Model): JQuery; + data(key: "ejOlapChart"): ej.olap.OlapChart; + + ejPivotGrid(): JQuery; + ejPivotGrid(options?: ej.PivotGrid.Model): JQuery; + data(key: "ejPivotGrid"): ej.PivotGrid; + + ejPivotSchemaDesigner(): JQuery; + ejPivotSchemaDesigner(options?: ej.PivotSchemaDesigner.Model): JQuery; + data(key: "ejPivotSchemaDesigner"): ej.PivotSchemaDesigner; + + ejOlapClient(): JQuery; + ejOlapClient(options?: ej.olap.OlapClient.Model): JQuery; + data(key: "ejOlapClient"): ej.olap.OlapClient; + + ejOlapGauge(): JQuery; + ejOlapGauge(options?: ej.olap.OlapGauge.Model): JQuery; + data(key: "ejOlapGauge"): ej.olap.OlapGauge; + + ejPivotPager(): JQuery; + ejPivotPager(options?: ej.PivotPager.Model): JQuery; + data(key: "ejPivotPager"): ej.PivotPager; + + /* Spreadsheet */ + ejSpreadsheet(): JQuery; + ejSpreadsheet(options?: ej.Spreadsheet.Model): JQuery; + data(key: "ejSpreadsheet"): ej.Spreadsheet; + /* Spreadsheet */ + + ejScroller(): JQuery; + ejScroller(options?: ej.Scroller.Model): JQuery; + data(key: "ejScroller"): ej.Scroller; + +} +interface JQuery { + + /*Accordion*/ + ejmAccordion(): JQuery; + ejmAccordion(options?: ej.mobile.AccordionOptions): JQuery; + data(key: "ejmAccordion"): ej.mobile.Accordion; + /*Accordion*/ + + /*AutoComplete*/ + ejmAutocomplete(): JQuery; + ejmAutocomplete(options?: ej.mobile.AutocompleteOptions): JQuery; + data(key: "ejmAutocomplete"): ej.mobile.Autocomplete; + /*AutoComplete*/ + + /*Button*/ + ejmButton(): JQuery; + ejmButton(options?: ej.mobile.ButtonOptions): JQuery; + data(key: "ejmButton"): ej.mobile.Button; + + ejmActionlink(): JQuery; + ejmActionlink(options?: ej.mobile.ButtonOptions): JQuery; + data(key: "ejmActionlink"): ej.mobile.Button; + /*Button*/ + + /* DatePicker */ + ejmDatePicker(): JQuery; + ejmDatePicker(options?: ej.mobile.DatePickerOptions): JQuery; + data(key: "ejmDatePicker"): ej.mobile.DatePicker; + /* DatePicker */ + + /*Editor*/ + ejmNumeric(): JQuery; + ejmNumeric(options?: ej.mobile.EditorOptions): JQuery; + data(key: "ejmNumeric"): ej.mobile.Numeric; + /*Editor*/ + + /* Grid Start */ + ejmGrid(): JQuery; + ejmGrid(options?: ej.mobile.GridOptions): JQuery; + data(key: "ejmGrid"): ej.mobile.Grid; + /* Grid End */ + + /*Header*/ + ejmHeader(): JQuery; + ejmHeader(options?: ej.mobile.HeaderOptions): JQuery; + data(key: "ejmHeader"): ej.mobile.Header; + /*Header*/ + + /*ListView*/ + ejmListView(): JQuery; + ejmListView(options?: ej.mobile.ListViewOptions): JQuery; + data(key: "ejmListView"): ej.mobile.ListView; + /*ListView*/ + + /*Menu*/ + ejmMenu(): JQuery; + ejmMenu(options?: ej.mobile.MenuOptions): JQuery; + data(key: "ejmMenu"): ej.mobile.Menu; + /*Menu*/ + + /* ProgressBar */ + ejmProgress(): JQuery; + ejmProgress(options?: ej.mobile.ProgressOptions): JQuery; + data(key: "ejmProgress"): ej.mobile.Progress; + /* ProgressBar */ + + /*Radio Button*/ + ejmRadioButton(): JQuery; + ejmRadioButton(options?: ej.mobile.RadioButtonOptions): JQuery; + data(key: "ejmRadioButton"): ej.mobile.RadioButton; + /*Radio Button*/ + + /*Rating*/ + ejmRating(): JQuery; + ejmRating(options?: ej.mobile.RatingOptions): JQuery; + data(key: "ejmRating"): ej.mobile.Rating; + /*Rating*/ + + + /*Rotator*/ + ejmRotator(): JQuery; + ejmRotator(options?: ej.mobile.RotatorOptions): JQuery; + data(key: "ejmRotator"): ej.mobile.Rotator; + /*Rotator*/ + + /*Slider*/ + ejmSlider(): JQuery; + ejmSlider(options?: ej.mobile.SliderOptions): JQuery; + data(key: "ejmSlider"): ej.mobile.Slider; + /*Slider*/ + + /* Tab */ + ejmTab(): JQuery; + ejmTab(options?: ej.mobile.TabOptions): JQuery; + data(key: "ejmTab"): ej.mobile.Tab; + /* Tab */ + + /*Tile*/ + ejmTile(): JQuery; + ejmTile(options?: ej.mobile.TileOptions): JQuery; + data(key: "ejmTile"): ej.mobile.Tile; + /*Tile*/ + + /* TimePicker */ + ejmTimePicker(): JQuery; + ejmTimePicker(options?: ej.mobile.TimePickerOptions): JQuery; + data(key: "ejmTimePicker"): ej.mobile.TimePicker; + /* TimePicker */ + + /*ToggleButton*/ + ejmToggleButton(): JQuery; + ejmToggleButton(options?: ej.mobile.ToggleButtonOptions): JQuery; + data(key: "ejmToggleButton"): ej.mobile.ToggleButton; + /*ToggleButton*/ + + /*Toolbar*/ + ejmToolbar(): JQuery; + ejmToolbar(options?: ej.mobile.ToolbarOptions): JQuery; + data(key: "ejmToolbar"): ej.mobile.Toolbar; + /*Toolbar*/ + + /*GroupButton*/ + ejmGroupButton(): JQuery; + ejmGroupButton(options?: ej.mobile.GroupButtonOptions): JQuery; + data(key: "ejmGroupButton"): ej.mobile.GroupButton; + /*GroupButton*/ + + /* SplitPane */ + ejmSplitPane(): JQuery; + ejmSplitPane(options?: ej.mobile.SplitPaneOptions): JQuery; + data(key: "ejmSplitPane"): ej.mobile.SplitPane; + /* SplitPane */ + + /* Dialog */ + ejmDialog(): JQuery; + ejmDialog(options?: ej.mobile.DialogOptions): JQuery; + data(key: "ejmDialog"): ej.mobile.Dialog; + /* Dialog */ + + /* TextBox */ + ejmTextBox(): JQuery; + ejmTextBox(options?: ej.mobile.TextBoxOptions): JQuery; + data(key: "ejmTextBox"): ej.mobile.TextBox; + /* TextBox */ + + /* Password */ + ejmPassword(): JQuery; + ejmPassword(options?: ej.mobile.TextBoxOptions): JQuery; + data(key: "ejmPassword"): ej.mobile.TextBox; + /* Password */ + + /* MaskEdit */ + ejmMaskEdit(): JQuery; + ejmMaskEdit(options?: ej.mobile.MaskEditOptions): JQuery; + data(key: "ejmMaskEdit"): ej.mobile.MaskEdit; + /* MaskEdit */ + + /* TextArea */ + ejmTextArea(): JQuery; + ejmTextArea(options?: ej.mobile.TextBoxOptions): JQuery; + data(key: "ejmTextArea"): ej.mobile.TextBox; + /* MaskEdit */ + + /* Footer */ + ejmFooter(): JQuery; + ejmFooter(options?: ej.mobile.FooterOptions): JQuery; + data(key: "ejmFooter"): ej.mobile.Footer; + /* Footer */ + + /* CheckBox */ + ejmCheckBox(): JQuery; + ejmCheckBox(options?: ej.mobile.CheckBoxOptions): JQuery; + data(key: "ejmCheckBox"): ej.mobile.CheckBox; + /* CheckBox */ + + /* ScrollPanel */ + ejmScrollPanel(): JQuery; + ejmScrollPanel(options: ej.mobile.ScrollPanelOptions): JQuery; + data(key: "ejmScrollPanel"): ej.mobile.ScrollPanel; + /* ScrollPanel */ + + /* NavigationDrawer */ + ejmNavigationDrawer(): JQuery; + ejmNavigationDrawer(options: ej.mobile.NavigationDrawerOptions): JQuery; + data(key: "ejmNavigationDrawer"): ej.mobile.NavigationDrawer; + /* NavigationDrawer */ + + /* RadialMenu */ + ejmRadialMenu(): JQuery; + ejmRadialMenu(options?: ej.mobile.RadialMenuOptions): JQuery; + data(key: "ejmRadialMenu"): ej.mobile.RadialMenu; + /* RadialMenu */ + + ejLinearGauge(): JQuery; + ejLinearGauge(options?: ej.datavisualization.LinearGauge.Model): JQuery; + data(key: "ejLinearGauge"): ej.datavisualization.LinearGauge; + + ejDigitalGauge(): JQuery; + ejDigitalGauge(options?: ej.datavisualization.DigitalGauge.Model): JQuery; + data(key: "ejDigitalGauge"): ej.datavisualization.DigitalGauge; + + ejCircularGauge(): JQuery; + ejCircularGauge(options?: ej.datavisualization.CircularGauge.Model): JQuery; + data(key: "ejCircularGauge"): ej.datavisualization.CircularGauge; + + ejChart(): JQuery; + ejChart(options?: ej.datavisualization.Chart.Model): JQuery; + data(key: "ejChart"): ej.datavisualization.Chart; + + ejRangeNavigator(): JQuery; + ejRangeNavigator(options?: ej.datavisualization.RangeNavigator.Model): JQuery; + data(key: "ejRangeNavigator"): ej.datavisualization.RangeNavigator; + + ejBulletGraph(): JQuery; + ejBulletGraph(options?: ej.datavisualization.BulletGraph.Model): JQuery; + data(key: "ejBulletGraph"): ej.datavisualization.BulletGraph; + + ejMap(): JQuery; + ejMap(options?: ej.datavisualization.Map.Model): JQuery; + data(key: "ejMap"): ej.datavisualization.Map; + + ejTreeMap(): JQuery; + ejTreeMap(options?: ej.datavisualization.TreeMap.Model): JQuery; + data(key: "ejTreeMap"): ej.datavisualization.TreeMap; + + ejBarcode(): JQuery; + ejBarcode(options?: ej.datavisualization.Barcode.Model): JQuery; + data(key: "ejBarcode"): ej.datavisualization.Barcode; + + ejDraggable(): JQuery; + ejDraggable(options?: ej.DraggableOptions): JQuery; + data(key: "ejDraggable"): ej.Draggable; + + ejDroppable(): JQuery; + ejDroppable(options?: ej.DroppableOptions): JQuery; + data(key: "ejDroppable"): ej.Droppable; + + ejResizable(): JQuery; + ejResizable(options?: ej.ResizableOptions): JQuery; + data(key: "ejResizable"): ej.Resizable; + + ejColorPicker(): JQuery; + ejColorPicker(options?: ej.ColorPicker.Model): JQuery; + data(key: "ejColorPicker"): ej.ColorPicker; + + ejRadialSlider(): JQuery; + ejRadialSlider(options?: ej.RadialSliderOptions): JQuery; + data(key: "ejRadialSlider"): ej.RadialSlider; + +} \ No newline at end of file diff --git a/elastic.js/elastic.js-tests.ts b/elastic.js/elastic.js-tests.ts new file mode 100644 index 0000000000..24c9784f81 --- /dev/null +++ b/elastic.js/elastic.js-tests.ts @@ -0,0 +1,6 @@ +/// + +let body = new elasticjs.Request({}) + .query(new elasticjs.MatchQuery('title_field', 'testQuery')) + .facet(new elasticjs.TermsFacet('tags').field('tags')) + .toJSON(); diff --git a/elastic.js/elastic.js.d.ts b/elastic.js/elastic.js.d.ts new file mode 100644 index 0000000000..850d1ccdfa --- /dev/null +++ b/elastic.js/elastic.js.d.ts @@ -0,0 +1,8972 @@ +// Type definitions for elastic.js v1.2.0 +// Project: https://www.npmjs.com/package/elastic.js +// Definitions by: Oleksii Trekhleb +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module elasticjs { + + export interface Facet {} + export interface Geo {} + export interface Suggest {} + export interface Generator {} + export interface Query {} + export interface Filter {} + export interface Aggregation {} + export interface ScoreFunction {} + + export class AggregationMixin implements Aggregation { + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Add a nested aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. Alias for the + aggregation method. + */ + agg(agg: Aggregation): AggregationMixin; + + /* + Add a nested aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. + */ + aggregation(agg: Aggregation): AggregationMixin; + + /* + Retrieves the internal agg object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + A container Filter that allows Boolean AND composition of Filters. + */ + export class AndFilter implements Filter { + + /* + A container Filter that allows Boolean AND composition of Filters. + */ + constructor(f: Filter | Filter[]); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Enable or disable caching of the filter + */ + cache(trueFalse: boolean): AndFilter; + + /* + Sets the cache key. + */ + cacheKey(key: string): AndFilter; + + /* + Sets the filters for the filter. If fltr is a single + Filter, it is added to the current filters. If fltr is an array + of Filters, then they replace all existing filters. + */ + filters(fltr: Filter | Filter[]): AndFilter; + + /* + Sets the filter name. + */ + name(name: string): AndFilter; + + /* + Returns the filter object. + */ + toJSON(): AndFilter; + + } + + + /* + A single-value metrics aggregation that computes the average of numeric + values that are extracted from the aggregated documents. These values can be + extracted either from specific numeric fields in the documents, or be + generated by a provided script. + */ + export class AvgAggregation implements Aggregation { + + /* + Aggregation that computes the average of numeric values that are extracted + from the aggregated documents. + */ + constructor(name: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets the field to operate on. + */ + field(field: string): AvgAggregation; + + /* + The script language being used. + */ + lang(language: string): AvgAggregation; + + /* + Sets parameters that will be applied to the script. Overwrites + any existing params. + */ + params(p: Object): AvgAggregation; + + /* + Allows you generate or modify the terms/values using a script. + */ + script(scriptCode: string): AvgAggregation; + + /* + Set to true to assume script values are sorted. + */ + scriptValuesSorted(trueFalse: boolean): AvgAggregation; + + /* + Retrieves the internal agg object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + A BoolFilter allows you to build Boolean filter constructs + from individual filters. Similar in concept to Boolean query, except that + the clauses are other filters. Can be placed within queries that accept a + filter. + */ + export class BoolFilter implements Filter { + + /* + A Filter that matches documents matching boolean combinations of other + filters. + */ + constructor(); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Enable or disable caching of the filter + */ + cache(trueFalse: boolean): BoolFilter; + + /* + Sets the cache key. + */ + cacheKey(key: string): BoolFilter; + + /* + Adds filter to boolean container. Given filter "must" appear in + matching documents. If passed a single Filter it is added to the + list of existing filters. If passed an array of Filters, they + replace all existing filters. + */ + must(oFilter: Filter | Filter[]): BoolFilter; + + /* + Adds filter to boolean container. Given filter "must not" appear + in matching documents. If passed a single Filter it is added to + the list of existing filters. If passed an array of Filters, + they replace all existing filters. + */ + mustNot(oFilter: Filter | Filter[]): BoolFilter; + + /* + Sets the filter name. + */ + name(name: string): BoolFilter; + + /* + Adds filter to boolean container. Given filter "should" appear in + matching documents. If passed a single Filter it is added to + the list of existing filters. If passed an array of Filters, + they replace all existing filters. + */ + should(oFilter: Filter | Filter[]): BoolFilter; + + /* + Returns the filter object. + */ + toJSON(): BoolFilter; + + } + + + /* + A boolQuery allows you to build Boolean query constructs + from individual term or phrase queries. For example you might want to search + for documents containing the terms javascript and python. + */ + export class BoolQuery implements Query { + + /* + A Query that matches documents matching boolean combinations of other + queries, e.g. termQuerys, phraseQuerys or other boolQuerys. + */ + constructor(); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets if the Query should be enhanced with a + MatchAllQuery in order to act as a pure exclude when + only negative (mustNot) clauses exist. Default: true. + */ + adjustPureNegative(trueFalse: string): BoolQuery; + + /* + Sets the boost value for documents matching the Query. + */ + boost(boost: number): BoolQuery; + + /* + Enables or disables similarity coordinate scoring of documents + matching the Query. Default: false. + */ + disableCoord(trueFalse: string): BoolQuery; + + /* + Sets the number of optional clauses that must match. + + By default no optional clauses are necessary for a match + (unless there are no required clauses). If this method is used, + then the specified number of clauses is required. + + Use of this method is totally independent of specifying that + any specific clauses are required (or prohibited). This number will + only be compared against the number of matching optional clauses. + */ + minimumNumberShouldMatch(minMatch: number): BoolQuery; + + /* + Adds query to boolean container. Given query "must" appear in matching documents. + */ + must(oQuery: Object): BoolQuery; + + /* + Adds query to boolean container. Given query "must not" appear in matching documents. + */ + mustNot(oQuery: Object): BoolQuery; + + /* + Adds query to boolean container. Given query "should" appear in matching documents. + */ + should(oQuery: Object): BoolQuery; + + /* + Retrieves the internal query object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + The boost_factor score allows you to multiply the score by the provided + boost_factor. This can sometimes be desired since boost value set on specific + queries gets normalized, while for this score function it does not. + */ + export class BoostFactorScoreFunction implements ScoreFunction { + + /* + Multiply the score by the provided boost_factor. + */ + constructor(boostVal: number); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets the boost factor. + */ + boost(b: number): BoostFactorScoreFunction; + + /* + Adds a filter whose matching documents will have the score function applied. + */ + filter(oFilter: Filter): BoostFactorScoreFunction; + + /* + Retrieves the internal agg object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + The boosting query can be used to effectively demote results that match + a given query. Unlike the “NOT” clause in bool query, this still selects + documents that contain undesirable terms, but reduces their overall + score. + */ + export class BoostingQuery implements Query { + + /* + Constructs a query that can demote search results. A negative boost. + */ + constructor(positiveQry: Object, negativeQry: Object, negativeBoost: number); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets the boost value for documents matching the Query. + */ + boost(boost: number): BoostingQuery; + + /* + Sets the query used to match documents in the positive + query that will be negatively boosted. + */ + negative(oQuery: Object): BoostingQuery; + + /* + Sets the negative boost value. + */ + negativeBoost(boost: number): BoostingQuery; + + /* + Sets the "master" query that determines which results are returned. + */ + positive(oQuery: Object): BoostingQuery; + + /* + Retrieves the internal query object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + A single-value metrics aggregation that calculates an approximate count of + distinct values. Values can be extracted either from specific fields in the + document or generated by a script. + */ + export class CardinalityAggregation implements Aggregation { + + /* + Aggregation that calculates an approximate count of distinct values. + */ + constructor(name: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets the field to operate on. + */ + field(field: string): CardinalityAggregation; + + /* + The script language being used. + */ + lang(language: string): CardinalityAggregation; + + /* + Sets parameters that will be applied to the script. Overwrites + any existing params. + */ + params(p: Object): CardinalityAggregation; + + /* + Allows to trade memory for accuracy, and defines a unique count below which + counts are expected to be close to accurate. Above this value, counts might + become a bit more fuzzy. The maximum supported value is 40000, thresholds + above this number will have the same effect as a threshold of 40000. + Default value depends on the number of parent aggregations that multiple + create buckets (such as terms or histograms). + */ + precisionThreshold(num: number): CardinalityAggregation; + + /* + Set to false to disable rehashing of values. You must have computed a hash + on the client-side and stored it into your documents if you disable this. + */ + rehash(trueFalse: boolean): CardinalityAggregation; + + /* + Allows you generate or modify the terms/values using a script. + */ + script(scriptCode: string): CardinalityAggregation; + + /* + Retrieves the internal agg object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + A query that executes high-frequency terms in a optional sub-query to + prevent slow queries due to "common" terms like stopwords. + + This query basically builds two queries out of the terms in the query + string where low-frequency terms are added to a required boolean clause and + high-frequency terms are added to an optional boolean clause. The optional + clause is only executed if the required "low-frequency' clause matches. + + CommonTermsQuery has several advantages over stopword + filtering at index or query time since a term can be "classified" based on + the actual document frequency in the index and can prevent slow queries even + across domains without specialized stopword files. + */ + export class CommonTermsQuery implements Query { + + /* + A query that executes high-frequency terms in a optional sub-query. + */ + constructor(field: string, qstr: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets the analyzer name used to analyze the Query object. + */ + analyzer(analyzer: string): CommonTermsQuery; + + /* + Sets the boost value for documents commoning the Query. + */ + boost(boost: Number): CommonTermsQuery; + + /* + Sets the maximum threshold/frequency to be considered a low + frequency term. Set to a value between 0 and 1. + */ + cutoffFrequency(freq: Number): CommonTermsQuery; + + /* + Enables or disables similarity coordinate scoring of documents + commoning the Query. Default: false. + */ + disableCoord(trueFalse: string): CommonTermsQuery; + + /* + Sets the field to query against. + */ + field(f: string): CommonTermsQuery; + + /* + Sets the boolean operator to be used for high frequency terms. + Default: AND + */ + highFreqOperator(op: string): CommonTermsQuery; + + /* + Sets the boolean operator to be used for low frequency terms. + Default: AND + */ + lowFreqOperator(op: string): CommonTermsQuery; + + /* + Sets the minimum number of low freq matches that need to match in + a document before that document is returned in the results. + */ + minimumShouldMatch(min: number): CommonTermsQuery; + + /* + Sets the minimum number of high freq matches that need to match in + a document before that document is returned in the results. + */ + minimumShouldMatchHighFreq(min: number): CommonTermsQuery; + + /* + Sets the minimum number of low freq matches that need to match in + a document before that document is returned in the results. + */ + minimumShouldMatchLowFreq(min: number): CommonTermsQuery; + + /* + Sets the query string. + */ + query(qstr: string): CommonTermsQuery; + + /* + Retrieves the internal query object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + export class CompletionSuggester implements Suggest { + + /* + A suggester that allows basic auto-complete functionality. + */ + constructor(name: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets analyzer used to analyze the suggest text. + */ + analyzer(analyzer: string): CompletionSuggester; + + /* + Maximum edit distance (fuzziness), defaults to 1. Automatically + enables fuzzy suggestions when set to any value. + */ + editDistance(d: number): CompletionSuggester; + + /* + Sets the field used to generate suggestions from. + */ + field(field: string): CompletionSuggester; + + /* + Enable fuzzy completions which means a can spell a word + incorrectly and still get a suggestion. + */ + fuzzy(trueFalse: boolean): CompletionSuggester; + + /* + Minimum length of the input before fuzzy suggestions are returned, defaults + to 3. Automatically enables fuzzy suggestions when set to any value. + */ + minLength(m: number): CompletionSuggester; + + /* + Minimum length of the input, which is not checked for fuzzy alternatives, defaults + to 1. Automatically enables fuzzy suggestions when set to any value. + */ + prefixLength(l: number): CompletionSuggester; + + /* + Sets the maximum number of suggestions to be retrieved from + each individual shard. + */ + shardSize(s: number): CompletionSuggester; + + /* + Sets the number of suggestions returned for each token. + */ + size(s: number): CompletionSuggester; + + /* + Sets the text to get suggestions for. If not set, the global + suggestion text will be used. + */ + text(txt: string): CompletionSuggester; + + /* + Retrieves the internal suggest object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + /* + Sets if transpositions should be counted as one or two changes, defaults + to true when fuzzy is enabled. Automatically enables fuzzy suggestions + when set to any value. + */ + transpositions(trueFalse: boolean): CompletionSuggester; + + /* + Sets all are measurements (like edit distance, transpositions and lengths) + in unicode code points (actual letters) instead of bytes. Automatically + enables fuzzy suggestions when set to any value. + */ + unicodeAware(trueFalse: boolean): CompletionSuggester; + + } + + + /* + A constant score query wraps another Query or + Filter and returns a constant score for each + result that is equal to the query boost. + + Note that lucene's query normalization (queryNorm) attempts + to make scores between different queries comparable. It does not + change the relevance of your query, but it might confuse you when + you look at the score of your documents and they are not equal to + the query boost value as expected. The scores were normalized by + queryNorm, but maintain the same relevance. + */ + export class ConstantScoreQuery implements Query { + + /* + Constructs a query where each documents returned by the internal + query or filter have a constant score equal to the boost factor. + */ + constructor(); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets the boost value for documents matching the Query. + */ + boost(boost: number): ConstantScoreQuery; + + /* + Enables caching of the filter. + */ + cache(trueFalse: boolean): ConstantScoreQuery; + + /* + Set the cache key. + */ + cacheKey(k: string): ConstantScoreQuery; + + /* + Adds the filter to apply a constant score to. + */ + filter(oFilter: Object): ConstantScoreQuery; + + /* + Adds the query to apply a constant score to. + */ + query(oQuery: Object): ConstantScoreQuery; + + /* + Retrieves the internal query object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + A multi-bucket aggregation similar to the histogram except it can only be + applied on date values. Since dates are represented in elasticsearch + internally as long values, it is possible to use the normal histogram on + dates as well, though accuracy will be compromised. The reason for this is + in the fact that time based intervals are not fixed (think of leap years and + on the number of days in a month). For this reason, we need a special + support for time based data. From a functionality perspective, this + histogram supports the same features as the normal histogram. The main + difference is that the interval can be specified by date/time expressions. + */ + export class DateHistogramAggregation implements Aggregation { + + /* + Aggregation similar to the histogram except it can only be applied on + date values. + */ + constructor(name: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Add a nested aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. Alias for the + aggregation method. + */ + agg(agg: Aggregation): DateHistogramAggregation; + + /* + Add a nested aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. + */ + aggregation(agg: Aggregation): DateHistogramAggregation; + + /* + Set's the range/bounds for the histogram aggregation. Useful when you + want to include buckets that might be outside the bounds of indexed + documents. + */ + extendedBounds(min: string | number, max: string | number): DateHistogramAggregation; + + /* + Sets the field to gather terms from. + */ + field(field: string): DateHistogramAggregation; + + /* + Sets the format expression for the terms. Use for number or date + formatting + */ + format(f: string): DateHistogramAggregation; + + /* + Sets the histogram interval. Buckets are generated based on this interval + value. + */ + interval(i: string): DateHistogramAggregation; + + /* + Enable the response to be returned as a keyed object where the key is the + bucket interval. + */ + keyed(trueFalse: boolean): DateHistogramAggregation; + + /* + The script language being used. + */ + lang(language: string): DateHistogramAggregation; + + /* + Only return terms that match more than a configured number of hits. + */ + minDocCount(num: number): DateHistogramAggregation; + + /* + Sets order for the aggregated values. + */ + order(order: string, direction: string): DateHistogramAggregation; + + /* + Sets parameters that will be applied to the script. Overwrites + any existing params. + */ + params(p: Object): DateHistogramAggregation; + + /* + Set the post-rouding offset. + */ + postOffset(offset: string): DateHistogramAggregation; + + /* + Set the post-rouding date time zone. + */ + postZone(tz: string): DateHistogramAggregation; + + /* + Set the pre-rouding offset. + */ + preOffset(offset: string): DateHistogramAggregation; + + /* + Set the pre-rouding date time zone. + */ + preZone(tz: string): DateHistogramAggregation; + + /* + Set to true to apply interval adjusts to day and above intervals. + */ + preZoneAdjustLargeInterval(trueFalse: boolean): DateHistogramAggregation; + + /* + Allows you generate or modify the terms using a script. + */ + script(scriptCode: string): DateHistogramAggregation; + + /* + Set to true to assume script values are sorted. + */ + scriptValuesSorted(trueFalse: boolean): DateHistogramAggregation; + + /* + Set the date time zone. + */ + timeZone(tz: string): DateHistogramAggregation; + + /* + Retrieves the internal agg object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + The DateHistogram facet works with time-based values by building a histogram across time + intervals of the value field. Each value is rounded into an interval (or + placed in a bucket), and statistics are provided per interval/bucket (count and total). + + Facets are similar to SQL GROUP BY statements but perform much + better. You can also construct several "groups" at once by simply + specifying multiple facets. + + + + Tip: + For more information on faceted navigation, see + this + Wikipedia article on Faceted Classification. + + + */ + export class DateHistogramFacet implements Facet { + + /* + A facet which returns the N most frequent terms within a collection + or set of collections. + */ + constructor(name: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Enables caching of the facetFilter + */ + cacheFilter(trueFalse: boolean): DateHistogramFacet; + + /* + Allows you to reduce the documents used for computing facet results. + */ + facetFilter(oFilter: Object): DateHistogramFacet; + + /* + The date histogram works on numeric values (since time is stored + in milliseconds since the epoch in UTC). + + But, sometimes, systems will store a different resolution (like seconds since UTC) + in a numeric field. The factor parameter can be used to change the value in the field + to milliseconds to actual do the relevant rounding, and then be applied again to get to + the original unit. + + For example, when storing in a numeric field seconds resolution, + the factor can be set to 1000. + */ + factor(f: number): DateHistogramFacet; + + /* + Sets the field to be used to construct the this facet. + */ + field(fieldName: string): DateHistogramFacet; + + /* + Computes values across the entire index + */ + global(trueFalse: boolean): DateHistogramFacet; + + /* + Sets the bucket interval used to calculate the distribution. + */ + interval(timeInterval: string): DateHistogramFacet; + + /* + Allows you to specify a different key field to be used to group intervals. + */ + keyField(fieldName: string): DateHistogramFacet; + + /* + The script language being used. Currently supported values are + javascript, groovy, and mvel. + */ + lang(language: string): DateHistogramFacet; + + /* + Sets the mode the facet will use. + + + collector + post + + */ + mode(m: string): DateHistogramFacet; + + /* + Sets the path to the nested document if faceting against a + nested field. + */ + nested(path: string): DateHistogramFacet; + + /* + Sets the type of ordering that will be performed on the date + buckets. Valid values are: + + + time - the default, sort by the buckets start time in milliseconds. + count - sort by the number of items in the bucket + total - sort by the sum/total of the items in the bucket + + */ + order(o: string): DateHistogramFacet; + + /* + Sets parameters that will be applied to the script. Overwrites + any existing params. + */ + params(p: Object): DateHistogramFacet; + + /* + Set's a specific post-rounding offset. Format is 1d, 1h, etc. + */ + postOffset(offset: string): DateHistogramFacet; + + /* + By default, time values are stored in UTC format. + + This method allows users to set a time zone value that is then used to compute + intervals after rounding on the interval value. The value is an offset from UTC. + The tz offset value is simply added to the resulting bucket's date value. + + For example, to use EST you would set the value to -5. + */ + postZone(tz: number): DateHistogramFacet; + + /* + Set's a specific pre-rounding offset. Format is 1d, 1h, etc. + */ + preOffset(offset: string): DateHistogramFacet; + + /* + By default, time values are stored in UTC format. + + This method allows users to set a time zone value that is then used to + compute intervals before rounding on the interval value. The value is an + offset from UTC. + + For example, to use EST you would set the value to -5. + */ + preZone(tz: number): DateHistogramFacet; + + /* + Enables large date interval conversions (day and up). + + Set to true to enable and then set the interval to an + interval greater than a day. + */ + preZoneAdjustLargeInterval(trueFalse: boolean): DateHistogramFacet; + + /* + Computes values across the the specified scope + */ + scope(scope: string): DateHistogramFacet; + + /* + By default, time values are stored in UTC format. + + This method allows users to set a time zone value that is then used + to compute intervals before rounding on the interval value. Equalivent to + preZone. Use preZone if possible. The + value is an offset from UTC. + + For example, to use EST you would set the value to -5. + */ + timeZone(tz: number): DateHistogramFacet; + + /* + Retrieves the internal facet object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + /* + Allows you to specify a different value field to aggrerate over. + */ + valueField(fieldName: string): DateHistogramFacet; + + /* + Allows you modify the value field using a script. The modified value + is then used to compute the statistical data. + */ + valueScript(scriptCode: string): DateHistogramFacet; + + } + + + /* + A range aggregation that is dedicated for date values. The main difference + between this aggregation and the normal range aggregation is that the from + and to values can be expressed in Date Math expressions, and it is also + possible to specify a date format by which the from and to response fields + will be returned. Note that this aggregration includes the from value and + excludes the to value for each range. + + Note that this aggregration includes the from value and excludes the to + value for each range. + */ + export class DateRangeAggregation implements Aggregation { + + /* + Aggregation that is dedicated for date value ranges. + */ + constructor(name: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Add a nested aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. Alias for the + aggregation method. + */ + agg(agg: Aggregation): DateRangeAggregation; + + /* + Add a nested aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. + */ + aggregation(agg: Aggregation): DateRangeAggregation; + + /* + Sets the field to gather terms from. + */ + field(field: string): DateRangeAggregation; + + /* + Sets the date format expression. + */ + format(f: string): DateRangeAggregation; + + /* + Enable the response to be returned as a keyed object where the key is the + bucket interval. + */ + keyed(trueFalse: boolean): DateRangeAggregation; + + /* + The script language being used. + */ + lang(language: string): DateRangeAggregation; + + /* + Sets parameters that will be applied to the script. Overwrites + any existing params. + */ + params(p: Object): DateRangeAggregation; + + /* + Adds a range to the list of exsiting range expressions. + */ + range(from: string, to: string, key: string): DateRangeAggregation; + + /* + Allows you generate or modify the terms using a script. + */ + script(scriptCode: string): DateRangeAggregation; + + /* + Set to true to assume script values are sorted. + */ + scriptValuesSorted(trueFalse: boolean): DateRangeAggregation; + + /* + Retrieves the internal agg object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + Decay functions score a document with a function that decays depending on + the distance of a numeric field value of the document from a user given + origin. This is similar to a range query, but with smooth edges instead of + boxes. + + Supported decay functions are: linear, exp, and gauss. + */ + export class DecayScoreFunction implements ScoreFunction { + + /* + Score a document with a function that decays depending on the distance + of a numeric field value of the document from given origin. + */ + constructor(field: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets the decay value which defines how documents are scored at the distance + given at scale. + */ + decay(d: number): DecayScoreFunction; + + /* + Use the exp decay function. Exponential decay. + */ + exp(): DecayScoreFunction; + + /* + Sets the fields to run the decay function against. + */ + field(f: string): DecayScoreFunction; + + /* + Adds a filter whose matching documents will have the score function applied. + */ + filter(oFilter: Filter): DecayScoreFunction; + + /* + Use the gauss decay function. Normal decay. + */ + gauss(): DecayScoreFunction; + + /* + Use the linear decay function. Linear decay. + */ + linear(): DecayScoreFunction; + + /* + Sets the decay offset. The decay function will only compute a the decay + function for documents with a distance greater that the defined offset. + The default is 0. + */ + offset(o: string): DecayScoreFunction; + + /* + Sets the origin which is the “central point” from which the distance is + calculated. + */ + origin(o: string): DecayScoreFunction; + + /* + Sets the scale/rate of decay. + */ + scale(s: string): DecayScoreFunction; + + /* + Retrieves the internal agg object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + DirectGenerator is a candidate generator for PhraseSuggester. + It generates terms based on edit distance and operators much like the + TermSuggester. + */ + export class DirectGenerator implements Generator { + + /* + A candidate generator that generates terms based on edit distance. + */ + constructor(); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets the accuracy. How similar the suggested terms at least + need to be compared to the original suggest text. + */ + accuracy(a: number): DirectGenerator; + + /* + Sets the field used to generate suggestions from. + */ + field(field: string): DirectGenerator; + + /* + Sets the maximum edit distance candidate suggestions can have + in order to be considered as a suggestion. + */ + maxEdits(max: number): DirectGenerator; + + /* + The factor that is used to multiply with the size in order + to inspect more candidate suggestions. + */ + maxInspections(max: number): DirectGenerator; + + /* + Sets a maximum threshold in number of documents a suggest text + token can exist in order to be corrected. + */ + maxTermFreq(max: number): DirectGenerator; + + /* + Sets a minimal threshold of the number of documents a suggested + term should appear in. + */ + minDocFreq(min: number): DirectGenerator; + + /* + Sets the minimum length a suggest text term must have in order + to be corrected. + */ + minWordLen(len: number): DirectGenerator; + + /* + Sets an analyzer that is applied to each of the generated tokens + before they are passed to the actual phrase scorer. + */ + postFilter(analyzer: string): DirectGenerator; + + /* + Sets an analyzer that is applied to each of the tokens passed to + this generator. The analyzer is applied to the original tokens, + not the generated tokens. + */ + preFilter(analyzer: string): DirectGenerator; + + /* + Sets the number of suggestions returned for each token. + */ + size(s: number): DirectGenerator; + + /* + Sets the sort mode. Valid values are: + + + score - Sort by score first, then document frequency, and then the term itself + frequency - Sort by document frequency first, then simlarity score and then the term itself + + */ + sort(s: string): DirectGenerator; + + /* + Sets what string distance implementation to use for comparing + how similar suggested terms are. Valid values are: + + + internal - based on damerau_levenshtein but but highly optimized for comparing string distance for terms inside the index + damerau_levenshtein - String distance algorithm based on Damerau-Levenshtein algorithm + levenstein - String distance algorithm based on Levenstein edit distance algorithm + jarowinkler - String distance algorithm based on Jaro-Winkler algorithm + ngram - String distance algorithm based on character n-grams + + */ + stringDistance(s: string): DirectGenerator; + + /* + Sets the suggest mode. Valid values are: + + + missing - Only suggest terms in the suggest text that aren't in the index + popular - Only suggest suggestions that occur in more docs then the original suggest text term + always - Suggest any matching suggestions based on terms in the suggest text + + */ + suggestMode(m: string): DirectGenerator; + + /* + Retrieves the internal generator object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + export class DirectSettingsMixin { + + + /* + Sets the accuracy. How similar the suggested terms at least + need to be compared to the original suggest text. + */ + accuracy(a: number): DirectSettingsMixin; + + /* + Sets the maximum edit distance candidate suggestions can have + in order to be considered as a suggestion. + */ + maxEdits(max: number): DirectSettingsMixin; + + /* + The factor that is used to multiply with the size in order + to inspect more candidate suggestions. + */ + maxInspections(max: number): DirectSettingsMixin; + + /* + Sets a maximum threshold in number of documents a suggest text + token can exist in order to be corrected. + */ + maxTermFreq(max: number): DirectSettingsMixin; + + /* + Sets a minimal threshold of the number of documents a suggested + term should appear in. + */ + minDocFreq(min: number): DirectSettingsMixin; + + /* + Sets the minimum length a suggest text term must have in order + to be corrected. + */ + minWordLen(len: number): DirectSettingsMixin; + + /* + Sets the number of minimal prefix characters that must match in + order be a candidate suggestion. + */ + prefixLen(len: number): DirectSettingsMixin; + + /* + Sets the sort mode. Valid values are: + + + score - Sort by score first, then document frequency, and then the term itself + frequency - Sort by document frequency first, then simlarity score and then the term itself + + */ + sort(s: string): DirectSettingsMixin; + + /* + Sets what string distance implementation to use for comparing + how similar suggested terms are. Valid values are: + + + internal - based on damerau_levenshtein but but highly optimized for comparing string distance for terms inside the index + damerau_levenshtein - String distance algorithm based on Damerau-Levenshtein algorithm + levenstein - String distance algorithm based on Levenstein edit distance algorithm + jarowinkler - String distance algorithm based on Jaro-Winkler algorithm + ngram - String distance algorithm based on character n-grams + + */ + stringDistance(s: string): DirectSettingsMixin; + + /* + Sets the suggest mode. Valid values are: + + + missing - Only suggest terms in the suggest text that aren't in the index + popular - Only suggest suggestions that occur in more docs then the original suggest text term + always - Suggest any matching suggestions based on terms in the suggest text + + */ + suggestMode(m: string): DirectSettingsMixin; + + } + + + /* + A query that generates the union of documents produced by its subqueries, and + that scores each document with the maximum score for that document as produced + by any subquery, plus a tie breaking increment for any additional matching + subqueries. + */ + export class DisMaxQuery implements Query { + + /* + A query that generates the union of documents produced by its subqueries such + as termQuerys, phraseQuerys, boolQuerys, etc. + */ + constructor(); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets the boost value for documents matching the Query. + */ + boost(boost: number): DisMaxQuery; + + /* + Updates the queries. If passed a single Query, it is added to the + list of existing queries. If passed an array of Queries, it + replaces all existing values. + */ + queries(qs: Query | Query[]): DisMaxQuery; + + /* + The tie breaker value. + + The tie breaker capability allows results that include the same term in multiple + fields to be judged better than results that include this term in only the best of those + multiple fields, without confusing this with the better case of two different terms in + the multiple fields. + + Default: 0.0. + */ + tieBreaker(tieBreaker: number): DisMaxQuery; + + /* + Retrieves the internal query object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + An existsFilter matches documents where the specified field is present + and the field contains a legitimate value. + */ + export class ExistsFilter implements Filter { + + /* + Filters documents where a specified field exists and contains a value. + */ + constructor(fieldName: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Enable or disable caching of the filter + */ + cache(trueFalse: boolean): ExistsFilter; + + /* + Sets the cache key. + */ + cacheKey(key: string): ExistsFilter; + + /* + Sets the field to check for missing values. + */ + field(name: string): ExistsFilter; + + /* + Sets the filter name. + */ + name(name: string): ExistsFilter; + + /* + Returns the filter object. + */ + toJSON(): ExistsFilter; + + } + + + /* + A multi-value metrics aggregation that computes stats over numeric values + extracted from the aggregated documents. These values can be extracted either + from specific numeric fields in the documents, or be generated by a provided + script. + + The extended_stats aggregations is an extended version of the + StatsAggregation, where additional metrics are added such as + sum_of_squares, variance and std_deviation. + */ + export class ExtendedStatsAggregation implements Aggregation { + + /* + Aggregation that computes extra stats over numeric values extracted from + the aggregated documents. + */ + constructor(name: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets the field to operate on. + */ + field(field: string): ExtendedStatsAggregation; + + /* + The script language being used. + */ + lang(language: string): ExtendedStatsAggregation; + + /* + Sets parameters that will be applied to the script. Overwrites + any existing params. + */ + params(p: Object): ExtendedStatsAggregation; + + /* + Allows you generate or modify the terms/values using a script. + */ + script(scriptCode: string): ExtendedStatsAggregation; + + /* + Set to true to assume script values are sorted. + */ + scriptValuesSorted(trueFalse: boolean): ExtendedStatsAggregation; + + /* + Retrieves the internal agg object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + export class FacetMixin { + + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Enables caching of the facetFilter + */ + cacheFilter(trueFalse: boolean): FacetMixin; + + /* + Allows you to reduce the documents used for computing facet results. + */ + facetFilter(oFilter: Object): FacetMixin; + + /* + Computes values across the entire index + */ + global(trueFalse: boolean): FacetMixin; + + /* + Sets the mode the facet will use. + + + collector + post + + */ + mode(m: string): FacetMixin; + + /* + Sets the path to the nested document if faceting against a + nested field. + */ + nested(path: string): FacetMixin; + + /* + Computes values across the the specified scope + */ + scope(scope: string): FacetMixin; + + /* + Retrieves the internal facet object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + Wrapper to allow SpanQuery objects participate in composite single-field + SpanQueries by 'lying' about their search field. That is, the masked + SpanQuery will function as normal, but when asked for the field it + queries against, it will return the value specified as the masked field vs. + the real field used in the wrapped span query. + */ + export class FieldMaskingSpanQuery implements Query { + + /* + Wraps a SpanQuery and hides the real field being searched across. + */ + constructor(spanQry: Query, field: number); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets the boost value for documents matching the Query. + */ + boost(boost: number): FieldMaskingSpanQuery; + + /* + Sets the value of the "masked" field. + */ + field(f: string): FieldMaskingSpanQuery; + + /* + Sets the span query to wrap. + */ + query(spanQuery: Query): FieldMaskingSpanQuery; + + /* + Retrieves the internal query object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + Defines a single bucket of all the documents in the current document set + context that match a specified filter. Often this will be used to narrow down + the current aggregation context to a specific set of documents. + */ + export class FilterAggregation implements Aggregation { + + /* + Defines a single bucket of all the documents that match a given filter. + */ + constructor(name: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Add a nested aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. Alias for the + aggregation method. + */ + agg(agg: Aggregation): FilterAggregation; + + /* + Add a nested aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. + */ + aggregation(agg: Aggregation): FilterAggregation; + + /* + Sets the filter to be used for this aggregation. + */ + filter(oFilter: Filter): FilterAggregation; + + /* + Retrieves the internal agg object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + Filter queries allow you to restrict the results returned by a query. There are + several different types of filters that can be applied + (see filter module). A filterQuery + takes a Query and a Filter object as arguments and constructs + a new Query that is then used for the search. + */ + export class FilteredQuery implements Query { + + /* + A query that applies a filter to the results of another query. + */ + constructor(someQuery: Object, someFilter: Object); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets the boost value for documents matching the Query. + */ + boost(boost: number): FilteredQuery; + + /* + Enables caching of the filter. + */ + cache(trueFalse: boolean): FilteredQuery; + + /* + Set the cache key. + */ + cacheKey(k: string): FilteredQuery; + + /* + Adds the filter to apply a constant score to. + */ + filter(oFilter: Object): FilteredQuery; + + /* + Adds the query to apply a constant score to. + */ + query(oQuery: Object): FilteredQuery; + + /* + Sets the filter strategy. + + The strategy defines how the filter is applied during document collection. + Valid values are: + + + query_first - advance query scorer first then filter + random_access_random - random access filter + leap_frog - query scorer and filter "leap-frog", query goes first + leap_frog_filter_first - same as leap_frog, but filter goes first + random_access_N - replace N with integer, same as random access + except you can specify a custom threshold + + + This is an advanced setting, use with care. + */ + strategy(strategy: string): FilteredQuery; + + /* + Retrieves the internal query object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + The FilterFacet allows you to specify any valid Filter and + have the number of matching hits returned as the value. + + Facets are similar to SQL GROUP BY statements but perform much + better. You can also construct several "groups" at once by simply + specifying multiple facets. + + + + Tip: + For more information on faceted navigation, see + this + Wikipedia article on Faceted Classification. + + + */ + export class FilterFacet implements Facet { + + /* + A facet that return a count of the hits matching the given filter. + */ + constructor(name: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Enables caching of the facetFilter + */ + cacheFilter(trueFalse: boolean): FilterFacet; + + /* + Allows you to reduce the documents used for computing facet results. + */ + facetFilter(oFilter: Object): FilterFacet; + + /* + Sets the filter to be used for this facet. + */ + filter(oFilter: Object): FilterFacet; + + /* + Computes values across the entire index + */ + global(trueFalse: boolean): FilterFacet; + + /* + Sets the mode the facet will use. + + + collector + post + + */ + mode(m: string): FilterFacet; + + /* + Sets the path to the nested document if faceting against a + nested field. + */ + nested(path: string): FilterFacet; + + /* + Computes values across the the specified scope + */ + scope(scope: string): FilterFacet; + + /* + Retrieves the internal facet object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + export class FilterMixin { + + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Enable or disable caching of the filter + */ + cache(trueFalse: boolean): FilterMixin; + + /* + Sets the cache key. + */ + cacheKey(key: string): FilterMixin; + + /* + Sets the filter name. + */ + name(name: string): FilterMixin; + + /* + Returns the filter object. + */ + toJSON(): FilterMixin; + + } + + + /* + The function_score allows you to modify the score of documents that are + retrieved by a query. This can be useful if, for example, a score function is + computationally expensive and it is sufficient to compute the score on a + filtered set of documents. + */ + export class FunctionScoreQuery implements Query { + + /* + A query that allows you to modify the score of matching documents. + */ + constructor(); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets the boost value for documents matching the Query. + */ + boost(boost: number): FunctionScoreQuery; + + /* + Set the setermines how the new calculated score is combined with the + score from the original query. Valid values are: multiply, replace, sum, + avg, max, and min. + */ + boostMode(mode: string): FunctionScoreQuery; + + /* + Set the source filter. + */ + filter(oFilter: Filter): FunctionScoreQuery; + + /* + Add a single score function to the list of existing functions. + */ + //function (func: ScoreFunction): FunctionScoreQuery; + + /* + Sets the score functions. Replaces any existing score functions. + */ + functions(funcs: ScoreFunction[]): FunctionScoreQuery; + + /* + Set the source query. + */ + query(oQuery: Query): FunctionScoreQuery; + + /* + Set the scoring mode which specifies how the computed scores are combined. + Valid values are: avg, max, min, sum, multiply, and first. + */ + scoreMode(mode: string): FunctionScoreQuery; + + /* + Retrieves the internal query object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + The fuzzy_like_this_field query is the same as the fuzzy_like_this + query, except that it runs against a single field. It provides nicer query + DSL over the generic fuzzy_like_this query, and support typed fields + query (automatically wraps typed fields with type filter to match only on + the specific type). + + Fuzzifies ALL terms provided as strings and then picks the best n + differentiating terms. In effect this mixes the behaviour of FuzzyQuery and + MoreLikeThis but with special consideration of fuzzy scoring factors. This + generally produces good results for queries where users may provide details + in a number of fields and have no knowledge of boolean query syntax and + also want a degree of fuzzy matching and a fast query. + + For each source term the fuzzy variants are held in a BooleanQuery with + no coord factor (because we are not looking for matches on multiple variants + in any one doc). Additionally, a specialized TermQuery is used for variants + and does not use that variant term’s IDF because this would favour rarer + terms eg misspellings. Instead, all variants use the same IDF + ranking (the one for the source query term) and this is factored into the + variant’s boost. If the source query term does not exist in the index the + average IDF of the variants is used. + */ + export class FuzzyLikeThisFieldQuery implements Query { + + /* + Constructs a query where each documents returned are “like” provided text + */ + constructor(field: string, likeText: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + The analyzer that will be used to analyze the text. Defaults to the + analyzer associated with the field. + */ + analyzer(analyzerName: string): FuzzyLikeThisFieldQuery; + + /* + Sets the boost value of the Query. + */ + boost(boost: number): FuzzyLikeThisFieldQuery; + + /* + Should the Query fail when an unsupported field + is specified. Defaults to true. + */ + failOnUnsupportedField(trueFalse: boolean): FuzzyLikeThisFieldQuery; + + /* + The field to run the query against. + */ + field(f: string): FuzzyLikeThisFieldQuery; + + /* + Should term frequency be ignored. Defaults to false. + */ + ignoreTf(trueFalse: boolean): FuzzyLikeThisFieldQuery; + + /* + The text to find documents like + */ + likeText(s: string): FuzzyLikeThisFieldQuery; + + /* + The maximum number of query terms that will be included in any + generated query. Defaults to 25. + */ + maxQueryTerms(max: number): FuzzyLikeThisFieldQuery; + + /* + The minimum similarity of the term variants. Defaults to 0.5. + */ + minSimilarity(min: number): FuzzyLikeThisFieldQuery; + + /* + Length of required common prefix on variant terms. Defaults to 0.. + */ + prefixLength(len: number): FuzzyLikeThisFieldQuery; + + /* + Retrieves the internal query object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + Fuzzy like this query find documents that are “like” provided text by + running it against one or more fields. + + Fuzzifies ALL terms provided as strings and then picks the best n + differentiating terms. In effect this mixes the behaviour of FuzzyQuery and + MoreLikeThis but with special consideration of fuzzy scoring factors. This + generally produces good results for queries where users may provide details + in a number of fields and have no knowledge of boolean query syntax and + also want a degree of fuzzy matching and a fast query. + + For each source term the fuzzy variants are held in a BooleanQuery with + no coord factor (because we are not looking for matches on multiple variants + in any one doc). Additionally, a specialized TermQuery is used for variants + and does not use that variant term’s IDF because this would favour rarer + terms eg misspellings. Instead, all variants use the same IDF + ranking (the one for the source query term) and this is factored into the + variant’s boost. If the source query term does not exist in the index the + average IDF of the variants is used. + */ + export class FuzzyLikeThisQuery implements Query { + + /* + Constructs a query where each documents returned are “like” provided text + */ + constructor(likeText: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + The analyzer that will be used to analyze the text. Defaults to the + analyzer associated with the field. + */ + analyzer(analyzerName: string): FuzzyLikeThisQuery; + + /* + Sets the boost value for documents matching the Query. + */ + boost(boost: number): FuzzyLikeThisQuery; + + /* + Should the Query fail when an unsupported field + is specified. Defaults to true. + */ + failOnUnsupportedField(trueFalse: boolean): FuzzyLikeThisQuery; + + /* + The fields to run the query against. If you call with a single field, + it is added to the existing list of fields. If called with an array + of field names, it replaces any existing values with the new array. + */ + fields(f: string | string[]): FuzzyLikeThisQuery; + + /* + Should term frequency be ignored. Defaults to false. + */ + ignoreTf(trueFalse: boolean): FuzzyLikeThisQuery; + + /* + The text to find documents like + */ + likeText(s: string): FuzzyLikeThisQuery; + + /* + The maximum number of query terms that will be included in any + generated query. Defaults to 25. + */ + maxQueryTerms(max: number): FuzzyLikeThisQuery; + + /* + The minimum similarity of the term variants. Defaults to 0.5. + */ + minSimilarity(min: number): FuzzyLikeThisQuery; + + /* + Length of required common prefix on variant terms. Defaults to 0.. + */ + prefixLength(len: number): FuzzyLikeThisQuery; + + /* + Retrieves the internal query object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + A fuzzy search query based on the Damerau-Levenshtein (optimal string + alignment) algorithm, though you can explicitly choose classic Levenshtein + by passing false to the transpositions parameter./p> + + fuzzy query on a numeric field will result in a range query “around” + the value using the min_similarity value. As an example, if you perform a + fuzzy query against a field value of "12" with a min similarity setting + of "2", the query will search for values between "10" and "14". + */ + export class FuzzyQuery implements Query { + + /* + Constructs a query where each documents returned are “like” provided text + */ + constructor(field: string, value: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets the boost value of the Query. + */ + boost(boost: number): FuzzyQuery; + + /* + The field to run the query against. + */ + field(f: string): FuzzyQuery; + + /* + The maximum number of query terms that will be included in any + generated query. Defaults to 50. + */ + maxExpansions(max: number): FuzzyQuery; + + /* + The minimum similarity of the term variants. Defaults to 0.5. + */ + minSimilarity(min: number): FuzzyQuery; + + /* + Length of required common prefix on variant terms. Defaults to 0. + */ + prefixLength(len: number): FuzzyQuery; + + /* + Sets rewrite method. Valid values are: + + + constant_score_auto - tries to pick the best constant-score rewrite + method based on term and document counts from the query + + scoring_boolean - translates each term into boolean should and + keeps the scores as computed by the query + + constant_score_boolean - same as scoring_boolean, expect no scores + are computed. + + constant_score_filter - first creates a private Filter, by visiting + each term in sequence and marking all docs for that term + + top_terms_boost_N - first translates each term into boolean should + and scores are only computed as the boost using the top N + scoring terms. Replace N with an integer value. + + top_terms_N - first translates each term into boolean should + and keeps the scores as computed by the query. Only the top N + scoring terms are used. Replace N with an integer value. + + + Default is constant_score_auto. + + This is an advanced option, use with care. + */ + rewrite(m: string): FuzzyQuery; + + /* + Retrieves the internal query object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + /* + Set to false to use classic Levenshtein edit distance. + */ + transpositions(trueFalse: boolean): FuzzyQuery; + + /* + The query text to fuzzify. + */ + value(s: string): FuzzyQuery; + + } + + + /* + A filter that restricts matched results/docs to a geographic bounding box described by + the specified lon and lat coordinates. The format conforms with the GeoJSON specification. + */ + export class GeoBboxFilter implements Filter { + + /* + Filter results to those which are contained within the defined bounding box. + */ + constructor(fieldName: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets the bottom-right coordinate of the bounding box + */ + bottomRight(p: GeoPoint): GeoBboxFilter; + + /* + Enable or disable caching of the filter + */ + cache(trueFalse: boolean): GeoBboxFilter; + + /* + Sets the cache key. + */ + cacheKey(key: string): GeoBboxFilter; + + /* + Sets the fields to filter against. + */ + field(f: string): GeoBboxFilter; + + /* + Sets the filter name. + */ + name(name: string): GeoBboxFilter; + + /* + If the lat/long points should be normalized to lie within their + respective normalized ranges. + + Normalized ranges are: + lon = -180 (exclusive) to 180 (inclusive) range + lat = -90 to 90 (both inclusive) range + */ + normalize(trueFalse: string): GeoBboxFilter; + + /* + Returns the filter object. + */ + toJSON(): GeoBboxFilter; + + /* + Sets the top-left coordinate of the bounding box + */ + topLeft(p: GeoPoint): GeoBboxFilter; + + /* + Sets the type of the bounding box execution. Valid values are + "memory" and "indexed". Default is memory. + */ + type(type: string): GeoBboxFilter; + + } + + + /* + A multi-bucket aggregation that works on geo_point fields and conceptually + works very similar to the range aggregation. The user can define a point of + origin and a set of distance range buckets. The aggregation evaluate the + distance of each document value from the origin point and determines the + buckets it belongs to based on the ranges (a document belongs to a bucket + if the distance between the document and the origin falls within the distance + range of the bucket). + */ + export class GeoDistanceAggregation implements Aggregation { + + /* + Aggregation that works on geo_point fields and conceptually works very + similar to the range aggregation. + */ + constructor(name: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Add a nested aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. Alias for the + aggregation method. + */ + agg(agg: Aggregation): GeoDistanceAggregation; + + /* + Add a nested aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. + */ + aggregation(agg: Aggregation): GeoDistanceAggregation; + + /* + Sets the point of origin from where distances will be measured. Same as + origin. + */ + center(p: GeoPoint): GeoDistanceAggregation; + + /* + How to compute the distance. Valid values are: + plane, arc, sloppy_arc, and factor. + */ + distanceType(type: string): GeoDistanceAggregation; + + /* + Sets the field to gather terms from. + */ + field(field: string): GeoDistanceAggregation; + + /* + Enable the response to be returned as a keyed object where the key is the + bucket interval. + */ + keyed(trueFalse: boolean): GeoDistanceAggregation; + + /* + Sets the point of origin from where distances will be measured. + */ + origin(p: GeoPoint): GeoDistanceAggregation; + + /* + Sets the point of origin from where distances will be measured. Same as + origin. + */ + point(p: GeoPoint): GeoDistanceAggregation; + + /* + Adds a range to the list of exsiting range expressions. + */ + range(from: string, to: string, key: string): GeoDistanceAggregation; + + /* + Retrieves the internal agg object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + /* + Sets the distance unit. Valid values are: + in, yd, ft, km, NM, mm, cm, mi, and m. + */ + unit(unit: Number): GeoDistanceAggregation; + + } + + + /* + The geoDistanceFacet facet provides information over a range of distances from a + provided point. This includes the number of hits that fall within each range, + along with aggregate information (like total). + + Facets are similar to SQL GROUP BY statements but perform much + better. You can also construct several "groups" at once by simply + specifying multiple facets. + + + + Tip: + For more information on faceted navigation, see + this + Wikipedia article on Faceted Classification. + + + */ + export class GeoDistanceFacet implements Facet { + + /* + A facet which provides information over a range of distances from a provided point. + */ + constructor(name: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Adds a new bounded range. + */ + addRange(from: Number, to: Number): GeoDistanceFacet; + + /* + Adds a new unbounded lower limit. + */ + addUnboundedFrom(from: Number): GeoDistanceFacet; + + /* + Adds a new unbounded upper limit. + */ + addUnboundedTo(to: Number): GeoDistanceFacet; + + /* + Enables caching of the facetFilter + */ + cacheFilter(trueFalse: boolean): GeoDistanceFacet; + + /* + How to compute the distance. Can either be arc (better precision) + or plane (faster). Defaults to arc. + */ + distanceType(type: string): GeoDistanceFacet; + + /* + Allows you to reduce the documents used for computing facet results. + */ + facetFilter(oFilter: Object): GeoDistanceFacet; + + /* + Sets the document field containing the geo-coordinate to be used + to calculate the distance. Defaults to "location". + */ + field(fieldName: string): GeoDistanceFacet; + + /* + Computes values across the entire index + */ + global(trueFalse: boolean): GeoDistanceFacet; + + /* + The script language being used. Currently supported values are + javascript, groovy, and mvel. + */ + lang(language: string): GeoDistanceFacet; + + /* + Sets the mode the facet will use. + + + collector + post + + */ + mode(m: string): GeoDistanceFacet; + + /* + Sets the path to the nested document if faceting against a + nested field. + */ + nested(path: string): GeoDistanceFacet; + + /* + If the lat/long points should be normalized to lie within their + respective normalized ranges. + + Normalized ranges are: + lon = -180 (exclusive) to 180 (inclusive) range + lat = -90 to 90 (both inclusive) range + */ + normalize(trueFalse: string): GeoDistanceFacet; + + /* + Sets parameters that will be applied to the script. Overwrites + any existing params. + */ + params(p: Object): GeoDistanceFacet; + + /* + Sets the point of origin from where distances will be measured. + */ + point(p: GeoPoint): GeoDistanceFacet; + + /* + Computes values across the the specified scope + */ + scope(scope: string): GeoDistanceFacet; + + /* + Retrieves the internal facet object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + /* + Sets the distance unit. Valid values are "mi" for miles or "km" + for kilometers. Defaults to "km". + */ + unit(unit: Number): GeoDistanceFacet; + + /* + Allows you to specify a different value field to aggrerate over. + */ + valueField(fieldName: string): GeoDistanceFacet; + + /* + Allows you modify the value field using a script. The modified value + is then used to compute the statistical data. + */ + valueScript(scriptCode: string): GeoDistanceFacet; + + } + + + /* + A filter that restricts matched results/docs to a given distance from the + point of origin. The format conforms with the GeoJSON specification. + */ + export class GeoDistanceFilter implements Filter { + + /* + Filter results to those which fall within the given distance of the point of origin. + */ + constructor(fieldName: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Enable or disable caching of the filter + */ + cache(trueFalse: boolean): GeoDistanceFilter; + + /* + Sets the cache key. + */ + cacheKey(key: string): GeoDistanceFilter; + + /* + Sets the numeric distance to be used. The distance can be a + numeric value, and then the unit (either mi or km can be set) + controlling the unit. Or a single string with the unit as well. + */ + distance(numericDistance: Number): GeoDistanceFilter; + + /* + How to compute the distance. Can either be arc (better precision) + or plane (faster). Defaults to arc. + */ + distanceType(type: string): GeoDistanceFilter; + + /* + Sets the fields to filter against. + */ + field(f: string): GeoDistanceFilter; + + /* + Sets the filter name. + */ + name(name: string): GeoDistanceFilter; + + /* + If the lat/long points should be normalized to lie within their + respective normalized ranges. + + Normalized ranges are: + lon = -180 (exclusive) to 180 (inclusive) range + lat = -90 to 90 (both inclusive) range + */ + normalize(trueFalse: string): GeoDistanceFilter; + + /* + Will an optimization of using first a bounding box check will be + used. Defaults to memory which will do in memory checks. Can also + have values of indexed to use indexed value check, or none which + disables bounding box optimization. + */ + optimizeBbox(t: string): GeoDistanceFilter; + + /* + Sets the point of origin in which distance will be measured from + */ + point(p: GeoPoint): GeoDistanceFilter; + + /* + Returns the filter object. + */ + toJSON(): GeoDistanceFilter; + + /* + Sets the distance unit. Valid values are "mi" for miles or "km" + for kilometers. Defaults to "km". + */ + unit(unit: Number): GeoDistanceFilter; + + } + + + /* + A filter that restricts matched results/docs to a given distance range from the + point of origin. The format conforms with the GeoJSON specification. + */ + export class GeoDistanceRangeFilter implements Filter { + + /* + Filter results to those which fall within the given distance range of the point of origin. + */ + constructor(fieldName: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Enable or disable caching of the filter + */ + cache(trueFalse: boolean): GeoDistanceRangeFilter; + + /* + Sets the cache key. + */ + cacheKey(key: string): GeoDistanceRangeFilter; + + /* + How to compute the distance. Can either be arc (better precision) + or plane (faster). Defaults to arc. + */ + distanceType(type: string): GeoDistanceRangeFilter; + + /* + Sets the fields to filter against. + */ + field(f: string): GeoDistanceRangeFilter; + + /* + Sets the start point of the distance range + */ + from(numericDistance: Number): GeoDistanceRangeFilter; + + /* + Greater than value. Same as setting from to the value, and + include_lower to false, + */ + gt(val: Number): GeoDistanceRangeFilter; + + /* + Greater than or equal to value. Same as setting from to the value, + and include_lower to true. + */ + gte(val: Number): GeoDistanceRangeFilter; + + /* + Should the first from (if set) be inclusive or not. + Defaults to true + */ + includeLower(trueFalse: boolean): GeoDistanceRangeFilter; + + /* + Should the last to (if set) be inclusive or not. Defaults to true. + */ + includeUpper(trueFalse: boolean): GeoDistanceRangeFilter; + + /* + Less than value. Same as setting to to the value, and include_upper + to false. + */ + lt(val: Number): GeoDistanceRangeFilter; + + /* + Less than or equal to value. Same as setting to to the value, + and include_upper to true. + */ + lte(val: Number): GeoDistanceRangeFilter; + + /* + Sets the filter name. + */ + name(name: string): GeoDistanceRangeFilter; + + /* + If the lat/long points should be normalized to lie within their + respective normalized ranges. + + Normalized ranges are: + lon = -180 (exclusive) to 180 (inclusive) range + lat = -90 to 90 (both inclusive) range + */ + normalize(trueFalse: string): GeoDistanceRangeFilter; + + /* + Will an optimization of using first a bounding box check will be + used. Defaults to memory which will do in memory checks. Can also + have values of indexed to use indexed value check, or none which + disables bounding box optimization. + */ + optimizeBbox(t: string): GeoDistanceRangeFilter; + + /* + Sets the point of origin in which distance will be measured from + */ + point(p: GeoPoint): GeoDistanceRangeFilter; + + /* + Sets the end point of the distance range + */ + to(numericDistance: Number): GeoDistanceRangeFilter; + + /* + Returns the filter object. + */ + toJSON(): GeoDistanceRangeFilter; + + /* + Sets the distance unit. Valid values are "mi" for miles or "km" + for kilometers. Defaults to "km". + */ + unit(unit: Number): GeoDistanceRangeFilter; + + } + + + /* + A multi-bucket aggregation that works on geo_point fields and groups points + into buckets that represent cells in a grid. The resulting grid can be sparse + and only contains cells that have matching data. Each cell is labeled using a + geohash which is of user-definable precision. + */ + export class GeoHashGridAggregation implements Aggregation { + + /* + Aggregation that works on geo_point fields and groups points into buckets + that represent cells in a grid. + */ + constructor(name: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Add a nested aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. Alias for the + aggregation method. + */ + agg(agg: Aggregation): GeoHashGridAggregation; + + /* + Add a nested aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. + */ + aggregation(agg: Aggregation): GeoHashGridAggregation; + + /* + Sets the geo field to perform calculations from. + */ + field(field: string): GeoHashGridAggregation; + + /* + Sets the Geo Hash precision. The precision value can be between 1 and 12 + where 12 is the highest precision. + */ + precision(p: number): GeoHashGridAggregation; + + /* + Determines how many geohash_grid the coordinating node will request from + each shard. + */ + shardSize(shardSize: number): GeoHashGridAggregation; + + /* + Sets the number of aggregation entries that will be returned. + */ + size(size: number): GeoHashGridAggregation; + + /* + Retrieves the internal agg object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + A GeoPoint object that can be used in queries and filters that + take a GeoPoint. GeoPoint supports various input formats. + + See http://www.elasticsearch.org/guide/reference/mapping/geo-point-type.html + */ + export class GeoPoint implements Geo { + + /* + Defines a point + */ + constructor(p: any[]); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets the GeoPoint from an array point. The array must contain only + 2 values. The first value is the lat and the 2nd value is the lon. + + Example: + [41.12, -71.34] + */ + array(a: any[]): GeoPoint; + + /* + Sets the GeoPoint as a GeoHash. The hash is a string of + alpha-numeric characters with a precision length that defaults to 12. + + Example: + "drm3btev3e86" + */ + geohash(hash: string, precision: number): GeoPoint; + + /* + Sets the GeoPoint as properties on an object. The object must have + a 'lat' and 'lon' or a 'geohash' property. + + Example: + {lat: 41.12, lon: -71.34} or {geohash: "drm3btev3e86"} + */ + properties(obj: Object): GeoPoint; + + /* + Sets the GeoPoint as a string. The format is "lat,lon". + + Example: + + "41.12,-71.34" + */ + string(s: string): GeoPoint; + + /* + Retrieves the internal script object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + A filter for locating documents that fall within a polygon of points. Simply provide a lon/lat + for each document as a Geo Point type. The format conforms with the GeoJSON specification. + */ + export class GeoPolygonFilter { + + /* + Filter results to those which are contained within the polygon of points. + */ + constructor(fieldName: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Enable or disable caching of the filter + */ + cache(trueFalse: boolean): GeoPolygonFilter; + + /* + Sets the cache key. + */ + cacheKey(key: string): GeoPolygonFilter; + + /* + Sets the fields to filter against. + */ + field(f: string): GeoPolygonFilter; + + /* + Sets the filter name. + */ + name(name: string): GeoPolygonFilter; + + /* + If the lat/long points should be normalized to lie within their + respective normalized ranges. + + Normalized ranges are: + lon = -180 (exclusive) to 180 (inclusive) range + lat = -90 to 90 (both inclusive) range + */ + normalize(trueFalse: string): GeoPolygonFilter; + + /* + Sets a series of points that represent a polygon. If passed a + single GeoPoint object, it is added to the current + list of points. If passed an array of GeoPoint + objects it replaces all current values. + */ + points(pointsArray: any[]): GeoPolygonFilter; + + /* + Returns the filter object. + */ + toJSON(): GeoPolygonFilter; + + } + + + /* + Efficient filtering of documents containing shapes indexed using the + geo_shape type. + + Much like the geo_shape type, the geo_shape filter uses a grid square + representation of the filter shape to find those documents which have shapes + that relate to the filter shape in a specified way. In order to do this, the + field being queried must be of geo_shape type. The filter will use the same + PrefixTree configuration as defined for the field. + */ + export class GeoShapeFilter implements Filter { + + /* + A Filter to find documents with a geo_shapes matching a specific shape. + */ + constructor(); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Enable or disable caching of the filter + */ + cache(trueFalse: boolean): GeoShapeFilter; + + /* + Sets the cache key. + */ + cacheKey(key: string): GeoShapeFilter; + + /* + Sets the field to filter against. + */ + field(f: string): GeoShapeFilter; + + /* + Sets the indexed shape. Use this if you already have shape definitions + already indexed. + */ + indexedShape(indexedShape: string): GeoShapeFilter; + + /* + Sets the filter name. + */ + name(name: string): GeoShapeFilter; + + /* + Sets the shape relation type. A relationship between a Query Shape + and indexed Shapes that will be used to determine if a Document + should be matched or not. Valid values are: intersects, disjoint, + and within. + */ + relation(indexedShape: string): GeoShapeFilter; + + /* + Sets the shape + */ + shape(shape: string): GeoShapeFilter; + + /* + Sets the spatial strategy. + Valid values are: + + + recursive - default, recursively traverse nodes in + the spatial prefix tree. This strategy has support for + searching non-point shapes. + term - uses a large TermsFilter on each node + in the spatial prefix tree. It only supports the search of + indexed Point shapes. + + + This is an advanced setting, use with care. + */ + strategy(strategy: string): GeoShapeFilter; + + /* + Returns the filter object. + */ + toJSON(): GeoShapeFilter; + + } + + + /* + Efficient querying of documents containing shapes indexed using the + geo_shape type. + + Much like the geo_shape type, the geo_shape query uses a grid square + representation of the query shape to find those documents which have shapes + that relate to the query shape in a specified way. In order to do this, the + field being queried must be of geo_shape type. The query will use the same + PrefixTree configuration as defined for the field. + */ + export class GeoShapeQuery implements Query { + + /* + A Query to find documents with a geo_shapes matching a specific shape. + */ + constructor(); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets the boost value for documents matching the Query. + */ + boost(boost: Number): GeoShapeQuery; + + /* + Sets the field to query against. + */ + field(f: string): GeoShapeQuery; + + /* + Sets the indexed shape. Use this if you already have shape definitions + already indexed. + */ + indexedShape(indexedShape: string): GeoShapeQuery; + + /* + Sets the shape relation type. A relationship between a Query Shape + and indexed Shapes that will be used to determine if a Document + should be matched or not. Valid values are: intersects, disjoint, + and within. + */ + relation(indexedShape: string): GeoShapeQuery; + + /* + Sets the shape + */ + shape(shape: string): GeoShapeQuery; + + /* + Sets the spatial strategy. + Valid values are: + + + recursive - default, recursively traverse nodes in + the spatial prefix tree. This strategy has support for + searching non-point shapes. + term - uses a large TermsFilter on each node + in the spatial prefix tree. It only supports the search of + indexed Point shapes. + + + This is an advanced setting, use with care. + */ + strategy(strategy: string): GeoShapeQuery; + + /* + Retrieves the internal query object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + Defines a single bucket of all the documents within the search execution + context. This context is defined by the indices and the document types you’re + searching on, but is not influenced by the search query itself. + */ + export class GlobalAggregation implements Aggregation { + + /* + Defines a single bucket of all the documents within the search context. + */ + constructor(name: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Add a nested aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. Alias for the + aggregation method. + */ + agg(agg: Aggregation): GlobalAggregation; + + /* + Add a nested aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. + */ + aggregation(agg: Aggregation): GlobalAggregation; + + /* + Retrieves the internal agg object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + The has_child filter results in parent documents that have child docs + matching the query being returned. + */ + export class HasChildFilter implements Filter { + + /* + Returns results that have child documents matching the filter. + */ + constructor(qry: Object, type: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Enable or disable caching of the filter + */ + cache(trueFalse: boolean): HasChildFilter; + + /* + Sets the cache key. + */ + cacheKey(key: string): HasChildFilter; + + /* + Sets the filter + */ + filter(f: Query): HasChildFilter; + + /* + Sets the filter name. + */ + name(name: string): HasChildFilter; + + /* + Sets the query + */ + query(q: Query): HasChildFilter; + + /* + Sets the scope of the filter. A scope allows to run facets on the + same scope name that will work against the child documents. + */ + scope(s: string): HasChildFilter; + + /* + Sets the cutoff value to short circuit processing. + */ + shortCircuitCutoff(cutoff: number): HasChildFilter; + + /* + Returns the filter object. + */ + toJSON(): HasChildFilter; + + /* + Sets the child document type to search against + */ + type(t: string): HasChildFilter; + + } + + + /* + The has_child query works the same as the has_child filter, + by automatically wrapping the filter with a constant_score. Results in + parent documents that have child docs matching the query being returned. + */ + export class HasChildQuery implements Query { + + /* + Returns results that have child documents matching the query. + */ + constructor(qry: Object, type: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets the boost value for documents matching the Query. + */ + boost(boost: number): HasChildQuery; + + /* + Sets the query + */ + query(q: Object): HasChildQuery; + + /* + Sets the scope of the query. A scope allows to run facets on the + same scope name that will work against the child documents. + */ + scope(s: string): HasChildQuery; + + /* + Sets the scoring method. Valid values are: + + none - the default, no scoring + max - the highest score of all matched child documents is used + sum - the sum the all the matched child documents is used + avg - the average of all matched child documents is used + */ + scoreMode(s: string): HasChildQuery; + + /* + Sets the scoring method. Valid values are: + + none - the default, no scoring + max - the highest score of all matched child documents is used + sum - the sum the all the matched child documents is used + avg - the average of all matched child documents is used + */ + scoreType(s: string): HasChildQuery; + + /* + Sets the cutoff value to short circuit processing. + */ + shortCircuitCutoff(cutoff: number): HasChildQuery; + + /* + Retrieves the internal query object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + /* + Sets the child document type to search against + */ + type(t: string): HasChildQuery; + + } + + + /* + The has_parent results in child documents that have parent docs matching + the query being returned. + */ + export class HasParentFilter implements Filter { + + /* + Returns results that have parent documents matching the filter. + */ + constructor(qry: Object, parentType: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Enable or disable caching of the filter + */ + cache(trueFalse: boolean): HasParentFilter; + + /* + Sets the cache key. + */ + cacheKey(key: string): HasParentFilter; + + /* + Sets the filter + */ + filter(f: Object): HasParentFilter; + + /* + Sets the filter name. + */ + name(name: string): HasParentFilter; + + /* + Sets the child document type to search against + */ + parentType(t: string): HasParentFilter; + + /* + Sets the query + */ + query(q: Object): HasParentFilter; + + /* + Sets the scope of the filter. A scope allows to run facets on the + same scope name that will work against the parent documents. + */ + scope(s: string): HasParentFilter; + + /* + Returns the filter object. + */ + toJSON(): HasParentFilter; + + } + + + /* + The has_parent query works the same as the has_parent filter, by + automatically wrapping the filter with a constant_score. Results in + child documents that have parent docs matching the query being returned. + */ + export class HasParentQuery implements Query { + + /* + Returns results that have parent documents matching the query. + */ + constructor(qry: Object, parentType: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets the boost value for documents matching the Query. + */ + boost(boost: number): HasParentQuery; + + /* + Sets the child document type to search against + */ + parentType(t: string): HasParentQuery; + + /* + Sets the query + */ + query(q: Object): HasParentQuery; + + /* + Sets the scope of the query. A scope allows to run facets on the + same scope name that will work against the parent documents. + */ + scope(s: string): HasParentQuery; + + /* + Sets the scoring method. Valid values are: + + none - the default, no scoring + score - the score of the parent is used in all child documents. + */ + scoreMode(s: string): HasParentQuery; + + /* + Sets the scoring method. Valid values are: + + none - the default, no scoring + score - the score of the parent is used in all child documents. + */ + scoreType(s: string): HasParentQuery; + + /* + Retrieves the internal query object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + Allows to highlight search results on one or more fields. In order to + perform highlighting, the actual content of the field is required. If the + field in question is stored (has store set to yes in the mapping), it will + be used, otherwise, the actual _source will be loaded and the relevant + field will be extracted from it. + + If no term_vector information is provided (by setting it to + with_positions_offsets in the mapping), then the plain highlighter will be + used. If it is provided, then the fast vector highlighter will be used. + When term vectors are available, highlighting will be performed faster at + the cost of bigger index size. + + See http://www.elasticsearch.org/guide/reference/api/search/highlighting.html + */ + export class Highlight { + + /* + Allows to highlight search results on one or more fields. + */ + constructor(fields: string | string[]); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Set's the boundary characters. When highlighting a field that is + mapped with term vectors, boundary_chars can be configured to + define what constitutes a boundary for highlighting. It’s a single + string with each boundary character defined in it. You can apply + the option to a specific field by passing the field name in to + the oField parameter. It defaults to ".,!? \t\n". + */ + boundaryChars(charStr: string, oField: string): Highlight; + + /* + Sets the max number of characters to scan while looking for the + start of a boundary character. You can apply the option to a + specific field by passing the field name in to the + oField parameter. Default: 20 + */ + boundaryMaxScan(cnt: number, oField: string): Highlight; + + /* + Sets highlight encoder. Valid values are: + + default - the default, no encoding + html - to encode html characters if you use html tags + */ + encoder(e: string): Highlight; + + /* + Allows you to set the fields that will be highlighted. You can + specify a single field or an array of fields. All fields are + added to the current list of fields. + */ + fields(vals: string | string[]): Highlight; + + /* + Sets the fragmenter type. You can apply the option + to a specific field by passing the field name in to the + oField parameter. Valid values for order are: + + simple - breaks text up into same-size fragments with no concerns + over spotting sentence boundaries. + span - breaks text up into same-size fragments but does not split + up Spans. + */ + fragmenter(f: string, oField: string): Highlight; + + /* + Sets the size of each highlight fragment in characters. + You can apply the option to a specific field by passing the field + name in to the oField parameter. Default: 100 + */ + fragmentSize(size: number, oField: string): Highlight; + + /* + Enables highlights in documents matched by a filter. + You can apply the option to a specific field by passing the field + name in to the oField parameter. Defaults to false. + */ + highlightFilter(trueFalse: boolean, oField: string): Highlight; + + /* + Sets the number of highlight fragments. + You can apply the option to a specific field by passing the field + name in to the oField parameter. Default: 5 + */ + numberOfFragments(cnt: number, oField: string): Highlight; + + /* + Sets arbitrary options that can be passed to the highlighter + implementation in use. + */ + options(opts: string, oField: Object): Highlight; + + /* + Sets the order of highlight fragments. You can apply the option + to a specific field by passing the field name in to the + oField parameter. Valid values for order are: + + score - the score calculated by Lucene's highlighting framework. + */ + order(o: string, oField: string): Highlight; + + /* + Sets the post tags for highlighted fragments. You can apply the + tags to a specific field by passing the field name in to the + oField parameter. + */ + postTags(tags: string | string[], oField: string): Highlight; + + /* + Sets the pre tags for highlighted fragments. You can apply the + tags to a specific field by passing the field name in to the + oField parameter. + */ + preTags(tags: string | string[], oField: string): Highlight; + + /* + When enabled it will cause a field to be highlighted only if a + query matched that field. false means that terms are highlighted + on all requested fields regardless if the query matches + specifically on them. You can apply the option to a specific + field by passing the field name in to the oField + parameter. Defaults to false. + */ + requireFieldMatch(trueFalse: boolean, oField: string): Highlight; + + /* + Sets the schema to be used for the tags. Valid values are: + + styled - 10 pre tags with css class of hltN, where N is 1-10 + */ + tagsSchema(s: string): Highlight; + + /* + Retrieves the internal script object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + /* + Sets the highligher type. You can apply the option + to a specific field by passing the field name in to the + oField parameter. Valid values for order are: + + fast-vector-highlighter - the fast vector based highligher + highlighter - the slower plain highligher + */ + type(t: string, oField: string): Highlight; + + } + + + /* + A multi-bucket values source based aggregation that can be applied on + numeric values extracted from the documents. It dynamically builds fixed + size (a.k.a. interval) buckets over the values. + */ + export class HistogramAggregation implements Aggregation { + + /* + Aggregation that can be applied on numeric values extracted from the + documents. + */ + constructor(name: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Add a nested aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. Alias for the + aggregation method. + */ + agg(agg: Aggregation): HistogramAggregation; + + /* + Add a nested aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. + */ + aggregation(agg: Aggregation): HistogramAggregation; + + /* + Set's the range/bounds for the histogram aggregation. Useful when you + want to include buckets that might be outside the bounds of indexed + documents. + */ + extendedBounds(min: number, max: number): HistogramAggregation; + + /* + Sets the field to gather terms from. + */ + field(field: string): HistogramAggregation; + + /* + Sets the format expression for the terms. Use for number or date + formatting + */ + format(f: string): HistogramAggregation; + + /* + Sets the histogram interval. Buckets are generated based on this interval + value. + */ + interval(i: number): HistogramAggregation; + + /* + Enable the response to be returned as a keyed object where the key is the + bucket interval. + */ + keyed(trueFalse: boolean): HistogramAggregation; + + /* + The script language being used. + */ + lang(language: string): HistogramAggregation; + + /* + Only return terms that match more than a configured number of hits. + */ + minDocCount(num: number): HistogramAggregation; + + /* + Sets order for the aggregated values. + */ + order(order: string, direction: string): HistogramAggregation; + + /* + Sets parameters that will be applied to the script. Overwrites + any existing params. + */ + params(p: Object): HistogramAggregation; + + /* + Allows you generate or modify the terms using a script. + */ + script(scriptCode: string): HistogramAggregation; + + /* + Set to true to assume script values are sorted. + */ + scriptValuesSorted(trueFalse: boolean): HistogramAggregation; + + /* + Retrieves the internal agg object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + The histogram facet works with numeric data by building a histogram across intervals + of the field values. Each value is rounded into an interval (or placed in a + bucket), and statistics are provided per interval/bucket (count and total). + + Facets are similar to SQL GROUP BY statements but perform much + better. You can also construct several "groups" at once by simply + specifying multiple facets. + + + + Tip: + For more information on faceted navigation, see + this + Wikipedia article on Faceted Classification. + + + */ + export class HistogramFacet implements Facet { + + /* + A facet which returns the N most frequent terms within a collection + or set of collections. + */ + constructor(name: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Enables caching of the facetFilter + */ + cacheFilter(trueFalse: boolean): HistogramFacet; + + /* + Allows you to reduce the documents used for computing facet results. + */ + facetFilter(oFilter: Object): HistogramFacet; + + /* + Sets the field to be used to construct the this facet. + */ + field(fieldName: string): HistogramFacet; + + /* + Sets the "from", "start", or lower bounds bucket. For example if + you have a value of 1023, an interval of 100, and a from value of + 1500, it will be placed into the 1500 bucket vs. the normal bucket + of 1000. + */ + from(from: Number): HistogramFacet; + + /* + Computes values across the entire index + */ + global(trueFalse: boolean): HistogramFacet; + + /* + Sets the bucket interval used to calculate the distribution. + */ + interval(numericInterval: Number): HistogramFacet; + + /* + Allows you to specify a different key field to be used to group intervals. + */ + keyField(fieldName: string): HistogramFacet; + + /* + Allows you modify the key field using a script. The modified value + is then used to generate the interval. + */ + keyScript(scriptCode: string): HistogramFacet; + + /* + The script language being used. Currently supported values are + javascript, groovy, and mvel. + */ + lang(language: string): HistogramFacet; + + /* + Sets the mode the facet will use. + + + collector + post + + */ + mode(m: string): HistogramFacet; + + /* + Sets the path to the nested document if faceting against a + nested field. + */ + nested(path: string): HistogramFacet; + + /* + Sets the type of ordering that will be performed on the date + buckets. Valid values are: + + key - the default, sort by the bucket's key value + count - sort by the number of items in the bucket + total - sort by the sum/total of the items in the bucket + */ + order(o: string): HistogramFacet; + + /* + Sets parameters that will be applied to the script. Overwrites + any existing params. + */ + params(p: Object): HistogramFacet; + + /* + Computes values across the the specified scope + */ + scope(scope: string): HistogramFacet; + + /* + Sets the bucket interval used to calculate the distribution based + on a time value such as "1d", "1w", etc. + */ + timeInterval(timeInterval: Number): HistogramFacet; + + /* + Sets the "to", "end", or upper bounds bucket. For example if + you have a value of 1023, an interval of 100, and a to value of + 900, it will be placed into the 900 bucket vs. the normal bucket + of 1000. + */ + to(to: Number): HistogramFacet; + + /* + Retrieves the internal facet object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + /* + Allows you to specify a different value field to aggrerate over. + */ + valueField(fieldName: string): HistogramFacet; + + /* + Allows you modify the value field using a script. The modified value + is then used to compute the statistical data. + */ + valueScript(scriptCode: string): HistogramFacet; + + } + + + /* + Filters documents that only have the provided ids. Note, this filter + does not require the _id field to be indexed since it works using the + _uid field. + */ + export class IdsFilter implements Filter { + + /* + Matches documents with the specified id(s). + */ + constructor(ids: string | string[]); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Enable or disable caching of the filter + */ + cache(trueFalse: boolean): IdsFilter; + + /* + Sets the cache key. + */ + cacheKey(key: string): IdsFilter; + + /* + Sets the filter name. + */ + name(name: string): IdsFilter; + + /* + Returns the filter object. + */ + toJSON(): IdsFilter; + + /* + Sets the type as a single type or an array of types. If type is a + string, it is added to the list of existing types. If type is an + array, it is set as the types and overwrites an existing types. This + parameter is optional. + */ + type(type: string | string[]): IdsFilter; + + /* + Sets the values array or adds a new value. if val is a string, it + is added to the list of existing document ids. If val is an + array it is set as the document values and replaces any existing values. + */ + values(val: string | string[]): IdsFilter; + + } + + + /* + Filters documents that only have the provided ids. Note, this filter + does not require the _id field to be indexed since it works using the + _uid field. + */ + export class IdsQuery implements Query { + + /* + Matches documents with the specified id(s). + */ + constructor(ids: string | string[]); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets the boost value for documents matching the Query. + */ + boost(boost: number): IdsQuery; + + /* + Retrieves the internal query object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + /* + Sets the type as a single type or an array of types. If type is a + string, it is added to the list of existing types. If type is an + array, it is set as the types and overwrites an existing types. This + parameter is optional. + */ + type(type: string | string[]): IdsQuery; + + /* + Sets the values array or adds a new value. if val is a string, it + is added to the list of existing document ids. If val is an + array it is set as the document values and replaces any existing values. + */ + values(val: string | string[]): IdsQuery; + + } + + + /* + A shape which has already been indexed in another index and/or index + type. This is particularly useful for when you have a pre-defined list of + shapes which are useful to your application and you want to reference this + using a logical name (for example ‘New Zealand’) rather than having to + provide their coordinates each time. + */ + export class IndexedShape implements Geo { + + /* + Defines a shape that already exists in an index/type. + */ + constructor(type: string, id: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets the document id of the indexed shape. + */ + id(id: string): IndexedShape; + + /* + Sets the index which the shape is indexed under. + Defaults to "shapes". + */ + index(idx: string): IndexedShape; + + /* + Sets the field name containing the indexed shape. + Defaults to "shape". + */ + shapeFieldName(field: string): IndexedShape; + + /* + Retrieves the internal script object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + /* + Sets the type which the shape is indexed under. + */ + type(t: string): IndexedShape; + + } + + + /* + The indices filter can be used when executed across multiple indices, + allowing to have a filter that executes only when executed on an index that + matches a specific list of indices, and another filter that executes when it + is executed on an index that does not match the listed indices. + */ + export class IndicesFilter implements Filter { + + /* + A configurable filter that is dependent on the index name. + */ + constructor(fltr: Object, indices: string | string[]); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Enable or disable caching of the filter + */ + cache(trueFalse: boolean): IndicesFilter; + + /* + Sets the cache key. + */ + cacheKey(key: string): IndicesFilter; + + /* + Sets the filter to be used when executing on one of the indicies + specified. + */ + filter(f: Object): IndicesFilter; + + /* + Sets the indicies the filter should match. When passed a string, + the index name is added to the current list of indices. When passed + an array, it overwites all current indices. + */ + indices(i: string | string[]): IndicesFilter; + + /* + Sets the filter name. + */ + name(name: string): IndicesFilter; + + /* + Sets the filter to be used on an index that does not match an index + name in the indices list. Can also be set to "none" to not match any + documents or "all" to match all documents. + */ + noMatchFilter(f: Filter | string): IndicesFilter; + + /* + Returns the filter object. + */ + toJSON(): IndicesFilter; + + } + + + /* + The indices query can be used when executed across multiple indices, + allowing to have a query that executes only when executed on an index that + matches a specific list of indices, and another query that executes when it + is executed on an index that does not match the listed indices. + */ + export class IndicesQuery implements Query { + + /* + A configurable query that is dependent on the index name. + */ + constructor(qry: Query, indices: string | string[]); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets the boost value for documents matching the Query. + */ + boost(boost: number): IndicesQuery; + + /* + Sets the indicies the query should match. When passed a string, + the index name is added to the current list of indices. When passed + an array, it overwites all current indices. + */ + indices(i: string | string[]): IndicesQuery; + + /* + Sets the query to be used on an index that does not match an index + name in the indices list. Can also be set to "none" to not match any + documents or "all" to match all documents. + */ + noMatchQuery(q: Query | string): IndicesQuery; + + /* + Sets the query to be executed against the indices specified. + */ + query(q: Query): IndicesQuery; + + /* + Retrieves the internal query object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + A dedicated range aggregation for IPv4 typed fields. + + Note that this aggregration includes the from value and excludes the to + value for each range. + */ + export class IPv4RangeAggregation implements Aggregation { + + /* + A dedicated range aggregation for IPv4 typed fields. + */ + constructor(name: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Add a nested aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. Alias for the + aggregation method. + */ + agg(agg: Aggregation): IPv4RangeAggregation; + + /* + Add a nested aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. + */ + aggregation(agg: Aggregation): IPv4RangeAggregation; + + /* + Sets the field to gather terms from. + */ + field(field: string): IPv4RangeAggregation; + + /* + Enable the response to be returned as a keyed object where the key is the + bucket interval. + */ + keyed(trueFalse: boolean): IPv4RangeAggregation; + + /* + The script language being used. + */ + lang(language: string): IPv4RangeAggregation; + + /* + Sets parameters that will be applied to the script. Overwrites + any existing params. + */ + params(p: Object): IPv4RangeAggregation; + + /* + Adds a range to the list of exsiting range expressions. + */ + range(from: string, to: string, key: string): IPv4RangeAggregation; + + /* + Allows you generate or modify the terms using a script. + */ + script(scriptCode: string): IPv4RangeAggregation; + + /* + Set to true to assume script values are sorted. + */ + scriptValuesSorted(trueFalse: boolean): IPv4RangeAggregation; + + /* + Retrieves the internal agg object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + A limit filter limits the number of documents (per shard) to execute on. + */ + export class LimitFilter implements Filter { + + /* + Limits the number of documents to execute on. + */ + constructor(limit: number); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Enable or disable caching of the filter + */ + cache(trueFalse: boolean): LimitFilter; + + /* + Sets the cache key. + */ + cacheKey(key: string): LimitFilter; + + /* + Sets the filter name. + */ + name(name: string): LimitFilter; + + /* + Returns the filter object. + */ + toJSON(): LimitFilter; + + /* + Sets the limit value. + */ + value(val: number): LimitFilter; + + } + + + /* + This filter can be used to match on all the documents + in a given set of collections and/or types. + */ + export class MatchAllFilter implements Filter { + + /* + A filter that matches on all documents + */ + constructor(); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Enable or disable caching of the filter + */ + cache(trueFalse: boolean): MatchAllFilter; + + /* + Sets the cache key. + */ + cacheKey(key: string): MatchAllFilter; + + /* + Sets the filter name. + */ + name(name: string): MatchAllFilter; + + /* + Returns the filter object. + */ + toJSON(): MatchAllFilter; + + } + + + /* + This query can be used to match all the documents + in a given set of collections and/or types. + */ + export class MatchAllQuery implements Query { + + /* + A query that returns all documents. + */ + constructor(); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets the boost value for documents matching the Query. + */ + boost(boost: number): MatchAllQuery; + + /* + Retrieves the internal query object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + A MatchQuery is a type of Query that accepts + text/numerics/dates, analyzes it, generates a query based on the + MatchQuery type. + */ + export class MatchQuery implements Query { + + /* + A Query that appects text, analyzes it, generates internal query based + on the MatchQuery type. + */ + constructor(field: string, qstr: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets the analyzer name used to analyze the Query object. + */ + analyzer(analyzer: string): MatchQuery; + + /* + Sets the boost value for documents matching the Query. + */ + boost(boost: Number): MatchQuery; + + /* + Sets the maximum threshold/frequency to be considered a low + frequency term in a CommonTermsQuery. + Set to a value between 0 and 1. + */ + cutoffFrequency(freq: Number): MatchQuery; + + /* + Sets the fuzziness value for the Query. + */ + fuzziness(fuzz: number): MatchQuery; + + /* + Sets fuzzy rewrite method. Valid values are: + + constant_score_auto - tries to pick the best constant-score rewrite + method based on term and document counts from the query + + scoring_boolean - translates each term into boolean should and + keeps the scores as computed by the query + + constant_score_boolean - same as scoring_boolean, expect no scores + are computed. + + constant_score_filter - first creates a private Filter, by visiting + each term in sequence and marking all docs for that term + + top_terms_boost_N - first translates each term into boolean should + and scores are only computed as the boost using the top N + scoring terms. Replace N with an integer value. + + top_terms_N - first translates each term into boolean should + and keeps the scores as computed by the query. Only the top N + scoring terms are used. Replace N with an integer value. + + Default is constant_score_auto. + + This is an advanced option, use with care. + */ + fuzzyRewrite(m: string): MatchQuery; + + /* + Set to false to use classic Levenshtein edit distance in the + fuzzy query. + */ + fuzzyTranspositions(trueFalse: boolean): MatchQuery; + + /* + Enables lenient parsing of the query string. + */ + lenient(trueFalse: boolean): MatchQuery; + + /* + Sets the max expansions of a fuzzy MatchQuery. + */ + maxExpansions(e: number): MatchQuery; + + /* + Sets a percent value controlling how many "should" clauses in the + resulting Query should match. + */ + minimumShouldMatch(minMatch: number): MatchQuery; + + /* + Sets default operator of the Query. Default: or. + */ + operator(op: string): MatchQuery; + + /* + Sets the prefix length for a fuzzy prefix MatchQuery. + */ + prefixLength(l: number): MatchQuery; + + /* + Sets the query string for the Query. + */ + query(qstr: string): MatchQuery; + + /* + Sets rewrite method. Valid values are: + + constant_score_auto - tries to pick the best constant-score rewrite + method based on term and document counts from the query + + scoring_boolean - translates each term into boolean should and + keeps the scores as computed by the query + + constant_score_boolean - same as scoring_boolean, expect no scores + are computed. + + constant_score_filter - first creates a private Filter, by visiting + each term in sequence and marking all docs for that term + + top_terms_boost_N - first translates each term into boolean should + and scores are only computed as the boost using the top N + scoring terms. Replace N with an integer value. + + top_terms_N - first translates each term into boolean should + and keeps the scores as computed by the query. Only the top N + scoring terms are used. Replace N with an integer value. + + Default is constant_score_auto. + + This is an advanced option, use with care. + */ + rewrite(m: string): MatchQuery; + + /* + Sets the default slop for phrases. If zero, then exact phrase matches + are required. Default: 0. + */ + slop(slop: number): MatchQuery; + + /* + Retrieves the internal query object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + /* + Sets the type of the MatchQuery. Valid values are + boolean, phrase, and phrase_prefix. + */ + type(type: string): MatchQuery; + + /* + Sets what happens when no terms match. Valid values are + "all" or "none". + */ + zeroTermsQuery(q: string): MatchQuery; + + } + + + /* + A single-value metrics aggregation that keeps track and returns the + maximum value among the numeric values extracted from the aggregated + documents. These values can be extracted either from specific numeric fields + in the documents, or be generated by a provided script. + */ + export class MaxAggregation implements Aggregation { + + /* + Aggregation that keeps track and returns the maximum value among the + numeric values extracted from the aggregated documents. + */ + constructor(name: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets the field to operate on. + */ + field(field: string): MaxAggregation; + + /* + The script language being used. + */ + lang(language: string): MaxAggregation; + + /* + Sets parameters that will be applied to the script. Overwrites + any existing params. + */ + params(p: Object): MaxAggregation; + + /* + Allows you generate or modify the terms/values using a script. + */ + script(scriptCode: string): MaxAggregation; + + /* + Set to true to assume script values are sorted. + */ + scriptValuesSorted(trueFalse: boolean): MaxAggregation; + + /* + Retrieves the internal agg object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + export class MetricsAggregationMixin implements Aggregation { + + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets the field to operate on. + */ + field(field: string): MetricsAggregationMixin; + + /* + The script language being used. + */ + lang(language: string): MetricsAggregationMixin; + + /* + Sets parameters that will be applied to the script. Overwrites + any existing params. + */ + params(p: Object): MetricsAggregationMixin; + + /* + Allows you generate or modify the terms/values using a script. + */ + script(scriptCode: string): MetricsAggregationMixin; + + /* + Set to true to assume script values are sorted. + */ + scriptValuesSorted(trueFalse: boolean): MetricsAggregationMixin; + + /* + Retrieves the internal agg object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + A single-value metrics aggregation that keeps track and returns the + minimum value among numeric values extracted from the aggregated documents. + These values can be extracted either from specific numeric fields in the + documents, or be generated by a provided script. + */ + export class MinAggregation implements Aggregation { + + /* + Aggregation that keeps track and returns the minimum value among numeric + values extracted from the aggregated documents. + */ + constructor(name: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets the field to operate on. + */ + field(field: string): MinAggregation; + + /* + The script language being used. + */ + lang(language: string): MinAggregation; + + /* + Sets parameters that will be applied to the script. Overwrites + any existing params. + */ + params(p: Object): MinAggregation; + + /* + Allows you generate or modify the terms/values using a script. + */ + script(scriptCode: string): MinAggregation; + + /* + Set to true to assume script values are sorted. + */ + scriptValuesSorted(trueFalse: boolean): MinAggregation; + + /* + Retrieves the internal agg object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + A field data based single bucket aggregation, that creates a bucket of all + documents in the current document set context that are missing a field value + (effectively, missing a field or having the configured NULL value set). + */ + export class MissingAggregation implements Aggregation { + + /* + Defines a bucket of all documents that are missing a field value. + */ + constructor(name: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Add a nested aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. Alias for the + aggregation method. + */ + agg(agg: Aggregation): MissingAggregation; + + /* + Add a nested aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. + */ + aggregation(agg: Aggregation): MissingAggregation; + + /* + Sets the field to gather missing terms from. + */ + field(field: string): MissingAggregation; + + /* + Retrieves the internal agg object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + An missingFilter matches documents where the specified field contains no legitimate value. + */ + export class MissingFilter implements Filter { + + /* + Filters documents where a specific field has no value present. + */ + constructor(fieldName: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Enable or disable caching of the filter + */ + cache(trueFalse: boolean): MissingFilter; + + /* + Sets the cache key. + */ + cacheKey(key: string): MissingFilter; + + /* + Checks if the field doesn't exist. + */ + existence(trueFalse: boolean): MissingFilter; + + /* + Sets the field to check for missing values. + */ + field(name: string): MissingFilter; + + /* + Sets the filter name. + */ + name(name: string): MissingFilter; + + /* + Checks if the field has null values. + */ + nullValue(trueFalse: boolean): MissingFilter; + + /* + Returns the filter object. + */ + toJSON(): MissingFilter; + + } + + + /* + The more_like_this_field query is the same as the more_like_this query, + except it runs against a single field. + */ + export class MoreLikeThisFieldQuery implements Query { + + /* + Constructs a query where each documents returned are “like” provided text + */ + constructor(field: string, likeText: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + The analyzer that will be used to analyze the text. Defaults to the + analyzer associated with the field. + */ + analyzer(analyzerName: string): MoreLikeThisFieldQuery; + + /* + Sets the boost value of the Query. + */ + boost(boost: number): MoreLikeThisFieldQuery; + + /* + Sets the boost factor to use when boosting terms. + Defaults to 1. + */ + boostTerms(boost: number): MoreLikeThisFieldQuery; + + /* + Should the Query fail when an unsupported field + is specified. Defaults to true. + */ + failOnUnsupportedField(trueFalse: boolean): MoreLikeThisFieldQuery; + + /* + The field to run the query against. + */ + field(f: string): MoreLikeThisFieldQuery; + + /* + The text to find documents like + */ + likeText(s: string): MoreLikeThisFieldQuery; + + /* + The maximum frequency in which words may still appear. Words that + appear in more than this many docs will be ignored. + Defaults to unbounded. + */ + maxDocFreq(max: number): MoreLikeThisFieldQuery; + + /* + The maximum number of query terms that will be included in any + generated query. Defaults to 25. + */ + maxQueryTerms(max: number): MoreLikeThisFieldQuery; + + /* + The maximum word length above which words will be ignored. + Defaults to unbounded (0). + */ + maxWordLen(len: number): MoreLikeThisFieldQuery; + + /* + The frequency at which words will be ignored which do not occur in + at least this many docs. Defaults to 5. + */ + minDocFreq(min: number): MoreLikeThisFieldQuery; + + /* + The frequency below which terms will be ignored in the source doc. + The default frequency is 2. + */ + minTermFreq(freq: number): MoreLikeThisFieldQuery; + + /* + The minimum word length below which words will be ignored. + Defaults to 0. + */ + minWordLen(len: number): MoreLikeThisFieldQuery; + + /* + The percentage of terms to match on (float value). + Defaults to 0.3 (30 percent). + */ + percentTermsToMatch(percent: number): MoreLikeThisFieldQuery; + + /* + An array of stop words. Any word in this set is considered + “uninteresting” and ignored. Even if your Analyzer allows stopwords, + you might want to tell the MoreLikeThis code to ignore them, as for + the purposes of document similarity it seems reasonable to assume + that “a stop word is never interesting”. + */ + stopWords(stopWords: any[]): MoreLikeThisFieldQuery; + + /* + Retrieves the internal query object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + More like this query find documents that are “like” provided text by + running it against one or more fields. + */ + export class MoreLikeThisQuery implements Query { + + /* + Constructs a query where each documents returned are “like” provided text + */ + constructor(fields: string | string[], likeText: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + The analyzer that will be used to analyze the text. Defaults to the + analyzer associated with the field. + */ + analyzer(analyzerName: string): MoreLikeThisQuery; + + /* + Sets the boost value for documents matching the Query. + */ + boost(boost: number): MoreLikeThisQuery; + + /* + Sets the boost factor to use when boosting terms. + Defaults to 1. + */ + boostTerms(boost: number): MoreLikeThisQuery; + + /* + Should the Query fail when an unsupported field + is specified. Defaults to true. + */ + failOnUnsupportedField(trueFalse: boolean): MoreLikeThisQuery; + + /* + The fields to run the query against. If you call with a single field, + it is added to the existing list of fields. If called with an array + of field names, it replaces any existing values with the new array. + */ + fields(f: string | string[]): MoreLikeThisQuery; + + /* + The text to find documents like + */ + likeText(s: string): MoreLikeThisQuery; + + /* + The maximum frequency in which words may still appear. Words that + appear in more than this many docs will be ignored. + Defaults to unbounded. + */ + maxDocFreq(max: number): MoreLikeThisQuery; + + /* + The maximum number of query terms that will be included in any + generated query. Defaults to 25. + */ + maxQueryTerms(max: number): MoreLikeThisQuery; + + /* + The maximum word length above which words will be ignored. + Defaults to unbounded (0). + */ + maxWordLen(len: number): MoreLikeThisQuery; + + /* + The frequency at which words will be ignored which do not occur in + at least this many docs. Defaults to 5. + */ + minDocFreq(min: number): MoreLikeThisQuery; + + /* + The frequency below which terms will be ignored in the source doc. + The default frequency is 2. + */ + minTermFreq(freq: number): MoreLikeThisQuery; + + /* + The minimum word length below which words will be ignored. + Defaults to 0. + */ + minWordLen(len: number): MoreLikeThisQuery; + + /* + The percentage of terms to match on (float value). + Defaults to 0.3 (30 percent). + */ + percentTermsToMatch(percent: number): MoreLikeThisQuery; + + /* + An array of stop words. Any word in this set is considered + “uninteresting” and ignored. Even if your Analyzer allows stopwords, + you might want to tell the MoreLikeThis code to ignore them, as for + the purposes of document similarity it seems reasonable to assume + that “a stop word is never interesting”. + */ + stopWords(stopWords: any[]): MoreLikeThisQuery; + + /* + Retrieves the internal query object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + A MultiMatchQuery query builds further on top of the + MatchQuery by allowing multiple fields to be specified. + The idea here is to allow to more easily build a concise match type query + over multiple fields instead of using a relatively more expressive query + by using multiple match queries within a bool query. + */ + export class MultiMatchQuery implements Query { + + /* + A Query that allow to more easily build a MatchQuery + over multiple fields + */ + constructor(fields: string | string[], qstr: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets the analyzer name used to analyze the Query object. + */ + analyzer(analyzer: string): MultiMatchQuery; + + /* + Sets the boost value for documents matching the Query. + */ + boost(boost: number): MultiMatchQuery; + + /* + Sets the maximum threshold/frequency to be considered a low + frequency term in a CommonTermsQuery. + Set to a value between 0 and 1. + */ + cutoffFrequency(freq: Number): MultiMatchQuery; + + /* + Sets the fields to search across. If passed a single value it is + added to the existing list of fields. If passed an array of + values, they overwite all existing values. + */ + fields(f: string | string[]): MultiMatchQuery; + + /* + Sets the fuzziness value for the Query. + */ + fuzziness(fuzz: number): MultiMatchQuery; + + /* + Sets fuzzy rewrite method. Valid values are: + + constant_score_auto - tries to pick the best constant-score rewrite + method based on term and document counts from the query + + scoring_boolean - translates each term into boolean should and + keeps the scores as computed by the query + + constant_score_boolean - same as scoring_boolean, expect no scores + are computed. + + constant_score_filter - first creates a private Filter, by visiting + each term in sequence and marking all docs for that term + + top_terms_boost_N - first translates each term into boolean should + and scores are only computed as the boost using the top N + scoring terms. Replace N with an integer value. + + top_terms_N - first translates each term into boolean should + and keeps the scores as computed by the query. Only the top N + scoring terms are used. Replace N with an integer value. + + Default is constant_score_auto. + + This is an advanced option, use with care. + */ + fuzzyRewrite(m: string): MultiMatchQuery; + + /* + Enables lenient parsing of the query string. + */ + lenient(trueFalse: boolean): MultiMatchQuery; + + /* + Sets the max expansions of a fuzzy Query. + */ + maxExpansions(e: number): MultiMatchQuery; + + /* + Sets a percent value controlling how many "should" clauses in the + resulting Query should match. + */ + minimumShouldMatch(minMatch: number): MultiMatchQuery; + + /* + Sets default operator of the Query. Default: or. + */ + operator(op: string): MultiMatchQuery; + + /* + Sets the prefix length for a fuzzy prefix Query. + */ + prefixLength(l: number): MultiMatchQuery; + + /* + Sets the query string for the Query. + */ + query(qstr: string): MultiMatchQuery; + + /* + Sets rewrite method. Valid values are: + + constant_score_auto - tries to pick the best constant-score rewrite + method based on term and document counts from the query + + scoring_boolean - translates each term into boolean should and + keeps the scores as computed by the query + + constant_score_boolean - same as scoring_boolean, expect no scores + are computed. + + constant_score_filter - first creates a private Filter, by visiting + each term in sequence and marking all docs for that term + + top_terms_boost_N - first translates each term into boolean should + and scores are only computed as the boost using the top N + scoring terms. Replace N with an integer value. + + top_terms_N - first translates each term into boolean should + and keeps the scores as computed by the query. Only the top N + scoring terms are used. Replace N with an integer value. + + Default is constant_score_auto. + + This is an advanced option, use with care. + */ + rewrite(m: string): MultiMatchQuery; + + /* + Sets the default slop for phrases. If zero, then exact phrase matches + are required. Default: 0. + */ + slop(slop: number): MultiMatchQuery; + + /* + The tie breaker value. The tie breaker capability allows results + that include the same term in multiple fields to be judged better than + results that include this term in only the best of those multiple + fields, without confusing this with the better case of two different + terms in the multiple fields. Default: 0.0. + */ + tieBreaker(tieBreaker: number): MultiMatchQuery; + + /* + Retrieves the internal query object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + /* + Sets the type of the MultiMatchQuery. Valid values are + boolean, phrase, and phrase_prefix or phrasePrefix. + */ + type(type: string): MultiMatchQuery; + + /* + Sets whether or not queries against multiple fields should be combined using Lucene's + + DisjunctionMaxQuery + */ + useDisMax(trueFalse: string): MultiMatchQuery; + + /* + Sets what happens when no terms match. Valid values are + "all" or "none". + */ + zeroTermsQuery(q: string): MultiMatchQuery; + + } + + + /* + A special single bucket aggregation that enables aggregating nested + documents. + */ + export class NestedAggregation implements Aggregation { + + /* + A special single bucket aggregation that enables aggregating nested + documents. + */ + constructor(name: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Add a nested aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. Alias for the + aggregation method. + */ + agg(agg: Aggregation): NestedAggregation; + + /* + Add a nested aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. + */ + aggregation(agg: Aggregation): NestedAggregation; + + /* + Sets the nested path. + */ + path(path: string): NestedAggregation; + + /* + Retrieves the internal agg object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + Nested filters allow you to search against content within objects that are + embedded inside of other objects. It is similar to XPath + expressions in XML both conceptually and syntactically. + + + The filter is executed against the nested objects / docs as if they were + indexed as separate docs and resulting in the root + parent doc (or parent nested mapping). + */ + export class NestedFilter implements Filter { + + /* + Constructs a filter that is capable of executing a filter against objects + nested within a document. + */ + constructor(path: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets the boost value of the nested Query. + */ + boost(boost: number): NestedFilter; + + /* + Enable or disable caching of the filter + */ + cache(trueFalse: boolean): NestedFilter; + + /* + Sets the cache key. + */ + cacheKey(key: string): NestedFilter; + + /* + Sets the nested filter to be executed. + */ + filter(oFilter: Object): NestedFilter; + + /* + If the nested query should be "joined" with the parent document. + Defaults to false. + */ + join(trueFalse: boolean): NestedFilter; + + /* + Sets the filter name. + */ + name(name: string): NestedFilter; + + /* + Sets the root context for the nested filter. + */ + path(p: string): NestedFilter; + + /* + Sets the nested query to be executed. + */ + query(oQuery: Query): NestedFilter; + + /* + Sets the scope of the filter. A scope allows to run facets on the + same scope name that will work against the nested documents. + */ + scope(s: string): NestedFilter; + + /* + Returns the filter object. + */ + toJSON(): NestedFilter; + + } + + + /* + Nested queries allow you to search against content within objects that are + embedded inside of other objects. It is similar to XPath expressions + in XML both conceptually and syntactically. + + The query is executed against the nested objects / docs as if they were + indexed as separate docs and resulting in the rootparent doc (or parent + nested mapping). + */ + export class NestedQuery implements Query { + + /* + Constructs a query that is capable of executing a search against objects + nested within a document. + */ + constructor(path: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets the boost value for documents matching the Query. + */ + boost(boost: number): NestedQuery; + + /* + Sets the nested filter to be executed. + */ + filter(oFilter: Object): NestedQuery; + + /* + Sets the root context for the nested query. + */ + path(path: string): NestedQuery; + + /* + Sets the nested query to be executed. + */ + query(oQuery: Object): NestedQuery; + + /* + Sets the scope of the query. A scope allows to run facets on the + same scope name that will work against the nested documents. + */ + scope(s: string): NestedQuery; + + /* + Sets how the inner (nested) matches affect scoring on the parent document. + */ + scoreMode(mode: string): NestedQuery; + + /* + Retrieves the internal query object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + A container Filter that excludes the documents matched by the + contained filter. + */ + export class NotFilter implements Filter { + + /* + Container filter that excludes the matched documents of the contained filter. + */ + constructor(oFilter: Object); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Enable or disable caching of the filter + */ + cache(trueFalse: boolean): NotFilter; + + /* + Sets the cache key. + */ + cacheKey(key: string): NotFilter; + + /* + Sets the filter + */ + filter(fltr: Object): NotFilter; + + /* + Sets the filter name. + */ + name(name: string): NotFilter; + + /* + Returns the filter object. + */ + toJSON(): NotFilter; + + } + + + /* + Filters documents with fields that have values within a certain numeric + range. Similar to range filter, except that it works only with numeric + values, and the filter execution works differently. + + The numeric range filter works by loading all the relevant field values + into memory, and checking for the relevant docs if they satisfy the range + requirements. This requires more memory since the numeric range data are + loaded to memory, but can provide a significant increase in performance. + + Note, if the relevant field values have already been loaded to memory, + for example because it was used in facets or was sorted on, then this + filter should be used. + */ + export class NumericRangeFilter implements Filter { + + /* + A Filter that only accepts numeric values within a specified range. + */ + constructor(fieldName: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Enable or disable caching of the filter + */ + cache(trueFalse: boolean): NumericRangeFilter; + + /* + Sets the cache key. + */ + cacheKey(key: string): NumericRangeFilter; + + /* + Returns the field name used to create this object. + */ + field(field: string): NumericRangeFilter; + + /* + Sets the endpoint for the current range. + */ + from(startPoint: Number): NumericRangeFilter; + + /* + Greater than value. Same as setting from to the value, and + include_lower to false, + */ + gt(val: any): NumericRangeFilter; + + /* + Greater than or equal to value. Same as setting from to the value, + and include_lower to true. + */ + gte(val: any): NumericRangeFilter; + + /* + Should the first from (if set) be inclusive or not. + Defaults to true + */ + includeLower(trueFalse: boolean): NumericRangeFilter; + + /* + Should the last to (if set) be inclusive or not. Defaults to true. + */ + includeUpper(trueFalse: boolean): NumericRangeFilter; + + /* + Less than value. Same as setting to to the value, and include_upper + to false. + */ + lt(val: any): NumericRangeFilter; + + /* + Less than or equal to value. Same as setting to to the value, + and include_upper to true. + */ + lte(val: any): NumericRangeFilter; + + /* + Sets the filter name. + */ + name(name: string): NumericRangeFilter; + + /* + Sets the endpoint for the current range. + */ + to(endPoint: Number): NumericRangeFilter; + + /* + Returns the filter object. + */ + toJSON(): NumericRangeFilter; + + } + + + /* + A container filter that allows Boolean OR composition of filters. + */ + export class OrFilter implements Filter { + + /* + A container Filter that allows Boolean OR composition of filters. + */ + constructor(filters: Filter | Filter[]); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Enable or disable caching of the filter + */ + cache(trueFalse: boolean): OrFilter; + + /* + Sets the cache key. + */ + cacheKey(key: string): OrFilter; + + /* + Updates the filters. If passed a single Filter it is added to + the existing filters. If passed an array of Filters, they + replace all existing Filters. + */ + filters(fltr: Filter | Filter[]): OrFilter; + + /* + Sets the filter name. + */ + name(name: string): OrFilter; + + /* + Returns the filter object. + */ + toJSON(): OrFilter; + + } + + + /* + A multi-value metrics aggregation that calculates one or more percentiles + over numeric values extracted from the aggregated documents. These values can + be extracted either from specific numeric fields in the documents, or be + generated by a provided script. + */ + export class PercentilesAggregation implements Aggregation { + + /* + Aggregation that calculates one or more percentiles over numeric values + extracted from the aggregated documents. + */ + constructor(name: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Compression controls memory usage and approximation error. The compression + value limits the maximum number of nodes to 100 * compression. By + increasing the compression value, you can increase the accuracy of your + percentiles at the cost of more memory. Larger compression values also make + the algorithm slower since the underlying tree data structure grows in + size, resulting in more expensive operations. The default compression + value is 100. + */ + compression(c: number): PercentilesAggregation; + + /* + Sets the field to operate on. + */ + field(field: string): PercentilesAggregation; + + /* + Enable the response to be returned as a keyed object where the key is the + bucket interval. + */ + keyed(trueFalse: boolean): PercentilesAggregation; + + /* + The script language being used. + */ + lang(language: string): PercentilesAggregation; + + /* + Sets parameters that will be applied to the script. Overwrites + any existing params. + */ + params(p: Object): PercentilesAggregation; + + /* + Add a single percentile to the current list of percentiles. + */ + percent(percentile: number): PercentilesAggregation; + + /* + Sets the percentile bucket array. Overwrites all existing values. + */ + percents(percents: number[]): PercentilesAggregation; + + /* + Allows you generate or modify the terms/values using a script. + */ + script(scriptCode: string): PercentilesAggregation; + + /* + Set to true to assume script values are sorted. + */ + scriptValuesSorted(trueFalse: boolean): PercentilesAggregation; + + /* + Retrieves the internal agg object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + PhraseSuggester extends the PhraseSuggester and suggests + entire corrected phrases instead of individual tokens. The individual + phrase suggestions are weighted based on ngram-langugage models. In practice + it will be able to make better decision about which tokens to pick based on + co-occurence and frequencies. + */ + export class PhraseSuggester implements Suggest { + + /* + A suggester that suggests entire corrected phrases. + */ + constructor(name: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets analyzer used to analyze the suggest text. + */ + analyzer(analyzer: string): PhraseSuggester; + + /* + Sets the confidence level defines a factor applied to the input + phrases score which is used as a threshold for other suggest + candidates. Only candidates that score higher than the threshold + will be included in the result. + */ + confidence(c: number): PhraseSuggester; + + /* + Adds a direct generator. If passed a single Generator + it is added to the list of existing generators. If passed an + array of Generators, they replace all existing generators. + */ + directGenerator(oGenerator: Generator | Generator[]): PhraseSuggester; + + /* + Sets the field used to generate suggestions from. + */ + field(field: string): PhraseSuggester; + + /* + Forces the use of unigrams. + */ + forceUnigrams(trueFalse: boolean): PhraseSuggester; + + /* + Sets the max size of the n-grams (shingles) in the field. If + the field doesn't contain n-grams (shingles) this should be + omitted or set to 1. + */ + gramSize(s: number): PhraseSuggester; + + /* + Enables highlighting of suggestions + */ + highlight(preTag: string, postTag: string): PhraseSuggester; + + /* + A smoothing model that uses an additive smoothing model where a + constant (typically 1.0 or smaller) is added to all counts to + balance weights, The default alpha is 0.5. + */ + laplaceSmoothing(alpha: number): PhraseSuggester; + + /* + A smoothing model that takes the weighted mean of the unigrams, + bigrams and trigrams based on user supplied weights (lambdas). The + sum of tl, bl, and ul must equal 1. + */ + linearSmoothing(tl: number, bl: number, ul: number): PhraseSuggester; + + /* + Sets the maximum percentage of the terms that at most + considered to be misspellings in order to form a correction. + */ + maxErrors(c: number): PhraseSuggester; + + /* + Sets the likelihood of a term being a misspelled even if the + term exists in the dictionary. The default it 0.95 corresponding + to 5% or the real words are misspelled. + */ + realWordErrorLikelihood(l: number): PhraseSuggester; + + /* + Sets the separator that is used to separate terms in the bigram + field. If not set the whitespce character is used as a + separator. + */ + separator(sep: string): PhraseSuggester; + + /* + Sets the maximum number of suggestions to be retrieved from + each individual shard. + */ + shardSize(s: number): PhraseSuggester; + + /* + Sets the number of suggestions returned for each token. + */ + size(s: number): PhraseSuggester; + + /* + A simple backoff model that backs off to lower order n-gram + models if the higher order count is 0 and discounts the lower + order n-gram model by a constant factor. The default discount is + 0.4. + */ + stupidBackoffSmoothing(discount: number): PhraseSuggester; + + /* + Sets the text to get suggestions for. If not set, the global + suggestion text will be used. + */ + text(txt: string): PhraseSuggester; + + /* + Retrieves the internal suggest object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + /* + Sets the token limit. + */ + tokenLimit(l: number): PhraseSuggester; + + } + + + /* + Filters documents that have fields containing terms with a specified prefix (not analyzed). Similar + to phrase query, except that it acts as a filter. Can be placed within queries that accept a filter. + */ + export class PrefixFilter implements Filter { + + /* + Filters documents that have fields containing terms with a specified prefix. + */ + constructor(fieldName: string, prefix: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Enable or disable caching of the filter + */ + cache(trueFalse: boolean): PrefixFilter; + + /* + Sets the cache key. + */ + cacheKey(key: string): PrefixFilter; + + /* + Returns the field name used to create this object. + */ + field(field: string): PrefixFilter; + + /* + Sets the filter name. + */ + name(name: string): PrefixFilter; + + /* + Sets the prefix to search for. + */ + prefix(value: string): PrefixFilter; + + /* + Returns the filter object. + */ + toJSON(): PrefixFilter; + + } + + + /* + Matches documents that have fields containing terms with a specified + prefix (not analyzed). The prefix query maps to Lucene PrefixQuery. + */ + export class PrefixQuery implements Query { + + /* + Matches documents containing the specified un-analyzed prefix. + */ + constructor(field: string, value: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets the boost value of the Query. + */ + boost(boost: number): PrefixQuery; + + /* + The field to run the query against. + */ + field(f: string): PrefixQuery; + + /* + Sets rewrite method. Valid values are: + + constant_score_auto - tries to pick the best constant-score rewrite + method based on term and document counts from the query + + scoring_boolean - translates each term into boolean should and + keeps the scores as computed by the query + + constant_score_boolean - same as scoring_boolean, expect no scores + are computed. + + constant_score_filter - first creates a private Filter, by visiting + each term in sequence and marking all docs for that term + + top_terms_boost_N - first translates each term into boolean should + and scores are only computed as the boost using the top N + scoring terms. Replace N with an integer value. + + top_terms_N - first translates each term into boolean should + and keeps the scores as computed by the query. Only the top N + scoring terms are used. Replace N with an integer value. + + Default is constant_score_auto. + + This is an advanced option, use with care. + */ + rewrite(m: string): PrefixQuery; + + /* + Retrieves the internal query object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + /* + The prefix value. + */ + value(p: string): PrefixQuery; + + } + + + /* + The QueryFacet facet allows you to specify any valid Query and + have the number of matching hits returned as the value. + + Facets are similar to SQL GROUP BY statements but perform much + better. You can also construct several "groups" at once by simply + specifying multiple facets. + + + + Tip: + For more information on faceted navigation, see + this + Wikipedia article on Faceted Classification. + + + */ + export class QueryFacet implements Facet { + + /* + A facet that return a count of the hits matching the given query. + */ + constructor(name: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Enables caching of the facetFilter + */ + cacheFilter(trueFalse: boolean): QueryFacet; + + /* + Allows you to reduce the documents used for computing facet results. + */ + facetFilter(oFilter: Object): QueryFacet; + + /* + Computes values across the entire index + */ + global(trueFalse: boolean): QueryFacet; + + /* + Sets the mode the facet will use. + + + collector + post + + */ + mode(m: string): QueryFacet; + + /* + Sets the path to the nested document if faceting against a + nested field. + */ + nested(path: string): QueryFacet; + + /* + Sets the query to be used for this facet. + */ + query(oQuery: Object): QueryFacet; + + /* + Computes values across the the specified scope + */ + scope(scope: string): QueryFacet; + + /* + Retrieves the internal facet object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + Wraps any query to be used as a filter. Can be placed within queries + that accept a filter. + + The result of the filter is not cached by default. Set the cache + parameter to true to cache the result of the filter. This is handy when the + same query is used on several (many) other queries. + + Note, the process of caching the first execution is higher when not + caching (since it needs to satisfy different queries). + */ + export class QueryFilter implements Filter { + + /* + Filters documents matching the wrapped query. + */ + constructor(qry: Object); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Enable or disable caching of the filter + */ + cache(trueFalse: boolean): QueryFilter; + + /* + Sets the cache key. + */ + cacheKey(key: string): QueryFilter; + + /* + Sets the filter name. + */ + name(name: string): QueryFilter; + + /* + Sets the query + */ + query(q: Object): QueryFilter; + + /* + Returns the filter object. + */ + toJSON(): QueryFilter; + + } + + export class QueryMixin { + + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets the boost value for documents matching the Query. + */ + boost(boost: number): QueryMixin; + + /* + Retrieves the internal query object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + A query that is parsed using Lucene's default query parser. Although Lucene provides the + ability to create your own queries through its API, it also provides a rich query language + through the Query Parser, a lexer which interprets a string into a Lucene Query. + + See the Lucene Query Parser Syntax + for more information. + */ + export class QueryStringQuery implements Query { + + /* + A query that is parsed using Lucene's default query parser. + */ + constructor(qstr: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets whether or not wildcard characters (* and ?) are allowed as the + first character of the Query. Default: true. + */ + allowLeadingWildcard(trueFalse: boolean): QueryStringQuery; + + /* + Sets the analyzer name used to analyze the Query object. + */ + analyzer(analyzer: string): QueryStringQuery; + + /* + Sets whether or not we should attempt to analyzed wilcard terms in the + Query. By default, wildcard terms are not analyzed. + Analysis of wildcard characters is not perfect. Default: false. + */ + analyzeWildcard(trueFalse: boolean): QueryStringQuery; + + /* + Sets whether or not we should auto generate phrase queries *if* the + analyzer returns more than one term. Default: false. + */ + autoGeneratePhraseQueries(trueFalse: boolean): QueryStringQuery; + + /* + Sets the boost value for documents matching the Query. + */ + boost(boost: number): QueryStringQuery; + + /* + Sets the default field/property this query should execute against. + */ + defaultField(fieldName: string): QueryStringQuery; + + /* + Set the default Boolean operator. This operator is used to join individual query + terms when no operator is explicity used in the query string (i.e., this AND that). + Defaults to OR. + */ + defaultOperator(op: string): QueryStringQuery; + + /* + Sets whether or not position increments will be used in the + Query. Default: true. + */ + enablePositionIncrements(trueFalse: boolean): QueryStringQuery; + + /* + If they query string should be escaped or not. + */ + escape(trueFalse: boolean): QueryStringQuery; + + /* + A set of fields/properties this query should execute against. + Pass a single value to add to the existing list of fields and + pass an array to overwrite all existing fields. For each field, + you can apply a field specific boost by appending a ^boost to the + field name. For example, title^10, to give the title field a + boost of 10. + */ + fields(fieldNames: any[]): QueryStringQuery; + + /* + Sets the max number of term expansions for fuzzy queries. + */ + fuzzyMaxExpansions(max: number): QueryStringQuery; + + /* + Set the minimum similarity for fuzzy queries. Default: 0.5. + */ + fuzzyMinSim(minSim: number): QueryStringQuery; + + /* + Sets the prefix length for fuzzy queries. Default: 0. + */ + fuzzyPrefixLength(fuzzLen: number): QueryStringQuery; + + /* + Sets fuzzy rewrite method. Valid values are: + + constant_score_auto - tries to pick the best constant-score rewrite + method based on term and document counts from the query + + scoring_boolean - translates each term into boolean should and + keeps the scores as computed by the query + + constant_score_boolean - same as scoring_boolean, expect no scores + are computed. + + constant_score_filter - first creates a private Filter, by visiting + each term in sequence and marking all docs for that term + + top_terms_boost_N - first translates each term into boolean should + and scores are only computed as the boost using the top N + scoring terms. Replace N with an integer value. + + top_terms_N - first translates each term into boolean should + and keeps the scores as computed by the query. Only the top N + scoring terms are used. Replace N with an integer value. + + Default is constant_score_auto. + + This is an advanced option, use with care. + */ + fuzzyRewrite(m: string): QueryStringQuery; + + /* + Enables lenient parsing of the query string. + */ + lenient(trueFalse: boolean): QueryStringQuery; + + /* + Sets whether or not terms from wildcard, prefix, fuzzy, and + range queries should automatically be lowercased in the Query + since they are not analyzed. Default: true. + */ + lowercaseExpandedTerms(trueFalse: boolean): QueryStringQuery; + + /* + Sets a percent value controlling how many "should" clauses in the + resulting Query should match. + */ + minimumShouldMatch(minMatch: number): QueryStringQuery; + + /* + Sets the default slop for phrases. If zero, then exact phrase matches + are required. Default: 0. + */ + phraseSlop(slop: number): QueryStringQuery; + + /* + Sets the query string on this Query object. + */ + query(qstr: string): QueryStringQuery; + + /* + Sets the quote analyzer name used to analyze the query + when in quoted text. + */ + quoteAnalyzer(analyzer: string): QueryStringQuery; + + /* + Sets the suffix to automatically add to the field name when + performing a quoted search. + */ + quoteFieldSuffix(s: string): QueryStringQuery; + + /* + Sets rewrite method. Valid values are: + + constant_score_auto - tries to pick the best constant-score rewrite + method based on term and document counts from the query + + scoring_boolean - translates each term into boolean should and + keeps the scores as computed by the query + + constant_score_boolean - same as scoring_boolean, expect no scores + are computed. + + constant_score_filter - first creates a private Filter, by visiting + each term in sequence and marking all docs for that term + + top_terms_boost_N - first translates each term into boolean should + and scores are only computed as the boost using the top N + scoring terms. Replace N with an integer value. + + top_terms_N - first translates each term into boolean should + and keeps the scores as computed by the query. Only the top N + scoring terms are used. Replace N with an integer value. + + Default is constant_score_auto. + + This is an advanced option, use with care. + */ + rewrite(m: string): QueryStringQuery; + + /* + Sets the tie breaker value for a Query using + DisMax. The tie breaker capability allows results + that include the same term in multiple fields to be judged better than + results that include this term in only the best of those multiple + fields, without confusing this with the better case of two different + terms in the multiple fields. Default: 0.0. + */ + tieBreaker(tieBreaker: number): QueryStringQuery; + + /* + Retrieves the internal query object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + /* + Sets whether or not queries against multiple fields should be combined using Lucene's + + DisjunctionMaxQuery + */ + useDisMax(trueFalse: string): QueryStringQuery; + + } + + + /* + The random_score generates scores via a pseudo random number algorithm + that is initialized with a seed. + */ + export class RandomScoreFunction implements ScoreFunction { + + /* + Randomly score documents. + */ + constructor(); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Adds a filter whose matching documents will have the score function applied. + */ + filter(oFilter: Filter): RandomScoreFunction; + + /* + Sets random seed value. + */ + seed(s: number): RandomScoreFunction; + + /* + Retrieves the internal agg object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + A multi-bucket value source based aggregation that enables the user to + define a set of ranges - each representing a bucket. During the aggregation + process, the values extracted from each document will be checked against each + bucket range and "bucket" the relevant/matching document. + + Note that this aggregration includes the from value and excludes the to + value for each range. + */ + export class RangeAggregation implements Aggregation { + + /* + Aggregation that enables the user to define a set of ranges that each + represent a bucket. + */ + constructor(name: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Add a nested aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. Alias for the + aggregation method. + */ + agg(agg: Aggregation): RangeAggregation; + + /* + Add a nested aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. + */ + aggregation(agg: Aggregation): RangeAggregation; + + /* + Sets the field to gather terms from. + */ + field(field: string): RangeAggregation; + + /* + Enable the response to be returned as a keyed object where the key is the + bucket interval. + */ + keyed(trueFalse: boolean): RangeAggregation; + + /* + The script language being used. + */ + lang(language: string): RangeAggregation; + + /* + Sets parameters that will be applied to the script. Overwrites + any existing params. + */ + params(p: Object): RangeAggregation; + + /* + Adds a range to the list of exsiting range expressions. + */ + range(from: string, to: string, key: string): RangeAggregation; + + /* + Allows you generate or modify the terms using a script. + */ + script(scriptCode: string): RangeAggregation; + + /* + Set to true to assume script values are sorted. + */ + scriptValuesSorted(trueFalse: boolean): RangeAggregation; + + /* + Retrieves the internal agg object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + A RangeFacet allows you to specify a set of ranges and get both the number of docs (count) that + fall within each range, and aggregated data based on the field, or another specified field. + + Facets are similar to SQL GROUP BY statements but perform much + better. You can also construct several "groups" at once by simply + specifying multiple facets. + + + + Tip: + For more information on faceted navigation, see + this + Wikipedia article on Faceted Classification. + + + */ + export class RangeFacet implements Facet { + + /* + A facet which provides information over a range of numeric intervals. + */ + constructor(name: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Adds a new bounded range. + */ + addRange(from: Number, to: Number): RangeFacet; + + /* + Adds a new unbounded lower limit. + */ + addUnboundedFrom(from: Number): RangeFacet; + + /* + Adds a new unbounded upper limit. + */ + addUnboundedTo(to: Number): RangeFacet; + + /* + Enables caching of the facetFilter + */ + cacheFilter(trueFalse: boolean): RangeFacet; + + /* + Allows you to reduce the documents used for computing facet results. + */ + facetFilter(oFilter: Object): RangeFacet; + + /* + Sets the document field to be used for the facet. + */ + field(fieldName: string): RangeFacet; + + /* + Computes values across the entire index + */ + global(trueFalse: boolean): RangeFacet; + + /* + Allows you to specify an alternate key field to be used to compute the interval. + */ + keyField(fieldName: string): RangeFacet; + + /* + Allows you modify the key field using a script. The modified value + is then used to generate the interval. + */ + keyScript(scriptCode: string): RangeFacet; + + /* + The script language being used. Currently supported values are + javascript, groovy, and mvel. + */ + lang(language: string): RangeFacet; + + /* + Sets the mode the facet will use. + + + collector + post + + */ + mode(m: string): RangeFacet; + + /* + Sets the path to the nested document if faceting against a + nested field. + */ + nested(path: string): RangeFacet; + + /* + Sets parameters that will be applied to the script. Overwrites + any existing params. + */ + params(p: Object): RangeFacet; + + /* + Computes values across the the specified scope + */ + scope(scope: string): RangeFacet; + + /* + Retrieves the internal facet object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + /* + Allows you to specify an alternate value field to be used to compute statistical information. + */ + valueField(fieldName: string): RangeFacet; + + /* + Allows you modify the value field using a script. The modified value + is then used to compute the statistical data. + */ + valueScript(scriptCode: string): RangeFacet; + + } + + + /* + Matches documents with fields that have terms within a certain range. + */ + export class RangeFilter implements Filter { + + /* + Filters documents with fields that have terms within a certain range. + */ + constructor(field: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Enable or disable caching of the filter + */ + cache(trueFalse: boolean): RangeFilter; + + /* + Sets the cache key. + */ + cacheKey(key: string): RangeFilter; + + /* + The field to run the filter against. + */ + field(f: string): RangeFilter; + + /* + The lower bound. Defaults to start from the first. + */ + from(f: any): RangeFilter; + + /* + Greater than value. Same as setting from to the value, and + include_lower to false, + */ + gt(val: any): RangeFilter; + + /* + Greater than or equal to value. Same as setting from to the value, + and include_lower to true. + */ + gte(val: any): RangeFilter; + + /* + Should the first from (if set) be inclusive or not. + Defaults to true + */ + includeLower(trueFalse: boolean): RangeFilter; + + /* + Should the last to (if set) be inclusive or not. Defaults to true. + */ + includeUpper(trueFalse: boolean): RangeFilter; + + /* + Less than value. Same as setting to to the value, and include_upper + to false. + */ + lt(val: any): RangeFilter; + + /* + Less than or equal to value. Same as setting to to the value, + and include_upper to true. + */ + lte(val: any): RangeFilter; + + /* + Sets the filter name. + */ + name(name: string): RangeFilter; + + /* + The upper bound. Defaults to unbounded. + */ + to(t: any): RangeFilter; + + /* + Returns the filter object. + */ + toJSON(): RangeFilter; + + } + + + /* + Matches documents with fields that have terms within a certain range. + The type of the Lucene query depends on the field type, for string fields, + the TermRangeQuery, while for number/date fields, the query is a + NumericRangeQuery. + */ + export class RangeQuery implements Query { + + /* + Matches documents with fields that have terms within a certain range. + */ + constructor(field: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets the boost value of the Query. + */ + boost(boost: number): RangeQuery; + + /* + The field to run the query against. + */ + field(f: string): RangeQuery; + + /* + The lower bound. Defaults to start from the first. + */ + from(f: any): RangeQuery; + + /* + Greater than value. Same as setting from to the value, and + include_lower to false, + */ + gt(val: any): RangeQuery; + + /* + Greater than or equal to value. Same as setting from to the value, + and include_lower to true. + */ + gte(val: any): RangeQuery; + + /* + Should the first from (if set) be inclusive or not. + Defaults to true + */ + includeLower(trueFalse: boolean): RangeQuery; + + /* + Should the last to (if set) be inclusive or not. Defaults to true. + */ + includeUpper(trueFalse: boolean): RangeQuery; + + /* + Less than value. Same as setting to to the value, and include_upper + to false. + */ + lt(val: any): RangeQuery; + + /* + Less than or equal to value. Same as setting to to the value, + and include_upper to true. + */ + lte(val: any): RangeQuery; + + /* + The upper bound. Defaults to unbounded. + */ + to(t: any): RangeQuery; + + /* + Retrieves the internal query object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + Filters documents that have a field value matching a regular expression. + Based on Lucene 4.0 RegexpFilter which uses automaton to efficiently iterate + over index terms. + */ + export class RegexpFilter implements Filter { + + /* + Matches documents that have fields matching a regular expression. + */ + constructor(field: string, value: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Enable or disable caching of the filter + */ + cache(trueFalse: boolean): RegexpFilter; + + /* + Sets the cache key. + */ + cacheKey(key: string): RegexpFilter; + + /* + The field to run the filter against. + */ + field(f: string): RegexpFilter; + + /* + The regex flags to use. Valid flags are: + + INTERSECTION - Support for intersection notation + COMPLEMENT - Support for complement notation + EMPTY - Support for the empty language symbol: # + ANYSTRING - Support for the any string symbol: @ + INTERVAL - Support for numerical interval notation: + NONE - Disable support for all syntax options + ALL - Enables support for all syntax options + + Use multiple flags by separating with a "|" character. Example: + + INTERSECTION|COMPLEMENT|EMPTY + */ + flags(f: string): RegexpFilter; + + /* + The regex flags to use as a numeric value. Advanced use only, + it is probably better to stick with the flags option. + */ + flagsValue(v: string): RegexpFilter; + + /* + Sets the filter name. + */ + name(name: string): RegexpFilter; + + /* + Returns the filter object. + */ + toJSON(): RegexpFilter; + + /* + The regexp value. + */ + value(p: string): RegexpFilter; + + } + + + /* + Matches documents that have fields matching a regular expression. Based + on Lucene 4.0 RegexpQuery which uses automaton to efficiently iterate over + index terms. + */ + export class RegexpQuery implements Query { + + /* + Matches documents that have fields matching a regular expression. + */ + constructor(field: string, value: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets the boost value of the Query. + */ + boost(boost: number): RegexpQuery; + + /* + The field to run the query against. + */ + field(f: string): RegexpQuery; + + /* + The regex flags to use. Valid flags are: + + INTERSECTION - Support for intersection notation + COMPLEMENT - Support for complement notation + EMPTY - Support for the empty language symbol: # + ANYSTRING - Support for the any string symbol: @ + INTERVAL - Support for numerical interval notation: + NONE - Disable support for all syntax options + ALL - Enables support for all syntax options + + Use multiple flags by separating with a "|" character. Example: + + INTERSECTION|COMPLEMENT|EMPTY + */ + flags(f: string): RegexpQuery; + + /* + The regex flags to use as a numeric value. Advanced use only, + it is probably better to stick with the flags option. + */ + flagsValue(v: string): RegexpQuery; + + /* + Sets rewrite method. Valid values are: + + constant_score_auto - tries to pick the best constant-score rewrite + method based on term and document counts from the query + + scoring_boolean - translates each term into boolean should and + keeps the scores as computed by the query + + constant_score_boolean - same as scoring_boolean, expect no scores + are computed. + + constant_score_filter - first creates a private Filter, by visiting + each term in sequence and marking all docs for that term + + top_terms_boost_N - first translates each term into boolean should + and scores are only computed as the boost using the top N + scoring terms. Replace N with an integer value. + + top_terms_N - first translates each term into boolean should + and keeps the scores as computed by the query. Only the top N + scoring terms are used. Replace N with an integer value. + + Default is constant_score_auto. + + This is an advanced option, use with care. + */ + rewrite(m: string): RegexpQuery; + + /* + Retrieves the internal query object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + /* + The regexp value. + */ + value(p: string): RegexpQuery; + + } + + + /* + The Request object provides methods generating an elasticsearch request body. + */ + export class Request { + + /* + Provides methods for generating request bodies. + */ + constructor(conf: Object); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Add an aggregation. This method can be called multiple times + in order to set multiple nested aggregations that will be executed + at the same time as the search request. Alias for the aggregation method. + */ + agg(agg: Aggregation): Request; + + /* + Add an aggregation. This method can be called multiple times + in order to set multiple nested aggregations that will be executed + at the same time as the search request. + */ + aggregation(agg: Aggregation): Request; + + /* + Enable/Disable explanation of score for each search result. + */ + explain(trueFalse: boolean): Request; + + /* + Allows you to set the specified facet on this request object. Multiple facets can + be set, all of which will be returned when the search is executed. + */ + facet(facet: Facet): Request; + + /* + By default, searches return full documents, meaning every property or field. + This method allows you to specify which fields you want returned. + + Pass a single field name and it is appended to the current list of + fields. Pass an array of fields and it replaces all existing + fields. + */ + fields(s: string | string[]): Request; + + /* + Allows you to set a specified filter on this request object. + */ + filter(filter: Object): Request; + + /* + A search result set could be very large (think Google). Setting the + from parameter allows you to page through the result set + by making multiple request. This parameters specifies the starting + result/document number point. Combine with size() to achieve paging. + */ + from(f: any[]): Request; + + /* + Performs highlighting based on the Highlight + settings. + */ + highlight(h: Highlight): Request; + + /* + Boosts hits in the specified index by the given boost value. + */ + indexBoost(index: string, boost: number): Request; + + /* + Filters out search results will scores less than the specified minimum score. + */ + minScore(min: number): Request; + + /* + Allows you to set the specified query on this search object. This is the + query that will be used when the search is executed. + */ + query(someQuery: Query): Request; + + /* + Once a query executes, you can use rescore to run a secondary, more + expensive query to re-order the results. + */ + rescore(r: Rescore): Request; + + /* + Computes a document property dynamically based on the supplied ScriptField. + */ + scriptField(oScriptField: ScriptField): Request; + + /* + Sets the number of results/documents to be returned. This is set on a per page basis. + */ + size(s: number): Request; + + /* + Sets the sorting for the query. This accepts many input formats. + + + sort() - The current sorting values are returned. + sort(fieldName) - Adds the field to the current list of sorting values. + sort(fieldName, order) - Adds the field to the current list of + sorting with the specified order. Order must be asc or desc. + sort(ejs.Sort) - Adds the Sort value to the current list of sorting values. + sort(array) - Replaces all current sorting values with values + from the array. The array must contain only strings and Sort objects. + + + Multi-level sorting is supported so the order in which sort fields + are added to the query requests is relevant. + + It is recommended to use Sort objects when possible. + */ + sort(fieldName: string): Request; + + /* + Allows to control how the _source field is returned with every hit. + By default operations return the contents of the _source field + unless you have used the fields parameter or if the _source field + is disabled. Set the includes parameter to false to completely + disable returning the source field. + */ + source(includes: string | boolean | string[], excludes: string | string[]): Request; + + /* + Allows you to set the specified suggester on this request object. + Multiple suggesters can be set, all of which will be returned when + the search is executed. Global suggestion text can be set by + passing in a string vs. a Suggest object. + */ + suggest(s: string | Suggest): Request; + + /* + A timeout, bounding the request to be executed within the + specified time value and bail when expired. Defaults to no timeout. + + This option is valid during the following operations: + search and delete by query + */ + timeout(t: number): Request; + + /* + Retrieves the internal query object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + /* + Enables score computation and tracking during sorting. Be default, + when sorting scores are not computed. + */ + trackScores(trueFalse: boolean): Request; + + /* + Enable/Disable returning version number for each search result. + */ + version(trueFalse: boolean): Request; + + } + + + /* + A method that allows to rescore queries with a typically more expensive. + */ + export class Rescore { + + /* + Defines an operation that rescores a query with another query. + */ + //constructor(windowSize: Number, windowSize: Query); + constructor(windowSize: Number); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets the weight assigned to the original query of the rescoring. + */ + queryWeight(weight: Number): Rescore; + + /* + Sets the query used by the rescoring. + */ + rescoreQuery(someQuery: Query): Rescore; + + /* + Sets the weight assigned to the query used to rescore the original query. + */ + rescoreQueryWeight(weight: Number): Rescore; + + /* + Sets the scoring mode. Valid values are: + + total - default mode, the scores combined + multiply - the scores multiplied + min - the lowest of the scores + max - the highest score + avg - the average of the scores + */ + scoreMode(s: string): Rescore; + + /* + Retrieves the internal script object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + /* + Sets the window_size parameter of the rescoring. + */ + windowSize(size: Number): Rescore; + + } + + export class ScoreFunctionMixin implements ScoreFunction { + + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Adds a filter whose matching documents will have the score function applied. + */ + filter(oFilter: Filter): ScoreFunctionMixin; + + /* + Retrieves the internal agg object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + ScriptField's allow you create dynamic fields on stored documents at query + time. For example, you might have a set of document thats containsthe fields + price and quantity. At query time, you could define a computed + property that dynamically creates a new field called totalin each document + based on the calculation price * quantity. + */ + export class ScriptField { + + /* + Computes dynamic document properties based on information from other fields. + */ + constructor(fieldName: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + If execeptions thrown from the script should be ignored or not. + Default: false + */ + ignoreFailure(trueFalse: boolean): ScriptField; + + /* + The script language being used. Currently supported values are + javascript and mvel. + */ + lang(language: string): ScriptField; + + /* + Allows you to set script parameters to be used during the execution of the script. + */ + params(oParams: Object): ScriptField; + + /* + Sets the script/code that will be used to perform the calculation. + */ + script(expression: string): ScriptField; + + /* + Retrieves the internal script object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + A filter allowing to define scripts as filters + */ + export class ScriptFilter implements Filter { + + /* + A filter allowing to define scripts as filters. + */ + constructor(script: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Enable or disable caching of the filter + */ + cache(trueFalse: boolean): ScriptFilter; + + /* + Sets the cache key. + */ + cacheKey(key: string): ScriptFilter; + + /* + Sets the script language. + */ + lang(lang: string): ScriptFilter; + + /* + Sets the filter name. + */ + name(name: string): ScriptFilter; + + /* + Sets parameters that will be applied to the script. Overwrites + any existing params. + */ + params(p: Object): ScriptFilter; + + /* + Sets the script. + */ + script(s: string): ScriptFilter; + + /* + Returns the filter object. + */ + toJSON(): ScriptFilter; + + } + + + /* + The script_score function allows you to wrap another query and customize + the scoring of it optionally with a computation derived from other numeric + field values in the doc using a script expression. + */ + export class ScriptScoreFunction implements ScoreFunction { + + /* + Modify a documents score using a script. + */ + constructor(); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Adds a filter whose matching documents will have the score function applied. + */ + filter(oFilter: Filter): ScriptScoreFunction; + + /* + The script language being used. + */ + lang(language: string): ScriptScoreFunction; + + /* + Sets parameters that will be applied to the script. Overwrites + any existing params. + */ + params(p: Object): ScriptScoreFunction; + + /* + Set the script that will modify the score. + */ + script(scriptCode: string): ScriptScoreFunction; + + /* + Retrieves the internal agg object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + A Shape object that can be used in queries and filters that + take a Shape. Shape uses the GeoJSON format. + + See http://www.geojson.org/ + */ + export class Shape implements Geo { + + /* + Defines a shape + */ + constructor(type: string, coords: any[]); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets the coordinates for the shape definition. Note, the coordinates + are not validated in this api. Please see GeoJSON and ElasticSearch + documentation for correct coordinate definitions. + */ + coordinates(c: any[]): Shape; + + /* + Sets the radius for parsing a circle Shape. + */ + radius(r: string): Shape; + + /* + Retrieves the internal script object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + /* + Sets the shape type. Can be set to one of: point, linestring, polygon, + multipoint, envelope, or multipolygon. + */ + type(t: string): Shape; + + } + + + /* + An aggregation that returns interesting or unusual occurrences of terms in + a set. + */ + export class SignificantTermsAggregation implements Aggregation { + + /* + An aggregation that returns interesting or unusual occurrences of terms in + a set. + */ + constructor(name: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Add a nested aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. Alias for the + aggregation method. + */ + agg(agg: Aggregation): SignificantTermsAggregation; + + /* + Add a nested aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. + */ + aggregation(agg: Aggregation): SignificantTermsAggregation; + + /* + Allows you to filter out unwanted facet entries using a regular + expression. You can also optionally pass in a set of flags to apply + to the regular expression. Valid flags are: CASE_INSENSITIVE, + MULTILINE, DOTALL, UNICODE_CASE, CANON_EQ, UNIX_LINES, LITERAL, + COMMENTS, and UNICODE_CHAR_CLASS. Separate multiple flags with a | + character. + */ + exclude(exclude: string, flags: string): SignificantTermsAggregation; + + /* + Sets the execution hint determines how the aggregation is computed. + Supported values are: map and ordinals. + */ + executionHint(h: string): SignificantTermsAggregation; + + /* + Sets the field to gather terms from. + */ + field(field: string): SignificantTermsAggregation; + + /* + Sets the format expression for the terms. Use for number or date + formatting. + */ + format(f: string): SignificantTermsAggregation; + + /* + Allows you to allow only specific entries using a regular + expression. You can also optionally pass in a set of flags to apply + to the regular expression. Valid flags are: CASE_INSENSITIVE, + MULTILINE, DOTALL, UNICODE_CASE, CANON_EQ, UNIX_LINES, LITERAL, + COMMENTS, and UNICODE_CHAR_CLASS. Separate multiple flags with a | + character. + */ + include(include: string, flags: string): SignificantTermsAggregation; + + /* + Only return terms that match more than a configured number of hits. + */ + minDocCount(num: number): SignificantTermsAggregation; + + /* + Determines how many terms the coordinating node will request from + each shard. + */ + shardSize(shardSize: number): SignificantTermsAggregation; + + /* + Sets the number of aggregation entries that will be returned. + */ + size(size: number): SignificantTermsAggregation; + + /* + Retrieves the internal agg object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + A Sort object that can be used in on the Request object to specify + various types of sorting. + + See http://www.elasticsearch.org/guide/reference/api/search/sort.html + */ + export class Sort { + + /* + Defines a sort value + */ + constructor(fieldName: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets the sort order to ascending (asc). Same as calling + order('asc'). + */ + asc(): Sort; + + /* + Sets the sort order to descending (desc). Same as calling + order('desc'). + */ + desc(): Sort; + + /* + How to compute the distance. Can either be arc (better precision) + or plane (faster). Defaults to arc. + + Valid during sort types: geo distance + */ + distanceType(type: string): Sort; + + /* + Set's the field to sort on + */ + field(f: string): Sort; + + /* + Enables sorting based on a distance from a GeoPoint + */ + geoDistance(point: GeoPoint): Sort; + + /* + Sets if the sort should ignore unmapped fields vs throwing an error. + + Valid during sort types: field + */ + ignoreUnmapped(trueFalse: boolean): Sort; + + /* + Sets the script language. + + Valid during sort types: script + */ + lang(lang: string): Sort; + + /* + Sets the value to use for missing fields. Valid values are: + + _last - to put documents with the field missing last + _first - to put documents with the field missing first + {String} - any string value to use as the sort value. + + Valid during sort types: field + */ + missing(m: string): Sort; + + /* + Sets the sort mode. Valid values are: + + + min - sort by lowest value + max - sort by highest value + sum - sort by the sum of all values + avg - sort by the average of all values + + + Valid during sort types: field, geo distance + */ + mode(m: string): Sort; + + /* + Allows you to set a filter that nested objects must match + in order to be considered during sorting. + + Valid during sort types: field, geo distance + */ + nestedFilter(oFilter: Object): Sort; + + /* + Sets the path of the nested object. + + Valid during sort types: field, geo distance + */ + nestedPath(path: string): Sort; + + /* + If the lat/long points should be normalized to lie within their + respective normalized ranges. + + Normalized ranges are: + lon = -180 (exclusive) to 180 (inclusive) range + lat = -90 to 90 (both inclusive) range + + Valid during sort types: geo distance + */ + normalize(trueFalse: string): Sort; + + /* + Sets the sort order. Valid values are: + + asc - for ascending order + desc - for descending order + + Valid during sort types: field, geo distance, and script + */ + order(o: string): Sort; + + /* + Sets parameters that will be applied to the script. Overwrites + any existing params. + + Valid during sort types: script + */ + params(p: Object): Sort; + + /* + Sets the order with a boolean value. + + true = descending sort order + false = ascending sort order + + Valid during sort types: field, geo distance, and script + */ + reverse(trueFalse: boolean): Sort; + + /* + Enables sorting based on a script. + */ + script(scriptCode: string): Sort; + + /* + Retrieves the internal script object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + /* + Sets the script sort type. Valid values are: + + + string - script return value is sorted as a string + number - script return value is sorted as a number + + + Valid during sort types: script + */ + type(type: string): Sort; + + /* + Sets the distance unit. Valid values are "mi" for miles or "km" + for kilometers. Defaults to "km". + + Valid during sort types: geo distance + */ + unit(unit: Number): Sort; + + } + + + /* + Matches spans near the beginning of a field. The spanFirstQuery allows you to search + for Spans that start and end within the first n positions of the document. + The span first query maps to Lucene SpanFirstQuery. + */ + export class SpanFirstQuery implements Query { + + /* + Matches spans near the beginning of a field. + */ + constructor(spanQry: Query, end: number); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets the boost value for documents matching the Query. + */ + boost(boost: number): SpanFirstQuery; + + /* + Sets the maximum end position permitted in a match. + */ + end(position: Number): SpanFirstQuery; + + /* + Sets the span query to match on. + */ + match(spanQuery: Object): SpanFirstQuery; + + /* + Retrieves the internal query object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + Wraps lucene MultiTermQueries as a SpanQuery so it can be used in the + various Span* queries. Examples of valid MultiTermQueries are + Fuzzy, NumericRange, Prefix, Regex, Range, and Wildcard. + */ + export class SpanMultiTermQuery implements Query { + + /* + Use MultiTermQueries as a SpanQuery. + */ + constructor(qry: Query); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets the boost value for documents matching the Query. + */ + boost(boost: number): SpanMultiTermQuery; + + /* + Sets the span query to match on. + */ + match(mtQuery: Object): SpanMultiTermQuery; + + /* + Retrieves the internal query object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + A spanNearQuery will look to find a number of spanQuerys within a given + distance from each other. + */ + export class SpanNearQuery implements Query { + + /* + Matches spans which are near one another. + */ + constructor(clauses: Query | Query[], slop: number); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets the boost value for documents matching the Query. + */ + boost(boost: number): SpanNearQuery; + + /* + Sets the clauses used. If passed a single SpanQuery, it is added + to the existing list of clauses. If passed an array of + SpanQueries, they replace any existing clauses. + */ + clauses(clauses: Query | Query[]): SpanNearQuery; + + /* + Sets whether or not payloads are being used. A payload is an arbitrary + byte array stored at a specific position (i.e. token/term). + */ + collectPayloads(trueFalse: boolean): SpanNearQuery; + + /* + Sets whether or not matches are required to be in-order. + */ + inOrder(trueFalse: boolean): SpanNearQuery; + + /* + Sets the maximum number of intervening unmatched positions. + */ + slop(distance: Number): SpanNearQuery; + + /* + Retrieves the internal query object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + Removes matches which overlap with another span query. + The span not query maps to Lucene SpanNotQuery. + */ + export class SpanNotQuery implements Query { + + /* + Removes matches which overlap with another span query. + */ + constructor(includeQry: Query, excludeQry: Query); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets the boost value for documents matching the Query. + */ + boost(boost: number): SpanNotQuery; + + /* + Sets the span query whose matches must not overlap those returned. + */ + exclude(spanQuery: Object): SpanNotQuery; + + /* + Set the span query whose matches are filtered. + */ + include(spanQuery: Object): SpanNotQuery; + + /* + Retrieves the internal query object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + The spanOrQuery takes an array of SpanQuerys and will match if any of the + underlying SpanQueries match. The span or query maps to Lucene SpanOrQuery. + */ + export class SpanOrQuery implements Query { + + /* + Matches the union of its span clauses. + */ + constructor(clauses: Object); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets the boost value for documents matching the Query. + */ + boost(boost: number): SpanOrQuery; + + /* + Sets the clauses used. If passed a single SpanQuery, it is added + to the existing list of clauses. If passed an array of + SpanQueries, they replace any existing clauses. + */ + clauses(clauses: Query | Query[]): SpanOrQuery; + + /* + Retrieves the internal query object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + A spanTermQuery is the basic unit of Lucene's Span Query which allows for nested, + positional restrictions when matching documents. The spanTermQuery simply matches + spans containing a term. It's essentially a termQuery with positional information asscoaited. + */ + export class SpanTermQuery implements Query { + + /* + Matches spans containing a term + */ + constructor(field: string, value: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets the boost value for documents matching the Query. + */ + boost(boost: number): SpanTermQuery; + + /* + Sets the field to query against. + */ + field(f: string): SpanTermQuery; + + /* + Sets the term. + */ + term(t: string): SpanTermQuery; + + /* + Retrieves the internal query object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + A statistical facet allows you to compute statistical data over a numeric fields. Statistical data includes + the count, total, sum of squares, mean (average), minimum, maximum, variance, and standard deviation. + + Facets are similar to SQL GROUP BY statements but perform much + better. You can also construct several "groups" at once by simply + specifying multiple facets. + + + + Tip: + For more information on faceted navigation, see + this + Wikipedia article on Faceted Classification. + + + */ + export class StatisticalFacet implements Facet { + + /* + A facet which returns statistical information about a numeric field + */ + constructor(name: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Enables caching of the facetFilter + */ + cacheFilter(trueFalse: boolean): StatisticalFacet; + + /* + Allows you to reduce the documents used for computing facet results. + */ + facetFilter(oFilter: Object): StatisticalFacet; + + /* + Sets the field to be used to construct the this facet. + */ + field(fieldName: string): StatisticalFacet; + + /* + Aggregate statistical info across a set of fields. + */ + fields(aFieldName: any[]): StatisticalFacet; + + /* + Computes values across the entire index + */ + global(trueFalse: boolean): StatisticalFacet; + + /* + The script language being used. Currently supported values are + javascript, groovy, and mvel. + */ + lang(language: string): StatisticalFacet; + + /* + Sets the mode the facet will use. + + + collector + post + + */ + mode(m: string): StatisticalFacet; + + /* + Sets the path to the nested document if faceting against a + nested field. + */ + nested(path: string): StatisticalFacet; + + /* + Allows you to set script parameters to be used during the execution of the script. + */ + params(oParams: Object): StatisticalFacet; + + /* + Computes values across the the specified scope + */ + scope(scope: string): StatisticalFacet; + + /* + Define a script to evaluate of which the result will be used to generate + the statistical information. + */ + script(code: string): StatisticalFacet; + + /* + Retrieves the internal facet object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + A multi-value metrics aggregation that computes stats over numeric values + extracted from the aggregated documents. These values can be extracted either + from specific numeric fields in the documents, or be generated by a provided + script. + + The stats that are returned consist of: min, max, sum, count and avg. + */ + export class StatsAggregation implements Aggregation { + + /* + Aggregation that computes stats over numeric values extracted from the + aggregated documents. + */ + constructor(name: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets the field to operate on. + */ + field(field: string): StatsAggregation; + + /* + The script language being used. + */ + lang(language: string): StatsAggregation; + + /* + Sets parameters that will be applied to the script. Overwrites + any existing params. + */ + params(p: Object): StatsAggregation; + + /* + Allows you generate or modify the terms/values using a script. + */ + script(scriptCode: string): StatsAggregation; + + /* + Set to true to assume script values are sorted. + */ + scriptValuesSorted(trueFalse: boolean): StatsAggregation; + + /* + Retrieves the internal agg object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + export class SuggestContextMixin { + + + /* + Sets analyzer used to analyze the suggest text. + */ + analyzer(analyzer: string): SuggestContextMixin; + + /* + Sets the field used to generate suggestions from. + */ + field(field: string): SuggestContextMixin; + + /* + Sets the maximum number of suggestions to be retrieved from + each individual shard. + */ + shardSize(s: number): SuggestContextMixin; + + /* + Sets the number of suggestions returned for each token. + */ + size(s: number): SuggestContextMixin; + + } + + export class SuggesterMixin { + + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets the text to get suggestions for. If not set, the global + suggestion text will be used. + */ + text(txt: string): SuggesterMixin; + + /* + Retrieves the internal suggest object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + A single-value metrics aggregation that sums up numeric values that are + extracted from the aggregated documents. These values can be extracted either + from specific numeric fields in the documents, or be generated by a + provided script. + */ + export class SumAggregation implements Aggregation { + + /* + Aggregation that sums up numeric values that are extracted from the + aggregated documents. + */ + constructor(name: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets the field to operate on. + */ + field(field: string): SumAggregation; + + /* + The script language being used. + */ + lang(language: string): SumAggregation; + + /* + Sets parameters that will be applied to the script. Overwrites + any existing params. + */ + params(p: Object): SumAggregation; + + /* + Allows you generate or modify the terms/values using a script. + */ + script(scriptCode: string): SumAggregation; + + /* + Set to true to assume script values are sorted. + */ + scriptValuesSorted(trueFalse: boolean): SumAggregation; + + /* + Retrieves the internal agg object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + Constructs a filter for docs matching any of the terms added to this + object. Unlike a RangeFilter this can be used for filtering on multiple + terms that are not necessarily in a sequence. + */ + export class TermFilter implements Filter { + + /* + Constructs a filter for docs matching the term added to this object. + */ + constructor(fieldName: string, term: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Enable or disable caching of the filter + */ + cache(trueFalse: boolean): TermFilter; + + /* + Sets the cache key. + */ + cacheKey(key: string): TermFilter; + + /* + Provides access to the filter fieldName used to construct the + termFilter object. + */ + field(f: string): TermFilter; + + /* + Sets the filter name. + */ + name(name: string): TermFilter; + + /* + Provides access to the filter term used to construct the + termFilter object. + */ + term(): TermFilter; + + /* + Returns the filter object. + */ + toJSON(): TermFilter; + + } + + + /* + A TermQuery can be used to return documents containing a given + keyword or term. For instance, you might want to retieve all the + documents/objects that contain the term Javascript. Term filters + often serve as the basis for more complex queries such as Boolean queries. + */ + export class TermQuery implements Query { + + /* + A Query that matches documents containing a term. This may be + combined with other terms with a BooleanQuery. + */ + constructor(field: string, term: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets the boost value for documents matching the Query. + */ + boost(boost: Number): TermQuery; + + /* + Sets the fields to query against. + */ + field(f: string): TermQuery; + + /* + Sets the term. + */ + term(t: string): TermQuery; + + /* + Retrieves the internal query object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + A multi-bucket value source based aggregation where buckets are dynamically + built - one per unique value. + */ + export class TermsAggregation implements Aggregation { + + /* + Defines an aggregation of unique values/terms. + */ + constructor(name: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Add a nested aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. Alias for the + aggregation method. + */ + agg(agg: Aggregation): TermsAggregation; + + /* + Add a nested aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. + */ + aggregation(agg: Aggregation): TermsAggregation; + + /* + Allows you to filter out unwanted facet entries using a regular + expression. You can also optionally pass in a set of flags to apply + to the regular expression. Valid flags are: CASE_INSENSITIVE, + MULTILINE, DOTALL, UNICODE_CASE, CANON_EQ, UNIX_LINES, LITERAL, + COMMENTS, and UNICODE_CHAR_CLASS. Separate multiple flags with a | + character. + */ + exclude(exclude: string, flags: string): TermsAggregation; + + /* + Sets the execution hint determines how the aggregation is computed. + Supported values are: map and ordinals. + */ + executionHint(h: string): TermsAggregation; + + /* + Sets the field to gather terms from. + */ + field(field: string): TermsAggregation; + + /* + Sets the format expression for the terms. Use for number or date + formatting + */ + format(f: string): TermsAggregation; + + /* + Allows you to allow only specific entries using a regular + expression. You can also optionally pass in a set of flags to apply + to the regular expression. Valid flags are: CASE_INSENSITIVE, + MULTILINE, DOTALL, UNICODE_CASE, CANON_EQ, UNIX_LINES, LITERAL, + COMMENTS, and UNICODE_CHAR_CLASS. Separate multiple flags with a | + character. + */ + include(include: string, flags: string): TermsAggregation; + + /* + The script language being used. + */ + lang(language: string): TermsAggregation; + + /* + Only return terms that match more than a configured number of hits. + */ + minDocCount(num: number): TermsAggregation; + + /* + Sets order for the aggregated values. + */ + order(order: string, direction: string): TermsAggregation; + + /* + Sets parameters that will be applied to the script. Overwrites + any existing params. + */ + params(p: Object): TermsAggregation; + + /* + Allows you generate or modify the terms using a script. + */ + script(scriptCode: string): TermsAggregation; + + /* + Set to true to assume script values are unique. + */ + scriptValuesUnique(trueFalse: boolean): TermsAggregation; + + /* + Determines how many terms the coordinating node will request from + each shard. + */ + shardSize(shardSize: number): TermsAggregation; + + /* + Sets the number of aggregation entries that will be returned. + */ + size(size: number): TermsAggregation; + + /* + Retrieves the internal agg object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + /* + Sets the type of the field value for use in scripts. Current values are: + string, double, float, long, integer, short, and byte. + */ + valueType(v: string): TermsAggregation; + + } + + + /* + A facet which returns the N most frequent terms within a collection + or set of collections. Term facets are useful for building constructs + which allow users to refine search results by filtering on terms returned + by the facet. + + Facets are similar to SQL GROUP BY statements but perform much + better. You can also construct several "groups" at once by simply + specifying multiple facets. + + For more information on faceted navigation, see this Wikipedia article on + Faceted Classification + */ + export class TermsFacet implements Facet { + + /* + A facet which returns the N most frequent terms within a collection + or set of collections. + */ + constructor(name: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Allows you to return all terms, even if the frequency count is 0. This should not be + used on fields that contain a large number of unique terms because it could cause + out-of-memory errors. + */ + allTerms(trueFalse: string): TermsFacet; + + /* + Enables caching of the facetFilter + */ + cacheFilter(trueFalse: boolean): TermsFacet; + + /* + Allows you to filter out unwanted facet entries. When passed + a single term, it is appended to the list of currently excluded + terms. If passed an array, it overwrites all existing values. + */ + exclude(exclude: string | string[]): TermsFacet; + + /* + Sets the execution hint determines how the facet is computed. + Currently only supported value is "map". + */ + executionHint(h: Object): TermsFacet; + + /* + Allows you to reduce the documents used for computing facet results. + */ + facetFilter(oFilter: Object): TermsFacet; + + /* + Sets the field to be used to construct the this facet. Set to + _index to return a facet count of hits per _index the search was + executed on. + */ + field(fieldName: string): TermsFacet; + + /* + Aggregate statistical info across a set of fields. + */ + fields(aFieldName: any[]): TermsFacet; + + /* + Computes values across the entire index + */ + global(trueFalse: boolean): TermsFacet; + + /* + The script language being used. Currently supported values are + javascript, groovy, and mvel. + */ + lang(language: string): TermsFacet; + + /* + Sets the mode the facet will use. + + + collector + post + + */ + mode(m: string): TermsFacet; + + /* + Sets the path to the nested document if faceting against a + nested field. + */ + nested(path: string): TermsFacet; + + /* + Sets the type of ordering that will be performed on the date + buckets. Valid values are: + + count - default, sort by the number of items in the bucket + term - sort by term value. + reverse_count - reverse sort of the number of items in the bucket + reverse_term - reverse sort of the term value. + */ + order(o: string): TermsFacet; + + /* + Sets parameters that will be applied to the script. Overwrites + any existing params. + */ + params(p: Object): TermsFacet; + + /* + Allows you to only include facet entries matching a specified regular expression. + */ + regex(exp: string): TermsFacet; + + /* + Allows you to set the regular expression flags to be used + with the regex + */ + regexFlags(flags: string): TermsFacet; + + /* + Computes values across the the specified scope + */ + scope(scope: string): TermsFacet; + + /* + Allows you modify the term using a script. The modified value + is then used in the facet collection. + */ + script(scriptCode: string): TermsFacet; + + /* + Sets a script that will provide the terms for a given document. + */ + scriptField(script: string): TermsFacet; + + /* + Determines how many terms the coordinating node will request from + each shard. + */ + shardSize(shardSize: number): TermsFacet; + + /* + Sets the number of facet entries that will be returned for this facet. For instance, you + might ask for only the top 5 authors although there might be hundreds of + unique authors. + */ + size(facetSize: number): TermsFacet; + + /* + Retrieves the internal facet object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + Filters documents that have fields that match any of the provided + terms (not analyzed) + */ + export class TermsFilter implements Filter { + + /* + A Filter that matches documents containing provided terms. + */ + constructor(field: string, terms: string | string[]); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Enable or disable caching of the filter + */ + cache(trueFalse: boolean): TermsFilter; + + /* + Sets the cache key. + */ + cacheKey(key: string): TermsFilter; + + /* + Enable or disable caching of the lookup + */ + cacheLookup(trueFalse: boolean): TermsFilter; + + /* + Sets the way terms filter executes is by iterating over the terms + provided and finding matches docs (loading into a bitset) and + caching it. Valid values are: plain, bool, bool_nocache, and, + and_nocache, or, or_nocache. Defaults to plain. + */ + execution(e: string): TermsFilter; + + /* + Sets the fields to filter against. + */ + field(f: string): TermsFilter; + + /* + Sets the document id of the document containing the terms to use + when performing a terms lookup. + */ + id(id: string): TermsFilter; + + /* + Sets the index the document containing the terms is in when + performing a terms lookup. Defaults to the index currently + being searched. + */ + index(idx: string): TermsFilter; + + /* + Sets the filter name. + */ + name(name: string): TermsFilter; + + /* + Sets the path/field name where the terms in the source document + are located when performing a terms lookup. + */ + path(path: string): TermsFilter; + + /* + Sets the routing value for the source document when performing a + terms lookup. + */ + routing(path: string): TermsFilter; + + /* + Sets the terms. If t is a String, it is added to the existing + list of terms. If t is an array, the list of terms replaces the + existing terms. + */ + terms(t: string | string[]): TermsFilter; + + /* + Returns the filter object. + */ + toJSON(): TermsFilter; + + /* + Sets the type the document containing the terms when performing a + terms lookup. + */ + type(type: string): TermsFilter; + + } + + + /* + A query that match on any (configurable) of the provided terms. This is + a simpler syntax query for using a bool query with several term queries + in the should clauses. + */ + export class TermsQuery implements Query { + + /* + A Query that matches documents containing provided terms. + */ + constructor(field: string, terms: string | string[]); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets the boost value for documents matching the Query. + */ + boost(boost: number): TermsQuery; + + /* + Enables or disables similarity coordinate scoring of documents + matching the Query. Default: false. + */ + disableCoord(trueFalse: string): TermsQuery; + + /* + Sets the fields to query against. + */ + field(f: string): TermsQuery; + + /* + Sets the minimum number of terms that need to match in a document + before that document is returned in the results. + */ + minimumShouldMatch(min: number): TermsQuery; + + /* + Sets the terms. If you t is a String, it is added to the existing + list of terms. If t is an array, the list of terms replaces the + existing terms. + */ + terms(t: string | string[]): TermsQuery; + + /* + Retrieves the internal query object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + A termsStatsFacet allows you to compute statistics over an aggregate key (term). Essentially this + facet provides the functionality of what is often refered to as a pivot table. + + Facets are similar to SQL GROUP BY statements but perform much + better. You can also construct several "groups" at once by simply + specifying multiple facets. + + + + Tip: + For more information on faceted navigation, see + this + Wikipedia article on Faceted Classification. + + + */ + export class TermStatsFacet implements Facet { + + /* + A facet which computes statistical data based on an aggregate key. + */ + constructor(name: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Allows you to return all terms, even if the frequency count is 0. This should not be + used on fields that contain a large number of unique terms because it could cause + out-of-memory errors. + */ + allTerms(trueFalse: string): TermStatsFacet; + + /* + Enables caching of the facetFilter + */ + cacheFilter(trueFalse: boolean): TermStatsFacet; + + /* + Allows you to reduce the documents used for computing facet results. + */ + facetFilter(oFilter: Object): TermStatsFacet; + + /* + Computes values across the entire index + */ + global(trueFalse: boolean): TermStatsFacet; + + /* + Sets the field which will be used to pivot on (group-by). + */ + keyField(fieldName: string): TermStatsFacet; + + /* + The script language being used. Currently supported values are + javascript, groovy, and mvel. + */ + lang(language: string): TermStatsFacet; + + /* + Sets the mode the facet will use. + + + collector + post + + */ + mode(m: string): TermStatsFacet; + + /* + Sets the path to the nested document if faceting against a + nested field. + */ + nested(path: string): TermStatsFacet; + + /* + Sets the type of ordering that will be performed on the date + buckets. Valid values are: + + count - default, sort by the number of items in the bucket + term - sort by term value. + reverse_count - reverse sort of the number of items in the bucket + reverse_term - reverse sort of the term value. + total - sorts by the total value of the bucket contents + reverse_total - reverse sort of the total value of bucket contents + min - the minimum value in the bucket + reverse_min - the reverse sort of the minimum value + max - the maximum value in the bucket + reverse_max - the reverse sort of the maximum value + mean - the mean value of the bucket contents + reverse_mean - the reverse sort of the mean value of bucket contents. + */ + order(o: string): TermStatsFacet; + + /* + Allows you to set script parameters to be used during the execution of the script. + */ + params(oParams: Object): TermStatsFacet; + + /* + Computes values across the the specified scope + */ + scope(scope: string): TermStatsFacet; + + /* + Sets a script that will provide the terms for a given document. + */ + scriptField(script: string): TermStatsFacet; + + /* + Sets the number of facet entries that will be returned for this facet. For instance, you + might ask for only the top 5 aggregate keys although there might be hundreds of + unique keys. Higher settings could cause memory strain. + */ + size(facetSize: number): TermStatsFacet; + + /* + Retrieves the internal facet object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + /* + Sets the field for which statistical information will be generated. + */ + valueField(fieldName: string): TermStatsFacet; + + /* + Define a script to evaluate of which the result will be used to generate + the statistical information. + */ + valueScript(code: string): TermStatsFacet; + + } + + + /* + TermSuggester suggests terms based on edit distance. The provided suggest + text is analyzed before terms are suggested. The suggested terms are + provided per analyzed suggest text token. This leaves the suggest-selection + to the API consumer. For a higher level suggester, please use the + PhraseSuggester. + */ + export class TermSuggester implements Suggest { + + /* + A suggester that suggests terms based on edit distance. + */ + constructor(name: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets the accuracy. How similar the suggested terms at least + need to be compared to the original suggest text. + */ + accuracy(a: number): TermSuggester; + + /* + Sets analyzer used to analyze the suggest text. + */ + analyzer(analyzer: string): TermSuggester; + + /* + Sets the field used to generate suggestions from. + */ + field(field: string): TermSuggester; + + /* + Sets the maximum edit distance candidate suggestions can have + in order to be considered as a suggestion. + */ + maxEdits(max: number): TermSuggester; + + /* + The factor that is used to multiply with the size in order + to inspect more candidate suggestions. + */ + maxInspections(max: number): TermSuggester; + + /* + Sets a maximum threshold in number of documents a suggest text + token can exist in order to be corrected. + */ + maxTermFreq(max: number): TermSuggester; + + /* + Sets a minimal threshold of the number of documents a suggested + term should appear in. + */ + minDocFreq(min: number): TermSuggester; + + /* + Sets the minimum length a suggest text term must have in order + to be corrected. + */ + minWordLen(len: number): TermSuggester; + + /* + Sets the maximum number of suggestions to be retrieved from + each individual shard. + */ + shardSize(s: number): TermSuggester; + + /* + Sets the number of suggestions returned for each token. + */ + size(s: number): TermSuggester; + + /* + Sets the sort mode. Valid values are: + + + score - Sort by score first, then document frequency, and then the term itself + frequency - Sort by document frequency first, then simlarity score and then the term itself + + */ + sort(s: string): TermSuggester; + + /* + Sets what string distance implementation to use for comparing + how similar suggested terms are. Valid values are: + + + internal - based on damerau_levenshtein but but highly optimized for comparing string distance for terms inside the index + damerau_levenshtein - String distance algorithm based on Damerau-Levenshtein algorithm + levenstein - String distance algorithm based on Levenstein edit distance algorithm + jarowinkler - String distance algorithm based on Jaro-Winkler algorithm + ngram - String distance algorithm based on character n-grams + + */ + stringDistance(s: string): TermSuggester; + + /* + Sets the suggest mode. Valid values are: + + + missing - Only suggest terms in the suggest text that aren't in the index + popular - Only suggest suggestions that occur in more docs then the original suggest text term + always - Suggest any matching suggestions based on terms in the suggest text + + */ + suggestMode(m: string): TermSuggester; + + /* + Sets the text to get suggestions for. If not set, the global + suggestion text will be used. + */ + text(txt: string): TermSuggester; + + /* + Retrieves the internal suggest object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + TThe top_children query runs the child query with an estimated hits size, + and out of the hit docs, aggregates it into parent docs. If there aren’t + enough parent docs matching the requested from/size search request, then it + is run again with a wider (more hits) search. + + The top_children also provide scoring capabilities, with the ability to + specify max, sum or avg as the score type. + */ + export class TopChildrenQuery implements Query { + + /* + Returns child documents matching the query aggregated into the parent docs. + */ + constructor(qry: Object, type: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets the boost value for documents matching the Query. + */ + boost(boost: number): TopChildrenQuery; + + /* + Sets the factor which is the number of hits that are asked for in + the child query. Defaults to 5. + */ + factor(f: number): TopChildrenQuery; + + /* + Sets the incremental factor. The incremental factor is used when not + enough child documents are returned so the factor is multiplied by + the incremental factor to fetch more results. Defaults to 52 + */ + incrementalFactor(f: number): TopChildrenQuery; + + /* + Sets the query + */ + query(q: Object): TopChildrenQuery; + + /* + Sets the scope of the query. A scope allows to run facets on the + same scope name that will work against the child documents. + */ + scope(s: string): TopChildrenQuery; + + /* + Sets the scoring type. Valid values are max, sum, or avg. If + another value is passed it we silently ignore the value. + */ + score(s: string): TopChildrenQuery; + + /* + Sets the scoring type. Valid values are max, sum, total, or avg. + If another value is passed it we silently ignore the value. + */ + scoreMode(s: string): TopChildrenQuery; + + /* + Retrieves the internal query object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + /* + Sets the child document type to search against + */ + type(t: string): TopChildrenQuery; + + } + + + /* + A Filter that filters results by a specified index type. + */ + export class TypeFilter implements Filter { + + /* + Filter results by a specified index type. + */ + constructor(type: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Enable or disable caching of the filter + */ + cache(trueFalse: boolean): TypeFilter; + + /* + Sets the cache key. + */ + cacheKey(key: string): TypeFilter; + + /* + Sets the filter name. + */ + name(name: string): TypeFilter; + + /* + Returns the filter object. + */ + toJSON(): TypeFilter; + + /* + Sets the type + */ + type(type: string): TypeFilter; + + } + + + /* + A single-value metrics aggregation that counts the number of values that + are extracted from the aggregated documents. These values can be extracted + either from specific fields in the documents, or be generated by a provided + script. Typically, this aggregator will be used in conjunction with other + single-value aggregations. + */ + export class ValueCountAggregation implements Aggregation { + + /* + Aggregation that counts the number of values that are extracted from the + aggregated documents. + */ + constructor(name: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets the field to operate on. + */ + field(field: string): ValueCountAggregation; + + /* + The script language being used. + */ + lang(language: string): ValueCountAggregation; + + /* + Sets parameters that will be applied to the script. Overwrites + any existing params. + */ + params(p: Object): ValueCountAggregation; + + /* + Allows you generate or modify the terms/values using a script. + */ + script(scriptCode: string): ValueCountAggregation; + + /* + Set to true to assume script values are unique. + */ + scriptValuesUnique(trueFalse: boolean): ValueCountAggregation; + + /* + Retrieves the internal agg object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + } + + + /* + Matches documents that have fields matching a wildcard expression + (not analyzed). Supported wildcards are *, which matches any character + sequence (including the empty one), and ?, which matches any single + character. Note this query can be slow, as it needs to iterate over many + wildcards. In order to prevent extremely slow wildcard queries, a wildcard + wildcard should not start with one of the wildcards * or ?. The wildcard query + maps to Lucene WildcardQuery. + */ + export class WildcardQuery implements Query { + + /* + A Query that matches documents containing a wildcard. This may be + combined with other wildcards with a BooleanQuery. + */ + constructor(field: string, value: string); + + /* + The type of ejs object. For internal use only. + */ + _type(): String; + + /* + Sets the boost value for documents matching the Query. + */ + boost(boost: Number): WildcardQuery; + + /* + Sets the fields to query against. + */ + field(f: string): WildcardQuery; + + /* + Sets rewrite method. Valid values are: + + constant_score_auto - tries to pick the best constant-score rewrite + method based on term and document counts from the query + + scoring_boolean - translates each term into boolean should and + keeps the scores as computed by the query + + constant_score_boolean - same as scoring_boolean, expect no scores + are computed. + + constant_score_filter - first creates a private Filter, by visiting + each term in sequence and marking all docs for that term + + top_terms_boost_N - first translates each term into boolean should + and scores are only computed as the boost using the top N + scoring terms. Replace N with an integer value. + + top_terms_N - first translates each term into boolean should + and keeps the scores as computed by the query. Only the top N + scoring terms are used. Replace N with an integer value. + + Default is constant_score_auto. + + This is an advanced option, use with care. + */ + rewrite(m: string): WildcardQuery; + + /* + Retrieves the internal query object. This is typically used by + internal API functions so use with caution. + */ + toJSON(): String; + + /* + Sets the wildcard query value. + */ + value(v: string): WildcardQuery; + + } + +} diff --git a/elasticsearch/elasticsearch-tests.ts b/elasticsearch/elasticsearch-tests.ts new file mode 100644 index 0000000000..9a85f2c908 --- /dev/null +++ b/elasticsearch/elasticsearch-tests.ts @@ -0,0 +1,35 @@ +/// +import elasticsearch = require("elasticsearch"); + +var client = new elasticsearch.Client({ + host: 'localhost:9200', + log: 'trace' +}); + +client = new elasticsearch.Client({ + hosts: [ + 'box1.server.org', + 'box2.server.org' + ], + selector: function (hosts: any) { } +}); + +client.ping({ + requestTimeout: 30000, + hello: "elasticsearch" +}, function (error) { +}); + +client.search({ + q: 'pants' +}).then(function (body) { + var hits = body.hits.hits; +}, function (error) { +}); + +client.indices.delete({ + index: 'test_index', + ignore: [404] +}).then(function (body) { +}, function (error) { +}); \ No newline at end of file diff --git a/elasticsearch/elasticsearch.d.ts b/elasticsearch/elasticsearch.d.ts new file mode 100644 index 0000000000..b06c11f6bc --- /dev/null +++ b/elasticsearch/elasticsearch.d.ts @@ -0,0 +1,323 @@ +// Type definitions for elasticsearch +// Project: https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/index.html +// Definitions by: Casper Skydt +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module Elasticsearch { + export class Client { + constructor(params: ConfigOptions); + indices: Indices; + bulk(params: BulkIndexDocumentsParams): PromiseLike; + bulk(params: BulkIndexDocumentsParams, callback: (error: any, response: any) => void): void; + delete(params: DeleteDocumentParams): PromiseLike; + delete(params: DeleteDocumentParams, callback: (error: any, response: any) => void): void; + get(params: GetParams, callback: (error: any, response: any) => void): void; + get(params: GetParams): PromiseLike>; + index(params: IndexDocumentParams): PromiseLike; + index(params: IndexDocumentParams, callback: (error: any, response: any) => void): void; + mget(params: MGetParams, callback: (error: any, response: any) => void): void; + mget(params: MGetParams): PromiseLike>; + msearch(params: MSearchParams, callback: (error: any, response: any) => void): void; + msearch(params: MSearchParams): PromiseLike>; + ping(params: PingParams): PromiseLike; + ping(params: PingParams, callback: (err: any, response: any, status: any) => void): void; + scroll(params: ScrollParams): PromiseLike; + scroll(params: ScrollParams, callback: (error: any, response: any) => void): void; + search(params: SearchParams): PromiseLike>; + search(params: SearchParams, callback: (error: any, response: SearchResponse) => void): void; + suggest(params: SuggestParams): PromiseLike; + suggest(params: SuggestParams, callback: (error: any, response: any) => void): void; + update(params: UpdateDocumentParams): PromiseLike; + update(params: UpdateDocumentParams, callback: (error: any, response: any) => void): void; + } + + export class Indices { + delete(params: IndicesDeleteParams, callback: (error: any, response: any, status: any) => void): void; + delete(params: IndicesDeleteParams): PromiseLike; + create(params: IndicesCreateParams, callback: (error: any, response: any, status: any) => void): void; + create(params: IndicesCreateParams): PromiseLike; + exists(params: IndicesIndexExitsParams, callback: (error: any, response: any, status: any) => void): void; + exists(params: IndicesIndexExitsParams): PromiseLike; + existsType(params: IndicesIndexExitsParams & {type: string}, callback: (error: any, response: any, status: any) => void): void; + existsType(params: IndicesIndexExitsParams & {type: string}): PromiseLike; + get(params: IndicesGetParams, callback: (error: any, response: any, status: any) => void): void; + get(params: IndicesGetParams): PromiseLike; + getAlias(params: IndicesGetAliasParams, callback: (error: any, response: any, status: any) => void): void; + getAlias(params: IndicesGetAliasParams): PromiseLike; + putAlias(params: IndicesPutAliasParams, callback: (error: any, response: any, status: any) => void): void; + putAlias(params: IndicesPutAliasParams): PromiseLike; + putTemplate(params: IndicesPutTemplateParams, callback: (error: any, response: any) => void): void; + putTemplate(params: IndicesPutTemplateParams): PromiseLike; + putMapping(params: IndicesPutMappingParams, callback: (error: any, response: any) => void): void; + putMapping(params: IndicesPutMappingParams): PromiseLike; + refresh(params: IndicesRefreshParams, callback: (error: any, response: any) => void): void; + refresh(params: IndicesRefreshParams): PromiseLike; + } + + export interface ConfigOptions{ + host?: any; + hosts?: any; + log?: any; + apiVersion?: string; + plugins?: any; + sniffOnStart?: boolean; + sniffInterval?: number; + sniffOnConnectionFault?: boolean; + maxRetries?: number; + requestTimeout?: number; + deadTimeout?: number; + pingTimeout?: number; + keepAlive?: boolean; + maxSockets?: number; + suggestCompression?: boolean; + connectionClass?: string; + sniffedNodesProtocol?: string; + ssl?: Object; + selector?: any; + defer?: () => void; + nodesToHostCallback?: any; + createNodeAgent?: any; + } + + export interface Explanation { + value: number, + description: string, + details: Explanation[] + } + + export interface GenericParams { + requestTimeout?: number; + maxRetries?: number; + method?: string; + body?: any; + ignore?: number | number[]; + } + + export interface BulkIndexDocumentsParams extends GenericParams { + refresh?: boolean; + routing? : string; + timeout?: number | Date; + type?: string; + fields?: string | string[] | boolean; + index?: string; + } + + export interface IndicesGetParams extends GenericParams { + ignoreUnavailable?: boolean; + index: string | string[] | boolean; + } + + export interface IndicesRefreshParams extends GenericParams { + force?: boolean; + ignoreUnavailable?: boolean; + index: string | string[] | boolean; + } + + export interface IndicesDeleteParams extends GenericParams { + index: string | string[] | boolean; + timeout?: Date | number; + masterTimeout?: Date | number; + } + + export interface IndicesCreateParams extends GenericParams { + index: string | string[] | boolean; + timeout?: Date | number; + masterTimeout?: Date | number; + } + + export interface IndicesPutTemplateParams extends GenericParams { + order?: number; + create?: boolean; + timeout?: Date | number; + masterTimeout?: Date | number; + flatSettings?: boolean; + name: string; + body: string | any; + } + + export interface IndicesPutMappingParams extends GenericParams { + timeout?: Date | number; + masterTimeout?: Date | number; + ignoreUnavailable?: boolean; + allowNoIndices?: boolean; + expandWildcards?: "open" | "closed" | "none" | "all"; + updateAllTypes?: boolean; + index: string | string[] | boolean; + type: string; + } + + export interface IndicesGetAliasParams extends GenericParams { + ignoreUnavailable?: boolean; + allowNoIndices?: boolean; + expandWildcards?: "open" | "closed" | "none" | "all"; + local?: boolean; + index?: string | string[] | boolean; + name: string | string[] | boolean; + } + + export interface IndicesPutAliasParams extends GenericParams { + index?: string | string[] | boolean; + name: string | string[] | boolean; + } + + export interface GetParams extends GenericParams { + index: string; + type: string; + id: string; + fields?: string | string[] | boolean; + parent?: string; + preference?: string; + realtime?: boolean; + refresh?: boolean; + routing?: string; + _source?: string | string[] | boolean; + _sourceExclude?: string | string[] | boolean; + _sourceInclude?: string | string[] | boolean; + version?: number; + versionType?: string; + } + + export interface GetResponse extends GenericParams { + _type: string; + _id: string; + _version: number; + found: boolean; + _source: T; + } + + export interface IndexDocumentParams extends GenericParams { + index: string; + type: string; + id: string; + body: T; + consistensy?: string; + parent?: string; + replication?: string; + routing?: string; + timeout?: Date | number; + timestamp?: Date | number; + version?: number; + versionType?: string; + } + + export interface ScrollParams extends GenericParams { + scroll: string; + scrollId: string; + } + + export interface SearchParams extends GenericParams { + index?: string; + type?: string | string[] | number; + body?: any; + q?: string; + scroll?: string; + search_type?: string; + fields?: string[]; + size?: number; + sort?: string | string[] | boolean; + _source?: string | string[] | boolean; + _sourceExclude?: string | string[] | boolean; + _sourceInclude?: string | string[] | boolean; + stats?: string | string[] | boolean; + suggestField?: string; + suggestSize?: number; + suggestText?: string; + timeout?: Date | number; + } + + export interface SearchResponse { + took: number, + timed_out: boolean, + _scroll_id?: string, + _shards: { + total: number, + successful: number, + failed: number + }, + hits: { + total: number, + max_score: number, + hits: { + _index: string, + _type: string, + _id: string, + _score: number, + _source: T, + _version: number, + _explanation?: Explanation, + fields?: any, + highlight?: any, + inner_hits?: any + }[] + }, + aggregations?: any + } + + export interface MSearchParams extends GenericParams { + index?: string | string[] | Boolean; + type?: string | string[] | Boolean; + search_type?: string; + } + + export interface MGetParams extends GenericParams { + fields?: string | string[] | Boolean; + preference?: string; + realtime?: Boolean; + refresh?: Boolean; + _sourceExclude?: string | string[] | boolean; + _sourceInclude?: string | string[] | boolean; + index?: string; + type?: string; + } + + export interface IndicesIndexExitsParams extends GenericParams { + index: string | string[] | boolean; + ignoreUnavailable?: boolean; + } + + export interface PingParams extends GenericParams { + requestTimeout?: number; + hello?: string; + } + + export interface DeleteDocumentParams extends GenericParams { + index: string; + type: string; + id: string; + refresh?: boolean; + } + + export interface UpdateDocumentParams extends GenericParams { + index: string; + type: string; + id: string; + body?: string | any; + version?: Number; + timesstamp?: Date | Number; + scriptedUpsert?: Boolean; + scriptId?: any; + script?: any; + routing?: string; + retryOnConflict?: Number; + refresh?: Boolean; + parent?: string; + lang?:string; + fields?: string | string[] | Boolean; + consistensy?: string; + } + + export interface SuggestParams extends GenericParams { + ignoreUnavailable?: boolean; + allowNoIndices?: boolean; + expandWildcards?: "open" | "closed" | "none" | "all"; + preference?: string; + routing?: string; + source?: string; + body: string | any; + index: string | string[] | boolean; + } +} + +declare module "elasticsearch" { + export = Elasticsearch; +} diff --git a/electron-notifications/electron-notifications-tests.ts b/electron-notifications/electron-notifications-tests.ts new file mode 100644 index 0000000000..7730747acc --- /dev/null +++ b/electron-notifications/electron-notifications-tests.ts @@ -0,0 +1,13 @@ +/// + +import * as notifier from 'electron-notifications'; + +const data: ElectronNotifications.NotifierOptions = { + message: 'message', + icon: 'icon', + buttons: ['ok', 'cancel'] +}; +const notification = notifier.notify('title', data); +notification.on('clicked', () => { console.log('clicked') }); +notification.on('swipedRight', () => { console.log('swipedRight') }); +notification.on('buttonClicked', (text) => { console.log(`buttonClicked: ${text}`) }); \ No newline at end of file diff --git a/electron-notifications/electron-notifications.d.ts b/electron-notifications/electron-notifications.d.ts new file mode 100644 index 0000000000..5cbb655246 --- /dev/null +++ b/electron-notifications/electron-notifications.d.ts @@ -0,0 +1,41 @@ +// Type definitions for electron-notifications v0.0.3 +// Project: https://github.com/blainesch/electron-notifications +// Definitions by: Daniel Pereira +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare namespace ElectronNotifications { + + interface NotifierOptions { + + /** A message to display under the title. */ + message?: string, + + /** The absolute URL of a icon displayed to the left of the text. */ + icon?: string, + + /** One or two buttons to display on the right of the notification. */ + buttons?: string[] + } + + class NotificationWindow extends Electron.BrowserWindow { + + /** When the notification was clicked, but not dragged. This usually does the default action, or closes the notification. */ + on(event: 'clicked', listener: Function): this; + + /** When the notification has been swiped to the right. This usually indiciated the user wants to dismiss the notification. */ + on(event: 'swipedRight', listener: Function): this; + + /** When any one of the buttons are clicked, it will trigger a buttonClicked event, and pass the text that was clicked to the handler. */ + on(event: 'buttonClicked', listener: (text: string) => void): this; + + on(event: string, listener: Function): this; + } + +} + +/** A node module for sending notifications in electron applications */ +declare module 'electron-notifications' { + export function notify(title: string, data?: ElectronNotifications.NotifierOptions): ElectronNotifications.NotificationWindow; +} \ No newline at end of file diff --git a/email-templates/email-templates-tests.ts b/email-templates/email-templates-tests.ts index 9b70728106..f48dedef40 100644 --- a/email-templates/email-templates-tests.ts +++ b/email-templates/email-templates-tests.ts @@ -4,6 +4,7 @@ import EmailTemplates = require('email-templates'); var EmailTemplate = EmailTemplates.EmailTemplate; var template = new EmailTemplate("./"); +var templateWithOptions = new EmailTemplate('./', {sassOptions: {}, juiceOptions: {}}); var users = [ { email: 'pappa.pizza@spaghetti.com', diff --git a/email-templates/email-templates.d.ts b/email-templates/email-templates.d.ts index c117980877..a836fdfadc 100644 --- a/email-templates/email-templates.d.ts +++ b/email-templates/email-templates.d.ts @@ -19,6 +19,12 @@ interface EmailTemplateResults { * @type {string} */ text: string; + + /** + * @summary Subject result. + * @type {string} + */ + subject: string; } /** @@ -32,6 +38,15 @@ interface EmailTemplateCallback { (err: Object, results: EmailTemplateResults): void; } +/** + * @summary Interface for email-template options + * @interface + */ +interface EmailTemplateOptions { + sassOptions?: any; + juiceOptions?: any; +} + declare module "email-templates" { /** * @summary Email template class. @@ -42,7 +57,7 @@ declare module "email-templates" { * @summary Constructor. * @param {string} templateDir The template directory. */ - constructor(templateDir: string); + constructor(templateDir: string, options?: EmailTemplateOptions); /** * @summary Render a single template. diff --git a/ember/ember-1.11.3-tests.ts b/ember/ember-1.11.3-tests.ts new file mode 100644 index 0000000000..6cd304c54a --- /dev/null +++ b/ember/ember-1.11.3-tests.ts @@ -0,0 +1,210 @@ +/// +/// + + +var App : any; + +App = Em.Application.create(); + +App.president = Em.Object.create({ + name: 'Barack Obama' +}); +App.country = Em.Object.create({ + presidentNameBinding: 'MyApp.president.name' +}); +App.country.get('presidentName'); +App.president = Em.Object.create({ + firstName: 'Barack', + lastName: 'Obama', + fullName: function () { + return this.get('firstName') + ' ' + this.get('lastName'); + }.property() +}); +App.president.get('fullName'); + +declare class MyPerson extends Em.Object { + static createMan(): MyPerson; +} + +var Person1 = Em.Object.extend({ + say: (thing: string) => { + alert(thing); + } +}); + +declare class MyPerson2 extends Em.Object { + helloWorld(): void; +} +var tom = Person1.create({ + name: 'Tom Dale', + helloWorld: function() { + this.say('Hi my name is ' + this.get('name')); + } +}); +tom.helloWorld(); + +Person1.reopen({ isPerson: true }); +Person1.create().get('isPerson'); + +Person1.reopenClass({ + createMan: () => { + return Person1.create({ isMan: true }); + } +}); +// ReSharper disable once DuplicatingLocalDeclaration +declare var Person1: typeof MyPerson; +Person1.createMan().get('isMan'); + +var person = Person1.create({ + firstName: 'Yehuda', + lastName: 'Katz' +}); +person.addObserver('fullName', null, () => { }); +person.set('firstName', 'Brohuda'); + +App.todosController = Em.Object.create({ + todos: [ + Em.Object.create({ isDone: false }) + ], + remaining: (function() { + var todos = this.get('todos'); + return todos.filterProperty('isDone', false).get('length'); + }).property('todos.@each.isDone') +}); + +var todos = App.todosController.get('todos'); +var todo = todos.objectAt(0); +todo.set('isDone', true); +App.todosController.get('remaining'); +todo = Em.Object.create({ isDone: false }); +todos.pushObject(todo); +App.todosController.get('remaining'); + +App.wife = Em.Object.create({ + householdIncome: 80000 +}); +App.husband = Em.Object.create({ + householdIncomeBinding: 'App.wife.householdIncome' +}); +App.husband.get('householdIncome'); +App.husband.set('householdIncome', 90000); +App.wife.get('householdIncome'); + +App.user = Em.Object.create({ + fullName: 'Kara Gates' +}); +App.userView = Em.View.create({ + userNameBinding: Em.Binding.oneWay('App.user.fullName') +}); +App.user.set('fullName', 'Krang Gates'); +App.userView.set('userName', 'Truckasaurus Gates'); +App.user.get('fullName'); + +App = Em.Application.create({ + rootElement: '#sidebar' +}); + +var view = Em.View.create({ + templateName: 'say-hello', + name: 'Bob' +}); +view.appendTo('#container'); +view.append(); +view.remove(); + +App.AlertView = Em.View.extend({ + priority: 'p4', + isUrgent: true +}); + +App.ListingView = Em.View.extend({ + templateName: 'listing', + edit: (event: any) => { + event.view.set('isEditing', true); + } +}); + +App.userController = Em.Object.create({ + content: Em.Object.create({ + firstName: 'Albert', + lastName: 'Hofmann', + posts: 25, + hobbies: 'Riding bicycles' + }) +}); + +Handlebars.registerHelper('highlight', function(property: string, options: any) { + var value = Em.Handlebars.get(this, property, options); + return new Handlebars.SafeString('' + value + ''); +}); + +App.MyText = Em.TextField.extend({ + formBlurredBinding: 'App.adminController.formBlurred', + change: function() { + this.set('formBlurred', true); + } +}); + +var textArea = Em.TextArea.create({ + valueBinding: 'TestObject.value' +}); + +App.ClickableView = Em.View.extend({ + click: () => { + alert('ClickableView was clicked!'); + } +}); + +var container = Em.ContainerView.create(); +container.append(); +var coolView = App.CoolView.create(), + childViews = container.get('childViews'); +childViews.pushObject(coolView); + +var Person2 = Em.Object.extend({ + sayHello: function() { + console.log('Hello from ' + this.get('name')); + } +}); +var people = [ + Person2.create({ name: 'Juan' }), + Person2.create({ name: 'Charles' }), + Person2.create({ name: 'Majd' }) +]; +people.invoke('sayHello'); + +var arr = [Em.Object.create(), Em.Object.create()]; +arr.setEach('name', 'unknown'); +arr.getEach('name'); + +var Person3 = Em.Object.extend({ + name: null, + isHappy: false +}); +var people2 = [ + Person3.create({ name: 'Yehuda', isHappy: true }), + Person3.create({ name: 'Majd', isHappy: false }) +]; +people2.every((person: Em.Object) => { + return !!person.get('isHappy'); +}); +people2.some((person: Em.Object) => { + return !!person.get('isHappy'); +}); +people2.everyProperty('isHappy', true); +people2.someProperty('isHappy', true); + +// Examples taken from http://emberjs.com/api/classes/Ember.RSVP.Promise.html +var promise = new Ember.RSVP.Promise(function(resolve: Function, reject: Function) { + // on success + resolve('ok!'); + + // on failure + reject('no-k!'); +}); + +promise.then(function(value: any) { + // on fulfillment +}, function(reason: any) { + // on rejection +}); diff --git a/ember/ember-1.11.3.d.ts b/ember/ember-1.11.3.d.ts new file mode 100644 index 0000000000..c24661d763 --- /dev/null +++ b/ember/ember-1.11.3.d.ts @@ -0,0 +1,3492 @@ +// Type definitions for Ember.js 1.11.3 +// Project: http://emberjs.com/ +// Definitions by: Jed Mao +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// + +declare var Handlebars: HandlebarsStatic; + +declare namespace EmberStates { + + interface Transition { + targetName: string; + urlMethod: string; + intent: any; + params: {}|any; + pivotHandler: any; + resolveIndex: number; + handlerInfos: any; + resolvedModels: {}|any; + isActive: boolean; + state: any; + queryParams: {}|any; + queryParamsOnly: boolean; + + isTransition: boolean; + + /** + The Transition's internal promise. Calling `.then` on this property + is that same as calling `.then` on the Transition object itself, but + this property is exposed for when you want to pass around a + Transition's promise, but not the Transition object itself, since + Transition object can be externally `abort`ed, while the promise + cannot. + */ + promise: Ember.RSVP.Promise; + + /** + Custom state can be stored on a Transition's `data` object. + This can be useful for decorating a Transition within an earlier + hook and shared with a later hook. Properties set on `data` will + be copied to new transitions generated by calling `retry` on this + transition. + */ + data: any; + + /** + A standard promise hook that resolves if the transition + succeeds and rejects if it fails/redirects/aborts. + + Forwards to the internal `promise` property which you can + use in situations where you want to pass around a thennable, + but not the Transition itself. + + @arg {Function} onFulfilled + @arg {Function} onRejected + @arg {String} label optional string for labeling the promise. Useful for tooling. + @return {Promise} + */ + then(onFulfilled: Function, onRejected?: Function, label?: string): Ember.RSVP.Promise; + + /** + Forwards to the internal `promise` property which you can + use in situations where you want to pass around a thennable, + but not the Transition itself. + + @method catch + @arg {Function} onRejection + @arg {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} + */ + catch(onRejection: Function, label?: string): Ember.RSVP.Promise; + + /** + Forwards to the internal `promise` property which you can + use in situations where you want to pass around a thennable, + but not the Transition itself. + + @method finally + @arg {Function} callback + @arg {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} + */ + finally(callback: Function, label?: string): Ember.RSVP.Promise; + + /** + Aborts the Transition. Note you can also implicitly abort a transition + by initiating another transition while a previous one is underway. + */ + abort(): EmberStates.Transition; + normalize(manager: Ember.StateManager, contexts: any[]): void; + + /** + Retries a previously-aborted transition (making sure to abort the + transition if it's still active). Returns a new transition that + represents the new attempt to transition. + */ + retry(): EmberStates.Transition; + + /** + Sets the URL-changing method to be employed at the end of a + successful transition. By default, a new Transition will just + use `updateURL`, but passing 'replace' to this method will + cause the URL to update using 'replaceWith' instead. Omitting + a parameter will disable the URL change, allowing for transitions + that don't update the URL at completion (this is also used for + handleURL, since the URL has already changed before the + transition took place). + + @arg {String} method the type of URL-changing method to use + at the end of a transition. Accepted values are 'replace', + falsy values, or any other non-falsy value (which is + interpreted as an updateURL transition). + + @return {Transition} this transition + */ + method(method: string): EmberStates.Transition; + + /** + Fires an event on the current list of resolved/resolving + handlers within this transition. Useful for firing events + on route hierarchies that haven't fully been entered yet. + + Note: This method is also aliased as `send` + + @arg {Boolean} [ignoreFailure=false] a boolean specifying whether unhandled events throw an error + @arg {String} name the name of the event to fire + */ + trigger(ignoreFailure:boolean, eventName: string): void; + /** + Fires an event on the current list of resolved/resolving + handlers within this transition. Useful for firing events + on route hierarchies that haven't fully been entered yet. + + Note: This method is also aliased as `send` + + @arg {String} name the name of the event to fire + */ + trigger(eventName: string): void; + + /** + Transitions are aborted and their promises rejected + when redirects occur; this method returns a promise + that will follow any redirects that occur and fulfill + with the value fulfilled by any redirecting transitions + that occur. + + @return {Promise} a promise that fulfills with the same + value that the final redirecting transition fulfills with + */ + followRedirects(): Ember.RSVP.Promise; + } + +} + +declare namespace EmberTesting { + + namespace Test { + + class Adapter { + asyncEnd(): void; + asyncStart(): void; + exception(error: string): void; + } + + class QUnitAdapter extends Adapter { } + + } + +} + +interface Function { + observes(...args: string[]): Function; + observesBefore(...args: string[]): Function; + on(...args: string[]): Function; + property(...args: string[]): Function; +} + +interface String { + camelize(): string; + capitalize(): string; + classify(): string; + dasherize(): string; + decamelize(): string; + fmt(...args: string[]): string; + htmlSafe(): typeof Handlebars.SafeString; + loc(...args: string[]): string; + underscore(): string; + w(): string[]; +} + +interface Array { + constructor(arr: any[]): void; + activate(): void; + addArrayObserver(target: any, opts?: EnumerableConfigurationOptions): any[]; + addEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): any[]; + any(callback: Function, target?: any): boolean; + anyBy(key: string, value?: string): boolean; + arrayContentDidChange(startIdx: number, removeAmt: number, addAmt: number): any[]; + arrayContentWillChange(startIdx: number, removeAmt: number, addAmt: number): any[]; + someProperty(key: string, value?: any): boolean; + clear(): any[]; + compact(): any[]; + contains(obj: any): boolean; + enumerableContentDidChange(start: number, removing: number, adding: number): any; + enumerableContentDidChange(start: number, removing: Ember.Enumerable, adding: number): any; + enumerableContentDidChange(start: number, removing: number, adding: Ember.Enumerable): any; + enumerableContentDidChange(start: number, removing: Ember.Enumerable, adding: Ember.Enumerable): any; + enumerableContentDidChange(removing: number, adding: number): any; + enumerableContentDidChange(removing: Ember.Enumerable, adding: number): any; + enumerableContentDidChange(removing: number, adding: Ember.Enumerable): any; + enumerableContentDidChange(removing: Ember.Enumerable, adding: Ember.Enumerable): any; + enumerableContentWillChange(removing: number, adding: number): any[]; + enumerableContentWillChange(removing: Ember.Enumerable, adding: number): any[]; + enumerableContentWillChange(removing: number, adding: Ember.Enumerable): any[]; + enumerableContentWillChange(removing: Ember.Enumerable, adding: Ember.Enumerable): any[]; + every(callback: Function, target?: any): boolean; + everyBy(key: string, value?: string): boolean; + everyProperty(key: string, value?: any): boolean; + filter(callback: Function, target?: any): any[]; + filterBy(key: string, value?: string): any[]; + + /** + Returns the first item in the array for which the callback returns true. + This method works similar to the `filter()` method defined in JavaScript 1.6 + except that it will stop working on the array once a match is found. + The callback method you provide should have the following signature (all + parameters are optional): + ```javascript + function(item, index, enumerable); + ``` + - `item` is the current item in the iteration. + - `index` is the current index in the iteration. + - `enumerable` is the enumerable object itself. + It should return the `true` to include the item in the results, `false` + otherwise. + Note that in addition to a callback, you can also pass an optional target + object that will be set as `this` on the context. This is a good way + to give your iterator function access to the current object. + @function find + @arg callback The callback to execute + @arg {Object} [target] The target object to use + @return {Object} Found item or `undefined`. +*/ + find(callback: Function, target?: any): any; + findBy(key: string, value?: string): any; + forEach(callback: Function, target?: any): any; + getEach(key: string): any[]; + indexOf(object: any, startAt?: number): number; + insertAt(idx: number, object: any): any[]; + invoke(methodName: string, ...args: any[]): any[]; + lastIndexOf(object: any, startAt?: number): number; + map(callback: Function, target?: any): any[]; + mapBy(key: string): any[]; + nextObject(index: number, previousObject: any, context: any): any; + objectAt(idx: number): any; + objectsAt(...args: number[]): any[]; + popObject(): any; + pushObject(obj: any): any; + pushObjects(...args: any[]): any[]; + reduce(callback: ReduceCallback, initialValue: any, reducerProperty: string): any; + reject: ItemIndexEnumerableCallbackTarget; + rejectBy(key: string, value?: string): any[]; + removeArrayObserver(target: any, opts: EnumerableConfigurationOptions): any[]; + removeAt(start: number, len: number): any; + removeEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): any[]; + replace(idx: number, amt: number, objects: any[]): void; + reverseObjects(): any[]; + setEach(key: string, value?: any): any; + setObjects(objects: any[]): any[]; + shiftObject(): any; + slice(beginIndex?: number, endIndex?: number): any[]; + some(callback: Function, target?: any): boolean; + toArray(): any[]; + uniq(): any[]; + unshiftObject(object: any): any; + unshiftObjects(objects: any[]): any[]; + without(value: any): any[]; + '[]': any[]; + '@each': Ember.EachProxy; + Boolean: boolean; + firstObject: any; + hasEnumerableObservers: boolean; + lastObject: any; + addObject(object: any): any; + addObjects(objects: Ember.Enumerable): any[]; + removeObject(object: any): any; + removeObjects(objects: Ember.Enumerable): any[]; + addObserver: ModifyObserver; + beginPropertyChanges(): any[]; + cacheFor(keyName: string): any; + decrementProperty(keyName: string, decrement?: number): number; + endPropertyChanges(): any[]; + get(keyName: string): any; + getProperties(...args: string[]): {}; + getProperties(keys: string[]): {}; + getWithDefault(keyName: string, defaultValue: any): any; + hasObserverFor(key: string): boolean; + incrementProperty(keyName: string, increment?: number): number; + notifyPropertyChange(keyName: string): any[]; + propertyDidChange(keyName: string): any[]; + propertyWillChange(keyName: string): any[]; + removeObserver(key: string, target: any, method: string): Ember.Observable; + removeObserver(key: string, target: any, method: Function): Ember.Observable; + set(keyName: string, value: any): any[]; + setProperties(hash: {}): any[]; + toggleProperty(keyName: string): any; + copy(deep: boolean): any[]; + frozenCopy(): any[]; + // 1.3 + isAny(key: string, value?: string): boolean; + isEvery(key: string, value?: string): boolean; +} + +interface ApplicationCreateArguments { + customEvents?: {}; + rootElement?: string; + /** + Basic logging of successful transitions. + **/ + LOG_TRANSITIONS?: boolean; + /** + Detailed logging of all routing steps. + **/ + LOG_TRANSITIONS_INTERNAL?: boolean; +} + +interface ApplicationInitializerArguments { + name?: string; + initialize?: ApplicationInitializerFunction; +} + +interface ApplicationInitializerFunction { + (container: Ember.Container, application: Ember.Application): void; +} + +interface CoreObjectArguments { + /** + An overridable method called when objects are instantiated. By default, does nothing unless it is + overridden during class definition. NOTE: If you do override init for a framework class like Ember.View + or Ember.ArrayController, be sure to call this._super() in your init declaration! If you don't, Ember + may not have an opportunity to do important setup work, and you'll see strange behavior in your application. + **/ + init?: Function; + /** + Override to implement teardown. + **/ + willDestroy?: Function; + + [propName: string]: any; +} + +interface EnumerableConfigurationOptions { + willChange?: boolean ; + didChange?: boolean ; +} + +interface ItemIndexEnumerableCallbackTarget { + (callback: ItemIndexEnumerableCallback, target?: any): any[]; +} + +interface ItemIndexEnumerableCallback { + (item: any, index: number, enumerable: Ember.Enumerable): void; +} + +interface ReduceCallback { + (previousValue: any, item: any, index: number, enumerable: Ember.Enumerable): void; +} + +interface TransitionsHash { + contexts: any[]; + exitStates: Ember.State[]; + enterStates: Ember.State[]; + resolveState: Ember.State; +} + +interface ActionsHash { + willTransition?: Function; + error?: Function; +} + +interface DisconnectOutletOptions { + outlet?: string; + parentView?: string; +} + +interface RenderOptions { + into?: string; + controller?: string; + model?: any; + outlet?: string; + view?: string; +} + +interface ModifyObserver { + (obj: any, path: string, target: any, method?: Function): void; + (obj: any, path: string, target: any, method?: string): void; + (obj: any, path: string, func: Function, method?: Function): void; + (obj: any, path: string, func: Function, method?: string): void; +} + +declare namespace Ember { + /** + Alias for jQuery. + **/ + // ReSharper disable once DuplicatingLocalDeclaration + var $: JQueryStatic; + /** + Creates an Ember.NativeArray from an Array like object. Does not modify the original object. + Ember.A is not needed if Ember.EXTEND_PROTOTYPES is true (the default value). However, it is + recommended that you use Ember.A when creating addons for ember or when you can not garentee + that Ember.EXTEND_PROTOTYPES will be true. + **/ + function A(arr?: any[]): NativeArray; + /** + The Ember.ActionHandler mixin implements support for moving an actions property to an _actions + property at extend time, and adding _actions to the object's mergedProperties list. + **/ + class ActionHandlerMixin { + /** + Triggers a named action on the ActionHandler + **/ + send(name: string, ...args: any[]): void; + /** + The collection of functions, keyed by name, available on this ActionHandler as action targets. + **/ + actions: ActionsHash; + } + /** + An instance of Ember.Application is the starting point for every Ember application. It helps to + instantiate, initialize and coordinate the many objects that make up your app. + **/ + class Application extends Namespace { + static detect(obj: any): boolean; + static detectInstance(obj: any): boolean; + /** + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ + static eachComputedProperty(callback: Function, binding: {}): void; + /** + Returns the original hash that was passed to meta(). + @param key property name + **/ + static metaForProperty(key: string): {}; + static isClass: boolean; + static isMethod: boolean; + static initializer(args?: ApplicationInitializerArguments): void; + /** + Call advanceReadiness after any asynchronous setup logic has completed. + Each call to deferReadiness must be matched by a call to advanceReadiness + or the application will never become ready and routing will not begin. + **/ + advanceReadiness(): void; + /** + Use this to defer readiness until some condition is true. + + This allows you to perform asynchronous setup logic and defer + booting your application until the setup has finished. + + However, if the setup requires a loading UI, it might be better + to use the router for this purpose. + */ + deferReadiness(): void; + /** + defines an injection or typeInjection + **/ + inject(factoryNameOrType: string, property: string, injectionName: string): void; + /** + This injects the test helpers into the window's scope. If a function of the + same name has already been defined it will be cached (so that it can be reset + if the helper is removed with `unregisterHelper` or `removeTestHelpers`). + Any callbacks registered with `onInjectHelpers` will be called once the + helpers have been injected. + **/ + injectTestHelpers(): void; + /** + registers a factory for later injection + @param fullName type:name (e.g., 'model:user') + @param factory (e.g., App.Person) + **/ + register(fullName: string, factory: Function, options?: {}): void; + /** + This removes all helpers that have been registered, and resets and functions + that were overridden by the helpers. + **/ + removeTestHelpers(): void; + /** + Reset the application. This is typically used only in tests. + **/ + reset(): void; + /** + This hook defers the readiness of the application, so that you can start + the app when your tests are ready to run. It also sets the router's + location to 'none', so that the window's location will not be modified + (preventing both accidental leaking of state between tests and interference + with your testing framework). + **/ + setupForTesting(): void; + /** + The DOM events for which the event dispatcher should listen. + */ + customEvents: {}; + /** + The Ember.EventDispatcher responsible for delegating events to this application's views. + **/ + eventDispatcher: EventDispatcher; + /** + Set this to provide an alternate class to Ember.DefaultResolver + **/ + resolver: DefaultResolver; + /** + The root DOM element of the Application. This can be specified as an + element or a jQuery-compatible selector string. + + This is the element that will be passed to the Application's, eventDispatcher, + which sets up the listeners for event delegation. Every view in your application + should be a child of the element you specify here. + **/ + rootElement: HTMLElement; + /** + Called when the Application has become ready. + The call will be delayed until the DOM has become ready. + **/ + ready: Function; + /** + Application's router. + **/ + Router: Router; + } + /** + This module implements Observer-friendly Array-like behavior. This mixin is picked up by the + Array class as well as other controllers, etc. that want to appear to be arrays. + **/ + class Array implements Enumerable { + addArrayObserver(target: any, opts?: EnumerableConfigurationOptions): any[]; + addEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; + any(callback: Function, target?: any): boolean; + anyBy(key: string, value?: string): boolean; + arrayContentDidChange(startIdx: number, removeAmt: number, addAmt: number): any[]; + arrayContentWillChange(startIdx: number, removeAmt: number, addAmt: number): any[]; + someProperty(key: string, value?: string): boolean; + compact(): any[]; + contains(obj: any): boolean; + enumerableContentDidChange(start: number, removing: number, adding: number): any; + enumerableContentDidChange(start: number, removing: Enumerable, adding: number): any; + enumerableContentDidChange(start: number, removing: number, adding: Enumerable): any; + enumerableContentDidChange(start: number, removing: Enumerable, adding: Enumerable): any; + enumerableContentDidChange(removing: number, adding: number): any; + enumerableContentDidChange(removing: Enumerable, adding: number): any; + enumerableContentDidChange(removing: number, adding: Enumerable): any; + enumerableContentDidChange(removing: Enumerable, adding: Enumerable): any; + enumerableContentWillChange(removing: number, adding: number): Enumerable; + enumerableContentWillChange(removing: Enumerable, adding: number): Enumerable; + enumerableContentWillChange(removing: number, adding: Enumerable): Enumerable; + enumerableContentWillChange(removing: Enumerable, adding: Enumerable): Enumerable; + every(callback: Function, target?: any): boolean; + everyBy(key: string, value?: string): boolean; + everyProperty(key: string, value?: string): boolean; + filter(callback: Function, target: any): any[]; + filterBy(key: string, value?: string): any[]; + find(callback: Function, target?: any): any; + findBy(key: string, value?: string): any; + forEach(callback: Function, target?: any): any; + getEach(key: string): any[]; + indexOf(object: any, startAt: number): number; + invoke(methodName: string, ...args: any[]): any[]; + lastIndexOf(object: any, startAt: number): number; + map: ItemIndexEnumerableCallbackTarget; + mapBy(key: string): any[]; + nextObject(index: number, previousObject: any, context: any): any; + objectAt(idx: number): any; + objectsAt(...args: number[]): any[]; + reduce(callback: ReduceCallback, initialValue: any, reducerProperty: string): any; + reject: ItemIndexEnumerableCallbackTarget; + rejectBy(key: string, value?: string): any[]; + removeArrayObserver(target: any, opts: EnumerableConfigurationOptions): any[]; + removeEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; + setEach(key: string, value?: any): any; + slice(beginIndex?: number, endIndex?: number): any[]; + some(callback: Function, target?: any): boolean; + toArray(): any[]; + uniq(): Enumerable; + without(value: any): Enumerable; + '@each': EachProxy; + Boolean: boolean; + '[]': any[]; + firstObject: any; + hasEnumerableObservers: boolean; + lastObject: any; + length: number; + } + /** + Provides a way for you to publish a collection of objects so that you can easily bind to the + collection from a Handlebars #each helper, an Ember.CollectionView, or other controllers. + **/ + class ArrayController extends ArrayProxy implements SortableMixin, ControllerMixin { + static detect(obj: any): boolean; + static detectInstance(obj: any): boolean; + /** + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ + static eachComputedProperty(callback: Function, binding: {}): void; + /** + Returns the original hash that was passed to meta(). + @param key property name + **/ + static metaForProperty(key: string): {}; + static isClass: boolean; + static isMethod: boolean; + lookupItemController(object: any): string; + arrangedContent: any; + itemController: string; + sortAscending: boolean; + sortFunction: Comparable; + sortProperties: any[]; + replaceRoute(name: string, ...args: any[]): void; + transitionToRoute(name: string, ...args: any[]): void; + controllers: {}; + needs: string[]; + target: any; + model: any; + queryParams: any; + send(name: string, ...args: any[]): void; + actions: {}; + + } + /** + Array polyfills to support ES5 features in older browsers. + **/ + var ArrayPolyfills: { + map: typeof Array.prototype.map; + forEach: typeof Array.prototype.forEach; + indexOf: typeof Array.prototype.indexOf; + }; + /** + An ArrayProxy wraps any other object that implements Ember.Array and/or Ember.MutableArray, + forwarding all requests. This makes it very useful for a number of binding use cases or other cases + where being able to swap out the underlying array is useful. + **/ + class ArrayProxy extends Object implements MutableArray { + static detect(obj: any): boolean; + static detectInstance(obj: any): boolean; + /** + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ + static eachComputedProperty(callback: Function, binding: {}): void; + /** + Returns the original hash that was passed to meta(). + @param key property name + **/ + static metaForProperty(key: string): {}; + static isClass: boolean; + static isMethod: boolean; + addArrayObserver(target: any, opts?: EnumerableConfigurationOptions): any[]; + addEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; + any(callback: Function, target?: any): boolean; + anyBy(key: string, value?: string): boolean; + arrayContentDidChange(startIdx: number, removeAmt: number, addAmt: number): any[]; + arrayContentWillChange(startIdx: number, removeAmt: number, addAmt: number): any[]; + someProperty(key: string, value?: string): boolean; + clear(): any[]; + compact(): any[]; + contains(obj: any): boolean; + enumerableContentDidChange(start: number, removing: number, adding: number): any; + enumerableContentDidChange(start: number, removing: Enumerable, adding: number): any; + enumerableContentDidChange(start: number, removing: number, adding: Enumerable): any; + enumerableContentDidChange(start: number, removing: Enumerable, adding: Enumerable): any; + enumerableContentDidChange(removing: number, adding: number): any; + enumerableContentDidChange(removing: Enumerable, adding: number): any; + enumerableContentDidChange(removing: number, adding: Enumerable): any; + enumerableContentDidChange(removing: Enumerable, adding: Enumerable): any; + enumerableContentWillChange(removing: number, adding: number): Enumerable; + enumerableContentWillChange(removing: Enumerable, adding: number): Enumerable; + enumerableContentWillChange(removing: number, adding: Enumerable): Enumerable; + enumerableContentWillChange(removing: Enumerable, adding: Enumerable): Enumerable; + every(callback: Function, target?: any): boolean; + everyBy(key: string, value?: string): boolean; + everyProperty(key: string, value?: string): boolean; + filter(callback: Function, target: any): any[]; + filterBy(key: string, value?: string): any[]; + find(callback: Function, target: any): any; + findBy(key: string, value?: string): any; + forEach(callback: Function, target?: any): any; + getEach(key: string): any[]; + indexOf(object: any, startAt: number): number; + insertAt(idx: number, object: any): any[]; + invoke(methodName: string, ...args: any[]): any[]; + lastIndexOf(object: any, startAt: number): number; + map: ItemIndexEnumerableCallbackTarget; + mapBy(key: string): any[]; + nextObject(index: number, previousObject: any, context: any): any; + objectAt(idx: number): any; + objectAtContent(idx: number): any; + objectsAt(...args: number[]): any[]; + popObject(): any; + pushObject(obj: any): any; + pushObjects(...args: any[]): any[]; + reduce(callback: ReduceCallback, initialValue: any, reducerProperty: string): any; + reject: ItemIndexEnumerableCallbackTarget; + rejectBy(key: string, value?: string): any[]; + removeArrayObserver(target: any, opts: EnumerableConfigurationOptions): any[]; + removeAt(start: number, len: number): any; + removeEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; + replace(idx: number, amt: number, objects: any[]): any; + replaceContent(idx: number, amt: number, objects: any[]): void; + reverseObjects(): any[]; + setEach(key: string, value?: any): any; + setObjects(objects: any[]): any[]; + shiftObject(): any; + slice(beginIndex?: number, endIndex?: number): any[]; + some(callback: Function, target?: any): boolean; + toArray(): any[]; + uniq(): Enumerable; + unshiftObject(object: any): any; + unshiftObjects(objects: any[]): any[]; + without(value: any): Enumerable; + '[]': any[]; + '@each': EachProxy; + Boolean: boolean; + firstObject: any; + hasEnumerableObservers: boolean; + lastObject: any; + length: number; + addObject(object: any): any; + addObjects(objects: Enumerable): MutableEnumberable; + removeObject(object: any): any; + removeObjects(objects: Enumerable): MutableEnumberable; + } + var BOOTED: boolean; + /** + Connects the properties of two objects so that whenever the value of one property changes, + the other property will be changed also. + **/ + class Binding { + constructor(toPath: string, fromPath: string); + connect(obj: any): Binding; + copy(): Binding; + disconnect(obj: any): Binding; + from(path: string): Binding; + static oneWay(from: string, flag?: boolean): Binding; + to(path: string): Binding; + to(pathTuple: any[]): Binding; + toString(): string; + } + class Button extends View implements TargetActionSupport { + static detect(obj: any): boolean; + static detectInstance(obj: any): boolean; + /** + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ + static eachComputedProperty(callback: Function, binding: {}): void; + /** + Returns the original hash that was passed to meta(). + @param key property name + **/ + static metaForProperty(key: string): {}; + static isClass: boolean; + static isMethod: boolean; + triggerAction(opts: {}): boolean; + } + /** + The internal class used to create text inputs when the {{input}} helper is used + with type of checkbox. See Handlebars.helpers.input for usage details. + **/ + class Checkbox extends View { + static detect(obj: any): boolean; + static detectInstance(obj: any): boolean; + /** + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ + static eachComputedProperty(callback: Function, binding: {}): void; + /** + Returns the original hash that was passed to meta(). + @param key property name + **/ + static metaForProperty(key: string): {}; + static isClass: boolean; + static isMethod: boolean; + } + /** + An Ember.View descendent responsible for managing a collection (an array or array-like object) + by maintaining a child view object and associated DOM representation for each item in the array + and ensuring that child views and their associated rendered HTML are updated when items in the + array are added, removed, or replaced. + **/ + class CollectionView extends ContainerView { + arrayDidChange(content: any[], start: number, removed: number, added: number): void; + arrayWillChange(content: any[], start: number, removed: number): void; + createChildView(viewClass: {}, attrs?: {}): CollectionView; + destroy(): CollectionView; + init(): void; + static CONTAINER_MAP: {}; + content: any[]; + emptyView: View; + itemViewClass: View; + } + /** + Implements some standard methods for comparing objects. Add this mixin to any class + you create that can compare its instances. + **/ + class Comparable { + compare(a: any, b: any): number; + } + /** + A view that is completely isolated. Property access in its templates go to the view object + and actions are targeted at the view object. There is no access to the surrounding context or + outer controller; all contextual information is passed in. + **/ + class Component extends View { + static detect(obj: any): boolean; + static detectInstance(obj: any): boolean; + /** + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ + static eachComputedProperty(callback: Function, binding: {}): void; + /** + Returns the original hash that was passed to meta(). + @param key property name + **/ + static metaForProperty(key: string): {}; + static isClass: boolean; + static isMethod: boolean; + sendAction(action: string, context: any): void; + targetObject: Controller; + } + /** + A computed property transforms an objects function into a property. + By default the function backing the computed property will only be called once and the result + will be cached. You can specify various properties that your computed property is dependent on. + This will force the cached result to be recomputed if the dependencies are modified. + **/ + class ComputedProperty { + cacheable(aFlag?: boolean): ComputedProperty; + get(keyName: string): any; + meta(meta: {}): ComputedProperty; + property(...args: string[]): ComputedProperty; + readOnly(): ComputedProperty; + set(keyName: string, newValue: any, oldValue: string): any; + // ReSharper disable UsingOfReservedWord + volatile(): ComputedProperty; + // ReSharper restore UsingOfReservedWord + } + class Container { + constructor(parent: Container); + parent: Container; + children: any[]; + resolver: Function; + registry: {}; + cache: {}; + typeInjections: {}; + injections: {}; + child(): Container; + set(object: {}, key: string, value: any): void; + /** + registers a factory for later injection + @param fullName type:name (e.g., 'model:user') + @param factory (e.g., App.Person) + **/ + register(fullName: string, factory: Function, options?: {}): void; + unregister(fullName: string): void; + resolve(fullName: string): Function; + describe(fullName: string): string; + normalize(fullName: string): string; + makeToString(factory: any, fullName: string): Function; + lookup(fullName: string, options?: {}): any; + lookupFactory(fullName: string): any; + has(fullName: string): boolean; + optionsForType(type: string, options: {}): void; + options(type: string, options: {}): void; + injection(factoryName: string, property: string, injectionName: string): void; + factoryInjection(factoryName: string, property: string, injectionName: string): void; + destroy(): void; + reset(): void; + } + /** + An Ember.View subclass that implements Ember.MutableArray allowing programatic + management of its child views. + **/ + class ContainerView extends View { + static detect(obj: any): boolean; + static detectInstance(obj: any): boolean; + /** + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ + static eachComputedProperty(callback: Function, binding: {}): void; + /** + Returns the original hash that was passed to meta(). + @param key property name + **/ + static metaForProperty(key: string): {}; + static isClass: boolean; + static isMethod: boolean; + } + class Controller extends Object implements ControllerMixin { + replaceRoute(name: string, ...args: any[]): void; + transitionToRoute(name: string, ...args: any[]): void; + controllers: {}; + model: any; + needs: string[]; + queryParams: any; + target: any; + send(name: string, ...args: any[]): void; + actions: ActionsHash; + } + /** + Additional methods for the ControllerMixin. + **/ + class ControllerMixin extends ActionHandlerMixin { + replaceRoute(name: string, ...args: any[]): void; + transitionToRoute(name: string, ...args: any[]): void; + controllers: {}; + model : any; + needs: string[]; + queryParams: any; + target: any; + } + /** + Implements some standard methods for copying an object. Add this mixin to any object you + create that can create a copy of itself. This mixin is added automatically to the built-in array. + You should generally implement the copy() method to return a copy of the receiver. + Note that frozenCopy() will only work if you also implement Ember.Freezable. + **/ + class Copyable { + copy(deep: boolean): Copyable; + frozenCopy(): Copyable; + } + class CoreObject { + /** + An overridable method called when objects are instantiated. By default, + does nothing unless it is overridden during class definition. + @method init + **/ + init(): void; + + /** + Defines the properties that will be concatenated from the superclass (instead of overridden). + @property concatenatedProperties + @type Array + @default null + **/ + concatenatedProperties: any[]; + + /** + Destroyed object property flag. If this property is true the observers and bindings were + already removed by the effect of calling the destroy() method. + @property isDestroyed + @default false + **/ + isDestroyed: boolean; + /** + Destruction scheduled flag. The destroy() method has been called. The object stays intact + until the end of the run loop at which point the isDestroyed flag is set. + @property isDestroying + @default false + **/ + isDestroying: boolean; + + /** + Destroys an object by setting the `isDestroyed` flag and removing its + metadata, which effectively destroys observers and bindings. + If you try to set a property on a destroyed object, an exception will be + raised. + Note that destruction is scheduled for the end of the run loop and does not + happen immediately. It will set an isDestroying flag immediately. + @method destroy + @return {Ember.Object} receiver + */ + destroy(): CoreObject; + + /** + Override to implement teardown. + @method willDestroy + */ + willDestroy(): void; + + /** + Returns a string representation which attempts to provide more information than Javascript's toString + typically does, in a generic way for all Ember objects (e.g., ""). + @method toString + @return {String} string representation + **/ + toString(): string; + + static isClass: boolean; + static isMethod: boolean; + + /** + Creates a new subclass. + @method extend + @static + @param {Object} [args] - Object containing values to use within the new class + **/ + static extend(args?: CoreObjectArguments): T; + /** + Creates a new subclass. + @method extend + @static + @param {Mixin} [mixins] - One or more Mixin classes + @param {Object} [args] - Object containing values to use within the new class + **/ + static extend(mixins?: Mixin, args?: CoreObjectArguments): T; + + /** + Creates a new subclass. + @method extend + @param {Object} [args] - Object containing values to use within the new class + Non-static method because Ember classes aren't currently 'real' TypeScript classes. + **/ + extend(args ?: CoreObjectArguments): T; + /** + Creates a new subclass. + @method extend + @param {Mixin} [mixins] - One or more Mixin classes + @param {Object} [args] - Object containing values to use within the new class + Non-static method because Ember classes aren't currently 'real' TypeScript classes. + **/ + extend(mixins ? : Mixin, args ?: CoreObjectArguments): T; + + /** + Equivalent to doing extend(arguments).create(). If possible use the normal create method instead. + @method createWithMixins + @static + @param [args] + **/ + static createWithMixins(args?: {}): T; + + /** + Creates an instance of the class. + @method create + @static + @param [args] - A hash containing values with which to initialize the newly instantiated object. + **/ + static create(args?: {}): T; + + /** + Augments a constructor's prototype with additional properties and functions. + To add functions and properties to the constructor itself, see reopenClass. + @method reopen + **/ + static reopen(args?: {}): T; + + /** + Augments a constructor's own properties and functions. + To add functions and properties to instances of a constructor by extending the + constructor's prototype see reopen. + @method reopenClass + **/ + static reopenClass(args?: {}): T; + + static detect(obj: any): boolean; + static detectInstance(obj: any): boolean; + + /** + Returns the original hash that was passed to meta(). + @method metaForProperty + @static + @param key {String} property name + **/ + static metaForProperty(key: string): {}; + + /** + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + + @method eachComputedProperty + @static + @param {Function} callback + @param {Object} binding + **/ + static eachComputedProperty(callback: Function, binding: {}): void; + } + /** + An abstract class that exists to give view-like behavior to both Ember's main view class Ember.View + and other classes like Ember._SimpleMetamorphView that don't need the fully functionaltiy of Ember.View. + Unless you have specific needs for CoreView, you will use Ember.View in your applications. + **/ + class CoreView extends Object implements ActionHandlerMixin { + static detect(obj: any): boolean; + static detectInstance(obj: any): boolean; + /** + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ + static eachComputedProperty(callback: Function, binding: {}): void; + /** + Returns the original hash that was passed to meta(). + @param key property name + **/ + static metaForProperty(key: string): {}; + static isClass: boolean; + static isMethod: boolean; + send(name: string, ...args: any[]): void; + actions: ActionsHash; + parentView: CoreView; + } + class DAG { + add(name: string): any; + map(name: string, value: any): void; + addEdge(fromName: string, toName: string): void; + topsort(fn: Function): void; + addEdges(name: string, value: any, before: any, after: any): void; + names: any[]; + vertices: {}; + } + function DEFAULT_GETTER_FUNCTION(name: string): Function; + /** + The DefaultResolver defines the default lookup rules to resolve container lookups before consulting + the container for registered items: + templates are looked up on Ember.TEMPLATES + other names are looked up on the application after converting the name. + For example, controller:post looks up App.PostController by default. + **/ + class DefaultResolver { + resolve(fullName: string): {}; + namespace: Application; + } + class Deferred { + reject(value: any): void; + resolve(value: any): void; + then(resolve: Function, reject: Function): void; + } + class DeferredMixin extends Mixin { + reject(value: any): void; + resolve(value: any): void; + then(resolve: Function, reject: Function): void; + } + /** + Objects of this type can implement an interface to respond to requests to get and set. + The default implementation handles simple properties. + You generally won't need to create or subclass this directly. + **/ + class Descriptor { } + var EMPTY_META: {}; // TODO: define interface + var ENV: {}; + var EXTEND_PROTOTYPES: boolean; + /** + This is the object instance returned when you get the @each property on an array. It uses + the unknownProperty handler to automatically create EachArray instances for property names. + **/ + class EachProxy extends Object { + static detect(obj: any): boolean; + static detectInstance(obj: any): boolean; + /** + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ + static eachComputedProperty(callback: Function, binding: {}): void; + /** + Returns the original hash that was passed to meta(). + @param key property name + **/ + static metaForProperty(key: string): {}; + static isClass: boolean; + static isMethod: boolean; + unknownProperty(keyName: string, value: any): any[]; + } + /** + This mixin defines the common interface implemented by enumerable objects in Ember. Most of these + methods follow the standard Array iteration API defined up to JavaScript 1.8 (excluding language-specific + features that cannot be emulated in older versions of JavaScript). + This mixin is applied automatically to the Array class on page load, so you can use any of these methods + on simple arrays. If Array already implements one of these methods, the mixin will not override them. + **/ + class Enumerable { + addEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; + any(callback: Function, target?: any): boolean; + anyBy(key: string, value?: string): boolean; + someProperty(key: string, value?: string): boolean; + compact(): any[]; + contains(obj: any): boolean; + enumerableContentDidChange(start: number, removing: number, adding: number): any; + enumerableContentDidChange(start: number, removing: Enumerable, adding: number): any; + enumerableContentDidChange(start: number, removing: number, adding: Enumerable): any; + enumerableContentDidChange(start: number, removing: Enumerable, adding: Enumerable): any; + enumerableContentDidChange(removing: number, adding: number): any; + enumerableContentDidChange(removing: Enumerable, adding: number): any; + enumerableContentDidChange(removing: number, adding: Enumerable): any; + enumerableContentDidChange(removing: Enumerable, adding: Enumerable): any; + enumerableContentWillChange(removing: number, adding: number): Enumerable; + enumerableContentWillChange(removing: Enumerable, adding: number): Enumerable; + enumerableContentWillChange(removing: number, adding: Enumerable): Enumerable; + enumerableContentWillChange(removing: Enumerable, adding: Enumerable): Enumerable; + every(callback: Function, target?: any): boolean; + everyBy(key: string, value?: string): boolean; + everyProperty(key: string, value?: string): boolean; + filter(callback: Function, target: any): any[]; + filterBy(key: string, value?: string): any[]; + find(callback: Function, target: any): any; + findBy(key: string, value?: string): any; + forEach(callback: Function, target?: any): any; + getEach(key: string): any[]; + invoke(methodName: string, ...args: any[]): any[]; + map: ItemIndexEnumerableCallbackTarget; + mapBy(key: string): any[]; + nextObject(index: number, previousObject: any, context: any): any; + reduce(callback: ReduceCallback, initialValue: any, reducerProperty: string): any; + reject: ItemIndexEnumerableCallbackTarget; + rejectBy(key: string, value?: string): any[]; + removeEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; + setEach(key: string, value?: any): any; + some(callback: Function, target?: any): boolean; + toArray(): any[]; + uniq(): Enumerable; + without(value: any): Enumerable; + '[]': any[]; + firstObject: any; + hasEnumerableObservers: boolean; + lastObject: any; + } + var EnumerableUtils: {}; // TODO: define interface + /** + A subclass of the JavaScript Error object for use in Ember. + **/ + // Restore this to 'typeof Error' when https://github.com/Microsoft/TypeScript/issues/983 is resolved + // ReSharper disable once DuplicatingLocalDeclaration + var Error: any; // typeof Error; + /** + Handles delegating browser events to their corresponding Ember.Views. For example, when you click on + a view, Ember.EventDispatcher ensures that that view's mouseDown method gets called. + **/ + class EventDispatcher extends Object { + static detect(obj: any): boolean; + static detectInstance(obj: any): boolean; + /** + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ + static eachComputedProperty(callback: Function, binding: {}): void; + /** + Returns the original hash that was passed to meta(). + @param key property name + **/ + static metaForProperty(key: string): {}; + static isClass: boolean; + static isMethod: boolean; + events: {}; + } + /** + This mixin allows for Ember objects to subscribe to and emit events. + You can also chain multiple event subscriptions. + **/ + class Evented { + has(name: string): boolean; + off(name: string, target: any, method: Function): Evented; + on(name: string, target: any, method: Function): Evented; + one(name: string, target: any, method: Function): Evented; + trigger(name: string, ...args: string[]): void; + } + var FROZEN_ERROR: string; + class Freezable { + freeze(): Freezable; + isFrozen: boolean; + } + var GUID_KEY: string; + namespace Handlebars { + function compile(string: string): Function; + function get(root: any, path: string, options?: {}): any; + function helper(name: string, func: Function, dependentKeys?: string): void; + function helper(name: string, view: View, dependentKeys?: string): void; + class helpers { + action(actionName: string, context: any, options?: {}): void; + bindAttr(options?: {}): string; + connectOutlet(outletName: string, view: {}): void; + control(path: string, modelPath: string, options?: {}): string; + debugger(property: string): void; + disconnectOutlet(outletName: string): void; + each(name: string, path: string, options?: {}): void; + if(context: Function, options?: {}): string; + init(): void; + input(options?: {}): void; + linkTo(routeName: string, context: any, options?: {}): string; + loc(str: string): void; + log(property: string): void; + outlet(property: string): string; + partial(partialName: string): void; + render(name: string, context?: string, options?: {}): string; + textarea(options?: {}): void; + unbound(property: string): string; + unless(context: Function, options?: {}): string; + view(path: string, options?: {}): string; + with(context: Function, options?: {}): string; + yield(options?: {}): string; + } + function precompile(string: string): void; + function registerBoundHelper(name: string, func: Function, dependentKeys?: string): void; + class Compiler { } + class JavaScriptCompiler { } + function registerHelper(name: string, fn: Function, inverse?: boolean): void; + function registerPartial(name: string, str: any): void; + function K(): any; + function createFrame(objec: any): any; + function Exception(message: string): void; + class SafeString { + constructor(str: string); + static toString(): string; + } + function parse(string: string): any; + function print(ast: any): void; + var logger: typeof Ember.Logger; + function log(level: string, str: string): void; + function compile(environment: any, options?: any, context?: any, asObject?: any): any; + } + class HashLocation extends Object { + static detect(obj: any): boolean; + static detectInstance(obj: any): boolean; + /** + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ + static eachComputedProperty(callback: Function, binding: {}): void; + /** + Returns the original hash that was passed to meta(). + @param key property name + **/ + static metaForProperty(key: string): {}; + static isClass: boolean; + static isMethod: boolean; + } + class HistoryLocation extends Object { + static detect(obj: any): boolean; + static detectInstance(obj: any): boolean; + /** + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ + static eachComputedProperty(callback: Function, binding: {}): void; + /** + Returns the original hash that was passed to meta(). + @param key property name + **/ + static metaForProperty(key: string): {}; + static isClass: boolean; + static isMethod: boolean; + rootURL: string; + } + var IS_BINDING: RegExp; + class Instrumentation { + getProperties(obj: any, list: any[]): {}; + getProperties(obj: any, ...args: string[]): {}; + instrument(name: string, payload: any, callback: Function, binding: any): void; + reset(): void; + subscribe(pattern: string, object: any): void; + unsubscribe(subscriber: any): void; + } + var K: Function; + var LOG_BINDINGS: boolean; + var LOG_STACKTRACE_ON_DEPRECATION: boolean; + var LOG_VERSION: boolean; + class LinkView extends View { + static detect(obj: any): boolean; + static detectInstance(obj: any): boolean; + /** + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ + static eachComputedProperty(callback: Function, binding: {}): void; + /** + Returns the original hash that was passed to meta(). + @param key property name + **/ + static metaForProperty(key: string): {}; + static isClass: boolean; + static isMethod: boolean; + init(): void; + active: any; + activeClass: string; + attributeBindings: any; + classNameBindings: string[]; + disabled: any; + disabledClass: string; + eventName: string; + href: any; + loading: any; + loadingClass: string; + loadingHref: string; + rel: any; + replace: boolean; + title: any; + click: Function; + } + class Location { + create(options?: {}): any; + registerImplementation(name: string, implementation: any): void; + } + var Logger: { + assert(param: any): void; + debug(...args: any[]): void; + error(...args: any[]): void; + info(...args: any[]): void; + log(...args: any[]): void; + warn(...args: any[]): void; + }; + function MANDATORY_SETTER_FUNCTION(value: string): void; + var META_KEY: string; + class Map { + copy(): Map; + static create(): Map; + forEach(callback: Function, self: any): void; + get(key: any): any; + has(key: any): boolean; + remove(key: any): boolean; + set(key: any, value: any): void; + length: number; + } + class MapWithDefault extends Map { + copy(): MapWithDefault; + static create(): MapWithDefault; + } + class Mixin { + apply(obj: any): any; + /** + Creates an instance of the class. + @param arguments A hash containing values with which to initialize the newly instantiated object. + **/ + static create(...args: CoreObjectArguments[]): T; + detect(obj: any): boolean; + reopen(args?: {}): T; + } + class MutableArray implements Array, MutableEnumberable { + addArrayObserver(target: any, opts?: EnumerableConfigurationOptions): any[]; + addEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; + any(callback: Function, target?: any): boolean; + anyBy(key: string, value?: string): boolean; + arrayContentDidChange(startIdx: number, removeAmt: number, addAmt: number): any[]; + arrayContentWillChange(startIdx: number, removeAmt: number, addAmt: number): any[]; + someProperty(key: string, value?: string): boolean; + clear(): any[]; + compact(): any[]; + contains(obj: any): boolean; + enumerableContentDidChange(start: number, removing: number, adding: number): any; + enumerableContentDidChange(start: number, removing: Enumerable, adding: number): any; + enumerableContentDidChange(start: number, removing: number, adding: Enumerable): any; + enumerableContentDidChange(start: number, removing: Enumerable, adding: Enumerable): any; + enumerableContentDidChange(removing: number, adding: number): any; + enumerableContentDidChange(removing: Enumerable, adding: number): any; + enumerableContentDidChange(removing: number, adding: Enumerable): any; + enumerableContentDidChange(removing: Enumerable, adding: Enumerable): any; + enumerableContentWillChange(removing: number, adding: number): Enumerable; + enumerableContentWillChange(removing: Enumerable, adding: number): Enumerable; + enumerableContentWillChange(removing: number, adding: Enumerable): Enumerable; + enumerableContentWillChange(removing: Enumerable, adding: Enumerable): Enumerable; + every(callback: Function, target?: any): boolean; + everyBy(key: string, value?: string): boolean; + everyProperty(key: string, value?: string): boolean; + filter(callback: Function, target: any): any[]; + filterBy(key: string, value?: string): any[]; + find(callback: Function, target: any): any; + findBy(key: string, value?: string): any; + forEach(callback: Function, target?: any): any; + getEach(key: string): any[]; + indexOf(object: any, startAt: number): number; + insertAt(idx: number, object: any): any[]; + invoke(methodName: string, ...args: any[]): any[]; + lastIndexOf(object: any, startAt: number): number; + map: ItemIndexEnumerableCallbackTarget; + mapBy(key: string): any[]; + nextObject(index: number, previousObject: any, context: any): any; + objectAt(idx: number): any; + objectsAt(...args: number[]): any[]; + popObject(): any; + pushObject(obj: any): any; + pushObjects(...args: any[]): any[]; + reduce(callback: ReduceCallback, initialValue: any, reducerProperty: string): any; + reject: ItemIndexEnumerableCallbackTarget; + rejectBy(key: string, value?: string): any[]; + removeArrayObserver(target: any, opts: EnumerableConfigurationOptions): any[]; + removeAt(start: number, len: number): any; + removeEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; + replace(idx: number, amt: number, objects: any[]): any; + reverseObjects(): any[]; + setEach(key: string, value?: any): any; + setObjects(objects: any[]): any[]; + shiftObject(): any; + slice(beginIndex?: number, endIndex?: number): any[]; + some(callback: Function, target?: any): boolean; + toArray(): any[]; + uniq(): Enumerable; + unshiftObject(object: any): any; + unshiftObjects(objects: any[]): any[]; + without(value: any): Enumerable; + '[]': any[]; + '@each': EachProxy; + Boolean: boolean; + firstObject: any; + hasEnumerableObservers: boolean; + lastObject: any; + length: number; + addObject(object: any): any; + addObjects(objects: Enumerable): MutableEnumberable; + removeObject(object: any): any; + removeObjects(objects: Enumerable): MutableEnumberable; + } + class MutableEnumberable implements Enumerable { + addEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; + addObject(object: any): any; + addObjects(objects: Enumerable): MutableEnumberable; + any(callback: Function, target?: any): boolean; + anyBy(key: string, value?: string): boolean; + someProperty(key: string, value?: string): boolean; + compact(): any[]; + contains(obj: any): boolean; + enumerableContentDidChange(start: number, removing: number, adding: number): any; + enumerableContentDidChange(start: number, removing: Enumerable, adding: number): any; + enumerableContentDidChange(start: number, removing: number, adding: Enumerable): any; + enumerableContentDidChange(start: number, removing: Enumerable, adding: Enumerable): any; + enumerableContentDidChange(removing: number, adding: number): any; + enumerableContentDidChange(removing: Enumerable, adding: number): any; + enumerableContentDidChange(removing: number, adding: Enumerable): any; + enumerableContentDidChange(removing: Enumerable, adding: Enumerable): any; + enumerableContentWillChange(removing: number, adding: number): Enumerable; + enumerableContentWillChange(removing: Enumerable, adding: number): Enumerable; + enumerableContentWillChange(removing: number, adding: Enumerable): Enumerable; + enumerableContentWillChange(removing: Enumerable, adding: Enumerable): Enumerable; + every(callback: Function, target?: any): boolean; + everyBy(key: string, value?: string): boolean; + everyProperty(key: string, value?: string): boolean; + filter(callback: Function, target: any): any[]; + filterBy(key: string, value?: string): any[]; + find(callback: Function, target: any): any; + findBy(key: string, value?: string): any; + forEach(callback: Function, target?: any): any; + getEach(key: string): any[]; + invoke(methodName: string, ...args: any[]): any[]; + map: ItemIndexEnumerableCallbackTarget; + mapBy(key: string): any[]; + nextObject(index: number, previousObject: any, context: any): any; + reduce(callback: ReduceCallback, initialValue: any, reducerProperty: string): any; + reject: ItemIndexEnumerableCallbackTarget; + rejectBy(key: string, value?: string): any[]; + removeEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; + removeObject(object: any): any; + removeObjects(objects: Enumerable): MutableEnumberable; + setEach(key: string, value?: any): any; + some(callback: Function, target?: any): boolean; + toArray(): any[]; + uniq(): Enumerable; + without(value: any): Enumerable; + '[]': any[]; + firstObject: any; + hasEnumerableObservers: boolean; + lastObject: any; + } + var NAME_KEY: string; + class Namespace extends Object { + static detect(obj: any): boolean; + static detectInstance(obj: any): boolean; + /** + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ + static eachComputedProperty(callback: Function, binding: {}): void; + /** + Returns the original hash that was passed to meta(). + @param key property name + **/ + static metaForProperty(key: string): {}; + static isClass: boolean; + static isMethod: boolean; + } + class NativeArray implements MutableArray, Observable, Copyable { + constructor(arr: any[]); + static activate(): void; + addArrayObserver(target: any, opts?: EnumerableConfigurationOptions): any[]; + addEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; + any(callback: Function, target?: any): boolean; + anyBy(key: string, value?: string): boolean; + arrayContentDidChange(startIdx: number, removeAmt: number, addAmt: number): any[]; + arrayContentWillChange(startIdx: number, removeAmt: number, addAmt: number): any[]; + someProperty(key: string, value?: any): boolean; + clear(): any[]; + compact(): any[]; + contains(obj: any): boolean; + enumerableContentDidChange(start: number, removing: number, adding: number): any; + enumerableContentDidChange(start: number, removing: Enumerable, adding: number): any; + enumerableContentDidChange(start: number, removing: number, adding: Enumerable): any; + enumerableContentDidChange(start: number, removing: Enumerable, adding: Enumerable): any; + enumerableContentDidChange(removing: number, adding: number): any; + enumerableContentDidChange(removing: Enumerable, adding: number): any; + enumerableContentDidChange(removing: number, adding: Enumerable): any; + enumerableContentDidChange(removing: Enumerable, adding: Enumerable): any; + enumerableContentWillChange(removing: number, adding: number): Enumerable; + enumerableContentWillChange(removing: Enumerable, adding: number): Enumerable; + enumerableContentWillChange(removing: number, adding: Enumerable): Enumerable; + enumerableContentWillChange(removing: Enumerable, adding: Enumerable): Enumerable; + every(callback: Function, target?: any): boolean; + everyBy(key: string, value?: string): boolean; + everyProperty(key: string, value?: any): boolean; + filter(callback: Function, target: any): any[]; + filterBy(key: string, value?: string): any[]; + find(callback: Function, target: any): any; + findBy(key: string, value?: string): any; + forEach(callback: Function, target?: any): any; + getEach(key: string): any[]; + indexOf(object: any, startAt: number): number; + insertAt(idx: number, object: any): any[]; + invoke(methodName: string, ...args: any[]): any[]; + lastIndexOf(object: any, startAt: number): number; + map: ItemIndexEnumerableCallbackTarget; + mapBy(key: string): any[]; + nextObject(index: number, previousObject: any, context: any): any; + objectAt(idx: number): any; + objectsAt(...args: number[]): any[]; + popObject(): any; + pushObject(obj: any): any; + pushObjects(...args: any[]): any[]; + reduce(callback: ReduceCallback, initialValue: any, reducerProperty: string): any; + reject: ItemIndexEnumerableCallbackTarget; + rejectBy(key: string, value?: string): any[]; + removeArrayObserver(target: any, opts: EnumerableConfigurationOptions): any[]; + removeAt(start: number, len: number): any; + removeEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; + replace(idx: number, amt: number, objects: any[]): any; + reverseObjects(): any[]; + setEach(key: string, value?: any): any; + setObjects(objects: any[]): any[]; + shiftObject(): any; + slice(beginIndex?: number, endIndex?: number): any[]; + some(callback: Function, target?: any): boolean; + toArray(): any[]; + uniq(): Enumerable; + unshiftObject(object: any): any; + unshiftObjects(objects: any[]): any[]; + without(value: any): Enumerable; + '[]': any[]; + '@each': EachProxy; + Boolean: boolean; + firstObject: any; + hasEnumerableObservers: boolean; + lastObject: any; + length: number; + addObject(object: any): any; + addObjects(objects: Enumerable): MutableEnumberable; + removeObject(object: any): any; + removeObjects(objects: Enumerable): MutableEnumberable; + addObserver: ModifyObserver; + beginPropertyChanges(): Observable; + cacheFor(keyName: string): any; + decrementProperty(keyName: string, decrement?: number): number; + endPropertyChanges(): Observable; + get(keyName: string): any; + getProperties(...args: string[]): {}; + getProperties(keys: string[]): {}; + getWithDefault(keyName: string, defaultValue: any): any; + hasObserverFor(key: string): boolean; + incrementProperty(keyName: string, increment?: number): number; + notifyPropertyChange(keyName: string): Observable; + propertyDidChange(keyName: string): Observable; + propertyWillChange(keyName: string): Observable; + removeObserver(key: string, target: any, method: string): void; + removeObserver(key: string, target: any, method: Function): void; + set(keyName: string, value: any): Observable; + setProperties(hash: {}): Observable; + toggleProperty(keyName: string): any; + copy(deep: boolean): Copyable; + frozenCopy(): Copyable; + } + class NoneLocation extends Object { + static detect(obj: any): boolean; + static detectInstance(obj: any): boolean; + /** + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ + static eachComputedProperty(callback: Function, binding: {}): void; + /** + Returns the original hash that was passed to meta(). + @param key property name + **/ + static metaForProperty(key: string): {}; + static isClass: boolean; + static isMethod: boolean; + } + var ORDER_DEFINITION: string[]; + class Object extends CoreObject implements Observable { + addObserver: ModifyObserver; + beginPropertyChanges(): Observable; + cacheFor(keyName: string): any; + decrementProperty(keyName: string, decrement?: number): number; + endPropertyChanges(): Observable; + + /** + * Retrieves the value of a property from the object + * @param keyName + * @returns {} + */ + get(keyName: string): any; + + /** + * Retrieves the value of a property from the object + * @param keyName + * @returns {} + */ + get(keyName: string): T; + + getProperties(...args: string[]): {}; + getProperties(keys: string[]): {}; + getWithDefault(keyName: string, defaultValue: any): any; + hasObserverFor(key: string): boolean; + incrementProperty(keyName: string, increment?: number): number; + notifyPropertyChange(keyName: string): Observable; + propertyDidChange(keyName: string): Observable; + propertyWillChange(keyName: string): Observable; + removeObserver(key: string, target: any, method: string): Observable; + removeObserver(key: string, target: any, method: Function): Observable; + set(keyName: string, value: any): Observable; + setProperties(hash: {}): Observable; + toggleProperty(keyName: string): any; + } + class ObjectController extends ObjectProxy implements ControllerMixin { + replaceRoute(name: string, ...args: any[]): void; + transitionToRoute(name: string, ...args: any[]): void; + controllers: Object; + needs: string[]; + target: any; + model: any; + queryParams: any; + send(name: string, ...args: any[]): void; + actions: {}; + } + class ObjectProxy extends Object { + static detect(obj: any): boolean; + static detectInstance(obj: any): boolean; + /** + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ + static eachComputedProperty(callback: Function, binding: {}): void; + /** + Returns the original hash that was passed to meta(). + @param key property name + **/ + static metaForProperty(key: string): {}; + static isClass: boolean; + static isMethod: boolean; + /** + The object whose properties will be forwarded. + **/ + content: Object; + } + class Observable { + addObserver: ModifyObserver; + beginPropertyChanges(): Observable; + cacheFor(keyName: string): any; + decrementProperty(keyName: string, decrement?: number): number; + endPropertyChanges(): Observable; + get(keyName: string): any; + getProperties(...args: string[]): {}; + getProperties(keys: string[]): {}; + getWithDefault(keyName: string, defaultValue: any): any; + hasObserverFor(key: string): boolean; + incrementProperty(keyName: string, increment?: number): number; + notifyPropertyChange(keyName: string): Observable; + propertyDidChange(keyName: string): Observable; + propertyWillChange(keyName: string): Observable; + removeObserver(key: string, target: {}, method: string): void; + removeObserver(key: string, target: {}, method: Function): void; + set(keyName: string, value: any): Observable; + setProperties(hash: {}): Observable; + /** + Set the value of a boolean property to the opposite of its current value. + */ + toggleProperty(keyName: string): boolean; + } + class OrderedSet { + add(obj: any): void; + clear(): void; + copy(): OrderedSet; + static create(): OrderedSet; + forEach(fn: Function, self: any): void; + has(obj: any): boolean; + isEmpty(): boolean; + remove(obj: any): void; + toArray(): any[]; + } + + // FYI - RSVP source comes from https://github.com/tildeio/rsvp.js/blob/master/lib/rsvp/promise.js + namespace RSVP { + interface PromiseResolve { + (value?: any): void; + } + interface PromiseReject { + (reason?: any): void; + } + interface PromiseResolverFunction { + (resolve: PromiseResolve, reject: PromiseReject): void; + } + + class Promise { + + /** + Promise objects represent the eventual result of an asynchronous operation. The + primary way of interacting with a promise is through its `then` method, which + registers callbacks to receive either a promise's eventual value or the reason + why the promise cannot be fulfilled. + @class RSVP.Promise + @param {function} resolver + @param {String} label optional string for labeling the promise. + Useful for tooling. + @constructor + */ + constructor(resolver: PromiseResolverFunction, label?: string); + + /** + The primary way of interacting with a promise is through its `then` method, + which registers callbacks to receive either a promise's eventual value or the + reason why the promise cannot be fulfilled. + @method then + @param {Function} onFulfilled + @param {Function} onRejected + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} + */ + then(onFulfilled?: Function, onRejected?: Function): Promise; + + /** + `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same + as the catch block of a try/catch statement. + + @method catch + @param {Function} onRejection + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} + */ + catch(onRejection: Function, label?: string): Promise; + + /** + `finally` will be invoked regardless of the promise's fate just as native + try/catch/finally behaves + + @method finally + @param {Function} callback + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} + */ + finally(callback: Function, label?: string): Promise; + } + } + class RenderBuffer { + addClass(className: string): RenderBuffer; + attr(name: string, value: any): any; + element(): HTMLElement; + id(id: string): RenderBuffer; + prop(name: string, value: string): any; + push(string: string): RenderBuffer; + removeAttr(name: string): RenderBuffer; + removeProp(name: string): RenderBuffer; + string(): string; + style(name: string, value: string): RenderBuffer; + classes: any[]; + elementAttributes: {}; + elementId: string; + elementProperties: {}; + elementStyle: {}; + elementTag: string; + parentBuffer: RenderBuffer; + } + + /** + The `Ember.Route` class is used to define individual routes. Refer to + the [routing guide](http://emberjs.com/guides/routing/) for documentation. + */ + class Route extends Object implements ActionHandlerMixin, Evented { + + static isClass: boolean; + static isMethod: boolean; + + /** + This hook is executed when the router enters the route. It is not executed + when the model for the route changes. + @method activate + */ + activate: Function; + + /** + This hook is called after this route's model has resolved. + It follows identical async/promise semantics to `beforeModel` + but is provided the route's resolved model in addition to + the `transition`, and is therefore suited to performing + logic that can only take place after the model has already + resolved. + + Refer to documentation for `beforeModel` for a description + of transition-pausing semantics when a promise is returned + from this hook. + @method afterModel + @param {Object} resolvedModel the value returned from `model`, + or its resolved value if it was a promise + @param {Transition} transition + @return {Promise} if the value returned from this hook is + a promise, the transition will pause until the transition + resolves. Otherwise, non-promise return values are not + utilized in any way. + */ + afterModel(resolvedModel: any, transition: EmberStates.Transition): RSVP.Promise; + + /** + This hook is the first of the route entry validation hooks + called when an attempt is made to transition into a route + or one of its children. It is called before `model` and + `afterModel`, and is appropriate for cases when: + 1) A decision can be made to redirect elsewhere without + needing to resolve the model first. + 2) Any async operations need to occur first before the + model is attempted to be resolved. + This hook is provided the current `transition` attempt + as a parameter, which can be used to `.abort()` the transition, + save it for a later `.retry()`, or retrieve values set + on it from a previous hook. You can also just call + `this.transitionTo` to another route to implicitly + abort the `transition`. + You can return a promise from this hook to pause the + transition until the promise resolves (or rejects). This could + be useful, for instance, for retrieving async code from + the server that is required to enter a route. + + @method beforeModel + @param {Transition} transition + @return {Promise} if the value returned from this hook is + a promise, the transition will pause until the transition + resolves. Otherwise, non-promise return values are not + utilized in any way. + */ + beforeModel(transition: EmberStates.Transition): RSVP.Promise; + + /** + The controller associated with this route. + + @property controller + @type Ember.Controller + @since 1.6.0 + */ + controller: Controller; + + /** + Returns the controller for a particular route or name. + The controller instance must already have been created, either through entering the + associated route or using `generateController`. + + @method controllerFor + @param {String} name the name of the route or controller + @return {Ember.Controller} + */ + controllerFor(name: string): Controller; + + /** + The name of the controller to associate with this route. + By default, Ember will lookup a route's controller that matches the name + of the route (i.e. `App.PostController` for `App.PostRoute`). However, + if you would like to define a specific controller to use, you can do so + using this property. + This is useful in many ways, as the controller specified will be: + * passed to the `setupController` method. + * used as the controller for the view being rendered by the route. + * returned from a call to `controllerFor` for the route. + @property controllerName + @type String + @default null + @since 1.4.0 + */ + controllerName: string; + + /** + This hook is executed when the router completely exits this route. It is + not executed when the model for the route changes. + @method deactivate + */ + deactivate: Function; + + /** + Deserializes value of the query parameter based on defaultValueType + @method deserializeQueryParam + @param {Object} value + @param {String} urlKey + @param {String} defaultValueType + */ + deserializeQueryParam(value: any, urlKey: string, defaultValueType: string): any; + + /** + Disconnects a view that has been rendered into an outlet. + You may pass any or all of the following options to `disconnectOutlet`: + * `outlet`: the name of the outlet to clear (default: 'main') + * `parentView`: the name of the view containing the outlet to clear + (default: the view rendered by the parent route) + + @method disconnectOutlet + @param {Object|String} options the options hash or outlet name + */ + disconnectOutlet(options: DisconnectOutletOptions|string): void; + + /** + @method findModel + @param {String} type the model type + @param {Object} value the value passed to find + */ + findModel(type: string, value: any): any; + + /** + Generates a controller for a route. + If the optional model is passed then the controller type is determined automatically, + e.g., an ArrayController for arrays. + + @method generateController + @param {String} name the name of the controller + @param {Object} model the model to infer the type of the controller (optional) + */ + generateController(name: string, model: {}): Controller; + + /** + Perform a synchronous transition into another route without attempting + to resolve promises, update the URL, or abort any currently active + asynchronous transitions (i.e. regular transitions caused by + `transitionTo` or URL changes). + This method is handy for performing intermediate transitions on the + way to a final destination route, and is called internally by the + default implementations of the `error` and `loading` handlers. + @method intermediateTransitionTo + @param {String} name the name of the route + @param {...Object} models the model(s) to be used while transitioning + to the route. + @since 1.2.0 + */ + intermediateTransitionTo(name: string, ...models: any[]): void; + + /** + A hook you can implement to convert the URL into the model for + this route. + + @method model + @param {Object} params the parameters extracted from the URL + @param {Transition} transition + @return {Object|Promise} the model for this route. If + a promise is returned, the transition will pause until + the promise resolves, and the resolved value of the promise + will be used as the model for this route. + */ + model(params: {}, transition: EmberStates.Transition): any|RSVP.Promise; + + /** + Returns the model of a parent (or any ancestor) route + in a route hierarchy. During a transition, all routes + must resolve a model object, and if a route + needs access to a parent route's model in order to + resolve a model (or just reuse the model from a parent), + it can call `this.modelFor(theNameOfParentRoute)` to + retrieve it. + + @method modelFor + @param {String} name the name of the route + @return {Object} the model object + */ + modelFor(name: string): {}; + + /** + Retrieves parameters, for current route using the state.params + variable and getQueryParamsFor, using the supplied routeName. + @method paramsFor + @param {String} name + */ + paramsFor(name: string) : any; + + /** + Configuration hash for this route's queryParams. + @property queryParams + @for Ember.Route + @type Hash + */ + queryParams: {}; + + /** + Refresh the model on this route and any child routes, firing the + `beforeModel`, `model`, and `afterModel` hooks in a similar fashion + to how routes are entered when transitioning in from other route. + The current route params (e.g. `article_id`) will be passed in + to the respective model hooks, and if a different model is returned, + `setupController` and associated route hooks will re-fire as well. + An example usage of this method is re-querying the server for the + latest information using the same parameters as when the route + was first entered. + Note that this will cause `model` hooks to fire even on routes + that were provided a model object when the route was initially + entered. + @method refresh + @return {Transition} the transition object associated with this + attempted transition + @since 1.4.0 + */ + redirect(): EmberStates.Transition; + + + /** + Refresh the model on this route and any child routes, firing the + `beforeModel`, `model`, and `afterModel` hooks in a similar fashion + to how routes are entered when transitioning in from other route. + The current route params (e.g. `article_id`) will be passed in + to the respective model hooks, and if a different model is returned, + `setupController` and associated route hooks will re-fire as well. + An example usage of this method is re-querying the server for the + latest information using the same parameters as when the route + was first entered. + Note that this will cause `model` hooks to fire even on routes + that were provided a model object when the route was initially + entered. + @method refresh + @return {Transition} the transition object associated with this + attempted transition + @since 1.4.0 + */ + refresh(): EmberStates.Transition; + + /** + `render` is used to render a template into a region of another template + (indicated by an `{{outlet}}`). `render` is used both during the entry + phase of routing (via the `renderTemplate` hook) and later in response to + user interaction. + + @method render + @param {String} name the name of the template to render + @param {Object} [options] the options + @param {String} [options.into] the template to render into, + referenced by name. Defaults to the parent template + @param {String} [options.outlet] the outlet inside `options.template` to render into. + Defaults to 'main' + @param {String|Object} [options.controller] the controller to use for this template, + referenced by name or as a controller instance. Defaults to the Route's paired controller + @param {Object} [options.model] the model object to set on `options.controller`. + Defaults to the return value of the Route's model hook + */ + render(name: string, options?: RenderOptions): void; + + /** + A hook you can use to render the template for the current route. + This method is called with the controller for the current route and the + model supplied by the `model` hook. By default, it renders the route's + template, configured with the controller for the route. + This method can be overridden to set up and render additional or + alternative templates. + + @method renderTemplate + @param {Object} controller the route's controller + @param {Object} model the route's model + */ + renderTemplate(controller: Controller, model: {}): void; + + /** + Transition into another route while replacing the current URL, if possible. + This will replace the current history entry instead of adding a new one. + Beside that, it is identical to `transitionTo` in all other respects. See + 'transitionTo' for additional information regarding multiple models. + + @method replaceWith + @param {String} name the name of the route or a URL + @param {...Object} models the model(s) or identifier(s) to be used while + transitioning to the route. + @return {Transition} the transition object associated with this + attempted transition + */ + replaceWith(name: string, ...models: any[]): void; + + /** + A hook you can use to reset controller values either when the model + changes or the route is exiting. + + @method resetController + @param {Controller} controller instance + @param {Boolean} isExiting + @param {Object} transition + @since 1.7.0 + */ + resetController(controller: Ember.Controller, isExiting: boolean, transition: any): void; + + /** + A hook you can implement to convert the route's model into parameters + for the URL. + + The default `serialize` method will insert the model's `id` into the + route's dynamic segment (in this case, `:post_id`) if the segment contains '_id'. + If the route has multiple dynamic segments or does not contain '_id', `serialize` + will return `Ember.getProperties(model, params)` + This method is called when `transitionTo` is called with a context + in order to populate the URL. + @method serialize + @param {Object} model the route's model + @param {Array} params an Array of parameter names for the current + route (in the example, `['post_id']`. + @return {Object} the serialized parameters + */ + serialize(model: {}, params: string[]): string; + + /** + Serializes value of the query parameter based on defaultValueType + @method serializeQueryParam + @param {Object} value + @param {String} urlKey + @param {String} defaultValueType + */ + serializeQueryParam(value: any, urlKey: string, defaultValueType: string): string; + + /** + Serializes the query parameter key + @method serializeQueryParamKey + @param {String} controllerPropertyName + */ + serializeQueryParamKey(controllerPropertyName: string): string; + + /** + A hook you can use to setup the controller for the current route. + This method is called with the controller for the current route and the + model supplied by the `model` hook. + By default, the `setupController` hook sets the `model` property of + the controller to the `model`. + If you implement the `setupController` hook in your Route, it will + prevent this default behavior. If you want to preserve that behavior + when implementing your `setupController` function, make sure to call + `_super` + @method setupController + @param {Controller} controller instance + @param {Object} model + */ + setupController(controller: Controller, model: {}): void; + + /** + Store property provides a hook for data persistence libraries to inject themselves. + By default, this store property provides the exact same functionality previously + in the model hook. + Currently, the required interface is: + `store.find(modelName, findArguments)` + @method store + @param {Object} store + */ + store(store: any): any; + + /** + The name of the template to use by default when rendering this routes + template. + This is similar with `viewName`, but is useful when you just want a custom + template without a view. + + @property templateName + @type String + @default null + @since 1.4.0 + */ + templateName: string; + + /** + Transition the application into another route. The route may + be either a single route or route path + + @method transitionTo + @param {String} name the name of the route or a URL + @param {...Object} models the model(s) or identifier(s) to be used while + transitioning to the route. + @param {Object} [options] optional hash with a queryParams property + containing a mapping of query parameters + @return {Transition} the transition object associated with this + attempted transition + */ + transitionTo(name: string, ...object: any[]): EmberStates.Transition; + + /** + The name of the view to use by default when rendering this routes template. + When rendering a template, the route will, by default, determine the + template and view to use from the name of the route itself. If you need to + define a specific view, set this property. + This is useful when multiple routes would benefit from using the same view + because it doesn't require a custom `renderTemplate` method. + @property viewName + @type String + @default null + @since 1.4.0 + */ + viewName: string; + + // ActionHandlerMixin methods + + /** + Sends an action to the router, which will delegate it to the currently + active route hierarchy per the bubbling rules explained under actions + + @method send + @param {String} actionName The action to trigger + @param {*} context a context to send with the action + */ + send(name: string, ...args: any[]): void; + + /** + The collection of functions, keyed by name, available on this + `ActionHandler` as action targets. + These functions will be invoked when a matching `{{action}}` is triggered + from within a template and the application's current route is this route. + Actions can also be invoked from other parts of your application + via `ActionHandler#send`. + The `actions` hash will inherit action handlers from + the `actions` hash defined on extended parent classes + or mixins rather than just replace the entire hash. + + Within a Controller, Route, View or Component's action handler, + the value of the `this` context is the Controller, Route, View or + Component object: + + It is also possible to call `this._super.apply(this, arguments)` from within an + action handler if it overrides a handler defined on a parent + class or mixin. + + ## Bubbling + By default, an action will stop bubbling once a handler defined + on the `actions` hash handles it. To continue bubbling the action, + you must return `true` from the handler + + @property actions + @type Hash + @default null + */ + actions: ActionsHash; + + // Evented methods + + /** + Subscribes to a named event with given function. + + An optional target can be passed in as the 2nd argument that will + be set as the "this" for the callback. This is a good way to give your + function access to the object triggering the event. When the target + parameter is used the callback becomes the third argument. + + @method on + @param {String} name The name of the event + @param {Object} [target] The "this" binding for the callback + @param {Function} method The callback to execute + @return this + */ + on(name: string, target: any, method: Function): Evented; + + /** + Subscribes a function to a named event and then cancels the subscription + after the first time the event is triggered. It is good to use ``one`` when + you only care about the first time an event has taken place. + This function takes an optional 2nd argument that will become the "this" + value for the callback. If this argument is passed then the 3rd argument + becomes the function. + + @method one + @param {String} name The name of the event + @param {Object} [target] The "this" binding for the callback + @param {Function} method The callback to execute + @return this + */ + one(name: string, target: any, method: Function): Evented; + + /** + Triggers a named event for the object. Any additional arguments + will be passed as parameters to the functions that are subscribed to the + event. + + @method trigger + @param {String} name The name of the event + @param {Object...} args Optional arguments to pass on + */ + trigger(name: string, ...args: string[]): void; + + /** + Cancels subscription for given name, target, and method. + + @method off + @param {String} name The name of the event + @param {Object} target The target of the subscription + @param {Function} method The function of the subscription + @return this + */ + off(name: string, target:any , method: Function): Evented; + + /** + Checks to see if object has any subscriptions for named event. + + @method has + @param {String} name The name of the event + @return {Boolean} does the object have a subscription for event + */ + has(name: string): boolean; + } + + class Router extends Object { + static detect(obj: any): boolean; + static detectInstance(obj: any): boolean; + /** + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ + static eachComputedProperty(callback: Function, binding: {}): void; + /** + Returns the original hash that was passed to meta(). + @param key property name + **/ + static metaForProperty(key: string): {}; + static isClass: boolean; + static isMethod: boolean; + map(callback: Function): Router; + } + class RouterDSL { + resource(name: string, options?: {}, callback?: Function): void; + resource(name: string, callback: Function): void; + route(name: string, options?: {}): void; + } + var SHIM_ES5: boolean; + var STRINGS: boolean; + class Select extends View { + static detect(obj: any): boolean; + static detectInstance(obj: any): boolean; + /** + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ + static eachComputedProperty(callback: Function, binding: {}): void; + /** + Returns the original hash that was passed to meta(). + @param key property name + **/ + static metaForProperty(key: string): {}; + static isClass: boolean; + static isMethod: boolean; + content: any[]; + groupView: View; + multiple: boolean; + optionGroupPath: string; + optionLabelPath: string; + optionValuePath: string; + optionView: View; + prompt: string; + selection: any; + value: string; + } + class SelectOption extends View { + static detect(obj: any): boolean; + static detectInstance(obj: any): boolean; + /** + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ + static eachComputedProperty(callback: Function, binding: {}): void; + /** + Returns the original hash that was passed to meta(). + @param key property name + **/ + static metaForProperty(key: string): {}; + static isClass: boolean; + static isMethod: boolean; + } + class Set extends CoreObject implements MutableEnumberable, Copyable, Freezable { + addEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Set; + addObject(object: any): any; + addObjects(objects: Enumerable): Set; + any(callback: Function, target?: any): boolean; + anyBy(key: string, value?: string): boolean; + someProperty(key: string, value?: string): boolean; + compact(): any[]; + contains(obj: any): boolean; + enumerableContentDidChange(start: number, removing: number, adding: number): any; + enumerableContentDidChange(start: number, removing: Enumerable, adding: number): any; + enumerableContentDidChange(start: number, removing: number, adding: Enumerable): any; + enumerableContentDidChange(start: number, removing: Enumerable, adding: Enumerable): any; + enumerableContentDidChange(removing: number, adding: number): any; + enumerableContentDidChange(removing: Enumerable, adding: number): any; + enumerableContentDidChange(removing: number, adding: Enumerable): any; + enumerableContentDidChange(removing: Enumerable, adding: Enumerable): any; + enumerableContentWillChange(removing: number, adding: number): Set; + enumerableContentWillChange(removing: Enumerable, adding: number): Set; + enumerableContentWillChange(removing: number, adding: Enumerable): Set; + enumerableContentWillChange(removing: Enumerable, adding: Enumerable): Set; + every(callback: Function, target?: any): boolean; + everyBy(key: string, value?: string): boolean; + everyProperty(key: string, value?: string): boolean; + filter(callback: Function, target: any): any[]; + filterBy(key: string, value?: string): any[]; + find(callback: Function, target: any): any; + findBy(key: string, value?: string): any; + forEach(callback: Function, target?: any): any; + getEach(key: string): any[]; + invoke(methodName: string, ...args: any[]): any[]; + map: ItemIndexEnumerableCallbackTarget; + mapBy(key: string): any[]; + nextObject(index: number, previousObject: any, context: any): any; + reduce(callback: ReduceCallback, initialValue: any, reducerProperty: string): any; + reject: ItemIndexEnumerableCallbackTarget; + rejectBy(key: string, value?: string): any[]; + removeEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Set; + removeObject(object: any): any; + removeObjects(objects: Enumerable): Set; + setEach(key: string, value?: any): any; + some(callback: Function, target?: any): boolean; + toArray(): any[]; + uniq(): Set; + without(value: any): Set; + '[]': any[]; + firstObject: any; + hasEnumerableObservers: boolean; + lastObject: any; + copy(deep: boolean): Set; + frozenCopy(): Set; + freeze(): Set; + isFrozen: boolean; + add(obj: any): Set; + addEach(...args: any[]): Set; + clear(): Set; + isEqual(obj: Set): boolean; + pop(): any; + push(obj: any): Set; + remove(obj: any): Set; + removeEach(...args: any[]): Set; + shift(): any; + unshift(obj: any): Set; + length: number; + } + class SortableMixin implements MutableEnumberable { + addEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; + addObject(object: any): any; + addObjects(objects: Enumerable): MutableEnumberable; + any(callback: Function, target?: any): boolean; + anyBy(key: string, value?: string): boolean; + someProperty(key: string, value?: string): boolean; + compact(): any[]; + contains(obj: any): boolean; + enumerableContentDidChange(start: number, removing: number, adding: number): any; + enumerableContentDidChange(start: number, removing: Enumerable, adding: number): any; + enumerableContentDidChange(start: number, removing: number, adding: Enumerable): any; + enumerableContentDidChange(start: number, removing: Enumerable, adding: Enumerable): any; + enumerableContentDidChange(removing: number, adding: number): any; + enumerableContentDidChange(removing: Enumerable, adding: number): any; + enumerableContentDidChange(removing: number, adding: Enumerable): any; + enumerableContentDidChange(removing: Enumerable, adding: Enumerable): any; + enumerableContentWillChange(removing: number, adding: number): Enumerable; + enumerableContentWillChange(removing: Enumerable, adding: number): Enumerable; + enumerableContentWillChange(removing: number, adding: Enumerable): Enumerable; + enumerableContentWillChange(removing: Enumerable, adding: Enumerable): Enumerable; + every(callback: Function, target?: any): boolean; + everyBy(key: string, value?: string): boolean; + everyProperty(key: string, value?: string): boolean; + filter(callback: Function, target: any): any[]; + filterBy(key: string, value?: string): any[]; + find(callback: Function, target: any): any; + findBy(key: string, value?: string): any; + forEach(callback: Function, target?: any): any; + getEach(key: string): any[]; + invoke(methodName: string, ...args: any[]): any[]; + map: ItemIndexEnumerableCallbackTarget; + mapBy(key: string): any[]; + nextObject(index: number, previousObject: any, context: any): any; + reduce(callback: ReduceCallback, initialValue: any, reducerProperty: string): any; + reject: ItemIndexEnumerableCallbackTarget; + rejectBy(key: string, value?: string): any[]; + removeEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; + removeObject(object: any): any; + removeObjects(objects: Enumerable): MutableEnumberable; + setEach(key: string, value?: any): any; + some(callback: Function, target?: any): boolean; + toArray(): any[]; + uniq(): Enumerable; + without(value: any): Enumerable; + '[]': any[]; + arrangedContent: any; + firstObject: any; + hasEnumerableObservers: boolean; + lastObject: any; + sortAscending: boolean; + sortFunction: Comparable; + sortProperties: any[]; + } + class State extends Object implements Evented { + static detect(obj: any): boolean; + static detectInstance(obj: any): boolean; + /** + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ + static eachComputedProperty(callback: Function, binding: {}): void; + /** + Returns the original hash that was passed to meta(). + @param key property name + **/ + static metaForProperty(key: string): {}; + static isClass: boolean; + static isMethod: boolean; + has(name: string): boolean; + off(name: string, target: any, method: Function): State; + on(name: string, target: any, method: Function): State; + one(name: string, target: any, method: Function): State; + trigger(name: string, ...args: string[]): void; + getPathsCache(stateManager: {}, path: string): {}; + init(): void; + setPathsCache(stateManager: {}, path: string, transitions: any): void; + static transitionTo(target: string): void; + hasContext: boolean; + isLeaf: boolean; + name: string; + parentState: State; + path: string; + enter: Function; + exit: Function; + setup: Function; + } + class StateManager extends State { + static detect(obj: any): boolean; + static detectInstance(obj: any): boolean; + /** + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ + static eachComputedProperty(callback: Function, binding: {}): void; + /** + Returns the original hash that was passed to meta(). + @param key property name + **/ + static metaForProperty(key: string): {}; + static isClass: boolean; + static isMethod: boolean; + contextFreeTransition(currentState: State, path: string): TransitionsHash; + enterState(transition: TransitionsHash): void; + getState(name: string): State; + getStateByPath(root: State, path: string): State; + getStateMeta(state: State, key: string): any; + getStatesInPath(root: State, path: string): State[]; + goToState(path: string, context: any): void; + send(event: string): void; + setStateMeta(state: State, key: string, value: any): any; + stateMetaFor(state: State): {}; + transitionTo(path: string, context: any): void; + triggerSetupContext(transitions: TransitionsHash): void; + unhandledEvent(manager: StateManager, event: string): any; + currentPath: string; + currentState: State; + errorOnUnhandledEvents: boolean; + transitionEvent: string; + } + namespace String { + function camelize(str: string): string; + function capitalize(str: string): string; + function classify(str: string): string; + function dasherize(str: string): string; + function decamelize(str: string): string; + function fmt(...args: string[]): string; + function htmlSafe(str: string): void; // TODO: @returns Handlebars.SafeStringStatic; + function loc(...args: string[]): string; + function underscore(str: string): string; + function w(str: string): string[]; + } + var TEMPLATES: {}; + class TargetActionSupport { + triggerAction(opts: {}): boolean; + } + class Test { + click(selector: string): RSVP.Promise; + fillin(selector: string, text: string): RSVP.Promise; + find(selector: string): JQuery; + findWithAssert(selector: string): JQuery; + injectTestHelpers(): void; + keyEvent(selector: string, type: string, keyCode: number): RSVP.Promise; + static oninjectHelpers(callback: Function): void; + static promise(resolver: Function): RSVP.Promise; + static registerHelper(name: string, helperMethod: Function): void; + removeTestHelpers(): void; + setupForTesting(): void; + static unregisterHelper(name: string): void; + visit(url: string): RSVP.Promise; + wait(value: any): RSVP.Promise; + static adapter: Object; + testHelpers: {}; + } + class TextArea extends View implements TextSupport { + static detect(obj: any): boolean; + static detectInstance(obj: any): boolean; + /** + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ + static eachComputedProperty(callback: Function, binding: {}): void; + /** + Returns the original hash that was passed to meta(). + @param key property name + **/ + static metaForProperty(key: string): {}; + static isClass: boolean; + static isMethod: boolean; + cancel(event: Function): void; + focusIn(event: Function): void; + focusOut(event: Function): void; + insertNewLine(event: Function): void; + keyPress(event: Function): void; + action: string; + bubbles: boolean; + onEvent: string; + } + class TextField extends View implements TextSupport { + static detect(obj: any): boolean; + static detectInstance(obj: any): boolean; + /** + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ + static eachComputedProperty(callback: Function, binding: {}): void; + /** + Returns the original hash that was passed to meta(). + @param key property name + **/ + static metaForProperty(key: string): {}; + static isClass: boolean; + static isMethod: boolean; + cancel(event: Function): void; + focusIn(event: Function): void; + focusOut(event: Function): void; + insertNewLine(event: Function): void; + keyPress(event: Function): void; + action: string; + bubbles: boolean; + onEvent: string; + pattern: string; + size: string; + type: string; + value: string; + } + class TextSupport { + cancel(event: Function): void; + focusIn(event: Function): void; + focusOut(event: Function): void; + insertNewLine(event: Function): void; + keyPress(event: Function): void; + action: string; + bubbles: boolean; + onEvent: string; + } + var VERSION: string; + class View extends CoreView { + static detect(obj: any): boolean; + static detectInstance(obj: any): boolean; + /** + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ + static eachComputedProperty(callback: Function, binding: {}): void; + /** + Returns the original hash that was passed to meta(). + @param key property name + **/ + static metaForProperty(key: string): {}; + static isClass: boolean; + static isMethod: boolean; + $(): JQuery; + append(): View; + // ReSharper disable InconsistentNaming + appendTo(A: string): View; + appendTo(A: HTMLElement): View; + appendTo(A: JQuery): View; + // ReSharper restore InconsistentNaming + createChildView(viewClass: {}, attrs?: {}): View; + createChildView(viewClass: string, attrs?: {}): View; + createElement(): View; + destroy(): View; + destroyElement(): View; + findElementInParentElement(parentElement: HTMLElement): HTMLElement; + remove(): View; + removeAllChildren(): View; + removeChild(view: View): View; + removeFromParent(): View; + render(buffer: RenderBuffer): void; + // ReSharper disable InconsistentNaming + replaceIn(A: string): View; + replaceIn(A: HTMLElement): View; + replaceIn(A: JQuery): View; + // ReSharper restore InconsistentNaming + rerender(): void; + ariaRole: string; + attributeBindings: any; + classNameBindings: string[]; + classNames: string[]; + context: any; + controller: any; + element: HTMLElement; + isView: boolean; + isVisible: boolean; + layout: Function; + layoutName: string; + nearestChildOf: View; + nearestOfType: View; + nearestWithProperty: View; + tagName: string; + template: Function; + templateName: string; + templates: {}; + views: {}; + didInsertElement: Function; + parentViewDidChange: Function; + willClearRender: Function; + willDestroyElement: Function; + willInsertElement: Function; + } + class ViewTargetActionSupport extends Mixin { + target: any; + actionContext: any; + } + var ViewUtils: {}; // TODO: define interface + function addBeforeObserver(obj: any, path: string, target: any, method: Function): any; + function addListener(obj: any, eventName: string, target: any, method: Function, once?: boolean): void; + function addListener(obj: any, eventName: string, target: any, method: string, once?: boolean): void; + function addListener(obj: any, eventName: string, func: Function, method: Function, once?: boolean): void; + function addListener(obj: any, eventName: string, func: Function, method: string, once?: boolean): void; + var addObserver: ModifyObserver; + /** + Ember.alias is deprecated. Please use Ember.aliasMethod or Ember.computed.alias instead. + **/ + var alias: typeof deprecateFunc; + function aliasMethod(methodName: string): Descriptor; + var anyUnprocessedMixins: boolean; + function assert(desc: string, test: boolean): void; + function beforeObserver(func: Function, propertyName: string): Function; + function beforeObserversFor(obj: any, path: string): string[]; + function beginPropertyChanges(): void; + function bind(obj: any, to: string, from: string): Binding; + function cacheFor(obj: any, key: string): any; + function canInvoke(obj: any, methodName: string): boolean; + function changeProperties(callback: Function, binding?: any): void; + function compare(v: any, w: any): number; + // ReSharper disable once DuplicatingLocalDeclaration + var computed: { + (...args: any[]): ComputedProperty; + alias(dependentKey: string): ComputedProperty; + and(...args: string[]): ComputedProperty; + any(...args: string[]): ComputedProperty; + bool(dependentKey: string): ComputedProperty; + defaultTo(defaultPath: string): ComputedProperty; + empty(dependentKey: string): ComputedProperty; + equal(dependentKey: string, value: any): ComputedProperty; + gt(dependentKey: string, value: number): ComputedProperty; + gte(dependentKey: string, value: number): ComputedProperty; + lt(dependentKey: string, value: number): ComputedProperty; + lte(dependentKey: string, value: number): ComputedProperty; + map(...args: string[]): ComputedProperty; + match(dependentKey: string, regexp: RegExp): ComputedProperty; + none(dependentKey: string): ComputedProperty; + not(dependentKey: string): ComputedProperty; + notEmpty(dependentKey: string): ComputedProperty; + oneWay(dependentKey: string): ComputedProperty; + or(...args: string[]): ComputedProperty; + }; + // ReSharper disable DuplicatingLocalDeclaration + var config: {}; + // ReSharper restore DuplicatingLocalDeclaration + function controllerFor(container: Container, controllerName: string, lookupOptions?: {}): Controller; + function copy(obj: any, deep: boolean): any; + /** + Creates an instance of the CoreObject class. + @param arguments A hash containing values with which to initialize the newly instantiated object. + **/ + function create(arguments?: {}): CoreObject; + function debug(message: string): void; + function defineProperty(obj: any, keyName: string, desc: {}): void; + function deprecate(message: string, test?: boolean): void; + function deprecateFunc(message: string, func: Function): Function; + function destroy(obj: any): void; + /** + Ember.empty is deprecated. Please use Ember.isEmpty instead. + **/ + // ReSharper disable once DuplicatingLocalDeclaration + var empty: typeof deprecateFunc; + function endPropertyChanges(): void; + // ReSharper disable once DuplicatingLocalDeclaration + var exports: {}; + function finishChains(obj: any): void; + function flushPendingChains(): void; + function generateController(container: Container, controllerName: string, context: any): Controller; + function generateGuid(obj: any, prefix?: string): string; + function get(obj: any, keyName: string): any; + function getMeta(obj: any, property: string): any; + /** + getPath is deprecated since get now supports paths. + **/ + var getPath: typeof deprecateFunc; + function getWithDefault(root: string, key: string, defaultValue: any): any; + function guidFor(obj: any): string; + function handleErrors(func: Function, context: any): any; + function hasListeners(context: any, name: string): boolean; + function hasOwnProperty(prop: string): boolean; + function immediateObserver(func: Function, ...propertyNames: any[]): Function; + var imports: {}; + function inspect(obj: any): string; + function instrument(name: string, payload: any, callback: Function, binding: any): void; + function isArray(obj: any): boolean; + function isEmpty(obj: any): boolean; + function isEqual(a: any, b: any): boolean; + function isGlobalPath(path: string): boolean; + var isNamespace: boolean; + function isNone(obj: any): boolean; + function isPrototypeOf(obj: {}): boolean; + function isWatching(obj: any, key: string): boolean; + function keys(obj: any): any[]; + function listenersDiff(obj: any, eventName: string, otherActions: any[]): any[]; + function listenersFor(obj: any, eventName: string): any[]; + function listenersUnion(obj: any, eventName: string, otherActions: any[]): void; + // ReSharper disable once DuplicatingLocalDeclaration + var lookup: {}; // TODO: define interface + function makeArray(obj: any): any[]; + function merge(original: any, updates: any): any; + function meta(obj: any, writable?: boolean): {}; + function metaPath(obj: any, path: string, writable?: boolean): any; + function mixin(obj: any, ...args: any[]): any; + /** + Ember.none is deprecated. Please use Ember.isNone instead. + **/ + var none: typeof deprecateFunc; + function normalizeTuple(target: any, path: string): any[]; + function observer(...args: any[]): Function; + function observersFor(obj: any, path: string): any[]; + function onLoad(name: string, callback: Function): void; + function oneWay(obj: any, to: string, from: string): Binding; + var onError: Error; + function overrideChains(obj: any, keyName: string, m: any): boolean; + // ReSharper disable once DuplicatingLocalDeclaration + var platform: { + addBeforeObserver: ModifyObserver; + addObserver: ModifyObserver; + defineProperty(obj: any, keyName: string, desc: {}): void; + removeBeforeObserver: ModifyObserver; + removeObserver: ModifyObserver; + hasPropertyAccessors: boolean; + }; + function propertyDidChange(obj: any, keyName: string): void; + function propertyIsEnumerable(prop: string): boolean; + function propertyWillChange(obj: any, keyName: string): void; + function removeBeforeObserver(obj: any, path: string, target: any, method: Function): any; + function removeChainWatcher(obj: any, keyName: string, node: any): void; + function removeListener(obj: any, eventName: string, target: any, method: Function): void; + function removeListener(obj: any, eventName: string, target: any, method: string): void; + function removeListener(obj: any, eventName: string, func: Function, method: Function): void; + function removeListener(obj: any, eventName: string, func: Function, method: string): void; + function removeObserver(obj: any, path: string, target: any, method: Function): any; + function required(): Descriptor; + function rewatch(obj: any): void; + var run: { + (target: any, method: Function): void; + begin(): void; + cancel(timer: any): void; + debounce(target: any, method: Function, ...args: any[]): void; + debounce(target: any, method: string, ...args: any[]): void; + end(): void; + join(target: any, method: Function, ...args: any[]): any; + join(target: any, method: string, ...args: any[]): any; + later(target: any, method: Function, ...args: any[]): string; + later(target: any, method: string, ...args: any[]): string; + next(target: any, method: Function, ...args: any[]): number; + next(target: any, method: string, ...args: any[]): number; + once(target: any, method: Function, ...args: any[]): number; + once(target: any, method: string, ...args: any[]): number; + schedule(queue: string, target: any, method: Function, ...args: any[]): void; + schedule(queue: string, target: any, method: string, ...args: any[]): void; + scheduleOnce(queue: string, target: any, method: Function, ...args: any[]): void; + scheduleOnce(queue: string, target: any, method: string, ...args: any[]): void; + sync(): void; + throttle(target: any, method: Function, ...args: any[]): void; + throttle(target: any, method: string, ...args: any[]): void; + queues: any[]; + }; + function runLoadHooks(name: string, object: any): void; + function sendEvent(obj: any, eventName: string, params?: any[], actions?: any[]): boolean; + function set(obj: any, keyName: string, value: any): any; + function setMeta(obj: any, property: string, value: any): void; + /** + setPath is deprecated since set now supports paths. + **/ + var setPath: typeof deprecateFunc; + function setProperties(self: any, hash: {}): any; + function subscribe(pattern: string, object: any): void; + function toLocaleString(): string; + function toString(): string; + function tryCatchFinally(tryable: Function, catchable: Function, finalizer: Function, binding?: any): any; + function tryFinally(tryable: Function, finalizer: Function, binding?: any): any; + function tryInvoke(obj: any, methodName: string, args?: any[]): any; + function trySet(obj: any, path: string, value: any): void; + /** + trySetPath has been renamed to trySet. + **/ + var trySetPath: typeof deprecateFunc; + function typeOf(item: any): string; + function unwatch(obj: any, keyPath: string): void; + function unwatchKey(obj: any, keyName: string): void; + function unwatchPath(obj: any, keyPath: string): void; + // ReSharper disable once DuplicatingLocalDeclaration + var uuid: number; + function valueOf(): {}; + function warn(message: string, test?: boolean): void; + function watch(obj: any, keyPath: string): void; + function watchKey(obj: any, keyName: string): void; + function watchPath(obj: any, keyPath: string): void; + function watchedEvents(obj: {}): any[]; + function wrap(func: Function, superFunc: Function): Function; +} + +// ReSharper disable DuplicatingLocalDeclaration +declare namespace Em { + /** + Alias for jQuery. + **/ + var $: typeof Ember.$; + var A: typeof Ember.A; + class ActionHandlerMixin extends Ember.ActionHandlerMixin { } + class Application extends Ember.Application { } + class Array extends Ember.Array { } + class ArrayController extends Ember.ArrayController { } + var ArrayPolyfills: typeof Ember.ArrayPolyfills; + class ArrayProxy extends Ember.ArrayProxy { } + var BOOTED: typeof Ember.BOOTED; + class Binding extends Ember.Binding { } + class Button extends Ember.Button { } + class Checkbox extends Ember.Checkbox { } + class CollectionView extends Ember.CollectionView { } + class Comparable extends Ember.Comparable { } + class Component extends Ember.Component { } + class ComputedProperty extends Ember.ComputedProperty { } + class Container extends Ember.Container { } + class ContainerView extends Ember.ContainerView { } + class Controller extends Ember.Controller { } + class ControllerMixin extends Ember.ControllerMixin { } + class Copyable extends Ember.Copyable { } + class CoreObject extends Ember.CoreObject { } + class CoreView extends Ember.CoreView { } + class DAG extends Ember.DAG { } + var DEFAULT_GETTER_FUNCTION: typeof Ember.DEFAULT_GETTER_FUNCTION; + class DefaultResolver extends Ember.DefaultResolver { } + class Deffered extends Ember.Deferred { } + class DeferredMixin extends Ember.DeferredMixin { } + class Descriptor extends Ember.Descriptor { } + var EMPTY_META: typeof Ember.EMPTY_META; + var ENV: typeof Ember.ENV; + var EXTEND_PROTOTYPES: typeof Ember.EXTEND_PROTOTYPES; + class EachProxy extends Ember.EachProxy { } + class Enumerable extends Ember.Enumerable { } + var EnumerableUtils: typeof Ember.EnumerableUtils; + var Error: typeof Ember.Error; + class EventDispatcher extends Ember.EventDispatcher { } + class Evented extends Ember.Evented { } + var FROZEN_ERROR: typeof Ember.FROZEN_ERROR; + class Freezable extends Ember.Freezable { } + var GUID_KEY: typeof Ember.GUID_KEY; + namespace Handlebars { + var compile: typeof Ember.Handlebars.compile; + var get: typeof Ember.Handlebars.get; + var helper: typeof Ember.Handlebars.helper; + class helpers extends Ember.Handlebars.helpers { } + var precompile: typeof Ember.Handlebars.precompile; + var registerBoundHelper: typeof Ember.Handlebars.registerBoundHelper; + class Compiler extends Ember.Handlebars.Compiler { } + class JavaScriptCompiler extends Ember.Handlebars.JavaScriptCompiler { } + var registerHelper: typeof Ember.Handlebars.registerHelper; + var registerPartial: typeof Ember.Handlebars.registerPartial; + var K: typeof Ember.Handlebars.K; + var createFrame: typeof Ember.Handlebars.createFrame; + var Exception: typeof Ember.Handlebars.Exception; + class SafeString extends Ember.Handlebars.SafeString { } + var parse: typeof Ember.Handlebars.parse; + var print: typeof Ember.Handlebars.print; + var logger: typeof Ember.Handlebars.logger; + var log: typeof Ember.Handlebars.log; + } + class HashLocation extends Ember.HashLocation { } + class HistoryLocation extends Ember.HistoryLocation { } + var IS_BINDING: typeof Ember.IS_BINDING; + class Instrumentation extends Ember.Instrumentation { } + var K: typeof Ember.K; + var LOG_BINDINGS: typeof Ember.LOG_BINDINGS; + var LOG_STACKTRACE_ON_DEPRECATION: typeof Ember.LOG_STACKTRACE_ON_DEPRECATION; + var LOG_VERSION: typeof Ember.LOG_VERSION; + class LinkView extends Ember.LinkView { } + class Location extends Ember.Location { } + var Logger: typeof Ember.Logger; + var MANDATORY_SETTER_FUNCTION: typeof Ember.MANDATORY_SETTER_FUNCTION; + var META_KEY: typeof Ember.META_KEY; + class Map extends Ember.Map { } + class MapWithDefault extends Ember.MapWithDefault { } + class Mixin extends Ember.Mixin { } + class MutableArray extends Ember.MutableArray { } + class MutableEnumerable extends Ember.MutableEnumberable { } + var NAME_KEY: typeof Ember.NAME_KEY; + class Namespace extends Ember.Namespace { } + class NativeArray extends Ember.NativeArray { } + class NoneLocation extends Ember.NoneLocation { } + var ORDER_DEFINITION: typeof Ember.ORDER_DEFINITION; + class Object extends Ember.Object { } + class ObjectController extends Ember.ObjectController { } + class ObjectProxy extends Ember.ObjectProxy { } + class Observable extends Ember.Observable { } + class OrderedSet extends Ember.OrderedSet { } + namespace RSVP { + interface PromiseResolve extends Ember.RSVP.PromiseResolve { } + interface PromiseReject extends Ember.RSVP.PromiseReject { } + interface PromiseResolverFunction extends Ember.RSVP.PromiseResolverFunction { } + class Promise extends Ember.RSVP.Promise { } + } + class RenderBuffer extends Ember.RenderBuffer { } + class Route extends Ember.Route { } + class Router extends Ember.Router { } + class RouterDSL extends Ember.RouterDSL { } + var SHIM_ES5: typeof Ember.SHIM_ES5; + var STRINGS: typeof Ember.STRINGS; + class Select extends Ember.Select { } + class SelectOption extends Ember.SelectOption { } + class Set extends Ember.Set { } + class SortableMixin extends Ember.SortableMixin { } + class State extends Ember.State { } + class StateManager extends Ember.StateManager { } + namespace String { + var camelize: typeof Ember.String.camelize; + var capitalize: typeof Ember.String.capitalize; + var classify: typeof Ember.String.classify; + var dasherize: typeof Ember.String.dasherize; + var decamelize: typeof Ember.String.decamelize; + var fmt: typeof Ember.String.fmt; + var htmlSafe: typeof Ember.String.htmlSafe; + var loc: typeof Ember.String.loc; + var underscore: typeof Ember.String.underscore; + var w: typeof Ember.String.w; + } + var TEMPLATES: typeof Ember.TEMPLATES; + class TargetActionSupport extends Ember.TargetActionSupport { } + class Test extends Ember.Test { } + class TextArea extends Ember.TextArea { } + class TextField extends Ember.TextField { } + class TextSupport extends Ember.TextSupport { } + var VERSION: typeof Ember.VERSION; + class View extends Ember.View { } + class ViewTargetActionSupport extends Ember.ViewTargetActionSupport { } + var ViewUtils: typeof Ember.ViewUtils; + var addBeforeObserver: typeof Ember.addBeforeObserver; + var addListener: typeof Ember.addListener; + var addObserver: typeof Ember.addObserver; + var alias: typeof Ember.alias; + var aliasMethod: typeof Ember.aliasMethod; + var anyUnprocessedMixins: typeof Ember.anyUnprocessedMixins; + var assert: typeof Ember.assert; + var beforeObserver: typeof Ember.beforeObserver; + var beforeObserversFor: typeof Ember.beforeObserversFor; + var beginPropertyChanges: typeof Ember.beginPropertyChanges; + var bind: typeof Ember.bind; + var cacheFor: typeof Ember.cacheFor; + var canInvoke: typeof Ember.canInvoke; + var changeProperties: typeof Ember.changeProperties; + var compare: typeof Ember.compare; + var computed: typeof Ember.computed; + var config: typeof Ember.config; + var controllerFor: typeof Ember.controllerFor; + var copy: typeof Ember.copy; + var create: typeof Ember.create; + var debug: typeof Ember.debug; + var defineProperty: typeof Ember.defineProperty; + var deprecate: typeof Ember.deprecate; + var deprecateFunc: typeof Ember.deprecateFunc; + var destroy: typeof Ember.destroy; + var empty: typeof deprecateFunc; + var endPropertyChanges: typeof Ember.endPropertyChanges; + var exports: typeof Ember.exports; + var finishChains: typeof Ember.finishChains; + var flushPendingChains: typeof Ember.flushPendingChains; + var generateController: typeof Ember.generateController; + var generateGuid: typeof Ember.generateGuid; + var get: typeof Ember.get; + var getMeta: typeof Ember.getMeta; + var getPath: typeof Ember.getPath; + var getWithDefault: typeof Ember.getWithDefault; + var guidFor: typeof Ember.guidFor; + var handleErrors: typeof Ember.handleErrors; + var hasListeners: typeof Ember.hasListeners; + var hasOwnProperty: typeof Ember.hasOwnProperty; + var immediateObserver: typeof Ember.immediateObserver; + var imports: typeof Ember.imports; + var inspect: typeof Ember.inspect; + var instrument: typeof Ember.instrument; + var isArray: typeof Ember.isArray; + var isEmpty: typeof Ember.isEmpty; + var isEqual: typeof Ember.isEqual; + var isGlobalPath: typeof Ember.isGlobalPath; + var isNamespace: typeof Ember.isNamespace; + var isNone: typeof Ember.isNone; + var isPrototypeOf: typeof Ember.isPrototypeOf; + var isWatching: typeof Ember.isWatching; + var keys: typeof Ember.keys; + var listenersDiff: typeof Ember.listenersDiff; + var listenersFor: typeof Ember.listenersFor; + var listenersUnion: typeof Ember.listenersUnion; + var lookup: typeof Ember.lookup; + var makeArray: typeof Ember.makeArray; + var merge: typeof Ember.merge; + var meta: typeof Ember.meta; + var metaPath: typeof Ember.metaPath; + var mixin: typeof Ember.mixin; + var none: typeof Ember.none; + var normalizeTuple: typeof Ember.normalizeTuple; + var observer: typeof Ember.observer; + var observersFor: typeof Ember.observersFor; + var onLoad: typeof Ember.onLoad; + var oneWay: typeof Ember.oneWay; + var onError: typeof Ember.onError; + var overrideChains: typeof Ember.overrideChains; + var platform: typeof Ember.platform; + var propertyDidChange: typeof Ember.propertyDidChange; + var propertyIsEnumerable: typeof Ember.propertyIsEnumerable; + var propertyWillChange: typeof Ember.propertyWillChange; + var removeBeforeObserver: typeof Ember.removeBeforeObserver; + var removeChainWatcher: typeof Ember.removeChainWatcher; + var removeListener: typeof Ember.removeListener; + var removeObserver: typeof Ember.removeObserver; + var required: typeof Ember.required; + var rewatch: typeof Ember.rewatch; + var run: typeof Ember.run; + var runLoadHooks: typeof Ember.runLoadHooks; + var sendEvent: typeof Ember.sendEvent; + var set: typeof Ember.set; + var setMeta: typeof Ember.setMeta; + var setPath: typeof Ember.setPath; + var setProperties: typeof Ember.setProperties; + var subscribe: typeof Ember.subscribe; + var toLocaleString: typeof Ember.toLocaleString; + var toString: typeof Ember.toString; + var tryCatchFinally: typeof Ember.tryCatchFinally; + var tryFinally: typeof Ember.tryFinally; + var tryInvoke: typeof Ember.tryInvoke; + var trySet: typeof Ember.trySet; + var trySetPath: typeof Ember.trySetPath; + var typeOf: typeof Ember.typeOf; + var unwatch: typeof Ember.unwatch; + var unwatchKey: typeof Ember.unwatchKey; + var unwatchPath: typeof Ember.unwatchPath; + var uuid: typeof Ember.uuid; + var valueOf: typeof Ember.valueOf; + var warn: typeof Ember.warn; + var watch: typeof Ember.watch; + var watchKey: typeof Ember.watchKey; + var watchPath: typeof Ember.watchPath; + var watchedEvents: typeof Ember.watchedEvents; + var wrap: typeof Ember.wrap; +} + +/** + * External ambient module - to allow "import Ember = require('Ember');" to work correctly + */ + +declare module "Ember" { + + var $: typeof Ember.$; + var A: typeof Ember.A; + class ActionHandlerMixin extends Ember.ActionHandlerMixin { } + class Application extends Ember.Application { } + class Array extends Ember.Array { } + class ArrayController extends Ember.ArrayController { } + var ArrayPolyfills: typeof Ember.ArrayPolyfills; + class ArrayProxy extends Ember.ArrayProxy { } + var BOOTED: typeof Ember.BOOTED; + class Binding extends Ember.Binding { } + class Button extends Ember.Button { } + class Checkbox extends Ember.Checkbox { } + class CollectionView extends Ember.CollectionView { } + class Comparable extends Ember.Comparable { } + class Component extends Ember.Component { } + class ComputedProperty extends Ember.ComputedProperty { } + class Container extends Ember.Container { } + class ContainerView extends Ember.ContainerView { } + class Controller extends Ember.Controller { } + class ControllerMixin extends Ember.ControllerMixin { } + class Copyable extends Ember.Copyable { } + class CoreObject extends Ember.CoreObject { } + class CoreView extends Ember.CoreView { } + class DAG extends Ember.DAG { } + var DEFAULT_GETTER_FUNCTION: typeof Ember.DEFAULT_GETTER_FUNCTION; + class DefaultResolver extends Ember.DefaultResolver { } + class Deffered extends Ember.Deferred { } + class DeferredMixin extends Ember.DeferredMixin { } + class Descriptor extends Ember.Descriptor { } + var EMPTY_META: typeof Ember.EMPTY_META; + var ENV: typeof Ember.ENV; + var EXTEND_PROTOTYPES: typeof Ember.EXTEND_PROTOTYPES; + class EachProxy extends Ember.EachProxy { } + class Enumerable extends Ember.Enumerable { } + var EnumerableUtils: typeof Ember.EnumerableUtils; + var Error: typeof Ember.Error; + class EventDispatcher extends Ember.EventDispatcher { } + class Evented extends Ember.Evented { } + var FROZEN_ERROR: typeof Ember.FROZEN_ERROR; + class Freezable extends Ember.Freezable { } + var GUID_KEY: typeof Ember.GUID_KEY; + namespace Handlebars { + var compile: typeof Ember.Handlebars.compile; + var get: typeof Ember.Handlebars.get; + var helper: typeof Ember.Handlebars.helper; + class helpers extends Ember.Handlebars.helpers { } + var precompile: typeof Ember.Handlebars.precompile; + var registerBoundHelper: typeof Ember.Handlebars.registerBoundHelper; + class Compiler extends Ember.Handlebars.Compiler { } + class JavaScriptCompiler extends Ember.Handlebars.JavaScriptCompiler { } + var registerHelper: typeof Ember.Handlebars.registerHelper; + var registerPartial: typeof Ember.Handlebars.registerPartial; + var K: typeof Ember.Handlebars.K; + var createFrame: typeof Ember.Handlebars.createFrame; + var Exception: typeof Ember.Handlebars.Exception; + class SafeString extends Ember.Handlebars.SafeString { } + var parse: typeof Ember.Handlebars.parse; + var print: typeof Ember.Handlebars.print; + var logger: typeof Ember.Handlebars.logger; + var log: typeof Ember.Handlebars.log; + } + class HashLocation extends Ember.HashLocation { } + class HistoryLocation extends Ember.HistoryLocation { } + var IS_BINDING: typeof Ember.IS_BINDING; + class Instrumentation extends Ember.Instrumentation { } + var K: typeof Ember.K; + var LOG_BINDINGS: typeof Ember.LOG_BINDINGS; + var LOG_STACKTRACE_ON_DEPRECATION: typeof Ember.LOG_STACKTRACE_ON_DEPRECATION; + var LOG_VERSION: typeof Ember.LOG_VERSION; + class LinkView extends Ember.LinkView { } + class Location extends Ember.Location { } + var Logger: typeof Ember.Logger; + var MANDATORY_SETTER_FUNCTION: typeof Ember.MANDATORY_SETTER_FUNCTION; + var META_KEY: typeof Ember.META_KEY; + class Map extends Ember.Map { } + class MapWithDefault extends Ember.MapWithDefault { } + class Mixin extends Ember.Mixin { } + class MutableArray extends Ember.MutableArray { } + class MutableEnumerable extends Ember.MutableEnumberable { } + var NAME_KEY: typeof Ember.NAME_KEY; + class Namespace extends Ember.Namespace { } + class NativeArray extends Ember.NativeArray { } + class NoneLocation extends Ember.NoneLocation { } + var ORDER_DEFINITION: typeof Ember.ORDER_DEFINITION; + class Object extends Ember.Object { } + class ObjectController extends Ember.ObjectController { } + class ObjectProxy extends Ember.ObjectProxy { } + class Observable extends Ember.Observable { } + class OrderedSet extends Ember.OrderedSet { } + namespace RSVP { + interface PromiseResolve extends Ember.RSVP.PromiseResolve { } + interface PromiseReject extends Ember.RSVP.PromiseReject { } + interface PromiseResolverFunction extends Ember.RSVP.PromiseResolverFunction { } + class Promise extends Ember.RSVP.Promise { } + } + class RenderBuffer extends Ember.RenderBuffer { } + class Route extends Ember.Route { } + class Router extends Ember.Router { } + class RouterDSL extends Ember.RouterDSL { } + var SHIM_ES5: typeof Ember.SHIM_ES5; + var STRINGS: typeof Ember.STRINGS; + class Select extends Ember.Select { } + class SelectOption extends Ember.SelectOption { } + class Set extends Ember.Set { } + class SortableMixin extends Ember.SortableMixin { } + class State extends Ember.State { } + class StateManager extends Ember.StateManager { } + namespace String { + var camelize: typeof Ember.String.camelize; + var capitalize: typeof Ember.String.capitalize; + var classify: typeof Ember.String.classify; + var dasherize: typeof Ember.String.dasherize; + var decamelize: typeof Ember.String.decamelize; + var fmt: typeof Ember.String.fmt; + var htmlSafe: typeof Ember.String.htmlSafe; + var loc: typeof Ember.String.loc; + var underscore: typeof Ember.String.underscore; + var w: typeof Ember.String.w; + } + var TEMPLATES: typeof Ember.TEMPLATES; + class TargetActionSupport extends Ember.TargetActionSupport { } + class Test extends Ember.Test { } + class TextArea extends Ember.TextArea { } + class TextField extends Ember.TextField { } + class TextSupport extends Ember.TextSupport { } + var VERSION: typeof Ember.VERSION; + class View extends Ember.View { } + class ViewTargetActionSupport extends Ember.ViewTargetActionSupport { } + var ViewUtils: typeof Ember.ViewUtils; + var addBeforeObserver: typeof Ember.addBeforeObserver; + var addListener: typeof Ember.addListener; + var addObserver: typeof Ember.addObserver; + var alias: typeof Ember.alias; + var aliasMethod: typeof Ember.aliasMethod; + var anyUnprocessedMixins: typeof Ember.anyUnprocessedMixins; + var assert: typeof Ember.assert; + var beforeObserver: typeof Ember.beforeObserver; + var beforeObserversFor: typeof Ember.beforeObserversFor; + var beginPropertyChanges: typeof Ember.beginPropertyChanges; + var bind: typeof Ember.bind; + var cacheFor: typeof Ember.cacheFor; + var canInvoke: typeof Ember.canInvoke; + var changeProperties: typeof Ember.changeProperties; + var compare: typeof Ember.compare; + var computed: typeof Ember.computed; + var config: typeof Ember.config; + var controllerFor: typeof Ember.controllerFor; + var copy: typeof Ember.copy; + var create: typeof Ember.create; + var debug: typeof Ember.debug; + var defineProperty: typeof Ember.defineProperty; + var deprecate: typeof Ember.deprecate; + var deprecateFunc: typeof Ember.deprecateFunc; + var destroy: typeof Ember.destroy; + var empty: typeof Ember.deprecateFunc; + var endPropertyChanges: typeof Ember.endPropertyChanges; + var exports: typeof Ember.exports; + var finishChains: typeof Ember.finishChains; + var flushPendingChains: typeof Ember.flushPendingChains; + var generateController: typeof Ember.generateController; + var generateGuid: typeof Ember.generateGuid; + var get: typeof Ember.get; + var getMeta: typeof Ember.getMeta; + var getPath: typeof Ember.getPath; + var getWithDefault: typeof Ember.getWithDefault; + var guidFor: typeof Ember.guidFor; + var handleErrors: typeof Ember.handleErrors; + var hasListeners: typeof Ember.hasListeners; + var hasOwnProperty: typeof Ember.hasOwnProperty; + var immediateObserver: typeof Ember.immediateObserver; + var imports: typeof Ember.imports; + var inspect: typeof Ember.inspect; + var instrument: typeof Ember.instrument; + var isArray: typeof Ember.isArray; + var isEmpty: typeof Ember.isEmpty; + var isEqual: typeof Ember.isEqual; + var isGlobalPath: typeof Ember.isGlobalPath; + var isNamespace: typeof Ember.isNamespace; + var isNone: typeof Ember.isNone; + var isPrototypeOf: typeof Ember.isPrototypeOf; + var isWatching: typeof Ember.isWatching; + var keys: typeof Ember.keys; + var listenersDiff: typeof Ember.listenersDiff; + var listenersFor: typeof Ember.listenersFor; + var listenersUnion: typeof Ember.listenersUnion; + var lookup: typeof Ember.lookup; + var makeArray: typeof Ember.makeArray; + var merge: typeof Ember.merge; + var meta: typeof Ember.meta; + var metaPath: typeof Ember.metaPath; + var mixin: typeof Ember.mixin; + var none: typeof Ember.none; + var normalizeTuple: typeof Ember.normalizeTuple; + var observer: typeof Ember.observer; + var observersFor: typeof Ember.observersFor; + var onLoad: typeof Ember.onLoad; + var oneWay: typeof Ember.oneWay; + var onError: typeof Ember.onError; + var overrideChains: typeof Ember.overrideChains; + var platform: typeof Ember.platform; + var propertyDidChange: typeof Ember.propertyDidChange; + var propertyIsEnumerable: typeof Ember.propertyIsEnumerable; + var propertyWillChange: typeof Ember.propertyWillChange; + var removeBeforeObserver: typeof Ember.removeBeforeObserver; + var removeChainWatcher: typeof Ember.removeChainWatcher; + var removeListener: typeof Ember.removeListener; + var removeObserver: typeof Ember.removeObserver; + var required: typeof Ember.required; + var rewatch: typeof Ember.rewatch; + var run: typeof Ember.run; + var runLoadHooks: typeof Ember.runLoadHooks; + var sendEvent: typeof Ember.sendEvent; + var set: typeof Ember.set; + var setMeta: typeof Ember.setMeta; + var setPath: typeof Ember.setPath; + var setProperties: typeof Ember.setProperties; + var subscribe: typeof Ember.subscribe; + var toLocaleString: typeof Ember.toLocaleString; + var toString: typeof Ember.toString; + var tryCatchFinally: typeof Ember.tryCatchFinally; + var tryFinally: typeof Ember.tryFinally; + var tryInvoke: typeof Ember.tryInvoke; + var trySet: typeof Ember.trySet; + var trySetPath: typeof Ember.trySetPath; + var typeOf: typeof Ember.typeOf; + var unwatch: typeof Ember.unwatch; + var unwatchKey: typeof Ember.unwatchKey; + var unwatchPath: typeof Ember.unwatchPath; + var uuid: typeof Ember.uuid; + var valueOf: typeof Ember.valueOf; + var warn: typeof Ember.warn; + var watch: typeof Ember.watch; + var watchKey: typeof Ember.watchKey; + var watchPath: typeof Ember.watchPath; + var watchedEvents: typeof Ember.watchedEvents; + var wrap: typeof Ember.wrap; +} diff --git a/ember/ember-tests.ts b/ember/ember-tests.ts index 33ff6be0b2..5924dbd0ae 100644 --- a/ember/ember-tests.ts +++ b/ember/ember-tests.ts @@ -93,9 +93,6 @@ App.wife.get('householdIncome'); App.user = Em.Object.create({ fullName: 'Kara Gates' }); -App.userView = Em.View.create({ - userNameBinding: Em.Binding.oneWay('App.user.fullName') -}); App.user.set('fullName', 'Krang Gates'); App.userView.set('userName', 'Truckasaurus Gates'); App.user.get('fullName'); @@ -104,26 +101,6 @@ App = Em.Application.create({ rootElement: '#sidebar' }); -var view = Em.View.create({ - templateName: 'say-hello', - name: 'Bob' -}); -view.appendTo('#container'); -view.append(); -view.remove(); - -App.AlertView = Em.View.extend({ - priority: 'p4', - isUrgent: true -}); - -App.ListingView = Em.View.extend({ - templateName: 'listing', - edit: (event: any) => { - event.view.set('isEditing', true); - } -}); - App.userController = Em.Object.create({ content: Em.Object.create({ firstName: 'Albert', @@ -134,32 +111,10 @@ App.userController = Em.Object.create({ }); Handlebars.registerHelper('highlight', function(property: string, options: any) { - var value = Em.Handlebars.get(this, property, options); - return new Handlebars.SafeString('' + value + ''); + return new Handlebars.SafeString('' + "some value" + ''); }); -App.MyText = Em.TextField.extend({ - formBlurredBinding: 'App.adminController.formBlurred', - change: function() { - this.set('formBlurred', true); - } -}); - -var textArea = Em.TextArea.create({ - valueBinding: 'TestObject.value' -}); - -App.ClickableView = Em.View.extend({ - click: () => { - alert('ClickableView was clicked!'); - } -}); - -var container = Em.ContainerView.create(); -container.append(); -var coolView = App.CoolView.create(), - childViews = container.get('childViews'); -childViews.pushObject(coolView); +var coolView = App.CoolView.create(); var Person2 = Em.Object.extend({ sayHello: function() { @@ -194,8 +149,8 @@ people2.some((person: Em.Object) => { people2.everyProperty('isHappy', true); people2.someProperty('isHappy', true); -// Examples taken from http://emberjs.com/api/classes/Ember.RSVP.Promise.html -var promise = new Ember.RSVP.Promise(function(resolve: Function, reject: Function) { +// Examples taken from http://emberjs.com/api/classes/Em.RSVP.Promise.html +var promise = new Em.RSVP.Promise(function(resolve: Function, reject: Function) { // on success resolve('ok!'); diff --git a/ember/ember.d.ts b/ember/ember.d.ts index c24661d763..20328feef8 100644 --- a/ember/ember.d.ts +++ b/ember/ember.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Ember.js 1.11.3 +// Type definitions for Ember.js 2.7 // Project: http://emberjs.com/ // Definitions by: Jed Mao // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -448,7 +448,6 @@ declare namespace Ember { static metaForProperty(key: string): {}; static isClass: boolean; static isMethod: boolean; - static initializer(args?: ApplicationInitializerArguments): void; /** Call advanceReadiness after any asynchronous setup logic has completed. Each call to deferReadiness must be matched by a call to advanceReadiness @@ -530,6 +529,7 @@ declare namespace Ember { Application's router. **/ Router: Router; + registry: Registry; } /** This module implements Observer-friendly Array-like behavior. This mixin is picked up by the @@ -594,50 +594,6 @@ declare namespace Ember { length: number; } /** - Provides a way for you to publish a collection of objects so that you can easily bind to the - collection from a Handlebars #each helper, an Ember.CollectionView, or other controllers. - **/ - class ArrayController extends ArrayProxy implements SortableMixin, ControllerMixin { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - lookupItemController(object: any): string; - arrangedContent: any; - itemController: string; - sortAscending: boolean; - sortFunction: Comparable; - sortProperties: any[]; - replaceRoute(name: string, ...args: any[]): void; - transitionToRoute(name: string, ...args: any[]): void; - controllers: {}; - needs: string[]; - target: any; - model: any; - queryParams: any; - send(name: string, ...args: any[]): void; - actions: {}; - - } - /** - Array polyfills to support ES5 features in older browsers. - **/ - var ArrayPolyfills: { - map: typeof Array.prototype.map; - forEach: typeof Array.prototype.forEach; - indexOf: typeof Array.prototype.indexOf; - }; - /** An ArrayProxy wraps any other object that implements Ember.Array and/or Ember.MutableArray, forwarding all requests. This makes it very useful for a number of binding use cases or other cases where being able to swap out the underlying array is useful. @@ -741,14 +697,13 @@ declare namespace Ember { constructor(toPath: string, fromPath: string); connect(obj: any): Binding; copy(): Binding; - disconnect(obj: any): Binding; + disconnect(): Binding; from(path: string): Binding; - static oneWay(from: string, flag?: boolean): Binding; to(path: string): Binding; to(pathTuple: any[]): Binding; toString(): string; } - class Button extends View implements TargetActionSupport { + class Button extends Component implements TargetActionSupport { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** @@ -769,7 +724,7 @@ declare namespace Ember { The internal class used to create text inputs when the {{input}} helper is used with type of checkbox. See Handlebars.helpers.input for usage details. **/ - class Checkbox extends View { + class Checkbox extends Component { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** @@ -786,23 +741,6 @@ declare namespace Ember { static isMethod: boolean; } /** - An Ember.View descendent responsible for managing a collection (an array or array-like object) - by maintaining a child view object and associated DOM representation for each item in the array - and ensuring that child views and their associated rendered HTML are updated when items in the - array are added, removed, or replaced. - **/ - class CollectionView extends ContainerView { - arrayDidChange(content: any[], start: number, removed: number, added: number): void; - arrayWillChange(content: any[], start: number, removed: number): void; - createChildView(viewClass: {}, attrs?: {}): CollectionView; - destroy(): CollectionView; - init(): void; - static CONTAINER_MAP: {}; - content: any[]; - emptyView: View; - itemViewClass: View; - } - /** Implements some standard methods for comparing objects. Add this mixin to any class you create that can compare its instances. **/ @@ -814,7 +752,7 @@ declare namespace Ember { and actions are targeted at the view object. There is no access to the surrounding context or outer controller; all contextual information is passed in. **/ - class Component extends View { + class Component { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** @@ -839,7 +777,6 @@ declare namespace Ember { This will force the cached result to be recomputed if the dependencies are modified. **/ class ComputedProperty { - cacheable(aFlag?: boolean): ComputedProperty; get(keyName: string): any; meta(meta: {}): ComputedProperty; property(...args: string[]): ComputedProperty; @@ -853,8 +790,10 @@ declare namespace Ember { constructor(parent: Container); parent: Container; children: any[]; + owner: any; + ownerInjection(): any; resolver: Function; - registry: {}; + registry: Registry; cache: {}; typeInjections: {}; injections: {}; @@ -865,42 +804,13 @@ declare namespace Ember { @param fullName type:name (e.g., 'model:user') @param factory (e.g., App.Person) **/ - register(fullName: string, factory: Function, options?: {}): void; - unregister(fullName: string): void; - resolve(fullName: string): Function; describe(fullName: string): string; - normalize(fullName: string): string; makeToString(factory: any, fullName: string): Function; lookup(fullName: string, options?: {}): any; - lookupFactory(fullName: string): any; - has(fullName: string): boolean; - optionsForType(type: string, options: {}): void; - options(type: string, options: {}): void; - injection(factoryName: string, property: string, injectionName: string): void; - factoryInjection(factoryName: string, property: string, injectionName: string): void; + lookupFactory(fullName: string, options?: {}): any; destroy(): void; reset(): void; } - /** - An Ember.View subclass that implements Ember.MutableArray allowing programatic - management of its child views. - **/ - class ContainerView extends View { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - } class Controller extends Object implements ControllerMixin { replaceRoute(name: string, ...args: any[]): void; transitionToRoute(name: string, ...args: any[]): void; @@ -1079,30 +989,6 @@ declare namespace Ember { **/ static eachComputedProperty(callback: Function, binding: {}): void; } - /** - An abstract class that exists to give view-like behavior to both Ember's main view class Ember.View - and other classes like Ember._SimpleMetamorphView that don't need the fully functionaltiy of Ember.View. - Unless you have specific needs for CoreView, you will use Ember.View in your applications. - **/ - class CoreView extends Object implements ActionHandlerMixin { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - send(name: string, ...args: any[]): void; - actions: ActionsHash; - parentView: CoreView; - } class DAG { add(name: string): any; map(name: string, value: any): void; @@ -1124,25 +1010,25 @@ declare namespace Ember { resolve(fullName: string): {}; namespace: Application; } - class Deferred { - reject(value: any): void; - resolve(value: any): void; - then(resolve: Function, reject: Function): void; - } - class DeferredMixin extends Mixin { - reject(value: any): void; - resolve(value: any): void; - then(resolve: Function, reject: Function): void; - } /** Objects of this type can implement an interface to respond to requests to get and set. The default implementation handles simple properties. You generally won't need to create or subclass this directly. **/ class Descriptor { } - var EMPTY_META: {}; // TODO: define interface - var ENV: {}; - var EXTEND_PROTOTYPES: boolean; + namespace ENV { + export var EXTEND_PROTOTYPES: typeof Ember.EXTEND_PROTOTYPES; + export var LOG_BINDINGS: boolean; + export var LOG_STACKTRACE_ON_DEPRECATION: boolean; + export var LOG_VERSION: boolean; + export var MODEL_FACTORY_INJECTIONS: boolean; + export var RAISE_ON_DEPRECATION: boolean; + } + namespace EXTEND_PROTOTYPES { + export var Array: boolean; + export var Function: boolean; + export var String: boolean; + } /** This is the object instance returned when you get the @each property on an array. It uses the unknownProperty handler to automatically create EachArray instances for property names. @@ -1217,7 +1103,6 @@ declare namespace Ember { hasEnumerableObservers: boolean; lastObject: any; } - var EnumerableUtils: {}; // TODO: define interface /** A subclass of the JavaScript Error object for use in Ember. **/ @@ -1264,38 +1149,9 @@ declare namespace Ember { var GUID_KEY: string; namespace Handlebars { function compile(string: string): Function; - function get(root: any, path: string, options?: {}): any; - function helper(name: string, func: Function, dependentKeys?: string): void; - function helper(name: string, view: View, dependentKeys?: string): void; - class helpers { - action(actionName: string, context: any, options?: {}): void; - bindAttr(options?: {}): string; - connectOutlet(outletName: string, view: {}): void; - control(path: string, modelPath: string, options?: {}): string; - debugger(property: string): void; - disconnectOutlet(outletName: string): void; - each(name: string, path: string, options?: {}): void; - if(context: Function, options?: {}): string; - init(): void; - input(options?: {}): void; - linkTo(routeName: string, context: any, options?: {}): string; - loc(str: string): void; - log(property: string): void; - outlet(property: string): string; - partial(partialName: string): void; - render(name: string, context?: string, options?: {}): string; - textarea(options?: {}): void; - unbound(property: string): string; - unless(context: Function, options?: {}): string; - view(path: string, options?: {}): string; - with(context: Function, options?: {}): string; - yield(options?: {}): string; - } - function precompile(string: string): void; - function registerBoundHelper(name: string, func: Function, dependentKeys?: string): void; + function precompile(string: string, options: any): void; class Compiler { } class JavaScriptCompiler { } - function registerHelper(name: string, fn: Function, inverse?: boolean): void; function registerPartial(name: string, str: any): void; function K(): any; function createFrame(objec: any): any; @@ -1356,38 +1212,6 @@ declare namespace Ember { var LOG_BINDINGS: boolean; var LOG_STACKTRACE_ON_DEPRECATION: boolean; var LOG_VERSION: boolean; - class LinkView extends View { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - init(): void; - active: any; - activeClass: string; - attributeBindings: any; - classNameBindings: string[]; - disabled: any; - disabledClass: string; - eventName: string; - href: any; - loading: any; - loadingClass: string; - loadingHref: string; - rel: any; - replace: boolean; - title: any; - click: Function; - } class Location { create(options?: {}): any; registerImplementation(name: string, implementation: any): void; @@ -1408,7 +1232,6 @@ declare namespace Ember { forEach(callback: Function, self: any): void; get(key: any): any; has(key: any): boolean; - remove(key: any): boolean; set(key: any, value: any): void; length: number; } @@ -1716,17 +1539,6 @@ declare namespace Ember { setProperties(hash: {}): Observable; toggleProperty(keyName: string): any; } - class ObjectController extends ObjectProxy implements ControllerMixin { - replaceRoute(name: string, ...args: any[]): void; - transitionToRoute(name: string, ...args: any[]): void; - controllers: Object; - needs: string[]; - target: any; - model: any; - queryParams: any; - send(name: string, ...args: any[]): void; - actions: {}; - } class ObjectProxy extends Object { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; @@ -1779,9 +1591,12 @@ declare namespace Ember { forEach(fn: Function, self: any): void; has(obj: any): boolean; isEmpty(): boolean; - remove(obj: any): void; toArray(): any[]; } + class Registry { + constructor (options: any); + static set: typeof Ember.set; + } // FYI - RSVP source comes from https://github.com/tildeio/rsvp.js/blob/master/lib/rsvp/promise.js namespace RSVP { @@ -1848,25 +1663,6 @@ declare namespace Ember { finally(callback: Function, label?: string): Promise; } } - class RenderBuffer { - addClass(className: string): RenderBuffer; - attr(name: string, value: any): any; - element(): HTMLElement; - id(id: string): RenderBuffer; - prop(name: string, value: string): any; - push(string: string): RenderBuffer; - removeAttr(name: string): RenderBuffer; - removeProp(name: string): RenderBuffer; - string(): string; - style(name: string, value: string): RenderBuffer; - classes: any[]; - elementAttributes: {}; - elementId: string; - elementProperties: {}; - elementStyle: {}; - elementTag: string; - parentBuffer: RenderBuffer; - } /** The `Ember.Route` class is used to define individual routes. Refer to @@ -2413,170 +2209,11 @@ declare namespace Ember { resource(name: string, options?: {}, callback?: Function): void; resource(name: string, callback: Function): void; route(name: string, options?: {}): void; + explicitIndex: boolean; + router: Router; + options: any; } - var SHIM_ES5: boolean; var STRINGS: boolean; - class Select extends View { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - content: any[]; - groupView: View; - multiple: boolean; - optionGroupPath: string; - optionLabelPath: string; - optionValuePath: string; - optionView: View; - prompt: string; - selection: any; - value: string; - } - class SelectOption extends View { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - } - class Set extends CoreObject implements MutableEnumberable, Copyable, Freezable { - addEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Set; - addObject(object: any): any; - addObjects(objects: Enumerable): Set; - any(callback: Function, target?: any): boolean; - anyBy(key: string, value?: string): boolean; - someProperty(key: string, value?: string): boolean; - compact(): any[]; - contains(obj: any): boolean; - enumerableContentDidChange(start: number, removing: number, adding: number): any; - enumerableContentDidChange(start: number, removing: Enumerable, adding: number): any; - enumerableContentDidChange(start: number, removing: number, adding: Enumerable): any; - enumerableContentDidChange(start: number, removing: Enumerable, adding: Enumerable): any; - enumerableContentDidChange(removing: number, adding: number): any; - enumerableContentDidChange(removing: Enumerable, adding: number): any; - enumerableContentDidChange(removing: number, adding: Enumerable): any; - enumerableContentDidChange(removing: Enumerable, adding: Enumerable): any; - enumerableContentWillChange(removing: number, adding: number): Set; - enumerableContentWillChange(removing: Enumerable, adding: number): Set; - enumerableContentWillChange(removing: number, adding: Enumerable): Set; - enumerableContentWillChange(removing: Enumerable, adding: Enumerable): Set; - every(callback: Function, target?: any): boolean; - everyBy(key: string, value?: string): boolean; - everyProperty(key: string, value?: string): boolean; - filter(callback: Function, target: any): any[]; - filterBy(key: string, value?: string): any[]; - find(callback: Function, target: any): any; - findBy(key: string, value?: string): any; - forEach(callback: Function, target?: any): any; - getEach(key: string): any[]; - invoke(methodName: string, ...args: any[]): any[]; - map: ItemIndexEnumerableCallbackTarget; - mapBy(key: string): any[]; - nextObject(index: number, previousObject: any, context: any): any; - reduce(callback: ReduceCallback, initialValue: any, reducerProperty: string): any; - reject: ItemIndexEnumerableCallbackTarget; - rejectBy(key: string, value?: string): any[]; - removeEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Set; - removeObject(object: any): any; - removeObjects(objects: Enumerable): Set; - setEach(key: string, value?: any): any; - some(callback: Function, target?: any): boolean; - toArray(): any[]; - uniq(): Set; - without(value: any): Set; - '[]': any[]; - firstObject: any; - hasEnumerableObservers: boolean; - lastObject: any; - copy(deep: boolean): Set; - frozenCopy(): Set; - freeze(): Set; - isFrozen: boolean; - add(obj: any): Set; - addEach(...args: any[]): Set; - clear(): Set; - isEqual(obj: Set): boolean; - pop(): any; - push(obj: any): Set; - remove(obj: any): Set; - removeEach(...args: any[]): Set; - shift(): any; - unshift(obj: any): Set; - length: number; - } - class SortableMixin implements MutableEnumberable { - addEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; - addObject(object: any): any; - addObjects(objects: Enumerable): MutableEnumberable; - any(callback: Function, target?: any): boolean; - anyBy(key: string, value?: string): boolean; - someProperty(key: string, value?: string): boolean; - compact(): any[]; - contains(obj: any): boolean; - enumerableContentDidChange(start: number, removing: number, adding: number): any; - enumerableContentDidChange(start: number, removing: Enumerable, adding: number): any; - enumerableContentDidChange(start: number, removing: number, adding: Enumerable): any; - enumerableContentDidChange(start: number, removing: Enumerable, adding: Enumerable): any; - enumerableContentDidChange(removing: number, adding: number): any; - enumerableContentDidChange(removing: Enumerable, adding: number): any; - enumerableContentDidChange(removing: number, adding: Enumerable): any; - enumerableContentDidChange(removing: Enumerable, adding: Enumerable): any; - enumerableContentWillChange(removing: number, adding: number): Enumerable; - enumerableContentWillChange(removing: Enumerable, adding: number): Enumerable; - enumerableContentWillChange(removing: number, adding: Enumerable): Enumerable; - enumerableContentWillChange(removing: Enumerable, adding: Enumerable): Enumerable; - every(callback: Function, target?: any): boolean; - everyBy(key: string, value?: string): boolean; - everyProperty(key: string, value?: string): boolean; - filter(callback: Function, target: any): any[]; - filterBy(key: string, value?: string): any[]; - find(callback: Function, target: any): any; - findBy(key: string, value?: string): any; - forEach(callback: Function, target?: any): any; - getEach(key: string): any[]; - invoke(methodName: string, ...args: any[]): any[]; - map: ItemIndexEnumerableCallbackTarget; - mapBy(key: string): any[]; - nextObject(index: number, previousObject: any, context: any): any; - reduce(callback: ReduceCallback, initialValue: any, reducerProperty: string): any; - reject: ItemIndexEnumerableCallbackTarget; - rejectBy(key: string, value?: string): any[]; - removeEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; - removeObject(object: any): any; - removeObjects(objects: Enumerable): MutableEnumberable; - setEach(key: string, value?: any): any; - some(callback: Function, target?: any): boolean; - toArray(): any[]; - uniq(): Enumerable; - without(value: any): Enumerable; - '[]': any[]; - arrangedContent: any; - firstObject: any; - hasEnumerableObservers: boolean; - lastObject: any; - sortAscending: boolean; - sortFunction: Comparable; - sortProperties: any[]; - } class State extends Object implements Evented { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; @@ -2659,25 +2296,30 @@ declare namespace Ember { class TargetActionSupport { triggerAction(opts: {}): boolean; } - class Test { - click(selector: string): RSVP.Promise; - fillin(selector: string, text: string): RSVP.Promise; - find(selector: string): JQuery; - findWithAssert(selector: string): JQuery; - injectTestHelpers(): void; - keyEvent(selector: string, type: string, keyCode: number): RSVP.Promise; - static oninjectHelpers(callback: Function): void; - static promise(resolver: Function): RSVP.Promise; - static registerHelper(name: string, helperMethod: Function): void; - removeTestHelpers(): void; - setupForTesting(): void; - static unregisterHelper(name: string): void; - visit(url: string): RSVP.Promise; - wait(value: any): RSVP.Promise; - static adapter: Object; - testHelpers: {}; + namespace Test { + class Adapter extends Ember.Object { + constructor (); + } + class Promise extends Ember.RSVP.Promise { + constructor (); + } + function oninjectHelpers(callback: Function): void; + function promise(resolver: Function, label: string): Ember.Test.Promise; + function unregisterHelper(name: string): void; + function registerHelper(name: string, helperMethod: Function): void; + function registerAsyncHelper(name: string, helperMethod: Function): void; + + var adapter: Object; + var QUnitAdapter: Object; + + function registerWaiter(callback: Function): void; + function registerWaiter(context: any, callback: Function): void; + function unregisterWaiter(callback: Function): void; + function unregisterWaiter(context: any, callback: Function): void; + + function resolve(result: any): Ember.Test.Promise; } - class TextArea extends View implements TextSupport { + class TextArea extends Component implements TextSupport { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** @@ -2701,7 +2343,7 @@ declare namespace Ember { bubbles: boolean; onEvent: string; } - class TextField extends View implements TextSupport { + class TextField extends Component implements TextSupport { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** @@ -2740,76 +2382,11 @@ declare namespace Ember { onEvent: string; } var VERSION: string; - class View extends CoreView { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - $(): JQuery; - append(): View; - // ReSharper disable InconsistentNaming - appendTo(A: string): View; - appendTo(A: HTMLElement): View; - appendTo(A: JQuery): View; - // ReSharper restore InconsistentNaming - createChildView(viewClass: {}, attrs?: {}): View; - createChildView(viewClass: string, attrs?: {}): View; - createElement(): View; - destroy(): View; - destroyElement(): View; - findElementInParentElement(parentElement: HTMLElement): HTMLElement; - remove(): View; - removeAllChildren(): View; - removeChild(view: View): View; - removeFromParent(): View; - render(buffer: RenderBuffer): void; - // ReSharper disable InconsistentNaming - replaceIn(A: string): View; - replaceIn(A: HTMLElement): View; - replaceIn(A: JQuery): View; - // ReSharper restore InconsistentNaming - rerender(): void; - ariaRole: string; - attributeBindings: any; - classNameBindings: string[]; - classNames: string[]; - context: any; - controller: any; - element: HTMLElement; - isView: boolean; - isVisible: boolean; - layout: Function; - layoutName: string; - nearestChildOf: View; - nearestOfType: View; - nearestWithProperty: View; - tagName: string; - template: Function; - templateName: string; - templates: {}; - views: {}; - didInsertElement: Function; - parentViewDidChange: Function; - willClearRender: Function; - willDestroyElement: Function; - willInsertElement: Function; - } class ViewTargetActionSupport extends Mixin { target: any; actionContext: any; } var ViewUtils: {}; // TODO: define interface - function addBeforeObserver(obj: any, path: string, target: any, method: Function): any; function addListener(obj: any, eventName: string, target: any, method: Function, once?: boolean): void; function addListener(obj: any, eventName: string, target: any, method: string, once?: boolean): void; function addListener(obj: any, eventName: string, func: Function, method: Function, once?: boolean): void; @@ -2820,10 +2397,7 @@ declare namespace Ember { **/ var alias: typeof deprecateFunc; function aliasMethod(methodName: string): Descriptor; - var anyUnprocessedMixins: boolean; function assert(desc: string, test: boolean): void; - function beforeObserver(func: Function, propertyName: string): Function; - function beforeObserversFor(obj: any, path: string): string[]; function beginPropertyChanges(): void; function bind(obj: any, to: string, from: string): Binding; function cacheFor(obj: any, key: string): any; @@ -2852,8 +2426,6 @@ declare namespace Ember { oneWay(dependentKey: string): ComputedProperty; or(...args: string[]): ComputedProperty; }; - // ReSharper disable DuplicatingLocalDeclaration - var config: {}; // ReSharper restore DuplicatingLocalDeclaration function controllerFor(container: Container, controllerName: string, lookupOptions?: {}): Controller; function copy(obj: any, deep: boolean): any; @@ -2873,14 +2445,10 @@ declare namespace Ember { // ReSharper disable once DuplicatingLocalDeclaration var empty: typeof deprecateFunc; function endPropertyChanges(): void; - // ReSharper disable once DuplicatingLocalDeclaration - var exports: {}; function finishChains(obj: any): void; - function flushPendingChains(): void; function generateController(container: Container, controllerName: string, context: any): Controller; function generateGuid(obj: any, prefix?: string): string; function get(obj: any, keyName: string): any; - function getMeta(obj: any, property: string): any; /** getPath is deprecated since get now supports paths. **/ @@ -2891,7 +2459,6 @@ declare namespace Ember { function hasListeners(context: any, name: string): boolean; function hasOwnProperty(prop: string): boolean; function immediateObserver(func: Function, ...propertyNames: any[]): Function; - var imports: {}; function inspect(obj: any): string; function instrument(name: string, payload: any, callback: Function, binding: any): void; function isArray(obj: any): boolean; @@ -2910,33 +2477,25 @@ declare namespace Ember { var lookup: {}; // TODO: define interface function makeArray(obj: any): any[]; function merge(original: any, updates: any): any; - function meta(obj: any, writable?: boolean): {}; - function metaPath(obj: any, path: string, writable?: boolean): any; + function meta(obj: any): {}; function mixin(obj: any, ...args: any[]): any; /** Ember.none is deprecated. Please use Ember.isNone instead. **/ var none: typeof deprecateFunc; - function normalizeTuple(target: any, path: string): any[]; function observer(...args: any[]): Function; function observersFor(obj: any, path: string): any[]; function onLoad(name: string, callback: Function): void; - function oneWay(obj: any, to: string, from: string): Binding; var onError: Error; function overrideChains(obj: any, keyName: string, m: any): boolean; // ReSharper disable once DuplicatingLocalDeclaration var platform: { - addBeforeObserver: ModifyObserver; - addObserver: ModifyObserver; - defineProperty(obj: any, keyName: string, desc: {}): void; - removeBeforeObserver: ModifyObserver; - removeObserver: ModifyObserver; + defineProperty: boolean; hasPropertyAccessors: boolean; }; function propertyDidChange(obj: any, keyName: string): void; function propertyIsEnumerable(prop: string): boolean; function propertyWillChange(obj: any, keyName: string): void; - function removeBeforeObserver(obj: any, path: string, target: any, method: Function): any; function removeChainWatcher(obj: any, keyName: string, node: any): void; function removeListener(obj: any, eventName: string, target: any, method: Function): void; function removeListener(obj: any, eventName: string, target: any, method: string): void; @@ -2972,7 +2531,6 @@ declare namespace Ember { function runLoadHooks(name: string, object: any): void; function sendEvent(obj: any, eventName: string, params?: any[], actions?: any[]): boolean; function set(obj: any, keyName: string, value: any): any; - function setMeta(obj: any, property: string, value: any): void; /** setPath is deprecated since set now supports paths. **/ @@ -2982,7 +2540,6 @@ declare namespace Ember { function toLocaleString(): string; function toString(): string; function tryCatchFinally(tryable: Function, catchable: Function, finalizer: Function, binding?: any): any; - function tryFinally(tryable: Function, finalizer: Function, binding?: any): any; function tryInvoke(obj: any, methodName: string, args?: any[]): any; function trySet(obj: any, path: string, value: any): void; /** @@ -3002,48 +2559,42 @@ declare namespace Ember { function watchPath(obj: any, keyPath: string): void; function watchedEvents(obj: {}): any[]; function wrap(func: Function, superFunc: Function): Function; + var _ContainerProxyMixin : Mixin; + var _RegistryProxyMixin: Mixin; + function getOwner(object: any): any; + function setOwner(object: any, owner: any): void; + var testing : boolean; + var MODEL_FACTORY_INJECTIONS : boolean; + function assign(original: any, ...sources: any[]): any; } -// ReSharper disable DuplicatingLocalDeclaration declare namespace Em { - /** - Alias for jQuery. - **/ var $: typeof Ember.$; var A: typeof Ember.A; - class ActionHandlerMixin extends Ember.ActionHandlerMixin { } + class ActionHandlerMixin extends Ember.ActionHandlerMixin { } class Application extends Ember.Application { } class Array extends Ember.Array { } - class ArrayController extends Ember.ArrayController { } - var ArrayPolyfills: typeof Ember.ArrayPolyfills; class ArrayProxy extends Ember.ArrayProxy { } var BOOTED: typeof Ember.BOOTED; class Binding extends Ember.Binding { } class Button extends Ember.Button { } class Checkbox extends Ember.Checkbox { } - class CollectionView extends Ember.CollectionView { } class Comparable extends Ember.Comparable { } class Component extends Ember.Component { } class ComputedProperty extends Ember.ComputedProperty { } class Container extends Ember.Container { } - class ContainerView extends Ember.ContainerView { } class Controller extends Ember.Controller { } class ControllerMixin extends Ember.ControllerMixin { } - class Copyable extends Ember.Copyable { } + class Copyable extends Ember.Copyable {} class CoreObject extends Ember.CoreObject { } - class CoreView extends Ember.CoreView { } - class DAG extends Ember.DAG { } - var DEFAULT_GETTER_FUNCTION: typeof Ember.DEFAULT_GETTER_FUNCTION; - class DefaultResolver extends Ember.DefaultResolver { } - class Deffered extends Ember.Deferred { } - class DeferredMixin extends Ember.DeferredMixin { } + class DAG extends Ember.DAG {} + var DEFAULT_GETTER_FUNCTION : typeof Ember.DEFAULT_GETTER_FUNCTION; + class DefaultResolver extends Ember.DefaultResolver { } class Descriptor extends Ember.Descriptor { } - var EMPTY_META: typeof Ember.EMPTY_META; var ENV: typeof Ember.ENV; var EXTEND_PROTOTYPES: typeof Ember.EXTEND_PROTOTYPES; class EachProxy extends Ember.EachProxy { } class Enumerable extends Ember.Enumerable { } - var EnumerableUtils: typeof Ember.EnumerableUtils; var Error: typeof Ember.Error; class EventDispatcher extends Ember.EventDispatcher { } class Evented extends Ember.Evented { } @@ -3052,14 +2603,9 @@ declare namespace Em { var GUID_KEY: typeof Ember.GUID_KEY; namespace Handlebars { var compile: typeof Ember.Handlebars.compile; - var get: typeof Ember.Handlebars.get; - var helper: typeof Ember.Handlebars.helper; - class helpers extends Ember.Handlebars.helpers { } var precompile: typeof Ember.Handlebars.precompile; - var registerBoundHelper: typeof Ember.Handlebars.registerBoundHelper; class Compiler extends Ember.Handlebars.Compiler { } - class JavaScriptCompiler extends Ember.Handlebars.JavaScriptCompiler { } - var registerHelper: typeof Ember.Handlebars.registerHelper; + class JavaScriptCompiler extends Ember.Handlebars.JavaScriptCompiler{ } var registerPartial: typeof Ember.Handlebars.registerPartial; var K: typeof Ember.Handlebars.K; var createFrame: typeof Ember.Handlebars.createFrame; @@ -3078,8 +2624,7 @@ declare namespace Em { var LOG_BINDINGS: typeof Ember.LOG_BINDINGS; var LOG_STACKTRACE_ON_DEPRECATION: typeof Ember.LOG_STACKTRACE_ON_DEPRECATION; var LOG_VERSION: typeof Ember.LOG_VERSION; - class LinkView extends Ember.LinkView { } - class Location extends Ember.Location { } + class Location extends Ember.Location {} var Logger: typeof Ember.Logger; var MANDATORY_SETTER_FUNCTION: typeof Ember.MANDATORY_SETTER_FUNCTION; var META_KEY: typeof Ember.META_KEY; @@ -3087,66 +2632,57 @@ declare namespace Em { class MapWithDefault extends Ember.MapWithDefault { } class Mixin extends Ember.Mixin { } class MutableArray extends Ember.MutableArray { } - class MutableEnumerable extends Ember.MutableEnumberable { } + class MutableEnumberable extends Ember.MutableEnumberable { } var NAME_KEY: typeof Ember.NAME_KEY; class Namespace extends Ember.Namespace { } class NativeArray extends Ember.NativeArray { } class NoneLocation extends Ember.NoneLocation { } var ORDER_DEFINITION: typeof Ember.ORDER_DEFINITION; class Object extends Ember.Object { } - class ObjectController extends Ember.ObjectController { } class ObjectProxy extends Ember.ObjectProxy { } class Observable extends Ember.Observable { } class OrderedSet extends Ember.OrderedSet { } + class Registry extends Ember.Registry { } namespace RSVP { interface PromiseResolve extends Ember.RSVP.PromiseResolve { } interface PromiseReject extends Ember.RSVP.PromiseReject { } interface PromiseResolverFunction extends Ember.RSVP.PromiseResolverFunction { } class Promise extends Ember.RSVP.Promise { } } - class RenderBuffer extends Ember.RenderBuffer { } - class Route extends Ember.Route { } + class Route extends Ember.Route {} class Router extends Ember.Router { } class RouterDSL extends Ember.RouterDSL { } - var SHIM_ES5: typeof Ember.SHIM_ES5; var STRINGS: typeof Ember.STRINGS; - class Select extends Ember.Select { } - class SelectOption extends Ember.SelectOption { } - class Set extends Ember.Set { } - class SortableMixin extends Ember.SortableMixin { } class State extends Ember.State { } class StateManager extends Ember.StateManager { } - namespace String { - var camelize: typeof Ember.String.camelize; - var capitalize: typeof Ember.String.capitalize; - var classify: typeof Ember.String.classify; - var dasherize: typeof Ember.String.dasherize; - var decamelize: typeof Ember.String.decamelize; - var fmt: typeof Ember.String.fmt; - var htmlSafe: typeof Ember.String.htmlSafe; - var loc: typeof Ember.String.loc; - var underscore: typeof Ember.String.underscore; - var w: typeof Ember.String.w; - } + var String : typeof Ember.String; var TEMPLATES: typeof Ember.TEMPLATES; - class TargetActionSupport extends Ember.TargetActionSupport { } - class Test extends Ember.Test { } + class TargetActionSupport extends Ember.TargetActionSupport {} + namespace Test { + class Adapter extends Ember.Test.Adapter { } + class Promise extends Ember.Test.Promise { } + var oninjectHelpers: typeof Ember.Test.oninjectHelpers; + var promise: typeof Ember.Test.promise; + var unregisterHelper: typeof Ember.Test.unregisterHelper; + var registerHelper: typeof Ember.Test.registerHelper; + var registerAsyncHelper: typeof Ember.Test.registerAsyncHelper; + var adapter: typeof Ember.Test.adapter; + var QUnitAdapter: typeof Ember.Test.QUnitAdapter; + var registerWaiter: typeof Ember.Test.registerWaiter; + var unregisterWaiter: typeof Ember.Test.unregisterWaiter + var resolve: typeof Ember.Test.resolve; + } class TextArea extends Ember.TextArea { } class TextField extends Ember.TextField { } class TextSupport extends Ember.TextSupport { } var VERSION: typeof Ember.VERSION; - class View extends Ember.View { } class ViewTargetActionSupport extends Ember.ViewTargetActionSupport { } var ViewUtils: typeof Ember.ViewUtils; - var addBeforeObserver: typeof Ember.addBeforeObserver; var addListener: typeof Ember.addListener; var addObserver: typeof Ember.addObserver; var alias: typeof Ember.alias; var aliasMethod: typeof Ember.aliasMethod; - var anyUnprocessedMixins: typeof Ember.anyUnprocessedMixins; var assert: typeof Ember.assert; - var beforeObserver: typeof Ember.beforeObserver; - var beforeObserversFor: typeof Ember.beforeObserversFor; var beginPropertyChanges: typeof Ember.beginPropertyChanges; var bind: typeof Ember.bind; var cacheFor: typeof Ember.cacheFor; @@ -3154,24 +2690,20 @@ declare namespace Em { var changeProperties: typeof Ember.changeProperties; var compare: typeof Ember.compare; var computed: typeof Ember.computed; - var config: typeof Ember.config; var controllerFor: typeof Ember.controllerFor; var copy: typeof Ember.copy; var create: typeof Ember.create; var debug: typeof Ember.debug; var defineProperty: typeof Ember.defineProperty; var deprecate: typeof Ember.deprecate; - var deprecateFunc: typeof Ember.deprecateFunc; + var deprecateFunc: typeof Ember.deprecateFunc var destroy: typeof Ember.destroy; - var empty: typeof deprecateFunc; + var empty: typeof Ember.empty; var endPropertyChanges: typeof Ember.endPropertyChanges; - var exports: typeof Ember.exports; var finishChains: typeof Ember.finishChains; - var flushPendingChains: typeof Ember.flushPendingChains; var generateController: typeof Ember.generateController; var generateGuid: typeof Ember.generateGuid; var get: typeof Ember.get; - var getMeta: typeof Ember.getMeta; var getPath: typeof Ember.getPath; var getWithDefault: typeof Ember.getWithDefault; var guidFor: typeof Ember.guidFor; @@ -3179,7 +2711,6 @@ declare namespace Em { var hasListeners: typeof Ember.hasListeners; var hasOwnProperty: typeof Ember.hasOwnProperty; var immediateObserver: typeof Ember.immediateObserver; - var imports: typeof Ember.imports; var inspect: typeof Ember.inspect; var instrument: typeof Ember.instrument; var isArray: typeof Ember.isArray; @@ -3198,21 +2729,17 @@ declare namespace Em { var makeArray: typeof Ember.makeArray; var merge: typeof Ember.merge; var meta: typeof Ember.meta; - var metaPath: typeof Ember.metaPath; var mixin: typeof Ember.mixin; var none: typeof Ember.none; - var normalizeTuple: typeof Ember.normalizeTuple; var observer: typeof Ember.observer; var observersFor: typeof Ember.observersFor; var onLoad: typeof Ember.onLoad; - var oneWay: typeof Ember.oneWay; var onError: typeof Ember.onError; var overrideChains: typeof Ember.overrideChains; var platform: typeof Ember.platform; var propertyDidChange: typeof Ember.propertyDidChange; var propertyIsEnumerable: typeof Ember.propertyIsEnumerable; var propertyWillChange: typeof Ember.propertyWillChange; - var removeBeforeObserver: typeof Ember.removeBeforeObserver; var removeChainWatcher: typeof Ember.removeChainWatcher; var removeListener: typeof Ember.removeListener; var removeObserver: typeof Ember.removeObserver; @@ -3222,14 +2749,12 @@ declare namespace Em { var runLoadHooks: typeof Ember.runLoadHooks; var sendEvent: typeof Ember.sendEvent; var set: typeof Ember.set; - var setMeta: typeof Ember.setMeta; var setPath: typeof Ember.setPath; var setProperties: typeof Ember.setProperties; var subscribe: typeof Ember.subscribe; var toLocaleString: typeof Ember.toLocaleString; var toString: typeof Ember.toString; var tryCatchFinally: typeof Ember.tryCatchFinally; - var tryFinally: typeof Ember.tryFinally; var tryInvoke: typeof Ember.tryInvoke; var trySet: typeof Ember.trySet; var trySetPath: typeof Ember.trySetPath; @@ -3245,6 +2770,13 @@ declare namespace Em { var watchPath: typeof Ember.watchPath; var watchedEvents: typeof Ember.watchedEvents; var wrap: typeof Ember.wrap; + var _ContainerProxyMixin : typeof Ember._ContainerProxyMixin; + var _RegistryProxyMixin: typeof Ember._RegistryProxyMixin; + var getOwner: typeof Ember.getOwner; + var setOwner: typeof Ember.setOwner; + var testing: typeof Ember.testing; + var MODEL_FACTORY_INJECTIONS: typeof Ember.MODEL_FACTORY_INJECTIONS; + var assign: typeof Ember.assign; } /** @@ -3252,241 +2784,5 @@ declare namespace Em { */ declare module "Ember" { - - var $: typeof Ember.$; - var A: typeof Ember.A; - class ActionHandlerMixin extends Ember.ActionHandlerMixin { } - class Application extends Ember.Application { } - class Array extends Ember.Array { } - class ArrayController extends Ember.ArrayController { } - var ArrayPolyfills: typeof Ember.ArrayPolyfills; - class ArrayProxy extends Ember.ArrayProxy { } - var BOOTED: typeof Ember.BOOTED; - class Binding extends Ember.Binding { } - class Button extends Ember.Button { } - class Checkbox extends Ember.Checkbox { } - class CollectionView extends Ember.CollectionView { } - class Comparable extends Ember.Comparable { } - class Component extends Ember.Component { } - class ComputedProperty extends Ember.ComputedProperty { } - class Container extends Ember.Container { } - class ContainerView extends Ember.ContainerView { } - class Controller extends Ember.Controller { } - class ControllerMixin extends Ember.ControllerMixin { } - class Copyable extends Ember.Copyable { } - class CoreObject extends Ember.CoreObject { } - class CoreView extends Ember.CoreView { } - class DAG extends Ember.DAG { } - var DEFAULT_GETTER_FUNCTION: typeof Ember.DEFAULT_GETTER_FUNCTION; - class DefaultResolver extends Ember.DefaultResolver { } - class Deffered extends Ember.Deferred { } - class DeferredMixin extends Ember.DeferredMixin { } - class Descriptor extends Ember.Descriptor { } - var EMPTY_META: typeof Ember.EMPTY_META; - var ENV: typeof Ember.ENV; - var EXTEND_PROTOTYPES: typeof Ember.EXTEND_PROTOTYPES; - class EachProxy extends Ember.EachProxy { } - class Enumerable extends Ember.Enumerable { } - var EnumerableUtils: typeof Ember.EnumerableUtils; - var Error: typeof Ember.Error; - class EventDispatcher extends Ember.EventDispatcher { } - class Evented extends Ember.Evented { } - var FROZEN_ERROR: typeof Ember.FROZEN_ERROR; - class Freezable extends Ember.Freezable { } - var GUID_KEY: typeof Ember.GUID_KEY; - namespace Handlebars { - var compile: typeof Ember.Handlebars.compile; - var get: typeof Ember.Handlebars.get; - var helper: typeof Ember.Handlebars.helper; - class helpers extends Ember.Handlebars.helpers { } - var precompile: typeof Ember.Handlebars.precompile; - var registerBoundHelper: typeof Ember.Handlebars.registerBoundHelper; - class Compiler extends Ember.Handlebars.Compiler { } - class JavaScriptCompiler extends Ember.Handlebars.JavaScriptCompiler { } - var registerHelper: typeof Ember.Handlebars.registerHelper; - var registerPartial: typeof Ember.Handlebars.registerPartial; - var K: typeof Ember.Handlebars.K; - var createFrame: typeof Ember.Handlebars.createFrame; - var Exception: typeof Ember.Handlebars.Exception; - class SafeString extends Ember.Handlebars.SafeString { } - var parse: typeof Ember.Handlebars.parse; - var print: typeof Ember.Handlebars.print; - var logger: typeof Ember.Handlebars.logger; - var log: typeof Ember.Handlebars.log; - } - class HashLocation extends Ember.HashLocation { } - class HistoryLocation extends Ember.HistoryLocation { } - var IS_BINDING: typeof Ember.IS_BINDING; - class Instrumentation extends Ember.Instrumentation { } - var K: typeof Ember.K; - var LOG_BINDINGS: typeof Ember.LOG_BINDINGS; - var LOG_STACKTRACE_ON_DEPRECATION: typeof Ember.LOG_STACKTRACE_ON_DEPRECATION; - var LOG_VERSION: typeof Ember.LOG_VERSION; - class LinkView extends Ember.LinkView { } - class Location extends Ember.Location { } - var Logger: typeof Ember.Logger; - var MANDATORY_SETTER_FUNCTION: typeof Ember.MANDATORY_SETTER_FUNCTION; - var META_KEY: typeof Ember.META_KEY; - class Map extends Ember.Map { } - class MapWithDefault extends Ember.MapWithDefault { } - class Mixin extends Ember.Mixin { } - class MutableArray extends Ember.MutableArray { } - class MutableEnumerable extends Ember.MutableEnumberable { } - var NAME_KEY: typeof Ember.NAME_KEY; - class Namespace extends Ember.Namespace { } - class NativeArray extends Ember.NativeArray { } - class NoneLocation extends Ember.NoneLocation { } - var ORDER_DEFINITION: typeof Ember.ORDER_DEFINITION; - class Object extends Ember.Object { } - class ObjectController extends Ember.ObjectController { } - class ObjectProxy extends Ember.ObjectProxy { } - class Observable extends Ember.Observable { } - class OrderedSet extends Ember.OrderedSet { } - namespace RSVP { - interface PromiseResolve extends Ember.RSVP.PromiseResolve { } - interface PromiseReject extends Ember.RSVP.PromiseReject { } - interface PromiseResolverFunction extends Ember.RSVP.PromiseResolverFunction { } - class Promise extends Ember.RSVP.Promise { } - } - class RenderBuffer extends Ember.RenderBuffer { } - class Route extends Ember.Route { } - class Router extends Ember.Router { } - class RouterDSL extends Ember.RouterDSL { } - var SHIM_ES5: typeof Ember.SHIM_ES5; - var STRINGS: typeof Ember.STRINGS; - class Select extends Ember.Select { } - class SelectOption extends Ember.SelectOption { } - class Set extends Ember.Set { } - class SortableMixin extends Ember.SortableMixin { } - class State extends Ember.State { } - class StateManager extends Ember.StateManager { } - namespace String { - var camelize: typeof Ember.String.camelize; - var capitalize: typeof Ember.String.capitalize; - var classify: typeof Ember.String.classify; - var dasherize: typeof Ember.String.dasherize; - var decamelize: typeof Ember.String.decamelize; - var fmt: typeof Ember.String.fmt; - var htmlSafe: typeof Ember.String.htmlSafe; - var loc: typeof Ember.String.loc; - var underscore: typeof Ember.String.underscore; - var w: typeof Ember.String.w; - } - var TEMPLATES: typeof Ember.TEMPLATES; - class TargetActionSupport extends Ember.TargetActionSupport { } - class Test extends Ember.Test { } - class TextArea extends Ember.TextArea { } - class TextField extends Ember.TextField { } - class TextSupport extends Ember.TextSupport { } - var VERSION: typeof Ember.VERSION; - class View extends Ember.View { } - class ViewTargetActionSupport extends Ember.ViewTargetActionSupport { } - var ViewUtils: typeof Ember.ViewUtils; - var addBeforeObserver: typeof Ember.addBeforeObserver; - var addListener: typeof Ember.addListener; - var addObserver: typeof Ember.addObserver; - var alias: typeof Ember.alias; - var aliasMethod: typeof Ember.aliasMethod; - var anyUnprocessedMixins: typeof Ember.anyUnprocessedMixins; - var assert: typeof Ember.assert; - var beforeObserver: typeof Ember.beforeObserver; - var beforeObserversFor: typeof Ember.beforeObserversFor; - var beginPropertyChanges: typeof Ember.beginPropertyChanges; - var bind: typeof Ember.bind; - var cacheFor: typeof Ember.cacheFor; - var canInvoke: typeof Ember.canInvoke; - var changeProperties: typeof Ember.changeProperties; - var compare: typeof Ember.compare; - var computed: typeof Ember.computed; - var config: typeof Ember.config; - var controllerFor: typeof Ember.controllerFor; - var copy: typeof Ember.copy; - var create: typeof Ember.create; - var debug: typeof Ember.debug; - var defineProperty: typeof Ember.defineProperty; - var deprecate: typeof Ember.deprecate; - var deprecateFunc: typeof Ember.deprecateFunc; - var destroy: typeof Ember.destroy; - var empty: typeof Ember.deprecateFunc; - var endPropertyChanges: typeof Ember.endPropertyChanges; - var exports: typeof Ember.exports; - var finishChains: typeof Ember.finishChains; - var flushPendingChains: typeof Ember.flushPendingChains; - var generateController: typeof Ember.generateController; - var generateGuid: typeof Ember.generateGuid; - var get: typeof Ember.get; - var getMeta: typeof Ember.getMeta; - var getPath: typeof Ember.getPath; - var getWithDefault: typeof Ember.getWithDefault; - var guidFor: typeof Ember.guidFor; - var handleErrors: typeof Ember.handleErrors; - var hasListeners: typeof Ember.hasListeners; - var hasOwnProperty: typeof Ember.hasOwnProperty; - var immediateObserver: typeof Ember.immediateObserver; - var imports: typeof Ember.imports; - var inspect: typeof Ember.inspect; - var instrument: typeof Ember.instrument; - var isArray: typeof Ember.isArray; - var isEmpty: typeof Ember.isEmpty; - var isEqual: typeof Ember.isEqual; - var isGlobalPath: typeof Ember.isGlobalPath; - var isNamespace: typeof Ember.isNamespace; - var isNone: typeof Ember.isNone; - var isPrototypeOf: typeof Ember.isPrototypeOf; - var isWatching: typeof Ember.isWatching; - var keys: typeof Ember.keys; - var listenersDiff: typeof Ember.listenersDiff; - var listenersFor: typeof Ember.listenersFor; - var listenersUnion: typeof Ember.listenersUnion; - var lookup: typeof Ember.lookup; - var makeArray: typeof Ember.makeArray; - var merge: typeof Ember.merge; - var meta: typeof Ember.meta; - var metaPath: typeof Ember.metaPath; - var mixin: typeof Ember.mixin; - var none: typeof Ember.none; - var normalizeTuple: typeof Ember.normalizeTuple; - var observer: typeof Ember.observer; - var observersFor: typeof Ember.observersFor; - var onLoad: typeof Ember.onLoad; - var oneWay: typeof Ember.oneWay; - var onError: typeof Ember.onError; - var overrideChains: typeof Ember.overrideChains; - var platform: typeof Ember.platform; - var propertyDidChange: typeof Ember.propertyDidChange; - var propertyIsEnumerable: typeof Ember.propertyIsEnumerable; - var propertyWillChange: typeof Ember.propertyWillChange; - var removeBeforeObserver: typeof Ember.removeBeforeObserver; - var removeChainWatcher: typeof Ember.removeChainWatcher; - var removeListener: typeof Ember.removeListener; - var removeObserver: typeof Ember.removeObserver; - var required: typeof Ember.required; - var rewatch: typeof Ember.rewatch; - var run: typeof Ember.run; - var runLoadHooks: typeof Ember.runLoadHooks; - var sendEvent: typeof Ember.sendEvent; - var set: typeof Ember.set; - var setMeta: typeof Ember.setMeta; - var setPath: typeof Ember.setPath; - var setProperties: typeof Ember.setProperties; - var subscribe: typeof Ember.subscribe; - var toLocaleString: typeof Ember.toLocaleString; - var toString: typeof Ember.toString; - var tryCatchFinally: typeof Ember.tryCatchFinally; - var tryFinally: typeof Ember.tryFinally; - var tryInvoke: typeof Ember.tryInvoke; - var trySet: typeof Ember.trySet; - var trySetPath: typeof Ember.trySetPath; - var typeOf: typeof Ember.typeOf; - var unwatch: typeof Ember.unwatch; - var unwatchKey: typeof Ember.unwatchKey; - var unwatchPath: typeof Ember.unwatchPath; - var uuid: typeof Ember.uuid; - var valueOf: typeof Ember.valueOf; - var warn: typeof Ember.warn; - var watch: typeof Ember.watch; - var watchKey: typeof Ember.watchKey; - var watchPath: typeof Ember.watchPath; - var watchedEvents: typeof Ember.watchedEvents; - var wrap: typeof Ember.wrap; + export = Ember; } diff --git a/enzyme/enzyme-1.2.0-tests.tsx b/enzyme/enzyme-1.2.0-tests.tsx new file mode 100644 index 0000000000..44db5705bc --- /dev/null +++ b/enzyme/enzyme-1.2.0-tests.tsx @@ -0,0 +1,605 @@ +/// +/// + +import { shallow, mount, render, describeWithDOM, spyLifecycle } from "enzyme"; +import * as React from "react"; +import {Component, ReactElement, HTMLAttributes} from "react"; +import {ShallowWrapper, ReactWrapper, CheerioWrapper} from "enzyme"; + + +// Help classes/interfaces +interface MyComponentProps { + propsProperty: any; + numberProp?: number; +} + +interface StatelessProps { + stateless: any; +} + +interface MyComponentState { + stateProperty: any; +} + +class MyComponent extends Component { + setState(...args: any[]) { + } +} + +const MyStatelessComponent = (props: StatelessProps) => ; + +// API +namespace SpyLifecycleTest { + spyLifecycle(MyComponent); +} + +// ShallowWrapper +namespace ShallowWrapperTest { + var shallowWrapper: ShallowWrapper = + shallow(); + + var reactElement: ReactElement, + objectVal: Object, + boolVal: Boolean, + stringVal: String, + elementWrapper: ShallowWrapper + + function test_find() { + elementWrapper = shallowWrapper.find('.selector'); + shallowWrapper = shallowWrapper.find(MyComponent); + shallowWrapper.find(MyStatelessComponent).props().stateless; + shallowWrapper.find(MyStatelessComponent).shallow(); + } + + function test_findWhere() { + shallowWrapper = + shallowWrapper.findWhere((aShallowWrapper: ShallowWrapper) => true); + } + + function test_filter() { + elementWrapper = shallowWrapper.filter('.selector'); + shallowWrapper = shallowWrapper.filter(MyComponent).shallow(); + } + + function test_filterWhere() { + shallowWrapper = + shallowWrapper.filterWhere(wrapper => { + wrapper.props().propsProperty; + return true; + }); + } + + function test_contains() { + boolVal = shallowWrapper.contains(
      ); + } + + function test_hasClass() { + boolVal = shallowWrapper.find('.my-button').hasClass('disabled'); + } + + function test_is() { + boolVal = shallowWrapper.is('.some-class'); + } + + function test_not() { + elementWrapper = shallowWrapper.find('.foo').not('.bar'); + } + + function test_children() { + shallowWrapper = shallowWrapper.children(); + shallowWrapper.children(MyStatelessComponent).props().stateless; + } + + function test_parents() { + shallowWrapper = shallowWrapper.parents(); + } + + function test_parent() { + shallowWrapper = shallowWrapper.parent(); + } + + function test_closest() { + elementWrapper = shallowWrapper.closest('.selector'); + shallowWrapper = shallowWrapper.closest(MyComponent); + } + + function test_shallow() { + shallowWrapper = shallowWrapper.shallow(); + } + + function test_unmount() { + shallowWrapper = shallowWrapper.unmount(); + } + + function test_render() { + var cheerioWrapper: CheerioWrapper = shallowWrapper.render(); + } + + function test_text() { + stringVal = shallowWrapper.text(); + } + + + function test_html() { + stringVal = shallowWrapper.html(); + } + + function test_get() { + reactElement = shallowWrapper.get(1); + } + + function test_at() { + shallowWrapper = shallowWrapper.at(1); + } + + function test_first() { + shallowWrapper = shallowWrapper.first(); + } + + function test_last() { + shallowWrapper = shallowWrapper.last(); + } + + function test_state() { + shallowWrapper.state(); + shallowWrapper.state('key'); + } + + function test_props() { + objectVal = shallowWrapper.props(); + } + + function test_prop() { + shallowWrapper.prop('key'); + } + + + function test_simulate(...args: any[]) { + shallowWrapper.simulate('click'); + shallowWrapper.simulate('click', args); + } + + function test_setState() { + shallowWrapper = shallowWrapper.setState({stateProperty: 'state'}); + } + + function test_setProps() { + shallowWrapper = shallowWrapper.setProps({propsProperty: 'foo'}); + } + + function test_setContext() { + shallowWrapper = shallowWrapper.setContext({name: 'baz'}); + } + + function test_instance() { + var myComponent: MyComponent = shallowWrapper.instance(); + } + + function test_update() { + shallowWrapper = shallowWrapper.update(); + } + + function test_debug() { + stringVal = shallowWrapper.debug(); + } + + function test_type() { + var stringOrFunction: String|Function = shallowWrapper.type(); + } + + function test_forEach() { + shallowWrapper = + shallowWrapper.forEach(wrapper => wrapper.shallow().props().propsProperty); + } + + function test_map() { + var arrayNumbers: Array = + shallowWrapper.map(wrapper => wrapper.props().numberProp); + } + + function test_reduce() { + const total: number[] = + shallowWrapper.reduce( + (amount: number, n: ShallowWrapper) => amount + n.props().numberProp + ); + } + + function test_reduceRight() { + const total: number[] = + shallowWrapper.reduceRight( + (amount: number, n: ShallowWrapper) => amount + n.prop('amount') + ); + } + + function test_some() { + boolVal = shallowWrapper.some('.selector'); + boolVal = shallowWrapper.some(MyComponent); + } + + function test_someWhere() { + boolVal = shallowWrapper.someWhere((aShallowWrapper: ShallowWrapper) => true); + } + + function test_every() { + boolVal = shallowWrapper.every('.selector'); + boolVal = shallowWrapper.every(MyComponent); + } + + function test_everyWhere() { + boolVal = shallowWrapper.everyWhere((aShallowWrapper: ShallowWrapper) => true); + } +} + + +// ReactWrapper +namespace ReactWrapperTest { + var reactWrapper: ReactWrapper = + mount(); + + var reactElement: ReactElement, + objectVal: Object, + boolVal: Boolean, + stringVal: String, + elementWrapper: ReactWrapper + + function test_unmount() { + reactWrapper = reactWrapper.unmount(); + } + + function test_mount() { + reactWrapper = reactWrapper.mount(); + } + + function test_find() { + elementWrapper = reactWrapper.find('.selector'); + reactWrapper = reactWrapper.find(MyComponent); + reactWrapper.find(MyStatelessComponent).props().stateless; + } + + function test_findWhere() { + reactWrapper = + reactWrapper.findWhere((aReactWrapper: ReactWrapper) => true); + } + + function test_filter() { + elementWrapper = reactWrapper.filter('.selector'); + reactWrapper = reactWrapper.filter(MyComponent); + } + + function test_filterWhere() { + reactWrapper = + reactWrapper.filterWhere(wrapper => { + wrapper.props().propsProperty; + return true; + }); + } + + function test_contains() { + boolVal = reactWrapper.contains(
      ); + } + + function test_hasClass() { + boolVal = reactWrapper.find('.my-button').hasClass('disabled'); + } + + function test_is() { + boolVal = reactWrapper.is('.some-class'); + } + + function test_not() { + elementWrapper = reactWrapper.find('.foo').not('.bar'); + } + + function test_children() { + reactWrapper = reactWrapper.children(); + } + + function test_parents() { + reactWrapper = reactWrapper.parents(); + } + + function test_parent() { + reactWrapper = reactWrapper.parent(); + } + + function test_closest() { + elementWrapper = reactWrapper.closest('.selector'); + reactWrapper = reactWrapper.closest(MyComponent); + } + + function test_text() { + stringVal = reactWrapper.text(); + } + + function test_html() { + stringVal = reactWrapper.html(); + } + + function test_get() { + reactElement = reactWrapper.get(1); + } + + function test_at() { + reactWrapper = reactWrapper.at(1); + } + + function test_first() { + reactWrapper = reactWrapper.first(); + } + + function test_last() { + reactWrapper = reactWrapper.last(); + } + + function test_state() { + reactWrapper.state(); + reactWrapper.state('key'); + } + + function test_props() { + objectVal = reactWrapper.props(); + } + + function test_prop() { + reactWrapper.prop('key'); + } + + + function test_simulate(...args: any[]) { + reactWrapper.simulate('click'); + reactWrapper.simulate('click', args); + } + + function test_setState() { + reactWrapper = reactWrapper.setState({stateProperty: 'state'}); + } + + function test_setProps() { + reactWrapper = reactWrapper.setProps({propsProperty: 'foo'}); + } + + function test_setContext() { + reactWrapper = reactWrapper.setContext({name: 'baz'}); + } + + function test_instance() { + var myComponent: MyComponent = reactWrapper.instance(); + } + + function test_update() { + reactWrapper = reactWrapper.update(); + } + + function test_debug() { + stringVal = reactWrapper.debug(); + } + + function test_type() { + var stringOrFunction: String|Function = reactWrapper.type(); + } + + function test_forEach() { + reactWrapper = + reactWrapper.forEach(wrapper => wrapper.props().propsProperty); + } + + function test_map() { + var arrayNumbers: Array = + reactWrapper.map(wrapper => wrapper.props().numberProp); + } + + function test_reduce() { + const total: number[] = + reactWrapper.reduce( + (amount: number, n: ReactWrapper) => amount + n.prop('amount') + ); + } + + function test_reduceRight() { + const total: number[] = + reactWrapper.reduceRight( + (amount: number, n: ReactWrapper) => amount + n.prop('amount') + ); + } + + function test_some() { + boolVal = reactWrapper.some('.selector'); + boolVal = reactWrapper.some(MyComponent); + } + + function test_someWhere() { + boolVal = reactWrapper.someWhere((aReactWrapper: ReactWrapper) => true); + } + + function test_every() { + boolVal = reactWrapper.every('.selector'); + boolVal = reactWrapper.every(MyComponent); + } + + function test_everyWhere() { + boolVal = reactWrapper.everyWhere((aReactWrapper: ReactWrapper) => true); + } +} + +// CheerioWrapper +namespace CheerioWrapperTest { + var cheerioWrapper: CheerioWrapper = + render(); + + var reactElement: ReactElement, + objectVal: Object, + boolVal: Boolean, + stringVal: String, + elementWrapper: CheerioWrapper + + function test_find() { + elementWrapper = cheerioWrapper.find('.selector'); + cheerioWrapper = cheerioWrapper.find(MyComponent); + cheerioWrapper.find(MyStatelessComponent).props().stateless; + } + + function test_findWhere() { + cheerioWrapper = + cheerioWrapper.findWhere((aCheerioWrapper: CheerioWrapper) => true); + } + + function test_filter() { + elementWrapper = cheerioWrapper.filter('.selector'); + cheerioWrapper = cheerioWrapper.filter(MyComponent); + } + + function test_filterWhere() { + cheerioWrapper = + cheerioWrapper.filterWhere(wrapper => { + wrapper.props().propsProperty; + return true; + }); + } + + function test_contains() { + boolVal = cheerioWrapper.contains(
      ); + } + + function test_hasClass() { + boolVal = cheerioWrapper.find('.my-button').hasClass('disabled'); + } + + function test_is() { + boolVal = cheerioWrapper.is('.some-class'); + } + + function test_not() { + elementWrapper = cheerioWrapper.find('.foo').not('.bar'); + } + + function test_children() { + cheerioWrapper = cheerioWrapper.children(); + } + + function test_parents() { + cheerioWrapper = cheerioWrapper.parents(); + } + + function test_parent() { + cheerioWrapper = cheerioWrapper.parent(); + } + + function test_closest() { + elementWrapper = cheerioWrapper.closest('.selector'); + cheerioWrapper = cheerioWrapper.closest(MyComponent); + } + + function test_text() { + stringVal = cheerioWrapper.text(); + } + + function test_html() { + stringVal = cheerioWrapper.html(); + } + + function test_get() { + reactElement = cheerioWrapper.get(1); + } + + function test_at() { + cheerioWrapper = cheerioWrapper.at(1); + } + + function test_first() { + cheerioWrapper = cheerioWrapper.first(); + } + + function test_last() { + cheerioWrapper = cheerioWrapper.last(); + } + + function test_state() { + cheerioWrapper.state(); + cheerioWrapper.state('key'); + } + + function test_props() { + objectVal = cheerioWrapper.props(); + } + + function test_prop() { + cheerioWrapper.prop('key'); + } + + + function test_simulate(...args: any[]) { + cheerioWrapper.simulate('click'); + cheerioWrapper.simulate('click', args); + } + + function test_setState() { + cheerioWrapper = cheerioWrapper.setState({stateProperty: 'state'}); + } + + function test_setProps() { + cheerioWrapper = cheerioWrapper.setProps({propsProperty: 'foo'}); + } + + function test_setContext() { + cheerioWrapper = cheerioWrapper.setContext({name: 'baz'}); + } + + function test_instance() { + var myComponent: MyComponent = cheerioWrapper.instance(); + } + + function test_update() { + cheerioWrapper = cheerioWrapper.update(); + } + + function test_debug() { + stringVal = cheerioWrapper.debug(); + } + + function test_type() { + var stringOrFunction: String|Function = cheerioWrapper.type(); + } + + function test_forEach() { + cheerioWrapper = + cheerioWrapper.forEach((aCheerioWrapper: CheerioWrapper)=> { + }); + } + + function test_map() { + var arrayNumbers: Array = + cheerioWrapper.map(wrapper => wrapper.props().numberProp); + } + + function test_reduce() { + const total: number[] = + cheerioWrapper.reduce( + (amount: number, n: CheerioWrapper) => amount + n.prop('amount') + ); + } + + function test_reduceRight() { + const total: number[] = + cheerioWrapper.reduceRight( + (amount: number, n: CheerioWrapper) => amount + n.prop('amount') + ); + } + + function test_some() { + boolVal = cheerioWrapper.some('.selector'); + boolVal = cheerioWrapper.some(MyComponent); + } + + function test_someWhere() { + boolVal = cheerioWrapper.someWhere((aCheerioWrapper: CheerioWrapper) => true); + } + + function test_every() { + boolVal = cheerioWrapper.every('.selector'); + boolVal = cheerioWrapper.every(MyComponent); + } + + function test_everyWhere() { + boolVal = cheerioWrapper.everyWhere((aCheerioWrapper: CheerioWrapper) => true); + } +} diff --git a/enzyme/enzyme-1.2.0.d.ts b/enzyme/enzyme-1.2.0.d.ts new file mode 100644 index 0000000000..13c00041a5 --- /dev/null +++ b/enzyme/enzyme-1.2.0.d.ts @@ -0,0 +1,473 @@ +// Type definitions for Enzyme v1.2.0 +// Project: https://github.com/airbnb/enzyme +// Definitions by: Marian Palkus , Cap3 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module "enzyme" { + + import {ReactElement, Component, StatelessComponent, ComponentClass, HTMLAttributes} from "react"; + + export class ElementClass extends Component { + } + + /** + * Many methods in Enzyme's API accept a selector as an argument. Selectors in Enzyme can fall into one of the + * following three categories: + * + * 1. A Valid CSS Selector + * 2. A React Component Constructor + * 3. A React Component's displayName + */ + export type EnzymeSelector = String | typeof ElementClass; + + interface CommonWrapper { + /** + * Find every node in the render tree that matches the provided selector. + * @param selector The selector to match. + */ + find(component: ComponentClass): CommonWrapper; + find(statelessComponent: StatelessComponent): CommonWrapper; + find(selector: string): CommonWrapper; + + /** + * Finds every node in the render tree that returns true for the provided predicate function. + * @param predicate + */ + findWhere(predicate: (wrapper: CommonWrapper) => Boolean): CommonWrapper; + + /** + * Removes nodes in the current wrapper that do not match the provided selector. + * @param selector The selector to match. + */ + filter(component: ComponentClass): CommonWrapper; + filter(statelessComponent: StatelessComponent): CommonWrapper; + filter(selector: string): CommonWrapper; + + /** + * Returns a new wrapper with only the nodes of the current wrapper that, when passed into the provided predicate function, return true. + * @param predicate + */ + filterWhere(predicate: (wrapper: this) => Boolean): this; + + /** + * Returns whether or not the current wrapper has a node anywhere in it's render tree that looks like the one passed in. + * @param node + */ + contains(node: ReactElement): Boolean; + + /** + * Returns whether or not the current node has a className prop including the passed in class name. + * @param className + */ + hasClass(className: String): Boolean; + + /** + * Returns whether or not the current node matches a provided selector. + * @param selector + */ + is(selector: EnzymeSelector): Boolean; + + /** + * Returns a new wrapper with only the nodes of the current wrapper that don't match the provided selector. + * This method is effectively the negation or inverse of filter. + * @param selector + */ + not(selector: EnzymeSelector): this; + + /** + * Returns a new wrapper with all of the children of the node(s) in the current wrapper. Optionally, a selector + * can be provided and it will filter the children by this selector. + * @param [selector] + */ + children(component: ComponentClass): CommonWrapper; + children(statelessComponent: StatelessComponent): CommonWrapper; + children(selector: string): CommonWrapper; + children(): CommonWrapper; + + /** + * Returns a wrapper around all of the parents/ancestors of the wrapper. Does not include the node in the + * current wrapper. Optionally, a selector can be provided and it will filter the parents by this selector. + * + * Note: can only be called on a wrapper of a single node. + * @param [selector] + */ + parents(component: ComponentClass): CommonWrapper; + parents(statelessComponent: StatelessComponent): CommonWrapper; + parents(selector: string): CommonWrapper; + parents(): CommonWrapper; + + /** + * Returns a wrapper with the direct parent of the node in the current wrapper. + */ + parent(): CommonWrapper; + + /** + * Returns a wrapper of the first element that matches the selector by traversing up through the current node's + * ancestors in the tree, starting with itself. + * + * Note: can only be called on a wrapper of a single node. + * @param selector + */ + closest(component: ComponentClass): CommonWrapper; + closest(statelessComponent: StatelessComponent): CommonWrapper; + closest(selector: string): CommonWrapper; + + /** + * Returns a string of the rendered text of the current render tree. This function should be looked at with + * skepticism if being used to test what the actual HTML output of the component will be. If that is what you + * would like to test, use enzyme's render function instead. + * + * Note: can only be called on a wrapper of a single node. + */ + text(): String; + + /** + * Returns a string of the rendered HTML markup of the current render tree. + * + * Note: can only be called on a wrapper of a single node. + */ + html(): String; + + /** + * Returns the node at a given index of the current wrapper. + * @param index + */ + get(index: number): ReactElement; + + /** + * Returns a wrapper around the node at a given index of the current wrapper. + * @param index + */ + at(index: number): this; + + /** + * Reduce the set of matched nodes to the first in the set. + */ + first(): this; + + /** + * Reduce the set of matched nodes to the last in the set. + */ + last(): this; + + /** + * Returns the state hash for the root node of the wrapper. Optionally pass in a prop name and it will return just that value. + * @param [key] + */ + state(key?: String): any; + + /** + * Returns the props hash for the current node of the wrapper. + * + * NOTE: can only be called on a wrapper of a single node. + */ + props(): P; + + /** + * Returns the prop value for the node of the current wrapper with the provided key. + * + * NOTE: can only be called on a wrapper of a single node. + * @param key + */ + prop(key: String): any; + + /** + * Simulate events. + * Returns itself. + * @param event + * @param args? + */ + simulate(event: string, ...args: any[]): this; + + /** + * A method to invoke setState() on the root component instance similar to how you might in the definition of + * the component, and re-renders. This method is useful for testing your component in hard to achieve states, + * however should be used sparingly. If possible, you should utilize your component's external API in order to + * get it into whatever state you want to test, in order to be as accurate of a test as possible. This is not + * always practical, however. + * Returns itself. + * + * NOTE: can only be called on a wrapper instance that is also the root instance. + * @param state + */ + setState(state: S): this; + + /** + * A method that sets the props of the root component, and re-renders. Useful for when you are wanting to test + * how the component behaves over time with changing props. Calling this, for instance, will call the + * componentWillReceiveProps lifecycle method. + * + * Similar to setState, this method accepts a props object and will merge it in with the already existing props. + * Returns itself. + * + * NOTE: can only be called on a wrapper instance that is also the root instance. + * @param state + */ + setProps(props: P): this; + + /** + * A method that sets the context of the root component, and re-renders. Useful for when you are wanting to + * test how the component behaves over time with changing contexts. + * Returns itself. + * + * NOTE: can only be called on a wrapper instance that is also the root instance. + * @param state + */ + setContext(context: Object): this; + + /** + * Gets the instance of the component being rendered as the root node passed into shallow(). + * + * NOTE: can only be called on a wrapper instance that is also the root instance. + */ + instance(): Component; + + /** + * Forces a re-render. Useful to run before checking the render output if something external may be updating + * the state of the component somewhere. + * Returns itself. + * + * NOTE: can only be called on a wrapper instance that is also the root instance. + */ + update(): this; + + /** + * Returns an html-like string of the wrapper for debugging purposes. Useful to print out to the console when + * tests are not passing when you expect them to. + */ + debug(): String; + + /** + * Returns the type of the current node of this wrapper. If it's a composite component, this will be the + * component constructor. If it's native DOM node, it will be a string of the tag name. + * + * Note: can only be called on a wrapper of a single node. + */ + type(): String | Function; + + /** + * Iterates through each node of the current wrapper and executes the provided function with a wrapper around + * the corresponding node passed in as the first argument. + * + * Returns itself. + * @param fn A callback to be run for every node in the collection. Should expect a ShallowWrapper as the first + * argument, and will be run with a context of the original instance. + */ + forEach(fn: (wrapper: this) => any): this; + + /** + * Maps the current array of nodes to another array. Each node is passed in as a ShallowWrapper to the map + * function. + * Returns an array of the returned values from the mapping function.. + * @param fn A mapping function to be run for every node in the collection, the results of which will be mapped + * to the returned array. Should expect a ShallowWrapper as the first argument, and will be run + * with a context of the original instance. + */ + map(fn: (wrapper: this) => V): V[]; + + /** + * Applies the provided reducing function to every node in the wrapper to reduce to a single value. Each node + * is passed in as a ShallowWrapper, and is processed from left to right. + * @param fn + * @param initialValue + */ + reduce(fn: (prevVal: R, wrapper: this, index: number) => R, initialValue?: R): R[]; + + /** + * Applies the provided reducing function to every node in the wrapper to reduce to a single value. + * Each node is passed in as a ShallowWrapper, and is processed from right to left. + * @param fn + * @param initialValue + */ + reduceRight(fn: (prevVal: R, wrapper: this, index: number) => R, initialValue?: R): R[]; + + /** + * Returns whether or not any of the nodes in the wrapper match the provided selector. + * @param selector + */ + some(selector: EnzymeSelector): Boolean; + + /** + * Returns whether or not any of the nodes in the wrapper pass the provided predicate function. + * @param fn + */ + someWhere(fn: (wrapper: this) => Boolean): Boolean; + + /** + * Returns whether or not all of the nodes in the wrapper match the provided selector. + * @param selector + */ + every(selector: EnzymeSelector): Boolean; + + /** + * Returns whether or not any of the nodes in the wrapper pass the provided predicate function. + * @param fn + */ + everyWhere(fn: (wrapper: this) => Boolean): Boolean; + + length: number; + } + + export interface ShallowWrapper extends CommonWrapper { + shallow(): ShallowWrapper; + render(): CheerioWrapper; + unmount(): ShallowWrapper; + + /** + * Find every node in the render tree that matches the provided selector. + * @param selector The selector to match. + */ + find(component: ComponentClass): ShallowWrapper; + find(statelessComponent: (props: P2) => JSX.Element): ShallowWrapper; + find(selector: string): ShallowWrapper; + + /** + * Removes nodes in the current wrapper that do not match the provided selector. + * @param selector The selector to match. + */ + filter(component: ComponentClass): ShallowWrapper; + filter(statelessComponent: StatelessComponent): ShallowWrapper; + filter(selector: string): ShallowWrapper; + + /** + * Finds every node in the render tree that returns true for the provided predicate function. + * @param predicate + */ + findWhere(predicate: (wrapper: CommonWrapper) => Boolean): ShallowWrapper; + + /** + * Returns a new wrapper with all of the children of the node(s) in the current wrapper. Optionally, a selector + * can be provided and it will filter the children by this selector. + * @param [selector] + */ + children(component: ComponentClass): ShallowWrapper; + children(statelessComponent: StatelessComponent): ShallowWrapper; + children(selector: string): ShallowWrapper; + children(): ShallowWrapper; + + /** + * Returns a wrapper around all of the parents/ancestors of the wrapper. Does not include the node in the + * current wrapper. Optionally, a selector can be provided and it will filter the parents by this selector. + * + * Note: can only be called on a wrapper of a single node. + * @param [selector] + */ + parents(component: ComponentClass): ShallowWrapper; + parents(statelessComponent: StatelessComponent): ShallowWrapper; + parents(selector: string): ShallowWrapper; + parents(): ShallowWrapper; + + /** + * Returns a wrapper of the first element that matches the selector by traversing up through the current node's + * ancestors in the tree, starting with itself. + * + * Note: can only be called on a wrapper of a single node. + * @param selector + */ + closest(component: ComponentClass): ShallowWrapper; + closest(statelessComponent: StatelessComponent): ShallowWrapper; + closest(selector: string): ShallowWrapper; + + /** + * Returns a wrapper with the direct parent of the node in the current wrapper. + */ + parent(): ShallowWrapper; + } + + export interface ReactWrapper extends CommonWrapper { + unmount(): ReactWrapper; + mount(): ReactWrapper; + + /** + * Find every node in the render tree that matches the provided selector. + * @param selector The selector to match. + */ + find(component: ComponentClass): ReactWrapper; + find(statelessComponent: (props: P2) => JSX.Element): ReactWrapper; + find(selector: string): ReactWrapper; + + /** + * Finds every node in the render tree that returns true for the provided predicate function. + * @param predicate + */ + findWhere(predicate: (wrapper: CommonWrapper) => Boolean): ReactWrapper; + + /** + * Removes nodes in the current wrapper that do not match the provided selector. + * @param selector The selector to match. + */ + filter(component: ComponentClass): ReactWrapper; + filter(statelessComponent: StatelessComponent): ReactWrapper; + filter(selector: string): ReactWrapper; + + /** + * Returns a new wrapper with all of the children of the node(s) in the current wrapper. Optionally, a selector + * can be provided and it will filter the children by this selector. + * @param [selector] + */ + children(component: ComponentClass): ReactWrapper; + children(statelessComponent: StatelessComponent): ReactWrapper; + children(selector: string): ReactWrapper; + children(): ReactWrapper; + + /** + * Returns a wrapper around all of the parents/ancestors of the wrapper. Does not include the node in the + * current wrapper. Optionally, a selector can be provided and it will filter the parents by this selector. + * + * Note: can only be called on a wrapper of a single node. + * @param [selector] + */ + parents(component: ComponentClass): ReactWrapper; + parents(statelessComponent: StatelessComponent): ReactWrapper; + parents(selector: string): ReactWrapper; + parents(): ReactWrapper; + + /** + * Returns a wrapper of the first element that matches the selector by traversing up through the current node's + * ancestors in the tree, starting with itself. + * + * Note: can only be called on a wrapper of a single node. + * @param selector + */ + closest(component: ComponentClass): ReactWrapper; + closest(statelessComponent: StatelessComponent): ReactWrapper; + closest(selector: string): ReactWrapper; + + /** + * Returns a wrapper with the direct parent of the node in the current wrapper. + */ + parent(): ReactWrapper; + } + + export interface CheerioWrapper extends CommonWrapper { + + } + + /** + * Shallow rendering is useful to constrain yourself to testing a component as a unit, and to ensure that + * your tests aren't indirectly asserting on behavior of child components. + * @param node + * @param [options] + */ + export function shallow(node: ReactElement

      , options?: any): ShallowWrapper; + + /** + * Mounts and renders a react component into the document and provides a testing wrapper around it. + * @param node + * @param [options] + */ + export function mount(node: ReactElement

      , options?: any): ReactWrapper; + + /** + * Render react components to static HTML and analyze the resulting HTML structure. + * @param node + * @param [options] + */ + export function render(node: ReactElement

      , options?: any): CheerioWrapper; + + export function describeWithDOM(description: String, fn: Function): void; + + export function spyLifecycle(component: typeof Component): void; +} \ No newline at end of file diff --git a/enzyme/enzyme-tests.tsx b/enzyme/enzyme-tests.tsx index 56767b4ab3..67dccafeaf 100644 --- a/enzyme/enzyme-tests.tsx +++ b/enzyme/enzyme-tests.tsx @@ -44,11 +44,21 @@ namespace ShallowWrapperTest { stringVal: String, elementWrapper: ShallowWrapper + function test_shallow_options() { + shallow(, { + context: { + test: "a", + }, + lifecycleExperimental: true + }); + } + function test_find() { elementWrapper = shallowWrapper.find('.selector'); shallowWrapper = shallowWrapper.find(MyComponent); shallowWrapper.find(MyStatelessComponent).props().stateless; shallowWrapper.find(MyStatelessComponent).shallow(); + shallowWrapper.find({ prop: 'value' }); } function test_findWhere() { @@ -59,6 +69,7 @@ namespace ShallowWrapperTest { function test_filter() { elementWrapper = shallowWrapper.filter('.selector'); shallowWrapper = shallowWrapper.filter(MyComponent).shallow(); + shallowWrapper.filter({ prop: 'val' }); } function test_filterWhere() { @@ -73,6 +84,26 @@ namespace ShallowWrapperTest { boolVal = shallowWrapper.contains(

      ); } + function test_containsMatchingElement() { + boolVal = shallowWrapper.contains(
      ); + } + + function test_containsAllMatchingElements() { + boolVal = shallowWrapper.containsAllMatchingElements([
      ]); + } + + function test_containsAnyMatchingElement() { + boolVal = shallowWrapper.containsAnyMatchingElements([
      ]); + } + + function test_equals() { + boolVal = shallowWrapper.equals(
      ); + } + + function test_matchesElement() { + boolVal = shallowWrapper.matchesElement(
      ); + } + function test_hasClass() { boolVal = shallowWrapper.find('.my-button').hasClass('disabled'); } @@ -88,6 +119,21 @@ namespace ShallowWrapperTest { function test_children() { shallowWrapper = shallowWrapper.children(); shallowWrapper.children(MyStatelessComponent).props().stateless; + shallowWrapper.children({ prop: 'myprop' }); + } + + function test_childAt() { + const childWrapper: ShallowWrapper = shallowWrapper.childAt(0); + + interface TmpType1 { + foo: any + } + + interface TmpType2 { + bar: any + } + + const childWrapper2: ShallowWrapper = shallowWrapper.childAt(0); } function test_parents() { @@ -101,12 +147,17 @@ namespace ShallowWrapperTest { function test_closest() { elementWrapper = shallowWrapper.closest('.selector'); shallowWrapper = shallowWrapper.closest(MyComponent); + shallowWrapper = shallowWrapper.closest({ prop: 'myprop' }); } function test_shallow() { shallowWrapper = shallowWrapper.shallow(); } + function test_unmount() { + shallowWrapper = shallowWrapper.unmount(); + } + function test_render() { var cheerioWrapper: CheerioWrapper = shallowWrapper.render(); } @@ -139,6 +190,13 @@ namespace ShallowWrapperTest { function test_state() { shallowWrapper.state(); shallowWrapper.state('key'); + const tmp: String = shallowWrapper.state('key'); + } + + function test_context() { + shallowWrapper.context(); + shallowWrapper.context('key'); + const tmp: String = shallowWrapper.context('key'); } function test_props() { @@ -147,8 +205,12 @@ namespace ShallowWrapperTest { function test_prop() { shallowWrapper.prop('key'); + const tmp: String = shallowWrapper.prop('key'); } + function test_key() { + stringVal = shallowWrapper.key(); + } function test_simulate(...args: any[]) { shallowWrapper.simulate('click'); @@ -156,15 +218,15 @@ namespace ShallowWrapperTest { } function test_setState() { - shallowWrapper = shallowWrapper.setState({stateProperty: 'state'}); + shallowWrapper = shallowWrapper.setState({ stateProperty: 'state' }); } function test_setProps() { - shallowWrapper = shallowWrapper.setProps({propsProperty: 'foo'}); + shallowWrapper = shallowWrapper.setProps({ propsProperty: 'foo' }); } function test_setContext() { - shallowWrapper = shallowWrapper.setContext({name: 'baz'}); + shallowWrapper = shallowWrapper.setContext({ name: 'baz' }); } function test_instance() { @@ -180,7 +242,11 @@ namespace ShallowWrapperTest { } function test_type() { - var stringOrFunction: String|Function = shallowWrapper.type(); + var stringOrFunction: String | Function = shallowWrapper.type(); + } + + function test_name() { + var str: String = shallowWrapper.name(); } function test_forEach() { @@ -224,6 +290,10 @@ namespace ShallowWrapperTest { function test_everyWhere() { boolVal = shallowWrapper.everyWhere((aShallowWrapper: ShallowWrapper) => true); } + + function test_isEmptyRender() { + boolVal = shallowWrapper.isEmptyRender(); + } } @@ -238,10 +308,44 @@ namespace ReactWrapperTest { stringVal: String, elementWrapper: ReactWrapper + function test_unmount() { + reactWrapper = reactWrapper.unmount(); + } + + function test_mount() { + reactWrapper = reactWrapper.mount(); + + mount(, { + attachTo: document.getElementById('test'), + context: { + a: "b" + } + }); + } + + function test_ref() { + reactWrapper = reactWrapper.ref('refName'); + + interface TmpType1 { + foo: string + } + + interface TmpType2 { + bar: string + } + + const tmp: ReactWrapper = reactWrapper.ref('refName'); + } + + function test_detach() { + reactWrapper.detach(); + } + function test_find() { elementWrapper = reactWrapper.find('.selector'); reactWrapper = reactWrapper.find(MyComponent); reactWrapper.find(MyStatelessComponent).props().stateless; + reactWrapper.find({ prop: 'myprop' }); } function test_findWhere() { @@ -252,6 +356,7 @@ namespace ReactWrapperTest { function test_filter() { elementWrapper = reactWrapper.filter('.selector'); reactWrapper = reactWrapper.filter(MyComponent); + reactWrapper = reactWrapper.filter({ prop: 'myprop' }); } function test_filterWhere() { @@ -266,6 +371,26 @@ namespace ReactWrapperTest { boolVal = reactWrapper.contains(
      ); } + function test_containsMatchingElement() { + boolVal = reactWrapper.contains(
      ); + } + + function test_containsAllMatchingElements() { + boolVal = reactWrapper.containsAllMatchingElements([
      ]); + } + + function test_containsAnyMatchingElement() { + boolVal = reactWrapper.containsAnyMatchingElements([
      ]); + } + + function test_equals() { + boolVal = reactWrapper.equals(
      ); + } + + function test_matchesElement() { + boolVal = reactWrapper.matchesElement(
      ); + } + function test_hasClass() { boolVal = reactWrapper.find('.my-button').hasClass('disabled'); } @@ -282,6 +407,20 @@ namespace ReactWrapperTest { reactWrapper = reactWrapper.children(); } + function test_childAt() { + const childWrapper: ReactWrapper = reactWrapper.childAt(0); + + interface TmpType1 { + foo: any + } + + interface TmpType2 { + bar: any + } + + const childWrapper2: ReactWrapper = reactWrapper.childAt(0); + } + function test_parents() { reactWrapper = reactWrapper.parents(); } @@ -293,6 +432,7 @@ namespace ReactWrapperTest { function test_closest() { elementWrapper = reactWrapper.closest('.selector'); reactWrapper = reactWrapper.closest(MyComponent); + reactWrapper = reactWrapper.closest({ prop: 'myprop' }); } function test_text() { @@ -322,6 +462,13 @@ namespace ReactWrapperTest { function test_state() { reactWrapper.state(); reactWrapper.state('key'); + const tmp: String = reactWrapper.state('key'); + } + + function test_context() { + reactWrapper.context(); + reactWrapper.context('key'); + const tmp: String = reactWrapper.context('key'); } function test_props() { @@ -330,8 +477,12 @@ namespace ReactWrapperTest { function test_prop() { reactWrapper.prop('key'); + const tmp: String = reactWrapper.prop('key'); } + function test_key() { + stringVal = reactWrapper.key(); + } function test_simulate(...args: any[]) { reactWrapper.simulate('click'); @@ -339,15 +490,15 @@ namespace ReactWrapperTest { } function test_setState() { - reactWrapper = reactWrapper.setState({stateProperty: 'state'}); + reactWrapper = reactWrapper.setState({ stateProperty: 'state' }); } function test_setProps() { - reactWrapper = reactWrapper.setProps({propsProperty: 'foo'}); + reactWrapper = reactWrapper.setProps({ propsProperty: 'foo' }); } function test_setContext() { - reactWrapper = reactWrapper.setContext({name: 'baz'}); + reactWrapper = reactWrapper.setContext({ name: 'baz' }); } function test_instance() { @@ -363,7 +514,11 @@ namespace ReactWrapperTest { } function test_type() { - var stringOrFunction: String|Function = reactWrapper.type(); + var stringOrFunction: String | Function = reactWrapper.type(); + } + + function test_name() { + var str: String = reactWrapper.name(); } function test_forEach() { @@ -407,6 +562,9 @@ namespace ReactWrapperTest { function test_everyWhere() { boolVal = reactWrapper.everyWhere((aReactWrapper: ReactWrapper) => true); } + function test_isEmptyRender() { + boolVal = reactWrapper.isEmptyRender(); + } } // CheerioWrapper @@ -418,12 +576,13 @@ namespace CheerioWrapperTest { objectVal: Object, boolVal: Boolean, stringVal: String, - elementWrapper: ReactWrapper + elementWrapper: CheerioWrapper function test_find() { elementWrapper = cheerioWrapper.find('.selector'); cheerioWrapper = cheerioWrapper.find(MyComponent); cheerioWrapper.find(MyStatelessComponent).props().stateless; + cheerioWrapper.find({ prop: 'myprop' }); } function test_findWhere() { @@ -434,6 +593,7 @@ namespace CheerioWrapperTest { function test_filter() { elementWrapper = cheerioWrapper.filter('.selector'); cheerioWrapper = cheerioWrapper.filter(MyComponent); + cheerioWrapper = cheerioWrapper.filter({ prop: 'myprop' }); } function test_filterWhere() { @@ -448,6 +608,26 @@ namespace CheerioWrapperTest { boolVal = cheerioWrapper.contains(
      ); } + function test_containsMatchingElement() { + boolVal = cheerioWrapper.contains(
      ); + } + + function test_containsAllMatchingElements() { + boolVal = cheerioWrapper.containsAllMatchingElements([
      ]); + } + + function test_containsAnyMatchingElement() { + boolVal = cheerioWrapper.containsAnyMatchingElements([
      ]); + } + + function test_equals() { + boolVal = cheerioWrapper.equals(
      ); + } + + function test_matchesElement() { + boolVal = cheerioWrapper.matchesElement(
      ); + } + function test_hasClass() { boolVal = cheerioWrapper.find('.my-button').hasClass('disabled'); } @@ -464,6 +644,20 @@ namespace CheerioWrapperTest { cheerioWrapper = cheerioWrapper.children(); } + function test_childAt() { + const childWrapper: CheerioWrapper = cheerioWrapper.childAt(0); + + interface TmpType1 { + foo: any + } + + interface TmpType2 { + bar: any + } + + const childWrapper2: CheerioWrapper = cheerioWrapper.childAt(0); + } + function test_parents() { cheerioWrapper = cheerioWrapper.parents(); } @@ -475,6 +669,7 @@ namespace CheerioWrapperTest { function test_closest() { elementWrapper = cheerioWrapper.closest('.selector'); cheerioWrapper = cheerioWrapper.closest(MyComponent); + cheerioWrapper = cheerioWrapper.closest({ prop: 'myprop' }); } function test_text() { @@ -504,6 +699,13 @@ namespace CheerioWrapperTest { function test_state() { cheerioWrapper.state(); cheerioWrapper.state('key'); + const tmp: String = cheerioWrapper.state('key'); + } + + function test_context() { + cheerioWrapper.context(); + cheerioWrapper.context('key'); + const tmp: String = cheerioWrapper.context('key'); } function test_props() { @@ -512,8 +714,12 @@ namespace CheerioWrapperTest { function test_prop() { cheerioWrapper.prop('key'); + const tmp: String = cheerioWrapper.prop('key'); } + function test_key() { + stringVal = cheerioWrapper.key(); + } function test_simulate(...args: any[]) { cheerioWrapper.simulate('click'); @@ -521,15 +727,15 @@ namespace CheerioWrapperTest { } function test_setState() { - cheerioWrapper = cheerioWrapper.setState({stateProperty: 'state'}); + cheerioWrapper = cheerioWrapper.setState({ stateProperty: 'state' }); } function test_setProps() { - cheerioWrapper = cheerioWrapper.setProps({propsProperty: 'foo'}); + cheerioWrapper = cheerioWrapper.setProps({ propsProperty: 'foo' }); } function test_setContext() { - cheerioWrapper = cheerioWrapper.setContext({name: 'baz'}); + cheerioWrapper = cheerioWrapper.setContext({ name: 'baz' }); } function test_instance() { @@ -545,12 +751,16 @@ namespace CheerioWrapperTest { } function test_type() { - var stringOrFunction: String|Function = cheerioWrapper.type(); + var stringOrFunction: String | Function = cheerioWrapper.type(); + } + + function test_name() { + var str: String = cheerioWrapper.name(); } function test_forEach() { cheerioWrapper = - cheerioWrapper.forEach((aCheerioWrapper: CheerioWrapper)=> { + cheerioWrapper.forEach((aCheerioWrapper: CheerioWrapper) => { }); } diff --git a/enzyme/enzyme.d.ts b/enzyme/enzyme.d.ts index 9047fbf728..4a5bf2beac 100644 --- a/enzyme/enzyme.d.ts +++ b/enzyme/enzyme.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Enzyme v1.2.0 +// Type definitions for Enzyme v2.4.1 // Project: https://github.com/airbnb/enzyme // Definitions by: Marian Palkus , Cap3 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -19,8 +19,11 @@ declare module "enzyme" { * 1. A Valid CSS Selector * 2. A React Component Constructor * 3. A React Component's displayName + * 4. A React Stateless component + * 5. A React component property map */ - export type EnzymeSelector = String | typeof ElementClass; + export type EnzymeSelector = string | StatelessComponent | ComponentClass | {[key: string]: any}; + export type EnzymePropSelector = { [key: string]: any }; interface CommonWrapper { /** @@ -29,13 +32,14 @@ declare module "enzyme" { */ find(component: ComponentClass): CommonWrapper; find(statelessComponent: StatelessComponent): CommonWrapper; + find(props: EnzymePropSelector): CommonWrapper; find(selector: string): CommonWrapper; /** * Finds every node in the render tree that returns true for the provided predicate function. * @param predicate */ - findWhere(predicate: (wrapper: CommonWrapper) => Boolean): CommonWrapper; + findWhere(predicate: (wrapper: CommonWrapper) => boolean): CommonWrapper; /** * Removes nodes in the current wrapper that do not match the provided selector. @@ -43,31 +47,60 @@ declare module "enzyme" { */ filter(component: ComponentClass): CommonWrapper; filter(statelessComponent: StatelessComponent): CommonWrapper; + filter(props: EnzymePropSelector): CommonWrapper; filter(selector: string): CommonWrapper; /** * Returns a new wrapper with only the nodes of the current wrapper that, when passed into the provided predicate function, return true. * @param predicate */ - filterWhere(predicate: (wrapper: this) => Boolean): this; + filterWhere(predicate: (wrapper: this) => boolean): this; /** * Returns whether or not the current wrapper has a node anywhere in it's render tree that looks like the one passed in. * @param node */ - contains(node: ReactElement): Boolean; + contains(node: ReactElement): boolean; + + /** + * Returns whether or not a given react element exists in the shallow render tree. + * @param node + */ + containsMatchingElement(node: ReactElement): boolean; + + /** + * Returns whether or not all the given react elements exists in the shallow render tree + * @param nodes + */ + containsAllMatchingElements(nodes: ReactElement[]): boolean; + + /** + * Returns whether or not one of the given react elements exists in the shallow render tree. + * @param nodes + */ + containsAnyMatchingElements(nodes: ReactElement[]): boolean; + + /** + * Returns whether or not the current render tree is equal to the given node, based on the expected value. + */ + equals(node: ReactElement): boolean; + + /** + * Returns whether or not a given react element matches the shallow render tree. + */ + matchesElement(node: ReactElement): boolean; /** * Returns whether or not the current node has a className prop including the passed in class name. * @param className */ - hasClass(className: String): Boolean; + hasClass(className: string): boolean; /** * Returns whether or not the current node matches a provided selector. * @param selector */ - is(selector: EnzymeSelector): Boolean; + is(selector: EnzymeSelector): boolean; /** * Returns a new wrapper with only the nodes of the current wrapper that don't match the provided selector. @@ -83,9 +116,17 @@ declare module "enzyme" { */ children(component: ComponentClass): CommonWrapper; children(statelessComponent: StatelessComponent): CommonWrapper; + children(props: EnzymePropSelector): CommonWrapper; children(selector: string): CommonWrapper; children(): CommonWrapper; + /** + * Returns a new wrapper with child at the specified index. + * @param index + */ + childAt(index: number): CommonWrapper; + childAt(index: number): CommonWrapper; + /** * Returns a wrapper around all of the parents/ancestors of the wrapper. Does not include the node in the * current wrapper. Optionally, a selector can be provided and it will filter the parents by this selector. @@ -95,6 +136,7 @@ declare module "enzyme" { */ parents(component: ComponentClass): CommonWrapper; parents(statelessComponent: StatelessComponent): CommonWrapper; + parents(props: EnzymePropSelector): CommonWrapper; parents(selector: string): CommonWrapper; parents(): CommonWrapper; @@ -112,6 +154,7 @@ declare module "enzyme" { */ closest(component: ComponentClass): CommonWrapper; closest(statelessComponent: StatelessComponent): CommonWrapper; + closest(props: EnzymePropSelector): CommonWrapper; closest(selector: string): CommonWrapper; /** @@ -121,14 +164,14 @@ declare module "enzyme" { * * Note: can only be called on a wrapper of a single node. */ - text(): String; + text(): string; /** * Returns a string of the rendered HTML markup of the current render tree. * * Note: can only be called on a wrapper of a single node. */ - html(): String; + html(): string; /** * Returns the node at a given index of the current wrapper. @@ -156,7 +199,14 @@ declare module "enzyme" { * Returns the state hash for the root node of the wrapper. Optionally pass in a prop name and it will return just that value. * @param [key] */ - state(key?: String): any; + state(key?: string): any; + state(key?: string): T; + + /** + * Returns the context hash for the root node of the wrapper. Optionally pass in a prop name and it will return just that value. + */ + context(key?: string): any; + context(key?: string): T; /** * Returns the props hash for the current node of the wrapper. @@ -171,7 +221,14 @@ declare module "enzyme" { * NOTE: can only be called on a wrapper of a single node. * @param key */ - prop(key: String): any; + prop(key: string): any; + prop(key: string): T; + + /** + * Returns the key value for the node of the current wrapper. + * NOTE: can only be called on a wrapper of a single node. + */ + key(): string; /** * Simulate events. @@ -237,7 +294,7 @@ declare module "enzyme" { * Returns an html-like string of the wrapper for debugging purposes. Useful to print out to the console when * tests are not passing when you expect them to. */ - debug(): String; + debug(): string; /** * Returns the type of the current node of this wrapper. If it's a composite component, this will be the @@ -245,7 +302,12 @@ declare module "enzyme" { * * Note: can only be called on a wrapper of a single node. */ - type(): String | Function; + type(): string | Function; + + /** + * Returns the name of the current node of the wrapper. + */ + name(): string; /** * Iterates through each node of the current wrapper and executes the provided function with a wrapper around @@ -287,25 +349,25 @@ declare module "enzyme" { * Returns whether or not any of the nodes in the wrapper match the provided selector. * @param selector */ - some(selector: EnzymeSelector): Boolean; + some(selector: EnzymeSelector): boolean; /** * Returns whether or not any of the nodes in the wrapper pass the provided predicate function. * @param fn */ - someWhere(fn: (wrapper: this) => Boolean): Boolean; + someWhere(fn: (wrapper: this) => boolean): boolean; /** * Returns whether or not all of the nodes in the wrapper match the provided selector. * @param selector */ - every(selector: EnzymeSelector): Boolean; + every(selector: EnzymeSelector): boolean; /** * Returns whether or not any of the nodes in the wrapper pass the provided predicate function. * @param fn */ - everyWhere(fn: (wrapper: this) => Boolean): Boolean; + everyWhere(fn: (wrapper: this) => boolean): boolean; length: number; } @@ -313,6 +375,7 @@ declare module "enzyme" { export interface ShallowWrapper extends CommonWrapper { shallow(): ShallowWrapper; render(): CheerioWrapper; + unmount(): ShallowWrapper; /** * Find every node in the render tree that matches the provided selector. @@ -320,6 +383,7 @@ declare module "enzyme" { */ find(component: ComponentClass): ShallowWrapper; find(statelessComponent: (props: P2) => JSX.Element): ShallowWrapper; + find(props: EnzymePropSelector): ShallowWrapper; find(selector: string): ShallowWrapper; /** @@ -328,13 +392,14 @@ declare module "enzyme" { */ filter(component: ComponentClass): ShallowWrapper; filter(statelessComponent: StatelessComponent): ShallowWrapper; + filter(props: EnzymePropSelector): ShallowWrapper; filter(selector: string): ShallowWrapper; /** * Finds every node in the render tree that returns true for the provided predicate function. * @param predicate */ - findWhere(predicate: (wrapper: CommonWrapper) => Boolean): ShallowWrapper; + findWhere(predicate: (wrapper: CommonWrapper) => boolean): ShallowWrapper; /** * Returns a new wrapper with all of the children of the node(s) in the current wrapper. Optionally, a selector @@ -343,9 +408,17 @@ declare module "enzyme" { */ children(component: ComponentClass): ShallowWrapper; children(statelessComponent: StatelessComponent): ShallowWrapper; + children(props: EnzymePropSelector): ShallowWrapper; children(selector: string): ShallowWrapper; children(): ShallowWrapper; + /** + * Returns a new wrapper with child at the specified index. + * @param index + */ + childAt(index: number): ShallowWrapper; + childAt(index: number): ShallowWrapper; + /** * Returns a wrapper around all of the parents/ancestors of the wrapper. Does not include the node in the * current wrapper. Optionally, a selector can be provided and it will filter the parents by this selector. @@ -355,6 +428,7 @@ declare module "enzyme" { */ parents(component: ComponentClass): ShallowWrapper; parents(statelessComponent: StatelessComponent): ShallowWrapper; + parents(props: EnzymePropSelector): ShallowWrapper; parents(selector: string): ShallowWrapper; parents(): ShallowWrapper; @@ -367,36 +441,165 @@ declare module "enzyme" { */ closest(component: ComponentClass): ShallowWrapper; closest(statelessComponent: StatelessComponent): ShallowWrapper; + closest(props: EnzymePropSelector): ShallowWrapper; closest(selector: string): ShallowWrapper; /** * Returns a wrapper with the direct parent of the node in the current wrapper. */ parent(): ShallowWrapper; + + /** + * Returns true if renderer returned null + */ + isEmptyRender(): boolean; } export interface ReactWrapper extends CommonWrapper { + unmount(): ReactWrapper; + mount(): ReactWrapper; + /** + * Returns a wrapper of the node that matches the provided reference name. + * + * NOTE: can only be called on a wrapper instance that is also the root instance. + */ + ref(refName: string): ReactWrapper; + ref(refName: string): ReactWrapper; + + /** + * Detaches the react tree from the DOM. Runs ReactDOM.unmountComponentAtNode() under the hood. + * + * This method will most commonly be used as a "cleanup" method if you decide to use the attachTo option in mount(node, options). + * + * The method is intentionally not "fluent" (in that it doesn't return this) because you should not be doing anything with this wrapper after this method is called. + * + * Using the attachTo is not generally recommended unless it is absolutely necessary to test something. It is your responsibility to clean up after yourself at the end of the test if you do decide to use it, though. + */ + detach() : void; + + /** + * Find every node in the render tree that matches the provided selector. + * @param selector The selector to match. + */ + find(component: ComponentClass): ReactWrapper; + find(statelessComponent: (props: P2) => JSX.Element): ReactWrapper; + find(props: EnzymePropSelector): ReactWrapper; + find(selector: string): ReactWrapper; + + /** + * Finds every node in the render tree that returns true for the provided predicate function. + * @param predicate + */ + findWhere(predicate: (wrapper: CommonWrapper) => boolean): ReactWrapper; + + /** + * Removes nodes in the current wrapper that do not match the provided selector. + * @param selector The selector to match. + */ + filter(component: ComponentClass): ReactWrapper; + filter(statelessComponent: StatelessComponent): ReactWrapper; + filter(props: EnzymePropSelector): ReactWrapper; + filter(selector: string): ReactWrapper; + + /** + * Returns a new wrapper with all of the children of the node(s) in the current wrapper. Optionally, a selector + * can be provided and it will filter the children by this selector. + * @param [selector] + */ + children(component: ComponentClass): ReactWrapper; + children(statelessComponent: StatelessComponent): ReactWrapper; + children(props: EnzymePropSelector): ReactWrapper; + children(selector: string): ReactWrapper; + children(): ReactWrapper; + + /** + * Returns a new wrapper with child at the specified index. + * @param index + */ + childAt(index: number): ReactWrapper; + childAt(index: number): ReactWrapper; + + /** + * Returns a wrapper around all of the parents/ancestors of the wrapper. Does not include the node in the + * current wrapper. Optionally, a selector can be provided and it will filter the parents by this selector. + * + * Note: can only be called on a wrapper of a single node. + * @param [selector] + */ + parents(component: ComponentClass): ReactWrapper; + parents(statelessComponent: StatelessComponent): ReactWrapper; + parents(props: EnzymePropSelector): ReactWrapper; + parents(selector: string): ReactWrapper; + parents(): ReactWrapper; + + /** + * Returns a wrapper of the first element that matches the selector by traversing up through the current node's + * ancestors in the tree, starting with itself. + * + * Note: can only be called on a wrapper of a single node. + * @param selector + */ + closest(component: ComponentClass): ReactWrapper; + closest(statelessComponent: StatelessComponent): ReactWrapper; + closest(props: EnzymePropSelector): ReactWrapper; + closest(selector: string): ReactWrapper; + + /** + * Returns a wrapper with the direct parent of the node in the current wrapper. + */ + parent(): ReactWrapper; + + /** + * Returns true if renderer returned null + */ + isEmptyRender(): boolean; } export interface CheerioWrapper extends CommonWrapper { } + export interface ShallowRendererProps { + /** + * Enable experimental support for full react lifecycle methods + */ + lifecycleExperimental?: boolean; + /** + * Context to be passed into the component + */ + context?: {}; + } + + export interface MountRendererProps { + /** + * Context to be passed into the component + */ + context?: {}; + /** + * DOM Element to attach the component to + */ + attachTo?: HTMLElement; + /** + * Merged contextTypes for all children of the wrapper + */ + childContextTypes?: {}; + } + /** * Shallow rendering is useful to constrain yourself to testing a component as a unit, and to ensure that * your tests aren't indirectly asserting on behavior of child components. * @param node * @param [options] */ - export function shallow(node: ReactElement

      , options?: any): ShallowWrapper; + export function shallow(node: ReactElement

      , options?: ShallowRendererProps): ShallowWrapper; /** * Mounts and renders a react component into the document and provides a testing wrapper around it. * @param node * @param [options] */ - export function mount(node: ReactElement

      , options?: any): ReactWrapper; + export function mount(node: ReactElement

      , options?: MountRendererProps): ReactWrapper; /** * Render react components to static HTML and analyze the resulting HTML structure. @@ -405,7 +608,7 @@ declare module "enzyme" { */ export function render(node: ReactElement

      , options?: any): CheerioWrapper; - export function describeWithDOM(description: String, fn: Function): void; + export function describeWithDOM(description: string, fn: Function): void; export function spyLifecycle(component: typeof Component): void; -} \ No newline at end of file +} diff --git a/epub/epub-tests.ts b/epub/epub-tests.ts new file mode 100644 index 0000000000..6e61a26634 --- /dev/null +++ b/epub/epub-tests.ts @@ -0,0 +1,9 @@ +/// +import EPub = require("epub"); + +var epub = new EPub("./file.epub"); +epub.on("end", function(){ + epub.getChapter("chapter_id", function(err: Error, text: string) {}); +}); + +epub.parse(); diff --git a/epub/epub.d.ts b/epub/epub.d.ts new file mode 100644 index 0000000000..7c813e003d --- /dev/null +++ b/epub/epub.d.ts @@ -0,0 +1,66 @@ +// Type definitions for epub +// Project: https://github.com/julien-c/epub +// Definitions by: Julien Chaumond +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +/** + * new EPub(fname[, imageroot][, linkroot]) + * - fname (String): filename for the ebook + * - imageroot (String): URL prefix for images + * - linkroot (String): URL prefix for links + * + * Creates an Event Emitter type object for parsing epub files + * + * var epub = new EPub("book.epub"); + * epub.on("end", function () { + * console.log(epub.spine); + * }); + * epub.on("error", function (error) { ... }); + * epub.parse(); + * + * Image and link URL format is: + * + * imageroot + img_id + img_zip_path + * + * So an image "logo.jpg" which resides in "OPT/" in the zip archive + * and is listed in the manifest with id "logo_img" will have the + * following url (providing that imageroot is "/images/"): + * + * /images/logo_img/OPT/logo.jpg + **/ +declare module "epub" { + + import {EventEmitter} from "events"; + + interface TocElement { + level: number; + order: number; + title: string; + id: string; + href?: string; + } + + class EPub extends EventEmitter { + constructor(epubfile: string, imagewebroot?: string, chapterwebroot?: string); + + metadata: Object; + manifest: Object; + spine: Object; + flow: Array; + toc: Array; + + parse(): void; + + getChapter(chapterId: string, callback: (error: Error, text: string) => void): void; + + getChapterRaw(chapterId: string, callback: (error: Error, text: string) => void): void; + + getImage(id: string, callback: (error: Error, data: Buffer, mimeType: string) => void): void; + + getFile(id: string, callback: (error: Error, data: Buffer, mimeType: string) => void): void; + } + + export = EPub; +} diff --git a/es6-promise/es6-promise-commonjs-tests.ts b/es6-promise/es6-promise-commonjs-tests.ts index b5a2fcbe49..308a042ec6 100644 --- a/es6-promise/es6-promise-commonjs-tests.ts +++ b/es6-promise/es6-promise-commonjs-tests.ts @@ -1,6 +1,7 @@ /// import rsvp = require('es6-promise'); +rsvp.polyfill(); // Test for polyfill method existence var Promise = rsvp.Promise; var promiseString: Promise, diff --git a/es6-promise/es6-promise.d.ts b/es6-promise/es6-promise.d.ts index 001330fd24..4af46edfa6 100644 --- a/es6-promise/es6-promise.d.ts +++ b/es6-promise/es6-promise.d.ts @@ -6,7 +6,6 @@ interface Thenable { then(onFulfilled?: (value: T) => U | Thenable, onRejected?: (error: any) => U | Thenable): Thenable; then(onFulfilled?: (value: T) => U | Thenable, onRejected?: (error: any) => void): Thenable; - catch(onRejected?: (error: any) => U | Thenable): Thenable; } declare class Promise implements Thenable { @@ -79,6 +78,7 @@ declare module 'es6-promise' { var foo: typeof Promise; // Temp variable to reference Promise in local context namespace rsvp { export var Promise: typeof foo; + export function polyfill(): void; } export = rsvp; } diff --git a/es6-shim/es6-shim.d.ts b/es6-shim/es6-shim.d.ts index 1c3df0ed7f..b2cad2f4ce 100644 --- a/es6-shim/es6-shim.d.ts +++ b/es6-shim/es6-shim.d.ts @@ -582,6 +582,7 @@ interface Set { entries(): IterableIteratorShim<[T, T]>; keys(): IterableIteratorShim; values(): IterableIteratorShim; + '_es6-shim iterator_'(): IterableIteratorShim; } interface SetConstructor { diff --git a/escodegen/escodegen-tests.ts b/escodegen/escodegen-tests.ts new file mode 100644 index 0000000000..f6c18cf5cd --- /dev/null +++ b/escodegen/escodegen-tests.ts @@ -0,0 +1,56 @@ +/// + +import * as escodegen from 'escodegen'; + +let emptyIndentOptions: escodegen.IndentOptions = {}; +let indentOptions: escodegen.IndentOptions = { + style: ' ', + base: 0, + adjustMultilineComment: true +}; + +let emptyFormatOptions: escodegen.FormatOptions = {}; +let formatOptions: escodegen.FormatOptions = { + indent: indentOptions, + newline: '\n', + space: ' ', + json: true, + renumber: true, + hexadecimal: true, + quotes: 'single', + escapeless: true, + compact: true, + parentheses: true, + semicolons: true, + safeConcatenation: true, + preserveBlankLines: true + } + +let emptyMozillaOptions: escodegen.MozillaOptions = {}; +let mozillaOptions: escodegen.MozillaOptions = { + starlessGenerator: true, + parenthesizedComprehensionBlock: true, + comprehensionExpressionStartsWithAssignment: true +} + +let emptyGenerateOptions: escodegen.GenerateOptions = {}; +let generateOptions: escodegen.GenerateOptions = { + format: formatOptions, + moz: mozillaOptions, + parse: () => {}, + comment: true, + sourceMap: " ", + sourceMapWithCode: true, + sourceContent: " ", + sourceCode: " ", + sourceMapRoot: " ", + directive: true, + file: " ", + verbatim: " " +}; + +let precedence: escodegen.Precedence = escodegen.Precedence.Primary; + +let myCode: string = escodegen.generate({}, generateOptions); + +let ast: any = escodegen.attachComments({}, {}, {}); diff --git a/escodegen/escodegen.d.ts b/escodegen/escodegen.d.ts new file mode 100644 index 0000000000..b72cfdedc6 --- /dev/null +++ b/escodegen/escodegen.d.ts @@ -0,0 +1,178 @@ +// Type definitions for escodegen +// Project: https://github.com/estools/escodegen +// Definitions by: Simon de Lang +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module 'escodegen' { + + export interface FormatOptions { + /** + * The indent options + */ + indent?: IndentOptions; + /** + * New line string. Default is '\n'. + */ + newline?: string; + /** + * White space string. Default is standard ' ' (\x20). + */ + space?: string; + /** + * Enforce JSON format of numeric and string literals. This option takes precedence over option.format.hexadecimal and option.format.quotes. Default is false. + */ + json?: boolean; + /** + * Try to generate shorter numeric literals than toString() (9.8.1). Default is false. + */ + renumber?: boolean; + /** + * Generate hexadecimal a numeric literal if it is shorter than its equivalents. Requires option.format.renumber. Default is false. + */ + hexadecimal?: boolean; + /** + * Delimiter to use for string literals. Accepted values are: 'single', 'double', and 'auto'. When 'auto' is specified, escodegen selects a delimiter that results in a shorter literal. Default is 'single'. + */ + quotes?: string; + /** + * Escape as few characters in string literals as necessary. Default is false. + */ + escapeless?: boolean; + /** + * Do not include superfluous whitespace characters and line terminators. Default is false. + */ + compact?: boolean; + /** + * Preserve parentheses in new expressions that have no arguments. Default is true. + */ + parentheses?: boolean; + /** + * Preserve semicolons at the end of blocks and programs. Default is true. + */ + semicolons?: boolean; + safeConcatenation?: boolean; + preserveBlankLines?: boolean; + } + + export interface IndentOptions { + /** + * Indent string. Default is 4 spaces (' '). + */ + style?: string; + /** + * Base indent level. Default is 0. + */ + base?: number; + /** + * Adjust the indentation of multiline comments to keep asterisks vertically aligned. Default is false. + */ + adjustMultilineComment?: boolean; + } + + export interface MozillaOptions { + /** + * Default: false + */ + starlessGenerator?: boolean; + /** + * Default: false + */ + parenthesizedComprehensionBlock?: boolean; + /** + * Default: false + */ + comprehensionExpressionStartsWithAssignment?: boolean; + } + + export interface GenerateOptions { + /** + * The format options + */ + format?: FormatOptions; + moz?: MozillaOptions; + /** + * Mozilla Parser API compatible parse function, e.g., the parse function exported by esprima. If it is provided, generator tries to use the 'raw' representation. See esprima raw information. Default is null. + */ + parse?: Function; + /** + * If comments are attached to AST, escodegen is going to emit comments to output code. Default is false. + */ + comment?: boolean; + /** + * sourceMap is the source maps's source filename, that's a name that will show up in the browser debugger for the generated source (if source-maps is enabled). + * If a non-empty string value is provided, generate a source map. + */ + sourceMap?: string; + /** + * . If sourceMapWithCode is true generator returns output hash, where output.map is a source-map representation, which can be serialized as output.map.toString(). output.code is a string with generated JS code (note that it's not going to have //@ sourceMappingURL comment in it). + */ + sourceMapWithCode?: boolean; + /** + * Optionally option.sourceContent string can be passed (which represents original source of the file, for example it could be a source of coffeescript from which JS is being generated), if provided generated source map will have original source embedded in it. + */ + sourceContent?: string; + sourceCode?: string; + /** + * Optionally option.sourceMapRoot can be provided, in which case option.sourceMap will be treated as relative to it. For more information about source map itself, see source map library document, V3 draft and HTML5Rocks introduction. Default is undefined + * sourceMapRoot is the source root for the source map (see the Mozilla documentation). If sourceMapWithCode is truthy, an object is returned from generate() of the form: { code: .. , map: .. }. If file is provided, it will be used as file property of generated source map. + */ + sourceMapRoot?: string; + /** + * Recognize DirectiveStatement and distinguish it from ExpressionStatement. Default: false + */ + directive?: boolean; + /** + * If file is provided, it will be used as file property of generated source map. + */ + file?: string; + /** + * Providing verbatim code generation option to Expression nodes. + * verbatim option is provided by user as string. When generating Expression code, + * looking up node[option.verbatim] value and dump it instead of normal code generation. + * + * @example + * + */ + verbatim?: string; + } + + /** + * https://github.com/estools/escodegen/commit/adf113333cd4888cf59bfc4f957df98bf7db82b6 + */ + export enum Precedence { + Sequence, + Yield, + Await, + Assignment, + Conditional, + ArrowFunction, + LogicalOR, + LogicalAND, + BitwiseOR, + BitwiseXOR, + BitwiseAND, + Equality, + Relational, + BitwiseSHIFT, + Additive, + Multiplicative, + Unary, + Postfix, + Call, + New, + TaggedTemplate, + Member, + Primary + } + + /** + * Produces given Abstract Syntax Tree as javascript code + * @param ast The Abstract Syntax Tree to generate code from + * @param options The generation options + */ + export function generate(ast: any, options?: GenerateOptions): string; + /** + * Attaching the comments is needed to keep the comments and to allow blank lines to be preserved. + */ + export function attachComments(ast: any, comments: any, tokens: any): any; +} diff --git a/esprima/esprima.d.ts b/esprima/esprima.d.ts index bd5f4009d2..30fe9512bf 100644 --- a/esprima/esprima.d.ts +++ b/esprima/esprima.d.ts @@ -71,6 +71,7 @@ declare namespace esprima { LabeledStatement: string, LogicalExpression: string, MemberExpression: string, + MetaProperty: string, MethodDefinition: string, NewExpression: string, ObjectExpression: string, diff --git a/estraverse/estraverse-tests.ts b/estraverse/estraverse-tests.ts new file mode 100644 index 0000000000..0650aa99e2 --- /dev/null +++ b/estraverse/estraverse-tests.ts @@ -0,0 +1,59 @@ +/// + +import * as estraverse from 'estraverse'; + +let ast: any = { + "type": "Program", + "body": [ + { + "type": "VariableDeclaration", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "answer" + }, + "init": { + "type": "BinaryExpression", + "operator": "*", + "left": { + "type": "Literal", + "value": 6, + "raw": "6" + }, + "right": { + "type": "Literal", + "value": 7, + "raw": "7" + } + } + } + ], + "kind": "var" + } + ], + "sourceType": "script" +}; + +estraverse.traverse(ast, { + enter: (node: any, parentNode: any) => { + if (node.type === 'Identifier') { + return estraverse.VisitorOption.Skip; + } + }, + leave: (node: any, parentNode: any) => {}, + fallback: 'iteration', + keys: { + TestExpression: ['argument'] + } +}); + +estraverse.replace(ast, { + enter: (node: any, parentNode: any) => { + return node; + }, + leave: (node: any, parentNode: any) => { + return node; + } +}); \ No newline at end of file diff --git a/estraverse/estraverse.d.ts b/estraverse/estraverse.d.ts new file mode 100644 index 0000000000..69b4d5d311 --- /dev/null +++ b/estraverse/estraverse.d.ts @@ -0,0 +1,22 @@ +// Type definitions for estraverse +// Project: https://github.com/estools/estraverse +// Definitions by: Sanex3339 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module 'estraverse' { + export interface Visitor { + enter?: (node: any, parentNode: any) => any; + leave?: (node: any, parentNode: any) => any; + + fallback?: string; + + keys?: {}; + } + + export enum VisitorOption { + Skip, Break, Remove + } + + export function traverse (ast: any, visitor: Visitor): any; + export function replace (ast: any, visitor: Visitor): any; +} \ No newline at end of file diff --git a/exorcist/exorcist-tests.ts b/exorcist/exorcist-tests.ts new file mode 100644 index 0000000000..26a1be0e07 --- /dev/null +++ b/exorcist/exorcist-tests.ts @@ -0,0 +1,15 @@ +/// + +import exorcist = require("exorcist"); + +module ExorcistTest { + + function pullSourceMaps(srcPath: string, projRoot: string) { + exorcist(srcPath, undefined, projRoot); + exorcist(srcPath, null, projRoot, null, true); + exorcist(srcPath, null, projRoot, "./"); + } + +} + +export = ExorcistTest; \ No newline at end of file diff --git a/exorcist/exorcist.d.ts b/exorcist/exorcist.d.ts new file mode 100644 index 0000000000..a60908915b --- /dev/null +++ b/exorcist/exorcist.d.ts @@ -0,0 +1,21 @@ +// Type definitions for exorcist v0.4.0 +// Project: https://github.com/thlorenz/exorcist +// Definitions by: TeamworkGuy2 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module 'exorcist' { + import through = require("through"); + + /** Externalizes the source map found inside a stream to an external .map file. + * Works with both JavaScript and CSS input streams + * @param file full path to the map file to which to write the extracted source map + * @param [url] full URL to the map file, set as sourceMappingURL in the streaming output (default: file) + * @param [root] root URL for loading relative source paths, set as sourceRoot in the source map (default: "") + * @param [base] base path for calculating relative source paths (default: use absolute paths) + * @param [errorOnMissing] when truthy, causes 'error' to be emitted instead of 'missing-map' if no map was found in the stream (default: falsey) + */ + function exorcist(file: string, url?: string, root?: string, base?: string, errorOnMissing?: boolean): through.ThroughStream; + export = exorcist; +} \ No newline at end of file diff --git a/express-brute/express-brute.d.ts b/express-brute/express-brute.d.ts index 37df68af64..c194f5b69a 100644 --- a/express-brute/express-brute.d.ts +++ b/express-brute/express-brute.d.ts @@ -49,15 +49,15 @@ declare module "express-brute" { * @interface */ interface ExpressBruteOptions { - freeRetries: number; - proxyDepth: number; - attachResetToRequest: boolean; - refreshTimeoutOnRequest: boolean; - minWait: number; - maxWait: number; - lifetime: number; - failCallback: (req: express.Request, res: express.Response, next: Function, nextValidRequestDate: any) => void; - handleStoreError: any; + freeRetries?: number; + proxyDepth?: number; + attachResetToRequest?: boolean; + refreshTimeoutOnRequest?: boolean; + minWait?: number; + maxWait?: number; + lifetime?: number; + failCallback?: (req: express.Request, res: express.Response, next: Function, nextValidRequestDate: any) => void; + handleStoreError?: any; } /** @@ -70,7 +70,7 @@ class ExpressBrute { * @constructor * @param {any} store The store. */ - constructor(store: any); + constructor(store: any, options?: ExpressBruteOptions); /** * @summary Generates middleware that will bounce requests with the same key and IP address that happen faster than the current wait time by calling failCallback. diff --git a/express-domain-middleware/express-domain-middleware-tests.ts b/express-domain-middleware/express-domain-middleware-tests.ts new file mode 100644 index 0000000000..446b732353 --- /dev/null +++ b/express-domain-middleware/express-domain-middleware-tests.ts @@ -0,0 +1,2 @@ +/// +import fn = require('express-domain-middleware'); diff --git a/express-domain-middleware/express-domain-middleware.d.ts b/express-domain-middleware/express-domain-middleware.d.ts new file mode 100644 index 0000000000..1710d548e0 --- /dev/null +++ b/express-domain-middleware/express-domain-middleware.d.ts @@ -0,0 +1,12 @@ +// Type definitions for express-domain-middleware +// Project: https://www.npmjs.com/package/express-domain-middleware +// Definitions by: Hookclaw +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module "express-domain-middleware" { + import express = require('express'); + function e(req: express.Request, res: express.Response, next: express.NextFunction): any; + export = e; +} diff --git a/express-graphql/express-graphql-tests.ts b/express-graphql/express-graphql-tests.ts index ec9e48ea43..7469a0801d 100644 --- a/express-graphql/express-graphql-tests.ts +++ b/express-graphql/express-graphql-tests.ts @@ -1,10 +1,29 @@ /// /// +/// -var express = require("express"); -var graphqlHTTP = require("express-graphql"); -var app = express(); +import * as express from "express"; +import * as graphqlHTTP from "express-graphql"; -var schema = {}; +const app = express(); +const schema = {}; -app.use("/graphql", graphqlHTTP({ schema: schema, graphiql: true })); +const graphqlOption: graphqlHTTP.OptionsObj = { + graphiql: true, + schema: schema, + formatError: (error:Error) => ({ + message: error.message, + }) +}; + +const graphqlOptionRequest = (request: express.Request): graphqlHTTP.OptionsObj => ({ + graphiql: true, + schema: schema, + context: request.session, +}); + +app.use("/graphql1", graphqlHTTP(graphqlOption)); + +app.use("/graphql2", graphqlHTTP(graphqlOptionRequest)); + +app.listen(8080); diff --git a/express-graphql/express-graphql.d.ts b/express-graphql/express-graphql.d.ts index 25f36967fe..e5f42f5839 100644 --- a/express-graphql/express-graphql.d.ts +++ b/express-graphql/express-graphql.d.ts @@ -8,45 +8,53 @@ declare module "express-graphql" { import { Request, Response } from "express"; - /** - * Used to configure the graphQLHTTP middleware by providing a schema - * and other configuration options. - */ - export type Options = ((req: Request) => OptionsObj) | OptionsObj - export type OptionsObj = { + namespace graphqlHTTP { /** - * A GraphQL schema from graphql-js. + * Used to configure the graphQLHTTP middleware by providing a schema + * and other configuration options. */ - schema: Object, + export type Options = ((req:Request) => OptionsObj) | OptionsObj + export type OptionsObj = { + /** + * A GraphQL schema from graphql-js. + */ + schema:Object, - /** - * An object to pass as the rootValue to the graphql() function. - */ - rootValue?: Object, + /** + * A value to pass as the context to the graphql() function. + */ + context?:Object, - /** - * A boolean to configure whether the output should be pretty-printed. - */ - pretty?: boolean, + /** + * An object to pass as the rootValue to the graphql() function. + */ + rootValue?:Object, - /** - * An optional function which will be used to format any errors produced by - * fulfilling a GraphQL operation. If no function is provided, GraphQL's - * default spec-compliant `formatError` function will be used. - */ - formatError?: Function, + /** + * A boolean to configure whether the output should be pretty-printed. + */ + pretty?:boolean, - /** - * A boolean to optionally enable GraphiQL mode. - */ - graphiql?: boolean, - }; + /** + * An optional function which will be used to format any errors produced by + * fulfilling a GraphQL operation. If no function is provided, GraphQL's + * default spec-compliant `formatError` function will be used. + */ + formatError?:Function, - type Middleware = (request: Request, response: Response) => void; + /** + * A boolean to optionally enable GraphiQL mode. + */ + graphiql?:boolean, + }; + + type Middleware = (request:Request, response:Response) => void; + } /** * Middleware for express; takes an options object or function as input to * configure behavior, and returns an express middleware. */ - export default function graphqlHTTP(options: Options): Middleware; + function graphqlHTTP(options: graphqlHTTP.Options): graphqlHTTP.Middleware; + export = graphqlHTTP; } diff --git a/express-jwt/express-jwt.d.ts b/express-jwt/express-jwt.d.ts index 1aec6606fe..dadf833f67 100644 --- a/express-jwt/express-jwt.d.ts +++ b/express-jwt/express-jwt.d.ts @@ -12,21 +12,30 @@ declare module "express-jwt" { function jwt(options: jwt.Options): jwt.RequestHandler; - interface IDoneCallback { - (err: Error, result: T): void; - } - - type ICallback = (req: express.Request, payload: T, done: IDoneCallback) => void; - namespace jwt { + + export type secretType = string | Buffer + export interface SecretCallback { + (req: express.Request, header:any, payload: any, done: (err: any, secret?: boolean) => void): void; + (req: express.Request, payload: any, done: (err: any, secret?: secretType) => void):void; + } + + export interface IsRevokedCallback { + (req: express.Request, payload: any, done: (err: any, revoked?: boolean) => void): void; + } + + export interface GetTokenCallback { + (req: express.Request): any; + } + export interface Options { - secret: string|Buffer|ICallback; + secret: secretType|SecretCallback; userProperty?: string; skip?: string[]; credentialsRequired?: boolean; - isRevoked?: boolean; + isRevoked?: IsRevokedCallback; requestProperty?: string; - getToken?: ICallback; + getToken?: GetTokenCallback; [property: string]: any; } export interface RequestHandler extends express.RequestHandler { @@ -34,4 +43,4 @@ declare module "express-jwt" { } } export = jwt; -} +} \ No newline at end of file diff --git a/express-serve-static-core/express-serve-static-core.d.ts b/express-serve-static-core/express-serve-static-core.d.ts index 70817018a9..de91c521cc 100644 --- a/express-serve-static-core/express-serve-static-core.d.ts +++ b/express-serve-static-core/express-serve-static-core.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Express 4.x +// Type definitions for Express 4.x // Project: http://expressjs.com // Definitions by: Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -17,24 +17,33 @@ declare namespace Express { declare module "express-serve-static-core" { import * as http from "http"; - interface IRoute { - path: string; - stack: any; - all(...handler: RequestHandler[]): IRoute; - get(...handler: RequestHandler[]): IRoute; - post(...handler: RequestHandler[]): IRoute; - put(...handler: RequestHandler[]): IRoute; - delete(...handler: RequestHandler[]): IRoute; - patch(...handler: RequestHandler[]): IRoute; - options(...handler: RequestHandler[]): IRoute; - head(...handler: RequestHandler[]): IRoute; + interface NextFunction { + (err?: any): void; } + interface RequestHandler { + (req: Request, res: Response, next: NextFunction): any; + } + + interface ErrorRequestHandler { + (err: any, req: Request, res: Response, next: NextFunction): any; + } + + type PathParams = string | RegExp | (string | RegExp)[]; + + type RequestHandlerParams = RequestHandler | ErrorRequestHandler | (RequestHandler | ErrorRequestHandler)[]; + interface IRouterMatcher { - (name: string | RegExp, ...handlers: RequestHandler[]): T; + (path: PathParams, ...handlers: RequestHandler[]): T; + (path: PathParams, ...handlers: RequestHandlerParams[]): T; } - interface IRouter extends RequestHandler { + interface IRouterHandler { + (...handlers: RequestHandler[]): T; + (...handlers: RequestHandlerParams[]): T; + } + + interface IRouter extends RequestHandler { /** * Map the given param placeholder `name`(s) to the given callback(s). * @@ -64,11 +73,10 @@ declare module "express-serve-static-core" { * @param name * @param fn */ - param(name: string, handler: RequestParamHandler): T; - param(name: string, matcher: RegExp): T; - param(name: string, mapper: (param: any) => any): T; + param(name: string, handler: RequestParamHandler): this; // Alternatively, you can pass only a callback, in which case you have the opportunity to alter the app.param() API - param(callback: (name: string, matcher: RegExp) => RequestParamHandler): T; + // deprecated since express 4.11.0 + param(callback: (name: string, matcher: RegExp) => RequestParamHandler): this; /** * Special-cased "all" method, applying the given route `path`, @@ -77,30 +85,34 @@ declare module "express-serve-static-core" { * @param path * @param fn */ - all: IRouterMatcher; - get: IRouterMatcher; - post: IRouterMatcher; - put: IRouterMatcher; - delete: IRouterMatcher; - patch: IRouterMatcher; - options: IRouterMatcher; - head: IRouterMatcher; + all: IRouterMatcher; + get: IRouterMatcher; + post: IRouterMatcher; + put: IRouterMatcher; + delete: IRouterMatcher; + patch: IRouterMatcher; + options: IRouterMatcher; + head: IRouterMatcher; - route(path: string): IRoute; + use: IRouterHandler & IRouterMatcher; - use(...handler: RequestHandler[]): T; - use(handler: ErrorRequestHandler | RequestHandler): T; - use(path: string, ...handler: RequestHandler[]): T; - use(path: string, handler: ErrorRequestHandler | RequestHandler): T; - use(path: string[], ...handler: RequestHandler[]): T; - use(path: string[], handler: ErrorRequestHandler): T; - use(path: RegExp, ...handler: RequestHandler[]): T; - use(path: RegExp, handler: ErrorRequestHandler): T; - use(path: string, router: Router): T; + route(prefix: PathParams): IRoute; } + interface IRoute { + path: string; + stack: any; + all: IRouterHandler; + get: IRouterHandler; + post: IRouterHandler; + put: IRouterHandler; + delete: IRouterHandler; + patch: IRouterHandler; + options: IRouterHandler; + head: IRouterHandler; + } - export interface Router extends IRouter { } + export interface Router extends IRouter { } interface CookieOptions { maxAge?: number; @@ -180,9 +192,10 @@ declare module "express-serve-static-core" { * req.accepts('html, json'); * // => "json" */ - accepts(type: string): string; - - accepts(type: string[]): string; + accepts(): string[]; + accepts(type: string): string | boolean; + accepts(type: string[]): string | boolean; + accepts(...type: string[]): string | boolean; /** * Returns the first accepted charset of the specified character sets, @@ -192,7 +205,10 @@ declare module "express-serve-static-core" { * For more information, or if you have issues or concerns, see accepts. * @param charset */ - acceptsCharsets(charset?: string | string[]): string[]; + acceptsCharsets(): string[]; + acceptsCharsets(charset: string): string | boolean; + acceptsCharsets(charset: string[]): string | boolean; + acceptsCharsets(...charset: string[]): string | boolean; /** * Returns the first accepted encoding of the specified encodings, @@ -202,7 +218,10 @@ declare module "express-serve-static-core" { * For more information, or if you have issues or concerns, see accepts. * @param encoding */ - acceptsEncodings(encoding?: string | string[]): string[]; + acceptsEncodings(): string[]; + acceptsEncodings(encoding: string): string | boolean; + acceptsEncodings(encoding: string[]): string | boolean; + acceptsEncodings(...encoding: string[]): string | boolean; /** * Returns the first accepted language of the specified languages, @@ -213,7 +232,10 @@ declare module "express-serve-static-core" { * * @param lang */ - acceptsLanguages(lang?: string | string[]): string[]; + acceptsLanguages(): string[]; + acceptsLanguages(lang: string): string | boolean; + acceptsLanguages(lang: string[]): string | boolean; + acceptsLanguages(...lang: string[]): string | boolean; /** * Parse Range header field, @@ -241,6 +263,8 @@ declare module "express-serve-static-core" { accepted: MediaType[]; /** + * @deprecated Use either req.params, req.body or req.query, as applicable. + * * Return the value of param `name` when present or `defaultValue`. * * - Checks route placeholders, ex: _/user/:id_ @@ -372,10 +396,6 @@ declare module "express-serve-static-core" { params: any; - user: any; - - authenticatedUser: any; - /** * Clear cookie `name`. * @@ -408,7 +428,7 @@ declare module "express-serve-static-core" { interface Send { (status: number, body?: any): Response; - (body: any): Response; + (body?: any): Response; } interface Response extends http.ServerResponse, Express.Response { @@ -780,24 +800,24 @@ declare module "express-serve-static-core" { locals: any; charset: string; - } - interface NextFunction { - (err?: any): void; + /** + * Adds the field to the Vary response header, if it is not there already. + * Examples: + * + * res.vary('User-Agent').render('docs'); + * + */ + vary(field: string): Response; } - interface ErrorRequestHandler { - (err: any, req: Request, res: Response, next: NextFunction): any; - } - - interface Handler extends RequestHandler { } interface RequestParamHandler { - (req: Request, res: Response, next: NextFunction, param: any): any; + (req: Request, res: Response, next: NextFunction, value: any, name: string): any; } - interface Application extends IRouter, Express.Application { + interface Application extends IRouter, Express.Application { /** * Initialize the server. * @@ -858,10 +878,11 @@ declare module "express-serve-static-core" { * @param val */ set(setting: string, val: any): Application; - get: { - (name: string): any; // Getter - (name: string | RegExp, ...handlers: RequestHandler[]): Application; - }; + get: {(name: string): any;} & IRouterMatcher; + + param(name: string | string[], handler: RequestParamHandler): this; + // Alternatively, you can pass only a callback, in which case you have the opportunity to alter the app.param() API + param(callback: (name: string, matcher: RegExp) => RequestParamHandler): this; /** * Return the app's absolute pathname @@ -1006,8 +1027,6 @@ declare module "express-serve-static-core" { listen(path: string, callback?: Function): http.Server; listen(handle: any, listeningListener?: Function): http.Server; - route(path: string): IRoute; - router: string; settings: any; @@ -1055,8 +1074,4 @@ declare module "express-serve-static-core" { response: Response; } - - interface RequestHandler { - (req: Request, res: Response, next: NextFunction): any; - } } diff --git a/express/express-tests.ts b/express/express-tests.ts index 11f8fd44fd..ed9265b66a 100644 --- a/express/express-tests.ts +++ b/express/express-tests.ts @@ -50,6 +50,26 @@ router.delete(pathRE); router.use((req, res, next) => { next(); }) router.route('/users') .get((req, res, next) => { + let types: string[] = req.accepts(); + let type: string | boolean = req.accepts('json'); + type = req.accepts(['json', 'text']); + type = req.accepts('json', 'text'); + + let charsets: string[] = req.acceptsCharsets(); + let charset: string | boolean = req.acceptsCharsets('utf-8'); + charset = req.acceptsCharsets(['utf-8', 'utf-16']); + charset = req.acceptsCharsets('utf-8', 'utf-16'); + + let encodings: string[] = req.acceptsEncodings(); + let encoding: string | boolean = req.acceptsEncodings('gzip'); + encoding = req.acceptsEncodings(['gzip', 'deflate']); + encoding = req.acceptsEncodings('gzip', 'deflate'); + + let languages: string[] = req.acceptsLanguages(); + let language: string | boolean = req.acceptsLanguages('en'); + language = req.acceptsLanguages(['en', 'ja']); + language = req.acceptsLanguages('en', 'ja'); + res.send(req.query['token']); }); diff --git a/express/express.d.ts b/express/express.d.ts index 4ab7eb1c90..5f65b60519 100644 --- a/express/express.d.ts +++ b/express/express.d.ts @@ -38,8 +38,9 @@ declare module "express" { interface Express extends core.Express { } interface Handler extends core.Handler { } interface IRoute extends core.IRoute { } - interface IRouter extends core.IRouter { } + interface IRouter extends core.IRouter { } interface IRouterMatcher extends core.IRouterMatcher { } + interface IRouterHandler extends core.IRouterHandler { } interface MediaType extends core.MediaType { } interface NextFunction extends core.NextFunction { } interface Request extends core.Request { } diff --git a/falcor-http-datasource/falcor-http-datasource.d.ts b/falcor-http-datasource/falcor-http-datasource.d.ts index 920ec2e8d0..3d0249b208 100644 --- a/falcor-http-datasource/falcor-http-datasource.d.ts +++ b/falcor-http-datasource/falcor-http-datasource.d.ts @@ -11,7 +11,7 @@ declare namespace FalcorHttpDataSource { * A HttpDataSource object is a {@link DataSource} can be used to retrieve data from a remote JSONGraph object using the browser's XMLHttpRequest. **/ class XMlHttpSource extends FalcorModel.DataSource { - constructor(jsonGraphUrl: string); + constructor(jsonGraphUrl: string, config?: any); } } diff --git a/fast-json-patch/fast-json-patch-tests.ts b/fast-json-patch/fast-json-patch-tests.ts new file mode 100644 index 0000000000..e7ecc249ac --- /dev/null +++ b/fast-json-patch/fast-json-patch-tests.ts @@ -0,0 +1,43 @@ +/// +import * as jsonpatch from 'fast-json-patch' + +var myobj:{ + firstName:string, + contactDetails: { + phoneNumbers:string[] + } +} = { firstName:"Albert", contactDetails: { phoneNumbers: [ ] } }; +var patches = [ + {op:"replace", path:"/firstName", value:"Joachim" }, + {op:"add", path:"/lastName", value:"Wester" }, + {op:"add", path:"/contactDetails/phoneNumbers/0", value:{ number:"555-123" } } + ]; +jsonpatch.apply( myobj, patches ); + +var myobj2 = { firstName:"Joachim", lastName:"Wester", contactDetails: { phoneNumbers: [ { number:"555-123" }] } }; +var observer = jsonpatch.observe( myobj2 ); +myobj2.firstName = "Albert"; +myobj2.contactDetails.phoneNumbers[0].number = "123"; +myobj2.contactDetails.phoneNumbers.push({number:"456"}); +var patches2 = jsonpatch.generate(observer); + +var objA = {user: {firstName: "Albert", lastName: "Einstein"}}; +var objB = {user: {firstName: "Albert", lastName: "Collins"}}; +var diff = jsonpatch.compare(objA, objB); + +var obj = {user: {firstName: "Albert"}}; +var patches3 = [{op: "replace", path: "/user/firstName", value: "Albert"}, {op: "replace", path: "/user/lastName", value: "Einstein"}]; +var errors = jsonpatch.validate(patches, obj); +if (errors.length == 0) { + //there are no errors! +} +else { + for (var i=0; i < errors.length; i++) { + if (!errors[i]) { + console.log("Valid patch at index", i, patches[i]); + } + else { + console.error("Invalid patch at index", i, errors[i], patches[i]); + } + } +} diff --git a/fast-json-patch/fast-json-patch.d.ts b/fast-json-patch/fast-json-patch.d.ts new file mode 100644 index 0000000000..9a4496b00c --- /dev/null +++ b/fast-json-patch/fast-json-patch.d.ts @@ -0,0 +1,67 @@ +// Type definitions for JSON-Patch v1.0.0 +// Project: https://github.com/Starcounter-Jack/JSON-Patch/releases +// Definitions by: Francis OBrien +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace fastjsonpatch { + + + interface JsonPatch { + /** + * Applies an array of patch instructions to an object + */ + apply(object:any, patches:Patch[], validate?:boolean):boolean + + /** + * Observes changes made to an object, which can then be retieved using generate + */ + observe(object:T, callback?:()=>void):Observer + + /** + * Detach an observer from an object + */ + unobserve(object:T, observer:Observer):void + + /** + * Generate an array of patches from an observer + */ + generate(observer:Observer):Patch[] + + /** + * Create an array of patches from the differences in two objects + */ + compare(object1:any, object2:any):Patch[] + + /** + * Ensure a set of patch instructions is valid + */ + validate(patches:Patch[], tree?:any):JsonPatchError[] + } + + interface Observer { + object:T + patches:Patch[] + unobserve():void + } + + interface Patch { + op:string + path:string + value?:any + from?:string + } + + interface JsonPatchError { + name:string + message:string + index:number + operation:any + tree:any + } +} + +declare var jsonpatch: fastjsonpatch.JsonPatch; + +declare module "fast-json-patch" { + export = jsonpatch +} \ No newline at end of file diff --git a/fast-simplex-noise/fast-simplex-noise-tests.ts b/fast-simplex-noise/fast-simplex-noise-tests.ts new file mode 100644 index 0000000000..94bac2f9b8 --- /dev/null +++ b/fast-simplex-noise/fast-simplex-noise-tests.ts @@ -0,0 +1,29 @@ +/// + +import FastSimplexNoise = require('fast-simplex-noise') + +var defaultNoiseGen: FastSimplexNoise = new FastSimplexNoise() +var emptyOptionsNoiseGen: FastSimplexNoise = new FastSimplexNoise({}) + +var noiseGen: FastSimplexNoise = new FastSimplexNoise({ + amplitude: 1, + frequency: 0.01, + max: 255, + min: 0, + octaves: 8, + persistence: 0.5, + random: Math.random +}) + +var values: number[] = [] + +values.push(noiseGen.cylindrical2D(5, 1, 1)) +values.push(noiseGen.cylindrical3D(5, 1, 1, 1)) +values.push(noiseGen.in2D(1, 1)) +values.push(noiseGen.in3D(1, 1, 1)) +values.push(noiseGen.in4D(1, 1, 1, 1)) +values.push(noiseGen.raw2D(1, 1)) +values.push(noiseGen.raw3D(1, 1, 1)) +values.push(noiseGen.raw4D(1, 1, 1, 1)) +values.push(noiseGen.spherical2D(5, 1, 1)) +values.push(noiseGen.spherical3D(5, 1, 1, 1)) diff --git a/fast-simplex-noise/fast-simplex-noise.d.ts b/fast-simplex-noise/fast-simplex-noise.d.ts new file mode 100644 index 0000000000..14df3351ef --- /dev/null +++ b/fast-simplex-noise/fast-simplex-noise.d.ts @@ -0,0 +1,94 @@ +// Type definitions for FastSimplexNoise v2.1.1 +// Project: https://www.npmjs.com/package/fast-simplex-noise +// Definitions by: Tobias Cohen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * A JavaScript implementation of the improved, faster Simplex algorithm outlined in Stefan Gustavson's Simplex noise demystified. + * + * Convenience functions have been added as well, in order to avoid needing to scale and handle the raw noise data directly. + */ +declare class FastSimplexNoise { + amplitude: number; + frequency: number; + max: number; + min: number; + octaves: number; + persistence: number; + random: ()=>number; + + /** + * Options is an optional object that can contain: + * + * amplitude: float - The base amplitude (default: 1.0) + * frequency: float - The base frequency (default: 1.0) + * max: float - The maximum scaled value to return (effective default: 1.0) + * min: float - The minimum scaled value to return (effective default: -1.0) + * octaves: integer - The number of octaves to sum for noise generation (default: 1) + * persistence: float - The persistence of amplitude per octave (default: 0.5) + * random: function - A function that generates random values between 0 and 1 (default: Math.random) + */ + constructor(options?: { + amplitude?: number; + frequency?: number; + max?: number; + min?: number; + octaves?: number; + persistence?: number; + random?: ()=>number; + }); + + /** + * Get a noise value between min and max for a point (x,y) on the surface of a cylinder with circumference c. + */ + cylindrical2D(c: number, x: number, y: number): number; + + /** + * Get a noise value between min and max for a point (x, y, z) on the surface of a cylinder with circumference c. + */ + cylindrical3D(c: number, x: number, y: number, z: number): number; + + /** + * Get a noise value between min and max at the 2D coordinate (x,y) in summed octaves, using amplitude, frequency, and persistence values. + */ + in2D(x: number, y: number): number; + + /** + * Get a noise value between min and max at the 3D coordinate (x,y,z) in summed octaves, using amplitude, frequency, and persistence values. + */ + in3D(x: number, y: number, z: number): number; + + /** + * Get a noise value between min and max at the 4D coordinate (x,y,z,w) in summed octaves, using amplitude, frequency, and persistence values. + */ + in4D(x: number, y: number, z: number, w: number): number; + + /** + * Get a noise value [-1, 1] at the 2D coordinate (x,y). + */ + raw2D(x: number, y: number): number; + + /** + * Get a noise value [-1, 1] at the 3D coordinate (x,y,z). + */ + raw3D(x: number, y: number, z: number): number; + + /** + * Get a noise value [-1, 1] at the 4D coordinate (x,y,z,w). + */ + raw4D(x: number, y: number, z: number, w: number): number; + + /** + * Get a noise value between min and max for a point (x, y) on the surface of a sphere with circumference c. + */ + spherical2D(c: number, x: number, y: number): number; + + /** + * Get a noise value between min and max for a point (x, y, z) on the surface of a sphere with circumference c. + */ + spherical3D(c: number, x: number, y: number, z: number): number; +} + +declare module "fast-simplex-noise" { + export = FastSimplexNoise; +} diff --git a/fbemitter/fbemitter.d.ts b/fbemitter/fbemitter.d.ts index b26b1a3162..0f5f6af528 100644 --- a/fbemitter/fbemitter.d.ts +++ b/fbemitter/fbemitter.d.ts @@ -3,7 +3,7 @@ // Definitions by: kmxz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare module 'fbemitter' { +declare namespace FBEmitter { export class EventSubscription { @@ -64,4 +64,8 @@ declare module 'fbemitter' { } -} \ No newline at end of file +} + +declare module 'fbemitter' { + export = FBEmitter; +} diff --git a/fbsdk/fbsdk.d.ts b/fbsdk/fbsdk.d.ts index 6153de6579..286eb86b8e 100644 --- a/fbsdk/fbsdk.d.ts +++ b/fbsdk/fbsdk.d.ts @@ -67,11 +67,28 @@ interface PayDialogParams { test_currency?: string; } +interface FeedDialogParams { + method: string; // "feed" + app_id: string; + redirect_uri?: string; + display?: string; + from?: string; + to?: string; + link?: string; + picture?: string; + source?: string; + name: string; + caption?: string; + description?: string; + ref?: any; +} + declare type FBUIParams = ShareDialogParams | PageTabDialogParams | RequestsDialogParams | SendDialogParams - | PayDialogParams; + | PayDialogParams + | FeedDialogParams; interface FBLoginOptions{ auth_type?: string; @@ -150,6 +167,7 @@ interface FBSDKCanvas{ } interface FBResponseObject { + data: any; error: any; } diff --git a/fetch-mock/fetch-mock-tests.ts b/fetch-mock/fetch-mock-tests.ts new file mode 100644 index 0000000000..defefa25a1 --- /dev/null +++ b/fetch-mock/fetch-mock-tests.ts @@ -0,0 +1,32 @@ +/// + +import * as fetchMock from "fetch-mock"; + +fetchMock.mock("http://test.com", 200); +fetchMock.mock(/test\.com/, 200); +fetchMock.mock(() => true, 200); +fetchMock.mock((url, opts) => true, 200); + +fetchMock.mock(/test/, "test").mock(/test/, { a: "b" }); +fetchMock.mock(/test/, { + status: 200, + headers: { + "test": "test" + }, + body: { + a: "b" + } +}); + +fetchMock.restore().reset(); + +(fetchMock.calls().matched[0][1] as RequestInit).body; +fetchMock.calls().unmatched[0][0].toUpperCase(); +fetchMock.calls("http://test.com")[0][0].toUpperCase(); +(fetchMock.calls("http://test.com")[0][1] as RequestInit).body; + +fetchMock.called("http://test.com"); + +(fetchMock.lastCall()[1] as RequestInit).body; +fetchMock.lastUrl(); +fetchMock.lastOptions(); diff --git a/fetch-mock/fetch-mock.d.ts b/fetch-mock/fetch-mock.d.ts new file mode 100644 index 0000000000..490b4c7dfd --- /dev/null +++ b/fetch-mock/fetch-mock.d.ts @@ -0,0 +1,207 @@ +// Type definitions for fetch-mock 5.0.0 +// Project: https://github.com/wheresrhys/fetch-mock +// Definitions by: Alexey Svetliakov , Tamir Duberstein +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// + +declare module "fetch-mock" { + type MockRequest = Request | RequestInit; + + /** + * Mock matcher function + * @param url + * @param opts + */ + type MockMatcherFunction = (url: string, opts: MockRequest) => boolean + /** + * Mock matcher. Can be one of following: + * string: Either + * an exact url to match e.g. 'http://www.site.com/page.html' + * if the string begins with a `^`, the string following the `^` must + begin the url e.g. '^http://www.site.com' would match + 'http://www.site.com' or 'http://www.site.com/page.html' + * '*' to match any url + * RegExp: A regular expression to test the url against + * Function(url, opts): A function (returning a Boolean) that is passed the + url and opts fetch() is called with (or, if fetch() was called with one, + the Request instance) + */ + type MockMatcher = string | RegExp | MockMatcherFunction; + + /** + * Mock response object + */ + interface MockResponseObject { + /** + * Set the response body + */ + body?: string | {}; + /** + * Set the response status + * @default 200 + */ + status?: number; + /** + * Set the response headers. + */ + headers?: { [key: string]: string }; + /** + * If this property is present then a Promise rejected with the value + of throws is returned + */ + throws?: boolean; + /** + * This property determines whether or not the request body should be + JSON.stringified before being sent + * @default true + */ + sendAsJson?: boolean; + } + /** + * Response: A Response instance - will be used unaltered + * number: Creates a response with this status + * string: Creates a 200 response with the string as the response body + * object: As long as the object is not a MockResponseObject it is + converted into a json string and returned as the body of a 200 response + * If MockResponseObject was given then it's used to configure response + * Function(url, opts): A function that is passed the url and opts fetch() + is called with and that returns any of the responses listed above + */ + type MockResponse = Response | Promise + | number | Promise + | string | Promise + | Object | Promise + | MockResponseObject | Promise; + /** + * Mock response function + * @param url + * @param opts + */ + type MockResponseFunction = (url: string, opts: MockRequest) => MockResponse; + + /** + * Mock options object + */ + interface MockOptions { + /** + * A unique string naming the route. Used to subsequently retrieve + references to the calls, grouped by name. + * @default matcher.toString() + * + * Note: If a non-unique name is provided no error will be thrown + (because names are optional, auto-generated ones may legitimately + clash) + */ + name?: string; + /** + * http method to match + */ + method?: string; + /** + * as specified above + */ + matcher?: MockMatcher; + /** + * as specified above + */ + response?: MockResponse | MockResponseFunction; + } + + type MockCall = [string, MockRequest]; + + interface MatchedRoutes { + matched: Array; + unmatched: Array; + } + + interface FetchMockStatic { + /** + * Replaces fetch() with a stub which records its calls, grouped by + route, and optionally returns a mocked Response object or passes the + call through to fetch(). Calls to .mock() can be chained. + * @param matcher Condition for selecting which requests to mock + * @param response Configures the http response returned by the mock + */ + mock(matcher: MockMatcher, response: MockResponse | MockResponseFunction): this; + /** + * Replaces fetch() with a stub which records its calls, grouped by + route, and optionally returns a mocked Response object or passes the + call through to fetch(). Calls to .mock() can be chained. + * @param matcher Condition for selecting which requests to mock + * @param response Configures the http response returned by the mock + * @param options Additional properties defining the route to mock + */ + mock(matcher: MockMatcher, response: MockResponse | MockResponseFunction, options: MockOptions): this; + /** + * Replaces fetch() with a stub which records its calls, grouped by + route, and optionally returns a mocked Response object or passes the + call through to fetch(). Calls to .mock() can be chained. + * @param options The route to mock + */ + mock(options: MockOptions): this; + /** + * Chainable method that restores fetch() to its unstubbed state and + clears all data recorded for its calls. + */ + restore(): this; + /** + * Chainable method that clears all data recorded for fetch()'s calls + */ + reset(): this; + /** + * Returns all calls to fetch, grouped by whether fetch-mock matched + them or not. + */ + calls(): MatchedRoutes; + /** + * Returns all calls to fetch matching matcherName. + */ + calls(matcherName?: string): Array; + /** + * Returns a Boolean indicating whether fetch was called and a route + was matched. + */ + called(): boolean; + /** + * Returns a Boolean indicating whether fetch was called and a route + named matcherName was matched. + */ + called(matcherName?: string): boolean; + /** + * Returns the arguments for the last matched call to fetch + */ + lastCall(): MockCall; + /** + * Returns the arguments for the last call to fetch matching + matcherName + */ + lastCall(matcherName?: string): MockCall; + /** + * Returns the url for the last matched call to fetch + */ + lastUrl(): string; + /** + * Returns the url for the last call to fetch matching matcherName + */ + lastUrl(matcherName?: string): string; + /** + * Returns the options for the last matched call to fetch + */ + lastOptions(): MockRequest; + /** + * Returns the options for the last call to fetch matching matcherName + */ + lastOptions(matcherName?: string): MockRequest; + /** + * Set some global config options, which include + * sendAsJson [default `true`] - by default fetchMock will + convert objects to JSON before sending. This is overrideable + for each call but for some scenarios, e.g. when dealing with a + lot of array buffers, it can be useful to default to `false` + */ + configure(opts: Object): void; + } + + var fetchMock: FetchMockStatic; + export = fetchMock; +} diff --git a/flickity/flickity-tests.ts b/flickity/flickity-tests.ts index 8d06e4ee7f..4f155f3e17 100644 --- a/flickity/flickity-tests.ts +++ b/flickity/flickity-tests.ts @@ -30,7 +30,7 @@ percentPosition: false, prevNextButtons: false, selectedAttraction: 0.050, - useSetGallerySize: true, + setGallerySize: true, watchCSS: true, wrapAround: true, resize: true, @@ -64,7 +64,7 @@ percentPosition: false, prevNextButtons: false, selectedAttraction: 0.050, - useSetGallerySize: true, + setGallerySize: true, watchCSS: true, wrapAround: true, resize: true, diff --git a/flickity/flickity.d.ts b/flickity/flickity.d.ts index bf4541e5ff..febb09b525 100644 --- a/flickity/flickity.d.ts +++ b/flickity/flickity.d.ts @@ -269,7 +269,7 @@ interface FlickityOptions { * * default: true */ - useSetGallerySize?: boolean; + setGallerySize?: boolean; /** * Adjusts sizes and positions when window is resized. diff --git a/flux/flux-tests.ts b/flux/flux-tests.ts index 24369ef2dd..6bb4350dc6 100644 --- a/flux/flux-tests.ts +++ b/flux/flux-tests.ts @@ -1,5 +1,5 @@ /// -/// +/// import flux = require('flux') import FluxUtils = require('flux/utils') @@ -88,7 +88,7 @@ export = customDispatcher // Sample Reduce Store -class CounterStore extends FluxUtils.ReduceStore { +class CounterStore extends FluxUtils.ReduceStore { getInitialState(): number { return 0; } @@ -126,4 +126,4 @@ class CounterContainer extends Component { } } -const container = Container.create(CounterContainer); +const container = Container.create(CounterContainer); diff --git a/flux/flux.d.ts b/flux/flux.d.ts index c3e9e3c10a..944aa54f3a 100644 --- a/flux/flux.d.ts +++ b/flux/flux.d.ts @@ -1,9 +1,11 @@ // Type definitions for Flux // Project: http://facebook.github.io/flux/ -// Definitions by: Steve Baker , Giedrius Grabauskas +// Definitions by: Steve Baker , Giedrius Grabauskas // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// +/// +/// declare namespace Flux { @@ -71,6 +73,29 @@ declare module "flux" { declare namespace FluxUtils { import React = __React; + import fbEmitter = FBEmitter; + import immutable = Immutable; + + /** + * Default options to create a Container with + * + * @interface RealOptions + */ + interface RealOptions { + /** + * Default value: true + * + * @type {boolean} + */ + pure?: boolean; + /** + * Default value: false + * + * @type {boolean} + */ + withProps?: boolean; + } + export class Container { constructor(); /** @@ -78,14 +103,13 @@ declare namespace FluxUtils { * that updates its state when relevant stores change. * The provided base class must have static methods getStores() and calculateState(). */ - static create(base: React.ComponentClass, options?: any): React.ComponentClass; + static create(base: React.ComponentClass, options?: RealOptions): React.ComponentClass; } /** * This class extends ReduceStore and defines the state as an immutable map. */ - // TODO: Change to > - export class MapStore extends ReduceStore { + export class MapStore extends ReduceStore, TPayload> { /** * Access the value at the given key. * Throws an error if the key does not exist in the cache. @@ -108,12 +132,10 @@ declare namespace FluxUtils { * it allows providing a previous result to update instead of generating a new map. * Providing a previous result allows the possibility of keeping the same reference if the keys did not change. */ - // TODO: Update with Immutable interface. - // getAll(keys: Immutable.IndexedIterable, prev?: Immutable.Map): Immutable.Map; - getAll(keys: any, prev?: any): any; + getAll(keys: immutable.Iterable.Indexed, prev?: immutable.Map): immutable.Map; } - export class ReduceStore extends Store { + export class ReduceStore extends Store { /** * Getter that exposes the entire state of this store. * If your state is not immutable you should override this and not expose state directly. @@ -131,7 +153,7 @@ declare namespace FluxUtils { * All subclasses must implement this method. * This method should be pure and have no side-effects. */ - reduce(state: T, action: any): T; + reduce(state: T, action: TPayload): T; /** * Checks if two versions of state are the same. @@ -141,24 +163,24 @@ declare namespace FluxUtils { } - export class Store { + export class Store { /** * Constructs and registers an instance of this store with the given dispatcher. */ - constructor(dispatcher: Flux.Dispatcher); + constructor(dispatcher: Flux.Dispatcher); /** * Adds a listener to the store, when the store changes the given callback will be called. * A token is returned that can be used to remove the listener. * Calling the remove() function on the returned token will remove the listener. */ - addListener(callback: Function): { remove: Function }; + addListener(callback: Function): fbEmitter.EventSubscription; /** * Returns the dispatcher this store is registered with. */ - getDispatcher(): Flux.Dispatcher; + getDispatcher(): Flux.Dispatcher; /** * Returns the dispatch token that the dispatcher recognizes this store by. @@ -185,7 +207,7 @@ declare namespace FluxUtils { * This is how the store receives actions from the dispatcher. * All state mutation logic must be done during this method. */ - __onDispatch(payload: any): void; + __onDispatch(payload: TPayload): void; } } diff --git a/fontfaceobserver/fontfaceobserver-tests.ts b/fontfaceobserver/fontfaceobserver-tests.ts new file mode 100644 index 0000000000..1ea9a7a222 --- /dev/null +++ b/fontfaceobserver/fontfaceobserver-tests.ts @@ -0,0 +1,46 @@ +/// + +function test1() { + var font = new FontFaceObserver('My Family', { + weight: 400 + }); + + font.load().then(function () { + console.log('Font is available'); + }, function () { + console.log('Font is not available'); + }); +} + +function test2() { + var font = new FontFaceObserver('My Family'); + + font.load('中国').then(function () { + console.log('Font is available'); + }, function () { + console.log('Font is not available'); + }); +} + +function test3() { + var font = new FontFaceObserver('My Family'); + + font.load(null, 5000).then(function () { + console.log('Font is available'); + }, function () { + console.log('Font is not available after waiting 5 seconds'); + }); +} + +function test4() { + var fontA = new FontFaceObserver('Family A'); + var fontB = new FontFaceObserver('Family B'); + + fontA.load().then(function () { + console.log('Family A is available'); + }); + + fontB.load().then(function () { + console.log('Family B is available'); + }); +} diff --git a/fontfaceobserver/fontfaceobserver-tests.ts.tscparams b/fontfaceobserver/fontfaceobserver-tests.ts.tscparams new file mode 100644 index 0000000000..14fce22a5c --- /dev/null +++ b/fontfaceobserver/fontfaceobserver-tests.ts.tscparams @@ -0,0 +1 @@ +--target ES6 diff --git a/fontfaceobserver/fontfaceobserver.d.ts b/fontfaceobserver/fontfaceobserver.d.ts new file mode 100644 index 0000000000..8f461dbd4f --- /dev/null +++ b/fontfaceobserver/fontfaceobserver.d.ts @@ -0,0 +1,33 @@ +// Type definitions for fontfaceobserver +// Project: https://github.com/bramstein/fontfaceobserver +// Definitions by: Rand Scullard +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + + +declare namespace FontFaceObserver { + interface FontVariant { + weight?: number | string; + style?: string; + stretch?: string; + } +} + +declare class FontFaceObserver { + /** + * Creates a new FontFaceObserver. + * @param fontFamilyName Name of the font family to observe. + * @param variant Description of the font variant to observe. If a property is not present it will default to normal. + */ + constructor(fontFamilyName: string, variant?: FontFaceObserver.FontVariant); + + /** + * Starts observing the loading of the specified font. Immediately returns a new Promise that resolves when the font is available and rejected when the font is not available. + * @param testString If your font doesn't contain latin characters you can pass a custom test string. + * @param timeout The default timeout for giving up on font loading is 3 seconds. You can increase or decrease this by passing a number of milliseconds. + */ + load(testString?: string, timeout?: number): Promise; +} + +declare module "fontfaceobserver" { + export = FontFaceObserver; +} diff --git a/form-data/form-data-tests.ts b/form-data/form-data-tests.ts index 641a368749..180986ed99 100644 --- a/form-data/form-data-tests.ts +++ b/form-data/form-data-tests.ts @@ -1,8 +1,135 @@ /// +/// +/// +/// +import FormData = require('form-data'); +import fs = require('fs'); +import http = require('http'); +import request = require('request'); -import formData = require('form-data'); +import * as ImportUsingES6Syntax from 'form-data'; -var value: any; -var fd = new formData.FormData(); -var obj: Object = fd.getHeaders(); -value = fd.pipe(value); +() => { + var form = new FormData(); + form.append('my_field', 'my value'); + form.append('my_buffer', new Buffer(10)); + form.append('my_file', fs.createReadStream('/foo/bar.jpg')); +} + +() => { + var form = new FormData(); + + http.request('http://nodejs.org/images/logo.png', function (response) { + form.append('my_field', 'my value'); + form.append('my_buffer', new Buffer(10)); + form.append('my_logo', response); + }); +} + +() => { + var form = new FormData(); + + form.append('my_field', 'my value'); + form.append('my_buffer', new Buffer(10)); + form.append('my_logo', request('http://nodejs.org/images/logo.png')); +} + +() => { + var form = new FormData(); + form.submit('http://example.org/', function (err, res) { + // res – response object (http.IncomingMessage) // + res.resume(); + }); +} + + +() => { + var form = new FormData(); + var request = http.request({ + method: 'post', + host: 'example.org', + path: '/upload', + headers: form.getHeaders() + }); + + form.pipe(request); + + request.on('response', function (res: any) { + console.log(res.statusCode); + }); +} + + +() => { + var form = new FormData(); + form.submit('example.org/upload', function (err, res) { + console.log(res.statusCode); + }); +} + +() => { + var CRLF = '\r\n'; + var form = new FormData(); + var buffer = new Buffer(''); + + var options = { + header: CRLF + '--' + form.getBoundary() + CRLF + 'X-Custom-Header: 123' + CRLF + CRLF, + knownLength: 1 + }; + + form.append('my_buffer', buffer, options); + + form.submit('http://example.com/', function (err, res) { + if (err) throw err; + console.log('Done'); + }); +} + +() => { + var form = new FormData(); + form.submit({ + host: 'example.com', + path: '/probably.php?extra=params', + auth: 'username:password' + }, function (err, res) { + console.log(res.statusCode); + }); +} + +() => { + var form = new FormData(); + form.submit({ + host: 'example.com', + path: '/surelynot.php', + headers: { 'x-test-header': 'test-header-value' } + }, function (err, res) { + console.log(res.statusCode); + }); +} + +() => { + var formData = { + my_field: 'my_value', + my_file: fs.createReadStream(__dirname + '/unicycle.jpg'), + }; + + request.post({ url: 'http://service.com/upload', formData: formData }, function (err, httpResponse, body) { + if (err) { + return console.error('upload failed:', err); + } + console.log('Upload successful! Server responded with:', body); + }); +} + +() => { + var form = new FormData(); + + form.append('a', 1); + + fetch('http://example.com', { method: 'POST', body: form }) + .then(function (res) { + return res.json(); + }).then(function (json) { + console.log(json); + }); +} diff --git a/form-data/form-data.d.ts b/form-data/form-data.d.ts index f3a19b16f7..e285d774af 100644 --- a/form-data/form-data.d.ts +++ b/form-data/form-data.d.ts @@ -1,16 +1,25 @@ // Type definitions for form-data // Project: https://github.com/felixge/node-form-data -// Definitions by: Carlos Ballesteros Velasco +// Definitions by: Carlos Ballesteros Velasco , Leon Yu // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // Imported from: https://github.com/soywiz/typescript-node-definitions/form-data.d.ts declare module "form-data" { - export class FormData { - append(key: string, value: any, options?: any): FormData; - getHeaders(): Object; - // TODO expand pipe - pipe(to: any): any; - submit(params: string|Object, callback: (error: any, response: any) => void): any; - } -} + class FormData { + append(key: string, value: any, options?: any): void; + getHeaders(): FormData.Dictionary; + // TODO expand pipe + pipe(to: any): any; + submit(params: string | Object, callback: (error: any, response: any) => void): any; + getBoundary(): string; + } + + namespace FormData { + interface Dictionary { + [key: string]: T; + } + } + + export = FormData; +} \ No newline at end of file diff --git a/freedom/freedom.d.ts b/freedom/freedom.d.ts index f1c7fca485..cc425dc733 100644 --- a/freedom/freedom.d.ts +++ b/freedom/freedom.d.ts @@ -1,4 +1,4 @@ -// Type definitions for freedom v0.6.26 +// Type definitions for freedom v0.6.29 // Project: https://github.com/freedomjs/freedom // Definitions by: Jonathan Pevarnek // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -423,6 +423,7 @@ declare namespace freedom.PgpProvider { clear(): Promise; exportKey(): Promise; getFingerprint(publicKey: string): Promise; + ecdhBob(curve: string, pubKey: string): Promise; signEncrypt(data: ArrayBuffer, encryptKey?: string, sign?: boolean): Promise; verifyDecrypt(data: ArrayBuffer, diff --git a/fs-extra/fs-extra-tests.ts b/fs-extra/fs-extra-tests.ts index c1785f851d..a31df8cfd7 100644 --- a/fs-extra/fs-extra-tests.ts +++ b/fs-extra/fs-extra-tests.ts @@ -2,50 +2,16 @@ /// import fs = require('fs-extra'); -import stream = require('stream'); -var stats: fs.Stats; -var str: string; -var strArr: string[]; -var bool: boolean; -var num: number; var src: string; var dest: string; var file: string; -var filename: string; var dir: string; var path: string; var data: any; var object: Object; -var buffer: NodeBuffer; -var modeNum: number; -var modeStr: string; -var encoding: string; -var type: string; -var flags: string; -var srcpath: string; -var dstpath: string; -var oldPath: string; -var newPath: string; -var cache: string; -var offset: number; -var length: number; -var position: number; -var cacheBool: boolean; -var cacheStr: string; -var fd: number; -var len: number; -var uid: number; -var gid: number; -var atime: number; -var mtime: number; -var statsCallback: (err: Error, stats: fs.Stats) => void; var errorCallback: (err: Error) => void; var openOpts: fs.OpenOptions; -var watcher: fs.FSWatcher; -var readStreeam: stream.Readable; -var writeStream: stream.Writable; -var outputStream: stream.Writable; fs.copy(src, dest, errorCallback); fs.copy(src, dest, (src: string) => { @@ -125,130 +91,6 @@ fs.writeJSON(file, object, openOpts, errorCallback); fs.writeJsonSync(file, object, openOpts); fs.writeJSONSync(file, object, openOpts); -fs.rename(oldPath, newPath, errorCallback); -fs.renameSync(oldPath, newPath); -fs.truncate(fd, len, errorCallback); -fs.truncateSync(fd, len); -fs.chown(path, uid, gid, errorCallback); -fs.chownSync(path, uid, gid); -fs.fchown(fd, uid, gid, errorCallback); -fs.fchownSync(fd, uid, gid); -fs.lchown(path, uid, gid, errorCallback); -fs.lchownSync(path, uid, gid); -fs.chmod(path, modeNum, errorCallback); -fs.chmod(path, modeStr, errorCallback); -fs.chmodSync(path, modeNum); -fs.chmodSync(path, modeStr); -fs.fchmod(fd, modeNum, errorCallback); -fs.fchmod(fd, modeStr, errorCallback); -fs.fchmodSync(fd, modeNum); -fs.fchmodSync(fd, modeStr); -fs.lchmod(path, modeStr, errorCallback); -fs.lchmod(path, modeNum, errorCallback); -fs.lchmodSync(path, modeNum); -fs.lchmodSync(path, modeStr); -fs.stat(path, statsCallback); -fs.lstat(path, statsCallback); -fs.fstat(fd, statsCallback); -stats = fs.statSync(path); -stats = fs.lstatSync(path); -stats = fs.fstatSync(fd); -fs.link(srcpath, dstpath, errorCallback); -fs.linkSync(srcpath, dstpath); -fs.symlink(srcpath, dstpath, type, errorCallback); -fs.symlinkSync(srcpath, dstpath, type); -fs.readlink(path, (err: Error, linkString: string) => { - -}); -fs.realpath(path, (err: Error, resolvedPath: string) => { - -}); -fs.realpath(path, cache, (err: Error, resolvedPath: string) => { - -}); -str = fs.realpathSync(path, cacheBool); -fs.unlink(path, errorCallback); -fs.unlinkSync(path); -fs.rmdir(path, errorCallback); -fs.rmdirSync(path); -fs.mkdir(path, modeNum, errorCallback); -fs.mkdir(path, modeStr, errorCallback); -fs.mkdirSync(path, modeNum); -fs.mkdirSync(path, modeStr); -fs.readdir(path, (err: Error, files: string[]) => { - -}); -strArr = fs.readdirSync(path); -fs.close(fd, errorCallback); -fs.closeSync(fd); -fs.open(path, flags, modeStr, (err: Error, fd: number) => { - -}); -num = fs.openSync(path, flags, modeStr); -fs.utimes(path, atime, mtime, errorCallback); -fs.utimesSync(path, atime, mtime); -fs.futimes(fd, atime, mtime, errorCallback); -fs.futimesSync(fd, atime, mtime); -fs.fsync(fd, errorCallback); -fs.fsyncSync(fd); -fs.write(fd, buffer, offset, length, position, (err: Error, written: number, buffer: NodeBuffer) => { - -}); -num = fs.writeSync(fd, buffer, offset, length, position); -fs.read(fd, buffer, offset, length, position, (err: Error, bytesRead: number, buffer: NodeBuffer) => { - -}); -num = fs.readSync(fd, buffer, offset, length, position); -fs.readFile(filename, (err: Error, data: NodeBuffer) => { - -}); -fs.readFile(filename, encoding, (err: Error, data: string) => { - -}); -fs.readFile(filename, openOpts, (err: Error, data: string) => { - -}); -fs.readFile(filename, (err: Error, data: NodeBuffer) => { - -}); -buffer = fs.readFileSync(filename); -str = fs.readFileSync(filename, encoding); -str = fs.readFileSync(filename, openOpts); - -fs.writeFile(filename, data, errorCallback); -fs.writeFile(filename, data, encoding, errorCallback); -fs.writeFile(filename, data, openOpts, errorCallback); -fs.writeFileSync(filename, data); -fs.writeFileSync(filename, data, encoding); -fs.writeFileSync(filename, data, openOpts); - -fs.appendFile(filename, data, errorCallback); -fs.appendFile(filename, data, encoding, errorCallback); -fs.appendFile(filename, data, openOpts, errorCallback); -fs.appendFileSync(filename, data); -fs.appendFileSync(filename, data, encoding); -fs.appendFileSync(filename, data, openOpts); - -fs.watchFile(filename, { - curr: stats, - prev: stats -}); -fs.watchFile(filename, { - persistent: bool, - interval: num -}, { - curr: stats, - prev: stats -}); -fs.unwatchFile(filename); -watcher = fs.watch(filename, { persistent: bool }, (event: string, filename: string) => { - -}); -fs.exists(path, (exists: boolean) => { - -}); -bool = fs.existsSync(path); - fs.ensureDir(path, errorCallback); fs.ensureDirSync(path); fs.ensureFile(path, errorCallback); @@ -259,24 +101,3 @@ fs.ensureSymlink(path, errorCallback); fs.ensureSymlinkSync(path); fs.emptyDir(path, errorCallback); fs.emptyDirSync(path); - -readStreeam = fs.createReadStream(path); -readStreeam = fs.createReadStream(path, { - flags: str, - encoding: str, - fd: num, - mode: num, - bufferSize: num -}); -writeStream = fs.createWriteStream(path); -writeStream = fs.createWriteStream(path, { - flags: str, - encoding: str, - string: str -}); -outputStream = fs.createOutputStream(path); -outputStream = fs.createOutputStream(path, { - flags: str, - encoding: str, - string: str -}); diff --git a/fs-extra/fs-extra.d.ts b/fs-extra/fs-extra.d.ts index b133047dec..39656ce685 100644 --- a/fs-extra/fs-extra.d.ts +++ b/fs-extra/fs-extra.d.ts @@ -8,39 +8,8 @@ /// declare module "fs-extra" { - import stream = require("stream"); + export * from "fs"; - export interface Stats { - isFile(): boolean; - isDirectory(): boolean; - isBlockDevice(): boolean; - isCharacterDevice(): boolean; - isSymbolicLink(): boolean; - isFIFO(): boolean; - isSocket(): boolean; - dev: number; - ino: number; - mode: number; - nlink: number; - uid: number; - gid: number; - rdev: number; - size: number; - blksize: number; - blocks: number; - atime: Date; - mtime: Date; - ctime: Date; - } - - export interface FSWatcher { - close(): void; - } - - export class ReadStream extends stream.Readable { } - export class WriteStream extends stream.Writable { } - - //extended methods export function copy(src: string, dest: string, callback?: (err: Error) => void): void; export function copy(src: string, dest: string, filter: CopyFilter, callback?: (err: Error) => void): void; export function copy(src: string, dest: string, options: CopyOptions, callback?: (err: Error) => void): void; @@ -77,8 +46,6 @@ declare module "fs-extra" { export function remove(dir: string, callback?: (err: Error) => void): void; export function removeSync(dir: string): void; - // export function delete(dir: string, callback?: (err: Error) => void): void; - // export function deleteSync(dir: string): void; export function writeJson(file: string, object: any, callback?: (err: Error) => void): void; export function writeJson(file: string, object: any, options?: OpenOptions, callback?: (err: Error) => void): void; @@ -88,98 +55,22 @@ declare module "fs-extra" { export function writeJsonSync(file: string, object: any, options?: OpenOptions): void; export function writeJSONSync(file: string, object: any, options?: OpenOptions): void; - export function rename(oldPath: string, newPath: string, callback?: (err: Error) => void): void; - export function renameSync(oldPath: string, newPath: string): void; - export function truncate(fd: number, len: number, callback?: (err: Error) => void): void; - export function truncateSync(fd: number, len: number): void; - export function chown(path: string, uid: number, gid: number, callback?: (err: Error) => void): void; - export function chownSync(path: string, uid: number, gid: number): void; - export function fchown(fd: number, uid: number, gid: number, callback?: (err: Error) => void): void; - export function fchownSync(fd: number, uid: number, gid: number): void; - export function lchown(path: string, uid: number, gid: number, callback?: (err: Error) => void): void; - export function lchownSync(path: string, uid: number, gid: number): void; - export function chmod(path: string, mode: number, callback?: (err: Error) => void): void; - export function chmod(path: string, mode: string, callback?: (err: Error) => void): void; - export function chmodSync(path: string, mode: number): void; - export function chmodSync(path: string, mode: string): void; - export function fchmod(fd: number, mode: number, callback?: (err: Error) => void): void; - export function fchmod(fd: number, mode: string, callback?: (err: Error) => void): void; - export function fchmodSync(fd: number, mode: number): void; - export function fchmodSync(fd: number, mode: string): void; - export function lchmod(path: string, mode: string, callback?: (err: Error) => void): void; - export function lchmod(path: string, mode: number, callback?: (err: Error) => void): void; - export function lchmodSync(path: string, mode: number): void; - export function lchmodSync(path: string, mode: string): void; - export function stat(path: string, callback?: (err: Error, stats: Stats) => void): void; - export function lstat(path: string, callback?: (err: Error, stats: Stats) => void): void; - export function fstat(fd: number, callback?: (err: Error, stats: Stats) => void): void; - export function statSync(path: string): Stats; - export function lstatSync(path: string): Stats; - export function fstatSync(fd: number): Stats; - export function link(srcpath: string, dstpath: string, callback?: (err: Error) => void): void; - export function linkSync(srcpath: string, dstpath: string): void; - export function symlink(srcpath: string, dstpath: string, type?: string, callback?: (err: Error) => void): void; - export function symlinkSync(srcpath: string, dstpath: string, type?: string): void; - export function readlink(path: string, callback?: (err: Error, linkString: string) => void): void; - export function realpath(path: string, callback?: (err: Error, resolvedPath: string) => void): void; - export function realpath(path: string, cache: string, callback: (err: Error, resolvedPath: string) => void): void; - export function realpathSync(path: string, cache?: boolean): string; - export function unlink(path: string, callback?: (err: Error) => void): void; - export function unlinkSync(path: string): void; - export function rmdir(path: string, callback?: (err: Error) => void): void; - export function rmdirSync(path: string): void; - export function mkdir(path: string, mode?: number, callback?: (err: Error) => void): void; - export function mkdir(path: string, mode?: string, callback?: (err: Error) => void): void; - export function mkdirSync(path: string, mode?: number): void; - export function mkdirSync(path: string, mode?: string): void; - export function readdir(path: string, callback?: (err: Error, files: string[]) => void ): void; - export function readdirSync(path: string): string[]; - export function close(fd: number, callback?: (err: Error) => void): void; - export function closeSync(fd: number): void; - export function open(path: string, flags: string, mode?: string, callback?: (err: Error, fs: number) => void): void; - export function openSync(path: string, flags: string, mode?: string): number; - export function utimes(path: string, atime: number, mtime: number, callback?: (err: Error) => void): void; - export function utimesSync(path: string, atime: number, mtime: number): void; - export function futimes(fd: number, atime: number, mtime: number, callback?: (err: Error) => void): void; - export function futimesSync(fd: number, atime: number, mtime: number): void; - export function fsync(fd: number, callback?: (err: Error) => void): void; - export function fsyncSync(fd: number): void; - export function write(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number, callback?: (err: Error, written: number, buffer: NodeBuffer) => void): void; - export function writeSync(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number): number; - export function read(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number, callback?: (err: Error, bytesRead: number, buffer: NodeBuffer) => void ): void; - export function readSync(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number): number; - export function readFile(filename: string, encoding: string, callback: (err: Error, data: string) => void ): void; - export function readFile(filename: string, options: OpenOptions, callback: (err: Error, data: string) => void ): void; - export function readFile(filename: string, callback: (err: Error, data: NodeBuffer) => void ): void; - export function readFileSync(filename: string): NodeBuffer; - export function readFileSync(filename: string, encoding: string): string; - export function readFileSync(filename: string, options: OpenOptions): string; - export function writeFile(filename: string, data: any, encoding?: string, callback?: (err: Error) => void): void; - export function writeFile(filename: string, data: any, options?: OpenOptions, callback?: (err: Error) => void): void; - export function writeFileSync(filename: string, data: any, encoding?: string): void; - export function writeFileSync(filename: string, data: any, option?: OpenOptions): void; - export function appendFile(filename: string, data: any, encoding?: string, callback?: (err: Error) => void): void; - export function appendFile(filename: string, data: any,option?: OpenOptions, callback?: (err: Error) => void): void; - export function appendFileSync(filename: string, data: any, encoding?: string): void; - export function appendFileSync(filename: string, data: any, option?: OpenOptions): void; - export function watchFile(filename: string, listener: { curr: Stats; prev: Stats; }): void; - export function watchFile(filename: string, options: { persistent?: boolean; interval?: number; }, listener: { curr: Stats; prev: Stats; }): void; - export function unwatchFile(filename: string, listener?: Stats): void; - export function watch(filename: string, options?: { persistent?: boolean; }, listener?: (event: string, filename: string) => any): FSWatcher; - export function exists(path: string, callback?: (exists: boolean) => void ): void; - export function existsSync(path: string): boolean; export function ensureDir(path: string, cb: (err: Error) => void): void; export function ensureDirSync(path: string): void; + export function ensureFile(path: string, cb: (err: Error) => void): void; export function ensureFileSync(path: string): void; + export function ensureLink(path: string, cb: (err: Error) => void): void; export function ensureLinkSync(path: string): void; + export function ensureSymlink(path: string, cb: (err: Error) => void): void; export function ensureSymlinkSync(path: string): void; + export function emptyDir(path: string, callback?: (err: Error) => void): void; export function emptyDirSync(path: string): boolean; - export interface CopyFilterFunction { + export interface CopyFilterFunction { (src: string): boolean } @@ -188,6 +79,7 @@ declare module "fs-extra" { export interface CopyOptions { clobber?: boolean preserveTimestamps?: boolean + dereference?: boolean filter?: CopyFilter } @@ -200,20 +92,4 @@ declare module "fs-extra" { fs?: any; mode?: number; } - - export interface ReadStreamOptions { - flags?: string; - encoding?: string; - fd?: number; - mode?: number; - bufferSize?: number; - } - export interface WriteStreamOptions { - flags?: string; - encoding?: string; - string?: string; - } - export function createReadStream(path: string, options?: ReadStreamOptions): ReadStream; - export function createWriteStream(path: string, options?: WriteStreamOptions): WriteStream; - export function createOutputStream(path: string, options?: WriteStreamOptions): WriteStream; } diff --git a/fullCalendar/fullCalendar-tests.ts b/fullCalendar/fullCalendar-tests.ts index a961512074..516111e6b7 100644 --- a/fullCalendar/fullCalendar-tests.ts +++ b/fullCalendar/fullCalendar-tests.ts @@ -599,17 +599,17 @@ $('#calendar').fullCalendar({ }); $('#calendar').fullCalendar({ - events: function (start, end, callback) { + events: function (start: moment.Moment, end: moment.Moment, timezone: string | boolean, callback: (events: FullCalendar.EventObject[]) => void) { $.ajax({ url: 'myxmlfeed.php', dataType: 'xml', data: { // our hypothetical feed requires UNIX timestamps - start: Math.round(start.getTime() / 1000), - end: Math.round(end.getTime() / 1000) + start: Math.round(start.toDate().getTime() / 1000), + end: Math.round(end.toDate().getTime() / 1000) }, success: function (doc) { - var events = []; + var events: any[] = []; $(doc).find('event').each(function () { events.push({ title: $(this).attr('title'), @@ -628,7 +628,7 @@ $('#calendar').fullCalendar({ // your event source { - events: function (start, end, callback) { + events: function (start: moment.Moment, end: moment.Moment, timezone: string | boolean, callback: (events: FullCalendar.EventObject[]) => void) { // ... }, color: 'yellow', // an option! @@ -681,7 +681,7 @@ $('#calendar').fullCalendar({ } // more events here ], - eventRender: function (event: EventWithDescription, element) { + eventRender: function (event: EventWithDescription, element: any, view: any) { element.qtip({ content: event.description }); diff --git a/fullCalendar/fullCalendar.d.ts b/fullCalendar/fullCalendar.d.ts index eb578e0a69..65df012185 100644 --- a/fullCalendar/fullCalendar.d.ts +++ b/fullCalendar/fullCalendar.d.ts @@ -1,5 +1,5 @@ -// Type definitions for FullCalendar 1.6.1 -// Project: http://arshaw.com/fullcalendar/ +// Type definitions for FullCalendar 2.7.2 +// Project: http://fullcalendar.io/ // Definitions by: Neil Stalker , Marcelo Camargo // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -8,27 +8,6 @@ declare namespace FullCalendar { export interface Calendar { - - /** - * Formats a Date object into a string. - */ - formatDate(date: Date, format: string, options?: Options): string; - - /** - * Formats a date range (two Date objects) into a string. - */ - formatDates(date1: Date, date2: Date, format: string, options?: Options): string; - - /** - * Parses a string into a Date object. - */ - parseDate(dateString: string, ignoreTimezone?: boolean): Date; - - /** - * Parses an ISO8601 string into a Date object. - */ - parseISO8601(dateString: string, ignoreTimezone?: boolean): Date; - /** * Gets the version of Fullcalendar */ @@ -47,8 +26,7 @@ declare namespace FullCalendar { } export interface Options extends AgendaOptions, EventDraggingResizingOptions, DroppingExternalElementsOptions, SelectionOptions { - - // General display - http://arshaw.com/fullcalendar/docs/display/ + // General display - http://fullcalendar.io/docs/display/ header?: { left: string; @@ -72,6 +50,7 @@ declare namespace FullCalendar { contentHeight?: number; aspectRatio?: number; handleWindowResize?: boolean; + views?: ViewSpecificOptions; viewRender?: (view: ViewObject, element: JQuery) => void; viewDestroy?: (view: ViewObject, element: JQuery) => void; dayRender?: (date: Date, cell: HTMLTableDataCellElement) => void; @@ -81,22 +60,22 @@ declare namespace FullCalendar { timezone?: string | boolean; now?: moment.Moment | Date | string | (() => moment.Moment) - // Views - http://arshaw.com/fullcalendar/docs/views/ + // Views - http://fullcalendar.io/docs/views/ defaultView?: string; - // Current Date - http://arshaw.com/fullcalendar/docs/current_date/ + // Current Date - http://fullcalendar.io/docs/current_date/ defaultDate?: moment.Moment | Date | string; year?: number; month?: number; date?: number; - // Text/Time Customization - http://arshaw.com/fullcalendar/docs/text/ + // Text/Time Customization - http://fullcalendar.io/docs/text/ - timeFormat?: any; // String/ViewOptionHash - columnFormat?: any; // String/ViewOptionHash - titleFormat?: any; // String/ViewOptionHash + timeFormat?: any; // String + columnFormat?: any; // String + titleFormat?: any; // String buttonText?: ButtonTextObject; monthNames?: Array; @@ -105,21 +84,21 @@ declare namespace FullCalendar { dayNamesShort?: Array; weekNumberTitle?: string; - // Clicking & Hovering - http://arshaw.com/fullcalendar/docs/mouse/ + // Clicking & Hovering - http://fullcalendar.io/docs/mouse/ dayClick?: (date: Date, allDay: boolean, jsEvent: MouseEvent, view: ViewObject) => void; eventClick?: (event: EventObject, jsEvent: MouseEvent, view: ViewObject) => any; // return type boolean or void eventMouseover?: (event: EventObject, jsEvent: MouseEvent, view: ViewObject) => void; eventMouseout?: (event: EventObject, jsEvent: MouseEvent, view: ViewObject) => void; - // Event Data - http://arshaw.com/fullcalendar/docs/event_data/ + // Event Data - http://fullcalendar.io/docs/event_data/ /** * This has one of the following types: * * - EventObject[] * - string (JSON feed) - * - (start: Date | string, end: Date | string, callback: {(events: EventObject[]) => void;}) => void; + * - (start: moment.Moment, end: moment.Moment, timezone: string | boolean, callback: {(events: EventObject[]) => void;}) => void; */ events?: any; @@ -129,19 +108,18 @@ declare namespace FullCalendar { * - EventSource * - EventObject[] * - string (JSON feed) - * - (start: Date | string, end: Date | string, callback: {(events: EventObject[]) => void;}) => void; + * - (start: moment.Moment, end: moment.Moment, timezone: string | boolean, callback: {(events: EventObject[]) => void;}) => void; */ eventSources?: any[]; allDayDefault?: boolean; - ignoreTimezone?: boolean; startParam?: string; endParam?: string lazyFetching?: boolean; eventDataTransform?: (eventData: any) => EventObject; loading?: (isLoading: boolean, view: ViewObject) => void; - // Event Rendering - http://arshaw.com/fullcalendar/docs/event_rendering/ + // Event Rendering - http://fullcalendar.io/docs/event_rendering/ eventColor?: string; eventBackgroundColor?: string; @@ -151,25 +129,10 @@ declare namespace FullCalendar { eventAfterRender?: (event: EventObject, element: HTMLDivElement, view: ViewObject) => void; eventAfterAllRender?: (view: ViewObject) => void; eventDestroy?: (event: EventObject, element: JQuery, view: ViewObject) => void; - - - } - - export interface ViewOptionHash { - month?: any; - week?: any; - day?: any; - agenda?: any; - agendaDay?: any; - agendaWeek?: any; - basic?: any; - basicDay?: any; - basicWeek?: any; - ''?: any; } /** - * Agenda Options - http://arshaw.com/fullcalendar/docs/agenda/ + * Agenda Options - http://fullcalendar.io/docs/agenda/ */ export interface AgendaOptions { allDaySlot?: boolean; @@ -204,7 +167,7 @@ declare namespace FullCalendar { eventResize?: (event: EventObject, delta: moment.Duration, revertFunc: Function, jsEvent: Event, ui: any, view: ViewObject) => void; } /* - * Selection - http://arshaw.com/fullcalendar/docs/selection/ + * Selection - http://fullcalendar.io/docs/selection/ */ export interface SelectionOptions { selectable?: boolean; @@ -258,13 +221,12 @@ declare namespace FullCalendar { } export interface EventSource extends JQueryAjaxSettings { - /** * This has one of the following types: * * - EventObject[] * - string (JSON feed) - * - (start: Date | string, end: Date | string, callback: {(events: EventObject[]) => void;}) => void; + * - (start: moment.Moment, end: moment.Moment, timezone: string | boolean, callback: {(events: EventObject[]) => void;}) => void; */ events?: any; @@ -281,10 +243,23 @@ declare namespace FullCalendar { endParam?: string } + /* + * View Specific Options - http://fullcalendar.io/docs/views/View-Specific-Options/ + */ + export interface ViewSpecificOptions { + basic?: Options; + agenda?: Options; + week?: Options; + day?: Options; + month?: Options; + basicWeek?: Options; + basicDay?: Options; + agendaWeek?: Options; + agendaDay?: Options; + } } interface JQuery { - /** * Get/Set option value */ @@ -428,4 +403,4 @@ interface JQuery { interface JQueryStatic { fullCalendar: FullCalendar.Calendar; -} +} \ No newline at end of file diff --git a/fullCalendar/v1/fullCalendar-tests.ts b/fullCalendar/v1/fullCalendar-tests.ts new file mode 100644 index 0000000000..8898649974 --- /dev/null +++ b/fullCalendar/v1/fullCalendar-tests.ts @@ -0,0 +1,836 @@ +/// +/// +/// + +// All examples from http://arshaw.com/fullcalendar/docs/ + +$('#calendar').fullCalendar({}); + +$('#calendar').fullCalendar({ + weekends: false +}); + +$('#calendar').fullCalendar({ + dayClick: function () { + alert('a day has been clicked!'); + } +}); + +$('#calendar').fullCalendar('next'); + +$('#calendar').fullCalendar({ + events: 'http://www.google.com/your_feed_url/' +}); + +$('#calendar').fullCalendar({ + events: { + url: 'http://www.google.com/your_feed_url/', + className: 'gcal-event', // an option! + currentTimezone: 'America/Chicago' // an option! + } +}); + +$('#calendar').fullCalendar({ + eventSources: [ + + // source with no options + "http://www.google.com/your_feed_url1/", + + // source with no options + "http://www.google.com/your_feed_url2/", + + // source WITH options + { + url: "http://www.google.com/your_feed_url3/", + className: 'nice-event' + } + ] +}); + +$('#calendar').fullCalendar({ + height: 650 +}); + +$('#calendar').fullCalendar('option', 'height', 700); + +$('#calendar').fullCalendar({ + contentHeight: 600 +}); + +$('#calendar').fullCalendar('option', 'contentHeight', 650); + +$('#calendar').fullCalendar({ + aspectRatio: 2 +}); + +$('#calendar').fullCalendar('option', 'aspectRatio', 1.8); + +$('#calendar').fullCalendar({ + viewRender: function (view) { + alert('The new title of the view is ' + view.title); + } +}); + +$('#calendar').fullCalendar({ + windowResize: function (view) { + alert('The calendar has adjusted to a window resize'); + } +}); + +$('#calendar').fullCalendar('render'); + +$('#calendar').fullCalendar({ + dragOpacity: .5 +}); + +var view = $('#calendar').fullCalendar('getView'); +alert("The view's title is " + view.title); + +$(document).ready(function () { + + var date = new Date(); + var d = date.getDate(); + var m = date.getMonth(); + var y = date.getFullYear(); + + $('#calendar').fullCalendar({ + header: { + left: 'prev,next today', + center: 'title', + right: 'month,basicWeek,basicDay' + }, + editable: true, + events: [ + { + title: 'All Day Event', + start: new Date(y, m, 1) + }, + { + title: 'Long Event', + start: new Date(y, m, d - 5), + end: new Date(y, m, d - 2) + }, + { + id: 999, + title: 'Repeating Event', + start: new Date(y, m, d - 3, 16, 0), + allDay: false + }, + { + id: 999, + title: 'Repeating Event', + start: new Date(y, m, d + 4, 16, 0), + allDay: false + }, + { + title: 'Meeting', + start: new Date(y, m, d, 10, 30), + allDay: false + }, + { + title: 'Lunch', + start: new Date(y, m, d, 12, 0), + end: new Date(y, m, d, 14, 0), + allDay: false + }, + { + title: 'Birthday Party', + start: new Date(y, m, d + 1, 19, 0), + end: new Date(y, m, d + 1, 22, 30), + allDay: false + }, + { + title: 'Click for Google', + start: new Date(y, m, 28), + end: new Date(y, m, 29), + url: 'http://google.com/' + } + ] + }); + +}); + +$(document).ready(function () { + + var date = new Date(); + var d = date.getDate(); + var m = date.getMonth(); + var y = date.getFullYear(); + + $('#calendar').fullCalendar({ + header: { + left: 'prev,next today', + center: 'title', + right: 'month,basicWeek,basicDay' + }, + defaultView: 'basicWeek', + editable: true, + events: [ + { + title: 'All Day Event', + start: new Date(y, m, 1) + }, + { + title: 'Long Event', + start: new Date(y, m, d - 5), + end: new Date(y, m, d - 2) + }, + { + id: 999, + title: 'Repeating Event', + start: new Date(y, m, d - 3, 16, 0), + allDay: false + }, + { + id: 999, + title: 'Repeating Event', + start: new Date(y, m, d + 4, 16, 0), + allDay: false + }, + { + title: 'Meeting', + start: new Date(y, m, d, 10, 30), + allDay: false + }, + { + title: 'Lunch', + start: new Date(y, m, d, 12, 0), + end: new Date(y, m, d, 14, 0), + allDay: false + }, + { + title: 'Birthday Party', + start: new Date(y, m, d + 1, 19, 0), + end: new Date(y, m, d + 1, 22, 30), + allDay: false + }, + { + title: 'Click for Google', + start: new Date(y, m, 28), + end: new Date(y, m, 29), + url: 'http://google.com/' + } + ] + }); + +}); + +$(document).ready(function () { + + var date = new Date(); + var d = date.getDate(); + var m = date.getMonth(); + var y = date.getFullYear(); + + $('#calendar').fullCalendar({ + header: { + left: 'prev,next today', + center: 'title', + right: 'month,basicWeek,basicDay' + }, + defaultView: 'basicDay', + editable: true, + events: [ + { + id: 1, + title: "Long Event", + start: new Date(y, m, d, 14, 0), + end: new Date(y, m, d + 3), + allDay: false + }, + { + id: 2, + title: "Repeating Event", + start: new Date(y, m, d - 1), + allDay: true + }, + { + id: 2, + title: "Repeating Event", + start: new Date(y, m, d + 6), + allDay: true + }, + { + id: 3, + title: "Meeting", + start: new Date(y, m, d, 9, 0), + allDay: false + }, + { + id: 4, + title: "Click for Facebook", + start: new Date(y, m, d, 16), + end: new Date(y, m, d), + url: "http://facebook.com/", + allDay: false + } + ] + }); + +}); + +$(document).ready(function () { + + var date = new Date(); + var d = date.getDate(); + var m = date.getMonth(); + var y = date.getFullYear(); + + $('#calendar').fullCalendar({ + editable: true, + header: { + left: 'prev,next today', + center: 'title', + right: 'month,agendaWeek,agendaDay' + }, + defaultView: 'agendaWeek', + events: [ + { + title: 'All Day Event', + start: new Date(y, m, 1) + }, + { + title: 'Long Event', + start: new Date(y, m, d - 5), + end: new Date(y, m, d - 2) + }, + { + id: 999, + title: 'Repeating Event', + start: new Date(y, m, d - 3, 16, 0), + allDay: false + }, + { + id: 999, + title: 'Repeating Event', + start: new Date(y, m, d + 4, 16, 0), + allDay: false + }, + { + title: 'Meeting', + start: new Date(y, m, d, 10, 30), + allDay: false + }, + { + title: 'Lunch', + start: new Date(y, m, d, 12, 0), + end: new Date(y, m, d, 14, 0), + allDay: false + }, + { + title: 'Birthday Party', + start: new Date(y, m, d + 1, 19, 0), + end: new Date(y, m, d + 1, 22, 30), + allDay: false + }, + { + title: 'Click for Google', + start: new Date(y, m, 28), + end: new Date(y, m, 29), + url: 'http://google.com/' + } + ] + }); + +}); + +$(document).ready(function () { + + var date = new Date(); + var d = date.getDate(); + var m = date.getMonth(); + var y = date.getFullYear(); + + $('#calendar').fullCalendar({ + header: { + left: 'prev,next today', + center: 'title', + right: 'month,agendaWeek,agendaDay' + }, + defaultView: 'agendaDay', + editable: true, + events: [ + { + id: 1, + title: "Long Event", + start: new Date(y, m, d), + end: new Date(y, m, d + 3), + allDay: true + }, + { + id: 2, + title: "Repeating Event", + start: new Date(y, m, d - 1), + allDay: true + }, + { + id: 2, + title: "Repeating Event", + start: new Date(y, m, d + 6), + allDay: true + }, + { + id: 3, + title: "Meeting", + start: new Date(y, m, d, 10, 0), + allDay: false + }, + { + id: 4, + title: "Click for Facebook", + start: new Date(y, m, d, 11, 30), + end: new Date(y, m, d), + url: "http://facebook.com/", + allDay: false + } + ] + }); + +}); + +$('#my-prev-button').click(function () { + $('#calendar').fullCalendar('prev'); +}); + +$('#my-next-button').click(function () { + $('#calendar').fullCalendar('next'); +}); + +$('#my-today-button').click(function () { + $('#calendar').fullCalendar('today'); +}); + +$('#calendar').fullCalendar('gotoDate', 1, 0, 1); + +$('#my-button').click(function () { + var d = $('#calendar').fullCalendar('getDate'); + alert("The current date of the calendar is " + d); +}); + +$('#calendar').fullCalendar({ + events: [ + { + title: 'My Event', + start: '2010-01-01T14:30:00', + allDay: false + } + // other events here... + ], + timeFormat: 'H(:mm)' // uppercase H for 24-hour clock +}); + +$('#calendar').fullCalendar({ + buttonText: { + prev: '<', + next: '>' + } +}); + +$('#calendar').fullCalendar({ + dayClick: function (date, allDay, jsEvent, view) { + + if (allDay) { + alert('Clicked on the entire day: ' + date); + } else { + alert('Clicked on the slot: ' + date); + } + + alert('Coordinates: ' + jsEvent.pageX + ',' + jsEvent.pageY); + + alert('Current view: ' + view.name); + + // change the day's background color just for fun + $(this).css('background-color', 'red'); + + } +}); + +$('#calendar').fullCalendar({ + eventClick: function (calEvent, jsEvent, view) { + + alert('Event: ' + calEvent.title); + alert('Coordinates: ' + jsEvent.pageX + ',' + jsEvent.pageY); + alert('View: ' + view.name); + + // change the border color just for fun + $(this).css('border-color', 'red'); + + } +}); + +$('#calendar').fullCalendar({ + events: [ + { + title: 'My Event', + start: '2010-01-01', + url: 'http://google.com/' + } + // other events here + ], + eventClick: function (event) { + if (event.url) { + window.open(event.url); + return false; + } + } +}); + +$('#calendar').fullCalendar({ + + eventSources: [ + + // your event source + { + url: '/myfeed.php', + type: 'POST', + data: { + custom_param1: 'something', + custom_param2: 'somethingelse' + }, + error: function () { + alert('there was an error while fetching events!'); + }, + color: 'yellow', // a non-ajax option + textColor: 'black' // a non-ajax option + } + + // any other sources... + + ] + +}); + +$('#calendar').fullCalendar({ + + events: { + url: '/myfeed.php', + type: 'POST', + data: { + custom_param1: 'something', + custom_param2: 'somethingelse' + }, + error: function () { + alert('there was an error while fetching events!'); + }, + color: 'yellow', // a non-ajax option + textColor: 'black' // a non-ajax option + } + +}); + +$('#calendar').fullCalendar({ + + events: { + url: '/myfeed.php', + cache: true + } + +}); + +$('#calendar').fullCalendar({ + + eventSources: [ + + // your event source + { + url: '/myfeed.php', // use the `url` property + color: 'yellow', // an option! + textColor: 'black' // an option! + } + + // any other sources... + + ] + +}); + +$('#calendar').fullCalendar({ + events: '/myfeed.php' +}); + +$('#calendar').fullCalendar({ + events: [ + { + title: 'event1', + start: '2010-01-01' + }, + { + title: 'event2', + start: '2010-01-05', + end: '2010-01-07' + }, + { + title: 'event3', + start: '2010-01-09 12:30:00', + allDay: false // will make the time show + } + ] +}); + +$('#calendar').fullCalendar({ + + eventSources: [ + + // your event source + { + events: [ // put the array in the `events` property + { + title: 'event1', + start: '2010-01-01' + }, + { + title: 'event2', + start: '2010-01-05', + end: '2010-01-07' + }, + { + title: 'event3', + start: '2010-01-09 12:30:00', + } + ], + color: 'black', // an option! + textColor: 'yellow' // an option! + } + + // any other event sources... + + ] + +}); + +$('#calendar').fullCalendar({ + events: function (start: any, end: any, callback: any) { + $.ajax({ + url: 'myxmlfeed.php', + dataType: 'xml', + data: { + // our hypothetical feed requires UNIX timestamps + start: Math.round(start.getTime() / 1000), + end: Math.round(end.getTime() / 1000) + }, + success: function (doc) { + var events: any[] = []; + $(doc).find('event').each(function () { + events.push({ + title: $(this).attr('title'), + start: $(this).attr('start') // will be parsed + }); + }); + callback(events); + } + }); + } +}); + +$('#calendar').fullCalendar({ + + eventSources: [ + + // your event source + { + events: function (start: any, end: any, callback: any) { + // ... + }, + color: 'yellow', // an option! + textColor: 'black' // an option! + } + + // any other sources... + + ] + +}); + +$('#calendar').fullCalendar({ + eventSources: [ + '/feed1.php', + '/feed2.php' + ] +}); + +$('#calendar').fullCalendar({ + eventClick: function (event, element) { + + event.title = "CLICKED!"; + + $('#calendar').fullCalendar('updateEvent', event); + + } +}); + +$('#calendar').fullCalendar({ + events: [ + // my event data + ], + eventColor: '#378006' +}); + +interface EventWithDescription extends FullCalendar.EventObject { + description: string; +} +interface JQuery { + qtip: any; // dummy plugin interface +} + +$('#calendar').fullCalendar({ + events: [ + { + title: 'My Event', + start: '2010-01-01', + description: 'This is a cool event' + } + // more events here + ], + eventRender: function (event: EventWithDescription, element: any) { + element.qtip({ + content: event.description + }); + } +}); +$('#my-draggable').draggable({ + revert: true, // immediately snap back to original position + revertDuration: 0 // +}); + +$('#calendar').fullCalendar({ + droppable: true, + drop: function (date, allDay) { + alert("Dropped on " + date + " with allDay=" + allDay); + } +}); + +$('#calendar').fullCalendar({ + droppable: true, + dropAccept: '.cool-event', + drop: function () { + alert('dropped!'); + } +}); + +$('#draggable1').draggable(); +$('#draggable2').draggable(); + +$(document).ready(function () { + + var date = new Date(); + var d = date.getDate(); + var m = date.getMonth(); + var y = date.getFullYear(); + + $('#calendar').fullCalendar({ + theme: true, + header: { + left: 'prev,next today', + center: 'title', + right: 'month,agendaWeek,agendaDay' + }, + editable: true, + events: [ + { + title: 'All Day Event', + start: new Date(y, m, 1) + }, + { + title: 'Long Event', + start: new Date(y, m, d - 5), + end: new Date(y, m, d - 2) + }, + { + id: 999, + title: 'Repeating Event', + start: new Date(y, m, d - 3, 16, 0), + allDay: false + }, + { + id: 999, + title: 'Repeating Event', + start: new Date(y, m, d + 4, 16, 0), + allDay: false + }, + { + title: 'Meeting', + start: new Date(y, m, d, 10, 30), + allDay: false + }, + { + title: 'Lunch', + start: new Date(y, m, d, 12, 0), + end: new Date(y, m, d, 14, 0), + allDay: false + }, + { + title: 'Birthday Party', + start: new Date(y, m, d + 1, 19, 0), + end: new Date(y, m, d + 1, 22, 30), + allDay: false + }, + { + title: 'Click for Google', + start: new Date(y, m, 28), + end: new Date(y, m, 29), + url: 'http://google.com/' + } + ] + }); + +}); + +$(document).ready(function () { + /* initialize the external events + -----------------------------------------------------------------*/ + $('#external-events div.external-event').each(function () { + + // create an Event Object (http://arshaw.com/fullcalendar/docs/event_data/Event_Object/) + // it doesn't need to have a start or end + var eventObject = { + title: $.trim($(this).text()) // use the element's text as the event title + }; + + // store the Event Object in the DOM element so we can get to it later + $(this).data('eventObject', eventObject); + + // make the event draggable using jQuery UI + $(this).draggable({ + zIndex: 999, + revert: true, // will cause the event to go back to its + revertDuration: 0 // original position after the drag + }); + + }); + /* initialize the calendar + -----------------------------------------------------------------*/ + + $('#calendar').fullCalendar({ + header: { + left: 'prev,next today', + center: 'title', + right: 'month,agendaWeek,agendaDay' + }, + editable: true, + droppable: true, // this allows things to be dropped onto the calendar !!! + drop: function (date, allDay) { // this function is called when something is dropped + + // retrieve the dropped element's stored Event Object + var originalEventObject = $(this).data('eventObject'); + + // we need to copy it, so that multiple events don't have a reference to the same object + var copiedEventObject: any = $.extend({}, originalEventObject); + + // assign it the date that was reported + copiedEventObject.start = date; + copiedEventObject.allDay = allDay; + + // render the event on the calendar + // the last `true` argument determines if the event "sticks" (http://arshaw.com/fullcalendar/docs/event_rendering/renderEvent/) + $('#calendar').fullCalendar('renderEvent', copiedEventObject, true); + + // is the "remove after drop" checkbox checked? + if ($('#drop-remove').is(':checked')) { + // if so, remove the element from the "Draggable Events" list + $(this).remove(); + } + } + }); +}); + +$('#calendar').fullCalendar('refetchEvents'); diff --git a/fullCalendar/v1/fullCalendar.d.ts b/fullCalendar/v1/fullCalendar.d.ts new file mode 100644 index 0000000000..b5ed783796 --- /dev/null +++ b/fullCalendar/v1/fullCalendar.d.ts @@ -0,0 +1,431 @@ +// Type definitions for FullCalendar 1.6.1 +// Project: http://arshaw.com/fullcalendar/ +// Definitions by: Neil Stalker , Marcelo Camargo +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// + +declare namespace FullCalendar { + export interface Calendar { + + /** + * Formats a Date object into a string. + */ + formatDate(date: Date, format: string, options?: Options): string; + + /** + * Formats a date range (two Date objects) into a string. + */ + formatDates(date1: Date, date2: Date, format: string, options?: Options): string; + + /** + * Parses a string into a Date object. + */ + parseDate(dateString: string, ignoreTimezone?: boolean): Date; + + /** + * Parses an ISO8601 string into a Date object. + */ + parseISO8601(dateString: string, ignoreTimezone?: boolean): Date; + + /** + * Gets the version of Fullcalendar + */ + version: string; + } + + export interface BusinessHours { + start: moment.Duration; + end: moment.Duration; + dow: Array; + } + + export interface Timespan { + start: moment.Moment; + end: moment.Moment; + } + + export interface Options extends AgendaOptions, EventDraggingResizingOptions, DroppingExternalElementsOptions, SelectionOptions { + + // General display - http://arshaw.com/fullcalendar/docs/display/ + + header?: { + left: string; + center: string; + right: string; + } + theme?: boolean + buttonIcons?: { + prev: string; + next: string; + } + firstDay?: number; + isRTL?: boolean; + weekends?: boolean; + hiddenDays?: number[]; + weekMode?: string; + weekNumbers?: boolean; + weekNumberCalculation?: any; // String/Function + businessHours?: boolean | BusinessHours; + height?: number; + contentHeight?: number; + aspectRatio?: number; + handleWindowResize?: boolean; + viewRender?: (view: ViewObject, element: JQuery) => void; + viewDestroy?: (view: ViewObject, element: JQuery) => void; + dayRender?: (date: Date, cell: HTMLTableDataCellElement) => void; + windowResize?: (view: ViewObject) => void; + + // Timezone + timezone?: string | boolean; + now?: moment.Moment | Date | string | (() => moment.Moment) + + // Views - http://arshaw.com/fullcalendar/docs/views/ + + defaultView?: string; + + // Current Date - http://arshaw.com/fullcalendar/docs/current_date/ + + defaultDate?: moment.Moment | Date | string; + year?: number; + month?: number; + date?: number; + + // Text/Time Customization - http://arshaw.com/fullcalendar/docs/text/ + + timeFormat?: any; // String/ViewOptionHash + columnFormat?: any; // String/ViewOptionHash + titleFormat?: any; // String/ViewOptionHash + + buttonText?: ButtonTextObject; + monthNames?: Array; + monthNamesShort?: Array; + dayNames?: Array; + dayNamesShort?: Array; + weekNumberTitle?: string; + + // Clicking & Hovering - http://arshaw.com/fullcalendar/docs/mouse/ + + dayClick?: (date: Date, allDay: boolean, jsEvent: MouseEvent, view: ViewObject) => void; + eventClick?: (event: EventObject, jsEvent: MouseEvent, view: ViewObject) => any; // return type boolean or void + eventMouseover?: (event: EventObject, jsEvent: MouseEvent, view: ViewObject) => void; + eventMouseout?: (event: EventObject, jsEvent: MouseEvent, view: ViewObject) => void; + + // Event Data - http://arshaw.com/fullcalendar/docs/event_data/ + + /** + * This has one of the following types: + * + * - EventObject[] + * - string (JSON feed) + * - (start: Date | string, end: Date | string, callback: {(events: EventObject[]) => void;}) => void; + */ + events?: any; + + /** + * An array, each element being one of the following types: + * + * - EventSource + * - EventObject[] + * - string (JSON feed) + * - (start: Date | string, end: Date | string, callback: {(events: EventObject[]) => void;}) => void; + */ + eventSources?: any[]; + + allDayDefault?: boolean; + ignoreTimezone?: boolean; + startParam?: string; + endParam?: string + lazyFetching?: boolean; + eventDataTransform?: (eventData: any) => EventObject; + loading?: (isLoading: boolean, view: ViewObject) => void; + + // Event Rendering - http://arshaw.com/fullcalendar/docs/event_rendering/ + + eventColor?: string; + eventBackgroundColor?: string; + eventBorderColor?: string; + eventTextColor?: string; + eventRender?: (event: EventObject, element: HTMLDivElement, view: ViewObject) => void; + eventAfterRender?: (event: EventObject, element: HTMLDivElement, view: ViewObject) => void; + eventAfterAllRender?: (view: ViewObject) => void; + eventDestroy?: (event: EventObject, element: JQuery, view: ViewObject) => void; + + + } + + export interface ViewOptionHash { + month?: any; + week?: any; + day?: any; + agenda?: any; + agendaDay?: any; + agendaWeek?: any; + basic?: any; + basicDay?: any; + basicWeek?: any; + ''?: any; + } + + /** + * Agenda Options - http://arshaw.com/fullcalendar/docs/agenda/ + */ + export interface AgendaOptions { + allDaySlot?: boolean; + allDayText?: string; + slotDuration?: moment.Duration; + slotLabelFormat?: string; + slotLabelInterval?: moment.Duration; + snapDuration?: moment.Duration; + scrollTime?: moment.Duration; + minTime?: moment.Duration; // Integer/String + maxTime?: moment.Duration; // Integer/String + slotEventOverlap?: boolean; + } + + /* + * Event Dragging & Resizing + */ + export interface EventDraggingResizingOptions { + editable?: boolean; + eventStartEditable?: boolean; + eventDurationEditable?: boolean; + dragRevertDuration?: number; // integer, milliseconds + dragOpacity?: number; // float + dragScroll?: boolean; + eventOverlap?: boolean | ((stillEvent: EventObject, movingEvent: EventObject) => boolean); + eventConstraint?: BusinessHours | Timespan; + eventDragStart?: (event: EventObject, jsEvent: MouseEvent, ui: any, view: ViewObject) => void; + eventDragStop?: (event: EventObject, jsEvent: MouseEvent, ui: any, view: ViewObject) => void; + eventDrop?: (event: EventObject, delta: moment.Duration, revertFunc: Function, jsEvent: Event, ui: any, view: ViewObject) => void; + eventResizeStart?: (event: EventObject, jsEvent: MouseEvent, ui: any, view: ViewObject) => void; + eventResizeStop?: (event: EventObject, jsEvent: MouseEvent, ui: any, view: ViewObject) => void; + eventResize?: (event: EventObject, delta: moment.Duration, revertFunc: Function, jsEvent: Event, ui: any, view: ViewObject) => void; + } + /* + * Selection - http://arshaw.com/fullcalendar/docs/selection/ + */ + export interface SelectionOptions { + selectable?: boolean; + selectHelper?: boolean | ((start: moment.Moment, end: moment.Moment) => HTMLElement); + unselectAuto?: boolean; + unselectCancel?: string; + selectOverlap?: boolean | ((event: EventObject) => boolean); + selectConstraint?: Timespan | BusinessHours; + select?: (start: moment.Moment, end: moment.Moment, jsEvent: MouseEvent, view: ViewObject, resource?: any) => void; + unselect?: (view: ViewObject, jsEvent: Event) => void; + } + + export interface DroppingExternalElementsOptions { + droppable?: boolean; + dropAccept?: string | ((draggable: any) => boolean); + drop?: (date: moment.Moment, jsEvent: MouseEvent, ui: any) => void; + eventReceive?: (event: EventObject) => void + } + + export interface ButtonTextObject { + prev?: string; + next?: string; + prevYear?: string; + nextYear?: string; + today?: string; + month?: string; + week?: string; + day?: string; + } + + export interface EventObject extends Timespan { + id?: any // String/number + title: string; + allDay?: boolean; + url?: string; + className?: any; // string/Array + editable?: boolean; + source?: EventSource; + color?: string; + backgroundColor?: string; + borderColor?: string; + textColor?: string; + rendering?: string; + } + + export interface ViewObject extends Timespan { + name: string; + title: string; + intervalStart: moment.Moment; + intervalEnd: moment.Moment; + } + + export interface EventSource extends JQueryAjaxSettings { + + /** + * This has one of the following types: + * + * - EventObject[] + * - string (JSON feed) + * - (start: Date | string, end: Date | string, callback: {(events: EventObject[]) => void;}) => void; + */ + events?: any; + + color?: string; + backgroundColor?: string; + borderColor?: string; + textColor?: string; + className?: any; // string/Array + editable?: boolean; + allDayDefault?: boolean; + ignoreTimezone?: boolean; + eventTransform?: any; + startParam?: string; + endParam?: string + } + +} + +interface JQuery { + + /** + * Get/Set option value + */ + fullCalendar(method: 'option', option: string, value?: any): void; + + /** + * Immediately forces the calendar to render and/or readjusts its size. + */ + fullCalendar(method: 'render'): void; + + /** + * Restores the element to the state before FullCalendar was initialized. + */ + fullCalendar(method: 'destroy'): void; + + /** + * Returns the View Object for the current view. + */ + fullCalendar(method: 'getView'): FullCalendar.ViewObject; + + /** + * Immediately switches to a different view. + */ + fullCalendar(method: 'changeView', viewName: string): void; + + /** + * Moves the calendar one step back (either by a month, week, or day). + */ + fullCalendar(method: 'prev'): void; + + /** + * Moves the calendar one step forward (either by a month, week, or day). + */ + fullCalendar(method: 'next'): void; + + /** + * Moves the calendar back one year. + */ + fullCalendar(method: 'prevYear'): void; + + /** + * Moves the calendar forward one year. + */ + fullCalendar(method: 'nextYear'): void; + + /** + * Moves the calendar to the current date. + */ + fullCalendar(method: 'today'): void; + + /** + * Moves the calendar to an arbitrary year/month/date. + */ + fullCalendar(method: 'gotoDate', year: number, month?: number, date?: number): void; + + /** + * Moves the calendar to an arbitrary date. + */ + fullCalendar(method: 'gotoDate', date: Date | string): void; + + /** + * Moves the calendar forward/backward an arbitrary amount of time. + */ + fullCalendar(method: 'incrementDate', year: number, month?: number, date?: number): void; + + /** + * Returns a Date object for the current date of the calendar. + */ + fullCalendar(method: 'getDate'): Date; + + /** + * A method for programmatically selecting a period of time. + */ + fullCalendar(method: 'select', startDate: Date, endDate: Date, allDay: boolean): void; + + /** + * A method for programmatically clearing the current selection. + */ + fullCalendar(method: 'unselect'): void; + + /** + * Reports changes to an event and renders them on the calendar. + */ + fullCalendar(method: 'updateEvent', event: FullCalendar.EventObject): void; + + /** + * Retrieves events that FullCalendar has in memory. + */ + fullCalendar(method: 'clientEvents', idOrfilter?: any): Array; + + /** + * Retrieves events that FullCalendar has in memory. + */ + fullCalendar(method: 'clientEvents', idOrfilter?: (e: FullCalendar.EventObject) => boolean): Array; + + /** + * Removes events from the calendar. + */ + fullCalendar(method: 'removeEvents', idOrfilter?: any): void; + + /** + * Removes events from the calendar. + */ + fullCalendar(method: 'removeEvents', idOrfilter?: (e: FullCalendar.EventObject) => boolean): void; + + /** + * Refetches events from all sources and rerenders them on the screen. + */ + fullCalendar(method: 'refetchEvents'): void; + + /** + * Dynamically adds an event source. + */ + fullCalendar(method: 'addEventSource', source: any): void; + + /** + * Dynamically removes an event source. + */ + fullCalendar(method: 'removeEventSource', source: any): void; + + /** + * Renders a new event on the calendar. + */ + fullCalendar(method: 'renderEvent', event: FullCalendar.EventObject, stick?: boolean): void; + + /** + * Rerenders all events on the calendar. + */ + fullCalendar(method: 'rerenderEvents'): void; + + /** + * Create calendar object + */ + fullCalendar(options: FullCalendar.Options): JQuery; + + /** + * Generic method function + */ + fullCalendar(method: string, arg1: any, arg2: any, arg3: any): void; +} + +interface JQueryStatic { + fullCalendar: FullCalendar.Calendar; +} diff --git a/fullpage.js/fullpage.js-tests.ts b/fullpage.js/fullpage.js-tests.ts new file mode 100644 index 0000000000..31e66fdd60 --- /dev/null +++ b/fullpage.js/fullpage.js-tests.ts @@ -0,0 +1,64 @@ +/// + +function test_public_methods() { + $(() => { + $('#fullpage').fullpage({ + // Navigation + menu: '#menu', + lockAnchors: false, + anchors:['firstPage', 'secondPage'], + navigation: false, + navigationPosition: 'right', + navigationTooltips: ['firstSlide', 'secondSlide'], + showActiveTooltip: false, + slidesNavigation: true, + slidesNavPosition: 'bottom', + + // Scrolling + css3: true, + scrollingSpeed: 700, + autoScrolling: true, + fitToSection: true, + fitToSectionDelay: 1000, + scrollBar: false, + easing: 'easeInOutCubic', + easingcss3: 'ease', + loopBottom: false, + loopTop: false, + loopHorizontal: true, + continuousVertical: false, + normalScrollElements: '#element1, .element2', + scrollOverflow: false, + scrollOverflowOptions: null, + touchSensitivity: 15, + normalScrollElementTouchThreshold: 5, + + // Accessibility + keyboardScrolling: true, + animateAnchor: true, + recordHistory: true, + + // Design + controlArrows: true, + verticalCentered: true, + sectionsColor : ['#ccc', '#fff'], + paddingTop: '3em', + paddingBottom: '10px', + fixedElements: '#header, .footer', + responsiveWidth: 0, + responsiveHeight: 0, + + // Custom selectors + sectionSelector: '.section', + slideSelector: '.slide', + + // Events + onLeave: (index, nextIndex, direction) => {}, + afterLoad: (anchorLink, index) => {}, + afterRender: () => {}, + afterResize: () => {}, + afterSlideLoad: (anchorLink, index, slideAnchor, slideIndex) => {}, + onSlideLeave: (anchorLink, index, slideIndex, direction, nextSlideIndex) => {} + }); + }); +} diff --git a/fullpage.js/fullpage.js.d.ts b/fullpage.js/fullpage.js.d.ts new file mode 100644 index 0000000000..b2bedc62d9 --- /dev/null +++ b/fullpage.js/fullpage.js.d.ts @@ -0,0 +1,267 @@ +// Type definitions for fullpage.js v2.8.0 +// Project: http://alvarotrigo.com/fullPage/ +// Definitions by: Andrew Roberts +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +interface FullPageJsOptions { + /** + * (default false) A selector can be used to specify the menu to link with the sections. This way the scrolling of the sections will activate the corresponding element in the menu using the class active. This won't generate a menu but will just add the active class to the element in the given menu with the corresponding anchor links. In order to link the elements of the menu with the sections, an HTML 5 data-tag (data-menuanchor) will be needed to use with the same anchor links as used within the sections. + */ + menu?: string; + + /** + * (default false). Determines whether anchors in the URL will have any effect at all in the plugin. You can still using anchors internally for your own functions and callbacks, but they won't have any effect in the scrolling of the site. Useful if you want to combine fullPage.js with other plugins using anchor in the URL. + */ + lockAnchors?: boolean; + + /** + * (default []) Defines the anchor links (#example) to be shown on the URL for each section. Anchors value should be unique. The position of the anchors in the array will define to which sections the anchor is applied. (second position for second section and so on). Using anchors forward and backward navigation will also be possible through the browser. This option also allows users to bookmark a specific section or slide. Be careful! anchors can not have the same value as any ID element on the site (or NAME element for IE). Now anchors can be defined directly in the HTML structure by using the attribute data-anchor as explained here. + */ + anchors?: string[]; + + /** + * (default false) If set to true, it will show a navigation bar made up of small circles. + */ + navigation?: boolean; + + /** + * (default none) It can be set to left or right and defines which position the navigation bar will be shown (if using one). + */ + navigationPosition?: string; + + /** + * (default []) Defines the tooltips to show for the navigation circles in case they are being used. Example: navigationTooltips: ['firstSlide', 'secondSlide']. + */ + navigationTooltips?: string[]; + + /** + * (default false) Shows a persistent tooltip for the actively viewed section in the vertical navigation. + */ + showActiveTooltip?: boolean; + + /** + * (default false) If set to true it will show a navigation bar made up of small circles for each landscape slider on the site. + */ + slidesNavigation?: boolean; + + /** + * (default bottom) Defines the position for the landscape navigation bar for sliders. Admits top and bottom as values. You may want to modify the CSS styles to determine the distance from the top or bottom as well as any other style such as color. + */ + slidesNavPosition?: string; + + // Scrolling + + /** + * (default true). Defines whether to use JavaScript or CSS3 transforms to scroll within sections and slides. Useful to speed up the movement in tablet and mobile devices with browsers supporting CSS3. If this option is set to true and the browser doesn't support CSS3, a jQuery fallback will be used instead. + */ + css3?: boolean; + + /** + * (default 700) Speed in milliseconds for the scrolling transitions. + */ + scrollingSpeed?: number; + + /** + * (default true) Defines whether to use the "automatic" scrolling or the "normal" one. It also has affects the way the sections fit in the browser/device window in tablets and mobile phones. + */ + autoScrolling?: boolean; + + /** + * (default true). Determines whether or not to fit sections to the viewport or not. When set to true the current active section will always fill the whole viewport. Otherwise the user will be free to stop in the middle of a section (when ) + */ + fitToSection?: boolean; + + /** + * (default 1000). If fitToSection is set to true, this delays the fitting by the configured milliseconds. + */ + fitToSectionDelay?: number; + + /** + * (default false). Determines whether to use scrollbar for the site or not. In case of using scroll bar, the autoScrolling functionality will still working as expected. The user will also be free to scroll the site with the scroll bar and fullPage.js will fit the section in the screen when scrolling finishes. + */ + scrollBar?: boolean; + + /** + * (default easeInOutCubic) Defines the transition effect to use for the vertical and horizontal scrolling. It requires the file vendors/jquery.easings.min.js or jQuery UI for using some of its transitions. Other libraries could be used instead. + */ + easing?: string; + + /** + * (default ease) Defines the transition effect to use in case of using css3:true. You can use the pre-defined ones (such as linear, ease-out...) or create your own ones using the cubic-bezier function. You might want to use Matthew Lein CSS Easing Animation Tool for it. + */ + easingcss3?: string; + + /** + * (default false) Defines whether scrolling down in the last section should scroll to the first one or not. + */ + loopBottom?: boolean; + + /** + * (default false) Defines whether scrolling up in the first section should scroll to the last one or not. + */ + loopTop?: boolean; + + /** + * (default true) Defines whether horizontal sliders will loop after reaching the last or previous slide or not. + */ + loopHorizontal?: boolean; + + /** + * (default false) Defines whether scrolling down in the last section should scroll down to the first one or not, and if scrolling up in the first section should scroll up to the last one or not. Not compatible with loopTop or loopBottom. + */ + continuousVertical?: boolean; + + /** + * (default null) If you want to avoid the auto scroll when scrolling over some elements, this is the option you need to use. (useful for maps, scrolling divs etc.) It requires a string with the jQuery selectors for those elements. (For example: normalScrollElements: '#element1, .element2') + */ + normalScrollElements?: string; + + /** + * (default false) defines whether or not to create a scroll for the section/slide in case its content is bigger than the height of it. When set to true, your content will be wrapped by the plugin. Consider using delegation or load your other scripts in the afterRender callback. In case of setting it to true, it requires the vendor library scrolloverflow.min.js and it should be loaded before the fullPage.js plugin. + */ + scrollOverflow?: boolean; + + /** + * when using scrollOverflow:true fullpage.js will make use of a forked and modified version of iScroll.js libary. You can customize the scrolling behaviour by providing fullpage.js with the iScroll.js options you want to use. Check its documentation for more info. + */ + scrollOverflowOptions?: any; + + /** + * (default 5) Defines a percentage of the browsers window width/height, and how far a swipe must measure for navigating to the next section / slide + */ + touchSensitivity?: number; + + /** + * (default 5) Defines the threshold for the number of hops up the html node tree Fullpage will test to see if normalScrollElements is a match to allow scrolling functionality on divs on a touch device. (For example: normalScrollElementTouchThreshold: 3) + */ + normalScrollElementTouchThreshold?: number; + + // Accessibility + + /** + * (default true) Defines if the content can be navigated using the keyboard + */ + keyboardScrolling?: boolean; + + /** + * (default true) Defines whether the load of the site when given an anchor (#) will scroll with animation to its destination or will directly load on the given section. + */ + animateAnchor?: boolean; + + /** + * (default true) Defines whether to push the state of the site to the browser's history. When set to true each section/slide of the site will act as a new page and the back and forward buttons of the browser will scroll the sections/slides to reach the previous or next state of the site. When set to false, the URL will keep changing but will have no effect ont he browser's history. This option is automatically turned off when using autoScrolling:false. + */ + recordHistory?: boolean; + + // Design + /** + * (default: true) Determines whether to use control arrows for the slides to move right or left. + */ + controlArrows?: boolean; + + /** + * (default true) Vertically centering of the content within sections. When set to true, your content will be wrapped by the plugin. Consider using delegation or load your other scripts in the afterRender callback. + */ + verticalCentered?: boolean; + + + resize ?: boolean; + + /** + * (default none) Define the CSS background-color property for each section + */ + sectionsColor ?: string[]; + + /** + * (default 0) Defines the top padding for each section with a numerical value and its measure (paddingTop: '10px', paddingTop: '10em'...) Useful in case of using a fixed header. + */ + paddingTop?: string; + + /** + * (default 0) Defines the bottom padding for each section with a numerical value and its measure (paddingBottom: '10px', paddingBottom: '10em'...). Useful in case of using a fixed footer. + */ + paddingBottom?: string; + + /** + * (default null) Defines which elements will be taken off the scrolling structure of the plugin which is necessary when using the css3 option to keep them fixed. It requires a string with the jQuery selectors for those elements. (For example: fixedElements: '#element1, .element2') + */ + fixedElements?: string; + + /** + * (default 0) A normal scroll (autoScrolling:false) will be used under the defined width in pixels. A class fp-responsive is added to the body tag in case the user wants to use it for his own responsive CSS. For example, if set to 900, whenever the browser's width is less than 900 the plugin will scroll like a normal site. + */ + responsiveWidth?: number; + + /** + * (default 0) A normal scroll (autoScrolling:false) will be used under the defined height in pixels. A class fp-responsive is added to the body tag in case the user wants to use it for his own responsive CSS. For example, if set to 900, whenever the browser's height is less than 900 the plugin will scroll like a normal site. + */ + responsiveHeight?: number; + + // Custom selectors + + /** + * (default .section) Defines the jQuery selector used for the plugin sections. It might need to be changed sometimes to avoid problem with other plugins using the same selectors as fullpage.js. + */ + sectionSelector?: string; + + /** + * (default .slide) Defines the jQuery selector used for the plugin slides. It might need to be changed sometimes to avoid problem with other plugins using the same selectors as fullpage.js. + */ + slideSelector?: string; + + // Events + /** + * This callback is fired once the user leaves a section, in the transition to the new section. Returning false will cancel the move before it takes place. + * @param index index of the leaving section. Starting from 1. + * @param nextIndex index of the destination section. Starting from 1. + * @param direction it will take the values up or down depending on the scrolling direction. + */ + onLeave?: (index: number, nextIndex: number, direction: string) => void; + + /** + * Callback fired once the sections have been loaded, after the scrolling has ended. + * @param anchorLink anchorLink corresponding to the section. + * @param index index of the section. Starting from 1. + */ + afterLoad?: (anchorLink: string, index: number) => void; + + /** + * This callback is fired just after the structure of the page is generated. This is the callback you want to use to initialize other plugins or fire any code which requires the document to be ready (as this plugin modifies the DOM to create the resulting structure). + */ + afterRender?: () => void; + + /** + * This callback is fired after resizing the browser's window. Just after the sections are resized. + */ + afterResize?: () => void; + + /** + * Callback fired once the slide of a section have been loaded, after the scrolling has ended. + * + * In case of not having anchorLinks defined for the slide or slides the slideIndex parameter would be the only one to use. + * + * Parameters: + * + * @param anchorLink anchorLink corresponding to the section. + * @param index index of the section. Starting from 1. + * @param slideAnchor anchor corresponding to the slide (in case there is) + * @param slideIndex index of the slide. Starting from 1. (the default slide doesn't count as slide, but as a section) + */ + afterSlideLoad?: (anchorLink: string, index: number, slideAnchor: string, slideIndex: number) => void; + + /** + * This callback is fired once the user leaves an slide to go to another, in the transition to the new slide. Returning false will cancel the move before it takes place. + * @param anchorLink: anchorLink corresponding to the section. + * @param index index of the section. Starting from 1. + * @param slideIndex index of the slide. Starting from 0. + * @param direction takes the values right or left depending on the scrolling direction. + * @param nextSlideIndex index of the destination slide. Starting from 0. + */ + onSlideLeave?: (anchorLink: string, index: number, slideIndex: number, direction: string, nextSlideIndex: number) => void; +} + +interface JQuery { + fullpage(options?: FullPageJsOptions): JQuery; +} diff --git a/fuse/fuse.d.ts b/fuse/fuse.d.ts index 09192fb909..9f1de6ff03 100644 --- a/fuse/fuse.d.ts +++ b/fuse/fuse.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Fuse.js 1.1.5 +// Type definitions for Fuse.js 2.2.0 // Project: https://github.com/krisk/Fuse // Definitions by: Greg Smith // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -11,12 +11,13 @@ declare class Fuse { declare namespace fuse { interface IFuseOptions extends ISearchOptions { caseSensitive?: boolean; - includeScore?: boolean; + include?: string[]; shouldSort?: boolean; searchFn?: any; sortFn?: (a: {score: number}, b: {score: number}) => number; getFn?: (obj: any, path: string) => any; - keys?: string[]; + keys?: string[] | { name:string; weight:number} []; + verbose?:boolean; } interface ISearchOptions { diff --git a/gapi.auth2/gapi.auth2.d.ts b/gapi.auth2/gapi.auth2.d.ts index 9b23a34874..c94ed8c1a9 100644 --- a/gapi.auth2/gapi.auth2.d.ts +++ b/gapi.auth2/gapi.auth2.d.ts @@ -64,7 +64,7 @@ declare namespace gapi.auth2 { fetch_basic_profile?: boolean; prompt?: boolean; scope?: string; - }, onsuccess: () => any, onfailure: (reason: string) => any): any; + }, onsuccess: (googleUser: GoogleUser) => any, onfailure: (reason: string) => any): any; } export interface IsSignedIn{ diff --git a/generic-functions/generic-functions.d.ts b/generic-functions/generic-functions.d.ts new file mode 100644 index 0000000000..d25ebde7cc --- /dev/null +++ b/generic-functions/generic-functions.d.ts @@ -0,0 +1,15 @@ +// Type definitions for generic-functions +// Project: https://github.com/stpettersens/generic-functions +// Definitions by: Sam Saint-Pettersen +// Definitions: https://github.com/definitelytyped/DefinitelyTyped + +declare module "generic-functions" { + function strcmp(str1: string, str2: string): boolean; + function icstrcmp(str1: string, str2: string): boolean; + function strendswith(str: string, suffix: string): boolean; + function icstrendswith(str: string, suffix: string): boolean; + function endswithdot(str: string): string; + function println(message: string): void; + function printlns(message: string[]): void; + function objGetKeyByValue(object: Object, value: any): string; +} diff --git a/generic-functions/genetic-functions-tests.ts b/generic-functions/genetic-functions-tests.ts new file mode 100644 index 0000000000..d3dc53665a --- /dev/null +++ b/generic-functions/genetic-functions-tests.ts @@ -0,0 +1,16 @@ +/// + +import g = require('generic-functions'); + +var tvShow: Object = { + seasons: 2, + show: "Better Call Saul" +}; + +console.log(g.strcmp("foo", "foo")); // => true +console.log(g.icstrcmp("BAR", "bar")); // => true +console.log(g.strendswith("file.pdf", "pdf")); // => true +console.log(g.icstrendswith("file.PDF", "pdf")); // => true +console.log(g.endswithdot("file.pdf")); // => ".pdf" +console.log(g.objGetKeyByValue(tvShow, 2)); // => "seasons" +console.log(g.objGetKeyByValue(tvShow, "Better Call Saul")); // => "show" diff --git a/geojson/geojson-tests.ts b/geojson/geojson-tests.ts index ce38b654b2..75cf6ffd54 100644 --- a/geojson/geojson-tests.ts +++ b/geojson/geojson-tests.ts @@ -72,6 +72,11 @@ var point: GeoJSON.Point = { coordinates: [100.0, 0.0] }; + +// This type is commonly used in the turf package +var pointCoordinates: number[] = point.coordinates + + var lineString: GeoJSON.LineString = { type: "LineString", coordinates: [ [100.0, 0.0], [101.0, 1.0] ] @@ -126,4 +131,4 @@ var geometryCollection: GeoJSON.GeometryCollection = { coordinates: [ [101.0, 0.0], [102.0, 1.0] ] } ] -} \ No newline at end of file +} diff --git a/geojson/geojson.d.ts b/geojson/geojson.d.ts index d77de1fe86..38715a9a27 100644 --- a/geojson/geojson.d.ts +++ b/geojson/geojson.d.ts @@ -18,10 +18,7 @@ declare namespace GeoJSON { /*** * http://geojson.org/geojson-spec.html#positions */ - export interface Position - { - [index: number]: number; - } + export type Position = number[] /*** * http://geojson.org/geojson-spec.html#geometry-objects @@ -36,6 +33,7 @@ declare namespace GeoJSON { */ export interface Point extends GeometryObject { + type: 'Point' coordinates: Position } @@ -44,6 +42,7 @@ declare namespace GeoJSON { */ export interface MultiPoint extends GeometryObject { + type: 'MultiPoint' coordinates: Position[] } @@ -52,6 +51,7 @@ declare namespace GeoJSON { */ export interface LineString extends GeometryObject { + type: 'LineString' coordinates: Position[] } @@ -60,6 +60,7 @@ declare namespace GeoJSON { */ export interface MultiLineString extends GeometryObject { + type: 'MultiLineString' coordinates: Position[][] } @@ -68,6 +69,7 @@ declare namespace GeoJSON { */ export interface Polygon extends GeometryObject { + type: 'Polygon' coordinates: Position[][] } @@ -76,6 +78,7 @@ declare namespace GeoJSON { */ export interface MultiPolygon extends GeometryObject { + type: 'MultiPolygon' coordinates: Position[][][] } @@ -84,6 +87,7 @@ declare namespace GeoJSON { */ export interface GeometryCollection extends GeoJsonObject { + type: 'GeometryCollection' geometries: GeometryObject[]; } @@ -92,6 +96,7 @@ declare namespace GeoJSON { */ export interface Feature extends GeoJsonObject { + type: 'Feature' geometry: T; properties: any; id?: string; @@ -102,6 +107,7 @@ declare namespace GeoJSON { */ export interface FeatureCollection extends GeoJsonObject { + type: 'FeatureCollection' features: Feature[]; } diff --git a/get-port/get-port-tests.ts b/get-port/get-port-tests.ts new file mode 100644 index 0000000000..d414742230 --- /dev/null +++ b/get-port/get-port-tests.ts @@ -0,0 +1,7 @@ +/// + +import * as getPort from "get-port"; + +getPort().then(port => { + console.log(port); +}); diff --git a/get-port/get-port.d.ts b/get-port/get-port.d.ts new file mode 100644 index 0000000000..673c547f1c --- /dev/null +++ b/get-port/get-port.d.ts @@ -0,0 +1,9 @@ +// Type definitions for ajv +// Project: https://github.com/sindresorhus/get-port +// Definitions by: York Yao +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module "get-port" { + var getPort: () => PromiseLike + export = getPort; +} diff --git a/gijgo/gijgo-tests.ts b/gijgo/gijgo-tests.ts new file mode 100644 index 0000000000..4b981c172e --- /dev/null +++ b/gijgo/gijgo-tests.ts @@ -0,0 +1,23 @@ +/// +/// + +// Grid +$(() => { + this.grid = $('#grid').grid({ + primaryKey: 'ID', + columns: [ + { field: 'ID', width: 50, sortable: true }, + { field: 'Name', sortable: true }, + ], + pager: { limit: 5, sizes: [2, 5, 10, 20] } + }); +}); + +// Dialog +$(() => { + this.dialog = $('#playerModal').dialog({ + autoOpen: false, + title: 'Player', + width: 400 + }); +}); \ No newline at end of file diff --git a/gijgo/gijgo.d.ts b/gijgo/gijgo.d.ts new file mode 100644 index 0000000000..2f9604bbef --- /dev/null +++ b/gijgo/gijgo.d.ts @@ -0,0 +1,167 @@ +// Type definitions for Gijgo v0.6.2 +// Project: http://gijgo.com +// Definitions by: Atanas Atanasov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module Gijgo { + + //Grid + interface GridPager { + limit?: number; + sizes?: Array; + leftControls?: any; + rightControls?: any; + } + + interface GridColumn { + align?: string; + cssClass?: string; + decimalDigits?: number; + editor?: any; + events?: any; + field?: string; + format?: string; + headerCssClass?: string; + hidden?: boolean; + icon?: string; + minWidth?: number; + priority?: number; + sortable?: boolean; + stopPropagation?: boolean; + title?: string; + tmpl?: string; + tooltip?: string; + type?: string; + width?: number; + } + + interface GridDefaultParams { + direction?: string; + limit?: string; + page?: string; + sortBy?: string; + } + + interface GridMapping { + dataField?: string; + totalRecordsField?: string; + } + + interface GridSettings { + //Configuration options + autoGenerateColumns?: boolean; + autoLoad?: boolean; + columns?: Array; + dataSource?: any; + defaultColumnSettings?: GridColumn; + defaultParams?: GridDefaultParams; + detailTemplate?: string; + fontSize?: string; + mapping?: string; + minWidth?: number; + notFoundText?: string; + pager?: GridPager; + primaryKey?: string; + resizableColumns?: boolean; + resizeCheckInterval?: number; + responsive?: boolean; + selectionMethod?: string; + selectionType?: string; + showHiddenColumnsAsDetails?: boolean; + title?: string; + toolbarTemplate?: string; + uiLibrary?: string; + width?: number; + params?: any; + + //Events + beforeEmptyRowInsert?: (e: any, $row: JQuery) => any; + cellDataBound?: (e: any, $wrapper: JQuery, id: string, column: GridColumn, record: Entity) => any; + cellDataChanged?: (e: any, $cell: JQuery, column: GridColumn, record: Entity, oldValue: any, newValue: any) => any; + columnHide?: (e: any, column: GridColumn) => any; + columnShow?: (e: any, column: GridColumn) => any; + dataBinding?: (e: any, records: Array) => any; + dataBound?: (e: any, records: Array, totalRecords: number) => any; + destroying?: (e: any) => any; + detailCollapse?: (e: any, detailWrapper: JQuery, record: Entity) => any; + detailExpand?: (e: any, detailWrapper: JQuery, record: Entity) => any; + initialized?: (e: any) => any; + pageChanging?: (e: any, newPage: number) => any; + pageSizeChange?: (e: any, newPage: number) => any; + resize?: (e: any, newWidth: number, oldWidth: number) => any; + rowDataBound?: (e: any, $row: JQuery, id: string, record: Entity) => any; + rowRemoving?: (e: any, $row: JQuery, id: string, record: Entity) => any; + rowSelect?: (e: any, $row: JQuery, id: string, record: Entity) => any; + rowUnselect?: (e: any, $row: JQuery, id: string, record: Entity) => any; + } + + interface Grid extends JQuery { + addRow(record: Entity): Grid; + clear(showNotFoundText?: boolean): Grid; + count(): number; + destroy(keepTableTag?: boolean, keepWrapperTag?: boolean): void; + //get(position: number): Entity; //TODO: rename to getByPosition to avoid conflicts with jquery.get + getAll(): Array; + getById(id: string): Entity; + getChanges(): Array; + getSelected(): string; + getSelections(): Array; + hideColumn(field: string): Grid; + makeResponsive(): void; + reload(params?: Params): Grid; + removeRow(id: string): Grid; + render(response: any): Grid; + selectAll(): Grid; + setSelected(id: string | number): Grid; + showColumn(field: string): Grid; + title(text: any): any; + unSelectAll(): Grid; + updateRow(id: string, record: Entity): Grid; + } + + //Dialog + interface DialogSettings { + //Configuration options + autoOpen?: boolean; + closeOnEscape?: boolean; + draggable?: boolean; + height?: number | string; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + modal?: boolean; + resizable?: boolean; + title?: string; + uiLibrary?: string; + width?: number; + + //Events + closed?: (e: any) => any; + closing?: (e: any) => any; + drag?: (e: any) => any; + dragStart?: (e: any) => any; + dragStop?: (e: any) => any; + initialized?: (e: any) => any; + opened?: (e: any) => any; + opening?: (e: any) => any; + resize?: (e: any) => any; + resizeStart?: (e: any) => any; + resizeStop?: (e: any) => any; + } + + interface Dialog extends JQuery { + close(): Dialog; + isOpen(): boolean; + open(): Dialog; + } +} + + +interface JQuery { + grid(settings: Gijgo.GridSettings): Gijgo.Grid; + grid(settings: Gijgo.GridSettings): Gijgo.Grid; + grid(settings: Gijgo.GridSettings): Gijgo.Grid; + + dialog(settings: Gijgo.DialogSettings): Gijgo.Dialog; +} diff --git a/github-electron/github-electron-main-tests.ts b/github-electron/github-electron-main-tests.ts index 27d6599596..bebf0b99c8 100644 --- a/github-electron/github-electron-main-tests.ts +++ b/github-electron/github-electron-main-tests.ts @@ -19,7 +19,8 @@ import { screen, shell, session, - hideInternalModules + systemPreferences, + webContents } from 'electron'; import * as path from 'path'; @@ -44,7 +45,6 @@ var shouldQuit = app.makeSingleInstance(function(commandLine, workingDirectory) if (mainWindow.isMinimized()) mainWindow.restore(); mainWindow.focus(); } - return true; }); if (shouldQuit) { @@ -79,19 +79,9 @@ app.on('ready', () => { mainWindow = null; }); - mainWindow.print({silent: true, printBackground: false}); mainWindow.webContents.print({silent: true, printBackground: false}); - mainWindow.print(); mainWindow.webContents.print(); - mainWindow.printToPDF({ - marginsType: 1, - pageSize: 'A3', - printBackground: true, - printSelectionOnly: true, - landscape: true, - }, (error: Error, data: Buffer) => {}); - mainWindow.webContents.printToPDF({ marginsType: 1, pageSize: 'A3', @@ -100,13 +90,13 @@ app.on('ready', () => { landscape: true, }, (error: Error, data: Buffer) => {}); - mainWindow.printToPDF({}, (err, data) => {}); mainWindow.webContents.printToPDF({}, (err, data) => {}); mainWindow.webContents.executeJavaScript('return true;'); mainWindow.webContents.executeJavaScript('return true;', true); mainWindow.webContents.executeJavaScript('return true;', true, (result: boolean) => console.log(result)); mainWindow.webContents.insertText('blah, blah, blah'); + mainWindow.webContents.startDrag({file: '/path/to/img.png', icon: nativeImage.createFromPath('/path/to/icon.png')}); mainWindow.webContents.findInPage('blah'); mainWindow.webContents.findInPage('blah', { forward: true, @@ -144,6 +134,35 @@ app.on('ready', () => { }); mainWindow.webContents.debugger.sendCommand("Network.enable"); + mainWindow.webContents.capturePage(image => { + console.log(image.toDataURL()); + }); + mainWindow.webContents.capturePage({x: 0, y: 0, width: 100, height: 200}, image => { + console.log(image.toPNG()); + }); +}); + +app.commandLine.appendSwitch('enable-web-bluetooth'); + +app.on('ready', () => { + mainWindow.webContents.on('select-bluetooth-device', (event, deviceList, callback) => { + event.preventDefault(); + + let result = (() => { + for (let device of deviceList) { + if (device.deviceName === 'test') { + return device; + } + } + return null; + })(); + + if (!result) { + callback(''); + } else { + callback(result.deviceId); + } + }); }); // Locale @@ -208,6 +227,7 @@ app.dock.setBadge('foo'); var id = app.dock.bounce('informational'); app.dock.cancelBounce(id); app.dock.setIcon('/path/to/icon.png'); +app.dock.setBadgeCount(app.dock.getBadgeCount() + 1); app.setUserTasks([ { @@ -220,6 +240,12 @@ app.setUserTasks([ } ]); app.setUserTasks([]); +if (app.isUnityRunning()) { +} +if (app.isAccessibilitySupportEnabled()) { +} +app.setLoginItemSettings({openAtLogin: true, openAsHidden: false}); +console.log(app.getLoginItemSettings().wasOpenedAtLogin); var window = new BrowserWindow(); window.setProgressBar(0.5); @@ -235,6 +261,7 @@ app.on('ready', () => { onlineStatusWindow = new BrowserWindow({ width: 0, height: 0, show: false }); onlineStatusWindow.loadURL(`file://${__dirname}/online-status.html`); }); +app.on('accessibility-support-changed', (_, enabled) => console.log('accessibility: ' + enabled)); ipcMain.on('online-status-changed', (event: any, status: any) => { console.log(status); @@ -257,11 +284,10 @@ app.on('ready', () => { app.commandLine.appendSwitch('remote-debugging-port', '8315'); app.commandLine.appendSwitch('host-rules', 'MAP * 127.0.0.1'); -app.commandLine.appendSwitch('v', -1); app.commandLine.appendSwitch('vmodule', 'console=0'); -// app -// https://github.com/atom/electron/blob/master/docs/api/app.md +// systemPreferences +// https://github.com/electron/electron/blob/master/docs/api/system-preferences.md var browserOptions = { width: 1000, @@ -271,7 +297,7 @@ var browserOptions = { }; // Make the window transparent only if the platform supports it. -if (process.platform !== 'win32' || app.isAeroGlassEnabled()) { +if (process.platform !== 'win32' || systemPreferences.isAeroGlassEnabled()) { browserOptions.transparent = true; browserOptions.frame = false; } @@ -287,9 +313,8 @@ if (browserOptions.transparent) { win.loadURL('file://' + __dirname + '/fallback.html'); } -app.on('platform-theme-changed', () => { - console.log(app.isDarkMode()); -}); +// app +// https://github.com/atom/electron/blob/master/docs/api/app.md app.on('certificate-error', function(event, webContents, url, error, certificate, callback) { if (url == "https://github.com") { @@ -311,6 +336,14 @@ app.on('login', function(event, webContents, request, authInfo, callback) { callback('username', 'secret'); }); +var win = new BrowserWindow({show: false}) +win.once('ready-to-show', () => { + win.show(); +}); + +app.relaunch({args: process.argv.slice(1).concat(['--relaunch'])}); +app.exit(0); + // auto-updater // https://github.com/atom/electron/blob/master/docs/api/auto-updater.md @@ -340,6 +373,8 @@ win.show(); var toolbarRect = document.getElementById('toolbar').getBoundingClientRect(); win.setSheetOffset(toolbarRect.height); +var installed = BrowserWindow.getDevToolsExtensions().hasOwnProperty('devtron'); + // content-tracing // https://github.com/atom/electron/blob/master/docs/api/content-tracing.md @@ -408,6 +443,14 @@ ipcMain.on('synchronous-message', (event: Electron.IpcMainEvent, arg: any) => { event.returnValue = 'pong'; }); +var winWindows = new BrowserWindow({ + width: 800, + height: 600, + show: false, + thickFrame: false, + type: 'toolbar', +}); + // menu-item // https://github.com/atom/electron/blob/master/docs/api/menu-item.md @@ -534,6 +577,42 @@ var template = [ focusedWindow.webContents.toggleDevTools(); } } + }, + { + type: 'separator' + }, + { + label: 'Actual Size', + accelerator: 'CmdOrCtrl+0', + click: (item, focusedWindow) => { + if (focusedWindow) { + focusedWindow.webContents.setZoomLevel(0) + } + } + }, + { + label: 'Zoom In', + accelerator: 'CmdOrCtrl+Plus', + click: (item, focusedWindow) => { + if (focusedWindow) { + const { webContents } = focusedWindow; + webContents.getZoomLevel((zoomLevel) => { + webContents.setZoomLevel(zoomLevel + 0.5) + }); + } + } + }, + { + label: 'Zoom Out', + accelerator: 'CmdOrCtrl+-', + click: (item, focusedWindow) => { + if (focusedWindow) { + const { webContents } = focusedWindow; + webContents.getZoomLevel((zoomLevel) => { + webContents.setZoomLevel(zoomLevel - 0.5) + }); + } + } } ] }, @@ -679,8 +758,11 @@ app.on('ready', () => { clipboard.writeText('Example String'); clipboard.writeText('Example String', 'selection'); +clipboard.writeBookmark('foo', 'http://example.com'); +clipboard.writeBookmark('foo', 'http://example.com', 'selection'); console.log(clipboard.readText('selection')); console.log(clipboard.availableFormats()); +console.log(clipboard.readBookmark().title); clipboard.clear(); clipboard.write({ @@ -714,9 +796,13 @@ var image = clipboard.readImage(); var appIcon3 = new Tray(image); var appIcon4 = new Tray('/Users/somebody/images/icon.png'); +let image2 = nativeImage.createFromPath('/Users/somebody/images/icon.png'); + // process // https://github.com/electron/electron/blob/master/docs/api/process.md +console.log(process.versions.electron); +console.log(process.versions.chrome); console.log(process.type); console.log(process.resourcesPath); console.log(process.mas); @@ -777,6 +863,8 @@ shell.openExternal('https://github.com', { shell.beep(); +shell.writeShortcutLink('/home/user/Desktop/shortcut.lnk', 'update', shell.readShortcutLink('/home/user/Desktop/shortcut.lnk')); + // session // https://github.com/atom/electron/blob/master/docs/api/session.md @@ -810,19 +898,28 @@ session.defaultSession.cookies.set(cookie, (error) => { session.defaultSession.on('will-download', (event, item, webContents) => { // Set the save path, making Electron not to prompt a save dialog. item.setSavePath('/tmp/save.pdf'); + console.log(item.getSavePath()); console.log(item.getMimeType()); console.log(item.getFilename()); console.log(item.getTotalBytes()); - item.on('updated', function() { - console.log('Received bytes: ' + item.getReceivedBytes()); + item.on('updated', (event, state) => { + if (state === 'interrupted') { + console.log('Download is interrupted but can be resumed'); + } else if (state === 'progressing') { + if (item.isPaused()) { + console.log('Download is paused'); + } else { + console.log(`Received bytes: ${item.getReceivedBytes()}`); + } + } }); item.on('done', function(e, state) { if (state == "completed") { console.log("Download successfully"); } else { - console.log("Download is cancelled or interrupted that can't be resumed"); + console.log(`Download failed: ${state}`) } }); }); @@ -854,6 +951,13 @@ session.defaultSession.setPermissionRequestHandler(function(webContents, permiss callback(true); }); +// consider any url ending with `example.com`, `foobar.com`, `baz` +// for integrated authentication. +session.defaultSession.allowNTLMCredentialsForDomains('*example.com, *foobar.com, *baz') + +// consider all urls for integrated authentication. +session.defaultSession.allowNTLMCredentialsForDomains('*') + // Modify the user agent for all requests to the following urls. var filter = { urls: ["https://*.github.com/*", "*://electron.github.io"] @@ -863,3 +967,33 @@ session.defaultSession.webRequest.onBeforeSendHeaders(filter, function(details, details.requestHeaders['User-Agent'] = "MyAgent"; callback({cancel: false, requestHeaders: details.requestHeaders}); }); + +app.on('ready', function () { + const protocol = session.defaultSession.protocol + protocol.registerFileProtocol('atom', function (request, callback) { + var url = request.url.substr(7); + callback({path: path.normalize(__dirname + '/' + url)}); + }, function (error) { + if (error) { + console.error('Failed to register protocol'); + } + }) +}); + +// webContents +// https://github.com/electron/electron/blob/master/docs/api/web-contents.md + +console.log(webContents.getAllWebContents()); +console.log(webContents.getFocusedWebContents()); + +var win = new BrowserWindow({ + webPreferences: { + offscreen: true + } +}); + +win.webContents.on('paint', (event, dirty, image) => { + console.log(dirty, image.getBitmap()); +}); + +win.loadURL('http://github.com'); diff --git a/github-electron/github-electron-renderer-tests.ts b/github-electron/github-electron-renderer-tests.ts index 42d034c5c7..b7292e3ac5 100644 --- a/github-electron/github-electron-renderer-tests.ts +++ b/github-electron/github-electron-renderer-tests.ts @@ -75,6 +75,9 @@ webFrame.executeJavaScript('JSON.stringify({})', false, (result) => { console.log(result); }); +console.log(webFrame.getResourceUsage()); +webFrame.clearCache(); + // clipboard // https://github.com/atom/electron/blob/master/docs/api/clipboard.md @@ -232,7 +235,7 @@ webview.addEventListener('found-in-page', function(e) { } }); -var rquestId = webview.findInPage("test"); +var requestId = webview.findInPage("test"); webview.addEventListener('new-window', function(e) { require('electron').shell.openExternal(e.url); @@ -247,6 +250,7 @@ webview.addEventListener('ipc-message', function(event) { console.log(event.channel); // Prints "pong" }); webview.send('ping'); +webview.capturePage((image) => { console.log(image); }); // In guest page. ipcRenderer.on('ping', function() { diff --git a/github-electron/github-electron.d.ts b/github-electron/github-electron.d.ts index 3d4bd89835..7b246966ab 100644 --- a/github-electron/github-electron.d.ts +++ b/github-electron/github-electron.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Electron v0.37.7 +// Type definitions for Electron v1.3.3 // Project: http://electron.atom.io/ // Definitions by: jedmao , rhysd , Milan Burda // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -25,6 +25,23 @@ declare namespace Electron { sender: EventEmitter; } + type Point = { + x: number; + y: number; + } + + type Size = { + width: number; + height: number; + } + + type Rectangle = { + x: number; + y: number; + width: number; + height: number; + } + // https://github.com/electron/electron/blob/master/docs/api/app.md /** @@ -34,7 +51,7 @@ declare namespace Electron { /** * Emitted when the application has finished basic startup. * On Windows and Linux, the will-finish-launching event - * is the same as the ready event; on OS X, this event represents + * is the same as the ready event; on macOS, this event represents * the applicationWillFinishLaunching notification of NSApplication. * You would usually set up listeners for the open-file and open-url events here, * and start the crash reporter and auto updater. @@ -49,7 +66,9 @@ declare namespace Electron { /** * Emitted when all windows have been closed. * - * This event is only emitted when the application is not going to quit. + * If you do not subscribe to this event and all windows are closed, + * the default behavior is to quit the app; however, if you subscribe, + * you control whether the app quits or not. * If the user pressed Cmd + Q, or the developer called app.quit(), * Electron will first try to close all the windows and then emit the will-quit event, * and in this case the window-all-closed event would not be emitted. @@ -79,7 +98,7 @@ declare namespace Electron { * * You should call event.preventDefault() if you want to handle this event. * - * Note: This is only implemented on OS X. + * Note: This is only implemented on macOS. */ on(event: 'open-file', listener: (event: Event, url: string) => void): this; /** @@ -88,14 +107,19 @@ declare namespace Electron { * * You should call event.preventDefault() if you want to handle this event. * - * Note: This is only implemented on OS X. + * Note: This is only implemented on macOS. */ on(event: 'open-url', listener: (event: Event, url: string) => void): this; /** * Emitted when the application is activated, which usually happens when clicks on the applications’s dock icon. - * Note: This is only implemented on OS X. + * Note: This is only implemented on macOS. */ on(event: 'activate', listener: Function): this; + /** + * Emitted during Handoff when an activity from a different device wants to be resumed. + * You should call event.preventDefault() if you want to handle this event. + */ + on(event: 'continue-activity', listener: (event: Event, type: string, userInfo: Object) => void): this; /** * Emitted when a browserWindow gets blurred. */ @@ -108,6 +132,10 @@ declare namespace Electron { * Emitted when a new browserWindow is created. */ on(event: 'browser-window-created', listener: (event: Event, browserWindow: BrowserWindow) => void): this; + /** + * Emitted when a new webContents is created. + */ + on(event: 'web-contents-created', listener: (event: Event, webContents: WebContents) => void): this; /** * Emitted when failed to verify the certificate for url, to trust the certificate * you should prevent the default behavior with event.preventDefault() and call callback(true). @@ -150,10 +178,11 @@ declare namespace Electron { */ on(event: 'gpu-process-crashed', listener: Function): this; /** - * Emitted when the system’s Dark Mode theme is toggled. - * Note: This is only implemented on OS X. + * Emitted when Chrome's accessibility support changes. + * + * Note: This API is only available on macOS and Windows. */ - on(event: 'platform-theme-changed', listener: Function): this; + on(event: 'accessibility-support-changed', listener: (event: Event, accessibilitySupportEnabled: boolean) => void): this; on(event: string, listener: Function): this; /** * Try to close all windows. The before-quit event will first be emitted. @@ -171,20 +200,38 @@ declare namespace Electron { * and the before-quit and will-quit events will not be emitted. */ exit(exitCode: number): void; + /** + * Relaunches the app when current instance exits. + * + * By default the new instance will use the same working directory + * and command line arguments with current instance. + * When args is specified, the args will be passed as command line arguments instead. + * When execPath is specified, the execPath will be executed for relaunch instead of current app. + * + * Note that this method does not quit the app when executed, you have to call app.quit + * or app.exit after calling app.relaunch to make the app restart. + * + * When app.relaunch is called for multiple times, multiple instances + * will be started after current instance exited. + */ + relaunch(options?: { + args?: string[], + execPath?: string + }): void; /** * On Linux, focuses on the first visible window. - * On OS X, makes the application the active app. + * On macOS, makes the application the active app. * On Windows, focuses on the application’s first window. */ focus(): void; /** * Hides all application windows without minimizing them. - * Note: This is only implemented on OS X. + * Note: This is only implemented on macOS. */ hide(): void; /** * Shows application windows after they were hidden. Does not automatically focus them. - * Note: This is only implemented on OS X. + * Note: This is only implemented on macOS. */ show(): void; /** @@ -233,70 +280,79 @@ declare namespace Electron { * Adds path to recent documents list. * * This list is managed by the system, on Windows you can visit the list from - * task bar, and on Mac you can visit it from dock menu. + * task bar, and on macOS you can visit it from dock menu. * - * Note: This is only implemented on OS X and Windows. + * Note: This is only implemented on macOS and Windows. */ addRecentDocument(path: string): void; /** * Clears the recent documents list. * - * Note: This is only implemented on OS X and Windows. + * Note: This is only implemented on macOS and Windows. */ clearRecentDocuments(): void; /** * Sets the current executable as the default handler for a protocol (aka URI scheme). - * Once registered, all links with your-protocol:// will be openend with the current executable. + * Once registered, all links with your-protocol:// will be opened with the current executable. * The whole link, including protocol, will be passed to your application as a parameter. * - * Note: This is only implemented on OS X and Windows. - * On OS X, you can only register protocols that have been added to your app's info.plist. + * Note: This is only implemented on macOS and Windows. + * On macOS, you can only register protocols that have been added to your app's info.plist. */ - setAsDefaultProtocolClient(protocol: string): void; + setAsDefaultProtocolClient(protocol: string): boolean; /** * Removes the current executable as the default handler for a protocol (aka URI scheme). * - * Note: This API is only available on Windows. - * On OS X, removing the app will automatically remove the app as the default protocol handler. + * Note: This is only implemented on macOS and Windows. */ - removeAsDefaultProtocolClient(protocol: string): void; + removeAsDefaultProtocolClient(protocol: string): boolean; + /** + * @returns Whether the current executable is the default handler for a protocol (aka URI scheme). + * + * Note: This is only implemented on macOS and Windows. + */ + isDefaultProtocolClient(protocol: string): boolean; /** * Adds tasks to the Tasks category of JumpList on Windows. * * Note: This API is only available on Windows. */ - setUserTasks(tasks: Task[]): void; - /** - * Dynamically sets whether to always send credentials for HTTP NTLM or Negotiate authentication. - * Normally, Electron will only send NTLM/Kerberos credentials for URLs that fall under - * "Local Intranet" sites (i.e. are in the same domain as you). - * However, this detection often fails when corporate networks are badly configured, - * so this lets you co-opt this behavior and enable it for all URLs. - */ - allowNTLMCredentialsForAllDomains(allow: boolean): void; + setUserTasks(tasks: Task[]): boolean; /** * This method makes your application a Single Instance Application instead of allowing * multiple instances of your app to run, this will ensure that only a single instance * of your app is running, and other instances signal this instance and exit. */ - makeSingleInstance(callback: (args: string[], workingDirectory: string) => boolean): boolean; + makeSingleInstance(callback: (args: string[], workingDirectory: string) => void): boolean; + /** + * Releases all locks that were created by makeSingleInstance. This will allow + * multiple instances of the application to once again run side by side. + */ + releaseSingleInstance(): void; + /** + * Creates an NSUserActivity and sets it as the current activity. + * The activity is eligible for Handoff to another device afterward. + * + * @param type Uniquely identifies the activity. Maps to NSUserActivity.activityType. + * @param userInfo App-specific state to store for use by another device. + * @param webpageURL The webpage to load in a browser if no suitable app is + * installed on the resuming device. The scheme must be http or https. + * + * Note: This API is only available on macOS. + */ + setUserActivity(type: string, userInfo: Object, webpageURL?: string): void; + /** + * @returns The type of the currently running activity. + * + * Note: This API is only available on macOS. + */ + getCurrentActivityType(): string; /** * Changes the Application User Model ID to id. - */ - setAppUserModelId(id: string): void; - /** - * This method returns true if DWM composition (Aero Glass) is enabled, - * and false otherwise. You can use it to determine if you should create - * a transparent window or not (transparent windows won’t work correctly when DWM composition is disabled). * * Note: This is only implemented on Windows. */ - isAeroGlassEnabled(): boolean; - /** - * @returns If the system is in Dark Mode. - * Note: This is only implemented on OS X. - */ - isDarkMode(): boolean; + setAppUserModelId(id: string): void; /** * Imports the certificate in pkcs12 format into the platform certificate store. * @param callback Called with the result of import operation, a value of 0 indicates success @@ -305,14 +361,46 @@ declare namespace Electron { * Note: This API is only available on Linux. */ importCertificate(options: ImportCertificateOptions, callback: (result: number) => void): void; + /** + * Disables hardware acceleration for current app. + * This method can only be called before app is ready. + */ + disableHardwareAcceleration(): void; + /** + * @returns whether current desktop environment is Unity launcher. (Linux) + * + * Note: This API is only available on Linux. + */ + isUnityRunning(): boolean; + /** + * Returns a Boolean, true if Chrome's accessibility support is enabled, false otherwise. + * This API will return true if the use of assistive technologies, such as screen readers, + * has been detected. + * See https://www.chromium.org/developers/design-documents/accessibility for more details. + * + * Note: This API is only available on macOS and Windows. + */ + isAccessibilitySupportEnabled(): boolean; + /** + * @returns an Object with the login item settings of the app. + * + * Note: This API is only available on macOS and Windows. + */ + getLoginItemSettings(): LoginItemSettings; + /** + * Set the app's login item settings. + * + * Note: This API is only available on macOS and Windows. + */ + setLoginItemSettings(settings: LoginItemSettings): void; commandLine: CommandLine; /** - * Note: This API is only available on Mac. + * Note: This API is only available on macOS. */ dock: Dock; } - type AppPathName = 'home'|'appData'|'userData'|'temp'|'exe'|'module'|'desktop'|'documents'|'downloads'|'music'|'pictures'|'videos'; + type AppPathName = 'home'|'appData'|'userData'|'temp'|'exe'|'module'|'desktop'|'documents'|'downloads'|'music'|'pictures'|'videos'|'pepperFlashSystemPlugin'; interface ImportCertificateOptions { /** @@ -332,7 +420,7 @@ declare namespace Electron { * Note: This will not affect process.argv, and is mainly used by developers * to control some low-level Chromium behaviors. */ - appendSwitch(_switch: string, value?: string|number): void; + appendSwitch(_switch: string, value?: string): void; /** * Append an argument to Chromium's command line. The argument will quoted properly. * @@ -357,43 +445,70 @@ declare namespace Electron { /** * Cancel the bounce of id. * - * Note: This API is only available on Mac. + * Note: This API is only available on macOS. */ cancelBounce(id: number): void; + /** + * Bounces the Downloads stack if the filePath is inside the Downloads folder. + * + * Note: This API is only available on macOS. + */ + downloadFinished(filePath: string): void; /** * Sets the string to be displayed in the dock’s badging area. * - * Note: This API is only available on Mac. + * Note: This API is only available on macOS. */ setBadge(text: string): void; /** * Returns the badge string of the dock. * - * Note: This API is only available on Mac. + * Note: This API is only available on macOS. */ getBadge(): string; + /** + * Sets the counter badge for current app. Setting the count to 0 will hide the badge. + * + * @returns True when the call succeeded, otherwise returns false. + * + * Note: This API is only available on macOS and Linux. + */ + setBadgeCount(count: number): boolean; + /** + * @returns The current value displayed in the counter badge. + * + * Note: This API is only available on macOS and Linux. + */ + getBadgeCount(): number; /** * Hides the dock icon. * - * Note: This API is only available on Mac. + * Note: This API is only available on macOS. */ hide(): void; /** * Shows the dock icon. * - * Note: This API is only available on Mac. + * Note: This API is only available on macOS. */ show(): void; + /** + * @returns Whether the dock icon is visible. + * The app.dock.show() call is asynchronous so this method might not return true immediately after that call. + * + * Note: This API is only available on macOS. + */ + isVisible(): boolean; /** * Sets the application dock menu. * - * Note: This API is only available on Mac. + * Note: This API is only available on macOS. */ setMenu(menu: Menu): void; /** * Sets the image associated with this dock icon. * - * Note: This API is only available on Mac. + * Note: This API is only available on macOS. */ setIcon(icon: NativeImage | string): void; } @@ -430,6 +545,32 @@ declare namespace Electron { iconIndex?: number; } + interface LoginItemSettings { + /** + * True if the app is set to open at login. + */ + openAtLogin: boolean; + /** + * True if the app is set to open as hidden at login. This setting is only supported on macOS. + */ + openAsHidden: boolean; + /** + * True if the app was opened at login automatically. This setting is only supported on macOS. + */ + wasOpenedAtLogin?: boolean; + /** + * True if the app was opened as a hidden login item. This indicates that the app should not + * open any windows at startup. This setting is only supported on macOS. + */ + wasOpenedAsHidden?: boolean; + /** + * True if the app was opened as a login item that should restore the state from the previous session. + * This indicates that the app should restore the windows that were open the last time the app was closed. + * This setting is only supported on macOS. + */ + restoreState?: boolean; + } + // https://github.com/electron/electron/blob/master/docs/api/auto-updater.md /** @@ -460,9 +601,12 @@ declare namespace Electron { on(event: string, listener: Function): this; /** * Set the url and initialize the auto updater. - * The url cannot be changed once it is set. */ - setFeedURL(url: string): void; + setFeedURL(url: string, requestHeaders?: Headers): void; + /** + * @returns The current update feed URL. + */ + getFeedURL(): string; /** * Ask the server whether there is an update, you have to call setFeedURL * before using this API @@ -521,6 +665,10 @@ declare namespace Electron { * Emitted when the window is hidden. */ on(event: 'hide', listener: Function): this; + /** + * Emitted when the web page has been rendered and window can be displayed without visual flash. + */ + on(event: 'ready-to-show', listener: Function): this; /** * Emitted when window is maximized. */ @@ -570,20 +718,23 @@ declare namespace Electron { on(event: 'app-command', listener: (event: Event, command: string) => void): this; /** * Emitted when scroll wheel event phase has begun. - * Note: This is only implemented on OS X. + * Note: This is only implemented on macOS. */ on(event: 'scroll-touch-begin', listener: Function): this; /** * Emitted when scroll wheel event phase has ended. - * Note: This is only implemented on OS X. + * Note: This is only implemented on macOS. */ on(event: 'scroll-touch-end', listener: Function): this; /** * Emitted on 3-finger swipe. - * Note: This is only implemented on OS X. + * Note: This is only implemented on macOS. */ on(event: 'swipe', listener: (event: Event, direction: SwipeDirection) => void): this; on(event: string, listener: Function): this; + /** + * Creates a new BrowserWindow with native properties as set by the options. + */ constructor(options?: BrowserWindowOptions); /** * @returns All opened browser windows. @@ -605,13 +756,23 @@ declare namespace Electron { * Adds devtools extension located at path. The extension will be remembered * so you only need to call this API once, this API is not for programming use. * @returns The extension's name. + * + * Note: This API cannot be called before the ready event of the app module is emitted. */ static addDevToolsExtension(path: string): string; /** * Remove a devtools extension. * @param name The name of the devtools extension to remove. + * + * Note: This API cannot be called before the ready event of the app module is emitted. */ static removeDevToolsExtension(name: string): void; + /** + * @returns devtools extensions. + * + * Note: This API cannot be called before the ready event of the app module is emitted. + */ + static getDevToolsExtensions(): DevToolsExtensions; /** * The WebContents object this window owns, all web page related events and * operations would be done via it. @@ -648,6 +809,10 @@ declare namespace Electron { * @returns Whether the window is focused. */ isFocused(): boolean; + /** + * @returns Whether the window is destroyed. + */ + isDestroyed(): boolean; /** * Shows and gives focus to the window. */ @@ -664,6 +829,10 @@ declare namespace Electron { * @returns Whether the window is visible to the user. */ isVisible(): boolean; + /** + * @returns Whether the window is a modal window. + */ + isModal(): boolean; /** * Maximizes the window. */ @@ -703,9 +872,9 @@ declare namespace Electron { * not included within the aspect ratio calculations. * This API already takes into account the difference between a window’s size and its content size. * - * Note: This API is available only on OS X. + * Note: This API is available only on macOS. */ - setAspectRatio(aspectRatio: number, extraSize?: Dimension): void; + setAspectRatio(aspectRatio: number, extraSize?: Size): void; /** * Resizes and moves the window to width, height, x, y. */ @@ -714,6 +883,14 @@ declare namespace Electron { * @returns The window's width, height, x and y values. */ getBounds(): Rectangle; + /** + * Resizes and moves the window's client area (e.g. the web page) to width, height, x, y. + */ + setContentBounds(options: Rectangle, animate?: boolean): void; + /** + * @returns The window's client area (e.g. the web page) width, height, x and y values. + */ + getContentBounds(): Rectangle; /** * Resizes the window to width and height. */ @@ -756,31 +933,31 @@ declare namespace Electron { isResizable(): boolean; /** * Sets whether the window can be moved by user. On Linux does nothing. - * Note: This API is available only on OS X and Windows. + * Note: This API is available only on macOS and Windows. */ setMovable(movable: boolean): void; /** - * Note: This API is available only on OS X and Windows. + * Note: This API is available only on macOS and Windows. * @returns Whether the window can be moved by user. On Linux always returns true. */ isMovable(): boolean; /** * Sets whether the window can be manually minimized by user. On Linux does nothing. - * Note: This API is available only on OS X and Windows. + * Note: This API is available only on macOS and Windows. */ setMinimizable(minimizable: boolean): void; /** - * Note: This API is available only on OS X and Windows. + * Note: This API is available only on macOS and Windows. * @returns Whether the window can be manually minimized by user. On Linux always returns true. */ isMinimizable(): boolean; /** * Sets whether the window can be manually maximized by user. On Linux does nothing. - * Note: This API is available only on OS X and Windows. + * Note: This API is available only on macOS and Windows. */ setMaximizable(maximizable: boolean): void; /** - * Note: This API is available only on OS X and Windows. + * Note: This API is available only on macOS and Windows. * @returns Whether the window can be manually maximized by user. On Linux always returns true. */ isMaximizable(): boolean; @@ -794,11 +971,11 @@ declare namespace Electron { isFullScreenable(): boolean; /** * Sets whether the window can be manually closed by user. On Linux does nothing. - * Note: This API is available only on OS X and Windows. + * Note: This API is available only on macOS and Windows. */ setClosable(closable: boolean): void; /** - * Note: This API is available only on OS X and Windows. + * Note: This API is available only on macOS and Windows. * @returns Whether the window can be manually closed by user. On Linux always returns true. */ isClosable(): boolean; @@ -834,10 +1011,10 @@ declare namespace Electron { */ getTitle(): string; /** - * Changes the attachment point for sheets on Mac OS X. - * Note: This API is available only on OS X. + * Changes the attachment point for sheets on macOS. + * Note: This API is available only on macOS. */ - setSheetOffset(offset: number): void; + setSheetOffset(offsetY: number, offsetX?: number): void; /** * Starts or stops flashing the window to attract user's attention. */ @@ -855,7 +1032,7 @@ declare namespace Electron { */ isKiosk(): boolean; /** - * The native type of the handle is HWND on Windows, NSView* on OS X, + * The native type of the handle is HWND on Windows, NSView* on macOS, * and Window (unsigned long) on Linux. * @returns The platform-specific handle of the window as Buffer. */ @@ -880,22 +1057,22 @@ declare namespace Electron { /** * Sets the pathname of the file the window represents, and the icon of the * file will show in window's title bar. - * Note: This API is available only on OS X. + * Note: This API is available only on macOS. */ setRepresentedFilename(filename: string): void; /** - * Note: This API is available only on OS X. + * Note: This API is available only on macOS. * @returns The pathname of the file the window represents. */ getRepresentedFilename(): string; /** * Specifies whether the window’s document has been edited, and the icon in * title bar will become grey when set to true. - * Note: This API is available only on OS X. + * Note: This API is available only on macOS. */ setDocumentEdited(edited: boolean): void; /** - * Note: This API is available only on OS X. + * Note: This API is available only on macOS. * @returns Whether the window's document has been edited. */ isDocumentEdited(): boolean; @@ -909,26 +1086,25 @@ declare namespace Electron { * @param callback Supplies the image that stores data of the snapshot. */ capturePage(rect: Rectangle, callback: (image: NativeImage) => void): void; + /** + * Captures the snapshot of page within rect, upon completion the callback + * will be called. Omitting the rect would capture the whole visible page. + * Note: Be sure to read documents on remote buffer in remote if you are going + * to use this API in renderer process. + * @param callback Supplies the image that stores data of the snapshot. + */ capturePage(callback: (image: NativeImage) => void): void; /** - * Same with webContents.print([options]) - */ - print(options?: PrintOptions): void; - /** - * Same with webContents.printToPDF([options]) - */ - printToPDF(options: PrintToPDFOptions, callback: (error: Error, data: Buffer) => void): void; - /** - * Same with webContents.loadURL(url). + * Same as webContents.loadURL(url). */ loadURL(url: string, options?: LoadURLOptions): void; /** - * Same with webContents.reload. + * Same as webContents.reload. */ reload(): void; /** * Sets the menu as the window top menu. - * Note: This API is not available on OS X. + * Note: This API is not available on macOS. */ setMenu(menu: Menu): void; /** @@ -939,7 +1115,13 @@ declare namespace Electron { * @param progress Valid range is [0, 1.0]. If < 0, the progress bar is removed. * If greater than 0, it becomes indeterminate. */ - setProgressBar(progress: number): void; + setProgressBar(progress: number, options?: { + /** + * Mode for the progress bar. + * Note: This is only implemented on Windows. + */ + mode: 'none' | 'normal' | 'indeterminate' | 'error' | 'paused' + }): void; /** * Sets a 16px overlay onto the current Taskbar icon, usually used to convey * some sort of application status or to passively notify the user. @@ -951,11 +1133,11 @@ declare namespace Electron { setOverlayIcon(overlay: NativeImage, description: string): void; /** * Sets whether the window should have a shadow. On Windows and Linux does nothing. - * Note: This API is available only on OS X. + * Note: This API is available only on macOS. */ setHasShadow(hasShadow: boolean): void; /** - * Note: This API is available only on OS X. + * Note: This API is available only on macOS. * @returns whether the window has a shadow. On Windows and Linux always returns true. */ hasShadow(): boolean; @@ -963,13 +1145,33 @@ declare namespace Electron { * Add a thumbnail toolbar with a specified set of buttons to the thumbnail image * of a window in a taskbar button layout. * @returns Whether the thumbnail has been added successfully. + * + * Note: This API is available only on Windows. */ setThumbarButtons(buttons: ThumbarButton[]): boolean; /** - * Shows pop-up dictionary that searches the selected word on the page. - * Note: This API is available only on OS X. + * Sets the region of the window to show as the thumbnail image displayed when hovering + * over the window in the taskbar. You can reset the thumbnail to be the entire window + * by specifying an empty region: {x: 0, y: 0, width: 0, height: 0}. + * + * Note: This API is available only on Windows. + */ + setThumbnailClip(region: Rectangle): boolean; + /** + * Sets the toolTip that is displayed when hovering over the window thumbnail in the taskbar. + * Note: This API is available only on Windows. + */ + setThumbnailToolTip(toolTip: string): boolean; + /** + * Same as webContents.showDefinitionForSelection(). + * Note: This API is available only on macOS. */ showDefinitionForSelection(): void; + /** + * Changes window icon. + * Note: This API is not available on macOS. + */ + setIcon(icon: NativeImage): void; /** * Sets whether the window menu bar should hide itself automatically. Once set * the menu bar will only show when users press the single Alt key. @@ -1001,10 +1203,38 @@ declare namespace Electron { */ isVisibleOnAllWorkspaces(): boolean; /** - * Ignore all moused events that happened in the window. - * Note: This API is available only on OS X. + * Makes the window ignore all mouse events. + * + * All mouse events happened in this window will be passed to the window below this window, + * but if this window has focus, it will still receive keyboard events. */ setIgnoreMouseEvents(ignore: boolean): void; + /** + * Prevents the window contents from being captured by other apps. + * + * On macOS it sets the NSWindow's sharingType to NSWindowSharingNone. + * On Windows it calls SetWindowDisplayAffinity with WDA_MONITOR. + */ + setContentProtection(enable: boolean): void; + /** + * Changes whether the window can be focused. + * Note: This API is available only on Windows. + */ + setFocusable(focusable: boolean): void; + /** + * Sets parent as current window's parent window, + * passing null will turn current window into a top-level window. + * Note: This API is not available on Windows. + */ + setParentWindow(parent: BrowserWindow): void; + /** + * @returns The parent window. + */ + getParentWindow(): BrowserWindow; + /** + * @returns All child windows. + */ + getChildWindows(): BrowserWindow[]; } type SwipeDirection = 'up' | 'right' | 'down' | 'left'; @@ -1018,6 +1248,13 @@ declare namespace Electron { flags?: ThumbarButtonFlags[]; } + interface DevToolsExtensions { + [name: string]: { + name: string; + value: string; + } + } + interface WebPreferences { /** * Whether node integration is enabled. @@ -1116,9 +1353,18 @@ declare namespace Electron { */ directWrite?: boolean; /** - * A list of feature strings separated by ",". + * Enables scroll bounce (rubber banding) effect on macOS. + * Default: false. + */ + scrollBounce?: boolean; + /** + * A list of feature strings separated by ",", like CSSVariables,KeyboardEventKey to enable. */ blinkFeatures?: string; + /** + * A list of feature strings separated by ",", like CSSVariables,KeyboardEventKey to disable. + */ + disableBlinkFeatures?: string; /** * Sets the default font for the font-family. */ @@ -1158,12 +1404,17 @@ declare namespace Electron { defaultEncoding?: string; /** * Whether to throttle animations and timers when the page becomes background. - * Default: true + * Default: true. */ backgroundThrottling?: boolean; + /** + * Whether to enable offscreen rendering for the browser window. + * Default: false. + */ + offscreen?: boolean; } - interface BrowserWindowOptions extends Rectangle { + interface BrowserWindowOptions { /** * Window’s width in pixels. * Default: 800. @@ -1244,6 +1495,14 @@ declare namespace Electron { * Default: true. */ closable?: boolean; + /** + * Whether the window can be focused. + * On Windows setting focusable: false also implies setting skipTaskbar: true. + * On Linux setting focusable: false makes the window stop interacting with wm, + * so the window will always stay on top in all workspaces. + * Default: true. + */ + focusable?: boolean; /** * Whether the window should always stay on top of other windows. * Default: false. @@ -1251,12 +1510,13 @@ declare namespace Electron { alwaysOnTop?: boolean; /** * Whether the window should show in fullscreen. - * When explicity set to false the fullscreen button will be hidden or disabled on OS X. + * When explicitly set to false the fullscreen button will be hidden or disabled on macOS. * Default: false. */ fullscreen?: boolean; /** - * Whether the maximize/zoom button on OS X should toggle full screen mode or maximize window. + * Whether the window can be put into fullscreen mode. + * On macOS, also whether the maximize/zoom button should toggle full screen mode or maximize window. * Default: true. */ fullscreenable?: boolean; @@ -1289,6 +1549,16 @@ declare namespace Electron { * Default: true. */ frame?: boolean; + /** + * Specify parent window. + * Default: null. + */ + parent?: BrowserWindow; + /** + * Whether this is a modal window. This only works when the window is a child window. + * Default: false. + */ + modal?: boolean; /** * Whether the web view accepts a single mouse-down event that simultaneously activates the window. * Default: false. @@ -1316,7 +1586,7 @@ declare namespace Electron { backgroundColor?: string; /** * Whether window should have a shadow. - * Note: This is only implemented on OS X. + * Note: This is only implemented on macOS. * Default: true. */ hasShadow?: boolean; @@ -1339,22 +1609,20 @@ declare namespace Electron { * The style of window title bar. */ titleBarStyle?: 'default' | 'hidden' | 'hidden-inset'; + /** + * Use WS_THICKFRAME style for frameless windows on Windows + */ + thickFrame?: boolean; /** * Settings of web page’s features. */ webPreferences?: WebPreferences; } - type BrowserWindowType = BrowserWindowTypeLinux | BrowserWindowTypeMac; + type BrowserWindowType = BrowserWindowTypeLinux | BrowserWindowTypeMac | BrowserWindowTypeWindows; type BrowserWindowTypeLinux = 'desktop' | 'dock' | 'toolbar' | 'splash' | 'notification'; type BrowserWindowTypeMac = 'desktop' | 'textured'; - - interface Rectangle { - x?: number; - y?: number; - width?: number; - height?: number; - } + type BrowserWindowTypeWindows = 'toolbar'; // https://github.com/electron/electron/blob/master/docs/api/clipboard.md @@ -1373,11 +1641,11 @@ declare namespace Electron { /** * @returns The contents of the clipboard as markup. */ - readHtml(type?: ClipboardType): string; + readHTML(type?: ClipboardType): string; /** * Writes markup to the clipboard. */ - writeHtml(markup: string, type?: ClipboardType): void; + writeHTML(markup: string, type?: ClipboardType): void; /** * @returns The contents of the clipboard as a NativeImage. */ @@ -1389,11 +1657,11 @@ declare namespace Electron { /** * @returns The contents of the clipboard as RTF. */ - readRtf(type?: ClipboardType): string; + readRTF(type?: ClipboardType): string; /** * Writes the text into the clipboard in RTF. */ - writeRtf(text: string, type?: ClipboardType): void; + writeRTF(text: string, type?: ClipboardType): void; /** * Clears everything in clipboard. */ @@ -1422,10 +1690,27 @@ declare namespace Electron { html?: string; image?: NativeImage; }, type?: ClipboardType): void; + /** + * @returns An Object containing title and url keys representing the bookmark in the clipboard. + * + * Note: This API is available on macOS and Windows. + */ + readBookmark(): Bookmark; + /** + * Writes the title and url into the clipboard as a bookmark. + * + * Note: This API is available on macOS and Windows. + */ + writeBookmark(title: string, url: string, type?: ClipboardType): void; } type ClipboardType = '' | 'selection'; + interface Bookmark { + title: string; + url: string; + } + // https://github.com/electron/electron/blob/master/docs/api/content-tracing.md /** @@ -1542,7 +1827,7 @@ declare namespace Electron { /** * You are required to call this method before using other crashReporter APIs. * - * Note: On OS X, Electron uses a new crashpad client, which is different from breakpad + * Note: On macOS, Electron uses a new crashpad client, which is different from breakpad * on Windows and Linux. To enable the crash collection feature, you are required to call * the crashReporter.start API to initialize crashpad in the main process and in each * renderer process from which you wish to collect crash reports. @@ -1615,7 +1900,7 @@ declare namespace Electron { * The suggested size that thumbnail should be scaled. * Default: {width: 150, height: 150} */ - thumbnailSize?: Dimension; + thumbnailSize?: Size; } interface DesktopCapturerSource { @@ -1699,6 +1984,10 @@ declare namespace Electron { interface OpenDialogOptions { title?: string; defaultPath?: string; + /** + * Custom label for the confirmation button, when left empty the default label will be used. + */ + buttonLabel?: string; /** * File types that can be displayed or selected. */ @@ -1713,12 +2002,16 @@ declare namespace Electron { /** * Contains which features the dialog should use. */ - properties?: ('openFile' | 'openDirectory' | 'multiSelections' | 'createDirectory')[]; + properties?: ('openFile' | 'openDirectory' | 'multiSelections' | 'createDirectory' | 'showHiddenFiles')[]; } interface SaveDialogOptions { title?: string; defaultPath?: string; + /** + * Custom label for the confirmation button, when left empty the default label will be used. + */ + buttonLabel?: string; /** * File types that can be displayed, see dialog.showOpenDialog for an example. */ @@ -1734,7 +2027,7 @@ declare namespace Electron { */ type?: 'none' | 'info' | 'error' | 'question' | 'warning'; /** - * Texts for buttons. + * Texts for buttons. On Windows, an empty array will result in one button labeled "OK". */ buttons?: string[]; /** @@ -1757,7 +2050,7 @@ declare namespace Electron { /** * The value will be returned when user cancels the dialog instead of clicking the buttons of the dialog. * By default it is the index of the buttons that have "cancel" or "no" as label, - * or 0 if there is no such buttons. On OS X and Windows the index of "Cancel" button + * or 0 if there is no such buttons. On macOS and Windows the index of "Cancel" button * will always be used as cancelId, not matter whether it is already specified. */ cancelId?: number; @@ -1777,9 +2070,9 @@ declare namespace Electron { */ interface DownloadItem extends NodeJS.EventEmitter { /** - * Emits when the downloadItem gets updated. + * Emitted when the download has been updated and is not done. */ - on(event: 'updated', listener: Function): this; + on(event: 'updated', listener: (event: Event, state: 'progressing' | 'interrupted') => void): this; /** * Emits when the download is in a terminal state. This includes a completed download, * a cancelled download (via downloadItem.cancel()), and interrupted download that can’t be resumed. @@ -1793,14 +2086,27 @@ declare namespace Electron { * routine to determine the save path (Usually prompts a save dialog). */ setSavePath(path: string): void; + /** + * @returns The save path of the download item. + * This will be either the path set via downloadItem.setSavePath(path) or the path selected from the shown save dialog. + */ + getSavePath(): string; /** * Pauses the download. */ pause(): void; + /** + * @returns Whether the download is paused. + */ + isPaused(): boolean; /** * Resumes the download that has been paused. */ resume(): void; + /** + * @returns Whether the download can resume. + */ + canResume(): boolean; /** * Cancels the download operation. */ @@ -1836,6 +2142,10 @@ declare namespace Electron { * @returns The Content-Disposition field from the response header. */ getContentDisposition(): string; + /** + * @returns The current state. + */ + getState(): 'progressing' | 'completed' | 'cancelled' | 'interrupted'; } // https://github.com/electron/electron/blob/master/docs/api/global-shortcut.md @@ -1956,7 +2266,7 @@ declare namespace Electron { */ constructor(options: MenuItemOptions); - click: (menuItem: MenuItem, browserWindow: BrowserWindow) => void; + click: (menuItem: MenuItem, browserWindow: BrowserWindow, event: Event) => void; /** * Read-only property. */ @@ -1986,8 +2296,8 @@ declare namespace Electron { } type MenuItemType = 'normal' | 'separator' | 'submenu' | 'checkbox' | 'radio'; - type MenuItemRole = 'undo' | 'redo' | 'cut' | 'copy' | 'paste' | 'selectall' | 'minimize' | 'close'; - type MenuItemRoleMac = 'about' | 'hide' | 'hideothers' | 'unhide' | 'front' | 'window' | 'help' | 'services'; + type MenuItemRole = 'undo' | 'redo' | 'cut' | 'copy' | 'paste' | 'pasteandmatchstyle' | 'selectall' | 'delete' | 'minimize' | 'close' | 'quit' | 'togglefullscreen' | 'resetzoom' | 'zoomin' | 'zoomout'; + type MenuItemRoleMac = 'about' | 'hide' | 'hideothers' | 'unhide' | 'startspeaking' | 'stopspeaking' | 'front' | 'zoom' | 'window' | 'help' | 'services'; interface MenuItemOptions { /** @@ -2010,13 +2320,13 @@ declare namespace Electron { * * Platform notice: * On Linux and Windows, the Command key would not have any effect, - * you can use CommandOrControl which represents Command on OS X and Control on + * you can use CommandOrControl which represents Command on macOS and Control on * Linux and Windows to define some accelerators. * - * Use Alt instead of Option. The Option key only exists on OS X, whereas + * Use Alt instead of Option. The Option key only exists on macOS, whereas * the Alt key is available on all platforms. * - * The Super key is mapped to the Windows key on Windows and Linux and Cmd on OS X. + * The Super key is mapped to the Windows key on Windows and Linux and Cmd on macOS. * * Available modifiers: * Command (or Cmd for short) @@ -2035,6 +2345,7 @@ declare namespace Electron { * Punctuations like ~, !, @, #, $, etc. * Plus * Space + * Tab * Backspace * Delete * Insert @@ -2101,16 +2412,20 @@ declare namespace Electron { */ constructor(); /** - * Sets menu as the application menu on OS X. On Windows and Linux, the menu + * Sets menu as the application menu on macOS. On Windows and Linux, the menu * will be set as each window's top menu. */ static setApplicationMenu(menu: Menu): void; + /** + * @returns The application menu if set, or null if not set. + */ + static getApplicationMenu(): Menu; /** * Sends the action to the first responder of application. * This is used for emulating default Cocoa menu behaviors, * usually you would just use the role property of MenuItem. * - * Note: This method is OS X only. + * Note: This method is macOS only. */ static sendActionToFirstResponder(action: string): void; /** @@ -2120,7 +2435,7 @@ declare namespace Electron { */ static buildFromTemplate(template: MenuItemOptions[]): Menu; /** - * Popups this menu as a context menu in the browserWindow. You can optionally + * Pops up this menu as a context menu in the browserWindow. You can optionally * provide a (x,y) coordinate to place the menu at, otherwise it will be placed * at the current mouse cursor position. * @param x Horizontal coordinate where the menu will be placed. @@ -2165,20 +2480,32 @@ declare namespace Electron { */ static createFromDataURL(dataURL: string): NativeImage; /** - * @returns Buffer Contains the image's PNG encoded data. + * @returns Buffer that contains the image's PNG encoded data. */ - toPng(): Buffer; + toPNG(): Buffer; /** - * @returns Buffer Contains the image's JPEG encoded data. + * @returns Buffer that contains the image's JPEG encoded data. */ - toJpeg(quality: number): Buffer; + toJPEG(quality: number): Buffer; + /** + * @returns Buffer that contains a copy of the image's raw bitmap pixel data. + */ + toBitmap(): Buffer; + /** + * @returns Buffer that contains the image's raw bitmap pixel data. + * + * The difference between getBitmap() and toBitmap() is, getBitmap() does not copy the bitmap data, + * so you have to use the returned Buffer immediately in current event loop tick, + * otherwise the data might be changed or destroyed. + */ + getBitmap(): Buffer; /** * @returns string The data URL of the image. */ toDataURL(): string; /** - * The native type of the handle is NSImage* on OS X. - * Note: This is only implemented on OS X. + * The native type of the handle is NSImage* on macOS. + * Note: This is only implemented on macOS. * @returns The platform-specific handle of the image as Buffer. */ getNativeHandle(): Buffer; @@ -2189,7 +2516,7 @@ declare namespace Electron { /** * @returns {} The size of the image. */ - getSize(): Dimension; + getSize(): Size; /** * Marks the image as template image. */ @@ -2268,19 +2595,19 @@ declare namespace Electron { /** * Registers a protocol of scheme that will send the file as a response. */ - registerFileProtocol(scheme: string, handler: (request: ProtocolRequest, callback: FileProtocolCallback) => void, completion?: (error: Error) => void): void; + registerFileProtocol(scheme: string, handler: FileProtocolHandler, completion?: (error: Error) => void): void; /** * Registers a protocol of scheme that will send a Buffer as a response. */ - registerBufferProtocol(scheme: string, handler: (request: ProtocolRequest, callback: BufferProtocolCallback) => void, completion?: (error: Error) => void): void; + registerBufferProtocol(scheme: string, handler: BufferProtocolHandler, completion?: (error: Error) => void): void; /** * Registers a protocol of scheme that will send a String as a response. */ - registerStringProtocol(scheme: string, handler: (request: ProtocolRequest, callback: StringProtocolCallback) => void, completion?: (error: Error) => void): void; + registerStringProtocol(scheme: string, handler: StringProtocolHandler, completion?: (error: Error) => void): void; /** * Registers a protocol of scheme that will send an HTTP request as a response. */ - registerHttpProtocol(scheme: string, handler: (request: ProtocolRequest, callback: HttpProtocolCallback) => void, completion?: (error: Error) => void): void; + registerHttpProtocol(scheme: string, handler: HttpProtocolHandler, completion?: (error: Error) => void): void; /** * Unregisters the custom protocol of scheme. */ @@ -2292,25 +2619,30 @@ declare namespace Electron { /** * Intercepts scheme protocol and uses handler as the protocol’s new handler which sends a file as a response. */ - interceptFileProtocol(scheme: string, handler: (request: ProtocolRequest, callback: FileProtocolCallback) => void, completion?: (error: Error) => void): void; - /** - * Intercepts scheme protocol and uses handler as the protocol’s new handler which sends a String as a response. - */ - interceptStringProtocol(scheme: string, handler: (request: ProtocolRequest, callback: BufferProtocolCallback) => void, completion?: (error: Error) => void): void; + interceptFileProtocol(scheme: string, handler: FileProtocolHandler, completion?: (error: Error) => void): void; /** * Intercepts scheme protocol and uses handler as the protocol’s new handler which sends a Buffer as a response. */ - interceptBufferProtocol(scheme: string, handler: (request: ProtocolRequest, callback: StringProtocolCallback) => void, completion?: (error: Error) => void): void; + interceptBufferProtocol(scheme: string, handler: BufferProtocolHandler, completion?: (error: Error) => void): void; + /** + * Intercepts scheme protocol and uses handler as the protocol’s new handler which sends a String as a response. + */ + interceptStringProtocol(scheme: string, handler: StringProtocolHandler, completion?: (error: Error) => void): void; /** * Intercepts scheme protocol and uses handler as the protocol’s new handler which sends a new HTTP request as a response. */ - interceptHttpProtocol(scheme: string, handler: (request: ProtocolRequest, callback: HttpProtocolCallback) => void, completion?: (error: Error) => void): void; + interceptHttpProtocol(scheme: string, handler: HttpProtocolHandler, completion?: (error: Error) => void): void; /** * Remove the interceptor installed for scheme and restore its original handler. */ uninterceptProtocol(scheme: string, completion?: (error: Error) => void): void; } + type FileProtocolHandler = (request: ProtocolRequest, callback: FileProtocolCallback) => void; + type BufferProtocolHandler = (request: ProtocolRequest, callback: BufferProtocolCallback) => void; + type StringProtocolHandler = (request: ProtocolRequest, callback: StringProtocolCallback) => void; + type HttpProtocolHandler = (request: ProtocolRequest, callback: HttpProtocolCallback) => void; + interface ProtocolRequest { url: string; referrer: string; @@ -2407,38 +2739,21 @@ declare namespace Electron { * Unique identifier associated with the display. */ id: number; - bounds: Bounds; - workArea: Bounds; - size: Dimension; - workAreaSize: Dimension; + bounds: Rectangle; + workArea: Rectangle; + size: Size; + workAreaSize: Size; /** * Output device’s pixel scale factor. */ scaleFactor: number; /** - * Can be 0, 1, 2, 3, each represents screen rotation in clock-wise degrees of 0, 90, 180, 270. + * Can be 0, 90, 180, 270, represents screen rotation in clock-wise degrees. */ rotation: number; touchSupport: 'available' | 'unavailable' | 'unknown'; } - type Bounds = { - x: number; - y: number; - width: number; - height: number; - } - - type Dimension = { - width: number; - height: number; - } - - type Point = { - x: number; - y: number; - } - type DisplayMetrics = 'bounds' | 'workArea' | 'scaleFactor' | 'rotation'; /** @@ -2478,7 +2793,7 @@ declare namespace Electron { /** * @returns The display that most closely intersects the provided bounds. */ - getDisplayMatching(rect: Bounds): Display; + getDisplayMatching(rect: Rectangle): Display; } // https://github.com/electron/electron/blob/master/docs/api/session.md @@ -2492,7 +2807,7 @@ declare namespace Electron { /** * @returns a new Session instance from partition string. */ - static fromPartition(partition: string): Session; + static fromPartition(partition: string, options?: FromPartitionOptions): Session; /** * @returns the default session object of the app. */ @@ -2531,7 +2846,7 @@ declare namespace Electron { /** * Sets the proxy settings. */ - setProxy(config: string, callback: Function): void; + setProxy(config: ProxyConfig, callback: Function): void; /** * Resolves the proxy information for url. */ @@ -2565,14 +2880,40 @@ declare namespace Electron { * Clears the host resolver cache. */ clearHostResolverCache(callback: Function): void; + /** + * Dynamically sets whether to always send credentials for HTTP NTLM or Negotiate authentication. + * @param domains Comma-seperated list of servers for which integrated authentication is enabled. + */ + allowNTLMCredentialsForDomains(domains: string): void; + /** + * Overrides the userAgent and acceptLanguages for this session. + * The acceptLanguages must a comma separated ordered list of language codes, for example "en-US,fr,de,ko,zh-CN,ja". + * This doesn't affect existing WebContents, and each WebContents can use webContents.setUserAgent to override the session-wide user agent. + */ + setUserAgent(userAgent: string, acceptLanguages?: string): void; + /** + * @returns The user agent for this session. + */ + getUserAgent(): string; /** * The webRequest API set allows to intercept and modify contents of a request at various stages of its lifetime. */ webRequest: WebRequest; + /** + * @returns An instance of protocol module for this session. + */ + protocol: Protocol; } type Permission = 'media' | 'geolocation' | 'notifications' | 'midiSysex' | 'pointerLock' | 'fullscreen' | 'openExternal'; + interface FromPartitionOptions { + /** + * Whether to enable cache. + */ + cache?: boolean; + } + interface ClearStorageDataOptions { /** * Should follow window.location.origin’s representation scheme://host:port. @@ -2588,6 +2929,21 @@ declare namespace Electron { quotas?: ('temporary' | 'persistent' | 'syncable')[]; } + interface ProxyConfig { + /** + * The URL associated with the PAC file. + */ + pacScript: string; + /** + * Rules indicating which proxies to use. + */ + proxyRules: string; + /** + * Rules indicating which URLs should bypass the proxy settings. + */ + proxyBypassRules: string; + } + interface NetworkEmulationOptions { /** * Whether to emulate network outage. @@ -2948,6 +3304,131 @@ declare namespace Electron { * Play the beep sound. */ beep(): void; + /** + * Creates or updates a shortcut link at shortcutPath. + * + * Note: This API is available only on Windows. + */ + writeShortcutLink(shortcutPath: string, options: ShortcutLinkOptions): boolean; + /** + * Creates or updates a shortcut link at shortcutPath. + * + * Note: This API is available only on Windows. + */ + writeShortcutLink(shortcutPath: string, operation: 'create' | 'update' | 'replace', options: ShortcutLinkOptions): boolean; + /** + * Resolves the shortcut link at shortcutPath. + * An exception will be thrown when any error happens. + * + * Note: This API is available only on Windows. + */ + readShortcutLink(shortcutPath: string): ShortcutLinkOptions; + } + + interface ShortcutLinkOptions { + /** + * The target to launch from this shortcut. + */ + target: string; + /** + * The working directory. + * Default: empty. + */ + cwd?: string; + /** + * The arguments to be applied to target when launching from this shortcut. + * Default: empty. + */ + args?: string; + /** + * The description of the shortcut. + * Default: empty. + */ + description?: string; + /** + * The path to the icon, can be a DLL or EXE. icon and iconIndex have to be set together. + * Default: empty, which uses the target's icon. + */ + icon?: string; + /** + * The resource ID of icon when icon is a DLL or EXE. + * Default: 0. + */ + iconIndex?: number; + /** + * The Application User Model ID. + * Default: empty. + */ + appUserModelId?: string; + } + + // https://github.com/electron/electron/blob/master/docs/api/system-preferences.md + + /** + * Get system preferences. + */ + interface SystemPreferences { + /** + * @returns If the system is in Dark Mode. + * + * Note: This is only implemented on macOS. + */ + isDarkMode(): boolean; + /** + * @returns If the Swipe between pages setting is on. + * + * Note: This is only implemented on macOS. + */ + isSwipeTrackingFromScrollEventsEnabled(): boolean; + /** + * Posts event as native notifications of macOS. + * The userInfo contains the user information dictionary sent along with the notification. + * + * Note: This is only implemented on macOS. + */ + postNotification(event: string, userInfo: Object): void; + /** + * Posts event as native notifications of macOS. + * The userInfo contains the user information dictionary sent along with the notification. + * + * Note: This is only implemented on macOS. + */ + postLocalNotification(event: string, userInfo: Object): void; + /** + * Subscribes to native notifications of macOS, callback will be called when the corresponding event happens. + * The id of the subscriber is returned, which can be used to unsubscribe the event. + * + * Note: This is only implemented on macOS. + */ + subscribeNotification(event: string, callback: (event: Event, userInfo: Object) => void): number; + /** + * Removes the subscriber with id. + * + * Note: This is only implemented on macOS. + */ + unsubscribeNotification(id: number): void; + /** + * Same as subscribeNotification, but uses NSNotificationCenter for local defaults. + */ + subscribeLocalNotification(event: string, callback: (event: Event, userInfo: Object) => void): number; + /** + * Same as unsubscribeNotification, but removes the subscriber from NSNotificationCenter. + */ + unsubscribeLocalNotification(id: number): void; + /** + * Get the value of key in system preferences. + * + * Note: This is only implemented on macOS. + */ + getUserDefault(key: string, type: 'string' | 'boolean' | 'integer' | 'float' | 'double' | 'url' | 'array' | 'dictionary'): any; + /** + * This method returns true if DWM composition (Aero Glass) is enabled, + * and false otherwise. You can use it to determine if you should create + * a transparent window or not (transparent windows won’t work correctly when DWM composition is disabled). + * + * Note: This is only implemented on Windows. + */ + isAeroGlassEnabled(): boolean; } // https://github.com/electron/electron/blob/master/docs/api/tray.md @@ -2958,19 +3439,19 @@ declare namespace Electron { interface Tray extends NodeJS.EventEmitter { /** * Emitted when the tray icon is clicked. - * Note: The bounds payload is only implemented on OS X and Windows. + * Note: The bounds payload is only implemented on macOS and Windows. */ - on(event: 'click', listener: (modifiers: Modifiers, bounds: Bounds) => void): this; + on(event: 'click', listener: (modifiers: Modifiers, bounds: Rectangle) => void): this; /** * Emitted when the tray icon is right clicked. - * Note: This is only implemented on OS X and Windows. + * Note: This is only implemented on macOS and Windows. */ - on(event: 'right-click', listener: (modifiers: Modifiers, bounds: Bounds) => void): this; + on(event: 'right-click', listener: (modifiers: Modifiers, bounds: Rectangle) => void): this; /** * Emitted when the tray icon is double clicked. - * Note: This is only implemented on OS X and Windows. + * Note: This is only implemented on macOS and Windows. */ - on(event: 'double-click', listener: (modifiers: Modifiers, bounds: Bounds) => void): this; + on(event: 'double-click', listener: (modifiers: Modifiers, bounds: Rectangle) => void): this; /** * Emitted when the tray balloon shows. * Note: This is only implemented on Windows. @@ -2988,27 +3469,32 @@ declare namespace Electron { on(event: 'balloon-closed', listener: Function): this; /** * Emitted when any dragged items are dropped on the tray icon. - * Note: This is only implemented on OS X. + * Note: This is only implemented on macOS. */ on(event: 'drop', listener: Function): this; /** * Emitted when dragged files are dropped in the tray icon. - * Note: This is only implemented on OS X + * Note: This is only implemented on macOS */ on(event: 'drop-files', listener: (event: Event, files: string[]) => void): this; + /** + * Emitted when dragged text is dropped in the tray icon. + * Note: This is only implemented on macOS + */ + on(event: 'drop-text', listener: (event: Event, text: string) => void): this; /** * Emitted when a drag operation enters the tray icon. - * Note: This is only implemented on OS X + * Note: This is only implemented on macOS */ on(event: 'drag-enter', listener: Function): this; /** * Emitted when a drag operation exits the tray icon. - * Note: This is only implemented on OS X + * Note: This is only implemented on macOS */ on(event: 'drag-leave', listener: Function): this; /** * Emitted when a drag operation ends on the tray or ends at another location. - * Note: This is only implemented on OS X + * Note: This is only implemented on macOS */ on(event: 'drag-end', listener: Function): this; on(event: string, listener: Function): this; @@ -3034,14 +3520,14 @@ declare namespace Electron { setToolTip(toolTip: string): void; /** * Sets the title displayed aside of the tray icon in the status bar. - * Note: This is only implemented on OS X. + * Note: This is only implemented on macOS. */ setTitle(title: string): void; /** - * Sets whether the tray icon is highlighted when it is clicked. - * Note: This is only implemented on OS X. + * Sets when the tray's icon background becomes highlighted. + * Note: This is only implemented on macOS. */ - setHighlightMode(highlight: boolean): void; + setHighlightMode(mode: 'selection' | 'always' | 'never'): void; /** * Displays a tray balloon. * Note: This is only implemented on Windows. @@ -3052,16 +3538,20 @@ declare namespace Electron { content?: string; }): void; /** - * Popups the context menu of tray icon. When menu is passed, + * Pops up the context menu of tray icon. When menu is passed, * the menu will showed instead of the tray's context menu. * The position is only available on Windows, and it is (0, 0) by default. - * Note: This is only implemented on OS X and Windows. + * Note: This is only implemented on macOS and Windows. */ popUpContextMenu(menu?: Menu, position?: Point): void; /** * Sets the context menu for this icon. */ setContextMenu(menu: Menu): void; + /** + * @returns The bounds of this tray icon. + */ + getBounds(): Rectangle; } interface Modifiers { @@ -3071,8 +3561,31 @@ declare namespace Electron { metaKey: boolean; } + interface DragItem { + /** + * The absolute path of the file to be dragged + */ + file: string; + /** + * The image showing under the cursor when dragging. + */ + icon: NativeImage; + } + // https://github.com/electron/electron/blob/master/docs/api/web-contents.md + interface WebContentsStatic { + /** + * @returns An array of all web contents. This will contain web contents for all windows, + * webviews, opened devtools, and devtools extension background pages. + */ + getAllWebContents(): WebContents[]; + /** + * @returns The web contents that is focused in this application, otherwise returns null. + */ + getFocusedWebContents(): WebContents; + } + /** * A WebContents is responsible for rendering and controlling a web page. */ @@ -3244,12 +3757,32 @@ declare namespace Electron { * */ on(event: 'did-change-theme-color', listener: Function): this; + /** + * Emitted when mouse moves over a link or the keyboard moves the focus to a link. + */ + on(event: 'update-target-url', listener: (event: Event, url: string) => void): this; /** * Emitted when the cursor’s type changes. * If the type parameter is custom, the image parameter will hold the custom cursor image - * in a NativeImage, and the scale will hold scaling information for the image. + * in a NativeImage, and scale, size and hotspot will hold additional information about the custom cursor. */ - on(event: 'cursor-changed', listener: (event: Event, type: CursorType, image?: NativeImage, scale?: number) => void): this; + on(event: 'cursor-changed', listener: (event: Event, type: CursorType, image?: NativeImage, scale?: number, size?: Size, hotspot?: Point) => void): this; + /** + * Emitted when there is a new context menu that needs to be handled. + */ + on(event: 'context-menu', listener: (event: Event, params: ContextMenuParams) => void): this; + /** + * Emitted when bluetooth device needs to be selected on call to navigator.bluetooth.requestDevice. + * To use navigator.bluetooth api webBluetooth should be enabled. + * If event.preventDefault is not called, first available device will be selected. + * callback should be called with deviceId to be selected, + * passing empty string to callback will cancel the request. + */ + on(event: 'select-bluetooth-device', listener: (event: Event, deviceList: BluetoothDevice[], callback: (deviceId: string) => void) => void): this; + /** + * Emitted when a new frame is generated. Only the dirty area is passed in the buffer. + */ + on(event: 'paint', listener: (event: Event, dirtyRect: Rectangle, image: NativeImage) => void): this; on(event: string, listener: Function): this; /** * Loads the url in the window. @@ -3360,47 +3893,74 @@ declare namespace Electron { */ isAudioMuted(): boolean; /** - * Executes Edit -> Undo command in page. + * Changes the zoom factor to the specified factor. + * Zoom factor is zoom percent divided by 100, so 300% = 3.0. + */ + setZoomFactor(factor: number): void; + /** + * Sends a request to get current zoom factor. + */ + getZoomFactor(callback: (zoomFactor: number) => void): void; + /** + * Changes the zoom level to the specified level. + * The original size is 0 and each increment above or below represents + * zooming 20% larger or smaller to default limits of 300% and 50% of original size, respectively. + */ + setZoomLevel(level: number): void; + /** + * Sends a request to get current zoom level. + */ + getZoomLevel(callback: (zoomLevel: number) => void): void; + /** + * Sets the maximum and minimum zoom level. + */ + setZoomLevelLimits(minimumLevel: number, maximumLevel: number): void; + /** + * Executes the editing command undo in web page. */ undo(): void; /** - * Executes Edit -> Redo command in page. + * Executes the editing command redo in web page. */ redo(): void; /** - * Executes Edit -> Cut command in page. + * Executes the editing command cut in web page. */ cut(): void; /** - * Executes Edit -> Copy command in page. + * Executes the editing command copy in web page. */ copy(): void; /** - * Executes Edit -> Paste command in page. + * Copy the image at the given position to the clipboard. + */ + copyImageAt(x: number, y: number): void; + /** + * Executes the editing command paste in web page. */ paste(): void; /** - * Executes Edit -> Paste and Match Style in page. + * Executes the editing command pasteAndMatchStyle in web page. */ pasteAndMatchStyle(): void; /** - * Executes Edit -> Delete command in page. + * Executes the editing command delete in web page. */ delete(): void; /** - * Executes Edit -> Select All command in page. + * Executes the editing command selectAll in web page. */ selectAll(): void; /** - * Executes Edit -> Unselect command in page. + * Executes the editing command unselect in web page. */ unselect(): void; /** - * Executes Edit -> Replace command in page. + * Executes the editing command replace in web page. */ replace(text: string): void; /** - * Executes Edit -> Replace Misspelling command in page. + * Executes the editing command replaceMisspelling in web page. */ replaceMisspelling(text: string): void; /** @@ -3502,16 +4062,12 @@ declare namespace Electron { * Begin subscribing for presentation events and captured frames, * The callback will be called when there is a presentation event. */ - beginFrameSubscription(callback: ( - /** - * The frameBuffer is a Buffer that contains raw pixel data. - * On most machines, the pixel data is effectively stored in 32bit BGRA format, - * but the actual representation depends on the endianness of the processor - * (most modern processors are little-endian, on machines with big-endian - * processors the data is in 32bit ARGB format). - */ - frameBuffer: Buffer - ) => void): void; + beginFrameSubscription(onlyDirty: boolean, callback: BeginFrameSubscriptionCallback): void; + /** + * Begin subscribing for presentation events and captured frames, + * The callback will be called when there is a presentation event. + */ + beginFrameSubscription(callback: BeginFrameSubscriptionCallback): void; /** * End subscribing for frame presentation events. */ @@ -3520,6 +4076,52 @@ declare namespace Electron { * @returns If the process of saving page has been initiated successfully. */ savePage(fullPath: string, saveType: 'HTMLOnly' | 'HTMLComplete' | 'MHTML', callback?: (eror: Error) => void): boolean; + /** + * Shows pop-up dictionary that searches the selected word on the page. + * Note: This API is available only on macOS. + */ + showDefinitionForSelection(): void; + /** + * @returns Whether offscreen rendering is enabled. + */ + isOffscreen(): boolean; + /** + * If offscreen rendering is enabled and not painting, start painting. + */ + startPainting(): void; + /** + * If offscreen rendering is enabled and painting, stop painting. + */ + stopPainting(): void; + /** + * If offscreen rendering is enabled returns whether it is currently painting. + */ + isPainting(): boolean; + /** + * If offscreen rendering is enabled sets the frame rate to the specified number. + * Only values between 1 and 60 are accepted. + */ + setFrameRate(fps: number): void; + /** + * If offscreen rendering is enabled returns the current frame rate. + */ + getFrameRate(): number; + /** + * Sets the item as dragging item for current drag-drop operation. + */ + startDrag(item: DragItem): void; + /** + * Captures a snapshot of the page within rect. + */ + capturePage(callback: (image: NativeImage) => void): void; + /** + * Captures a snapshot of the page within rect. + */ + capturePage(rect: Rectangle, callback: (image: NativeImage) => void): void; + /** + * @returns The unique ID of this WebContents. + */ + id: number; /** * @returns The session object used by this webContents. */ @@ -3540,6 +4142,167 @@ declare namespace Electron { debugger: Debugger; } + interface BeginFrameSubscriptionCallback { + ( + /** + * The frameBuffer is a Buffer that contains raw pixel data. + * On most machines, the pixel data is effectively stored in 32bit BGRA format, + * but the actual representation depends on the endianness of the processor + * (most modern processors are little-endian, on machines with big-endian + * processors the data is in 32bit ARGB format). + */ + frameBuffer: Buffer, + /** + * The dirtyRect is an object with x, y, width, height properties that describes which part of the page was repainted. + * If onlyDirty is set to true, frameBuffer will only contain the repainted area. onlyDirty defaults to false. + */ + dirtyRect?: Rectangle + ): void + } + + interface ContextMenuParams { + /** + * x coordinate + */ + x: number; + /** + * y coordinate + */ + y: number; + /** + * URL of the link that encloses the node the context menu was invoked on. + */ + linkURL: string; + /** + * Text associated with the link. May be an empty string if the contents of the link are an image. + */ + linkText: string; + /** + * URL of the top level page that the context menu was invoked on. + */ + pageURL: string; + /** + * URL of the subframe that the context menu was invoked on. + */ + frameURL: string; + /** + * Source URL for the element that the context menu was invoked on. + * Elements with source URLs are images, audio and video. + */ + srcURL: string; + /** + * Type of the node the context menu was invoked on. + */ + mediaType: 'none' | 'image' | 'audio' | 'video' | 'canvas' | 'file' | 'plugin'; + /** + * Parameters for the media element the context menu was invoked on. + */ + mediaFlags: { + /** + * Whether the media element has crashed. + */ + inError: boolean; + /** + * Whether the media element is paused. + */ + isPaused: boolean; + /** + * Whether the media element is muted. + */ + isMuted: boolean; + /** + * Whether the media element has audio. + */ + hasAudio: boolean; + /** + * Whether the media element is looping. + */ + isLooping: boolean; + /** + * Whether the media element's controls are visible. + */ + isControlsVisible: boolean; + /** + * Whether the media element's controls are toggleable. + */ + canToggleControls: boolean; + /** + * Whether the media element can be rotated. + */ + canRotate: boolean; + } + /** + * Whether the context menu was invoked on an image which has non-empty contents. + */ + hasImageContents: boolean; + /** + * Whether the context is editable. + */ + isEditable: boolean; + /** + * These flags indicate whether the renderer believes it is able to perform the corresponding action. + */ + editFlags: { + /** + * Whether the renderer believes it can undo. + */ + canUndo: boolean; + /** + * Whether the renderer believes it can redo. + */ + canRedo: boolean; + /** + * Whether the renderer believes it can cut. + */ + canCut: boolean; + /** + * Whether the renderer believes it can copy + */ + canCopy: boolean; + /** + * Whether the renderer believes it can paste. + */ + canPaste: boolean; + /** + * Whether the renderer believes it can delete. + */ + canDelete: boolean; + /** + * Whether the renderer believes it can select all. + */ + canSelectAll: boolean; + } + /** + * Text of the selection that the context menu was invoked on. + */ + selectionText: string; + /** + * Title or alt text of the selection that the context was invoked on. + */ + titleText: string; + /** + * The misspelled word under the cursor, if any. + */ + misspelledWord: string; + /** + * The character encoding of the frame on which the menu was invoked. + */ + frameCharset: string; + /** + * If the context menu was invoked on an input field, the type of that field. + */ + inputFieldType: 'none' | 'plainText' | 'password' | 'other'; + /** + * Input source that invoked the context menu. + */ + menuSourceType: 'none' | 'mouse' | 'keyboard' | 'touch' | 'touchMenu'; + } + + interface BluetoothDevice { + deviceName: string; + deviceId: string; + } + interface Headers { [key: string]: string; } @@ -3548,8 +4311,8 @@ declare namespace Electron { /** * Specifies the action to take place when ending webContents.findInPage request. - * 'clearSelection' - Translate the selection into a normal selection. - * 'keepSelection' - Clear the selection. + * 'clearSelection' - Clear the selection. + * 'keepSelection' - Translate the selection into a normal selection. * 'activateSelection' - Focus and click the selection node. */ type StopFindInPageAtion = 'clearSelection' | 'keepSelection' | 'activateSelection'; @@ -3597,7 +4360,7 @@ declare namespace Electron { * Specify page size of the generated PDF. * Default: A4. */ - pageSize?: 'A3' | 'A4' | 'A5' | 'Legal' | 'Letter' | 'Tabloid'; + pageSize?: 'A3' | 'A4' | 'A5' | 'Legal' | 'Letter' | 'Tabloid' | Size; /** * Whether to print CSS backgrounds. * Default: false. @@ -3617,10 +4380,33 @@ declare namespace Electron { interface Certificate { /** - * PEM encoded data + * PEM encoded data. */ data: Buffer; + /** + * Issuer's Common Name. + */ issuerName: string; + /** + * Subject's Common Name. + */ + subjectName: string; + /** + * Hex value represented string. + */ + serialNumber: string; + /** + * Start date of the certificate being valid in seconds. + */ + validStart: number; + /** + * End date of the certificate being valid in seconds. + */ + validExpiry: number; + /** + * Fingerprint of the certificate. + */ + fingerprint: string; } interface LoginRequest { @@ -3679,7 +4465,7 @@ declare namespace Electron { /** * Coordinates of first match region. */ - selectionArea?: Bounds; + selectionArea?: Rectangle; } interface DeviceEmulationParameters { @@ -3691,7 +4477,7 @@ declare namespace Electron { /** * Set the emulated screen size (screenPosition == mobile) */ - screenSize?: Dimension; + screenSize?: Size; /** * Position the view on the screen (screenPosition == mobile) * Default: {x: 0, y: 0} @@ -3705,7 +4491,7 @@ declare namespace Electron { /** * Set the emulated view size (empty means no override). */ - viewSize?: Dimension; + viewSize?: Size; /** * Whether emulated view should be scaled down if necessary to fit into available space * Default: false @@ -3750,7 +4536,7 @@ declare namespace Electron { wheelTicksY?: number; accelerationRatioX?: number; accelerationRatioY?: number; - hasPreciseScrollingDeltas?: number; + hasPreciseScrollingDeltas?: boolean; canScroll?: boolean; } @@ -3855,6 +4641,32 @@ declare namespace Electron { * this limitation. */ executeJavaScript(code: string, userGesture?: boolean, callback?: (result: any) => void): void; + /** + * @returns Object describing usage information of Blink’s internal memory caches. + */ + getResourceUsage(): ResourceUsages; + /** + * Attempts to free memory that is no longer being used (like images from a previous navigation). + */ + clearCache(): void; + } + + interface ResourceUsages { + fonts: ResourceUsage; + images: ResourceUsage; + cssStyleSheets: ResourceUsage; + xslStyleSheets: ResourceUsage; + scripts: ResourceUsage; + other: ResourceUsage; + } + + interface ResourceUsage { + count: number; + decodedSize: number; + liveSize: number; + purgeableSize: number; + purgedSize: number; + size: number; } // https://github.com/electron/electron/blob/master/docs/api/web-view-tag.md @@ -3934,6 +4746,10 @@ declare namespace Electron { * A list of strings which specifies the blink features to be enabled separated by ,. */ blinkfeatures: string; + /** + * A list of strings which specifies the blink features to be disabled separated by ,. + */ + disableblinkfeatures: string; /** * Loads the url in the webview, the url must contain the protocol prefix, e.g. the http:// or file://. */ @@ -3946,6 +4762,10 @@ declare namespace Electron { * @returns The title of guest page. */ getTitle(): string; + /** + * @returns Whether the web page is destroyed. + */ + isDestroyed(): boolean; /** * @returns Whether guest page is still loading resources. */ @@ -3997,7 +4817,7 @@ declare namespace Electron { /** * Navigates to the specified offset from the "current entry". */ - goToOffset(offset: boolean): void; + goToOffset(offset: number): void; /** * @returns Whether the renderer process has crashed. */ @@ -4128,10 +4948,23 @@ declare namespace Electron { * See webContents.sendInputEvent for detailed description of event object. */ sendInputEvent(event: SendInputEvent): void + /** + * Shows pop-up dictionary that searches the selected word on the page. + * Note: This API is available only on macOS. + */ + showDefinitionForSelection(): void; /** * @returns The WebContents associated with this webview. */ getWebContents(): WebContents; + /** + * Captures a snapshot of the webview's page. Same as webContents.capturePage([rect, ]callback). + */ + capturePage(callback: (image: NativeImage) => void): void; + /** + * Captures a snapshot of the webview's page. Same as webContents.capturePage([rect, ]callback). + */ + capturePage(rect: Rectangle, callback: (image: NativeImage) => void): void; /** * Fired when a load has committed. This includes navigation within the current document * as well as subframe document-level loads, but does not include asynchronous resource loads. @@ -4263,6 +5096,10 @@ declare namespace Electron { * */ addEventListener(type: 'did-change-theme-color', listener: (event: WebViewElement.DidChangeThemeColorEvent) => void, useCapture?: boolean): void; + /** + * Emitted when mouse moves over a link or the keyboard moves the focus to a link. + */ + addEventListener(type: 'update-target-url', listener: (event: WebViewElement.UpdateTargetUrlEvent) => void, useCapture?: boolean): void; /** * Emitted when DevTools is opened. */ @@ -4362,6 +5199,10 @@ declare namespace Electron { interface DidChangeThemeColorEvent extends Event { themeColor: string; } + + interface UpdateTargetUrlEvent extends Event { + url: string; + } } /** @@ -4394,6 +5235,10 @@ declare namespace Electron { * properties and a single method. */ postMessage(message: string, targetOrigin: string): void; + /** + * Invokes the print dialog on the child window. + */ + print(): void; } // https://github.com/electron/electron/blob/master/docs/api/synopsis.md @@ -4418,8 +5263,9 @@ declare namespace Electron { protocol: Electron.Protocol; screen: Electron.Screen; session: typeof Electron.Session; + systemPreferences: Electron.SystemPreferences; Tray: Electron.Tray; - hideInternalModules(): void; + webContents: Electron.WebContentsStatic; } interface ElectronMainAndRenderer extends CommonElectron { @@ -4459,7 +5305,23 @@ interface File { // https://github.com/electron/electron/blob/master/docs/api/process.md declare namespace NodeJS { + + interface ProcessVersions { + /** + * Electron's version string. + */ + electron: string; + /** + * Chrome's version string. + */ + chrome: string; + } + interface Process { + /** + * Setting this to true can disable the support for asar archives in Node's built-in modules. + */ + noAsar?: boolean; /** * Process's type */ @@ -4476,16 +5338,17 @@ declare namespace NodeJS { * If the app is running as a Windows Store app (appx), this value is true, for other builds it is undefined. */ windowsStore?: boolean; + /** + * When app is started by being passed as parameter to the default app, + * this value is true in the main process, otherwise it is undefined. + */ + defaultApp?: boolean; /** * Emitted when Electron has loaded its internal initialization script * and is beginning to load the web page or the main script. */ on(event: 'loaded', listener: Function): this; on(event: string, listener: Function): this; - /** - * Setting this to true can disable the support for asar archives in Node's built-in modules. - */ - noAsar?: boolean; /** * Causes the main thread of the current process crash; */ @@ -4498,9 +5361,57 @@ declare namespace NodeJS { * Sets the file descriptor soft limit to maxDescriptors or the OS hard limit, * whichever is lower for the current process. * - * Note: This API is only available on Mac and Linux. + * Note: This API is only available on macOS and Linux. */ setFdLimit(maxDescriptors: number): void; + /** + * @returns Object giving memory usage statistics about the current process. + * Note: All statistics are reported in Kilobytes. + */ + getProcessMemoryInfo(): ProcessMemoryInfo; + /** + * @returns Object giving memory usage statistics about the entire system. + * Note: All statistics are reported in Kilobytes. + */ + getSystemMemoryInfo(): SystemMemoryInfo; + } + + interface ProcessMemoryInfo { + /** + * The amount of memory currently pinned to actual physical RAM. + */ + workingSetSize: number; + /** + * The maximum amount of memory that has ever been pinned to actual physical RAM. + */ + peakWorkingSetSize: number; + /** + * The amount of memory not shared by other processes, such as JS heap or HTML content. + */ + privateBytes: number; + /** + * The amount of memory shared between processes, typically memory consumed by the Electron code itself. + */ + sharedBytes: number; + } + + interface SystemMemoryInfo { + /** + * The total amount of physical memory available to the system. + */ + total: number; + /** + * The total amount of memory not being used by applications or disk cache. + */ + free: number; + /** + * The total amount of swap memory available to the system. + */ + swapTotal: number; + /** + * The free amount of swap memory available to the system. + */ + swapFree: number; } } diff --git a/gl-matrix/gl-matrix-tests.ts b/gl-matrix/gl-matrix-tests.ts index ce5251edad..682bca7b8b 100644 --- a/gl-matrix/gl-matrix-tests.ts +++ b/gl-matrix/gl-matrix-tests.ts @@ -308,6 +308,11 @@ q = [0, 0, 0, 1]; out = mat4.fromRotationTranslation(out, q, [1, 2, 3]); out = mat4.fromQuat(out, q); +q = [0, 0, 0, 1]; +out = mat4.fromRotationTranslationScale(out, q, [1, 2, 3], [1, 2, 3]); +out = mat4.fromQuat(out, q); + + // quat var quatA = [1, 2, 3, 4]; var quatB = [5, 6, 7, 8]; diff --git a/gl-matrix/gl-matrix-typed-tests.ts b/gl-matrix/gl-matrix-typed-tests.ts new file mode 100644 index 0000000000..7364ec0a83 --- /dev/null +++ b/gl-matrix/gl-matrix-typed-tests.ts @@ -0,0 +1,346 @@ +/// + +// common +import {vec2, mat2, mat3, mat4, vec3, vec4, glMatrix, mat2d, quat} from "./gl-matrix-typed"; +var result: number = glMatrix.toRadian(180); + +var outVal: number; +var outBool: boolean; +var outStr: string; + +let vecArray = new Float32Array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]); + +let vec2A = vec2.fromValues(1, 2); +let vec2B = vec2.fromValues(3, 4); +let vec3A = vec3.fromValues(1, 2, 3); +let vec3B = vec3.fromValues(3, 4, 5); +let vec4A = vec4.fromValues(1, 2, 3, 4); +let vec4B = vec4.fromValues(3, 4, 5, 6); +let mat2A = mat2.fromValues(1, 2, 3, 4); +let mat2B = mat2.fromValues(1, 2, 3, 4); +let mat2dA = mat2d.fromValues(1, 2, 3, 4, 5, 6); +let mat2dB = mat2d.fromValues(1, 2, 3, 4, 5, 6); +let mat3A = mat3.fromValues(1, 2, 3, 4, 5, 6, 7, 8, 9); +let mat3B = mat3.fromValues(1, 2, 3, 4, 5, 6, 7, 8, 9); +let mat4A = mat4.fromValues(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); +let mat4B = mat4.fromValues(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); +let quatA = quat.fromValues(1, 2, 3, 4); +let quatB = quat.fromValues(5, 6, 7, 8); + +let outVec2 = vec2.create(); +let outVec3 = vec3.create(); +let outVec4 = vec4.create(); +let outMat2 = mat2.create(); +let outMat2d = mat2d.create(); +let outMat3 = mat3.create(); +let outMat4 = mat4.create(); +let outQuat = quat.create(); + +// vec2 +outVec2 = vec2.create(); +outVec2 = vec2.clone(vec2A); +outVec2 = vec2.fromValues(1, 2); +outVec2 = vec2.copy(outVec2, vec2A); +outVec2 = vec2.set(outVec2, 1, 2); +outVec2 = vec2.add(outVec2, vec2A, vec2B); +outVec2 = vec2.subtract(outVec2, vec2A, vec2B); +outVec2 = vec2.sub(outVec2, vec2A, vec2B); +outVec2 = vec2.multiply(outVec2, vec2A, vec2B); +outVec2 = vec2.mul(outVec2, vec2A, vec2B); +outVec2 = vec2.divide(outVec2, vec2A, vec2B); +outVec2 = vec2.div(outVec2, vec2A, vec2B); +outVec2 = vec2.ceil(outVec2, vec2A); +outVec2 = vec2.floor(outVec2, vec2A); +outVec2 = vec2.min(outVec2, vec2A, vec2B); +outVec2 = vec2.max(outVec2, vec2A, vec2B); +outVec2 = vec2.round(outVec2, vec2A); +outVec2 = vec2.scale(outVec2, vec2A, 2); +outVec2 = vec2.scaleAndAdd(outVec2, vec2A, vec2B, 0.5); +outVal = vec2.distance(vec2A, vec2B); +outVal = vec2.dist(vec2A, vec2B); +outVal = vec2.squaredDistance(vec2A, vec2B); +outVal = vec2.sqrDist(vec2A, vec2B); +outVal = vec2.length(vec2A); +outVal = vec2.len(vec2A); +outVal = vec2.squaredLength(vec2A); +outVal = vec2.sqrLen(vec2A); +outVec2 = vec2.negate(outVec2, vec2A); +outVec2 = vec2.inverse(outVec2, vec2A); +outVec2 = vec2.normalize(outVec2, vec2A); +outVal = vec2.dot(vec2A, vec2B); +outVec2 = vec2.cross(outVec2, vec2A, vec2B); +outVec2 = vec2.lerp(outVec2, vec2A, vec2B, 0.5); +outVec2 = vec2.random(outVec2); +outVec2 = vec2.random(outVec2, 5.0); +outVec2 = vec2.transformMat2(outVec2, vec2A, mat2A); +outVec2 = vec2.transformMat2d(outVec2, vec2A, mat2dA); +outVec2 = vec2.transformMat3(outVec2, vec2A, mat3A); +outVec2 = vec2.transformMat4(outVec2, vec2A, mat4A); +vecArray = vec2.forEach(vecArray, 0, 0, 0, vec2.normalize); +outStr = vec2.str(vec2A); +outBool = vec2.exactEquals(vec2A, vec2B); +outBool = vec2.equals(vec2A, vec2B); + +// vec3 +outVec3 = vec3.create(); +outVec3 = vec3.clone(vec3A); +outVec3 = vec3.fromValues(1, 2, 3); +outVec3 = vec3.copy(outVec3, vec3A); +outVec3 = vec3.set(outVec3, 1, 2, 3); +outVec3 = vec3.add(outVec3, vec3A, vec3B); +outVec3 = vec3.subtract(outVec3, vec3A, vec3B); +outVec3 = vec3.sub(outVec3, vec3A, vec3B); +outVec3 = vec3.multiply(outVec3, vec3A, vec3B); +outVec3 = vec3.mul(outVec3, vec3A, vec3B); +outVec3 = vec3.divide(outVec3, vec3A, vec3B); +outVec3 = vec3.div(outVec3, vec3A, vec3B); +outVec3 = vec3.ceil(outVec3, vec3A); +outVec3 = vec3.floor(outVec3, vec3A); +outVec3 = vec3.min(outVec3, vec3A, vec3B); +outVec3 = vec3.max(outVec3, vec3A, vec3B); +outVec3 = vec3.round(outVec3, vec3A); +outVec3 = vec3.scale(outVec3, vec3A, 2); +outVec3 = vec3.scaleAndAdd(outVec3, vec3A, vec3B, 0.5); +outVal = vec3.distance(vec3A, vec3B); +outVal = vec3.dist(vec3A, vec3B); +outVal = vec3.squaredDistance(vec3A, vec3B); +outVal = vec3.sqrDist(vec3A, vec3B); +outVal = vec3.length(vec3A); +outVal = vec3.len(vec3A); +outVal = vec3.squaredLength(vec3A); +outVal = vec3.sqrLen(vec3A); +outVec3 = vec3.negate(outVec3, vec3A); +outVec3 = vec3.inverse(outVec3, vec3A); +outVec3 = vec3.normalize(outVec3, vec3A); +outVal = vec3.dot(vec3A, vec3B); +outVec3 = vec3.cross(outVec3, vec3A, vec3B); +outVec3 = vec3.lerp(outVec3, vec3A, vec3B, 0.5); +outVec3 = vec3.hermite(outVec3, vec3A, vec3B, vec3A, vec3B, 0.5); +outVec3 = vec3.bezier(outVec3, vec3A, vec3B, vec3A, vec3B, 0.5); +outVec3 = vec3.random(outVec3); +outVec3 = vec3.random(outVec3, 5.0); +outVec3 = vec3.transformMat3(outVec3, vec3A, mat3A); +outVec3 = vec3.transformMat4(outVec3, vec3A, mat4A); +outVec3 = vec3.transformQuat(outVec3, vec3A, quatA); +outVec3 = vec3.rotateX(outVec3, vec3A, vec3B, Math.PI); +outVec3 = vec3.rotateY(outVec3, vec3A, vec3B, Math.PI); +outVec3 = vec3.rotateZ(outVec3, vec3A, vec3B, Math.PI); +vecArray = vec3.forEach(vecArray, 0, 0, 0, vec3.normalize); +outVal = vec3.angle(vec3A, vec3B); +outStr = vec3.str(vec3A); +outBool = vec3.exactEquals(vec3A, vec3B); +outBool = vec3.equals(vec3A, vec3B); + +// vec4 +outVec4 = vec4.create(); +outVec4 = vec4.clone(vec4A); +outVec4 = vec4.fromValues(1, 2, 3, 4); +outVec4 = vec4.copy(outVec4, vec4A); +outVec4 = vec4.set(outVec4, 1, 2, 3, 4); +outVec4 = vec4.add(outVec4, vec4A, vec4B); +outVec4 = vec4.subtract(outVec4, vec4A, vec4B); +outVec4 = vec4.sub(outVec4, vec4A, vec4B); +outVec4 = vec4.multiply(outVec4, vec4A, vec4B); +outVec4 = vec4.mul(outVec4, vec4A, vec4B); +outVec4 = vec4.divide(outVec4, vec4A, vec4B); +outVec4 = vec4.div(outVec4, vec4A, vec4B); +outVec4 = vec4.ceil(outVec4, vec4A); +outVec4 = vec4.floor(outVec4, vec4A); +outVec4 = vec4.min(outVec4, vec4A, vec4B); +outVec4 = vec4.max(outVec4, vec4A, vec4B); +outVec4 = vec4.scale(outVec4, vec4A, 2); +outVec4 = vec4.scaleAndAdd(outVec4, vec4A, vec4B, 0.5); +outVal = vec4.distance(vec4A, vec4B); +outVal = vec4.dist(vec4A, vec4B); +outVal = vec4.squaredDistance(vec4A, vec4B); +outVal = vec4.sqrDist(vec4A, vec4B); +outVal = vec4.length(vec4A); +outVal = vec4.len(vec4A); +outVal = vec4.squaredLength(vec4A); +outVal = vec4.sqrLen(vec4A); +outVec4 = vec4.negate(outVec4, vec4A); +outVec4 = vec4.inverse(outVec4, vec4A); +outVec4 = vec4.normalize(outVec4, vec4A); +outVal = vec4.dot(vec4A, vec4B); +outVec4 = vec4.lerp(outVec4, vec4A, vec4B, 0.5); +outVec4 = vec4.random(outVec4); +outVec4 = vec4.random(outVec4, 5.0); +outVec4 = vec4.transformMat4(outVec4, vec4A, mat4A); +outVec4 = vec4.transformQuat(outVec4, vec4A, quatA); +vecArray = vec4.forEach(vecArray, 0, 0, 0, vec4.normalize); +outStr = vec4.str(vec4A); +outBool = vec4.exactEquals(vec4A, vec4B); +outBool = vec4.equals(vec4A, vec4B); + +// mat2 +outMat2 = mat2.create(); +outMat2 = mat2.clone(mat2A); +outMat2 = mat2.copy(outMat2, mat2A); +outMat2 = mat2.identity(outMat2); +outMat2 = mat2.fromValues(1, 2, 3, 4); +outMat2 = mat2.set(outMat2, 1, 2, 3, 4); +outMat2 = mat2.transpose(outMat2, mat2A); +outMat2 = mat2.invert(outMat2, mat2A); +outMat2 = mat2.adjoint(outMat2, mat2A); +outVal = mat2.determinant(mat2A); +outMat2 = mat2.multiply(outMat2, mat2A, mat2B); +outMat2 = mat2.mul(outMat2, mat2A, mat2B); +outMat2 = mat2.rotate(outMat2, mat2A, Math.PI * 0.5); +outMat2 = mat2.scale(outMat2, mat2A, vec2A); +outMat2 = mat2.fromRotation(outMat2, 0.5); +outMat2 = mat2.fromScaling(outMat2, vec2A); +outStr = mat2.str(mat2A); +outVal = mat2.frob(mat2A); +var L = mat2.create(); +var D = mat2.create(); +var U = mat2.create(); +outMat2 = mat2.LDU(L, D, U, mat2A); +outMat2 = mat2.add(outMat2, mat2A, mat2B); +outMat2 = mat2.subtract(outMat2, mat2A, mat2B); +outMat2 = mat2.sub(outMat2, mat2A, mat2B); +outBool = mat2.exactEquals(mat2A, mat2B); +outBool = mat2.equals(mat2A, mat2B); +outMat2 = mat2.multiplyScalar (outMat2, mat2A, 2); +outMat2 = mat2.multiplyScalarAndAdd (outMat2, mat2A, mat2B, 2); + +// mat2d +outMat2d = mat2d.create(); +outMat2d = mat2d.clone(mat2dA); +outMat2d = mat2d.copy(outMat2d, mat2dA); +outMat2d = mat2d.identity(outMat2d); +outMat2d = mat2d.fromValues(1, 2, 3, 4, 5, 6); +outMat2d = mat2d.set(outMat2d, 1, 2, 3, 4, 5, 6); +outMat2d = mat2d.invert(outMat2d, mat2dA); +outVal = mat2d.determinant(mat2dA); +outMat2d = mat2d.multiply(outMat2d, mat2dA, mat2dB); +outMat2d = mat2d.mul(outMat2d, mat2dA, mat2dB); +outMat2d = mat2d.rotate(outMat2d, mat2dA, Math.PI * 0.5); +outMat2d = mat2d.scale(outMat2d, mat2dA, vec2A); +outMat2d = mat2d.translate(outMat2d, mat2dA, vec2A); +outMat2d = mat2d.fromRotation(outMat2d, 0.5); +outMat2d = mat2d.fromScaling(outMat2d, vec2A); +outMat2d = mat2d.fromTranslation(outMat2d, vec2A); +outStr = mat2d.str(mat2dA); +outVal = mat2d.frob(mat2dA); +outMat2d = mat2d.add(outMat2d, mat2dA, mat2dB); +outMat2d = mat2d.subtract(outMat2d, mat2dA, mat2dB); +outMat2d = mat2d.sub(outMat2d, mat2dA, mat2dB); +outMat2d = mat2d.multiplyScalar (outMat2d, mat2dA, 2); +outMat2d = mat2d.multiplyScalarAndAdd (outMat2d, mat2dA, mat2dB, 2); +outBool = mat2d.exactEquals(mat2dA, mat2dB); +outBool = mat2d.equals(mat2dA, mat2dB); + + +// mat3 +outMat3 = mat3.create(); +outMat3 = mat3.fromMat4(outMat3, mat4A); +outMat3 = mat3.clone(mat3A); +outMat3 = mat3.copy(outMat3, mat3A); +outMat3 = mat3.fromValues(1, 2, 3, 4, 5, 6, 7, 8, 9); +outMat3 = mat3.set(outMat3, 1, 2, 3, 4, 5, 6, 7, 8, 9); +outMat3 = mat3.identity(outMat3); +outMat3 = mat3.transpose(outMat3, mat3A); +outMat3 = mat3.invert(outMat3, mat3A); +outMat3 = mat3.adjoint(outMat3, mat3A); +outVal = mat3.determinant(mat3A); +outMat3 = mat3.multiply(outMat3, mat3A, mat3B); +outMat3 = mat3.mul(outMat3, mat3A, mat3B); +outMat3 = mat3.translate(outMat3, mat3A, vec3A); +outMat3 = mat3.rotate(outMat3, mat3A, Math.PI/2); +outMat3 = mat3.scale(outMat3, mat3A, vec2A); +outMat3 = mat3.fromTranslation(outMat3, vec2A); +outMat3 = mat3.fromRotation(outMat3, Math.PI); +outMat3 = mat3.fromScaling(outMat3, vec2A); +outMat3 = mat3.fromMat2d(outMat3, mat2dA); +outMat3 = mat3.fromQuat(outMat3, quatA); +outMat3 = mat3.normalFromMat4(outMat3, mat4A); +outStr = mat3.str(mat3A); +outVal = mat3.frob(mat3A); +outMat3 = mat3.add(outMat3, mat3A, mat3B); +outMat3 = mat3.subtract(outMat3, mat3A, mat3B); +outMat3 = mat3.sub(outMat3, mat3A, mat3B); +outMat3 = mat3.multiplyScalar (outMat3, mat3A, 2); +outMat3 = mat3.multiplyScalarAndAdd (outMat3, mat3A, mat3B, 2); +outBool = mat3.exactEquals(mat3A, mat3B); +outBool = mat3.equals(mat3A, mat3B); + +//mat4 +outMat4 = mat4.create(); +outMat4 = mat4.clone(mat4A); +outMat4 = mat4.copy(outMat4, mat4A); +outMat4 = mat4.fromValues(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); +outMat4 = mat4.set(outMat4, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); +outMat4 = mat4.identity(outMat4); +outMat4 = mat4.transpose(outMat4, mat4A); +outMat4 = mat4.invert(outMat4, mat4A); +outMat4 = mat4.adjoint(outMat4, mat4A); +outVal = mat4.determinant(mat4A); +outMat4 = mat4.multiply(outMat4, mat4A, mat4B); +outMat4 = mat4.mul(outMat4, mat4A, mat4B); +outMat4 = mat4.translate(outMat4, mat4A, vec3A); +outMat4 = mat4.scale(outMat4, mat4A, vec3A); +outMat4 = mat4.rotate(outMat4, mat4A, Math.PI, vec3A); +outMat4 = mat4.rotateX(outMat4, mat4A, Math.PI); +outMat4 = mat4.rotateY(outMat4, mat4A, Math.PI); +outMat4 = mat4.rotateZ(outMat4, mat4A, Math.PI); +outMat4 = mat4.fromTranslation(outMat4, vec3A); +outMat4 = mat4.fromRotation(outMat4, Math.PI, vec3A); +outMat4 = mat4.fromScaling(outMat4, vec3A); +outMat4 = mat4.fromXRotation(outMat4, Math.PI); +outMat4 = mat4.fromYRotation(outMat4, Math.PI); +outMat4 = mat4.fromZRotation(outMat4, Math.PI); +outMat4 = mat4.fromRotationTranslation(outMat4, quatA, vec3A); +outVec3 = mat4.getTranslation(outVec3, mat4A) +outQuat = mat4.getRotation(outQuat, mat4A) +outMat4 = mat4.fromRotationTranslationScale(outMat4, quatA, vec3A, vec3B); +outMat4 = mat4.fromRotationTranslationScaleOrigin(outMat4, quatA, vec3A, vec3B, vec3A); +outMat4 = mat4.fromQuat(outMat4, quatB); +outMat4 = mat4.frustum(outMat4, -1, 1, -1, 1, -1, 1); +outMat4 = mat4.perspective(outMat4, Math.PI, 1, 0, 1); +outMat4 = mat4.perspectiveFromFieldOfView(outMat4, {upDegrees:Math.PI, downDegrees:-Math.PI, leftDegrees:-Math.PI, rightDegrees:Math.PI}, 1, 0); +outMat4 = mat4.ortho(outMat4, -1, 1, -1, 1, -1, 1); +outMat4 = mat4.lookAt(outMat4, vec3A, vec3B, vec3A); +outStr = mat4.str(mat4A); +outVal = mat4.frob(mat4A); +outMat4 = mat4.add(outMat4, mat4A, mat4B); +outMat4 = mat4.subtract(outMat4, mat4A, mat4B); +outMat4 = mat4.sub(outMat4, mat4A, mat4B); +outMat4 = mat4.multiplyScalar (outMat4, mat4A, 2); +outMat4 = mat4.multiplyScalarAndAdd (outMat4, mat4A, mat4B, 2); +outBool = mat4.exactEquals(mat4A, mat4B); +outBool = mat4.equals(mat4A, mat4B); + +// quat +var deg90 = Math.PI / 2; +outQuat = quat.create(); +outQuat = quat.clone(quatA); +outQuat = quat.fromValues(1, 2, 3, 4); +outQuat = quat.copy(outQuat, quatA); +outQuat = quat.set(outQuat, 1, 2, 3, 4); +outQuat = quat.identity(outQuat); +outQuat = quat.rotationTo(outQuat, vec3A, vec3B); +outQuat = quat.setAxes(outQuat, vec3A, vec3B, vec3A); +outQuat = quat.setAxisAngle(outQuat, vec3A, Math.PI * 0.5); +outVal = quat.getAxisAngle (outVec3, quatA); +outQuat = quat.add(outQuat, quatA, quatB); +outQuat = quat.multiply(outQuat, quatA, quatB); +outQuat = quat.mul(outQuat, quatA, quatB); +outQuat = quat.scale(outQuat, quatA, 2); +outVal = quat.length(quatA); +outVal = quat.len(quatA); +outVal = quat.squaredLength(quatA); +outVal = quat.sqrLen(quatA); +outQuat = quat.normalize(outQuat, quatA); +outVal = quat.dot(quatA, quatB); +outQuat = quat.lerp(outQuat, quatA, quatB, 0.5); +outQuat = quat.slerp(outQuat, quatA, quatB, 0.5); +outQuat = quat.invert(outQuat, quatA); +outQuat = quat.conjugate(outQuat, quatA); +outStr = quat.str(quatA); +outQuat = quat.rotateX(outQuat, quatA, deg90); +outQuat = quat.rotateY(outQuat, quatA, deg90); +outQuat = quat.rotateZ(outQuat, quatA, deg90); +outQuat = quat.fromMat3(outQuat, mat3A); +outQuat = quat.calculateW(outQuat, quatA); +outBool = quat.exactEquals(quatA, quatB); +outBool = quat.equals(quatA, quatB); \ No newline at end of file diff --git a/gl-matrix/gl-matrix-typed.d.ts b/gl-matrix/gl-matrix-typed.d.ts new file mode 100644 index 0000000000..e172074fec --- /dev/null +++ b/gl-matrix/gl-matrix-typed.d.ts @@ -0,0 +1,3054 @@ +// Type definitions for gl-matrix 2.2.2 +// Project: https://github.com/toji/gl-matrix +// Definitions by: Mattijs Kneppers , based on definitions by Tat +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// Common +export class glMatrix { + /** + * Convert Degree To Radian + * + * @param a Angle in Degrees + */ + public static toRadian(a: number): number; +} + +// vec2 +export class vec2 extends Float32Array { + private typeVec2:number; + + /** + * Creates a new, empty vec2 + * + * @returns a new 2D vector + */ + public static create(): vec2; + + /** + * Creates a new vec2 initialized with values from an existing vector + * + * @param a a vector to clone + * @returns a new 2D vector + */ + public static clone(a: vec2): vec2; + + /** + * Creates a new vec2 initialized with the given values + * + * @param x X component + * @param y Y component + * @returns a new 2D vector + */ + public static fromValues(x: number, y: number): vec2; + + /** + * Copy the values from one vec2 to another + * + * @param out the receiving vector + * @param a the source vector + * @returns out + */ + public static copy(out: vec2, a: vec2): vec2; + + /** + * Set the components of a vec2 to the given values + * + * @param out the receiving vector + * @param x X component + * @param y Y component + * @returns out + */ + public static set(out: vec2, x: number, y: number): vec2; + + /** + * Adds two vec2's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + public static add(out: vec2, a: vec2, b: vec2): vec2; + + /** + * Subtracts vector b from vector a + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + public static subtract(out: vec2, a: vec2, b: vec2): vec2; + + /** + * Subtracts vector b from vector a + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + public static sub(out: vec2, a: vec2, b: vec2): vec2; + + /** + * Multiplies two vec2's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + public static multiply(out: vec2, a: vec2, b: vec2): vec2; + + /** + * Multiplies two vec2's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + public static mul(out: vec2, a: vec2, b: vec2): vec2; + + /** + * Divides two vec2's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + public static divide(out: vec2, a: vec2, b: vec2): vec2; + + /** + * Divides two vec2's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + public static div(out: vec2, a: vec2, b: vec2): vec2; + + /** + * Math.ceil the components of a vec2 + * + * @param {vec2} out the receiving vector + * @param {vec2} a vector to ceil + * @returns {vec2} out + */ + public static ceil(out:vec2, a:vec2):vec2; + + /** + * Math.floor the components of a vec2 + * + * @param {vec2} out the receiving vector + * @param {vec2} a vector to floor + * @returns {vec2} out + */ + public static floor (out:vec2, a:vec2):vec2; + + /** + * Returns the minimum of two vec2's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + public static min(out: vec2, a: vec2, b: vec2): vec2; + + /** + * Returns the maximum of two vec2's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + public static max(out: vec2, a: vec2, b: vec2): vec2; + + /** + * Math.round the components of a vec2 + * + * @param {vec2} out the receiving vector + * @param {vec2} a vector to round + * @returns {vec2} out + */ + public static round(out:vec2, a:vec2):vec2; + + + /** + * Scales a vec2 by a scalar number + * + * @param out the receiving vector + * @param a the vector to scale + * @param b amount to scale the vector by + * @returns out + */ + public static scale(out: vec2, a: vec2, b: number): vec2; + + /** + * Adds two vec2's after scaling the second operand by a scalar value + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @param scale the amount to scale b by before adding + * @returns out + */ + public static scaleAndAdd(out: vec2, a: vec2, b: vec2, scale: number): vec2; + + /** + * Calculates the euclidian distance between two vec2's + * + * @param a the first operand + * @param b the second operand + * @returns distance between a and b + */ + public static distance(a: vec2, b: vec2): number; + + /** + * Calculates the euclidian distance between two vec2's + * + * @param a the first operand + * @param b the second operand + * @returns distance between a and b + */ + public static dist(a: vec2, b: vec2): number; + + /** + * Calculates the squared euclidian distance between two vec2's + * + * @param a the first operand + * @param b the second operand + * @returns squared distance between a and b + */ + public static squaredDistance(a: vec2, b: vec2): number; + + /** + * Calculates the squared euclidian distance between two vec2's + * + * @param a the first operand + * @param b the second operand + * @returns squared distance between a and b + */ + public static sqrDist(a: vec2, b: vec2): number; + + /** + * Calculates the length of a vec2 + * + * @param a vector to calculate length of + * @returns length of a + */ + public static length(a: vec2): number; + + /** + * Calculates the length of a vec2 + * + * @param a vector to calculate length of + * @returns length of a + */ + public static len(a: vec2): number; + + /** + * Calculates the squared length of a vec2 + * + * @param a vector to calculate squared length of + * @returns squared length of a + */ + public static squaredLength(a: vec2): number; + + /** + * Calculates the squared length of a vec2 + * + * @param a vector to calculate squared length of + * @returns squared length of a + */ + public static sqrLen(a: vec2): number; + + /** + * Negates the components of a vec2 + * + * @param out the receiving vector + * @param a vector to negate + * @returns out + */ + public static negate(out: vec2, a: vec2): vec2; + + /** + * Returns the inverse of the components of a vec2 + * + * @param out the receiving vector + * @param a vector to invert + * @returns out + */ + public static inverse(out: vec2, a: vec2): vec2; + + /** + * Normalize a vec2 + * + * @param out the receiving vector + * @param a vector to normalize + * @returns out + */ + public static normalize(out: vec2, a: vec2): vec2; + + /** + * Calculates the dot product of two vec2's + * + * @param a the first operand + * @param b the second operand + * @returns dot product of a and b + */ + public static dot(a: vec2, b: vec2): number; + + /** + * Computes the cross product of two vec2's + * Note that the cross product must by definition produce a 3D vector + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + public static cross(out: vec2, a: vec2, b: vec2): vec2; + + /** + * Performs a linear interpolation between two vec2's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @param t interpolation amount between the two inputs + * @returns out + */ + public static lerp(out: vec2, a: vec2, b: vec2, t: number): vec2; + + /** + * Generates a random unit vector + * + * @param out the receiving vector + * @returns out + */ + public static random(out: vec2): vec2; + + /** + * Generates a random vector with the given scale + * + * @param out the receiving vector + * @param scale Length of the resulting vector. If ommitted, a unit vector will be returned + * @returns out + */ + public static random(out: vec2, scale: number): vec2; + + /** + * Transforms the vec2 with a mat2 + * + * @param out the receiving vector + * @param a the vector to transform + * @param m matrix to transform with + * @returns out + */ + public static transformMat2(out: vec2, a: vec2, m: mat2): vec2; + + /** + * Transforms the vec2 with a mat2d + * + * @param out the receiving vector + * @param a the vector to transform + * @param m matrix to transform with + * @returns out + */ + public static transformMat2d(out: vec2, a: vec2, m: mat2d): vec2; + + /** + * Transforms the vec2 with a mat3 + * 3rd vector component is implicitly '1' + * + * @param out the receiving vector + * @param a the vector to transform + * @param m matrix to transform with + * @returns out + */ + public static transformMat3(out: vec2, a: vec2, m: mat3): vec2; + + /** + * Transforms the vec2 with a mat4 + * 3rd vector component is implicitly '0' + * 4th vector component is implicitly '1' + * + * @param out the receiving vector + * @param a the vector to transform + * @param m matrix to transform with + * @returns out + */ + public static transformMat4(out: vec2, a: vec2, m: mat4): vec2; + + /** + * Perform some operation over an array of vec2s. + * + * @param a the array of vectors to iterate over + * @param stride Number of elements between the start of each vec2. If 0 assumes tightly packed + * @param offset Number of elements to skip at the beginning of the array + * @param count Number of vec2s to iterate over. If 0 iterates over entire array + * @param fn Function to call for each vector in the array + * @param arg additional argument to pass to fn + * @returns a + */ + public static forEach(a: Float32Array, stride: number, offset: number, count: number, + fn: (a: vec2, b: vec2, arg: any) => void, arg: any): Float32Array; + + /** + * Perform some operation over an array of vec2s. + * + * @param a the array of vectors to iterate over + * @param stride Number of elements between the start of each vec2. If 0 assumes tightly packed + * @param offset Number of elements to skip at the beginning of the array + * @param count Number of vec2s to iterate over. If 0 iterates over entire array + * @param fn Function to call for each vector in the array + * @returns a + */ + public static forEach(a: Float32Array, stride: number, offset: number, count: number, + fn: (a: vec2, b: vec2) => void): Float32Array; + + /** + * Returns a string representation of a vector + * + * @param a vector to represent as a string + * @returns string representation of the vector + */ + public static str(a: vec2): string; + + /** + * Returns whether or not the vectors exactly have the same elements in the same position (when compared with ===) + * + * @param {vec2} a The first vector. + * @param {vec2} b The second vector. + * @returns {boolean} True if the vectors are equal, false otherwise. + */ + public static exactEquals (a:vec2, b:vec2): boolean; + + /** + * Returns whether or not the vectors have approximately the same elements in the same position. + * + * @param {vec2} a The first vector. + * @param {vec2} b The second vector. + * @returns {boolean} True if the vectors are equal, false otherwise. + */ + public static equals (a:vec2, b:vec2) : boolean; +} + +// vec3 +export class vec3 extends Float32Array { + private typeVec3:number; + + /** + * Creates a new, empty vec3 + * + * @returns a new 3D vector + */ + public static create(): vec3; + + /** + * Creates a new vec3 initialized with values from an existing vector + * + * @param a vector to clone + * @returns a new 3D vector + */ + public static clone(a: vec3): vec3; + + /** + * Creates a new vec3 initialized with the given values + * + * @param x X component + * @param y Y component + * @param z Z component + * @returns a new 3D vector + */ + public static fromValues(x: number, y: number, z: number): vec3; + + /** + * Copy the values from one vec3 to another + * + * @param out the receiving vector + * @param a the source vector + * @returns out + */ + public static copy(out: vec3, a: vec3): vec3; + + /** + * Set the components of a vec3 to the given values + * + * @param out the receiving vector + * @param x X component + * @param y Y component + * @param z Z component + * @returns out + */ + public static set(out: vec3, x: number, y: number, z: number): vec3; + + /** + * Adds two vec3's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + public static add(out: vec3, a: vec3, b: vec3): vec3; + + /** + * Subtracts vector b from vector a + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + public static subtract(out: vec3, a: vec3, b: vec3): vec3; + + /** + * Subtracts vector b from vector a + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + public static sub(out: vec3, a: vec3, b: vec3): vec3 + + /** + * Multiplies two vec3's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + public static multiply(out: vec3, a: vec3, b: vec3): vec3; + + /** + * Multiplies two vec3's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + public static mul(out: vec3, a: vec3, b: vec3): vec3; + + /** + * Divides two vec3's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + public static divide(out: vec3, a: vec3, b: vec3): vec3; + + /** + * Divides two vec3's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + public static div(out: vec3, a: vec3, b: vec3): vec3; + + /** + * Math.ceil the components of a vec3 + * + * @param {vec3} out the receiving vector + * @param {vec3} a vector to ceil + * @returns {vec3} out + */ + public static ceil (out:vec3, a:vec3) : vec3; + + /** + * Math.floor the components of a vec3 + * + * @param {vec3} out the receiving vector + * @param {vec3} a vector to floor + * @returns {vec3} out + */ + public static floor (out:vec3, a:vec3) :vec3; + + /** + * Returns the minimum of two vec3's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + public static min(out: vec3, a: vec3, b: vec3): vec3; + + /** + * Returns the maximum of two vec3's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + public static max(out: vec3, a: vec3, b: vec3): vec3; + + /** + * Math.round the components of a vec3 + * + * @param {vec3} out the receiving vector + * @param {vec3} a vector to round + * @returns {vec3} out + */ + public static round (out:vec3, a:vec3) : vec3 + + /** + * Scales a vec3 by a scalar number + * + * @param out the receiving vector + * @param a the vector to scale + * @param b amount to scale the vector by + * @returns out + */ + public static scale(out: vec3, a: vec3, b: number): vec3; + + /** + * Adds two vec3's after scaling the second operand by a scalar value + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @param scale the amount to scale b by before adding + * @returns out + */ + public static scaleAndAdd(out: vec3, a: vec3, b: vec3, scale: number): vec3; + + /** + * Calculates the euclidian distance between two vec3's + * + * @param a the first operand + * @param b the second operand + * @returns distance between a and b + */ + public static distance(a: vec3, b: vec3): number; + + /** + * Calculates the euclidian distance between two vec3's + * + * @param a the first operand + * @param b the second operand + * @returns distance between a and b + */ + public static dist(a: vec3, b: vec3): number; + + /** + * Calculates the squared euclidian distance between two vec3's + * + * @param a the first operand + * @param b the second operand + * @returns squared distance between a and b + */ + public static squaredDistance(a: vec3, b: vec3): number; + + /** + * Calculates the squared euclidian distance between two vec3's + * + * @param a the first operand + * @param b the second operand + * @returns squared distance between a and b + */ + public static sqrDist(a: vec3, b: vec3): number; + + /** + * Calculates the length of a vec3 + * + * @param a vector to calculate length of + * @returns length of a + */ + public static length(a: vec3): number; + + /** + * Calculates the length of a vec3 + * + * @param a vector to calculate length of + * @returns length of a + */ + public static len(a: vec3): number; + + /** + * Calculates the squared length of a vec3 + * + * @param a vector to calculate squared length of + * @returns squared length of a + */ + public static squaredLength(a: vec3): number; + + /** + * Calculates the squared length of a vec3 + * + * @param a vector to calculate squared length of + * @returns squared length of a + */ + public static sqrLen(a: vec3): number; + + /** + * Negates the components of a vec3 + * + * @param out the receiving vector + * @param a vector to negate + * @returns out + */ + public static negate(out: vec3, a: vec3): vec3; + + /** + * Returns the inverse of the components of a vec3 + * + * @param out the receiving vector + * @param a vector to invert + * @returns out + */ + public static inverse(out: vec3, a: vec3): vec3; + + /** + * Normalize a vec3 + * + * @param out the receiving vector + * @param a vector to normalize + * @returns out + */ + public static normalize(out: vec3, a: vec3): vec3; + + /** + * Calculates the dot product of two vec3's + * + * @param a the first operand + * @param b the second operand + * @returns dot product of a and b + */ + public static dot(a: vec3, b: vec3): number; + + /** + * Computes the cross product of two vec3's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + public static cross(out: vec3, a: vec3, b: vec3): vec3; + + /** + * Performs a linear interpolation between two vec3's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @param t interpolation amount between the two inputs + * @returns out + */ + public static lerp(out: vec3, a: vec3, b: vec3, t: number): vec3; + + /** + * Performs a hermite interpolation with two control points + * + * @param {vec3} out the receiving vector + * @param {vec3} a the first operand + * @param {vec3} b the second operand + * @param {vec3} c the third operand + * @param {vec3} d the fourth operand + * @param {number} t interpolation amount between the two inputs + * @returns {vec3} out + */ + public static hermite (out:vec3, a:vec3, b:vec3, c:vec3, d:vec3, t:number) : vec3; + + /** + * Performs a bezier interpolation with two control points + * + * @param {vec3} out the receiving vector + * @param {vec3} a the first operand + * @param {vec3} b the second operand + * @param {vec3} c the third operand + * @param {vec3} d the fourth operand + * @param {number} t interpolation amount between the two inputs + * @returns {vec3} out + */ + public static bezier (out:vec3, a:vec3, b:vec3, c:vec3, d:vec3, t:number) :vec3; + + /** + * Generates a random unit vector + * + * @param out the receiving vector + * @returns out + */ + public static random(out: vec3): vec3; + + /** + * Generates a random vector with the given scale + * + * @param out the receiving vector + * @param [scale] Length of the resulting vector. If omitted, a unit vector will be returned + * @returns out + */ + public static random(out: vec3, scale: number): vec3; + + /** + * Transforms the vec3 with a mat3. + * + * @param out the receiving vector + * @param a the vector to transform + * @param m the 3x3 matrix to transform with + * @returns out + */ + public static transformMat3(out: vec3, a: vec3, m: mat3): vec3; + + /** + * Transforms the vec3 with a mat4. + * 4th vector component is implicitly '1' + * + * @param out the receiving vector + * @param a the vector to transform + * @param m matrix to transform with + * @returns out + */ + public static transformMat4(out: vec3, a: vec3, m: mat4): vec3; + + /** + * Transforms the vec3 with a quat + * + * @param out the receiving vector + * @param a the vector to transform + * @param q quaternion to transform with + * @returns out + */ + public static transformQuat(out: vec3, a: vec3, q: quat): vec3; + + + /** + * Rotate a 3D vector around the x-axis + * @param out The receiving vec3 + * @param a The vec3 point to rotate + * @param b The origin of the rotation + * @param c The angle of rotation + * @returns out + */ + public static rotateX(out: vec3, a: vec3, b: vec3, c: number): vec3; + + /** + * Rotate a 3D vector around the y-axis + * @param out The receiving vec3 + * @param a The vec3 point to rotate + * @param b The origin of the rotation + * @param c The angle of rotation + * @returns out + */ + public static rotateY(out: vec3, a: vec3, b: vec3, c: number): vec3; + + /** + * Rotate a 3D vector around the z-axis + * @param out The receiving vec3 + * @param a The vec3 point to rotate + * @param b The origin of the rotation + * @param c The angle of rotation + * @returns out + */ + public static rotateZ(out: vec3, a: vec3, b: vec3, c: number): vec3; + + /** + * Perform some operation over an array of vec3s. + * + * @param a the array of vectors to iterate over + * @param stride Number of elements between the start of each vec3. If 0 assumes tightly packed + * @param offset Number of elements to skip at the beginning of the array + * @param count Number of vec3s to iterate over. If 0 iterates over entire array + * @param fn Function to call for each vector in the array + * @param arg additional argument to pass to fn + * @returns a + * @function + */ + public static forEach(a: Float32Array, stride: number, offset: number, count: number, + fn: (a: vec3, b: vec3, arg: any) => void, arg: any): Float32Array; + + /** + * Perform some operation over an array of vec3s. + * + * @param a the array of vectors to iterate over + * @param stride Number of elements between the start of each vec3. If 0 assumes tightly packed + * @param offset Number of elements to skip at the beginning of the array + * @param count Number of vec3s to iterate over. If 0 iterates over entire array + * @param fn Function to call for each vector in the array + * @returns a + * @function + */ + public static forEach(a: Float32Array, stride: number, offset: number, count: number, + fn: (a: vec3, b: vec3) => void): Float32Array; + + /** + * Get the angle between two 3D vectors + * @param a The first operand + * @param b The second operand + * @returns The angle in radians + */ + public static angle(a: vec3, b: vec3): number; + + /** + * Returns a string representation of a vector + * + * @param a vector to represent as a string + * @returns string representation of the vector + */ + public static str(a: vec3): string; + + /** + * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * + * @param {vec3} a The first vector. + * @param {vec3} b The second vector. + * @returns {boolean} True if the vectors are equal, false otherwise. + */ + public static exactEquals (a:vec3, b:vec3): boolean + + /** + * Returns whether or not the vectors have approximately the same elements in the same position. + * + * @param {vec3} a The first vector. + * @param {vec3} b The second vector. + * @returns {boolean} True if the vectors are equal, false otherwise. + */ + public static equals (a:vec3, b:vec3) : boolean +} + +// vec4 +export class vec4 extends Float32Array { + private typeVec3:number; + + /** + * Creates a new, empty vec4 + * + * @returns a new 4D vector + */ + public static create(): vec4; + + /** + * Creates a new vec4 initialized with values from an existing vector + * + * @param a vector to clone + * @returns a new 4D vector + */ + public static clone(a: vec4): vec4; + + /** + * Creates a new vec4 initialized with the given values + * + * @param x X component + * @param y Y component + * @param z Z component + * @param w W component + * @returns a new 4D vector + */ + public static fromValues(x: number, y: number, z: number, w: number): vec4; + + /** + * Copy the values from one vec4 to another + * + * @param out the receiving vector + * @param a the source vector + * @returns out + */ + public static copy(out: vec4, a: vec4): vec4; + + /** + * Set the components of a vec4 to the given values + * + * @param out the receiving vector + * @param x X component + * @param y Y component + * @param z Z component + * @param w W component + * @returns out + */ + public static set(out: vec4, x: number, y: number, z: number, w: number): vec4; + + /** + * Adds two vec4's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + public static add(out: vec4, a: vec4, b: vec4): vec4; + + /** + * Subtracts vector b from vector a + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + public static subtract(out: vec4, a: vec4, b: vec4): vec4; + + /** + * Subtracts vector b from vector a + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + public static sub(out: vec4, a: vec4, b: vec4): vec4; + + /** + * Multiplies two vec4's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + public static multiply(out: vec4, a: vec4, b: vec4): vec4; + + /** + * Multiplies two vec4's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + public static mul(out: vec4, a: vec4, b: vec4): vec4; + + /** + * Divides two vec4's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + public static divide(out: vec4, a: vec4, b: vec4): vec4; + + /** + * Divides two vec4's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + public static div(out: vec4, a: vec4, b: vec4): vec4; + + /** + * Math.ceil the components of a vec4 + * + * @param {vec4} out the receiving vector + * @param {vec4} a vector to ceil + * @returns {vec4} out + */ + public static ceil (out:vec4, a:vec4) : vec4; + + /** + * Math.floor the components of a vec4 + * + * @param {vec4} out the receiving vector + * @param {vec4} a vector to floor + * @returns {vec4} out + */ + public static floor (out:vec4, a:vec4) : vec4; + + /** + * Returns the minimum of two vec4's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + public static min(out: vec4, a: vec4, b: vec4): vec4; + + /** + * Returns the maximum of two vec4's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + public static max(out: vec4, a: vec4, b: vec4): vec4; + + /** + * Math.round the components of a vec4 + * + * @param {vec4} out the receiving vector + * @param {vec4} a vector to round + * @returns {vec4} out + */ + public static round (out:vec4, a:vec4): vec4; + + /** + * Scales a vec4 by a scalar number + * + * @param out the receiving vector + * @param a the vector to scale + * @param b amount to scale the vector by + * @returns out + */ + public static scale(out: vec4, a: vec4, b: number): vec4; + + /** + * Adds two vec4's after scaling the second operand by a scalar value + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @param scale the amount to scale b by before adding + * @returns out + */ + public static scaleAndAdd(out: vec4, a: vec4, b: vec4, scale: number): vec4; + + /** + * Calculates the euclidian distance between two vec4's + * + * @param a the first operand + * @param b the second operand + * @returns distance between a and b + */ + public static distance(a: vec4, b: vec4): number; + + /** + * Calculates the euclidian distance between two vec4's + * + * @param a the first operand + * @param b the second operand + * @returns distance between a and b + */ + public static dist(a: vec4, b: vec4): number; + + /** + * Calculates the squared euclidian distance between two vec4's + * + * @param a the first operand + * @param b the second operand + * @returns squared distance between a and b + */ + public static squaredDistance(a: vec4, b: vec4): number; + + /** + * Calculates the squared euclidian distance between two vec4's + * + * @param a the first operand + * @param b the second operand + * @returns squared distance between a and b + */ + public static sqrDist(a: vec4, b: vec4): number; + + /** + * Calculates the length of a vec4 + * + * @param a vector to calculate length of + * @returns length of a + */ + public static length(a: vec4): number; + + /** + * Calculates the length of a vec4 + * + * @param a vector to calculate length of + * @returns length of a + */ + public static len(a: vec4): number; + + /** + * Calculates the squared length of a vec4 + * + * @param a vector to calculate squared length of + * @returns squared length of a + */ + public static squaredLength(a: vec4): number; + + /** + * Calculates the squared length of a vec4 + * + * @param a vector to calculate squared length of + * @returns squared length of a + */ + public static sqrLen(a: vec4): number; + + /** + * Negates the components of a vec4 + * + * @param out the receiving vector + * @param a vector to negate + * @returns out + */ + public static negate(out: vec4, a: vec4): vec4; + + /** + * Returns the inverse of the components of a vec4 + * + * @param out the receiving vector + * @param a vector to invert + * @returns out + */ + public static inverse(out: vec4, a: vec4): vec4; + + /** + * Normalize a vec4 + * + * @param out the receiving vector + * @param a vector to normalize + * @returns out + */ + public static normalize(out: vec4, a: vec4): vec4; + + /** + * Calculates the dot product of two vec4's + * + * @param a the first operand + * @param b the second operand + * @returns dot product of a and b + */ + public static dot(a: vec4, b: vec4): number; + + /** + * Performs a linear interpolation between two vec4's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @param t interpolation amount between the two inputs + * @returns out + */ + public static lerp(out: vec4, a: vec4, b: vec4, t: number): vec4; + + /** + * Generates a random unit vector + * + * @param out the receiving vector + * @returns out + */ + public static random(out: vec4): vec4; + + /** + * Generates a random vector with the given scale + * + * @param out the receiving vector + * @param scale length of the resulting vector. If ommitted, a unit vector will be returned + * @returns out + */ + public static random(out: vec4, scale: number): vec4; + + /** + * Transforms the vec4 with a mat4. + * + * @param out the receiving vector + * @param a the vector to transform + * @param m matrix to transform with + * @returns out + */ + public static transformMat4(out: vec4, a: vec4, m: mat4): vec4; + + /** + * Transforms the vec4 with a quat + * + * @param out the receiving vector + * @param a the vector to transform + * @param q quaternion to transform with + * @returns out + */ + + public static transformQuat(out: vec4, a: vec4, q: quat): vec4; + + /** + * Perform some operation over an array of vec4s. + * + * @param a the array of vectors to iterate over + * @param stride Number of elements between the start of each vec4. If 0 assumes tightly packed + * @param offset Number of elements to skip at the beginning of the array + * @param count Number of vec4s to iterate over. If 0 iterates over entire array + * @param fn Function to call for each vector in the array + * @param arg additional argument to pass to fn + * @returns a + * @function + */ + public static forEach(a: Float32Array, stride: number, offset: number, count: number, + fn: (a: vec4, b: vec4, arg: any) => void, arg: any): Float32Array; + + /** + * Perform some operation over an array of vec4s. + * + * @param a the array of vectors to iterate over + * @param stride Number of elements between the start of each vec4. If 0 assumes tightly packed + * @param offset Number of elements to skip at the beginning of the array + * @param count Number of vec4s to iterate over. If 0 iterates over entire array + * @param fn Function to call for each vector in the array + * @returns a + * @function + */ + public static forEach(a: Float32Array, stride: number, offset: number, count: number, + fn: (a: vec4, b: vec4) => void): Float32Array; + + /** + * Returns a string representation of a vector + * + * @param a vector to represent as a string + * @returns string representation of the vector + */ + public static str(a: vec4): string; + + /** + * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * + * @param {vec4} a The first vector. + * @param {vec4} b The second vector. + * @returns {boolean} True if the vectors are equal, false otherwise. + */ + public static exactEquals (a:vec4, b:vec4) : boolean; + + /** + * Returns whether or not the vectors have approximately the same elements in the same position. + * + * @param {vec4} a The first vector. + * @param {vec4} b The second vector. + * @returns {boolean} True if the vectors are equal, false otherwise. + */ + public static equals (a:vec4, b:vec4) : boolean; +} + +// mat2 +export class mat2 extends Float32Array { + private typeMat2:number; + + /** + * Creates a new identity mat2 + * + * @returns a new 2x2 matrix + */ + public static create():mat2; + + /** + * Creates a new mat2 initialized with values from an existing matrix + * + * @param a matrix to clone + * @returns a new 2x2 matrix + */ + public static clone(a:mat2):mat2; + + /** + * Copy the values from one mat2 to another + * + * @param out the receiving matrix + * @param a the source matrix + * @returns out + */ + public static copy(out:mat2, a:mat2):mat2; + + /** + * Set a mat2 to the identity matrix + * + * @param out the receiving matrix + * @returns out + */ + public static identity(out:mat2):mat2; + + /** + * Create a new mat2 with the given values + * + * @param {number} m00 Component in column 0, row 0 position (index 0) + * @param {number} m01 Component in column 0, row 1 position (index 1) + * @param {number} m10 Component in column 1, row 0 position (index 2) + * @param {number} m11 Component in column 1, row 1 position (index 3) + * @returns {mat2} out A new 2x2 matrix + */ + public static fromValues(m00:number, m01:number, m10:number, m11:number):mat2; + + /** + * Set the components of a mat2 to the given values + * + * @param {mat2} out the receiving matrix + * @param {number} m00 Component in column 0, row 0 position (index 0) + * @param {number} m01 Component in column 0, row 1 position (index 1) + * @param {number} m10 Component in column 1, row 0 position (index 2) + * @param {number} m11 Component in column 1, row 1 position (index 3) + * @returns {mat2} out + */ + public static set(out:mat2, m00:number, m01:number, m10:number, m11:number):mat2; + + /** + * Transpose the values of a mat2 + * + * @param out the receiving matrix + * @param a the source matrix + * @returns out + */ + public static transpose(out:mat2, a:mat2):mat2; + + /** + * Inverts a mat2 + * + * @param out the receiving matrix + * @param a the source matrix + * @returns out + */ + public static invert(out:mat2, a:mat2):mat2; + + /** + * Calculates the adjugate of a mat2 + * + * @param out the receiving matrix + * @param a the source matrix + * @returns out + */ + public static adjoint(out:mat2, a:mat2):mat2; + + /** + * Calculates the determinant of a mat2 + * + * @param a the source matrix + * @returns determinant of a + */ + public static determinant(a:mat2):number; + + /** + * Multiplies two mat2's + * + * @param out the receiving matrix + * @param a the first operand + * @param b the second operand + * @returns out + */ + public static multiply(out:mat2, a:mat2, b:mat2):mat2; + + /** + * Multiplies two mat2's + * + * @param out the receiving matrix + * @param a the first operand + * @param b the second operand + * @returns out + */ + public static mul(out:mat2, a:mat2, b:mat2):mat2; + + /** + * Rotates a mat2 by the given angle + * + * @param out the receiving matrix + * @param a the matrix to rotate + * @param rad the angle to rotate the matrix by + * @returns out + */ + public static rotate(out:mat2, a:mat2, rad:number):mat2; + + /** + * Scales the mat2 by the dimensions in the given vec2 + * + * @param out the receiving matrix + * @param a the matrix to rotate + * @param v the vec2 to scale the matrix by + * @returns out + **/ + public static scale(out:mat2, a:mat2, v:vec2):mat2; + + /** + * Creates a matrix from a given angle + * This is equivalent to (but much faster than): + * + * mat2.identity(dest); + * mat2.rotate(dest, dest, rad); + * + * @param {mat2} out mat2 receiving operation result + * @param {number} rad the angle to rotate the matrix by + * @returns {mat2} out + */ + public static fromRotation(out:mat2, rad:number):mat2; + + /** + * Creates a matrix from a vector scaling + * This is equivalent to (but much faster than): + * + * mat2.identity(dest); + * mat2.scale(dest, dest, vec); + * + * @param {mat2} out mat2 receiving operation result + * @param {vec2} v Scaling vector + * @returns {mat2} out + */ + public static fromScaling(out:mat2, v:vec2):mat2; + + /** + * Returns a string representation of a mat2 + * + * @param a matrix to represent as a string + * @returns string representation of the matrix + */ + public static str(a:mat2):string; + + /** + * Returns Frobenius norm of a mat2 + * + * @param a the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + public static frob(a:mat2):number; + + /** + * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix + * @param L the lower triangular matrix + * @param D the diagonal matrix + * @param U the upper triangular matrix + * @param a the input matrix to factorize + */ + public static LDU(L:mat2, D:mat2, U:mat2, a:mat2):mat2; + + /** + * Adds two mat2's + * + * @param {mat2} out the receiving matrix + * @param {mat2} a the first operand + * @param {mat2} b the second operand + * @returns {mat2} out + */ + public static add(out:mat2, a:mat2, b:mat2):mat2; + + /** + * Subtracts matrix b from matrix a + * + * @param {mat2} out the receiving matrix + * @param {mat2} a the first operand + * @param {mat2} b the second operand + * @returns {mat2} out + */ + public static subtract (out:mat2, a:mat2, b:mat2):mat2; + + /** + * Subtracts matrix b from matrix a + * + * @param {mat2} out the receiving matrix + * @param {mat2} a the first operand + * @param {mat2} b the second operand + * @returns {mat2} out + */ + public static sub (out:mat2, a:mat2, b:mat2):mat2; + + /** + * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===) + * + * @param {mat2} a The first matrix. + * @param {mat2} b The second matrix. + * @returns {boolean} True if the matrices are equal, false otherwise. + */ + public static exactEquals (a:mat2, b:mat2):boolean; + + /** + * Returns whether or not the matrices have approximately the same elements in the same position. + * + * @param {mat2} a The first matrix. + * @param {mat2} b The second matrix. + * @returns {boolean} True if the matrices are equal, false otherwise. + */ + public static equals (a:mat2, b:mat2) :boolean; + + /** + * Multiply each element of the matrix by a scalar. + * + * @param {mat2} out the receiving matrix + * @param {mat2} a the matrix to scale + * @param {number} b amount to scale the matrix's elements by + * @returns {mat2} out + */ + public static multiplyScalar (out:mat2, a:mat2, b:number) :mat2 + + /** + * Adds two mat2's after multiplying each element of the second operand by a scalar value. + * + * @param {mat2} out the receiving vector + * @param {mat2} a the first operand + * @param {mat2} b the second operand + * @param {number} scale the amount to scale b's elements by before adding + * @returns {mat2} out + */ + public static multiplyScalarAndAdd (out:mat2, a:mat2, b:mat2, scale:number): mat2 + + + +} + +// mat2d +export class mat2d extends Float32Array { + private typeMat2d:number; + + /** + * Creates a new identity mat2d + * + * @returns a new 2x3 matrix + */ + public static create(): mat2d; + + /** + * Creates a new mat2d initialized with values from an existing matrix + * + * @param a matrix to clone + * @returns a new 2x3 matrix + */ + public static clone(a: mat2d): mat2d; + + /** + * Copy the values from one mat2d to another + * + * @param out the receiving matrix + * @param a the source matrix + * @returns out + */ + public static copy(out: mat2d, a: mat2d): mat2d; + + /** + * Set a mat2d to the identity matrix + * + * @param out the receiving matrix + * @returns out + */ + public static identity(out: mat2d): mat2d; + + /** + * Create a new mat2d with the given values + * + * @param {number} a Component A (index 0) + * @param {number} b Component B (index 1) + * @param {number} c Component C (index 2) + * @param {number} d Component D (index 3) + * @param {number} tx Component TX (index 4) + * @param {number} ty Component TY (index 5) + * @returns {mat2d} A new mat2d + */ + public static fromValues (a:number, b:number, c:number, d:number, tx:number, ty:number) : mat2d + + + /** + * Set the components of a mat2d to the given values + * + * @param {mat2d} out the receiving matrix + * @param {number} a Component A (index 0) + * @param {number} b Component B (index 1) + * @param {number} c Component C (index 2) + * @param {number} d Component D (index 3) + * @param {number} tx Component TX (index 4) + * @param {number} ty Component TY (index 5) + * @returns {mat2d} out + */ + public static set (out:mat2d, a:number, b:number, c:number, d:number, tx:number, ty:number) :mat2d + + /** + * Inverts a mat2d + * + * @param out the receiving matrix + * @param a the source matrix + * @returns out + */ + public static invert(out: mat2d, a: mat2d): mat2d; + + /** + * Calculates the determinant of a mat2d + * + * @param a the source matrix + * @returns determinant of a + */ + public static determinant(a: mat2d): number; + + /** + * Multiplies two mat2d's + * + * @param out the receiving matrix + * @param a the first operand + * @param b the second operand + * @returns out + */ + public static multiply(out: mat2d, a: mat2d, b: mat2d): mat2d; + + /** + * Multiplies two mat2d's + * + * @param out the receiving matrix + * @param a the first operand + * @param b the second operand + * @returns out + */ + public static mul(out: mat2d, a: mat2d, b: mat2d): mat2d; + + /** + * Rotates a mat2d by the given angle + * + * @param out the receiving matrix + * @param a the matrix to rotate + * @param rad the angle to rotate the matrix by + * @returns out + */ + public static rotate(out: mat2d, a: mat2d, rad: number): mat2d; + + /** + * Scales the mat2d by the dimensions in the given vec2 + * + * @param out the receiving matrix + * @param a the matrix to translate + * @param v the vec2 to scale the matrix by + * @returns out + **/ + public static scale(out: mat2d, a: mat2d, v: vec2): mat2d; + + /** + * Translates the mat2d by the dimensions in the given vec2 + * + * @param out the receiving matrix + * @param a the matrix to translate + * @param v the vec2 to translate the matrix by + * @returns out + **/ + public static translate(out: mat2d, a: mat2d, v: vec2): mat2d; + + /** + * Creates a matrix from a given angle + * This is equivalent to (but much faster than): + * + * mat2d.identity(dest); + * mat2d.rotate(dest, dest, rad); + * + * @param {mat2d} out mat2d receiving operation result + * @param {number} rad the angle to rotate the matrix by + * @returns {mat2d} out + */ + public static fromRotation (out:mat2d, rad:number): mat2d; + + /** + * Creates a matrix from a vector scaling + * This is equivalent to (but much faster than): + * + * mat2d.identity(dest); + * mat2d.scale(dest, dest, vec); + * + * @param {mat2d} out mat2d receiving operation result + * @param {vec2} v Scaling vector + * @returns {mat2d} out + */ + public static fromScaling (out:mat2d, v:vec2):mat2d; + + /** + * Creates a matrix from a vector translation + * This is equivalent to (but much faster than): + * + * mat2d.identity(dest); + * mat2d.translate(dest, dest, vec); + * + * @param {mat2d} out mat2d receiving operation result + * @param {vec2} v Translation vector + * @returns {mat2d} out + */ + public static fromTranslation (out:mat2d, v:vec2):mat2d + + /** + * Returns a string representation of a mat2d + * + * @param a matrix to represent as a string + * @returns string representation of the matrix + */ + public static str(a: mat2d): string; + + /** + * Returns Frobenius norm of a mat2d + * + * @param a the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + public static frob(a: mat2d): number; + + /** + * Adds two mat2d's + * + * @param {mat2d} out the receiving matrix + * @param {mat2d} a the first operand + * @param {mat2d} b the second operand + * @returns {mat2d} out + */ + public static add (out: mat2d, a: mat2d, b: mat2d): mat2d + + /** + * Subtracts matrix b from matrix a + * + * @param {mat2d} out the receiving matrix + * @param {mat2d} a the first operand + * @param {mat2d} b the second operand + * @returns {mat2d} out + */ + public static subtract(out: mat2d, a: mat2d, b: mat2d): mat2d + + /** + * Subtracts matrix b from matrix a + * + * @param {mat2d} out the receiving matrix + * @param {mat2d} a the first operand + * @param {mat2d} b the second operand + * @returns {mat2d} out + */ + public static sub(out: mat2d, a: mat2d, b: mat2d): mat2d + + /** + * Multiply each element of the matrix by a scalar. + * + * @param {mat2d} out the receiving matrix + * @param {mat2d} a the matrix to scale + * @param {number} b amount to scale the matrix's elements by + * @returns {mat2d} out + */ + public static multiplyScalar (out: mat2d, a: mat2d, b: number): mat2d; + + /** + * Adds two mat2d's after multiplying each element of the second operand by a scalar value. + * + * @param {mat2d} out the receiving vector + * @param {mat2d} a the first operand + * @param {mat2d} b the second operand + * @param {number} scale the amount to scale b's elements by before adding + * @returns {mat2d} out + */ + public static multiplyScalarAndAdd (out: mat2d, a: mat2d, b: mat2d, scale:number) : mat2d + + /** + * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===) + * + * @param {mat2d} a The first matrix. + * @param {mat2d} b The second matrix. + * @returns {boolean} True if the matrices are equal, false otherwise. + */ + public static exactEquals (a: mat2d, b: mat2d): boolean; + + /** + * Returns whether or not the matrices have approximately the same elements in the same position. + * + * @param {mat2d} a The first matrix. + * @param {mat2d} b The second matrix. + * @returns {boolean} True if the matrices are equal, false otherwise. + */ + public static equals (a: mat2d, b: mat2d): boolean +} + +// mat3 +export class mat3 extends Float32Array { + private typeMat3:number; + + /** + * Creates a new identity mat3 + * + * @returns a new 3x3 matrix + */ + public static create():mat3; + + /** + * Copies the upper-left 3x3 values into the given mat3. + * + * @param {mat3} out the receiving 3x3 matrix + * @param {mat4} a the source 4x4 matrix + * @returns {mat3} out + */ + public static fromMat4(out:mat3, a:mat4):mat3 + + /** + * Creates a new mat3 initialized with values from an existing matrix + * + * @param a matrix to clone + * @returns a new 3x3 matrix + */ + public static clone(a:mat3):mat3; + + /** + * Copy the values from one mat3 to another + * + * @param out the receiving matrix + * @param a the source matrix + * @returns out + */ + public static copy(out:mat3, a:mat3):mat3; + + /** + * Create a new mat3 with the given values + * + * @param {number} m00 Component in column 0, row 0 position (index 0) + * @param {number} m01 Component in column 0, row 1 position (index 1) + * @param {number} m02 Component in column 0, row 2 position (index 2) + * @param {number} m10 Component in column 1, row 0 position (index 3) + * @param {number} m11 Component in column 1, row 1 position (index 4) + * @param {number} m12 Component in column 1, row 2 position (index 5) + * @param {number} m20 Component in column 2, row 0 position (index 6) + * @param {number} m21 Component in column 2, row 1 position (index 7) + * @param {number} m22 Component in column 2, row 2 position (index 8) + * @returns {mat3} A new mat3 + */ + public static fromValues(m00:number, m01:number, m02:number, m10:number, m11:number, m12:number, m20:number, m21:number, m22:number):mat3; + + + /** + * Set the components of a mat3 to the given values + * + * @param {mat3} out the receiving matrix + * @param {number} m00 Component in column 0, row 0 position (index 0) + * @param {number} m01 Component in column 0, row 1 position (index 1) + * @param {number} m02 Component in column 0, row 2 position (index 2) + * @param {number} m10 Component in column 1, row 0 position (index 3) + * @param {number} m11 Component in column 1, row 1 position (index 4) + * @param {number} m12 Component in column 1, row 2 position (index 5) + * @param {number} m20 Component in column 2, row 0 position (index 6) + * @param {number} m21 Component in column 2, row 1 position (index 7) + * @param {number} m22 Component in column 2, row 2 position (index 8) + * @returns {mat3} out + */ + public static set(out:mat3, m00:number, m01:number, m02:number, m10:number, m11:number, m12:number, m20:number, m21:number, m22:number):mat3 + + /** + * Set a mat3 to the identity matrix + * + * @param out the receiving matrix + * @returns out + */ + public static identity(out:mat3):mat3; + + /** + * Transpose the values of a mat3 + * + * @param out the receiving matrix + * @param a the source matrix + * @returns out + */ + public static transpose(out:mat3, a:mat3):mat3; + + /** + * Inverts a mat3 + * + * @param out the receiving matrix + * @param a the source matrix + * @returns out + */ + public static invert(out:mat3, a:mat3):mat3; + + /** + * Calculates the adjugate of a mat3 + * + * @param out the receiving matrix + * @param a the source matrix + * @returns out + */ + public static adjoint(out:mat3, a:mat3):mat3; + + /** + * Calculates the determinant of a mat3 + * + * @param a the source matrix + * @returns determinant of a + */ + public static determinant(a:mat3):number; + + /** + * Multiplies two mat3's + * + * @param out the receiving matrix + * @param a the first operand + * @param b the second operand + * @returns out + */ + public static multiply(out:mat3, a:mat3, b:mat3):mat3; + + /** + * Multiplies two mat3's + * + * @param out the receiving matrix + * @param a the first operand + * @param b the second operand + * @returns out + */ + public static mul(out:mat3, a:mat3, b:mat3):mat3; + + + /** + * Translate a mat3 by the given vector + * + * @param out the receiving matrix + * @param a the matrix to translate + * @param v vector to translate by + * @returns out + */ + public static translate(out:mat3, a:mat3, v:vec3):mat3; + + /** + * Rotates a mat3 by the given angle + * + * @param out the receiving matrix + * @param a the matrix to rotate + * @param rad the angle to rotate the matrix by + * @returns out + */ + public static rotate(out:mat3, a:mat3, rad:number):mat3; + + /** + * Scales the mat3 by the dimensions in the given vec2 + * + * @param out the receiving matrix + * @param a the matrix to rotate + * @param v the vec2 to scale the matrix by + * @returns out + **/ + public static scale(out:mat3, a:mat3, v:vec2):mat3; + + /** + * Creates a matrix from a vector translation + * This is equivalent to (but much faster than): + * + * mat3.identity(dest); + * mat3.translate(dest, dest, vec); + * + * @param {mat3} out mat3 receiving operation result + * @param {vec2} v Translation vector + * @returns {mat3} out + */ + public static fromTranslation(out:mat3, v:vec2):mat3 + + /** + * Creates a matrix from a given angle + * This is equivalent to (but much faster than): + * + * mat3.identity(dest); + * mat3.rotate(dest, dest, rad); + * + * @param {mat3} out mat3 receiving operation result + * @param {number} rad the angle to rotate the matrix by + * @returns {mat3} out + */ + public static fromRotation(out:mat3, rad:number):mat3 + + /** + * Creates a matrix from a vector scaling + * This is equivalent to (but much faster than): + * + * mat3.identity(dest); + * mat3.scale(dest, dest, vec); + * + * @param {mat3} out mat3 receiving operation result + * @param {vec2} v Scaling vector + * @returns {mat3} out + */ + public static fromScaling(out:mat3, v:vec2):mat3 + + /** + * Copies the values from a mat2d into a mat3 + * + * @param out the receiving matrix + * @param {mat2d} a the matrix to copy + * @returns out + **/ + public static fromMat2d(out:mat3, a:mat2d):mat3; + + /** + * Calculates a 3x3 matrix from the given quaternion + * + * @param out mat3 receiving operation result + * @param q Quaternion to create matrix from + * + * @returns out + */ + public static fromQuat(out:mat3, q:quat):mat3; + + /** + * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix + * + * @param out mat3 receiving operation result + * @param a Mat4 to derive the normal matrix from + * + * @returns out + */ + public static normalFromMat4(out:mat3, a:mat4):mat3; + + /** + * Returns a string representation of a mat3 + * + * @param mat matrix to represent as a string + * @returns string representation of the matrix + */ + public static str(mat:mat3):string; + + /** + * Returns Frobenius norm of a mat3 + * + * @param a the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + public static frob(a:mat3):number; + + /** + * Adds two mat3's + * + * @param {mat3} out the receiving matrix + * @param {mat3} a the first operand + * @param {mat3} b the second operand + * @returns {mat3} out + */ + public static add(out:mat3, a:mat3, b:mat3):mat3 + + /** + * Subtracts matrix b from matrix a + * + * @param {mat3} out the receiving matrix + * @param {mat3} a the first operand + * @param {mat3} b the second operand + * @returns {mat3} out + */ + public static subtract(out:mat3, a:mat3, b:mat3):mat3 + + /** + * Subtracts matrix b from matrix a + * + * @param {mat3} out the receiving matrix + * @param {mat3} a the first operand + * @param {mat3} b the second operand + * @returns {mat3} out + */ + public static sub(out:mat3, a:mat3, b:mat3):mat3 + + /** + * Multiply each element of the matrix by a scalar. + * + * @param {mat3} out the receiving matrix + * @param {mat3} a the matrix to scale + * @param {number} b amount to scale the matrix's elements by + * @returns {mat3} out + */ + public static multiplyScalar(out:mat3, a:mat3, b:number):mat3 + + /** + * Adds two mat3's after multiplying each element of the second operand by a scalar value. + * + * @param {mat3} out the receiving vector + * @param {mat3} a the first operand + * @param {mat3} b the second operand + * @param {number} scale the amount to scale b's elements by before adding + * @returns {mat3} out + */ + public static multiplyScalarAndAdd(out:mat3, a:mat3, b:mat3, scale:number):mat3 + + /** + * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===) + * + * @param {mat3} a The first matrix. + * @param {mat3} b The second matrix. + * @returns {boolean} True if the matrices are equal, false otherwise. + */ + public static exactEquals(a:mat3, b:mat3):boolean; + + /** + * Returns whether or not the matrices have approximately the same elements in the same position. + * + * @param {mat3} a The first matrix. + * @param {mat3} b The second matrix. + * @returns {boolean} True if the matrices are equal, false otherwise. + */ + public static equals(a:mat3, b:mat3):boolean +} + +// mat4 +export class mat4 extends Float32Array { + private typeMat4:number; + + /** + * Creates a new identity mat4 + * + * @returns a new 4x4 matrix + */ + public static create():mat4; + + /** + * Creates a new mat4 initialized with values from an existing matrix + * + * @param a matrix to clone + * @returns a new 4x4 matrix + */ + public static clone(a:mat4):mat4; + + /** + * Copy the values from one mat4 to another + * + * @param out the receiving matrix + * @param a the source matrix + * @returns out + */ + public static copy(out:mat4, a:mat4):mat4; + + + /** + * Create a new mat4 with the given values + * + * @param {number} m00 Component in column 0, row 0 position (index 0) + * @param {number} m01 Component in column 0, row 1 position (index 1) + * @param {number} m02 Component in column 0, row 2 position (index 2) + * @param {number} m03 Component in column 0, row 3 position (index 3) + * @param {number} m10 Component in column 1, row 0 position (index 4) + * @param {number} m11 Component in column 1, row 1 position (index 5) + * @param {number} m12 Component in column 1, row 2 position (index 6) + * @param {number} m13 Component in column 1, row 3 position (index 7) + * @param {number} m20 Component in column 2, row 0 position (index 8) + * @param {number} m21 Component in column 2, row 1 position (index 9) + * @param {number} m22 Component in column 2, row 2 position (index 10) + * @param {number} m23 Component in column 2, row 3 position (index 11) + * @param {number} m30 Component in column 3, row 0 position (index 12) + * @param {number} m31 Component in column 3, row 1 position (index 13) + * @param {number} m32 Component in column 3, row 2 position (index 14) + * @param {number} m33 Component in column 3, row 3 position (index 15) + * @returns {mat4} A new mat4 + */ + public static fromValues(m00:number, m01:number, m02:number, m03:number, m10:number, m11:number, m12:number, m13:number, m20:number, m21:number, m22:number, m23:number, m30:number, m31:number, m32:number, m33:number):mat4; + + /** + * Set the components of a mat4 to the given values + * + * @param {mat4} out the receiving matrix + * @param {number} m00 Component in column 0, row 0 position (index 0) + * @param {number} m01 Component in column 0, row 1 position (index 1) + * @param {number} m02 Component in column 0, row 2 position (index 2) + * @param {number} m03 Component in column 0, row 3 position (index 3) + * @param {number} m10 Component in column 1, row 0 position (index 4) + * @param {number} m11 Component in column 1, row 1 position (index 5) + * @param {number} m12 Component in column 1, row 2 position (index 6) + * @param {number} m13 Component in column 1, row 3 position (index 7) + * @param {number} m20 Component in column 2, row 0 position (index 8) + * @param {number} m21 Component in column 2, row 1 position (index 9) + * @param {number} m22 Component in column 2, row 2 position (index 10) + * @param {number} m23 Component in column 2, row 3 position (index 11) + * @param {number} m30 Component in column 3, row 0 position (index 12) + * @param {number} m31 Component in column 3, row 1 position (index 13) + * @param {number} m32 Component in column 3, row 2 position (index 14) + * @param {number} m33 Component in column 3, row 3 position (index 15) + * @returns {mat4} out + */ + public static set(out:mat4, m00:number, m01:number, m02:number, m03:number, m10:number, m11:number, m12:number, m13:number, m20:number, m21:number, m22:number, m23:number, m30:number, m31:number, m32:number, m33:number):mat4; + + /** + * Set a mat4 to the identity matrix + * + * @param out the receiving matrix + * @returns out + */ + public static identity(out:mat4):mat4; + + /** + * Transpose the values of a mat4 + * + * @param out the receiving matrix + * @param a the source matrix + * @returns out + */ + public static transpose(out:mat4, a:mat4):mat4; + + /** + * Inverts a mat4 + * + * @param out the receiving matrix + * @param a the source matrix + * @returns out + */ + public static invert(out:mat4, a:mat4):mat4; + + /** + * Calculates the adjugate of a mat4 + * + * @param out the receiving matrix + * @param a the source matrix + * @returns out + */ + public static adjoint(out:mat4, a:mat4):mat4; + + /** + * Calculates the determinant of a mat4 + * + * @param a the source matrix + * @returns determinant of a + */ + public static determinant(a:mat4):number; + + /** + * Multiplies two mat4's + * + * @param out the receiving matrix + * @param a the first operand + * @param b the second operand + * @returns out + */ + public static multiply(out:mat4, a:mat4, b:mat4):mat4; + + /** + * Multiplies two mat4's + * + * @param out the receiving matrix + * @param a the first operand + * @param b the second operand + * @returns out + */ + public static mul(out:mat4, a:mat4, b:mat4):mat4; + + /** + * Translate a mat4 by the given vector + * + * @param out the receiving matrix + * @param a the matrix to translate + * @param v vector to translate by + * @returns out + */ + public static translate(out:mat4, a:mat4, v:vec3):mat4; + + /** + * Scales the mat4 by the dimensions in the given vec3 + * + * @param out the receiving matrix + * @param a the matrix to scale + * @param v the vec3 to scale the matrix by + * @returns out + **/ + public static scale(out:mat4, a:mat4, v:vec3):mat4; + + /** + * Rotates a mat4 by the given angle + * + * @param out the receiving matrix + * @param a the matrix to rotate + * @param rad the angle to rotate the matrix by + * @param axis the axis to rotate around + * @returns out + */ + public static rotate(out:mat4, a:mat4, rad:number, axis:vec3):mat4; + + /** + * Rotates a matrix by the given angle around the X axis + * + * @param out the receiving matrix + * @param a the matrix to rotate + * @param rad the angle to rotate the matrix by + * @returns out + */ + public static rotateX(out:mat4, a:mat4, rad:number):mat4; + + /** + * Rotates a matrix by the given angle around the Y axis + * + * @param out the receiving matrix + * @param a the matrix to rotate + * @param rad the angle to rotate the matrix by + * @returns out + */ + public static rotateY(out:mat4, a:mat4, rad:number):mat4; + + /** + * Rotates a matrix by the given angle around the Z axis + * + * @param out the receiving matrix + * @param a the matrix to rotate + * @param rad the angle to rotate the matrix by + * @returns out + */ + public static rotateZ(out:mat4, a:mat4, rad:number):mat4; + + /** + * Creates a matrix from a vector translation + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, dest, vec); + * + * @param {mat4} out mat4 receiving operation result + * @param {vec3} v Translation vector + * @returns {mat4} out + */ + public static fromTranslation(out:mat4, v:vec3):mat4 + + /** + * Creates a matrix from a vector scaling + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.scale(dest, dest, vec); + * + * @param {mat4} out mat4 receiving operation result + * @param {vec3} v Scaling vector + * @returns {mat4} out + */ + public static fromScaling(out:mat4, v:vec3):mat4 + + /** + * Creates a matrix from a given angle around a given axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotate(dest, dest, rad, axis); + * + * @param {mat4} out mat4 receiving operation result + * @param {number} rad the angle to rotate the matrix by + * @param {vec3} axis the axis to rotate around + * @returns {mat4} out + */ + public static fromRotation(out:mat4, rad:number, axis:vec3):mat4 + + /** + * Creates a matrix from the given angle around the X axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotateX(dest, dest, rad); + * + * @param {mat4} out mat4 receiving operation result + * @param {number} rad the angle to rotate the matrix by + * @returns {mat4} out + */ + public static fromXRotation(out:mat4, rad:number):mat4 + + /** + * Creates a matrix from the given angle around the Y axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotateY(dest, dest, rad); + * + * @param {mat4} out mat4 receiving operation result + * @param {number} rad the angle to rotate the matrix by + * @returns {mat4} out + */ + public static fromYRotation(out:mat4, rad:number):mat4 + + + /** + * Creates a matrix from the given angle around the Z axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotateZ(dest, dest, rad); + * + * @param {mat4} out mat4 receiving operation result + * @param {number} rad the angle to rotate the matrix by + * @returns {mat4} out + */ + public static fromZRotation(out:mat4, rad:number):mat4 + + /** + * Creates a matrix from a quaternion rotation and vector translation + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, vec); + * var quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * + * @param out mat4 receiving operation result + * @param q Rotation quaternion + * @param v Translation vector + * @returns out + */ + public static fromRotationTranslation(out:mat4, q:quat, v:vec3):mat4; + + /** + * Returns the translation vector component of a transformation + * matrix. If a matrix is built with fromRotationTranslation, + * the returned vector will be the same as the translation vector + * originally supplied. + * @param {vec3} out Vector to receive translation component + * @param {mat4} mat Matrix to be decomposed (input) + * @return {vec3} out + */ + public static getTranslation(out:vec3, mat:mat4):vec3; + + /** + * Returns a quaternion representing the rotational component + * of a transformation matrix. If a matrix is built with + * fromRotationTranslation, the returned quaternion will be the + * same as the quaternion originally supplied. + * @param {quat} out Quaternion to receive the rotation component + * @param {mat4} mat Matrix to be decomposed (input) + * @return {quat} out + */ + public static getRotation(out:quat, mat:mat4):quat; + + /** + * Creates a matrix from a quaternion rotation, vector translation and vector scale + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, vec); + * var quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale) + * + * @param out mat4 receiving operation result + * @param q Rotation quaternion + * @param v Translation vector + * @param s Scaling vector + * @returns out + */ + public static fromRotationTranslationScale(out:mat4, q:quat, v:vec3, s:vec3):mat4; + + /** + * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, vec); + * mat4.translate(dest, origin); + * var quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale) + * mat4.translate(dest, negativeOrigin); + * + * @param {mat4} out mat4 receiving operation result + * @param {quat} q Rotation quaternion + * @param {vec3} v Translation vector + * @param {vec3} s Scaling vector + * @param {vec3} o The origin vector around which to scale and rotate + * @returns {mat4} out + */ + public static fromRotationTranslationScaleOrigin(out:mat4, q:quat, v:vec3, s:vec3, o:vec3):mat4 + + /** + * Calculates a 4x4 matrix from the given quaternion + * + * @param {mat4} out mat4 receiving operation result + * @param {quat} q Quaternion to create matrix from + * + * @returns {mat4} out + */ + public static fromQuat(out:mat4, q:quat):mat4 + + /** + * Generates a frustum matrix with the given bounds + * + * @param out mat4 frustum matrix will be written into + * @param left Left bound of the frustum + * @param right Right bound of the frustum + * @param bottom Bottom bound of the frustum + * @param top Top bound of the frustum + * @param near Near bound of the frustum + * @param far Far bound of the frustum + * @returns out + */ + public static frustum(out:mat4, left:number, right:number, + bottom:number, top:number, near:number, far:number):mat4; + + /** + * Generates a perspective projection matrix with the given bounds + * + * @param out mat4 frustum matrix will be written into + * @param fovy Vertical field of view in radians + * @param aspect Aspect ratio. typically viewport width/height + * @param near Near bound of the frustum + * @param far Far bound of the frustum + * @returns out + */ + public static perspective(out:mat4, fovy:number, aspect:number, + near:number, far:number):mat4; + + /** + * Generates a perspective projection matrix with the given field of view. + * This is primarily useful for generating projection matrices to be used + * with the still experimental WebVR API. + * + * @param {mat4} out mat4 frustum matrix will be written into + * @param {Object} fov Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees + * @param {number} near Near bound of the frustum + * @param {number} far Far bound of the frustum + * @returns {mat4} out + */ + public static perspectiveFromFieldOfView(out:mat4, + fov:{upDegrees:number, downDegrees:number, leftDegrees:number, rightDegrees:number}, + near:number, far:number):mat4 + + /** + * Generates a orthogonal projection matrix with the given bounds + * + * @param out mat4 frustum matrix will be written into + * @param left Left bound of the frustum + * @param right Right bound of the frustum + * @param bottom Bottom bound of the frustum + * @param top Top bound of the frustum + * @param near Near bound of the frustum + * @param far Far bound of the frustum + * @returns out + */ + public static ortho(out:mat4, left:number, right:number, + bottom:number, top:number, near:number, far:number):mat4; + + /** + * Generates a look-at matrix with the given eye position, focal point, and up axis + * + * @param out mat4 frustum matrix will be written into + * @param eye Position of the viewer + * @param center Point the viewer is looking at + * @param up vec3 pointing up + * @returns out + */ + public static lookAt(out:mat4, eye:vec3, center:vec3, up:vec3):mat4; + + /** + * Returns a string representation of a mat4 + * + * @param mat matrix to represent as a string + * @returns string representation of the matrix + */ + public static str(mat:mat4):string; + + /** + * Returns Frobenius norm of a mat4 + * + * @param a the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + public static frob(a:mat4):number; + + /** + * Adds two mat4's + * + * @param {mat4} out the receiving matrix + * @param {mat4} a the first operand + * @param {mat4} b the second operand + * @returns {mat4} out + */ + public static add(out:mat4, a:mat4, b:mat4):mat4 + + /** + * Subtracts matrix b from matrix a + * + * @param {mat4} out the receiving matrix + * @param {mat4} a the first operand + * @param {mat4} b the second operand + * @returns {mat4} out + */ + public static subtract(out:mat4, a:mat4, b:mat4):mat4 + + /** + * Subtracts matrix b from matrix a + * + * @param {mat4} out the receiving matrix + * @param {mat4} a the first operand + * @param {mat4} b the second operand + * @returns {mat4} out + */ + public static sub(out:mat4, a:mat4, b:mat4):mat4 + + /** + * Multiply each element of the matrix by a scalar. + * + * @param {mat4} out the receiving matrix + * @param {mat4} a the matrix to scale + * @param {number} b amount to scale the matrix's elements by + * @returns {mat4} out + */ + public static multiplyScalar(out:mat4, a:mat4, b:number):mat4 + + /** + * Adds two mat4's after multiplying each element of the second operand by a scalar value. + * + * @param {mat4} out the receiving vector + * @param {mat4} a the first operand + * @param {mat4} b the second operand + * @param {number} scale the amount to scale b's elements by before adding + * @returns {mat4} out + */ + public static multiplyScalarAndAdd (out:mat4, a:mat4, b:mat4, scale:number):mat4 + + /** + * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===) + * + * @param {mat4} a The first matrix. + * @param {mat4} b The second matrix. + * @returns {boolean} True if the matrices are equal, false otherwise. + */ + public static exactEquals (a:mat4, b:mat4) :boolean + + /** + * Returns whether or not the matrices have approximately the same elements in the same position. + * + * @param {mat4} a The first matrix. + * @param {mat4} b The second matrix. + * @returns {boolean} True if the matrices are equal, false otherwise. + */ + public static equals (a:mat4, b:mat4): boolean + +} + +// quat +export class quat extends Float32Array { + private typeQuat:number; + + /** + * Creates a new identity quat + * + * @returns a new quaternion + */ + public static create(): quat; + + /** + * Creates a new quat initialized with values from an existing quaternion + * + * @param a quaternion to clone + * @returns a new quaternion + * @function + */ + public static clone(a: quat): quat; + + /** + * Creates a new quat initialized with the given values + * + * @param x X component + * @param y Y component + * @param z Z component + * @param w W component + * @returns a new quaternion + * @function + */ + public static fromValues(x: number, y: number, z: number, w: number): quat; + + /** + * Copy the values from one quat to another + * + * @param out the receiving quaternion + * @param a the source quaternion + * @returns out + * @function + */ + public static copy(out: quat, a: quat): quat; + + /** + * Set the components of a quat to the given values + * + * @param out the receiving quaternion + * @param x X component + * @param y Y component + * @param z Z component + * @param w W component + * @returns out + * @function + */ + public static set(out: quat, x: number, y: number, z: number, w: number): quat; + + /** + * Set a quat to the identity quaternion + * + * @param out the receiving quaternion + * @returns out + */ + public static identity(out: quat): quat; + + /** + * Sets a quaternion to represent the shortest rotation from one + * vector to another. + * + * Both vectors are assumed to be unit length. + * + * @param {quat} out the receiving quaternion. + * @param {vec3} a the initial vector + * @param {vec3} b the destination vector + * @returns {quat} out + */ + public static rotationTo (out:quat, a:vec3, b:vec3): quat; + + /** + * Sets the specified quaternion with values corresponding to the given + * axes. Each axis is a vec3 and is expected to be unit length and + * perpendicular to all other specified axes. + * + * @param {vec3} view the vector representing the viewing direction + * @param {vec3} right the vector representing the local "right" direction + * @param {vec3} up the vector representing the local "up" direction + * @returns {quat} out + */ + public static setAxes (out:quat, view:vec3, right:vec3, up:vec3):quat + + + + /** + * Sets a quat from the given angle and rotation axis, + * then returns it. + * + * @param out the receiving quaternion + * @param axis the axis around which to rotate + * @param rad the angle in radians + * @returns out + **/ + public static setAxisAngle(out: quat, axis: vec3, rad: number): quat; + + /** + * Gets the rotation axis and angle for a given + * quaternion. If a quaternion is created with + * setAxisAngle, this method will return the same + * values as providied in the original parameter list + * OR functionally equivalent values. + * Example: The quaternion formed by axis [0, 0, 1] and + * angle -90 is the same as the quaternion formed by + * [0, 0, 1] and 270. This method favors the latter. + * @param {vec3} out_axis Vector receiving the axis of rotation + * @param {quat} q Quaternion to be decomposed + * @return {number} Angle, in radians, of the rotation + */ + public static getAxisAngle (out_axis:vec3, q:quat) :number + + /** + * Adds two quat's + * + * @param out the receiving quaternion + * @param a the first operand + * @param b the second operand + * @returns out + * @function + */ + public static add(out: quat, a: quat, b: quat): quat; + + /** + * Multiplies two quat's + * + * @param out the receiving quaternion + * @param a the first operand + * @param b the second operand + * @returns out + */ + public static multiply(out: quat, a: quat, b: quat): quat; + + /** + * Multiplies two quat's + * + * @param out the receiving quaternion + * @param a the first operand + * @param b the second operand + * @returns out + */ + public static mul(out: quat, a: quat, b: quat): quat; + + /** + * Scales a quat by a scalar number + * + * @param out the receiving vector + * @param a the vector to scale + * @param b amount to scale the vector by + * @returns out + * @function + */ + public static scale(out: quat, a: quat, b: number): quat; + + /** + * Calculates the length of a quat + * + * @param a vector to calculate length of + * @returns length of a + * @function + */ + public static length(a: quat): number; + + /** + * Calculates the length of a quat + * + * @param a vector to calculate length of + * @returns length of a + * @function + */ + public static len(a: quat): number; + + /** + * Calculates the squared length of a quat + * + * @param a vector to calculate squared length of + * @returns squared length of a + * @function + */ + public static squaredLength(a: quat): number; + + /** + * Calculates the squared length of a quat + * + * @param a vector to calculate squared length of + * @returns squared length of a + * @function + */ + public static sqrLen(a: quat): number; + + /** + * Normalize a quat + * + * @param out the receiving quaternion + * @param a quaternion to normalize + * @returns out + * @function + */ + public static normalize(out: quat, a: quat): quat; + + /** + * Calculates the dot product of two quat's + * + * @param a the first operand + * @param b the second operand + * @returns dot product of a and b + * @function + */ + public static dot(a: quat, b: quat): number; + + /** + * Performs a linear interpolation between two quat's + * + * @param out the receiving quaternion + * @param a the first operand + * @param b the second operand + * @param t interpolation amount between the two inputs + * @returns out + * @function + */ + public static lerp(out: quat, a: quat, b: quat, t: number): quat; + + /** + * Performs a spherical linear interpolation between two quat + * + * @param out the receiving quaternion + * @param a the first operand + * @param b the second operand + * @param t interpolation amount between the two inputs + * @returns out + */ + public static slerp(out:quat, a:quat, b:quat, t:number): quat; + + /** + * Performs a spherical linear interpolation with two control points + * + * @param {quat} out the receiving quaternion + * @param {quat} a the first operand + * @param {quat} b the second operand + * @param {quat} c the third operand + * @param {quat} d the fourth operand + * @param {number} t interpolation amount + * @returns {quat} out + */ + public static sqlerp(out: quat, a: quat, b: quat, c: quat, d: quat, t: number): quat; + + /** + * Calculates the inverse of a quat + * + * @param out the receiving quaternion + * @param a quat to calculate inverse of + * @returns out + */ + public static invert(out: quat, a: quat): quat; + + /** + * Calculates the conjugate of a quat + * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result. + * + * @param out the receiving quaternion + * @param a quat to calculate conjugate of + * @returns out + */ + public static conjugate(out: quat, a: quat): quat; + + /** + * Returns a string representation of a quaternion + * + * @param a quat to represent as a string + * @returns string representation of the quat + */ + public static str(a: quat): string; + + /** + * Rotates a quaternion by the given angle about the X axis + * + * @param out quat receiving operation result + * @param a quat to rotate + * @param rad angle (in radians) to rotate + * @returns out + */ + public static rotateX(out: quat, a: quat, rad: number): quat; + + /** + * Rotates a quaternion by the given angle about the Y axis + * + * @param out quat receiving operation result + * @param a quat to rotate + * @param rad angle (in radians) to rotate + * @returns out + */ + public static rotateY(out: quat, a: quat, rad: number): quat; + + /** + * Rotates a quaternion by the given angle about the Z axis + * + * @param out quat receiving operation result + * @param a quat to rotate + * @param rad angle (in radians) to rotate + * @returns out + */ + public static rotateZ(out: quat, a: quat, rad: number): quat; + + /** + * Creates a quaternion from the given 3x3 rotation matrix. + * + * NOTE: The resultant quaternion is not normalized, so you should be sure + * to renormalize the quaternion yourself where necessary. + * + * @param out the receiving quaternion + * @param m rotation matrix + * @returns out + * @function + */ + public static fromMat3(out: quat, m: mat3): quat; + + /** + * Sets the specified quaternion with values corresponding to the given + * axes. Each axis is a vec3 and is expected to be unit length and + * perpendicular to all other specified axes. + * + * @param out the receiving quat + * @param view the vector representing the viewing direction + * @param right the vector representing the local "right" direction + * @param up the vector representing the local "up" direction + * @returns out + */ + public static setAxes(out: quat, view: vec3, right: vec3, up: vec3): quat; + + /** + * Sets a quaternion to represent the shortest rotation from one + * vector to another. + * + * Both vectors are assumed to be unit length. + * + * @param out the receiving quaternion. + * @param a the initial vector + * @param b the destination vector + * @returns out + */ + public static rotationTo(out: quat, a: vec3, b: vec3): quat; + + /** + * Calculates the W component of a quat from the X, Y, and Z components. + * Assumes that quaternion is 1 unit in length. + * Any existing W component will be ignored. + * + * @param out the receiving quaternion + * @param a quat to calculate W component of + * @returns out + */ + public static calculateW(out: quat, a: quat): quat; + + /** + * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===) + * + * @param {quat} a The first vector. + * @param {quat} b The second vector. + * @returns {boolean} True if the quaternions are equal, false otherwise. + */ + public static exactEquals (a:quat, b:quat) : boolean; + + /** + * Returns whether or not the quaternions have approximately the same elements in the same position. + * + * @param {quat} a The first vector. + * @param {quat} b The second vector. + * @returns {boolean} True if the quaternions are equal, false otherwise. + */ + public static equals (a:quat, b:quat) : boolean; +} diff --git a/gl-matrix/gl-matrix.d.ts b/gl-matrix/gl-matrix.d.ts index b5dcdf3f1d..16366f263a 100644 --- a/gl-matrix/gl-matrix.d.ts +++ b/gl-matrix/gl-matrix.d.ts @@ -1828,8 +1828,27 @@ declare namespace mat4 { * @param v Translation vector * @returns out */ - export function fromRotationTranslation(out: GLM.IArray, q: GLM.IArray, - v: GLM.IArray): GLM.IArray; + export function fromRotationTranslation(out: GLM.IArray, q: GLM.IArray, v: GLM.IArray): GLM.IArray; + + /** + * Creates a matrix from a quaternion rotation, vector translation and vector scale. + * + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, vec); + * var quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale) + * + * @param out mat4 receiving operation result + * @param q Rotation quaternion + * @param v Translation vector + * @param s Scale vector + * @returns out + */ + export function fromRotationTranslationScale(out: GLM.IArray, q: GLM.IArray, v: GLM.IArray, s: GLM.IArray): GLM.IArray /** * Creates a matrix from a quaternion diff --git a/globalize-compiler/globalize-compiler-tests.ts b/globalize-compiler/globalize-compiler-tests.ts new file mode 100644 index 0000000000..f4fc934d1f --- /dev/null +++ b/globalize-compiler/globalize-compiler-tests.ts @@ -0,0 +1,36 @@ +/// + +import globalizeCompiler = require("globalize-compiler"); +const globalize: GlobalizeStatic = null; + +let extractsArray: GlobalizeCompiler.FormatterOrParserFunction[]; + +const templateFunction: (options: GlobalizeCompiler.CompileTemplateOptions) => string = + (options: GlobalizeCompiler.CompileTemplateOptions): string => { + const deps: string[] = options.dependencies; + const code: string = options.code; + return `${deps.join(';')}${code}`; + }; + +let compileOutput: string; +compileOutput = globalizeCompiler.compile(extractsArray); +compileOutput = globalizeCompiler.compile({ x: () => "test", y: (x: string) => x }); +compileOutput = globalizeCompiler.compile(extractsArray, { template: templateFunction }); +compileOutput = globalizeCompiler.compile({ x: () => "test", y: (x: string) => x }, { template: templateFunction }); + +let extractOutput: GlobalizeCompiler.ExtractFunction; +extractOutput = globalizeCompiler.extract("path"); + +const ast: ESTree.Program = undefined; +extractOutput = globalizeCompiler.extract(ast); + +extractsArray = extractOutput(globalize); + +compileOutput = globalizeCompiler.compileExtracts({ extracts: extractOutput, defaultLocale: "en" }); +compileOutput = globalizeCompiler.compileExtracts({ extracts: extractOutput, defaultLocale: "en", messages: {} }); +compileOutput = globalizeCompiler.compileExtracts({ extracts: extractOutput, defaultLocale: "en", template: templateFunction }); +compileOutput = globalizeCompiler.compileExtracts({ extracts: extractOutput, defaultLocale: "en", messages: {}, template: templateFunction }); +compileOutput = globalizeCompiler.compileExtracts({ extracts: extractOutput, defaultLocale: "en", cldr: {} }); +compileOutput = globalizeCompiler.compileExtracts({ extracts: extractOutput, defaultLocale: "en", cldr: {}, messages: {} }); +compileOutput = globalizeCompiler.compileExtracts({ extracts: extractOutput, defaultLocale: "en", cldr: {}, template: templateFunction }); +compileOutput = globalizeCompiler.compileExtracts({ extracts: extractOutput, defaultLocale: "en", cldr: {}, messages: {}, template: templateFunction }); diff --git a/globalize-compiler/globalize-compiler.d.ts b/globalize-compiler/globalize-compiler.d.ts new file mode 100644 index 0000000000..3959924412 --- /dev/null +++ b/globalize-compiler/globalize-compiler.d.ts @@ -0,0 +1,106 @@ +// Type definitions for globalize-compiler v0.2.0 +// Project: https://github.com/jquery-support/globalize-compiler +// Definitions by: Ian Clanton-Thuon +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// + +declare namespace GlobalizeCompiler { + interface CompileTemplateOptions { + /** + * the source of the compiled formatters and parsers. + */ + code: string; + + /** + * a list of globalize runtime modules that the compiled code depends on, e.g. globalize-runtime/number. + */ + dependencies: string[]; + } + + interface CompileOptions { + /** + * A function that replaces the default template. + */ + template?: (options: CompileTemplateOptions) => string; + } + + interface FormatterOrParserFunction { + (...arguments: any[]): any; + } + + interface ExtractFunction { + /** + * @param {globalize} the globalize object. + * + * @returns an Array with the formatters and parsers created using the passed Globalize. + */ + (globalize: GlobalizeStatic): FormatterOrParserFunction[]; + } + + interface CompileExtractsAttributes extends CompileOptions { + /** + * an Array of extracts obtained by @see{GlobalizeCompilerStatic.extract} + */ + extracts: ExtractFunction; + + /** + * a locale to be used as Globalize.locale(defaultLocale) when generating the extracted formatters and parsers. + */ + defaultLocale: string; + + /** + * an Object with CLDR data (in the JSON format) or a Function taking one argument: locale, a String; returning + * an Object with the CLDR data for the passed locale. Defaults to the entire supplemental data plus the entire + * main data for the defaultLocale. + */ + cldr?: Object | ((locale: string) => Object); + + /** + * an Object with messages data (in the JSON format) or a Function taking one argument: locale, a String; returning + * an Object with the messages data for the passed locale. Defaults to {}. + */ + messages?: Object | ((locale: string) => Object); + } + + interface GlobalizeCompilerStatic { + /** + * Generates a JavaScript bundle containing the specified globalize formatters and parsers. + * + * @param {formattersAndParsers} an Array or an Object containing formatters and/or parsers. + * @param {options} compiler options. + * + * @returns a String with the generated JavaScript bundle (UMD wrapped) including the compiled formatters and + * parsers. + */ + compile(formattersAndParsers: FormatterOrParserFunction[] | { [key: string]: FormatterOrParserFunction }, + options?: CompileOptions): string; + + /** + * Creates an extract function from a source file. + * + * @param {input} a String with a filename, or a String with the file content, or an AST Object. + * + * @returns an extract. An extract is a Function taking one argument: Globalize, the Globalize Object; + * and returning an Array with the formatters and parsers created using the passed Globalize. + */ + extract(input: string | ESTree.Program): ExtractFunction; + + /** + * Generates a JavaScript bundle containing the specified globalize formatters and parsers. + * + * @param {options} compiler attributes. + * + * @returns a String with the generated JavaScript bundle (UMD wrapped) including the compiled formatters and + * parsers. + */ + compileExtracts(attributes: CompileExtractsAttributes): string; + } +} + +declare module "globalize-compiler" { + var globalizeCompiler: GlobalizeCompiler.GlobalizeCompilerStatic; + + export = globalizeCompiler; +} diff --git a/globalize/globalize-0.1.3-tests.ts b/globalize/globalize-0.1.3-tests.ts new file mode 100644 index 0000000000..4e3e9056ed --- /dev/null +++ b/globalize/globalize-0.1.3-tests.ts @@ -0,0 +1,11 @@ +/// +module Tests { + Globalize.culture('en-US'); + Globalize.addCultureInfo('nb-NO', 'no', { messages: {Test: "Test"} }); + var cult = Globalize.findClosestCulture('nb-NO'); + var numberString = Globalize.format(1.245, 'n2'); + var testString = Globalize.localize('Test'); + var dateParsed = Globalize.parseDate('2016-02-03'); + var intParsed = Globalize.parseInt('123'); + var floatParsed = Globalize.parseFloat('12.3'); +} \ No newline at end of file diff --git a/globalize/globalize-0.1.3.d.ts b/globalize/globalize-0.1.3.d.ts new file mode 100644 index 0000000000..b31a1cc092 --- /dev/null +++ b/globalize/globalize-0.1.3.d.ts @@ -0,0 +1,25 @@ +// Type definitions for Globalize v0.1.3 (NuGet package version) +// Project: https://github.com/jquery/globalize +// Definitions by: Aram Taieb +// Definitions: https://github.com/afromogli/DefinitelyTyped + +interface GlobalizeStatic { + addCultureInfo(cultureName: string, baseCultureName: string, info: any): void; + findClosestCulture(name: string): any; + format(value: any, format: string): string; + format(value: any, format: string, cultureSelector: string): string; + localize(key: string): string; + localize(key: string, cultureSelector: string): string; + parseDate(value: any): Date; + parseDate(value: any, formats: any): Date; + parseDate(value: any, formats: any, culture: string): Date; + parseInt(value: any): number; + parseInt(value: any, radix: number): number; + parseInt(value: any, radix: number, cultureSelector: string): number; + parseFloat(value: any): number; + parseFloat(value: any, radix: number): number; + parseFloat(value: any, radix: number, cultureSelector: string): number; + culture(cultureSelector: string): any; +} + +declare var Globalize: GlobalizeStatic; diff --git a/globalize/globalize.d.ts b/globalize/globalize.d.ts index 8eeec964eb..d3bf7997d5 100644 --- a/globalize/globalize.d.ts +++ b/globalize/globalize.d.ts @@ -1,28 +1,330 @@ -// Type definitions for Globalize +// Type definitions for Globalize // Project: https://github.com/jquery/globalize -// Definitions by: Aram Taieb -// Definitions: https://github.com/afromogli/DefinitelyTyped +// Definitions by: Grégoire Castre , Aram Taieb +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// Note: You'll need the cldr.js definition file to use the globalize (https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/cldr.js) -interface NumberFormatterOptions { - minimumIntegerDigits?: number; - minimumFractionDigits?: number; - maximumFractionDigits?: number; - minimumSignificantDigits?: number; - maximumSignificantDigits?: number; - round?: string; - useGrouping?: boolean; +/// + +interface DateFormatterOptions { + /** + * String value indicating a skeleton (see description above), eg. { skeleton: "GyMMMd" }. + * Skeleton provides a more flexible formatting mechanism than the predefined list full, long, medium, or short represented by date, time, or datetime. + * Instead, they are an open-ended list of patterns containing only date field information, and in a canonical order. + */ + skeleton?: string; + /** + * One of the following String values: full, long, medium, or short, eg. { date: "full" }. + */ + date?: "full" | "long" | "medium" | "short"; + /** + * One of the following String values: full, long, medium, or short, eg. { time: "full" }. + */ + time?: "full" | "long" | "medium" | "short"; + /** + * One of the following String values: full, long, medium, or short, eg. { datetime: "full" } + */ + datetime?: "full" | "long" | "medium" | "short"; + /** + * String value indicating a machine raw pattern (anything in the "Sym." column) eg. { raw: "dd/mm" }. + * Note this is NOT recommended for i18n in general. Use skeleton instead. + */ + raw?: string; } -interface Cldr { - /* TODO: add typings */ +interface CommonNumberFormatterOptions { + /** + * Non-negative integer Number value indicating the minimum integer digits to be used. Numbers will be padded with leading zeroes if necessary. + */ + minimumIntegerDigits?: number; + /** + * Non-negative integer Number values indicating the minimum and maximum fraction digits to be used. + * Numbers will be rounded or padded with trailing zeroes if necessary. + * Either one or both of these properties must be present. + * If they are, they will override minimum and maximum fraction digits derived from the CLDR patterns. + */ + minimumFractionDigits?: number; + /** + * Non-negative integer Number values indicating the minimum and maximum fraction digits to be used. + * Numbers will be rounded or padded with trailing zeroes if necessary. + * Either one or both of these properties must be present. + * If they are, they will override minimum and maximum fraction digits derived from the CLDR patterns. + */ + maximumFractionDigits?: number; + /** + * Positive integer Number values indicating the minimum and maximum fraction digits to be shown. + * Either none or both of these properties are present + * If they are, they override minimum and maximum integer and fraction digits. + * The formatter uses however many integer and fraction digits are required to display the specified number of significant digits. + */ + minimumSignificantDigits?: number; + /** + * Positive integer Number values indicating the minimum and maximum fraction digits to be shown. + * Either none or both of these properties are present. + * If they are, they override minimum and maximum integer and fraction digits. + * The formatter uses however many integer and fraction digits are required to display the specified number of significant digits. + */ + maximumSignificantDigits?: number; + /** + * String with rounding method ceil, floor, round (default), or truncate. + */ + round?: "ceil" | "floor" | "round" | "truncate"; + /** + * Boolean (default is true) value indicating whether a grouping separator should be used. + */ + useGrouping?: boolean; +} + +interface NumberFormatterOptions extends CommonNumberFormatterOptions { + /** + * decimal (default), or percent + */ + style?: "decimal" | "percent"; +} + +interface CurrencyFormatterOptions extends CommonNumberFormatterOptions { + /** + * symbol (default), accounting, code or name. + */ + style?: "symbol" | "accounting" | "code" | "name"; +} + +interface NumberParserOptions { + /** + * decimal (default), or percent. + */ + style?: "decimal" | "percent"; +} + +interface PluralGeneratorOptions { + /** + * cardinal (default), or ordinal. + */ + type?: "cardinal" | "ordinal"; +} + +interface RelativeTimeFormatterOptions { + /** + * eg. "short" or "narrow". Or falsy for default long form + */ + form?: "short" | "narrow"; +} + +interface UnitFormatterOptions { + /** + * form: [String] eg. "long", "short" or "narrow". + */ + form?: "long" | "short" | "narrow"; + + /** + * numberFormatter: [Function] a number formatter function. Defaults to Globalize .numberFormatter() for the current locale using the default options. + */ + numberFormatter?: NumberFormatterOptions; } interface GlobalizeStatic { - load(jsonData: any): void; - locale(locale: string): Cldr; - numberFormatter(options?: NumberFormatterOptions): (value: number) => string; - formatNumber(value:number, options?: NumberFormatterOptions): string; + cldr: cldr.CldrStatic; + + /** + * Globalize.load( json, ... ) + * @param {Object} [JSON] + * Load resolved or unresolved cldr data. + * Somewhat equivalent to previous Globalize.addCultureInfo(...). + */ + load(json: Object): void; + + /** + * Globalize.locale() + * Return the default Cldr instance. + */ + locale(): cldr.CldrStatic; + + /** + * Globalize.locale( [locale] ) + * @param {string} locale + * Set default Cldr instance + * Return the default Cldr instance. + */ + + locale(locale: string): cldr.CldrStatic; + /** + * Globalize.locale( cldr ) + * @param {Cldr} cldr [Cldr instance] + * Set default Cldr instance + * Return the default Cldr instance. + */ + locale(cldr: cldr.CldrStatic): cldr.CldrStatic; + + /** + * .dateFormatter( options ) + * @param {DateFormatterOptions} options see date/expand_pattern for more info. + * @returns {Function} Return a function that formats a date according to the given `options` and the default/instance locale. + */ + dateFormatter(options?: DateFormatterOptions): (value: Date) => string; + + //Return a function that parses a string representing a date into a JavaScript Date object according to the given options. The default parsing assumes numeric year, month, and day (i.e., { skeleton: "yMd" }). + dateParser(options?: DateFormatterOptions): (value: string) => Date; + + //Alias for .dateFormatter( [options] )( value ). + formatDate(value: Date, options?: DateFormatterOptions): string; + /** + * Alias for .dateParser( [options] )( value ). + * @param {string} value The object whose module id you wish to determine. + * @param {DateFormatterOptions} options The object whose module id you wish to determine. + * @returns {Date} Return the value as a Date. + */ + parseDate(value: string, options?: DateFormatterOptions): Date; + + /** + * Load messages data. + * @param {Object} json JSON object of messages data. Keys can use any character, except /, { and }. Values (i.e., the message content itself) can contain any character. + * @returns {void} + */ + loadMessages(json: Object): void; + /** + * Return a function that formats a message (using ICU message format pattern) given its path and a set of variables into a user-readable string. It supports pluralization and gender inflections. + * @param path String or Array containing the path of the message content, eg. "greetings/bye", or [ "greetings", "bye" ]. + * @returns {Function} Return A function that formats a message (using ICU message format pattern) given its path and a set of variables into a user-readable string. It supports pluralization and gender inflections. + */ + messageFormatter(path: string | string[]): (variables?: string | string[] | Object) => string; + + /** + * Formats a message (using ICU message format pattern) given its path and a set of variables into a user-readable string + * @param path String or Array containing the path of the message content, eg. "greetings/bye", or [ "greetings", "bye" ]. + * @param variables Variables can be Objects, where each property can be referenced by name inside a message; or Arrays, where each entry of the Array can be used inside a message, using numeric indices. When passing one or more arguments of other types, they're converted to an Array and used as such. + * @returns {string} Return a user-readable string. + */ + formatMessage(path: string | string[], variables?: string | string[] | Object): string + + /** + * Return a function that formats a number according to the given options or locale's defaults. + * @param {NumberFormatterOptions} options A JSON object including none or any of the following options. + * style Optional String decimal (default), or percent. + * minimumIntegerDigits Optional Non-negative integer Number value indicating the minimum integer digits to be used. Numbers will be padded with leading zeroes if necessary. + * minimumFractionDigits and maximumFractionDigits Optional Non-negative integer Number values indicating the minimum and maximum fraction digits to be used. Numbers will be rounded or padded with trailing zeroes if necessary. Either one or both of these properties must be present. If they are, they will override minimum and maximum fraction digits derived from the CLDR patterns. + * minimumSignificantDigits and maximumSignificantDigits Optional Positive integer Number values indicating the minimum and maximum fraction digits to be shown. Either none or both of these properties are present. If they are, they override minimum and maximum integer and fraction digits. The formatter uses however many integer and fraction digits are required to display the specified number of significant digits. + * round Optional String with rounding method ceil, floor, round (default), or truncate. + * useGrouping Optional Boolean (default is true) value indicating whether a grouping separator should be used. + * @returns {Function} Return a function that formats a number according to the given options. + */ + numberFormatter(options?: NumberFormatterOptions): (value: number) => string; + + /** + * Return a function that parses a string representing a number according to the given options or locale's defaults. + * @param {NumberParserOptions} options A JSON object including none or any of the following options. + * style Optional String decimal (default), or percent. + * @returns {Function} Return a function that parses a String representing a number according to the given options. If value is invalid, NaN is returned. + */ + numberParser(options?: NumberParserOptions): (value: string) => number + + /** + * Return a number formatted according to the given options or locale's defaults. + * @param {number} value The number to format + * @param {NumberFormatterOptions} options A JSON object including none or any of the following options. + * style Optional String decimal (default), or percent. + * minimumIntegerDigits Optional Non-negative integer Number value indicating the minimum integer digits to be used. Numbers will be padded with leading zeroes if necessary. + * minimumFractionDigits and maximumFractionDigits Optional Non-negative integer Number values indicating the minimum and maximum fraction digits to be used. Numbers will be rounded or padded with trailing zeroes if necessary. Either one or both of these properties must be present. If they are, they will override minimum and maximum fraction digits derived from the CLDR patterns. + * minimumSignificantDigits and maximumSignificantDigits Optional Positive integer Number values indicating the minimum and maximum fraction digits to be shown. Either none or both of these properties are present. If they are, they override minimum and maximum integer and fraction digits. The formatter uses however many integer and fraction digits are required to display the specified number of significant digits. + * round Optional String with rounding method ceil, floor, round (default), or truncate. + * useGrouping Optional Boolean (default is true) value indicating whether a grouping separator should be used. + * @returns {string} Return the number formatted + */ + formatNumber(value: number, options?: NumberFormatterOptions): string; + + /** + * A function that parses a string representing a number according to the given options or locale's defaults. + * @param {string} value The number as string to parse + * @param {NumberParserOptions} options A JSON object including none or any of the following options. + * style Optional String decimal (default), or percent. + * @returns {number} Return a number according to the given options. If value is invalid, NaN is returned. + */ + parseNumber(value: string, options?: NumberParserOptions): number; + + /** + * Return a function that formats a currency according to the given options or locale's defaults. + * The returned function is invoked with one argument: the Number value to be formatted. + * @param {string} currency 3-letter currency code as defined by ISO 4217, eg. USD. + * @param {CurrencyFormatterOptions} options A JSON object including none or any of the following options. + * @returns {Function} Return a function that formats a currency + */ + currencyFormatter(currency: string, options?: CurrencyFormatterOptions): (value: number) => string; + + /** + * Return a currency formatted according to the given options or locale's defaults. + * @param {number} value The value to format. + * @param {string} currency 3-letter currency code as defined by ISO 4217, eg. USD. + * @param {CurrencyFormatterOptions} options A JSON object including none or any of the following options. + * @returns {string} Return a string formatted in the currency according to the value and the options + */ + formatCurrency(value: number, currency: string, options?: CurrencyFormatterOptions): string; + + /** + * Return a function that returns the value's corresponding plural group: zero, one, two, few, many, or other. + * The returned function is invoked with one argument: the Number value for which to return the plural group. + * @param {PluralGeneratorOptions} options A JSON object including none or any of the following options. + * type Optional String cardinal (default), or ordinal. + * @returns {Function} Return a function that returns the value's corresponding plural group: zero, one, two, few, many, or other. + */ + pluralGenerator(options?: PluralGeneratorOptions): (value: number) => string; + + /** + * Returns the value's corresponding plural group: zero, one, two, few, many, or other. + * @param {number} value A Number for which to return the plural group. + * @param {PluralGeneratorOptions} options A JSON object including none or any of the following options. + * type Optional String cardinal (default), or ordinal. + * @returns {string} Returns the value's corresponding plural group: zero, one, two, few, many, or other. + */ + plural(value: number, options?: PluralGeneratorOptions): string; + + /** + * Returns a function that formats a relative time according to the given unit, options, and the default/instance locale. + * The returned function is invoked with one argument: the number value to be formatted. + * @param unit String value indicating the unit to be formatted. eg. "day", "week", "month", etc. + * @param options form: [String] eg. "short" or "narrow". Or falsy for default long form. + * @returns {Function} Returns a function that formats a relative time according to the given unit. + */ + relativeTimeFormatter(unit: string, options?: RelativeTimeFormatterOptions): (value: number) => string; + + /** + * Return a relative time according to the given unit + * @param {number} value The number to be formatted. + * @param {string} unit String value indicating the unit to be formatted. eg. "day", "week", "month", etc. + * @param options form: [String] eg. "short" or "narrow". Or falsy for default long form. + * @returns {string} Return a relative time according to the given unit. + */ + formatRelativeTime(value: number, unit: string, options?: RelativeTimeFormatterOptions): string; + + /** + * Returns a function that formats a unit according to the given unit, options, and the default/instance locale. + * The returned function is invoked with one argument: the number value to be formatted. + * @param unit String value indicating the unit to be formatted. eg. "day", "week", "month", etc. Could also be a compound unit, eg. "mile-per-hour" or "mile/hour" + * @param options form: [String] eg. "long", "short" or "narrow". + * @returns {Function} Returns a function that formats a unit according to the given unit, options, and the default/instance locale. + */ + unitFormatter(unit: string, options?: UnitFormatterOptions): (value: number) => string; + + /** + * Alias for .unitFormatter( unit, options )( value ). + * @param {number} value The number to be formatted. + * @param {string} unit String value indicating the unit to be formatted. eg. "day", "week", "month", etc. Could also be a compound unit, eg. "mile-per-hour" or "mile/hour" + * @param {UnitFormatterOptions} options form: [String] eg. "long", "short" or "narrow". + * @returns {string} Returns the unit formatted. + */ + formatUnit(value: number, unit: string, options?: UnitFormatterOptions): string + + /** + * Create a Globalize instance. + * @param {string} Locale string of the instance. + * @returns {Globalize} A Globalize instance + */ + new (locale: string): GlobalizeStatic; + /** + * Create a Globalize instance. + * @param cldr Cldr instance of the instance. + * @returns {Globalize} A Globalize instance + */ + new (cldr: cldr.CldrStatic): GlobalizeStatic; } declare var Globalize: GlobalizeStatic; diff --git a/google-closure-compiler/google-closure-compiler-tests.ts b/google-closure-compiler/google-closure-compiler-tests.ts index b87bb4948c..b558ee9516 100644 --- a/google-closure-compiler/google-closure-compiler-tests.ts +++ b/google-closure-compiler/google-closure-compiler-tests.ts @@ -26,3 +26,12 @@ let jsonStream: GoogleClosureCompiler.JSONStreamFile[] = [ src: 'var x = "hello, world";', }, ]; + +// Test the various options formats -- see +// https://github.com/ChadKillingsworth/closure-compiler-npm#specifying-options +let optionsFormats: GoogleClosureCompiler.CompileOptions = { + js: ['/file-one.js', '/file-two.js'], + compilation_level: 'ADVANCED', + js_output_file: 'out.js', + debug: true +}; diff --git a/google-closure-compiler/google-closure-compiler.d.ts b/google-closure-compiler/google-closure-compiler.d.ts index e1a21ab106..acfcc7cccb 100644 --- a/google-closure-compiler/google-closure-compiler.d.ts +++ b/google-closure-compiler/google-closure-compiler.d.ts @@ -5,6 +5,10 @@ /// +// Note: the types seen in the JSDoc are wrong: +// https://github.com/ChadKillingsworth/closure-compiler-npm/issues/21 +// Be careful to read the code when choosing types. + declare module 'google-closure-compiler' { import * as child_process from 'child_process'; @@ -26,7 +30,8 @@ declare module 'google-closure-compiler' { getFullCommand(): string; } - type CompileOptions = {[key: string]: string}; + type CompileOption = string | boolean; + type CompileOptions = string[] | {[key: string]: (CompileOption|CompileOption[])}; var compiler: { new (opts: (CompileOptions|string[]), extraCommandArgs?: string[]): Compiler; diff --git a/google-drive-realtime-api/google-drive-realtime-api.d.ts b/google-drive-realtime-api/google-drive-realtime-api.d.ts index 2964ee90b6..b263b30bb9 100644 --- a/google-drive-realtime-api/google-drive-realtime-api.d.ts +++ b/google-drive-realtime-api/google-drive-realtime-api.d.ts @@ -430,6 +430,38 @@ declare namespace gapi.drive.realtime { events : BaseModelEvent[]; } + // https://developers.google.com/google-apps/realtime/reference/gapi.drive.realtime.ValuesAddedEvent + export interface ValuesAddedEvent extends BaseModelEvent { + new (target:CollaborativeObject, sessionId:string, userId:string, compoundOperationNames:string[], + isLocal:boolean, isUndo:boolean, isRedo:boolean, index:number, + values:V[], movedFromList:CollaborativeList, movedFromIndex:number):ValuesAddedEvent; + + // The index of the first added value + index:number; + + // The index in the source collaborative list that the values were moved from, or null if this insert is not the result of a move operation. + movedFromIndex:number; + + // The collaborative list that the values were moved from, or null if this insertion is not the result of a move operation. + movedFromList:CollaborativeList; + } + + // https://developers.google.com/google-apps/realtime/reference/gapi.drive.realtime.ValuesRemovedEvent + export interface ValuesRemovedEvent extends BaseModelEvent { + new (target:CollaborativeObject, sessionId:string, userId:string, compoundOperationNames:string[], + isLocal:boolean, isUndo:boolean, isRedo:boolean, index:number, + values:V[], movedToList:CollaborativeList, movedToIndex:number):ValuesRemovedEvent; + + // The index of the first removed value. + index:number; + + // The index in the collaborative list that the values were moved to, or null if this delete is not the result of a move operation. + movedToIndex:number; + + // The collaborative list that the values were moved to, or null if this delete is not the result of a move operation. + movedToList:CollaborativeList; + } + // Complete // https://developers.google.com/google-apps/realtime/reference/gapi.drive.realtime.Document @@ -513,6 +545,30 @@ declare namespace gapi.drive.realtime { opt_initializerFn? : (m:Model) => void, opt_errorFn? : (e:gapi.drive.realtime.Error) => void ) : Document; + + /* Loads an existing file by id. + https://developers.google.com/google-apps/realtime/reference/gapi.drive.realtime#.load + + @Param fileId {string} Id of the file to load. + + @Param onLoaded {function(non-null gapi.drive.realtime.Document)} + A callback that will be called when the realtime document is ready. The created or opened realtime document + object will be passed to this function. + + @Param opt_initializerFn {function(non-null gapi.drive.realtime.Model)} + An optional initialization function that will be called before onLoaded only the first time that the document + is loaded. The document's gapi.drive.realtime.Model object will be passed to this function. + + @Param opt_errorFn {function(non-null gapi.drive.realtime.Error)} + An optional error handling function that will be called if an error occurs while the document is being + loaded or edited. A gapi.drive.realtime.Error object describing the error will be passed to this function. + */ + export function load( + fileId:string, + onLoaded? : (d:Document) => void, + opt_initializerFn? : (m:Model) => void, + opt_errorFn? : (e:gapi.drive.realtime.Error) => void + ):void; } @@ -540,6 +596,10 @@ declare namespace gapi.drive.realtime.EventType { export var TEXT_INSERTED: string export var TEXT_DELETED: string export var OBJECT_CHANGED: string + // List + export var VALUES_ADDED:string; + export var VALUES_REMOVED:string; + export var VALUES_SET:string; } diff --git a/google-libphonenumber/google-libphonenumber-tests.ts b/google-libphonenumber/google-libphonenumber-tests.ts new file mode 100644 index 0000000000..0768f0f7a9 --- /dev/null +++ b/google-libphonenumber/google-libphonenumber-tests.ts @@ -0,0 +1,36 @@ +/// + +import libphonenumber = require('google-libphonenumber'); +import {PhoneNumberFormat, PhoneNumberUtil, AsYouTypeFormatter} from 'google-libphonenumber'; + +() => { + // Require `PhoneNumberFormat`. + var PNF = libphonenumber.PhoneNumberFormat; + + // Get an instance of `PhoneNumberUtil`. + var phoneUtil = libphonenumber.PhoneNumberUtil.getInstance(); + + // Parse number with country code. + var phoneNumber = phoneUtil.parse('202-456-1414', 'US'); + + // Print number in the international format. + console.log(phoneUtil.format(phoneNumber, PNF.INTERNATIONAL)); + // => +1 202-456-1414 +} + +() => { + // Require `AsYouTypeFormatter`. + var AsYouTypeFormatter = libphonenumber.AsYouTypeFormatter; + var formatter = new AsYouTypeFormatter('US'); + + console.log(formatter.inputDigit('6')); // => 6 + console.log(formatter.inputDigit('5')); // => 65 + console.log(formatter.inputDigit('0')); // => 650 + console.log(formatter.inputDigit('2')); // => 650-2 + console.log(formatter.inputDigit('5')); // => 650-25 + console.log(formatter.inputDigit('3')); // => 650-253 + console.log(formatter.inputDigit('2')); // => 650-2532 + console.log(formatter.inputDigit('2')); // => (650) 253-22 + + formatter.clear(); +} diff --git a/google-libphonenumber/google-libphonenumber.d.ts b/google-libphonenumber/google-libphonenumber.d.ts new file mode 100644 index 0000000000..fea36d9675 --- /dev/null +++ b/google-libphonenumber/google-libphonenumber.d.ts @@ -0,0 +1,38 @@ +// Type definitions for libphonenumber v7.4.3 +// Project: https://github.com/googlei18n/libphonenumber +// Project: https://github.com/seegno/google-libphonenumber +// Definitions by: Leon Yu +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace libphonenumber { + export enum PhoneNumberFormat { + E164, + INTERNATIONAL, + NATIONAL, + RFC3966 + } + + interface PhoneNumber { + } + + export class PhoneNumberUtil { + static getInstance(): PhoneNumberUtil + parse(number: string, region: string): PhoneNumber; + isValidNumber(phoneNumber: PhoneNumber): boolean; + isValidNumberForRegion(phoneNumber: PhoneNumber): boolean; + getRegionCodeForNumber(phoneNumber: PhoneNumber): string; + isNANPACountry(regionCode: string): boolean; + format(phoneNumber: PhoneNumber, format: PhoneNumberFormat): string; + } + + export class AsYouTypeFormatter { + constructor(region: string); + inputDigit(digit: string): string; + clear(): void; + } +} + + +declare module 'google-libphonenumber' { + export = libphonenumber; +} diff --git a/google.visualization/google.visualization-tests.ts b/google.visualization/google.visualization-tests.ts index a5b1352dee..3453e2124c 100644 --- a/google.visualization/google.visualization-tests.ts +++ b/google.visualization/google.visualization-tests.ts @@ -488,3 +488,25 @@ function test_formatter_PatternFormat() { table.draw(view, { allowHtml: true, showRowNumber: true, width: '100%', height: '100%' }); } + +function test_ChartsLoad() { + google.charts.load('current', {packages: ['corechart', 'table', 'sankey']}); + + function drawChart() { + // Define the chart to be drawn. + var data = new google.visualization.DataTable(); + data.addColumn('string', 'Element'); + data.addColumn('number', 'Percentage'); + data.addRows([ + ['Nitrogen', 0.78], + ['Oxygen', 0.21], + ['Other', 0.01] + ]); + + // Instantiate and draw the chart. + var chart = new google.visualization.PieChart(document.getElementById('myPieChart')); + chart.draw(data, null); + } + + google.charts.setOnLoadCallback(drawChart); +} diff --git a/google.visualization/google.visualization.d.ts b/google.visualization/google.visualization.d.ts index 9ed800798c..a4dc1b7b1a 100644 --- a/google.visualization/google.visualization.d.ts +++ b/google.visualization/google.visualization.d.ts @@ -1,6 +1,6 @@ // Type definitions for Google Visualisation Apis // Project: https://developers.google.com/chart/ -// Definitions by: Dan Ludwig +// Definitions by: Dan Ludwig , Gregory Moore // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace google { @@ -9,6 +9,12 @@ declare namespace google { function setOnLoadCallback(handler: Function): void; function setOnLoadCallback(handler: () => void): void; + // https://developers.google.com/chart/interactive/docs/basic_load_libs + namespace charts { + function load(version: string, packages: Object): void; + function setOnLoadCallback(handler: Function): void; + } + //https://developers.google.com/chart/interactive/docs/reference namespace visualization { @@ -141,6 +147,7 @@ declare namespace google { id?: string; role?: string; pattern?: string; + p?: any; } export interface DataObject { @@ -186,6 +193,42 @@ declare namespace google { function arrayToDataTable(data: any[], firstRowIsData?: boolean): DataTable; + //#endregion + //#region Query + + // https://developers.google.com/chart/interactive/docs/reference#query + export class Query { + constructor(dataSourceUrl: string, options?: QueryOptions); + + abort(): void; + + setRefreshInterval(intervalSeconds: number): void; + setTimeout(timeoutSeconds: number): void; + setQuery(queryString:string): void; + + send(callback: (response: QueryResponse) => void): void; + } + + export interface QueryOptions { + sendMethod?: string, + makeRequestParams?: Object + } + + //#endregion + //#region QueryResponse + + // https://developers.google.com/chart/interactive/docs/reference#queryresponse + export class QueryResponse { + constructor(responseObject: Object); + + getDataTable(): DataTable; + getDetailedMessage(): string; + getMessage(): string; + getReasons(): string[]; + hasWarning(): boolean; + isError(): boolean; + } + //#endregion //#region DataView diff --git a/googlemaps/google.maps.d.ts b/googlemaps/google.maps.d.ts index 4d225779ce..0c551fd712 100644 --- a/googlemaps/google.maps.d.ts +++ b/googlemaps/google.maps.d.ts @@ -1585,15 +1585,22 @@ declare namespace google.maps { setZoom(zoom: number): void; } + export interface FullscreenControlOptions { + position?: ControlPosition; + } + export interface StreetViewPanoramaOptions { addressControl?: boolean; addressControlOptions?: StreetViewAddressControlOptions; clickToGo?: boolean; - disableDefaultUi?: boolean; + disableDefaultUI?: boolean; disableDoubleClickZoom?: boolean; enableCloseButton?: boolean; + fullscreenControl?: boolean; + fullscreenControlOptions?: FullscreenControlOptions; imageDateControl?: boolean; linksControl?: boolean; + mode?: "html4" | "html5" |"webgl"; panControl?: boolean; panControlOptions?: PanControlOptions; pano?: string; @@ -1602,6 +1609,7 @@ declare namespace google.maps { pov?: StreetViewPov; scrollwheel?: boolean; visible?: boolean; + zoom?: number; zoomControl?: boolean; zoomControlOptions?: ZoomControlOptions; } @@ -1643,7 +1651,29 @@ declare namespace google.maps { worldSize?: Size; } + export enum StreetViewPreference { + BEST, + NEAREST + } + + export enum StreetViewSource { + DEFAULT, + OUTDOOR + } + + export interface StreetViewLocationRequest { + location: LatLng|LatLngLiteral; + preference?: StreetViewPreference; + radius?: number; + source?: StreetViewSource; + } + + export interface StreetViewPanoRequest { + pano: string; + } + export class StreetViewService { + getPanorama(request: StreetViewLocationRequest|StreetViewPanoRequest, cb: (data: StreetViewPanoramaData, status: StreetViewStatus) => void): void; getPanoramaById(pano: string, callback: (streetViewPanoramaData: StreetViewPanoramaData, streetViewStatus: StreetViewStatus) => void): void; getPanoramaByLocation(latlng: LatLng|LatLngLiteral, radius: number, callback: (streetViewPanoramaData: StreetViewPanoramaData, streetViewStatus: StreetViewStatus) => void ): void; } @@ -1753,21 +1783,22 @@ declare namespace google.maps { } export type LatLngLiteral = { lat: number; lng: number } + export type LatLngBoundsLiteral = { east: number; north: number; south: number; west: number } export class LatLngBounds { - constructor(sw?: LatLng, ne?: LatLng); + constructor(sw?: LatLng|LatLngLiteral, ne?: LatLng|LatLngLiteral); contains(latLng: LatLng): boolean; - equals(other: LatLngBounds): boolean; + equals(other: LatLngBounds|LatLngBoundsLiteral): boolean; extend(point: LatLng): LatLngBounds; getCenter(): LatLng; getNorthEast(): LatLng; getSouthWest(): LatLng; - intersects(other: LatLngBounds): boolean; + intersects(other: LatLngBounds|LatLngBoundsLiteral): boolean; isEmpty(): boolean; toSpan(): LatLng; toString(): string; toUrlValue(precision?: number): string; - union(other: LatLngBounds): LatLngBounds; + union(other: LatLngBounds|LatLngBoundsLiteral): LatLngBounds; } export class Point { diff --git a/graphene-pk11/graphene-pk11.d.ts b/graphene-pk11/graphene-pk11.d.ts index 5c0c5c5142..ce3d162f17 100644 --- a/graphene-pk11/graphene-pk11.d.ts +++ b/graphene-pk11/graphene-pk11.d.ts @@ -1,1230 +1,276 @@ -// Type definitions for graphene-pk11 v2.0.0 +// Type definitions for graphene-pk11 v2.0.2 // Project: https://github.com/PeculiarVentures/graphene // Definitions by: Stepan Miroshin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// +/// /** * A simple layer for interacting with PKCS #11 / PKCS11 / CryptoKI for Node - * v2.0.0 + * v2.0.2 */ -declare module "graphene-pk11" { - type Callback = (err: Error, rv: number) => void; - type CK_PTR = Buffer; +declare module "types/graphene-pk11" { + import * as graphene from "graphene-pk11"; + import * as pkcs11 from "pkcs11js"; - class Pkcs11 { - lib: any; - /** - * load a library with PKCS11 interface - * @param {string} libFile path to PKCS11 library - */ - constructor(libFile: string); - protected callFunction(funcName: string, args: any[]): number; - /** - * C_Initialize initializes the Cryptoki library. - * @param pInitArgs if this is not NULL_PTR, it gets - * cast to CK_C_INITIALIZE_ARGS_PTR - * and dereferenced - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_Initialize(pInitArgs?: CK_PTR): number; - C_Initialize(pInitArgs: CK_PTR, cllback: Callback): void; - /** - * C_Finalize indicates that an application is done with the Cryptoki library. - * @param pReserved reserved. Should be NULL_PTR - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_Finalize(pReserved?: CK_PTR): number; - C_Finalize(pReserved: CK_PTR, callback: Callback): void; - /** - * C_GetInfo returns general information about Cryptoki. - * @param pInfo location that receives information - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_GetInfo(pInfo: CK_PTR): number; - C_GetInfo(pInfo: CK_PTR, callback: Callback): void; - /** - * C_GetSlotList obtains a list of slots in the system. - * @param {boolean} tokenPresent only slots with tokens? - * @param pSlotList receives array of slot IDs - * @param pulCount receives number of slots - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_GetSlotList(tokenPresent: boolean, pSlotList: CK_PTR, pulCount: CK_PTR): number; - C_GetSlotList(tokenPresent: boolean, pSlotList: CK_PTR, pulCount: CK_PTR, callback: Callback): void; - /** - * C_GetSlotInfo obtains information about a particular slot in - * the system. - * @param {number} slotID the ID of the slot - * @param {Buffer} pInfo receives the slot information - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_GetSlotInfo(slotID: number, pInfo: CK_PTR): number; - C_GetSlotInfo(slotID: number, pInfo: CK_PTR, callback: Callback): void; - /** - * C_GetTokenInfo obtains information about a particular token - * in the system. - * @param {number} slotID ID of the token's slot - * @param {Buffer} pInfo receives the token information - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_GetTokenInfo(slotID: number, pInfo: Buffer): number; - C_GetTokenInfo(slotID: number, pInfo: Buffer, callback: Callback): void; - /** - * C_GetMechanismList obtains a list of mechanism types - * supported by a token. - * @param {number} slotID ID of the token's slot - * @param {number} pMechanismList gets mech. array - * @param {number} pulCount gets # of mechs - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_GetMechanismList(slotID: number, pMechanismList: Buffer, pulCount: Buffer): number; - C_GetMechanismList(slotID: number, pMechanismList: Buffer, pulCount: Buffer, callback: Callback): void; - /** C_GetMechanismInfo obtains information about a particular - * mechanism possibly supported by a token. - * @param {number} slotID ID of the token's slot - * @param {number} type type of mechanism - * @param {Buffer} pInfo receives mechanism info - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_GetMechanismInfo(slotID: number, type: number, pInfo: Buffer): number; - C_GetMechanismInfo(slotID: number, type: number, pInfo: Buffer, callback: Callback): void; - /** - * C_InitToken initializes a token. - * @param {number} slotID ID of the token's slot - * @param {Buffer} pPin the SO's initial PIN - * @param {number} ulPinLen length in bytes of the PIN - * @param {number} pLabel 32-byte token label (blank padded) - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_InitToken(slotID: number, pPin: Buffer, ulPinLen: number, pLabel: Buffer): number; - C_InitToken(slotID: number, pPin: Buffer, ulPinLen: number, pLabel: Buffer, callback: Callback): void; - /** - * C_InitPIN initializes the normal user's PIN. - * @param {number} hSession the session's handle - * @param {Buffer} pPin the normal user's PIN - * @param {number} ulPinLen length in bytes of the PIN - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_InitPIN(hSession: number, pPin: Buffer, ulPinLen: number): number; - C_InitPIN(hSession: number, pPin: Buffer, ulPinLen: number, callback: Callback): void; - /** - * C_SetPIN modifies the PIN of the user who is logged in. - * @param {number} hSession the session's handle - * @param {Buffer} pOldPin the old PIN - * @param {number} ulOldLen length of the old PIN - * @param {Buffer} pNewPin the new PIN - * @param {number} ulNewLen length of the new PIN - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_SetPIN(hSession: any, pOldPin: Buffer, ulOldLen: number, pNewPin: Buffer, ulNewLen: number): number; - C_SetPIN(hSession: any, pOldPin: Buffer, ulOldLen: number, pNewPin: Buffer, ulNewLen: number, callback: Callback): void; - /** - * C_OpenSession opens a session between an application and a - * token. - * @param {number} slotID ID of the token's slot - * @param {number} flags from CK_SESSION_INFO - * @param {Buffer} pApplication passed to callback - * @param {Buffer} Notify callback function - * @param {Buffer} phSession gets session handle - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_OpenSession(slotID: number, flags: number, pApplication?: Buffer, notify?: Buffer, phSession?: Buffer): number; - C_OpenSession(slotID: number, flags: number, pApplication: Buffer, notify: Buffer, phSession: Buffer, callback: Callback): void; - /** - * C_CloseSession closes a session between an application and a token. - * @param {number} hSession the session's handle - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_CloseSession(hSession: number): number; - C_CloseSession(hSession: number, callback: Callback): void; - /** - * C_CloseAllSessions closes all sessions with a token. - * @param {number} slotID ID of the token's slot - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_CloseAllSessions(slotID: number): number; - C_CloseAllSessions(slotID: number, callback: Callback): void; - /** - * C_GetSessionInfo obtains information about the session. - * @param {number} hSession the session's handle - * @param {Buffer} pInfo receives session info - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_GetSessionInfo(hSession: number, pInfo: Buffer): number; - C_GetSessionInfo(hSession: number, pInfo: Buffer, callback: Callback): void; - /** - * C_GetOperationState obtains the state of the cryptographic operation in a session. - * @param {number} hSession the session's handle - * @param {Buffer} pOperationState gets state - * @param {Buffer} pulOperationStateLen gets state length - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_GetOperationState(hSession: number, pOperationState: Buffer, pulOperationStateLen: Buffer): number; - C_GetOperationState(hSession: number, pOperationState: Buffer, pulOperationStateLen: Buffer, callback: Callback): void; - /** - * C_SetOperationState restores the state of the cryptographic operation in a session. - * @param {number} hSession the session's handle - * @param {Buffer} pOperationState holds state - * @param {number} ulOperationStateLen holds holds state length - * @param {number} hEncryptionKey en/decryption key - * @param {number} hAuthenticationKey sign/verify key - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_SetOperationState(hSession: number, pOperationState: Buffer, ulOperationStateLen: number, hEncryptionKey: number, hAuthenticationKey: number): number; - C_SetOperationState(hSession: number, pOperationState: Buffer, ulOperationStateLen: number, hEncryptionKey: number, hAuthenticationKey: number, callback: Callback): void; - /** - * C_Login logs a user into a token. - * @param {number} hSession the session's handle - * @param {number} userType the user type - * @param {Buffer} pPin the user's PIN - * @param {number} ulPinLen the length of the PIN - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_Login(hSession: number, userType: number, pPin: Buffer, ulPinLen: number): number; - C_Login(hSession: number, userType: number, pPin: Buffer, ulPinLen: number, callback: Callback): void; - /** - * C_Logout logs a user out from a token. - * @param {number} hSession the session's handle - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_Logout(hSession: number): number; - C_Logout(hSession: number, callback: Callback): void; - /** - * C_CreateObject creates a new object. - * @param {number} hSession the session's handle - * @param {Buffer} pTemplate the object's template - * @param {number} ulCount attributes in template - * @param {Buffer} phObject gets new object's handle - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_CreateObject(hSession: number, pTemplate: Buffer, ulCount: number, phObject: Buffer): number; - C_CreateObject(hSession: number, pTemplate: Buffer, ulCount: number, phObject: Buffer, callback: Callback): void; - /** - * C_CopyObject copies an object, creating a new object for the copy. - * @param {number} hSession the session's handle - * @param {number} hObject the object's handle - * @param {Buffer} pTemplate template for new object - * @param {number} ulCount attributes in template - * @param {Buffer} phNewObject receives handle of copy - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_CopyObject(hSession: number, hObject: number, pTemplate: Buffer, ulCount: number, phNewObject: Buffer): number; - C_CopyObject(hSession: number, hObject: number, pTemplate: Buffer, ulCount: number, phNewObject: Buffer, callback: Callback): void; - /** - * C_DestroyObject destroys an object. - * @param {number} hSession the session's handle - * @param {number} hObject the object's handle - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_DestroyObject(hSession: number, hObject: number): number; - C_DestroyObject(hSession: number, hObject: number, callback: Callback): void; - /** - * C_GetObjectSize gets the size of an object in bytes. - * @param {number} hSession the session's handle - * @param {number} hObject the object's handle - * @param {Buffer} pulSize receives size of object - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_GetObjectSize(hSession: number, hObject: number, pulSize: Buffer): number; - C_GetObjectSize(hSession: number, hObject: number, pulSize: Buffer, callback: Callback): void; - /** - * C_GetAttributeValue obtains the value of one or more object attributes. - * @param {number} hSession the session's handle - * @param {number} hObject the object's handle - * @param {Buffer} pTemplate specifies attrs; gets vals - * @param {number} ulCount attributes in template - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_GetAttributeValue(hSession: number, hObject: number, pTemplate: Buffer, ulCount: number): number; - C_GetAttributeValue(hSession: number, hObject: number, pTemplate: Buffer, ulCount: number, callback: Callback): void; - /** - * C_SetAttributeValue modifies the value of one or more object attributes - * @param {number} hSession the session's handle - * @param {number} hObject the object's handle - * @param {Buffer} pTemplate specifies attrs and values - * @param {number} ulCount attributes in template - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_SetAttributeValue(hSession: number, hObject: number, pTemplate: Buffer, ulCount: number): number; - C_SetAttributeValue(hSession: number, hObject: number, pTemplate: Buffer, ulCount: number, callback: Callback): void; - /** - * C_FindObjectsInit initializes a search for token and session - * objects that match a template. - * @param {number} hSession the session's handle - * @param {Buffer} pTemplate attribute values to match - * @param {number} ulCount attrs in search template - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_FindObjectsInit(hSession: number, pTemplate: Buffer, ulCount: number): number; - C_FindObjectsInit(hSession: number, pTemplate: Buffer, ulCount: number, callback: Callback): void; - /** - * C_FindObjects continues a search for token and session - * objects that match a template, obtaining additional object - * handles. - * @param {number} hSession the session's handle - * @param {Buffer} phObject gets obj. handles - * @param {number} ulMaxObjectCount max handles to get - * @param {Buffer} pulObjectCount actual # returned - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_FindObjects(hSession: number, phObject: Buffer, ulMaxObjectCount: number, pulObjectCount: Buffer): number; - C_FindObjects(hSession: number, phObject: Buffer, ulMaxObjectCount: number, pulObjectCount: Buffer, callback: Callback): void; - /** - * C_FindObjectsFinal finishes a search for token and session objects. - * @param {number} hSession the session's handle - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_FindObjectsFinal(hSession: number): number; - C_FindObjectsFinal(hSession: number, callback: Callback): void; - /** - * C_EncryptInit initializes an encryption operation. - * @param {number} hSession the session's handle - * @param {Buffer} pMechanism the encryption mechanism - * @param {number} hKey handle of encryption key - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_EncryptInit(hSession: number, pMechanism: Buffer, hKey: number): number; - C_EncryptInit(hSession: number, pMechanism: Buffer, hKey: number, callback: Callback): void; - /** - * C_Encrypt encrypts single-part data. - * @param {number} hSession the session's handle - * @param {Buffer} pData the plaintext data - * @param {number} ulDataLen bytes of plaintext - * @param {Buffer} pEncryptedData gets ciphertext - * @param {Buffer} pulEncryptedDataLen gets c-text size - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_Encrypt(hSession: number, pData: Buffer, ulDataLen: number, pEncryptedData: Buffer, pulEncryptedDataLen: Buffer): number; - C_Encrypt(hSession: number, pData: Buffer, ulDataLen: number, pEncryptedData: Buffer, pulEncryptedDataLen: Buffer, callback: Callback): void; - /** - * C_EncryptUpdate continues a multiple-part encryption operation. - * @param {number} hSession the session's handle - * @param {Buffer} pPart the plaintext data - * @param {number} ulPartLen plaintext data len - * @param {Buffer} pEncryptedPart gets ciphertext - * @param {Buffer} pulEncryptedPartLen gets c-text size - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_EncryptUpdate(hSession: number, pPart: Buffer, ulPartLen: number, pEncryptedPart: Buffer, pulEncryptedPartLen: Buffer): number; - C_EncryptUpdate(hSession: number, pPart: Buffer, ulPartLen: number, pEncryptedPart: Buffer, pulEncryptedPartLen: Buffer, callback: Callback): void; - /** - * C_EncryptFinal finishes a multiple-part encryption operation. - * @param {number} hSession the session's handle - * @param {Buffer} pLastEncryptedPart last c-text - * @param {Buffer} pulLastEncryptedPartLen gets last size - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_EncryptFinal(hSession: number, pLastEncryptedPart: Buffer, pulLastEncryptedPartLen: Buffer): number; - C_EncryptFinal(hSession: number, pLastEncryptedPart: Buffer, pulLastEncryptedPartLen: Buffer, callback: Callback): void; - /** - * C_DecryptInit initializes a decryption operation. - * @param {number} hSession the session's handle - * @param {Buffer} pMechanism the decryption mechanism - * @param {number} hKey handle of decryption key - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_DecryptInit(hSession: number, pMechanism: Buffer, hKey: number): any; - C_DecryptInit(hSession: number, pMechanism: Buffer, hKey: number, callback: Callback): void; - /** - * C_Decrypt decrypts encrypted data in a single part. - * @param {number} hSession the session's handle - * @param {Buffer} pEncryptedData ciphertext - * @param {number} ulEncryptedDataLen ciphertext length - * @param {Buffer} pData gets plaintext - * @param {number} pulDataLen gets p-text size - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_Decrypt(hSession: number, pEncryptedData: Buffer, ulEncryptedDataLen: number, pData: Buffer, pulDataLen: Buffer): number; - C_Decrypt(hSession: number, pEncryptedData: Buffer, ulEncryptedDataLen: number, pData: Buffer, pulDataLen: Buffer, callback: Callback): void; - /** - * C_DecryptUpdate continues a multiple-part decryption operation. - * @param {number} hSession the session's handle - * @param {Buffer} pEncryptedPart encrypted data - * @param {number} ulEncryptedPartLen input length - * @param {Buffer} pPart gets plaintext - * @param {Buffer} pulPartLen p-text size - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_DecryptUpdate(hSession: number, pEncryptedPart: Buffer, ulEncryptedPartLen: number, pPart: Buffer, pulPartLen: Buffer): number; - C_DecryptUpdate(hSession: number, pEncryptedPart: Buffer, ulEncryptedPartLen: number, pPart: Buffer, pulPartLen: Buffer, callback: Callback): void; - /** - * C_DecryptFinal finishes a multiple-part decryption operation. - * @param {number} hSession the session's handle - * @param {Buffer} pLastPart gets plaintext - * @param {Buffer} pulLastPartLen p-text size - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_DecryptFinal(hSession: number, pLastPart: Buffer, pulLastPartLen: Buffer): number; - C_DecryptFinal(hSession: number, pLastPart: Buffer, pulLastPartLen: Buffer, callback: Callback): void; - /** - * C_DigestInit initializes a message-digesting operation. - * @param {number} hSession the session's handle - * @param {Buffer} pMechanism the digesting mechanism - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_DigestInit(hSession: number, pMechanism: Buffer): number; - C_DigestInit(hSession: number, pMechanism: Buffer, callback: Callback): void; - /** - * C_Digest digests data in a single part. - * @param {number} hSession the session's handle - * @param {Buffer} pData data to be digested - * @param {number} ulDataLen bytes of data to digest - * @param {Buffer} pDigest gets the message digest - * @param {Buffer} pulDigestLen gets digest length - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_Digest(hSession: number, pData: Buffer, ulDataLen: number, pDigest: Buffer, pulDigestLen: Buffer): number; - C_Digest(hSession: number, pData: Buffer, ulDataLen: number, pDigest: Buffer, pulDigestLen: Buffer, callback: Callback): void; - /** - * C_DigestUpdate continues a multiple-part message-digesting operation. - * @param {number} hSession the session's handle - * @param {Buffer} pPart data to be digested - * @param {number} ulPartLen bytes of data to be digested - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_DigestUpdate(hSession: number, pPart: Buffer, ulPartLen: number): number; - C_DigestUpdate(hSession: number, pPart: Buffer, ulPartLen: number, callback: Callback): void; - /** - * C_DigestKey continues a multi-part message-digesting operation, - * by digesting the value of a secret key as part of - * the data already digested. - * @param {number} hSession the session's handle - * @param {number} hKey secret key to digest - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_DigestKey(hSession: number, hKey: number): number; - C_DigestKey(hSession: number, hKey: number, callback: Callback): void; - /** - * C_DigestFinal finishes a multiple-part message-digesting - * operation. - * @param {number} hSession the session's handle - * @param {Buffer} pDigest gets the message digest - * @param {Buffer} pulDigestLen gets byte count of digest - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_DigestFinal(hSession: number, pDigest: Buffer, pulDigestLen: Buffer): number; - C_DigestFinal(hSession: number, pDigest: Buffer, pulDigestLen: Buffer, callback: Callback): void; - /** - * C_SignInit initializes a signature (private key encryption) - * operation, where the signature is (will be) an appendix to - * the data, and plaintext cannot be recovered from the signature. - * @param {number} hSession the session's handle - * @param {Buffer} pMechanism the signature mechanism - * @param {number} hKey handle of signature key - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_SignInit(hSession: number, pMechanism: Buffer, hKey: number): number; - C_SignInit(hSession: number, pMechanism: Buffer, hKey: number, callback: Callback): void; - /** - * C_Sign signs (encrypts with private key) data in a single - * part, where the signature is (will be) an appendix to the - * data, and plaintext cannot be recovered from the signature. - * @param {number} hSession the session's handle - * @param {Buffer} pData the data to sign - * @param {number} ulDataLen count of bytes to sign - * @param {Buffer} pSignature gets the signature - * @param {Buffer} pulSignatureLen gets signature length - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_Sign(hSession: number, pData: Buffer, ulDataLen: number, pSignature: Buffer, pulSignatureLen: Buffer): number; - C_Sign(hSession: number, pData: Buffer, ulDataLen: number, pSignature: Buffer, pulSignatureLen: Buffer, callback: Callback): void; - /** - * C_SignUpdate continues a multiple-part signature operation, - * where the signature is (will be) an appendix to the data, - * and plaintext cannot be recovered from the signature. - * @param {number} hSession the session's handle - * @param {Buffer} pPart the data to sign - * @param {number} ulPartLen count of bytes to sign - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_SignUpdate(hSession: number, pPart: Buffer, ulPartLen: Buffer): number; - C_SignUpdate(hSession: number, pPart: Buffer, ulPartLen: Buffer, callback: Callback): void; - /** - * C_SignFinal finishes a multiple-part signature operation, - * returning the signature. - * @param {number} hSession the session's handle - * @param {Buffer} pSignature gets the signature - * @param {Buffer} pulSignatureLen gets signature length - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_SignFinal(hSession: number, pSignature: Buffer, pulSignatureLen: Buffer): number; - C_SignFinal(hSession: number, pSignature: Buffer, pulSignatureLen: Buffer, callback: Callback): void; - /** - * C_SignRecoverInit initializes a signature operation, where - * the data can be recovered from the signature. - * @param {number} hSession the session's handle - * @param {Buffer} pMechanism the signature mechanism - * @param {number} hKey handle of the signature key - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_SignRecoverInit(hSession: number, pMechanism: Buffer, hKey: number): number; - C_SignRecoverInit(hSession: number, pMechanism: Buffer, hKey: number, callback: Callback): void; - /** - * C_SignRecover signs data in a single operation, where the - * data can be recovered from the signature. - * @param {number} hSession the session's handle - * @param {Buffer} pData the data to sign - * @param {number} ulDataLen count of bytes to sign - * @param {Buffer} pSignature gets the signature - * @param {Buffer} pulSignatureLen gets signature length - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_SignRecover(hSession: number, pData: Buffer, ulDataLen: number, pSignature: Buffer, pulSignatureLen: Buffer): number; - C_SignRecover(hSession: number, pData: Buffer, ulDataLen: number, pSignature: Buffer, pulSignatureLen: Buffer, callback: Callback): void; - /** - * C_VerifyInit initializes a verification operation, where the - * signature is an appendix to the data, and plaintext cannot - * cannot be recovered from the signature (e.g. DSA). - * @param {number} hSession the session's handle - * @param {Buffer} pMechanism the verification mechanism - * @param {number} hKey verification key - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_VerifyInit(hSession: number, pMechanism: Buffer, hKey: number): number; - C_VerifyInit(hSession: number, pMechanism: Buffer, hKey: number, callback: Callback): void; - /** - * C_Verify verifies a signature in a single-part operation, - * where the signature is an appendix to the data, and plaintext - * cannot be recovered from the signature. - * @param {number} hSession the session's handle - * @param {Buffer} pData signed data - * @param {number} ulDataLen length of signed data - * @param {Buffer} pSignature signature - * @param {number} ulSignatureLen signature length - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_Verify(hSession: number, pData: Buffer, ulDataLen: number, pSignature: Buffer, ulSignatureLen: Buffer): number; - C_Verify(hSession: number, pData: Buffer, ulDataLen: number, pSignature: Buffer, ulSignatureLen: Buffer, callback: Callback): void; - /** - * C_VerifyUpdate continues a multiple-part verification - * operation, where the signature is an appendix to the data, - * and plaintext cannot be recovered from the signature. - * @param {number} hSession the session's handle - * @param {Buffer} pPart signed data - * @param {number} ulPartLen length of signed data - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_VerifyUpdate(hSession: number, pPart: Buffer, ulPartLen: number): number; - C_VerifyUpdate(hSession: number, pPart: Buffer, ulPartLen: number, callback: Callback): void; - /** - * C_VerifyFinal finishes a multiple-part verification - * operation, checking the signature. - * @param {number} hSession the session's handle - * @param {Buffer} pSignature signature to verify - * @param {number} ulSignatureLen signature length - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_VerifyFinal(hSession: number, pSignature: Buffer, ulSignatureLen: number): number; - C_VerifyFinal(hSession: number, pSignature: Buffer, ulSignatureLen: number, callback: Callback): void; - /** - * C_VerifyRecoverInit initializes a signature verification - * operation, where the data is recovered from the signature. - * @param {number} hSession the session's handle - * @param {Buffer} pMechanism the verification mechanism - * @param {number} hKey verification key - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_VerifyRecoverInit(hSession: number, pMechanism: Buffer, hKey: number): number; - C_VerifyRecoverInit(hSession: number, pMechanism: Buffer, hKey: number, callback: Callback): void; - /** - * C_VerifyRecover verifies a signature in a single-part - * operation, where the data is recovered from the signature. - * @param {number} hSession the session's handle - * @param {Buffer} pSignature signature to verify - * @param {number} ulSignatureLen signature length - * @param {Buffer} pData gets signed data - * @param {Buffer} pulDataLen gets signed data len - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_VerifyRecover(hSession: number, pSignature: Buffer, ulSignatureLen: number, pData: Buffer, pulDataLen: Buffer): number; - C_VerifyRecover(hSession: number, pSignature: Buffer, ulSignatureLen: number, pData: Buffer, pulDataLen: Buffer, callback: Callback): void; - /** - * C_DigestEncryptUpdate continues a multiple-part digesting - * and encryption operation. - * @param {number} hSession the session's handle - * @param {Buffer} pPart the plaintext data - * @param {number} ulPartLen plaintext length - * @param {Buffer} pEncryptedPart gets ciphertext - * @param {Buffer} pulEncryptedPartLen gets c-text length - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_DigestEncryptUpdate(hSession: number, pPart: Buffer, ulPartLen: number, pEncryptedPart: Buffer, pulEncryptedPartLen: Buffer): number; - C_DigestEncryptUpdate(hSession: number, pPart: Buffer, ulPartLen: number, pEncryptedPart: Buffer, pulEncryptedPartLen: Buffer, callback: Callback): void; - /** - * C_DecryptDigestUpdate continues a multiple-part decryption and - * digesting operation. - * @param {number} hSession the session's handle - * @param {Buffer} pEncryptedPart ciphertext - * @param {number} ulEncryptedPartLen ciphertext length - * @param {Buffer} pPart gets plaintext - * @param {Buffer} pulPartLen gets plaintext len - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_DecryptDigestUpdate(hSession: number, pEncryptedPart: Buffer, ulEncryptedPartLen: number, pPart: Buffer, pulPartLen: Buffer): number; - C_DecryptDigestUpdate(hSession: number, pEncryptedPart: Buffer, ulEncryptedPartLen: number, pPart: Buffer, pulPartLen: Buffer, callback: Callback): void; - /** - * C_SignEncryptUpdate continues a multiple-part signing and - * encryption operation. - * @param {number} hSession the session's handle - * @param {Buffer} pPart the plaintext data - * @param {number} ulPartLen plaintext length - * @param {Buffer} pEncryptedPart gets ciphertext - * @param {Buffer} pulEncryptedPartLen gets c-text length - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_SignEncryptUpdate(hSession: number, pPart: Buffer, ulPartLen: number, pEncryptedPart: Buffer, pulEncryptedPartLen: Buffer): number; - C_SignEncryptUpdate(hSession: number, pPart: Buffer, ulPartLen: number, pEncryptedPart: Buffer, pulEncryptedPartLen: Buffer, callback: Callback): void; - /** - * C_DecryptVerifyUpdate continues a multiple-part decryption and - * verify operation. - * @param {number} hSession the session's handle - * @param {Buffer} pEncryptedPart ciphertext - * @param {number} ulEncryptedPartLen ciphertext length - * @param {Buffer} pPart gets plaintext - * @param {Buffer} pulPartLen gets p-text length - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_DecryptVerifyUpdate(hSession: number, pEncryptedPart: Buffer, ulEncryptedPartLen: number, pPart: Buffer, pulPartLen: Buffer): number; - C_DecryptVerifyUpdate(hSession: number, pEncryptedPart: Buffer, ulEncryptedPartLen: number, pPart: Buffer, pulPartLen: Buffer, callback: Callback): void; - /** - * C_GenerateKey generates a secret key, creating a new key object. - * @param {number} hSession the session's handle - * @param {Buffer} pMechanism key generation mech. - * @param {Buffer} pTemplate template for new key - * @param {number} ulCount # of attrs in template - * @param {Buffer} phKey gets handle of new key - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_GenerateKey(hSession: number, pMechanism: Buffer, pTemplate: Buffer, ulCount: number, phKey: Buffer): number; - C_GenerateKey(hSession: number, pMechanism: Buffer, pTemplate: Buffer, ulCount: number, phKey: Buffer, callback: Callback): any; - /** - * C_GenerateKeyPair generates a public-key/private-key pair, - * creating new key objects. - * @param {number} hSession the session's handle - * @param {Buffer} pMechanism key-gen mech. - * @param {Buffer} pPublicKeyTemplate template for public key - * @param {number} ulPublicKeyAttributeCount public attrs - * @param {Buffer} pPrivateKeyTemplate template for private key - * @param {number} ulPrivateKeyAttributeCount private attrs - * @param {Buffer} phPublicKey gets public key handle - * @param {Buffer} phPrivateKey gets private key handle - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_GenerateKeyPair(hSession: number, pMechanism: Buffer, pPublicKeyTemplate: Buffer, ulPublicKeyAttributeCount: number, pPrivateKeyTemplate: Buffer, ulPrivateKeyAttributeCount: number, phPublicKey: Buffer, phPrivateKey: Buffer): number; - C_GenerateKeyPair(hSession: number, pMechanism: Buffer, pPublicKeyTemplate: Buffer, ulPublicKeyAttributeCount: number, pPrivateKeyTemplate: Buffer, ulPrivateKeyAttributeCount: number, phPublicKey: Buffer, phPrivateKey: Buffer, callback: Callback): void; - /** - * C_WrapKey wraps (i.e., encrypts) a key. - * @param {number} hSession the session's handle - * @param {Buffer} pMechanism the wrapping mechanism - * @param {number} hWrappingKey wrapping key - * @param {number} hKey key to be wrapped - * @param {Buffer} pWrappedKey gets wrapped key - * @param {Buffer} pulWrappedKeyLen gets wrapped key size - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_WrapKey(hSession: number, pMechanism: Buffer, hWrappingKey: number, hKey: number, pWrappedKey: Buffer, pulWrappedKeyLen: Buffer): number; - C_WrapKey(hSession: number, pMechanism: Buffer, hWrappingKey: number, hKey: number, pWrappedKey: Buffer, pulWrappedKeyLen: Buffer, callback: Callback): void; - /** - * C_UnwrapKey unwraps (decrypts) a wrapped key, creating a new - * key object. - * @param {number} hSession the session's handle - * @param {Buffer} pMechanism unwrapping mech. - * @param {Buffer} pWrappedKey the wrapped key - * @param {number} ulWrappedKeyLen wrapped key len - * @param {Buffer} pTemplate new key template - * @param {number} ulAttributeCount template length - * @param {Buffer} pTemplate new key template - * @param {number} ulAttributeCount template length - * @param {Buffer} phKey gets new handle - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_UnwrapKey(hSession: number, pMechanism: Buffer, hUnwrappingKey: number, pWrappedKey: Buffer, ulWrappedKeyLen: number, pTemplate: Buffer, ulAttributeCount: number, phKey: Buffer): number; - C_UnwrapKey(hSession: number, pMechanism: Buffer, hUnwrappingKey: number, pWrappedKey: Buffer, ulWrappedKeyLen: number, pTemplate: Buffer, ulAttributeCount: number, phKey: Buffer, callback: Callback): void; - /** - * C_DeriveKey derives a key from a base key, creating a new key object. - * @param {number} hSession the session's handle - * @param {Buffer} pMechanism key deriv. mech. - * @param {number} hBaseKey base key - * @param {Buffer} pTemplate new key template - * @param {number} ulAttributeCount template length - * @param {Buffer} phKey gets new handle - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_DeriveKey(hSession: number, pMechanism: Buffer, hBaseKey: number, pTemplate: Buffer, ulAttributeCount: number, phKey: Buffer): number; - C_DeriveKey(hSession: number, pMechanism: Buffer, hBaseKey: number, pTemplate: Buffer, ulAttributeCount: number, phKey: Buffer, callback: Callback): void; - /** - * C_SeedRandom mixes additional seed material into the token's - * random number generator. - * @param {number} hSession the session's handle - * @param {Buffer} pSeed the seed material - * @param {number} ulSeedLen length of seed material - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_SeedRandom(hSession: number, pSeed: Buffer, ulSeedLen: number): number; - C_SeedRandom(hSession: number, pSeed: Buffer, ulSeedLen: number, callback: Callback): void; - /** - * C_GenerateRandom generates random data. - * @param {number} hSession the session's handle - * @param {Buffer} pRandomData receives the random data - * @param {number} ulRandomLen # of bytes to generate - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_GenerateRandom(hSession: number, pRandomData: Buffer, ulRandomLen: number): number; - C_GenerateRandom(hSession: number, pRandomData: Buffer, ulRandomLen: number, callback: Callback): void; - /** - * C_GetFunctionStatus is a legacy function; it obtains an - * updated status of a function running in parallel with an - * application. - * @param {number} hSession the session's handle - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_GetFunctionStatus(hSession: number): number; - C_GetFunctionStatus(hSession: number, callback: Callback): void; - /** - * C_CancelFunction is a legacy function; it cancels a function - * running in parallel. - * @param {number} hSession the session's handle - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_CancelFunction(hSession: number): number; - C_CancelFunction(hSession: number, callback: Callback): void; - /** - * C_WaitForSlotEvent waits for a slot event (token insertion, - * removal, etc.) to occur. - * @param {number} flags blocking/nonblocking flag - * @param {Buffer} pSlot location that receives the slot ID - * @param {Buffer} pRserved reserved. Should be NULL_PTR - * @param {Callback} callback callback function with PKCS11 result value - * @returns void PKCS11 result value - */ - C_WaitForSlotEvent(flags: number, pSlot: Buffer, pRserved: Buffer): number; - C_WaitForSlotEvent(flags: number, pSlot: Buffer, pRserved: Buffer, callback: Callback): number; + // ========== Core ========== + + /** + * Handle + */ + type Handle = Buffer; + /** + * BaseObject + * + * @interface BaseObject + */ + interface BaseObject { + } + /** + * HandleObject + * + * @interface HandleObject + * @extends {BaseObject} + */ + interface HandleObject extends BaseObject { + /** + * handle to pkcs11 object + */ + handle: Handle; } - enum KeyType { - RSA, - DSA, - DH, - ECDSA, - EC, - X9_42_DH, - KEA, - GENERIC_SECRET, - RC2, - RC4, - DES, - DES2, - DES3, - CAST, - CAST3, - CAST5, - CAST128, - RC5, - IDEA, - SKIPJACK, - BATON, - JUNIPER, - CDMF, - AES, - GOSTR3410, - GOSTR3411, - GOST28147, - BLOWFISH, - TWOFISH, - SECURID, - HOTP, - ACTI, - CAMELLIA, - ARIA, - } - enum KeyGenMechanism { - AES, - RSA, - RSA_X9_31, - DSA, - DH_PKCS, - DH_X9_42, - GOSTR3410, - GOST28147, - RC2, - RC4, - DES, - DES2, - SECURID, - ACTI, - CAST, - CAST3, - CAST5, - CAST128, - RC5, - IDEA, - GENERIC_SECRET, - SSL3_PRE_MASTER, - CAMELLIA, - ARIA, - SKIPJACK, - KEA, - BATON, - ECDSA, - EC, - JUNIPER, - TWOFISH, - } + /** + * Collection + * + * @interface Collection + * @extends {BaseObject} + * @template T + */ + interface Collection extends BaseObject { - enum MechanismEnum { - RSA_PKCS_KEY_PAIR_GEN, - RSA_PKCS, - RSA_9796, - RSA_X_509, - MD2_RSA_PKCS, - MD5_RSA_PKCS, - SHA1_RSA_PKCS, - RIPEMD128_RSA_PKCS, - RIPEMD160_RSA_PKCS, - RSA_PKCS_OAEP, - RSA_X9_31_KEY_PAIR_GEN, - RSA_X9_31, - SHA1_RSA_X9_31, - RSA_PKCS_PSS, - SHA1_RSA_PKCS_PSS, - DSA_KEY_PAIR_GEN, - DSA, - DSA_SHA1, - DH_PKCS_KEY_PAIR_GEN, - DH_PKCS_DERIVE, - X9_42_DH_KEY_PAIR_GEN, - X9_42_DH_DERIVE, - X9_42_DH_HYBRID_DERIVE, - X9_42_MQV_DERIVE, - SHA256_RSA_PKCS, - SHA384_RSA_PKCS, - SHA512_RSA_PKCS, - SHA256_RSA_PKCS_PSS, - SHA384_RSA_PKCS_PSS, - SHA512_RSA_PKCS_PSS, - SHA224_RSA_PKCS, - SHA224_RSA_PKCS_PSS, - RC2_KEY_GEN, - RC2_ECB, - RC2_CBC, - RC2_MAC, - RC2_MAC_GENERAL, - RC2_CBC_PAD, - RC4_KEY_GEN, - RC4, - DES_KEY_GEN, - DES_ECB, - DES_CBC, - DES_MAC, - DES_MAC_GENERAL, - DES_CBC_PAD, - DES2_KEY_GEN, - DES3_KEY_GEN, - DES3_ECB, - DES3_CBC, - DES3_MAC, - DES3_MAC_GENERAL, - DES3_CBC_PAD, - CDMF_KEY_GEN, - CDMF_ECB, - CDMF_CBC, - CDMF_MAC, - CDMF_MAC_GENERAL, - CDMF_CBC_PAD, - DES_OFB64, - DES_OFB8, - DES_CFB64, - DES_CFB8, - MD2, - MD2_HMAC, - MD2_HMAC_GENERAL, - MD5, - MD5_HMAC, - MD5_HMAC_GENERAL, - SHA1, - SHA, - SHA_1, - SHA_1_HMAC, - SHA_1_HMAC_GENERAL, - RIPEMD128, - RIPEMD128_HMAC, - RIPEMD128_HMAC_GENERAL, - RIPEMD160, - RIPEMD160_HMAC, - RIPEMD160_HMAC_GENERAL, - SHA256, - SHA256_HMAC, - SHA256_HMAC_GENERAL, - SHA224, - SHA224_HMAC, - SHA224_HMAC_GENERAL, - SHA384, - SHA384_HMAC, - SHA384_HMAC_GENERAL, - SHA512, - SHA512_HMAC, - SHA512_HMAC_GENERAL, - SECURID_KEY_GEN, - SECURID, - HOTP_KEY_GEN, - HOTP, - ACTI, - ACTI_KEY_GEN, - CAST_KEY_GEN, - CAST_ECB, - CAST_CBC, - CAST_MAC, - CAST_MAC_GENERAL, - CAST_CBC_PAD, - CAST3_KEY_GEN, - CAST3_ECB, - CAST3_CBC, - CAST3_MAC, - CAST3_MAC_GENERAL, - CAST3_CBC_PAD, - CAST5_KEY_GEN, - CAST128_KEY_GEN, - CAST5_ECB, - CAST128_ECB, - CAST5_CBC, - CAST128_CBC, - CAST5_MAC, - CAST128_MAC, - CAST5_MAC_GENERAL, - CAST128_MAC_GENERAL, - CAST5_CBC_PAD, - CAST128_CBC_PAD, - RC5_KEY_GEN, - RC5_ECB, - RC5_CBC, - RC5_MAC, - RC5_MAC_GENERAL, - RC5_CBC_PAD, - IDEA_KEY_GEN, - IDEA_ECB, - IDEA_CBC, - IDEA_MAC, - IDEA_MAC_GENERAL, - IDEA_CBC_PAD, - GENERIC_SECRET_KEY_GEN, - CONCATENATE_BASE_AND_KEY, - CONCATENATE_BASE_AND_DATA, - CONCATENATE_DATA_AND_BASE, - XOR_BASE_AND_DATA, - EXTRACT_KEY_FROM_KEY, - SSL3_PRE_MASTER_KEY_GEN, - SSL3_MASTER_KEY_DERIVE, - SSL3_KEY_AND_MAC_DERIVE, - SSL3_MASTER_KEY_DERIVE_DH, - TLS_PRE_MASTER_KEY_GEN, - TLS_MASTER_KEY_DERIVE, - TLS_KEY_AND_MAC_DERIVE, - TLS_MASTER_KEY_DERIVE_DH, - TLS_PRF, - SSL3_MD5_MAC, - SSL3_SHA1_MAC, - MD5_KEY_DERIVATION, - MD2_KEY_DERIVATION, - SHA1_KEY_DERIVATION, - SHA256_KEY_DERIVATION, - SHA384_KEY_DERIVATION, - SHA512_KEY_DERIVATION, - SHA224_KEY_DERIVATION, - PBE_MD2_DES_CBC, - PBE_MD5_DES_CBC, - PBE_MD5_CAST_CBC, - PBE_MD5_CAST3_CBC, - PBE_MD5_CAST5_CBC, - PBE_MD5_CAST128_CBC, - PBE_SHA1_CAST5_CBC, - PBE_SHA1_CAST128_CBC, - PBE_SHA1_RC4_128, - PBE_SHA1_RC4_40, - PBE_SHA1_DES3_EDE_CBC, - PBE_SHA1_DES2_EDE_CBC, - PBE_SHA1_RC2_128_CBC, - PBE_SHA1_RC2_40_CBC, - PKCS5_PBKD2, - PBA_SHA1_WITH_SHA1_HMAC, - WTLS_PRE_MASTER_KEY_GEN, - WTLS_MASTER_KEY_DERIVE, - WTLS_MASTER_KEY_DERIVE_DH_ECC, - WTLS_PRF, - WTLS_SERVER_KEY_AND_MAC_DERIVE, - WTLS_CLIENT_KEY_AND_MAC_DERIVE, - KEY_WRAP_LYNKS, - KEY_WRAP_SET_OAEP, - CMS_SIG, - KIP_DERIVE, - KIP_WRAP, - KIP_MAC, - CAMELLIA_KEY_GEN, - CAMELLIA_ECB, - CAMELLIA_CBC, - CAMELLIA_MAC, - CAMELLIA_MAC_GENERAL, - CAMELLIA_CBC_PAD, - CAMELLIA_ECB_ENCRYPT_DATA, - CAMELLIA_CBC_ENCRYPT_DATA, - CAMELLIA_CTR, - ARIA_KEY_GEN, - ARIA_ECB, - ARIA_CBC, - ARIA_MAC, - ARIA_MAC_GENERAL, - ARIA_CBC_PAD, - ARIA_ECB_ENCRYPT_DATA, - ARIA_CBC_ENCRYPT_DATA, - SKIPJACK_KEY_GEN, - SKIPJACK_ECB64, - SKIPJACK_CBC64, - SKIPJACK_OFB64, - SKIPJACK_CFB64, - SKIPJACK_CFB32, - SKIPJACK_CFB16, - SKIPJACK_CFB8, - SKIPJACK_WRAP, - SKIPJACK_PRIVATE_WRAP, - SKIPJACK_RELAYX, - KEA_KEY_PAIR_GEN, - KEA_KEY_DERIVE, - FORTEZZA_TIMESTAMP, - BATON_KEY_GEN, - BATON_ECB128, - BATON_ECB96, - BATON_CBC128, - BATON_COUNTER, - BATON_SHUFFLE, - BATON_WRAP, - ECDSA_KEY_PAIR_GEN, - EC_KEY_PAIR_GEN, - ECDSA, - ECDSA_SHA1, - ECDSA_SHA224, - ECDSA_SHA256, - ECDSA_SHA384, - ECDSA_SHA512, - ECDH1_DERIVE, - ECDH1_COFACTOR_DERIVE, - ECMQV_DERIVE, - JUNIPER_KEY_GEN, - JUNIPER_ECB128, - JUNIPER_CBC128, - JUNIPER_COUNTER, - JUNIPER_SHUFFLE, - JUNIPER_WRAP, - FASTHASH, - AES_KEY_GEN, - AES_ECB, - AES_CBC, - AES_MAC, - AES_MAC_GENERAL, - AES_CBC_PAD, - AES_CTR, - AES_CMAC, - AES_CMAC_GENERAL, - BLOWFISH_KEY_GEN, - BLOWFISH_CBC, - TWOFISH_KEY_GEN, - TWOFISH_CBC, - AES_GCM, - AES_CCM, - AES_KEY_WRAP, - AES_KEY_WRAP_PAD, - DES_ECB_ENCRYPT_DATA, - DES_CBC_ENCRYPT_DATA, - DES3_ECB_ENCRYPT_DATA, - DES3_CBC_ENCRYPT_DATA, - AES_ECB_ENCRYPT_DATA, - AES_CBC_ENCRYPT_DATA, - GOSTR3410_KEY_PAIR_GEN, - GOSTR3410, - GOSTR3410_WITH_GOSTR3411, - GOSTR3410_KEY_WRAP, - GOSTR3410_DERIVE, - GOSTR3411, - GOSTR3411_HMAC, - GOST28147_KEY_GEN, - GOST28147_ECB, - GOST28147, - GOST28147_MAC, - GOST28147_KEY_WRAP, - DSA_PARAMETER_GEN, - DH_PKCS_PARAMETER_GEN, - X9_42_DH_PARAMETER_GEN, - VENDOR_DEFINED, - } + /** + * returns length of collection + */ + length: number; - interface IParams { - toCKI(): Buffer; - } - - interface IAlgorithm { - name: string; - params: Buffer | IParams; - } - - type MechanismType = MechanismEnum | KeyGenMechanism | IAlgorithm | string; - - enum MechanismFlag { - /** - * `True` if the mechanism is performed by the device; `false` if the mechanism is performed in software - */ - HW, - /** - * `True` if the mechanism can be used with encrypt function - */ - ENCRYPT, - /** - * `True` if the mechanism can be used with decrypt function - */ - DECRYPT, - /** - * `True` if the mechanism can be used with digest function - */ - DIGEST, - /** - * `True` if the mechanism can be used with sign function - */ - SIGN, - /** - * `True` if the mechanism can be used with sign recover function - */ - SIGN_RECOVER, - /** - * `True` if the mechanism can be used with verify function - */ - VERIFY, - /** - * `True` if the mechanism can be used with verify recover function - */ - VERIFY_RECOVER, - /** - * `True` if the mechanism can be used with geberate function - */ - GENERATE, - /** - * `True` if the mechanism can be used with generate key pair function - */ - GENERATE_KEY_PAIR, - /** - * `True` if the mechanism can be used with wrap function - */ - WRAP, - /** - * `True` if the mechanism can be used with unwrap function - */ - UNWRAP, - /** - * `True` if the mechanism can be used with derive function - */ - DERIVE, - } - class Mechanism extends HandleObject { - protected slotHandle: number; - /** - * the minimum size of the key for the mechanism - * _whether this is measured in bits or in bytes is mechanism-dependent_ - */ - minKeySize: number; - /** - * the maximum size of the key for the mechanism - * _whether this is measured in bits or in bytes is mechanism-dependent_ - */ - maxKeySize: number; - /** - * bit flag specifying mechanism capabilities - */ - flags: number; - /** - * returns string name from MechanismEnum - */ - name: string; - constructor(handle: number, slotHandle: number, lib: Pkcs11); - protected getInfo(): void; - static create(alg: MechanismType): Buffer; - static vendor(jsonFile: string): any; - static vendor(name: string, value: number): any; - } - - class MechanismCollection extends Collection { - protected slotHandle: number; - constructor(items: Array, slotHandle: number, lib: Pkcs11, classType?: typeof Mechanism); /** * returns item from collection by index * @param {number} index of element in collection `[0..n]` */ - items(index: number): Mechanism; + items(index: number): T; + + } + type SessionObjectCollection = Collection + type MechanismCollection = Collection; + type SlotCollection = Collection; + + // ========== PKCS11 Objects ========== + + /** + * Certificate objects (object class CKO_CERTIFICATE) hold public-key or attribute certificates + */ + interface Certificate extends Storage { + /** + * Type of certificate + */ + type: graphene.CertificateType; + /** + * The certificate can be trusted for the application that it was created. + */ + trusted: boolean; + /** + * Categorization of the certificate + */ + category: graphene.CertificateCategory; + /** + * Checksum + */ + checkValue: Buffer; + /** + * Start date for the certificate (default empty) + */ + startDate: Date; + /** + * End date for the certificate (default empty) + */ + endDate: Date; + } + + /** + * X.509 certificate objects (certificate type `CKC_X_509`) hold X.509 public key certificates + */ + interface X509Certificate extends Certificate { + /** + * DER-encoding of the certificate subject name + * - Must be specified when the object is created. + * - Must be non-empty if `CKA_URL` is empty. + */ + subject: Buffer; + /** + * Key identifier for public/private key pair (default empty) + */ + id: Buffer; + /** + * DER-encoding of the certificate issuer name (default empty) + */ + issuer: Buffer; + /** + * HEX-encoding of the certificate serial number (default empty) + */ + serialNumber: string; + /** + * BER-encoding of the certificate + * - Must be specified when the object is created. + * - Must be non-empty if `CKA_URL` is empty. + */ + value: Buffer; + /** + * If not empty this attribute gives the URL where the complete certificate + * can be obtained (default empty) + * - Must be non-empty if `CKA_VALUE` is empty + */ + url: string; + /** + * SHA-1 hash of the subject public key (default empty) + * - Can only be empty if `CKA_URL` is empty. + */ + subjetcKeyIdentifier: Buffer; + /** + * SHA-1 hash of the issuer public key (default empty) + * - Can only be empty if `CKA_URL` is empty. + */ + authorityKeyIdentifier: Buffer; + /** + * Java MIDP security domain + */ + java: graphene.JavaMIDP; + } + + /** + * WTLS certificate objects (certificate type `CKC_WTLS`) hold WTLS public key certificates + */ + interface WtlsCertificate extends Certificate { + /** + * WTLS-encoding (Identifier type) of the certificate subject + * - Must be specified when the object is created. + * - Can only be empty if `CKA_VALUE` is empty. + */ + subject: Buffer; + /** + * WTLS-encoding (Identifier type) of the certificate issuer (default empty) + */ + issuer: Buffer; + /** + * Key identifier for public/private key pair (default empty) + */ + id: Buffer; + /** + * WTLS-encoding of the certificate + * - Must be specified when the object is created. + * - Must be non-empty if `CKA_URL` is empty. + */ + value: Buffer; + /** + * If not empty this attribute gives the URL where the complete certificate + * can be obtained (default empty) + * - Must be non-empty if `CKA_VALUE` is empty + */ + url: string; + /** + * DER-encoding of the certificate serial number (default empty) + */ + serialNumber: Buffer; + /** + * SHA-1 hash of the subject public key (default empty) + * - Can only be empty if `CKA_URL` is empty. + */ + subjetcKeyIdentifier: Buffer; + /** + * SHA-1 hash of the issuer public key (default empty) + * - Can only be empty if `CKA_URL` is empty. + */ + authorityKeyIdentifier: Buffer; + } + + /** + * X.509 attribute certificate objects (certificate type `CKC_X_509_ATTR_CERT`) hold X.509 attribute certificates + */ + interface AttributeCertificate extends Certificate { + /** + * DER-encoding of the attribute certificate's subject field. + * This is distinct from the `CKA_SUBJECT` attribute contained in `CKC_X_509` certificates + * because the `ASN.1` syntax and encoding are different. + * - Must be specified when the object is created + */ + owner: Buffer; + /** + * DER-encoding of the attribute certificate's issuer field. + * This is distinct from the `CKA_ISSUER` attribute contained in `CKC_X_509` certificates + * because the ASN.1 syntax and encoding are different. (default empty) + */ + issuer: Buffer; + /** + * DER-encoding of the certificate serial number (default empty) + */ + serialNumber: Buffer; + /** + * BER-encoding of a sequence of object identifier values corresponding + * to the attribute types contained in the certificate. + * When present, this field offers an opportunity for applications + * to search for a particular attribute certificate without fetching + * and parsing the certificate itself. (default empty) + */ + types: Buffer; + /** + * BER-encoding of the certificate + * - Must be specified when the object is created. + */ + value: Buffer; + } + + interface DomainParameters extends Storage { + /** + * Type of key the domain parameters can be used to generate. + */ + keyType: graphene.KeyType; + /** + * `CK_TRUE` only if domain parameters were either * generated locally (i.e., on the token) + * with a `C_GenerateKey` * created with a `C_CopyObject` call as a copy of domain parameters + * which had its `CKA_LOCAL` attribute set to `CK_TRUE` + */ + local: boolean; + } + + /** + * Data objects (object class `CKO_DATA`) hold information defined by an application. + * Other than providing access to it, Cryptoki does not attach any special meaning to a data object + * + * @ + * @class Data + * @extends {Storage} + */ + interface Data extends Storage { + /** + * Description of the application that manages the object (default empty) + * + * @type {string} + */ + application: string; + /** + * DER-encoding of the object identifier indicating the data object type (default empty) + * + * @type {Buffer} + */ + objectId: Buffer; + /** + * Value of the object (default empty) + * + * @type {Buffer} + */ + value: Buffer; } /** @@ -1232,13 +278,13 @@ declare module "graphene-pk11" { * - defines the object class `CKO_PUBLIC_KEY`, `CKO_PRIVATE_KEY` and `CKO_SECRET_KEY` for type `CK_OBJECT_CLASS` * as used in the `CKA_CLASS` attribute of objects */ - class Key extends Storage { + interface Key extends Storage { /** * Type of key * - Must be specified when object is created with `C_CreateObject` * - Must be specified when object is unwrapped with `C_UnwrapKey` */ - type: KeyType; + type: graphene.KeyType; /** * Key identifier for key (default empty) * - May be modified after object is created with a `C_SetAttributeValue` call, @@ -1288,41 +334,736 @@ declare module "graphene-pk11" { * - Must not be specified when object is generated with `C_GenerateKey` or `C_GenerateKeyPair`. * - Must not be specified when object is unwrapped with `C_UnwrapKey`. */ - mechanism: KeyGenMechanism; + mechanism: graphene.KeyGenMechanism; allowedMechanisms: void; } - - class DomainParameters extends Storage { + /** + * Private key objects (object class `CKO_PRIVATE_KEY`) hold private keys + */ + interface PrivateKey extends Key { /** - * Type of key the domain parameters can be used to generate. + * DER-encoding of the key subject name (default empty) + * - May be modified after object is created with a `C_SetAttributeValue` call, + * or in the process of copying object with a `C_CopyObject` call. + * However, it is possible that a particular token may not permit modification of the attribute + * during the course of a `C_CopyObject` call. */ - keyType: KeyType; + subject: Buffer; /** - * `CK_TRUE` only if domain parameters were either * generated locally (i.e., on the token) - * with a `C_GenerateKey` * created with a `C_CopyObject` call as a copy of domain parameters - * which had its `CKA_LOCAL` attribute set to `CK_TRUE` + * `CK_TRUE` if key is sensitive + * - May be modified after object is created with a `C_SetAttributeValue` call, + * or in the process of copying object with a `C_CopyObject` call. + * However, it is possible that a particular token may not permit modification of the attribute + * during the course of a `C_CopyObject` call. + * - Attribute cannot be changed once set to CK_TRUE. It becomes a read only attribute. + * - Default value is token-specific, and may depend on the values of other attributes. */ - local: boolean; + sensitive: boolean; + /** + * `CK_TRUE` if key supports decryption + * - May be modified after object is created with a `C_SetAttributeValue` call, + * or in the process of copying object with a `C_CopyObject` call. + * However, it is possible that a particular token may not permit modification of the attribute + * during the course of a `C_CopyObject` call. + * - Default value is token-specific, and may depend on the values of other attributes. + */ + decrypt: boolean; + /** + * `CK_TRUE` if key supports signatures where the signature is an appendix to the data + * - May be modified after object is created with a `C_SetAttributeValue` call, + * or in the process of copying object with a `C_CopyObject` call. + * However, it is possible that a particular token may not permit modification of the attribute + * during the course of a `C_CopyObject` call. + * - Default value is token-specific, and may depend on the values of other attributes. + */ + sign: boolean; + /** + * `CK_TRUE` if key supports signatures where the data can be recovered from the signature + * - May be modified after object is created with a `C_SetAttributeValue` call, + * or in the process of copying object with a `C_CopyObject` call. + * However, it is possible that a particular token may not permit modification of the attribute + * during the course of a `C_CopyObject` call. + * - Default value is token-specific, and may depend on the values of other attributes. + */ + signRecover: boolean; + /** + * `CK_TRUE` if key supports unwrapping (i.e., can be used to unwrap other keys) + * - May be modified after object is created with a `C_SetAttributeValue` call, + * or in the process of copying object with a `C_CopyObject` call. + * However, it is possible that a particular token may not permit modification of the attribute + * during the course of a `C_CopyObject` call. + * - Default value is token-specific, and may depend on the values of other attributes. + */ + unwrap: boolean; + /** + * `CK_TRUE` if key is extractable and can be wrapped + * - May be modified after object is created with a `C_SetAttributeValue` call, + * or in the process of copying object with a `C_CopyObject` call. + * However, it is possible that a particular token may not permit modification of the attribute + * during the course of a `C_CopyObject` call. + * - Attribute cannot be changed once set to `CK_FALSE`. It becomes a read only attribute. + * - Default value is token-specific, and may depend on the values of other attributes. + */ + extractable: boolean; + /** + * `CK_TRUE` if key has always had the `CKA_SENSITIVE` attribute set to `CK_TRUE` + * - Must not be specified when object is created with `C_CreateObject`. + * - Must not be specified when object is generated with `C_GenerateKey` or `C_GenerateKeyPair`. + * - Must not be specified when object is unwrapped with `C_UnwrapKey`. + */ + alwaysSensitive: boolean; + /** + * `CK_TRUE` if key has never had the `CKA_EXTRACTABLE` attribute set to `CK_TRUE` + * - Must not be specified when object is created with `C_CreateObject`. + * - Must not be specified when object is generated with `C_GenerateKey` or `C_GenerateKeyPair`. + * - Must not be specified when object is unwrapped with `C_UnwrapKey`. + */ + neverExtractable: boolean; + /** + * `CK_TRUE` if the key can only be wrapped with a wrapping key + * that has `CKA_TRUSTED` set to `CK_TRUE`. Default is `CK_FALSE`. + * - Attribute cannot be changed once set to `CK_TRUE`. It becomes a read only attribute. + */ + wrapTrusted: boolean; + /** + * For wrapping keys. The attribute template to apply to any keys unwrapped + * using this wrapping key. Any user supplied template is applied after this template + * as if the object has already been created. + */ + template: void; + alwaysAuthenticate: boolean; } /** - * Data objects (object class `CKO_DATA`) hold information defined by an application. - * Other than providing access to it, Cryptoki does not attach any special meaning to a data object + * Public key objects (object class CKO_PUBLIC_KEY) hold public keys */ - class Data extends Storage { + interface PublicKey extends Key { /** - * Description of the application that manages the object (default empty) + * DER-encoding of the key subject name (default empty) + * - May be modified after object is created with a `C_SetAttributeValue` call, + * or in the process of copying object with a `C_CopyObject` call. + * However, it is possible that a particular token may not permit modification of the attribute + * during the course of a `C_CopyObject` call. */ - application: string; + subject: Buffer; /** - * DER-encoding of the object identifier indicating the data object type (default empty) + * `CK_TRUE` if key supports encryption + * - May be modified after object is created with a `C_SetAttributeValue` call, + * or in the process of copying object with a `C_CopyObject` call. + * However, it is possible that a particular token may not permit modification of the attribute + * during the course of a `C_CopyObject` call. + * - Default value is token-specific, and may depend on the values of other attributes. */ - objectId: Buffer; + encrypt: boolean; /** - * Value of the object (default empty) + * `CK_TRUE` if key supports verification where the signature is an appendix to the data + * - May be modified after object is created with a `C_SetAttributeValue` call, + * or in the process of copying object with a `C_CopyObject` call. + * However, it is possible that a particular token may not permit modification of the attribute + * during the course of a `C_CopyObject` call. + * - Default value is token-specific, and may depend on the values of other attributes. */ + verify: boolean; + /** + * `CK_TRUE` if key supports verification where the data is recovered from the signature + * - May be modified after object is created with a `C_SetAttributeValue` call, + * or in the process of copying object with a `C_CopyObject` call. + * However, it is possible that a particular token may not permit modification of the attribute + * during the course of a `C_CopyObject` call. + * - Default value is token-specific, and may depend on the values of other attributes. + */ + verifyRecover: boolean; + /** + * `CK_TRUE` if key supports wrapping (i.e., can be used to wrap other keys) + * - May be modified after object is created with a `C_SetAttributeValue` call, + * or in the process of copying object with a `C_CopyObject` call. + * However, it is possible that a particular token may not permit modification of the attribute + * during the course of a `C_CopyObject` call. + * - Default value is token-specific, and may depend on the values of other attributes. + */ + wrap: boolean; + /** + * The key can be trusted for the application that it was created. + * - The wrapping key can be used to wrap keys with `CKA_WRAP_WITH_TRUSTED` set to `CK_TRUE`. + * - Can only be set to CK_TRUE by the SO user. + */ + trusted: boolean; + /** + * For wrapping keys. The attribute template to match against any keys wrapped using this wrapping key. + * Keys that do not match cannot be wrapped. + */ + template: void; + } + + /** + * Secret key objects (object class `CKO_SECRET_KEY`) hold secret keys. + */ + interface SecretKey extends Key { + /** + * `CK_TRUE` if key is sensitive + * - May be modified after object is created with a `C_SetAttributeValue` call, + * or in the process of copying object with a `C_CopyObject` call. + * However, it is possible that a particular token may not permit modification of the attribute + * during the course of a `C_CopyObject` call. + * - Attribute cannot be changed once set to `CK_TRUE`. It becomes a read only attribute. + */ + sensitive: boolean; + /** + * `CK_TRUE` if key supports encryption + * - May be modified after object is created with a `C_SetAttributeValue` call, + * or in the process of copying object with a `C_CopyObject` call. + * However, it is possible that a particular token may not permit modification of the attribute + * during the course of a `C_CopyObject` call. + * - Default value is token-specific, and may depend on the values of other attributes. + */ + encrypt: boolean; + /** + * `CK_TRUE` if key supports decryption + * - May be modified after object is created with a `C_SetAttributeValue` call, + * or in the process of copying object with a `C_CopyObject` call. + * However, it is possible that a particular token may not permit modification of the attribute + * during the course of a `C_CopyObject` call. + * - Default value is token-specific, and may depend on the values of other attributes. + */ + decrypt: boolean; + /** + * `CK_TRUE` if key supports verification (i.e., of authentication codes) where the signature is an appendix to the data + * - May be modified after object is created with a `C_SetAttributeValue` call, + * or in the process of copying object with a `C_CopyObject` call. + * However, it is possible that a particular token may not permit modification of the attribute + * during the course of a `C_CopyObject` call. + * - Default value is token-specific, and may depend on the values of other attributes. + */ + verify: boolean; + /** + * `CK_TRUE` if key supports signatures (i.e., authentication codes) where the signature is an appendix to the data + * - May be modified after object is created with a `C_SetAttributeValue` call, + * or in the process of copying object with a `C_CopyObject` call. + * However, it is possible that a particular token may not permit modification of the attribute + * during the course of a `C_CopyObject` call. + * - Default value is token-specific, and may depend on the values of other attributes. + */ + sign: boolean; + /** + * `CK_TRUE` if key supports wrapping (i.e., can be used to wrap other keys) + * - May be modified after object is created with a `C_SetAttributeValue` call, + * or in the process of copying object with a `C_CopyObject` call. + * However, it is possible that a particular token may not permit modification of the attribute + * during the course of a `C_CopyObject` call. + * - Default value is token-specific, and may depend on the values of other attributes. + */ + wrap: boolean; + /** + * `CK_TRUE` if key supports unwrapping (i.e., can be used to unwrap other keys) + * - May be modified after object is created with a `C_SetAttributeValue` call, + * or in the process of copying object with a `C_CopyObject` call. + * However, it is possible that a particular token may not permit modification of the attribute + * during the course of a `C_CopyObject` call. + * - Default value is token-specific, and may depend on the values of other attributes. + */ + unwrap: boolean; + /** + * `CK_TRUE` if key is extractable and can be wrapped + * - May be modified after object is created with a `C_SetAttributeValue` call, + * or in the process of copying object with a `C_CopyObject` call. + * However, it is possible that a particular token may not permit modification of the attribute + * during the course of a `C_CopyObject` call. + * - Attribute cannot be changed once set to `CK_FALSE`. It becomes a read only attribute. + * - Default value is token-specific, and may depend on the values of other attributes. + */ + extractable: boolean; + /** + * `CK_TRUE` if key has always had the `CKA_SENSITIVE` attribute set to `CK_TRUE` + * - Must not be specified when object is created with `C_CreateObject`. + * - Must not be specified when object is generated with `C_GenerateKey` or `C_GenerateKeyPair`. + * - Must not be specified when object is unwrapped with `C_UnwrapKey`. + */ + alwaysSensitive: boolean; + /** + * `CK_TRUE` if key has never had the `CKA_EXTRACTABLE` attribute set to `CK_TRUE` + * - Must not be specified when object is created with `C_CreateObject`. + * - Must not be specified when object is generated with `C_GenerateKey` or `C_GenerateKeyPair`. + * - Must not be specified when object is unwrapped with `C_UnwrapKey`. + */ + neverExtractable: boolean; + /** + * Key checksum + */ + checkValue: Buffer; + /** + * `CK_TRUE` if the key can only be wrapped with a wrapping key + * that has `CKA_TRUSTED` set to `CK_TRUE`. Default is `CK_FALSE`. + * - Attribute cannot be changed once set to `CK_TRUE`. It becomes a read only attribute. + */ + wrapTrusted: boolean; + /** + * The wrapping key can be used to wrap keys with `CKA_WRAP_WITH_TRUSTED` set to `CK_TRUE`. + * - Can only be set to CK_TRUE by the SO user. + */ + trusted: boolean; + /** + * For wrapping keys. + * The attribute template to match against any keys wrapped using this wrapping key. + * Keys that do not match cannot be wrapped. + */ + wrapTemplate: void; + /** + * For wrapping keys. + * The attribute template to apply to any keys unwrapped using this wrapping key. + * Any user supplied template is applied after this template as if the object has already been created. + */ + unwrapTemplate: void; + } + + interface Storage extends SessionObject { + /** + * `true` if object is a token object; + * `false` if object is a session object. Default is `false`. + */ + token: boolean; + /** + * `true` if object is a private object; + * `false` if object is a public object. + * Default value is token-specific, and may depend on the values of other attributes of the object. + */ + private: boolean; + /** + * `true` if object can be modified. Default is `false` + */ + modifiable: boolean; + /** + * Description of the object (default empty) + */ + label: string; + } + + interface SessionObject extends HandleObject { + /** + * Session + */ + session: Session; + /** + * gets the size of an object in bytes + * + * @readonly + * @type {number} + */ + size: number; + /** + * copies an object, creating a new object for the copy + * + * @param {ITemplate} template template for the new object + * @returns {SessionObject} + */ + copy(template: ITemplate): SessionObject; + /** + * destroys an object + */ + destroy(): void; + getAttribute(attr: string): ITemplate; + getAttribute(attrs: ITemplate): ITemplate; + setAttribute(attrs: string, value: any): void; + setAttribute(attrs: ITemplate): void; + class: graphene.ObjectClass; + toType(): T; + } + + // ========== Crypto ========== + + /** + * Type CryptoData + */ + type CryptoData = string | Buffer; + + interface INamedCurve { + name: string; + oid: string; value: Buffer; + size: number; + } + + /** + * Cipher + * + * @interface Cipher + * @extends {BaseObject} + */ + interface Cipher extends BaseObject { + update(data: CryptoData): Buffer; + final(): Buffer; + once(data: CryptoData, enc: Buffer): Buffer; + once(data: CryptoData, enc: Buffer, cb: (error: Error, data: Buffer) => void): void; + } + + /** + * Decipher + * + * @interface Decipher + * @extends {BaseObject} + */ + interface Decipher extends BaseObject { + update(data: Buffer): Buffer; + final(): Buffer; + once(data: Buffer, dec: Buffer): Buffer; + once(data: Buffer, dec: Buffer, cb: (error: Error, data: Buffer) => void): void; + } + + /** + * Digest + * + * @interface Digest + * @extends {BaseObject} + */ + interface Digest extends BaseObject { + update(data: CryptoData): void; + final(): Buffer; + once(data: CryptoData): Buffer; + once(data: CryptoData, cb: (error: Error, data: Buffer) => void): void; + } + + /** + * Sign + * + * @interface Sign + * @extends {BaseObject} + */ + interface Sign extends BaseObject { + update(data: CryptoData): void; + final(): Buffer; + once(data: CryptoData): Buffer; + once(data: CryptoData, cb: (error: Error, data: Buffer) => void): void; + } + + /** + * Verify + * + * @interface Verify + * @extends {BaseObject} + */ + interface Verify extends BaseObject { + update(data: CryptoData): void; + final(signature: Buffer): boolean; + once(data: CryptoData, signature: Buffer): boolean; + once(data: CryptoData, signature: Buffer, cb: (error: Error, valid: boolean) => void): void; + } + + interface IAlgorithm { + name: string; + params: Buffer | IParams; + } + + type MechanismType = graphene.MechanismEnum | graphene.KeyGenMechanism | IAlgorithm | string; + + interface Mechanism extends BaseObject { + /** + * the minimum size of the key for the mechanism + * _whether this is measured in bits or in bytes is mechanism-dependent_ + */ + minKeySize: number; + /** + * the maximum size of the key for the mechanism + * _whether this is measured in bits or in bytes is mechanism-dependent_ + */ + maxKeySize: number; + /** + * bit flag specifying mechanism capabilities + */ + flags: number; + /** + * returns string name from MechanismEnum + */ + name: string; + } + + interface IParams { + toCKI(): any; + } + + interface IKeyPair { + privateKey: PrivateKey; + publicKey: PublicKey; + } + + /** + * provides information about a session + * + * @ + * @class Session + * @extends {HandleObject} + */ + interface Session extends HandleObject { + /** + * Slot + * + * @type {Slot} + */ + slot: Slot; + /** + * the state of the session + * + * @type {number} + */ + state: number; + /** + * bit flags that define the type of session + * + * @type {number} + */ + flags: number; + /** + * an error code defined by the cryptographic device. Used for errors not covered by Cryptoki + * + * @type {number} + */ + deviceError: number; + /** + * closes a session between an application and a token + */ + close(): void; + /** + * initializes the normal user's PIN + * @param {string} pin the normal user's PIN + */ + initPin(pin: string): void; + /** + * modifies the PIN of the user who is logged in + * @param {string} oldPin + * @param {string} newPin + */ + setPin(oldPin: string, newPin: string): void; + /** + * obtains a copy of the cryptographic operations state of a session, encoded as a string of bytes + */ + getOperationState(): Buffer; + /** + * restores the cryptographic operations state of a session + * from a string of bytes obtained with getOperationState + * @param {Buffer} state the saved state + * @param {number} encryptionKey holds key which will be used for an ongoing encryption + * or decryption operation in the restored session + * (or 0 if no encryption or decryption key is needed, + * either because no such operation is ongoing in the stored session + * or because all the necessary key information is present in the saved state) + * @param {number} authenticationKey holds a handle to the key which will be used for an ongoing signature, + * MACing, or verification operation in the restored session + * (or 0 if no such key is needed, either because no such operation is ongoing in the stored session + * or because all the necessary key information is present in the saved state) + */ + setOperationState(state: Buffer, encryptionKey?: number, authenticationKey?: number): void; + /** + * logs a user into a token + * @param {string} pin the user's PIN. + * - This standard allows PIN values to contain any valid `UTF8` character, + * but the token may impose subset restrictions + * @param {} userType the user type. Default is `USER` + */ + login(pin: string, userType?: graphene.UserType): void; + /** + * logs a user out from a token + */ + logout(): void; + /** + * creates a new object + * - Only session objects can be created during a read-only session. + * - Only public objects can be created unless the normal user is logged in. + * @param {ITemplate} template the object's template + * @returns {SessionObject} + */ + create(template: ITemplate): SessionObject; + /** + * Copies an object, creating a new object for the copy + * @param {SessionObject} object the copied object + * @param {ITemplate} template template for new object + * @returns {SessionObject} + */ + copy(object: SessionObject, template: ITemplate): SessionObject; + /** + * removes all session objects matched to template + * - if template is null, removes all session objects + * - returns a number of destroied session objects + * @param {ITemplate} template template + */ + destroy(template: ITemplate): number; + /** + * @param {SessionObject} object + */ + destroy(object: SessionObject): number; + destroy(): number; + /** + * removes all session objects + * - returns a number of destroied session objects + */ + clear(): number; + /** + * returns a collection of session objects mached to template + * @param template template + * @param callback optional callback function wich is called for each founded object + * - if callback function returns false, it breaks find function. + */ + find(callback?: (obj: SessionObject) => any): SessionObjectCollection; + find(template: ITemplate, callback?: (obj: SessionObject, index: number) => any): SessionObjectCollection; + /** + * Returns object from session by handle + * @param {number} handle handle of object + * @returns T + */ + getObject(handle: Handle): T; + /** + * generates a secret key or set of domain parameters, creating a new object. + * @param mechanism generation mechanism + * @param template template for the new key or set of domain parameters + */ + generateKey(mechanism: MechanismType, template?: ITemplate): SecretKey; + generateKey(mechanism: MechanismType, template: ITemplate, callback: (err: Error, key: SecretKey) => void): void; + generateKeyPair(mechanism: MechanismType, publicTemplate: ITemplate, privateTemplate: ITemplate): IKeyPair; + generateKeyPair(mechanism: MechanismType, publicTemplate: ITemplate, privateTemplate: ITemplate, callback: (err: Error, keys: IKeyPair) => void): void; + createSign(alg: MechanismType, key: Key): Sign; + createVerify(alg: MechanismType, key: Key): Verify; + createCipher(alg: MechanismType, key: Key): Cipher; + createDecipher(alg: MechanismType, key: Key, blockSize?: number): Decipher; + createDigest(alg: MechanismType): Digest; + wrapKey(alg: MechanismType, wrappingKey: Key, key: Key): Buffer; + wrapKey(alg: MechanismType, wrappingKey: Key, key: Key, callback: (err: Error, wkey: Buffer) => void): void; + unwrapKey(alg: MechanismType, unwrappingKey: Key, wrappedKey: Buffer, template: ITemplate): Key; + unwrapKey(alg: MechanismType, unwrappingKey: Key, wrappedKey: Buffer, template: ITemplate, callback: (err: Error, key: Key) => void): void; + /** + * derives a key from a base key, creating a new key object + * @param {MechanismType} alg key deriv. mech + * @param {Key} baseKey base key + * @param {ITemplate} template new key template + */ + deriveKey(alg: MechanismType, baseKey: Key, template: ITemplate): SecretKey; + deriveKey(alg: MechanismType, baseKey: Key, template: ITemplate, callback: (err: Error, key: Key) => void): void; + /** + * generates random data + * @param {number} size \# of bytes to generate + */ + generateRandom(size: number): Buffer; + } + + interface Slot extends HandleObject { + slotDescription: string; + manufacturerID: string; + flags: number; + hardwareVersion: pkcs11.Version; + firmwareVersion: pkcs11.Version; + module: graphene.Module; + /** + * Returns information about token + * + * @returns {Token} + */ + getToken(): Token; + /** + * returns list of `MechanismInfo` + * + * @returns {MechanismCollection} + */ + getMechanisms(): MechanismCollection; + /** + * initializes a token + * + * @param {string} pin the SO's initial PIN + * @returns {string} + */ + initToken(pin: string): string; + /** + * opens a session between an application and a token in a particular slot + * + * @param {SessionFlag} [flags=session.SessionFlag.SERIAL_SESSION] indicates the type of session + * @returns {Session} + */ + open(flags?: graphene.SessionFlag): Session; + /** + * closes all sessions an application has with a token + */ + closeAll(): void; + } + + interface Token extends HandleObject { + /** + * application-defined label, assigned during token initialization. + * - Must be padded with the blank character (' '). + * - Should __not__ be null-terminated. + */ + label: string; + /** + * ID of the device manufacturer. + * - Must be padded with the blank character (' '). + * - Should __not__ be null-terminated. + */ + manufacturerID: string; + /** + * model of the device. + * - Must be padded with the blank character (' '). + * - Should __not__ be null-terminated. + */ + model: string; + /** + * character-string serial number of the device. + * - Must be padded with the blank character (' '). + * - Should __not__ be null-terminated. + */ + serialNumber: string; + /** + * bit flags indicating capabilities and status of the device + */ + flags: number; + /** + * maximum number of sessions that can be opened with the token at one time by a single application + */ + maxSessionCount: number; + /** + * number of sessions that this application currently has open with the token + */ + sessionCount: number; + /** + * maximum number of read/write sessions that can be opened + * with the token at one time by a single application + */ + maxRwSessionCount: number; + /** + * number of read/write sessions that this application currently has open with the token + */ + rwSessionCount: number; + /** + * maximum length in bytes of the PIN + */ + maxPinLen: number; + /** + * minimum length in bytes of the PIN + */ + minPinLen: number; + /** + * the total amount of memory on the token in bytes in which public objects may be stored + */ + totalPublicMemory: number; + /** + * the amount of free (unused) memory on the token in bytes for public objects + */ + freePublicMemory: number; + /** + * the total amount of memory on the token in bytes in which private objects may be stored + */ + totalPrivateMemory: number; + /** + * the amount of free (unused) memory on the token in bytes for private objects + */ + freePrivateMemory: number; + /** + * version number of hardware + */ + hardwareVersion: pkcs11.Version; + /** + * version number of firmware + */ + firmwareVersion: pkcs11.Version; + /** + * current time as a character-string of length 16, + * represented in the format YYYYMMDDhhmmssxx + */ + utcTime: Date; } interface ITemplate { @@ -1638,7 +1379,7 @@ declare module "graphene-pk11" { /** * CKA_OTP_USER_IDENTIFIER */ - OtpUserId?: any; + otpUserId?: any; /** * CKA_OTP_SERVICE_IDENTIFIER */ @@ -1724,41 +1465,211 @@ declare module "graphene-pk11" { */ allowedMechanisms?: any; } - class Attribute { - protected $value: Buffer; - type: number; - name: string; - convertType: string; - length: number; - value: any; - constructor(type: number, value?: any); - constructor(type: string, value?: any); - get(): any; - set(template: any): void; - } - class Template { - protected attrs: Attribute[]; - length: number; - constructor(template: string); - constructor(template: ITemplate); - set(v: any): Template; - ref(): Buffer; - serialize(): any; + +} + +declare module "graphene-pk11" { + import * as graphene from "types/graphene-pk11"; + import * as pkcs11 from "pkcs11js"; + + // ========== Parameters ========== + + // ========== AES ========== + + /** + * Parameter AES CBC + * + * @class AesCbcParams + * @implements {graphene.IParams} + * @implements {pkcs11.AesCBC} + */ + class AesCbcParams implements graphene.IParams, pkcs11.AesCBC { + /** + * initialization vector + * - must have a fixed size of 16 bytes + */ + iv: Buffer; + /** + * the data + */ + data: Buffer; + type: MechParams; + constructor(iv: Buffer, data?: Buffer); + toCKI(): Buffer; } - class BaseObject { - protected lib: Pkcs11; - constructor(lib?: Pkcs11); - } - class HandleObject extends BaseObject { + /** + * Parameter AES CCM + * + * @class AesCcmParams + * @implements {graphene.IParams} + */ + class AesCcmParams implements graphene.IParams { /** - * handle to pkcs11 object + * length of the data where 0 <= dataLength < 2^8L */ - handle: number; - constructor(handle: number, lib: Pkcs11); - protected getInfo(): void; + dataLength: number; + /** + * the nonce + */ + nonce: Buffer; + /** + * the additional authentication data + * - This data is authenticated but not encrypted + */ + aad: Buffer; + /** + * length of authentication tag (output following cipher text) in bits. + * - Can be any value between 0 and 128 + */ + macLength: number; + type: MechParams; + constructor(dataLength: number, nonce: Buffer, aad?: Buffer, macLength?: number); + toCKI(): pkcs11.AesCCM; } + /** + * Parameter AES GCM + * + * @class AesGcmParams + * @implements {graphene.IParams} + */ + class AesGcmParams implements graphene.IParams { + /** + * initialization vector + * - The length of the initialization vector can be any number between 1 and 256. + * 96-bit (12 byte) IV values can be processed more efficiently, + * so that length is recommended for situations in which efficiency is critical. + */ + iv: Buffer; + /** + * pointer to additional authentication data. + * This data is authenticated but not encrypted. + */ + aad: Buffer; + /** + * length of authentication tag (output following cipher text) in bits. + * Can be any value between 0 and 128. Default 128 + */ + tagBits: number; + type: MechParams; + constructor(iv: Buffer, aad?: Buffer, tagBits?: number); + toCKI(): pkcs11.AesGCM; + } + + // ========== EC ========== + + /** + * Parameter EC DH + * + * @class EcdhParams + * @implements {graphene.IParams} + * @implements {pkcs11.ECDH1} + */ + class EcdhParams implements graphene.IParams, pkcs11.ECDH1 { + /** + * key derivation function used on the shared secret value + */ + kdf: EcKdf; + /** + * some data shared between the two parties + */ + sharedData: Buffer; + /** + * other party's EC public key value + */ + publicData: Buffer; + type: MechParams; + /** + * Creates an instance of EcdhParams. + * + * @param {EcKdf} kdf key derivation function used on the shared secret value + * @param {Buffer} [sharedData=null] some data shared between the two parties + * @param {Buffer} [publicData=null] other party's EC public key value + */ + constructor(kdf: EcKdf, sharedData?: Buffer, publicData?: Buffer); + toCKI(): pkcs11.ECDH1; + } + + class NamedCurve { + static getByName(name: string): graphene.INamedCurve; + static getByOid(oid: string): graphene.INamedCurve; + } + + /** + * EcKdf is used to indicate the Key Derivation Function (KDF) + * applied to derive keying data from a shared secret. + * The key derivation function will be used by the EC key agreement schemes. + */ + enum EcKdf { + NULL, + SHA1, + SHA224, + SHA256, + SHA384, + SHA512, + } + + // ========== RSA ========== + + /** + * Parameter RSA OAEP + * + * @class RsaOaepParams + * @implements {graphene.IParams} + */ + class RsaOaepParams implements graphene.IParams { + hashAlgorithm: MechanismEnum; + mgf: RsaMgf; + source: number; + sourceData: Buffer; + type: MechParams; + constructor(hashAlg?: MechanismEnum, mgf?: RsaMgf, sourceData?: Buffer); + toCKI(): pkcs11.RsaOAEP; + } + + /** + * Parameter RSA PSS + * + * @class RsaPssParams + * @implements {graphene.IParams} + */ + class RsaPssParams implements graphene.IParams { + /** + * hash algorithm used in the PSS encoding; + * - if the signature mechanism does not include message hashing, + * then this value must be the mechanism used by the application to generate + * the message hash; + * - if the signature mechanism includes hashing, + * then this value must match the hash algorithm indicated + * by the signature mechanism + */ + hashAlgorithm: MechanismEnum; + /** + * mask generation function to use on the encoded block + */ + mgf: RsaMgf; + /** + * length, in bytes, of the salt value used in the PSS encoding; + * - typical values are the length of the message hash and zero + */ + saltLength: number; + type: MechParams; + constructor(hashAlg?: MechanismEnum, mgf?: RsaMgf, saltLen?: number); + toCKI(): pkcs11.RsaPSS; + } + + enum RsaMgf { + MGF1_SHA1, + MGF1_SHA224, + MGF1_SHA256, + MGF1_SHA384, + MGF1_SHA512, + } + + + // ========== Enums ========== + enum ObjectClass { DATA, CERTIFICATE, @@ -1771,327 +1682,467 @@ declare module "graphene-pk11" { OTP_KEY, } - class SessionObject extends HandleObject { - /** - * Session - */ - session: Session; - /** - * gets the size of an object in bytes - */ - size: number; - constructor(object: SessionObject); - constructor(handle: number, session: Session, lib: Pkcs11); - /** - * copies an object, creating a new object for the copy - * @param {ITemplate} template template for the new object - */ - copy(template: ITemplate): SessionObject; - /** - * destroys an object - */ - destroy(): void; - getAttribute(attr: string): ITemplate; - getAttribute(attrs: ITemplate): ITemplate; - setAttribute(attrs: string, value: any): any; - setAttribute(attrs: ITemplate): any; - protected get(name: string): any; - protected set(name: string, value: any): void; - class: ObjectClass; - toType(): T; + class Mechanism { + static vendor(jsonFile: string): void; + static vendor(name: string, value: number): void; } - class SessionObjectCollection extends Collection { - session: Session; - items(index: number): SessionObject; - constructor(items: Array, session: Session, lib: Pkcs11, classType?: any); + enum CertificateType { + X_509, + X_509_ATTR_CERT, + WTLS, } - /** - * Private key objects (object class `CKO_PRIVATE_KEY`) hold private keys - */ - class PrivateKey extends Key { - /** - * DER-encoding of the key subject name (default empty) - * - May be modified after object is created with a `C_SetAttributeValue` call, - * or in the process of copying object with a `C_CopyObject` call. - * However, it is possible that a particular token may not permit modification of the attribute - * during the course of a `C_CopyObject` call. - */ - subject: Buffer; - /** - * `CK_TRUE` if key is sensitive - * - May be modified after object is created with a `C_SetAttributeValue` call, - * or in the process of copying object with a `C_CopyObject` call. - * However, it is possible that a particular token may not permit modification of the attribute - * during the course of a `C_CopyObject` call. - * - Attribute cannot be changed once set to CK_TRUE. It becomes a read only attribute. - * - Default value is token-specific, and may depend on the values of other attributes. - */ - sensitive: boolean; - /** - * `CK_TRUE` if key supports decryption - * - May be modified after object is created with a `C_SetAttributeValue` call, - * or in the process of copying object with a `C_CopyObject` call. - * However, it is possible that a particular token may not permit modification of the attribute - * during the course of a `C_CopyObject` call. - * - Default value is token-specific, and may depend on the values of other attributes. - */ - decrypt: boolean; - /** - * `CK_TRUE` if key supports signatures where the signature is an appendix to the data - * - May be modified after object is created with a `C_SetAttributeValue` call, - * or in the process of copying object with a `C_CopyObject` call. - * However, it is possible that a particular token may not permit modification of the attribute - * during the course of a `C_CopyObject` call. - * - Default value is token-specific, and may depend on the values of other attributes. - */ - sign: boolean; - /** - * `CK_TRUE` if key supports signatures where the data can be recovered from the signature - * - May be modified after object is created with a `C_SetAttributeValue` call, - * or in the process of copying object with a `C_CopyObject` call. - * However, it is possible that a particular token may not permit modification of the attribute - * during the course of a `C_CopyObject` call. - * - Default value is token-specific, and may depend on the values of other attributes. - */ - signRecover: boolean; - /** - * `CK_TRUE` if key supports unwrapping (i.e., can be used to unwrap other keys) - * - May be modified after object is created with a `C_SetAttributeValue` call, - * or in the process of copying object with a `C_CopyObject` call. - * However, it is possible that a particular token may not permit modification of the attribute - * during the course of a `C_CopyObject` call. - * - Default value is token-specific, and may depend on the values of other attributes. - */ - unwrap: boolean; - /** - * `CK_TRUE` if key is extractable and can be wrapped - * - May be modified after object is created with a `C_SetAttributeValue` call, - * or in the process of copying object with a `C_CopyObject` call. - * However, it is possible that a particular token may not permit modification of the attribute - * during the course of a `C_CopyObject` call. - * - Attribute cannot be changed once set to `CK_FALSE`. It becomes a read only attribute. - * - Default value is token-specific, and may depend on the values of other attributes. - */ - extractable: boolean; - /** - * `CK_TRUE` if key has always had the `CKA_SENSITIVE` attribute set to `CK_TRUE` - * - Must not be specified when object is created with `C_CreateObject`. - * - Must not be specified when object is generated with `C_GenerateKey` or `C_GenerateKeyPair`. - * - Must not be specified when object is unwrapped with `C_UnwrapKey`. - */ - alwaysSensitive: boolean; - /** - * `CK_TRUE` if key has never had the `CKA_EXTRACTABLE` attribute set to `CK_TRUE` - * - Must not be specified when object is created with `C_CreateObject`. - * - Must not be specified when object is generated with `C_GenerateKey` or `C_GenerateKeyPair`. - * - Must not be specified when object is unwrapped with `C_UnwrapKey`. - */ - neverExtractable: boolean; - /** - * `CK_TRUE` if the key can only be wrapped with a wrapping key - * that has `CKA_TRUSTED` set to `CK_TRUE`. Default is `CK_FALSE`. - * - Attribute cannot be changed once set to `CK_TRUE`. It becomes a read only attribute. - */ - wrapTrusted: boolean; - /** - * For wrapping keys. The attribute template to apply to any keys unwrapped - * using this wrapping key. Any user supplied template is applied after this template - * as if the object has already been created. - */ - template: void; - alwaysAuthenticate: boolean; + enum CertificateCategory { + Unspecified = 0, + TokenUser = 1, + Authority = 2, + OtherEntity = 3, } - /** - * Public key objects (object class CKO_PUBLIC_KEY) hold public keys - */ - class PublicKey extends Key { - /** - * DER-encoding of the key subject name (default empty) - * - May be modified after object is created with a `C_SetAttributeValue` call, - * or in the process of copying object with a `C_CopyObject` call. - * However, it is possible that a particular token may not permit modification of the attribute - * during the course of a `C_CopyObject` call. - */ - subject: Buffer; - /** - * `CK_TRUE` if key supports encryption - * - May be modified after object is created with a `C_SetAttributeValue` call, - * or in the process of copying object with a `C_CopyObject` call. - * However, it is possible that a particular token may not permit modification of the attribute - * during the course of a `C_CopyObject` call. - * - Default value is token-specific, and may depend on the values of other attributes. - */ - encrypt: boolean; - /** - * `CK_TRUE` if key supports verification where the signature is an appendix to the data - * - May be modified after object is created with a `C_SetAttributeValue` call, - * or in the process of copying object with a `C_CopyObject` call. - * However, it is possible that a particular token may not permit modification of the attribute - * during the course of a `C_CopyObject` call. - * - Default value is token-specific, and may depend on the values of other attributes. - */ - verify: boolean; - /** - * `CK_TRUE` if key supports verification where the data is recovered from the signature - * - May be modified after object is created with a `C_SetAttributeValue` call, - * or in the process of copying object with a `C_CopyObject` call. - * However, it is possible that a particular token may not permit modification of the attribute - * during the course of a `C_CopyObject` call. - * - Default value is token-specific, and may depend on the values of other attributes. - */ - verifyRecover: boolean; - /** - * `CK_TRUE` if key supports wrapping (i.e., can be used to wrap other keys) - * - May be modified after object is created with a `C_SetAttributeValue` call, - * or in the process of copying object with a `C_CopyObject` call. - * However, it is possible that a particular token may not permit modification of the attribute - * during the course of a `C_CopyObject` call. - * - Default value is token-specific, and may depend on the values of other attributes. - */ - wrap: boolean; - /** - * The key can be trusted for the application that it was created. - * - The wrapping key can be used to wrap keys with `CKA_WRAP_WITH_TRUSTED` set to `CK_TRUE`. - * - Can only be set to CK_TRUE by the SO user. - */ - trusted: boolean; - /** - * For wrapping keys. The attribute template to match against any keys wrapped using this wrapping key. - * Keys that do not match cannot be wrapped. - */ - template: void; + enum KeyType { + RSA, + DSA, + DH, + ECDSA, + EC, + X9_42_DH, + KEA, + GENERIC_SECRET, + RC2, + RC4, + DES, + DES2, + DES3, + CAST, + CAST3, + CAST5, + CAST128, + RC5, + IDEA, + SKIPJACK, + BATON, + JUNIPER, + CDMF, + AES, + GOSTR3410, + GOSTR3411, + GOST28147, + BLOWFISH, + TWOFISH, + SECURID, + HOTP, + ACTI, + CAMELLIA, + ARIA, } - /** - * Secret key objects (object class `CKO_SECRET_KEY`) hold secret keys. - */ - class SecretKey extends Key { - /** - * `CK_TRUE` if key is sensitive - * - May be modified after object is created with a `C_SetAttributeValue` call, - * or in the process of copying object with a `C_CopyObject` call. - * However, it is possible that a particular token may not permit modification of the attribute - * during the course of a `C_CopyObject` call. - * - Attribute cannot be changed once set to `CK_TRUE`. It becomes a read only attribute. - */ - sensitive: boolean; - /** - * `CK_TRUE` if key supports encryption - * - May be modified after object is created with a `C_SetAttributeValue` call, - * or in the process of copying object with a `C_CopyObject` call. - * However, it is possible that a particular token may not permit modification of the attribute - * during the course of a `C_CopyObject` call. - * - Default value is token-specific, and may depend on the values of other attributes. - */ - encrypt: boolean; - /** - * `CK_TRUE` if key supports decryption - * - May be modified after object is created with a `C_SetAttributeValue` call, - * or in the process of copying object with a `C_CopyObject` call. - * However, it is possible that a particular token may not permit modification of the attribute - * during the course of a `C_CopyObject` call. - * - Default value is token-specific, and may depend on the values of other attributes. - */ - decrypt: boolean; - /** - * `CK_TRUE` if key supports verification (i.e., of authentication codes) where the signature is an appendix to the data - * - May be modified after object is created with a `C_SetAttributeValue` call, - * or in the process of copying object with a `C_CopyObject` call. - * However, it is possible that a particular token may not permit modification of the attribute - * during the course of a `C_CopyObject` call. - * - Default value is token-specific, and may depend on the values of other attributes. - */ - verify: boolean; - /** - * `CK_TRUE` if key supports signatures (i.e., authentication codes) where the signature is an appendix to the data - * - May be modified after object is created with a `C_SetAttributeValue` call, - * or in the process of copying object with a `C_CopyObject` call. - * However, it is possible that a particular token may not permit modification of the attribute - * during the course of a `C_CopyObject` call. - * - Default value is token-specific, and may depend on the values of other attributes. - */ - sign: boolean; - /** - * `CK_TRUE` if key supports wrapping (i.e., can be used to wrap other keys) - * - May be modified after object is created with a `C_SetAttributeValue` call, - * or in the process of copying object with a `C_CopyObject` call. - * However, it is possible that a particular token may not permit modification of the attribute - * during the course of a `C_CopyObject` call. - * - Default value is token-specific, and may depend on the values of other attributes. - */ - wrap: boolean; - /** - * `CK_TRUE` if key supports unwrapping (i.e., can be used to unwrap other keys) - * - May be modified after object is created with a `C_SetAttributeValue` call, - * or in the process of copying object with a `C_CopyObject` call. - * However, it is possible that a particular token may not permit modification of the attribute - * during the course of a `C_CopyObject` call. - * - Default value is token-specific, and may depend on the values of other attributes. - */ - unwrap: boolean; - /** - * `CK_TRUE` if key is extractable and can be wrapped - * - May be modified after object is created with a `C_SetAttributeValue` call, - * or in the process of copying object with a `C_CopyObject` call. - * However, it is possible that a particular token may not permit modification of the attribute - * during the course of a `C_CopyObject` call. - * - Attribute cannot be changed once set to `CK_FALSE`. It becomes a read only attribute. - * - Default value is token-specific, and may depend on the values of other attributes. - */ - extractable: boolean; - /** - * `CK_TRUE` if key has always had the `CKA_SENSITIVE` attribute set to `CK_TRUE` - * - Must not be specified when object is created with `C_CreateObject`. - * - Must not be specified when object is generated with `C_GenerateKey` or `C_GenerateKeyPair`. - * - Must not be specified when object is unwrapped with `C_UnwrapKey`. - */ - alwaysSensitive: boolean; - /** - * `CK_TRUE` if key has never had the `CKA_EXTRACTABLE` attribute set to `CK_TRUE` - * - Must not be specified when object is created with `C_CreateObject`. - * - Must not be specified when object is generated with `C_GenerateKey` or `C_GenerateKeyPair`. - * - Must not be specified when object is unwrapped with `C_UnwrapKey`. - */ - neverExtractable: boolean; - /** - * Key checksum - */ - checkValue: Buffer; - /** - * `CK_TRUE` if the key can only be wrapped with a wrapping key - * that has `CKA_TRUSTED` set to `CK_TRUE`. Default is `CK_FALSE`. - * - Attribute cannot be changed once set to `CK_TRUE`. It becomes a read only attribute. - */ - wrapTrusted: boolean; - /** - * The wrapping key can be used to wrap keys with `CKA_WRAP_WITH_TRUSTED` set to `CK_TRUE`. - * - Can only be set to CK_TRUE by the SO user. - */ - trusted: boolean; - /** - * For wrapping keys. - * The attribute template to match against any keys wrapped using this wrapping key. - * Keys that do not match cannot be wrapped. - */ - wrapTemplate: void; - /** - * For wrapping keys. - * The attribute template to apply to any keys unwrapped using this wrapping key. - * Any user supplied template is applied after this template as if the object has already been created. - */ - unwrapTemplate: void; + enum KeyGenMechanism { + AES, + RSA, + RSA_X9_31, + DSA, + DH_PKCS, + DH_X9_42, + GOSTR3410, + GOST28147, + RC2, + RC4, + DES, + DES2, + SECURID, + ACTI, + CAST, + CAST3, + CAST5, + CAST128, + RC5, + IDEA, + GENERIC_SECRET, + SSL3_PRE_MASTER, + CAMELLIA, + ARIA, + SKIPJACK, + KEA, + BATON, + ECDSA, + EC, + JUNIPER, + TWOFISH, } + enum MechanismFlag { + /** + * `True` if the mechanism is performed by the device; `false` if the mechanism is performed in software + */ + HW, + /** + * `True` if the mechanism can be used with encrypt function + */ + ENCRYPT, + /** + * `True` if the mechanism can be used with decrypt function + */ + DECRYPT, + /** + * `True` if the mechanism can be used with digest function + */ + DIGEST, + /** + * `True` if the mechanism can be used with sign function + */ + SIGN, + /** + * `True` if the mechanism can be used with sign recover function + */ + SIGN_RECOVER, + /** + * `True` if the mechanism can be used with verify function + */ + VERIFY, + /** + * `True` if the mechanism can be used with verify recover function + */ + VERIFY_RECOVER, + /** + * `True` if the mechanism can be used with geberate function + */ + GENERATE, + /** + * `True` if the mechanism can be used with generate key pair function + */ + GENERATE_KEY_PAIR, + /** + * `True` if the mechanism can be used with wrap function + */ + WRAP, + /** + * `True` if the mechanism can be used with unwrap function + */ + UNWRAP, + /** + * `True` if the mechanism can be used with derive function + */ + DERIVE, + } - interface ISlotInfo { - slotDescription: string; - manufacturerID: string; - flags: number; - hardwareVersion: IVersion; - firmwareVersion: IVersion; + enum MechanismEnum { + RSA_PKCS_KEY_PAIR_GEN, + RSA_PKCS, + RSA_9796, + RSA_X_509, + MD2_RSA_PKCS, + MD5_RSA_PKCS, + SHA1_RSA_PKCS, + RIPEMD128_RSA_PKCS, + RIPEMD160_RSA_PKCS, + RSA_PKCS_OAEP, + RSA_X9_31_KEY_PAIR_GEN, + RSA_X9_31, + SHA1_RSA_X9_31, + RSA_PKCS_PSS, + SHA1_RSA_PKCS_PSS, + DSA_KEY_PAIR_GEN, + DSA, + DSA_SHA1, + DSA_SHA224, + DSA_SHA256, + DSA_SHA384, + DSA_SHA512, + DH_PKCS_KEY_PAIR_GEN, + DH_PKCS_DERIVE, + X9_42_DH_KEY_PAIR_GEN, + X9_42_DH_DERIVE, + X9_42_DH_HYBRID_DERIVE, + X9_42_MQV_DERIVE, + SHA256_RSA_PKCS, + SHA384_RSA_PKCS, + SHA512_RSA_PKCS, + SHA256_RSA_PKCS_PSS, + SHA384_RSA_PKCS_PSS, + SHA512_RSA_PKCS_PSS, + SHA224_RSA_PKCS, + SHA224_RSA_PKCS_PSS, + RC2_KEY_GEN, + RC2_ECB, + RC2_CBC, + RC2_MAC, + RC2_MAC_GENERAL, + RC2_CBC_PAD, + RC4_KEY_GEN, + RC4, + DES_KEY_GEN, + DES_ECB, + DES_CBC, + DES_MAC, + DES_MAC_GENERAL, + DES_CBC_PAD, + DES2_KEY_GEN, + DES3_KEY_GEN, + DES3_ECB, + DES3_CBC, + DES3_MAC, + DES3_MAC_GENERAL, + DES3_CBC_PAD, + CDMF_KEY_GEN, + CDMF_ECB, + CDMF_CBC, + CDMF_MAC, + CDMF_MAC_GENERAL, + CDMF_CBC_PAD, + DES_OFB64, + DES_OFB8, + DES_CFB64, + DES_CFB8, + MD2, + MD2_HMAC, + MD2_HMAC_GENERAL, + MD5, + MD5_HMAC, + MD5_HMAC_GENERAL, + SHA1, + SHA, + SHA_1, + SHA_1_HMAC, + SHA_1_HMAC_GENERAL, + RIPEMD128, + RIPEMD128_HMAC, + RIPEMD128_HMAC_GENERAL, + RIPEMD160, + RIPEMD160_HMAC, + RIPEMD160_HMAC_GENERAL, + SHA256, + SHA256_HMAC, + SHA256_HMAC_GENERAL, + SHA224, + SHA224_HMAC, + SHA224_HMAC_GENERAL, + SHA384, + SHA384_HMAC, + SHA384_HMAC_GENERAL, + SHA512, + SHA512_HMAC, + SHA512_HMAC_GENERAL, + SECURID_KEY_GEN, + SECURID, + HOTP_KEY_GEN, + HOTP, + ACTI, + ACTI_KEY_GEN, + CAST_KEY_GEN, + CAST_ECB, + CAST_CBC, + CAST_MAC, + CAST_MAC_GENERAL, + CAST_CBC_PAD, + CAST3_KEY_GEN, + CAST3_ECB, + CAST3_CBC, + CAST3_MAC, + CAST3_MAC_GENERAL, + CAST3_CBC_PAD, + CAST5_KEY_GEN, + CAST128_KEY_GEN, + CAST5_ECB, + CAST128_ECB, + CAST5_CBC, + CAST128_CBC, + CAST5_MAC, + CAST128_MAC, + CAST5_MAC_GENERAL, + CAST128_MAC_GENERAL, + CAST5_CBC_PAD, + CAST128_CBC_PAD, + RC5_KEY_GEN, + RC5_ECB, + RC5_CBC, + RC5_MAC, + RC5_MAC_GENERAL, + RC5_CBC_PAD, + IDEA_KEY_GEN, + IDEA_ECB, + IDEA_CBC, + IDEA_MAC, + IDEA_MAC_GENERAL, + IDEA_CBC_PAD, + GENERIC_SECRET_KEY_GEN, + CONCATENATE_BASE_AND_KEY, + CONCATENATE_BASE_AND_DATA, + CONCATENATE_DATA_AND_BASE, + XOR_BASE_AND_DATA, + EXTRACT_KEY_FROM_KEY, + SSL3_PRE_MASTER_KEY_GEN, + SSL3_MASTER_KEY_DERIVE, + SSL3_KEY_AND_MAC_DERIVE, + SSL3_MASTER_KEY_DERIVE_DH, + TLS_PRE_MASTER_KEY_GEN, + TLS_MASTER_KEY_DERIVE, + TLS_KEY_AND_MAC_DERIVE, + TLS_MASTER_KEY_DERIVE_DH, + TLS_PRF, + SSL3_MD5_MAC, + SSL3_SHA1_MAC, + MD5_KEY_DERIVATION, + MD2_KEY_DERIVATION, + SHA1_KEY_DERIVATION, + SHA256_KEY_DERIVATION, + SHA384_KEY_DERIVATION, + SHA512_KEY_DERIVATION, + SHA224_KEY_DERIVATION, + PBE_MD2_DES_CBC, + PBE_MD5_DES_CBC, + PBE_MD5_CAST_CBC, + PBE_MD5_CAST3_CBC, + PBE_MD5_CAST5_CBC, + PBE_MD5_CAST128_CBC, + PBE_SHA1_CAST5_CBC, + PBE_SHA1_CAST128_CBC, + PBE_SHA1_RC4_128, + PBE_SHA1_RC4_40, + PBE_SHA1_DES3_EDE_CBC, + PBE_SHA1_DES2_EDE_CBC, + PBE_SHA1_RC2_128_CBC, + PBE_SHA1_RC2_40_CBC, + PKCS5_PBKD2, + PBA_SHA1_WITH_SHA1_HMAC, + WTLS_PRE_MASTER_KEY_GEN, + WTLS_MASTER_KEY_DERIVE, + WTLS_MASTER_KEY_DERIVE_DH_ECC, + WTLS_PRF, + WTLS_SERVER_KEY_AND_MAC_DERIVE, + WTLS_CLIENT_KEY_AND_MAC_DERIVE, + KEY_WRAP_LYNKS, + KEY_WRAP_SET_OAEP, + CAMELLIA_KEY_GEN, + CAMELLIA_ECB, + CAMELLIA_CBC, + CAMELLIA_MAC, + CAMELLIA_MAC_GENERAL, + CAMELLIA_CBC_PAD, + CAMELLIA_ECB_ENCRYPT_DATA, + CAMELLIA_CBC_ENCRYPT_DATA, + CAMELLIA_CTR, + ARIA_KEY_GEN, + ARIA_ECB, + ARIA_CBC, + ARIA_MAC, + ARIA_MAC_GENERAL, + ARIA_CBC_PAD, + ARIA_ECB_ENCRYPT_DATA, + ARIA_CBC_ENCRYPT_DATA, + SKIPJACK_KEY_GEN, + SKIPJACK_ECB64, + SKIPJACK_CBC64, + SKIPJACK_OFB64, + SKIPJACK_CFB64, + SKIPJACK_CFB32, + SKIPJACK_CFB16, + SKIPJACK_CFB8, + SKIPJACK_WRAP, + SKIPJACK_PRIVATE_WRAP, + SKIPJACK_RELAYX, + KEA_KEY_PAIR_GEN, + KEA_KEY_DERIVE, + FORTEZZA_TIMESTAMP, + BATON_KEY_GEN, + BATON_ECB128, + BATON_ECB96, + BATON_CBC128, + BATON_COUNTER, + BATON_SHUFFLE, + BATON_WRAP, + ECDSA_KEY_PAIR_GEN, + EC_KEY_PAIR_GEN, + ECDSA, + ECDSA_SHA1, + ECDSA_SHA224, + ECDSA_SHA256, + ECDSA_SHA384, + ECDSA_SHA512, + ECDH1_DERIVE, + ECDH1_COFACTOR_DERIVE, + ECMQV_DERIVE, + JUNIPER_KEY_GEN, + JUNIPER_ECB128, + JUNIPER_CBC128, + JUNIPER_COUNTER, + JUNIPER_SHUFFLE, + JUNIPER_WRAP, + FASTHASH, + AES_KEY_GEN, + AES_ECB, + AES_CBC, + AES_MAC, + AES_MAC_GENERAL, + AES_CBC_PAD, + AES_CTR, + AES_CMAC, + AES_CMAC_GENERAL, + BLOWFISH_KEY_GEN, + BLOWFISH_CBC, + TWOFISH_KEY_GEN, + TWOFISH_CBC, + AES_GCM, + AES_CCM, + AES_KEY_WRAP, + AES_KEY_WRAP_PAD, + DES_ECB_ENCRYPT_DATA, + DES_CBC_ENCRYPT_DATA, + DES3_ECB_ENCRYPT_DATA, + DES3_CBC_ENCRYPT_DATA, + AES_ECB_ENCRYPT_DATA, + AES_CBC_ENCRYPT_DATA, + GOSTR3410_KEY_PAIR_GEN, + GOSTR3410, + GOSTR3410_WITH_GOSTR3411, + GOSTR3410_KEY_WRAP, + GOSTR3410_DERIVE, + GOSTR3411, + GOSTR3411_HMAC, + GOST28147_KEY_GEN, + GOST28147_ECB, + GOST28147, + GOST28147_MAC, + GOST28147_KEY_WRAP, + DSA_PARAMETER_GEN, + DH_PKCS_PARAMETER_GEN, + X9_42_DH_PARAMETER_GEN, + VENDOR_DEFINED, + } + + enum MechParams { + AesCBC = 1, + AesCCM = 2, + AesGCM = 3, + RsaOAEP = 4, + RsaPSS = 5, + EcDH = 6, + } + + enum SessionFlag { + /** + * `True` if the session is read/write; `false` if the session is read-only + */ + RW_SESSION, + /** + * This flag is provided for backward compatibility, and should always be set to `true` + */ + SERIAL_SESSION + } + + enum UserType { + /** + * Security Officer + */ + SO, + /** + * User + */ + USER, + /** + * Context specific + */ + CONTEXT_SPECIFIC } enum SlotFlag { @@ -2106,205 +2157,7 @@ declare module "graphene-pk11" { /** * True if the slot is a hardware slot, as opposed to a software slot implementing a "soft token" */ - HW_SLOT, - } - - interface IVersion { - major: number; - minor: number; - } - interface IModuleInfo { - cryptokiVersion: IVersion; - manufacturerID: string; - flags: number; - libraryDescription: string; - libraryVersion: IVersion; - } - - class Collection { - protected items_: Array; - protected classType: any; - protected lib: Pkcs11; - constructor(items: Array, lib: Pkcs11, classType: any); - /** - * returns length of collection - */ - length: number; - /** - * returns item from collection by index - * @param {number} index of element in collection `[0..n]` - */ - items(index: number): T; - } - - enum SessionOpenFlag { - /** - * session is r/w - */ - RW_SESSION, - /** - * no parallel - */ - SERIAL_SESSION, - } - enum SessionFlag { - /** - * `True` if the session is read/write; `false` if the session is read-only - */ - RW_SESSION, - /** - * This flag is provided for backward compatibility, and should always be set to `true` - */ - SERIAL_SESSION, - } - enum UserType { - /** - * Security Officer - */ - SO, - /** - * User - */ - USER, - /** - * Context specific - */ - CONTEXT_SPECIFIC, - } - interface IKeyPair { - privateKey: PrivateKey; - publicKey: PublicKey; - } - /** - * provides information about a session - */ - class Session extends HandleObject { - constructor(handle: number, slot: Slot, lib: Pkcs11); - slot: Slot; - /** - * the state of the session - */ - state: number; - /** - * bit flags that define the type of session - */ - flags: number; - /** - * an error code defined by the cryptographic device. Used for errors not covered by Cryptoki - */ - deviceError: number; - protected getInfo(): void; - /** - * closes a session between an application and a token - */ - close(): void; - /** - * initializes the normal user's PIN - * @param {string} pin the normal user's PIN - */ - initPin(pin: string): void; - /** - * modifies the PIN of the user who is logged in - * @param {string} oldPin - * @param {string} newPin - */ - setPin(oldPin: string, newPin: string): void; - /** - * obtains a copy of the cryptographic operations state of a session, encoded as a string of bytes - */ - getOperationState(): Buffer; - /** - * restores the cryptographic operations state of a session - * from a string of bytes obtained with getOperationState - * @param {Buffer} state the saved state - * @param {number} encryptionKey holds key which will be used for an ongoing encryption - * or decryption operation in the restored session - * (or 0 if no encryption or decryption key is needed, - * either because no such operation is ongoing in the stored session - * or because all the necessary key information is present in the saved state) - * @param {number} authenticationKey holds a handle to the key which will be used for an ongoing signature, - * MACing, or verification operation in the restored session - * (or 0 if no such key is needed, either because no such operation is ongoing in the stored session - * or because all the necessary key information is present in the saved state) - */ - setOperationState(state: Buffer, encryptionKey?: number, authenticationKey?: number): void; - /** - * logs a user into a token - * @param {string} pin the user's PIN. - * - This standard allows PIN values to contain any valid `UTF8` character, - * but the token may impose subset restrictions - * @param {} userType the user type. Default is `USER` - */ - login(pin: string, userType?: UserType): void; - /** - * logs a user out from a token - */ - logout(): void; - /** - * creates a new object - * - Only session objects can be created during a read-only session. - * - Only public objects can be created unless the normal user is logged in. - * @param {ITemplate} template the object's template - */ - create(template: ITemplate): SessionObject; - /** - * removes all session objects matched to template - * - if template is null, removes all session objects - * - returns a number of destroied session objects - * @param {ITemplate} template template - */ - destroy(template: ITemplate): number; - /** - * @param {SessionObject} object - */ - destroy(object: SessionObject): number; - destroy(): number; - /** - * removes all session objects - * - returns a number of destroied session objects - */ - clear(): number; - /** - * returns a collection of session objects mached to template - * @param template template - * @param callback optional callback function wich is called for each founded object - * - if callback function returns false, it breaks find function. - */ - find(callback?: (obj: SessionObject) => void): SessionObjectCollection; - find(template: ITemplate, callback?: (obj: SessionObject) => void): SessionObjectCollection; - /** - * Returns object from session by handle - * @param {number} handle handle of object - * @returns T - */ - getObject(handle: number): T; - /** - * generates a secret key or set of domain parameters, creating a new object. - * @param mechanism generation mechanism - * @param template template for the new key or set of domain parameters - */ - generateKey(mechanism: MechanismType, template?: ITemplate): SecretKey; - generateKey(mechanism: MechanismType, template: ITemplate, callback: (err: Error, key: SecretKey) => void): void; - generateKeyPair(mechanism: MechanismType, publicTemplate: ITemplate, privateTemplate: ITemplate): IKeyPair; - createSign(alg: MechanismType, key: Key): Sign; - createVerify(alg: MechanismType, key: Key): Verify; - createCipher(alg: MechanismType, key: Key): Cipher; - createDecipher(alg: MechanismType, key: Key): Decipher; - createDigest(alg: MechanismType): Digest; - wrapKey(alg: MechanismType, wrappingKey: Key, key: Key): Buffer; - unwrapKey(alg: MechanismType, unwrappingKey: Key, wrappedKey: Buffer, template: ITemplate): Key; - /** - * derives a key from a base key, creating a new key object - * @param {MechanismType} alg key deriv. mech - * @param {Key} baseKey base key - * @param {ITemplate} template new key template - */ - deriveKey(alg: MechanismType, baseKey: Key, template: ITemplate): SecretKey; - /** - * generates random data - * @param {number} size \# of bytes to generate - */ - generateRandom(size: number): Buffer; + HW_SLOT } enum TokenFlag { @@ -2325,139 +2178,25 @@ declare module "graphene-pk11" { SO_PIN_COUNT_LOW, SO_PIN_FINAL_TRY, SO_PIN_LOCKED, - SO_PIN_TO_BE_CHANGED, - } - class Token extends HandleObject { - /** - * application-defined label, assigned during token initialization. - * - Must be padded with the blank character (' '). - * - Should __not__ be null-terminated. - */ - label: string; - /** - * ID of the device manufacturer. - * - Must be padded with the blank character (' '). - * - Should __not__ be null-terminated. - */ - manufacturerID: string; - /** - * model of the device. - * - Must be padded with the blank character (' '). - * - Should __not__ be null-terminated. - */ - model: string; - /** - * character-string serial number of the device. - * - Must be padded with the blank character (' '). - * - Should __not__ be null-terminated. - */ - serialNumber: string; - /** - * bit flags indicating capabilities and status of the device - */ - flags: number; - /** - * maximum number of sessions that can be opened with the token at one time by a single application - */ - maxSessionCount: number; - /** - * number of sessions that this application currently has open with the token - */ - sessionCount: number; - /** - * maximum number of read/write sessions that can be opened - * with the token at one time by a single application - */ - maxRwSessionCount: number; - /** - * number of read/write sessions that this application currently has open with the token - */ - rwSessionCount: number; - /** - * maximum length in bytes of the PIN - */ - maxPinLen: number; - /** - * minimum length in bytes of the PIN - */ - minPinLen: number; - /** - * the total amount of memory on the token in bytes in which public objects may be stored - */ - totalPublicMemory: number; - /** - * the amount of free (unused) memory on the token in bytes for public objects - */ - freePublicMemory: number; - /** - * the total amount of memory on the token in bytes in which private objects may be stored - */ - totalPrivateMemory: number; - /** - * the amount of free (unused) memory on the token in bytes for private objects - */ - freePrivateMemory: number; - /** - * version number of hardware - */ - hardwareVersion: IVersion; - /** - * version number of firmware - */ - firmwareVersion: IVersion; - /** - * current time as a character-string of length 16, - * represented in the format YYYYMMDDhhmmssxx - */ - utcTime: Date; - constructor(handle: number, lib: Pkcs11); - protected getInfo(): void; + SO_PIN_TO_BE_CHANGED } - class Slot extends HandleObject implements ISlotInfo { - slotDescription: string; - manufacturerID: string; - flags: number; - hardwareVersion: IVersion; - firmwareVersion: IVersion; - module: Module; - constructor(handle: number, module: Module, lib: Pkcs11); - protected getInfo(): void; - getToken(): Token; - /** - * returns list of `MechanismInfo` - */ - getMechanisms(): MechanismCollection; - /** - * initializes a token - * @param {string} pin the SO's initial PIN - * @param {string} label label of the token - */ - initToken(pin: string, label: string): void; - /** - * opens a session between an application and a token in a particular slot - * @parsm flags indicates the type of session - */ - open(flags?: number): Session; - /** - * closes all sessions an application has with a token - */ - closeAll(): void; + enum JavaMIDP { + Unspecified, + Manufacturer, + Operator, + ThirdParty } - class SlotCollection extends Collection { - module: Module; - items(index: number): Slot; - constructor(items: Array, module: Module, lib: Pkcs11, classType?: any); - } + // ========== Module ========== - class Module extends BaseObject implements IModuleInfo { + class Module implements graphene.BaseObject { libFile: string; libName: string; /** * Cryptoki interface version */ - cryptokiVersion: IVersion; + cryptokiVersion: pkcs11.Version; /** * blank padded manufacturer ID */ @@ -2473,9 +2212,10 @@ declare module "graphene-pk11" { /** * version of library */ - libraryVersion: IVersion; - constructor(lib: Pkcs11); - protected getInfo(): void; + libraryVersion: pkcs11.Version; + + constructor(lib: pkcs11.PKCS11); + /** * initializes the Cryptoki library */ @@ -2489,231 +2229,17 @@ declare module "graphene-pk11" { * @param {number} index index of an element in collection * @param {number} tokenPresent only slots with tokens. Default `True` */ - getSlots(index: number, tokenPresent?: boolean): Slot; + getSlots(index: number, tokenPresent?: boolean): graphene.Slot; /** * @param {number} tokenPresent only slots with tokens. Default `True` */ - getSlots(tokenPresent?: boolean): SlotCollection; + getSlots(tokenPresent?: boolean): graphene.SlotCollection; /** * loads pkcs11 lib + * @param libFile path to PKCS11 library + * @param libName name of PKCS11 library */ static load(libFile: string, libName?: string): Module; } - class Cipher { - session: Session; - lib: Pkcs11; - constructor(session: Session, alg: MechanismType, key: Key, lib: Pkcs11); - protected init(alg: MechanismType, key: Key): void; - update(text: string): Buffer; - update(data: Buffer): Buffer; - final(): Buffer; - } - - class Decipher { - session: Session; - lib: Pkcs11; - constructor(session: Session, alg: MechanismType, key: Key, lib: Pkcs11); - protected init(alg: MechanismType, key: Key): void; - update(text: string): Buffer; - update(data: Buffer): Buffer; - final(): Buffer; - } - - class Digest { - session: Session; - lib: Pkcs11; - constructor(session: Session, alg: MechanismType, lib: Pkcs11); - protected init(alg: MechanismType): void; - update(text: string): void; - update(data: Buffer): void; - final(): Buffer; - } - - class Sign { - session: Session; - lib: Pkcs11; - constructor(session: Session, alg: MechanismType, key: Key, lib: Pkcs11); - protected init(alg: MechanismType, key: Key): void; - update(text: string): void; - update(data: Buffer): void; - final(): Buffer; - } - - class Verify { - session: Session; - lib: Pkcs11; - constructor(session: Session, alg: MechanismType, key: Key, lib: Pkcs11); - protected init(alg: MechanismType, key: Key): void; - update(text: string): void; - update(data: Buffer): void; - final(signature: Buffer): boolean; - } - - /** - * - * EC - * - */ - - /** - * EcKdf is used to indicate the Key Derivation Function (KDF) - * applied to derive keying data from a shared secret. - * The key derivation function will be used by the EC key agreement schemes. - */ - enum EcKdf { - NULL, - SHA1, - SHA224, - SHA256, - SHA384, - SHA512, - } - - class EcdhParams implements IParams { - /** - * key derivation function used on the shared secret value - */ - kdf: EcKdf; - /** - * some data shared between the two parties - */ - sharedData: Buffer; - /** - * other party's EC public key value - */ - publicData: Buffer; - /** - * @param {EcKdf} kdf key derivation function used on the shared secret value - * @param {Buffer=null} sharedData some data shared between the two parties - * @param {Buffer=null} publicData other party's EC public key value - */ - constructor(kdf: EcKdf, sharedData?: Buffer, publicData?: Buffer); - toCKI(): Buffer; - } - - export interface INamedCurve { - name: string; - oid: string; - value: Buffer; - size: number; - } - - class NamedCurve { - static getByName(name: string): INamedCurve; - static getByOid(oid: string): INamedCurve; - } - - /** - * - * AES - * - */ - - class AesCbcParams implements IParams { - /** - * initialization vector - * - must have a fixed size of 16 bytes - */ - iv: Buffer; - /** - * the data - */ - data: Buffer; - constructor(iv: Buffer, data: Buffer); - toCKI(): Buffer; - } - - class AesCcmParams implements IParams { - /** - * length of the data where 0 <= dataLength < 2^8L - */ - dataLength: number; - /** - * the nonce - */ - nonce: Buffer; - /** - * the additional authentication data - * - This data is authenticated but not encrypted - */ - aad: Buffer; - /** - * length of authentication tag (output following cipher text) in bits. - * - Can be any value between 0 and 128 - */ - macLength: number; - constructor(dataLength: number, nonce: Buffer, aad?: Buffer, macLength?: number); - toCKI(): Buffer; - } - - class AesGcmParams implements IParams { - /** - * initialization vector - * - The length of the initialization vector can be any number between 1 and 256. - * 96-bit (12 byte) IV values can be processed more efficiently, - * so that length is recommended for situations in which efficiency is critical. - */ - iv: Buffer; - /** - * pointer to additional authentication data. - * This data is authenticated but not encrypted. - */ - aad: Buffer; - /** - * length of authentication tag (output following cipher text) in bits. - * Can be any value between 0 and 128. Default 128 - */ - tagBits: number; - constructor(iv: Buffer, aad?: Buffer, tagBits?: number); - toCKI(): Buffer; - } - - /** - * - * RSA - * - */ - - enum RsaMgf { - MGF1_SHA1, - MGF1_SHA224, - MGF1_SHA256, - MGF1_SHA384, - MGF1_SHA512, - } - - class RsaOaepParams implements IParams { - hashAlgorithm: MechanismEnum; - mgf: RsaMgf; - source: number; - sourceData: Buffer; - constructor(hashAlg?: MechanismEnum, mgf?: RsaMgf, sourceData?: Buffer); - toCKI(): Buffer; - } - - class RsaPssParams implements IParams { - /** - * hash algorithm used in the PSS encoding; - * - if the signature mechanism does not include message hashing, - * then this value must be the mechanism used by the application to generate - * the message hash; - * - if the signature mechanism includes hashing, - * then this value must match the hash algorithm indicated - * by the signature mechanism - */ - hashAlgorithm: MechanismEnum; - /** - * mask generation function to use on the encoded block - */ - mgf: RsaMgf; - /** - * length, in bytes, of the salt value used in the PSS encoding; - * - typical values are the length of the message hash and zero - */ - saltLength: number; - constructor(hashAlg?: MechanismEnum, mgf?: RsaMgf, saltLen?: number); - toCKI(): Buffer; - } - } \ No newline at end of file diff --git a/grecaptcha/grecaptcha-tests.ts b/grecaptcha/grecaptcha-tests.ts index cfc86e71b6..b252efb04d 100644 --- a/grecaptcha/grecaptcha-tests.ts +++ b/grecaptcha/grecaptcha-tests.ts @@ -2,8 +2,9 @@ var params: ReCaptchaV2.Parameters = { "sitekey": "mySuperSecretKey", - "theme": "black", // no type-checking here. + "theme": "light", "type": "image", + "size": "normal", "tabindex": 5, "callback": (response: string) => { }, "expired-callback": () => { }, diff --git a/grecaptcha/grecaptcha.d.ts b/grecaptcha/grecaptcha.d.ts index 8e3b744d53..c8f165a8f8 100644 --- a/grecaptcha/grecaptcha.d.ts +++ b/grecaptcha/grecaptcha.d.ts @@ -29,6 +29,10 @@ declare namespace ReCaptchaV2 getResponse(opt_widget_id?: number): string; } + type Theme = "light" | "dark"; + type Type = "image" | "audio"; + type Size = "normal" | "compact"; + interface Parameters { /** @@ -39,14 +43,23 @@ declare namespace ReCaptchaV2 * Optional. The color theme of the widget. * Accepted values: "light", "dark" * @default "light" + * @type {Theme} **/ - theme?: string; + theme?: Theme; /** * Optional. The type of CAPTCHA to serve. - * Accepted values: "audio ", "image" + * Accepted values: "audio", "image" * @default "image" + * @type {Type} **/ - type?: string; + type?: Type; + /** + * Optional. The size of the widget. + * Accepted values: "compact", "normal" + * @default "compact" + * @type {Size} + */ + size?: Size; /** * Optional. The tabindex of the widget and challenge. * If other elements in your page use tabindex, it should be set to make user navigation easier. diff --git a/gregorian-calendar/gregorian-calendar-tests.ts b/gregorian-calendar/gregorian-calendar-tests.ts new file mode 100644 index 0000000000..d364e00fd2 --- /dev/null +++ b/gregorian-calendar/gregorian-calendar-tests.ts @@ -0,0 +1,14 @@ +/// + +import GregorianCalendar = require('gregorian-calendar'); +import GregorianCalendarFormat = require('gregorian-calendar-format'); + + +let cal = new GregorianCalendar(); +cal.set(2016, 7, 27, 0, 0, 0, 0); + +let fmt = new GregorianCalendarFormat('yyyy-MM'); + +let calAsStr = fmt.format(cal); +console.log(calAsStr); + diff --git a/gregorian-calendar/gregorian-calendar.d.ts b/gregorian-calendar/gregorian-calendar.d.ts new file mode 100644 index 0000000000..0bb2ffa934 --- /dev/null +++ b/gregorian-calendar/gregorian-calendar.d.ts @@ -0,0 +1,274 @@ +// Type definitions for gregorian-calendar v4.1.4 +// Project: https://github.com/yiminghe/gregorian-calendar +// Definitions by: Charlie Arnold +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + + +declare module 'gregorian-calendar' { + + class GregorianCalendar { + + constructor(locale?: Object); + + /** + * same as call setYear, setMonth, setDayOfMonth .... + */ + set(year: Number, month: Number, dayOfMonth: Number, + hourOfDay: Number, minutes: Number, seconds: Number, + milliseconds: Number): void; + + /** + * set absolute time for current instance + */ + setTime(time: Number): void; + + /** + * get absolute time for current instance + */ + getTime(): Number; + + /** + * set current date instance's timezone offset (in minutes) + */ + setTimezoneOffset(timezoneOffset: Number): void + + /** + * current date instance's timezone offset (in minutes) + */ + getTimezoneOffset(): Number; + + /** + * set the year of the given calendar field. + */ + setYear(year: Number): void; + + /** + * Returns the year of the given calendar field. + */ + getYear(): Number; + + /** + * set the month of the given calendar field. January is 0, you can use enum + */ + setMonth(month: Number): void; + + /** + * set the month of the given calendar field without influence month. + * 2015-09-29 -> setMonth(2) -> 2015-03-01 + * 2015-09-29 -> rollSetMonth(2) -> 2015-02-28 + */ + rollSetMonth(month: Number): void; + + /** + * Returns the month of the given calendar field. + */ + getMonth(): Number; + + /** + * set the day of month of the given calendar field. + */ + setDayOfMonth(day: Number): void; + + /** + * Returns the day of month of the given calendar field. + */ + getDayOfMonth(): Number; + + + /** + * set the hour of day for the given calendar field. + */ + setHourOfDay(hour: Number): void; + + /** + * Returns the hour of day for the given calendar field. + */ + getHourOfDay(): Number + + /** + * set the minute of the given calendar field. + */ + setMinutes(minute: Number): void; + + /** + * Returns the minute of the given calendar field. + */ + getMinutes(): Number; + + /** + * set the second of the given calendar field. + */ + setSeconds(second: Number): void; + + /** + * Returns the second of the given calendar field. + */ + getSeconds(): Number; + + /** + * set the millisecond of the given calendar field. + */ + setMilliSeconds(second: Number): void; + + /** + * Returns the millisecond of the given calendar field. + */ + getMilliSeconds(): Number; + + /** + * Returns the week of year of the given calendar field. + */ + getWeekOfYear(): Number; + + /** + * Returns the week of month of the given calendar field. + */ + getWeekOfMonth(): Number; + + /** + * Returns the day of year of the given calendar field. + */ + getDayOfYear(): Number; + + /** + * Returns the day of week of the given calendar field. sunday is 0, monday is 1 + */ + getDayOfWeek(): Number; + + /** + * Returns the day of week in month of the given calendar field. + */ + getDayOfWeekInMonth(): Number; + + /** + * add the year of the given calendar field. + */ + addYear(amount: Number): void; + + /** + * add the month of the given calendar field. + */ + addMonth(amount: Number): void; + + /** + * add the day of month of the given calendar field. + */ + addDayOfMonth(amount: Number): void; + + /** + * add the hour of day of the given calendar field. + */ + addHourOfDay(amount: Number): void; + + /** + * add the minute of the given calendar field. + */ + addMinute(amount: Number): void; + + /** + * add the second of the given calendar field. + */ + addSecond(amount: Number): void; + + /** + * add the millisecond of the given calendar field. + */ + addMilliSecond(amount: Number): void; + + /** + * Returns the week number of year represented by this GregorianCalendar. + */ + getWeekYear(): Number; + + /** + * Sets this GregorianCalendar to the date given by the date specifiers - weekYear, weekOfYear, and dayOfWeek. + * weekOfYear follows the WEEK_OF_YEAR numbering. + * The dayOfWeek value must be one of the DAY_OF_WEEK values: SUNDAY to SATURDAY. + * weekYear: the week year + * weekOfYear: the week number based on weekYear + * dayOfWeek: the day of week value + */ + setWeekDate(weekYear: Number, weekOfYear: Number, dayOfWeek: Number): void; + + /** + * Returns the number of weeks in the week year + */ + getWeeksInWeekYear(): Number; + + /** + * Returns a clone of current instance + */ + clone(): GregorianCalendar; + + equals(other: GregorianCalendar): boolean; + + /** + * compare this object and other by day. return -1 0 or 1 + */ + compareToDay(other: GregorianCalendar): Number; + + /** + * clear all field of current instance + */ + clear(): void; + } + + export = GregorianCalendar; +} + +declare module 'gregorian-calendar-format' { + + import GregorianCalendar = require('gregorian-calendar'); + + enum DateTimeStyle { + /** + * full style + */ + FULL = 0, + /** + * long style + */ + LONG, + /** + * medium style + */ + MEDIUM, + /** + * short style + */ + SHORT, + } + + class DateTimeFormat { + + public Style: DateTimeStyle; + + /** + * @param pattern The format pattern string + * @param locale The local of to output (defaults to require('gregorian-calendar/lib/locale/en_US'), + * may also be one of: + * require('gregorian-calendar/lib/locale/zh_CN') + * require('gregorian-calendar/lib/locale/ru_RU') + */ + constructor(pattern: string, locale?: Object); + + /** + * format an instance of GregorianCalendar according to pattern + */ + format(calendar: GregorianCalendar): String; + + /** + * parse a dateString to an instance of GregorianCalendar according to pattern, it's better to specify calendarLocale, such as + * `df.parse('2013-11-12', {locale: require('gregorian-calendar/lib/locale/zh_CN'}));` + */ + parse(dateString: String, {locale: Object}): GregorianCalendar; + + /** + * get a predefine GregorianCalendarFormat instance + */ + getDateTimeInstance(dateStyle: DateTimeStyle, timeStyle: DateTimeStyle, locale?: Object): DateTimeFormat; + } + + export = DateTimeFormat; +} + diff --git a/gridstack/gridstack-tests.ts b/gridstack/gridstack-tests.ts index f084e4f46c..3414230a4a 100644 --- a/gridstack/gridstack-tests.ts +++ b/gridstack/gridstack-tests.ts @@ -12,9 +12,9 @@ var options = { }; var gridstack:GridStack = $(document).gridstack(options); -gridstack.add_widget("test", 1, 2, 3, 4, true); -gridstack.batch_update(); -gridstack.cell_height();; -gridstack.cell_height(2); -gridstack.cell_width(); -gridstack.get_cell_from_pixel({ left:20, top: 20 }); +gridstack.addWidget("test", 1, 2, 3, 4, true); +gridstack.batchUpdate(); +gridstack.cellHeight();; +gridstack.cellHeight(2); +gridstack.cellWidth(); +gridstack.getCellFromPixel({ left:20, top: 20 }); diff --git a/gridstack/gridstack.d.ts b/gridstack/gridstack.d.ts index c69770a1b6..399f25e04b 100644 --- a/gridstack/gridstack.d.ts +++ b/gridstack/gridstack.d.ts @@ -11,35 +11,35 @@ interface GridStack { /** * Creates new widget and returns it. * - * Widget will be always placed even if result height is more than actual grid height. You need to use will_it_fit method before calling add_widget for additional check. + * Widget will be always placed even if result height is more than actual grid height. You need to use willItFit method before calling addWidget for additional check. * * @param {string} el widget to add * @param {number} x widget position x * @param {number} y widget position y * @param {number} width widget dimension width * @param {number} height widget dimension height - * @param {boolean} auto_position if true then x, y parameters will be ignored and widget will be places on the first available position + * @param {boolean} autoPosition if true then x, y parameters will be ignored and widget will be places on the first available position */ - add_widget(el: string, x: number, y: number, width: number, height: number, auto_position: boolean): JQuery + addWidget(el: string, x: number, y: number, width: number, height: number, autoPosition: boolean): JQuery /** * Initializes batch updates. You will see no changes until commit method is called. */ - batch_update():void + batchUpdate():void /** * Gets current cell height. */ - cell_height():number + cellHeight():number /** * Update current cell height. This method rebuilds an internal CSS style sheet. Note: You can expect performance issues if call this method too often. * @param {number} val the cell height */ - cell_height(val:number):void + cellHeight(val:number):void /** * Gets current cell width. */ - cell_width():number + cellWidth():number /** - * Finishes batch updates. Updates DOM nodes. You must call it after batch_update. + * Finishes batch updates. Updates DOM nodes. You must call it after batchUpdate. */ commit():void /** @@ -58,7 +58,7 @@ interface GridStack { * Get the position of the cell under a pixel on screen. * @param {MousePosition} position the position of the pixel to resolve in absolute coordinates, as an object with top and leftproperties */ - get_cell_from_pixel(position: MousePosition): CellPosition, + getCellFromPixel(position: MousePosition): CellPosition, /* * Checks if specified area is empty. * @param {number} x the position x. @@ -66,7 +66,7 @@ interface GridStack { * @param {number} width the width of to check * @param {number} height the height of to check */ - is_area_empty(x: number, y: number, width: number, height: number): void + isAreaEmpty(x: number, y: number, width: number, height: number): void /* * Locks/unlocks widget. * @param {HTMLElement} el widget to modify. @@ -78,13 +78,13 @@ interface GridStack { * @param {HTMLElement} el widget to modify. * @param {number} val A numeric value of the number of columns */ - min_width(el: HTMLElement, val: number): void + minWidth(el: HTMLElement, val: number): void /* * Set the minHeight for a widget. * @param {HTMLElement} el widget to modify. * @param {number} val A numeric value of the number of rows */ - min_height(el: HTMLElement, val: number): void + minHeight(el: HTMLElement, val: number): void /* * Enables/Disables moving. * @param {HTMLElement} el widget to modify. @@ -102,13 +102,13 @@ interface GridStack { /** * Removes widget from the grid. * @param {HTMLElement} el widget to modify - * @param {boolean} detach_node if false DOM node won't be removed from the tree (Optional. Default true). + * @param {boolean} detachNode if false DOM node won't be removed from the tree (Optional. Default true). */ - remove_widget(el: HTMLElement, detach_node?: boolean): void + removeWidget(el: HTMLElement, detachNode?: boolean): void /** * Removes all widgets from the grid. */ - remove_all(): void + removeAll(): void /** * Changes widget size * @param {HTMLElement} el widget to modify @@ -124,9 +124,9 @@ interface GridStack { resizable(el: HTMLElement, val: boolean): void /** * Toggle the grid static state. Also toggle the grid-stack-static class. - * @param {boolean} static_value if true the grid become static. + * @param {boolean} staticValue if true the grid become static. */ - set_static(static_value: boolean): void + setStatic(staticValue: boolean): void /** * Updates widget position/size. * @param {HTMLElement} el widget to modify @@ -142,9 +142,9 @@ interface GridStack { * @param {number} y new position y. If value is null or undefined it will be ignored. * @param {number} width new dimensions width. If value is null or undefined it will be ignored. * @param {number} height new dimensions height. If value is null or undefined it will be ignored. - * @param {boolean} auto_position if true then x, y parameters will be ignored and widget will be places on the first available position + * @param {boolean} autoPosition if true then x, y parameters will be ignored and widget will be places on the first available position */ - will_it_fit(x: number, y: number, width: number, height: number, auto_position:boolean):boolean + willItFit(x: number, y: number, width: number, height: number, autoPosition:boolean):boolean } @@ -181,7 +181,7 @@ interface IGridstackOptions { /** * if true the resizing handles are shown even if the user is not hovering over the widget (default: false) */ - always_show_resize_handle: boolean; + alwaysShowResizeHandle: boolean; /** * turns animation on (default: true) */ @@ -193,7 +193,7 @@ interface IGridstackOptions { /** * one cell height (default: 60) */ - cell_height: number; + cellHeight: number; /** * allows to override jQuery UI draggable options. (default: { handle: '.grid-stack-item-content', scroll: true, appendTo: 'body' }) */ @@ -213,15 +213,15 @@ interface IGridstackOptions { /** * widget class (default: 'grid-stack-item') */ - item_class: string; + itemClass: string; /** * minimal width.If window width is less, grid will be shown in one - column mode (default: 768) */ - min_width: number; + minWidth: number; /** * class for placeholder (default: 'grid-stack-placeholder') */ - placeholder_class: string; + placeholderClass: string; /** * allows to override jQuery UI resizable options. (default: { autoHide: true, handles: 'se' }) */ @@ -229,11 +229,11 @@ interface IGridstackOptions { /** * makes grid static (default false).If true widgets are not movable/ resizable.You don't even need jQueryUI draggable/resizable. A CSS class grid-stack-static is also added to the container. */ - static_grid: boolean; + staticGrid: boolean; /** * vertical gap size (default: 20) */ - vertical_margin: number; + verticalMargin: number; /** * amount of columns (default: 12) */ diff --git a/gruntjs/gruntjs.d.ts b/gruntjs/gruntjs.d.ts index 410ed10ab0..0a8e4d9d5a 100644 --- a/gruntjs/gruntjs.d.ts +++ b/gruntjs/gruntjs.d.ts @@ -773,6 +773,7 @@ declare namespace grunt { * The taskList argument must be an array of tasks. */ registerTask(taskName: string, taskList: string[]): void + registerTask(taskName: string, description: string, taskList: string[]): void /** * If a description and taskFunction are passed, the specified function will be executed @@ -784,6 +785,7 @@ declare namespace grunt { * * @note taskFunction.apply(scope: grunt.task.ITask, args: any[]) */ + registerTask(taskName: string, taskFunction: Function): void registerTask(taskName: string, description: string, taskFunction: Function): void /** diff --git a/gulp-help-doc/gulp-help-doc-tests.ts b/gulp-help-doc/gulp-help-doc-tests.ts new file mode 100644 index 0000000000..f06c25e55c --- /dev/null +++ b/gulp-help-doc/gulp-help-doc-tests.ts @@ -0,0 +1,27 @@ +/// +/// +/// + +import gulp = require('gulp'); +import usage = require('gulp-help-doc'); + +/** + * Demo task + * + * @task {demo} + * @arg {env} environment + */ +gulp.task('demo', function() {}); + +let logger: { + output: string, + log(msg: string): any +} = { + output: '', + log: msg => logger.output += msg + '\n' +}; + +usage(gulp, { + logger: logger, + gulpfile: __filename +}).then(() => console.log(logger.output)); diff --git a/gulp-help-doc/gulp-help-doc.d.ts b/gulp-help-doc/gulp-help-doc.d.ts new file mode 100644 index 0000000000..80d4922774 --- /dev/null +++ b/gulp-help-doc/gulp-help-doc.d.ts @@ -0,0 +1,56 @@ +// Type definitions for gulp-help-doc +// Project: https://github.com/Mikhus/gulp-help-doc +// Definitions by: Mikhus +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// + +declare module "gulp-help-doc" { + + import gulp = require('gulp'); + + namespace usage { + + interface UsageOptions { + /** + * Defines max line width for the printed output lines + * (by default is 80 characters long) + */ + lineWidth?: number, + + /** + * Defines max width of the column width tasks or args names + * (by default is 20 characters long) + */ + keysColumnWidth?: number, + + /** + * Defines number of empty characters for left-padding of the output + */ + padding?: number, + + /** + * Printing engine (by default is console). Accepted any device + * which has log() function defined to do output. + */ + logger?: { log: Function }, + + /** + * Path to a gulpfile (default is gulpfile.js) + * Normally, there is no need to change this option. It may be used + * for some special cases, like mocking gulpfile for testing. + */ + gulpfile?: string + } + + interface Usage { + (gulp: gulp.Gulp, options?: UsageOptions): Promise + } + + } + + var usage: usage.Usage; + + export = usage; +} diff --git a/gulp-insert/gulp-insert-tests.ts b/gulp-insert/gulp-insert-tests.ts new file mode 100644 index 0000000000..e420cf5e4a --- /dev/null +++ b/gulp-insert/gulp-insert-tests.ts @@ -0,0 +1,21 @@ +/// +/// + +import * as gulp from 'gulp'; +import * as insert from 'gulp-insert'; + +gulp.task('gulp-insert-tests', () => { + return gulp.src('*.js') + .pipe(insert.prepend('/* Inserted using gulp-insert prepend method */\n')) + .pipe(insert.prepend('\n/* Inserted using gulp-insert append method */')) + .pipe(insert.wrap( + '/* Inserted using gulp-insert wrap method */\n', + '\n/* Inserted using gulp-insert wrap method */' + )) + .pipe(insert.transform((contents, file) => { + var comment = '/* Local file: ' + file.path + ' */\n'; + return comment + contents; + })) + .pipe(gulp.dest('gulp-insert')); +}); + diff --git a/gulp-insert/gulp-insert.d.ts b/gulp-insert/gulp-insert.d.ts new file mode 100644 index 0000000000..9777280d5b --- /dev/null +++ b/gulp-insert/gulp-insert.d.ts @@ -0,0 +1,52 @@ +// Type definitions for gulp-insert 0.5.0 +// Project: https://github.com/rschmukler/gulp-insert +// Definitions by: Shant Marouti +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// + +declare module 'gulp-insert' { + + import File = require('vinyl'); + + interface Transformer { + (contents: string, file: File): string + } + + namespace Insert { + + /** + * Prepends a string onto the contents + * @param {string} content + * @returns {NodeJS.ReadWriteStream} + */ + function prepend(content: string): NodeJS.ReadWriteStream; + + /** + * Appends a string onto the contents + * @param {string} content + * @returns {NodeJS.ReadWriteStream} + */ + function append(content: string): NodeJS.ReadWriteStream; + + /** + * Wraps the contents with two strings + * @param {string} prepend + * @param {string} append + * @returns {NodeJS.ReadWriteStream} + */ + function wrap(prepend: string, append: string): NodeJS.ReadWriteStream; + + /** + * Calls a function with the contents of the file + * @param {Transformer} transformer + * @returns {NodeJS.ReadWriteStream} + */ + function transform(transformer: Transformer): NodeJS.ReadWriteStream; + + } + + module Insert { } + export = Insert; +} \ No newline at end of file diff --git a/gulp/gulp.d.ts b/gulp/gulp.d.ts index 43bb5aa597..74968ddcc5 100644 --- a/gulp/gulp.d.ts +++ b/gulp/gulp.d.ts @@ -149,6 +149,11 @@ declare module "gulp" { * Note that an explicit dot in a portion of the pattern will always match dot files. */ dot?: boolean; + + /** + * Set to match only fles, not directories. Set this flag to prevent copying empty directories + */ + nodir?: boolean; /** * By default, a pattern starting with a forward-slash will be "mounted" onto the root setting, so that a valid diff --git a/hammerjs/hammerjs.d.ts b/hammerjs/hammerjs.d.ts index 80487c134c..faba777b7a 100644 --- a/hammerjs/hammerjs.d.ts +++ b/hammerjs/hammerjs.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Hammer.js 2.0.4 +// Type definitions for Hammer.js 2.0.8 // Project: http://hammerjs.github.io/ // Definitions by: Philip Bulley , Han Lin Yap // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -11,7 +11,7 @@ declare module "hammerjs" { interface HammerStatic { - new( element:HTMLElement | SVGElement, options?:any ): HammerManager; + new( element:HTMLElement | SVGElement, options?:HammerOptions ): HammerManager; defaults:HammerDefaults; @@ -39,7 +39,7 @@ interface HammerStatic DIRECTION_VERTICAL: number; DIRECTION_ALL: number; - Manager: HammerManager; + Manager: HammerManagerConstructor; Input: HammerInput; TouchAction: TouchAction; @@ -68,16 +68,22 @@ interface HammerStatic prefixed( obj:any, property:string ):string; } -interface HammerDefaults +type RecognizerTuple = + [RecognizerStatic] + | [RecognizerStatic, RecognizerOptions] + | [RecognizerStatic, RecognizerOptions, string | string[]] + | [RecognizerStatic, RecognizerOptions, string | string[], (string | Recognizer) | (string | Recognizer)[]]; + +interface HammerDefaults extends HammerOptions { domEvents:boolean; enable:boolean; - preset:any[]; + preset:RecognizerTuple[]; touchAction:string; cssProps:CssProps; - inputClass():void; - inputTarget():void; + inputClass:() => void; + inputTarget:EventTarget; } interface CssProps @@ -90,15 +96,29 @@ interface CssProps userSelect:string; } -interface HammerOptions extends HammerDefaults +interface HammerOptions { + cssProps?:CssProps; + domEvents?:boolean; + enable?:boolean | ((manager: HammerManager) => boolean); + preset?:RecognizerTuple[]; + touchAction?:string; + recognizers?:RecognizerTuple[]; + inputClass?:() => void; + inputTarget?:EventTarget; +} + +interface HammerManagerConstructor { + new( element:EventTarget, options?:HammerOptions ):HammerManager; +} + +interface HammerListener { + (event:HammerInput): void } interface HammerManager { - new( element:HTMLElement, options?:any ):HammerManager; - add( recogniser:Recognizer ):Recognizer; add( recogniser:Recognizer ):HammerManager; add( recogniser:Recognizer[] ):Recognizer; @@ -107,8 +127,8 @@ interface HammerManager emit( event:string, data:any ):void; get( recogniser:Recognizer ):Recognizer; get( recogniser:string ):Recognizer; - off( events:string, handler?:( event:HammerInput ) => void ):void; - on( events:string, handler:( event:HammerInput ) => void ):void; + off( events:string, handler?:HammerListener ):void; + on( events:string, handler:HammerListener ):void; recognize( inputData:any ):void; remove( recogniser:Recognizer ):HammerManager; remove( recogniser:string ):HammerManager; @@ -155,7 +175,7 @@ declare class HammerInput direction:number; /** Direction moved from it's starting point. Matches the DIRECTION constants. */ - offsetDirection:string; + offsetDirection:number; /** Scaling that has been done when multi-touch. 1 on a single touch. */ scale:number; @@ -176,7 +196,7 @@ declare class HammerInput pointerType:string; /** Event type, matches the INPUT constants. */ - eventType:string; + eventType:number; /** true when the first input. */ isFirst:boolean; @@ -219,9 +239,22 @@ declare class TouchMouseInput extends HammerInput constructor( manager:HammerManager, callback:Function ); } +interface RecognizerOptions { + direction?: number; + enable?: boolean | ((recognizer: Recognizer, inputData: HammerInput) => boolean); + event?: string; + interval?: number; + pointers?: number; + posThreshold?: number; + taps?: number + threshold?: number; + time?: number; + velocity?: number; +} + interface RecognizerStatic { - new( options?:any ):Recognizer; + new( options?:RecognizerOptions ):Recognizer; } interface Recognizer @@ -244,7 +277,7 @@ interface Recognizer requireFailure( otherRecognizer:Recognizer ):Recognizer; requireFailure( otherRecognizer:string ):Recognizer; reset():void; - set( options?:any ):Recognizer; + set( options?:RecognizerOptions ):Recognizer; tryEmit( input:HammerInput ):void; } @@ -256,12 +289,12 @@ interface AttrRecognizerStatic interface AttrRecognizer extends Recognizer { - new( options?:any ):AttrRecognizer; + new( options?:RecognizerOptions ):AttrRecognizer; } interface PanRecognizerStatic { - new( options?:any ):PanRecognizer; + new( options?:RecognizerOptions ):PanRecognizer; } interface PanRecognizer extends AttrRecognizer @@ -270,7 +303,7 @@ interface PanRecognizer extends AttrRecognizer interface PinchRecognizerStatic { - new( options?:any ):PinchRecognizer; + new( options?:RecognizerOptions ):PinchRecognizer; } interface PinchRecognizer extends AttrRecognizer @@ -279,7 +312,7 @@ interface PinchRecognizer extends AttrRecognizer interface PressRecognizerStatic { - new( options?:any ):PressRecognizer; + new( options?:RecognizerOptions ):PressRecognizer; } interface PressRecognizer extends AttrRecognizer @@ -288,7 +321,7 @@ interface PressRecognizer extends AttrRecognizer interface RotateRecognizerStatic { - new( options?:any ):RotateRecognizer; + new( options?:RecognizerOptions ):RotateRecognizer; } interface RotateRecognizer extends AttrRecognizer @@ -297,7 +330,7 @@ interface RotateRecognizer extends AttrRecognizer interface SwipeRecognizerStatic { - new( options?:any ):SwipeRecognizer; + new( options?:RecognizerOptions ):SwipeRecognizer; } interface SwipeRecognizer extends AttrRecognizer @@ -306,7 +339,7 @@ interface SwipeRecognizer extends AttrRecognizer interface TapRecognizerStatic { - new( options?:any ):TapRecognizer; + new( options?:RecognizerOptions ):TapRecognizer; } interface TapRecognizer extends AttrRecognizer diff --git a/handlebars/handlebars.d.ts b/handlebars/handlebars.d.ts index 0af3d6f6e7..96b0491040 100644 --- a/handlebars/handlebars.d.ts +++ b/handlebars/handlebars.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Handlebars v3.0.3 +// Type definitions for Handlebars v4.0.5 // Project: http://handlebarsjs.com/ // Definitions by: Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -15,14 +15,25 @@ declare namespace Handlebars { export function Exception(message: string): void; export function log(level: number, obj: any): void; export function parse(input: string): hbs.AST.Program; - export function compile(input: any, options?: any): HandlebarsTemplateDelegate; + export function compile(input: any, options?: CompileOptions): HandlebarsTemplateDelegate; + export function precompile(input: any, options?: PrecompileOptions): TemplateSpecification; + export function template(precompilation: TemplateSpecification): HandlebarsTemplateDelegate; + + export function create(): typeof Handlebars; export var SafeString: typeof hbs.SafeString; + export var escapeExpression: typeof hbs.Utils.escapeExpression; export var Utils: typeof hbs.Utils; export var logger: Logger; export var templates: HandlebarsTemplates; export var helpers: any; + export function registerDecorator(name: string, fn: Function): void; + export function registerDecorator(obj: {[name: string] : Function}): void; + export function unregisterDecorator(name: string): void; + + export function noConflict(): typeof Handlebars; + export module AST { export var helpers: hbs.AST.helpers; } @@ -32,6 +43,9 @@ declare namespace Handlebars { Program(program: hbs.AST.Program): void; BlockStatement(block: hbs.AST.BlockStatement): void; PartialStatement(partial: hbs.AST.PartialStatement): void; + PartialBlockStatement(partial: hbs.AST.PartialBlockStatement): void; + DecoratorBlock(decorator: hbs.AST.DecoratorBlock): void; + Decorator(decorator: hbs.AST.Decorator): void; MustacheStatement(mustache: hbs.AST.MustacheStatement): void; ContentStatement(content: hbs.AST.ContentStatement): void; CommentStatement(comment?: hbs.AST.CommentStatement): void; @@ -52,6 +66,9 @@ declare namespace Handlebars { Program(program: hbs.AST.Program): void; BlockStatement(block: hbs.AST.BlockStatement): void; PartialStatement(partial: hbs.AST.PartialStatement): void; + PartialBlockStatement(partial: hbs.AST.PartialBlockStatement): void; + DecoratorBlock(decorator: hbs.AST.DecoratorBlock): void; + Decorator(decorator: hbs.AST.Decorator): void; MustacheStatement(mustache: hbs.AST.MustacheStatement): void; ContentStatement(content: hbs.AST.ContentStatement): void; CommentStatement(comment?: hbs.AST.CommentStatement): void; @@ -81,6 +98,37 @@ interface HandlebarsTemplates { [index: string]: HandlebarsTemplateDelegate; } +interface TemplateSpecification { + +} + +interface CompileOptions { + data?: boolean; + compat?: boolean; + knownHelpers?: { + helperMissing?: boolean; + blockHelperMissing?: boolean; + each?: boolean; + if?: boolean; + unless?: boolean; + with?: boolean; + log?: boolean; + lookup?: boolean; + } + knownHelpersOnly?: boolean; + noEscape?: boolean; + strict?: boolean; + assumeObjects?: boolean; + preventIndent?: boolean; + ignoreStandalone?: boolean; + explicitPartialContext?: boolean; +} + +interface PrecompileOptions extends CompileOptions { + srcName?: string; + destName?: string; +} + declare namespace hbs { class SafeString { constructor(str: string); @@ -89,6 +137,12 @@ declare namespace hbs { namespace Utils { function escapeExpression(str: string): string; + function createFrame(obj: Object): Object; + function isEmpty(obj: any) : boolean; + function extend(obj: any, ...source: any[]): any; + function toString(obj: any): string; + function isArray(obj: any): boolean; + function isFunction(obj: any): boolean; } } @@ -137,6 +191,8 @@ declare namespace hbs { strip: StripFlags; } + interface Decorator extends MustacheStatement { } + interface BlockStatement extends Statement { path: PathExpression; params: Expression[]; @@ -148,6 +204,8 @@ declare namespace hbs { closeStrip: StripFlags; } + interface DecoratorBlock extends BlockStatement { } + interface PartialStatement extends Statement { name: PathExpression | SubExpression; params: Expression[]; @@ -156,6 +214,15 @@ declare namespace hbs { strip: StripFlags; } + interface PartialBlockStatement extends Statement { + name: PathExpression | SubExpression; + params: Expression[], + hash: Hash, + program: Program, + openStrip: StripFlags, + closeStrip: StripFlags + } + interface ContentStatement extends Statement { value: string; original: StripFlags; diff --git a/handsontable/handsontable-tests.ts b/handsontable/handsontable-tests.ts index 25ec4dee0f..318038967a 100644 --- a/handsontable/handsontable-tests.ts +++ b/handsontable/handsontable-tests.ts @@ -120,6 +120,88 @@ function test_HandsontableInit() { visibleRows: 123, width: 1232, wordWrap: true, + + // Hooks + afterAutofillApplyValues: function() {}, + afterCellMetaReset: function() {}, + afterChange: function() {}, + afterChangesObserved: function() {}, + afterColumnMove: function() {}, + afterColumnResize: function() {}, + afterColumnSort: function() {}, + afterContextMenuDefaultOptions: function() {}, + afterContextMenuHide: function() {}, + afterContextMenuShow: function() {}, + afterCopyLimit: function() {}, + afterCreateCol: function() {}, + afterCreateRow: function() {}, + afterDeselect: function() {}, + afterDestroy: function() {}, + afterDocumentKeyDown: function() {}, + afterFilter: function() {}, + afterGetCellMeta: function() {}, + afterGetColHeader: function() {}, + afterGetColumnHeaderRenderers: function() {}, + afterGetRowHeader: function() {}, + afterGetRowHeaderRenderers: function() {}, + afterInit: function() {}, + afterLoadData: function() {}, + afterMomentumScroll: function() {}, + afterOnCellCornerMouseDown: function() {}, + afterOnCellMouseDown: function() {}, + afterOnCellMouseOver: function() {}, + afterRemoveCol: function() {}, + afterRemoveRow: function() {}, + afterRender: function() {}, + afterRenderer: function() {}, + afterRowMove: function() {}, + afterRowResize: function() {}, + afterScrollHorizontally: function() {}, + afterScrollVertically: function() {}, + afterSelection: function() {}, + afterSelectionByProp: function() {}, + afterSelectionEnd: function() {}, + afterSelectionEndByProp: function() {}, + afterSetCellMeta: function() {}, + afterUpdateSettings: function() {}, + afterValidate: function() {}, + beforeAutofill: function() {}, + beforeCellAlignment: function() {}, + beforeChange: function() {}, + beforeChangeRender: function() {}, + beforeColumnMove: function() {}, + beforeColumnResize: function() {}, + beforeColumnSort: function() {}, + beforeDrawBorders: function() {}, + beforeFilter: function() {}, + beforeGetCellMeta: function() {}, + beforeInit: function() {}, + beforeInitWalkontable: function() {}, + beforeKeyDown: function() {}, + beforeOnCellMouseDown: function() {}, + beforeRemoveCol: function() {}, + beforeRemoveRow: function() {}, + beforeRender: function() {}, + beforeRenderer: function() {}, + beforeRowMove: function() {}, + beforeRowResize: function() {}, + beforeSetRangeEnd: function() {}, + beforeStretchingColumnWidth: function() {}, + beforeTouchScroll: function() {}, + beforeValidate: function() {}, + construct: function() {}, + init: function() {}, + modifyCol: function() {}, + modifyColHeader: function() {}, + modifyColWidth: function() {}, + modifyCopyableRange: function() {}, + modifyRow: function() {}, + modifyRowHeader: function() {}, + modifyRowHeight: function() {}, + persistentStateLoad: function() {}, + persistentStateReset: function() {}, + persistentStateSave: function() {}, + unmodifyCol: function() {} }); } diff --git a/handsontable/handsontable.d.ts b/handsontable/handsontable.d.ts index 9c7f87aaa3..7a82509baa 100644 --- a/handsontable/handsontable.d.ts +++ b/handsontable/handsontable.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Handsontable 0.24.1 +// Type definitions for Handsontable 0.24.3 // Project: https://handsontable.com/ // Definitions by: Handsoncode sp. z o.o. // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped\ @@ -124,6 +124,88 @@ declare namespace ht { wordWrap?: boolean; isEmptyCol?: (col: number) => boolean; isEmptyRow?: (row: number) => boolean; + + // hooks + afterAutofillApplyValues?: (startArea: any[], entireArea: any[]) => void; + afterCellMetaReset?: () => void; + afterChange?: (changes: any[], source: string) => void; + afterChangesObserved?: () => void; + afterColumnMove?: (startColumn: number, endColumn: number) => void; + afterColumnResize?: (currentColumn: number, newSize: number, isDoubleClick: boolean) => void; + afterColumnSort?: (column: number, order: boolean) => void; + afterContextMenuDefaultOptions?: (predefinedItems: any[]) => void; + afterContextMenuHide?: (context: Object) => void; + afterContextMenuShow?: (context: Object) => void; + afterCopyLimit?: (selectedRows: number, selectedColumnds: number, copyRowsLimit: number, copyColumnsLimit: number) => void; + afterCreateCol?: (index: number, amount: number) => void; + afterCreateRow?: (index: number, amount: number) => void; + afterDeselect?: () => void; + afterDestroy?: () => void; + afterDocumentKeyDown?: (event: Event) => void; + afterFilter?: (formulasStack: any[]) => void; + afterGetCellMeta?: (row: number, col: number, cellProperties: Object) => void; + afterGetColHeader?: (col: number, TH: Element) => void; + afterGetColumnHeaderRenderers?: (array: any[]) => void; + afterGetRowHeader?: (row: number, TH: Element) => void; + afterGetRowHeaderRenderers?: (array: any[]) => void; + afterInit?: () => void; + afterLoadData?: (firstTime: boolean) => void; + afterMomentumScroll?: () => void; + afterOnCellCornerMouseDown?: (event: Object) => void; + afterOnCellMouseDown?: (event: Object, coords: Object, TD: Element) => void; + afterOnCellMouseOver?: (event: Object, coords: Object, TD: Element) => void; + afterRemoveCol?: (index: number, amount: number) => void; + afterRemoveRow?: (index: number, amount: number) => void; + afterRender?: (isForced: boolean) => void; + afterRenderer?: (TD: Element, row: number, col: number, prop: string|number, value: string, cellProperties: Object) => void; + afterRowMove?: (startRow: number, endRow: number) => void; + afterRowResize?: (currentRow: number, newSize: number, isDoubleClick: boolean) => void; + afterScrollHorizontally?: () => void; + afterScrollVertically?: () => void; + afterSelection?: (r: number, c: number, r2: number, c2: number) => void; + afterSelectionByProp?: (r: number, p: string, r2: number, p2: string) => void; + afterSelectionEnd?: (r: number, c: number, r2: number, c2: number) => void; + afterSelectionEndByProp?: (r: number, p: string, r2: number, p2: string) => void; + afterSetCellMeta?: (row: number, col: number, key: string, value: any) => void; + afterUpdateSettings?: () => void; + afterValidate?: (isValid: boolean, value: any, row: number, prop: string|number, source: string) => void|boolean; + beforeAutofill?: (start: Object, end: Object, data: any[]) => void; + beforeCellAlignment?: (stateBefore: any, range: any, type: string, alignmentClass: string) => void; + beforeChange?: (changes: any[], source: string) => void; + beforeChangeRender?: (changes: any[], source: string) => void; + beforeColumnMove?: (startColumn: number, endColumn: number) => void; + beforeColumnResize?: (currentColumn: number, newSize: number, isDoubleClick: boolean) => void; + beforeColumnSort?: (column: number, order: boolean) => void; + beforeDrawBorders?: (corners: any[], borderClassName: string) => void; + beforeFilter?: (formulasStack: any[]) => void; + beforeGetCellMeta?: (row: number, col: number, cellProperties: Object) => void; + beforeInit?: () => void; + beforeInitWalkontable?: (walkontableConfig: Object) => void; + beforeKeyDown?: (event: Event) => void; + beforeOnCellMouseDown?: (event: Event, coords: Object, TD: Element) => void; + beforeRemoveCol?: (index: number, amount: number, logicalCols?: any[]) => void; + beforeRemoveRow?: (index: number, amount: number, logicalRows?: any[]) => void; + beforeRender?: (isForced: boolean) => void; + beforeRenderer?: (TD: Element, row: number, col: number, prop: string|number, value: string, cellProperties: Object) => void; + beforeRowMove?: (startRow: number, endRow: number) => void; + beforeRowResize?: (currentRow: number, newSize: number, isDoubleClick: boolean) => any; + beforeSetRangeEnd?: (coords: any[]) => void; + beforeStretchingColumnWidth?: (stretchedWidth: number, column: number) => void; + beforeTouchScroll?: () => void; + beforeValidate?: (value: any, row: number, prop: string|number, source: string) => void; + construct?: () => void; + init?: () => void; + modifyCol?: (col: number) => void; + modifyColHeader?: (column: number) => void; + modifyColWidth?: (width: number, col: number) => void; + modifyCopyableRange?: (copyableRanges: any[]) => void; + modifyRow?: (row: number) => void; + modifyRowHeader?: (row: number) => void; + modifyRowHeight?: (height: number, row: number) => void; + persistentStateLoad?: (key: string, valuePlaceholder: Object) => void; + persistentStateReset?: (key: string) => void; + persistentStateSave?: (key: string, value: any) => void; + unmodifyCol?: (col: number) => void; } interface Methods { addHook(key: string, callback: Function|any[]): void; @@ -150,7 +232,7 @@ declare namespace ht { getCellMeta(row: number, col: number): Object; getCellRenderer(row: number, col: number): Function; getCellValidator(row: number, col: number): any; - getColHeader(col: number): any[]|string; + getColHeader(col?: number): any[]|string; getColWidth(col: number): number; getCoords(elem: Element): Object; getCopyableData(row: number, column: number): string; @@ -203,6 +285,8 @@ declare namespace ht { validateCells(callback: Function): void; } } + + declare var Handsontable: { new (element: Element, options: ht.Options): ht.Methods; }; diff --git a/hapi/hapi-8.2.0.d.ts b/hapi/hapi-8.2.0.d.ts index d205ade2bc..ef81b4fba3 100644 --- a/hapi/hapi-8.2.0.d.ts +++ b/hapi/hapi-8.2.0.d.ts @@ -221,21 +221,7 @@ declare module "hapi" { defaultExtension?: string; } - /** Concludes the handler activity by setting a response and returning control over to the framework where: - erran optional error response. - resultan optional response payload. - Since an request can only have one response regardless if it is an error or success, the reply() method can only result in a single response value. This means that passing both an err and result will only use the err. There is no requirement for either err or result to be (or not) an Error object. The framework will simply use the first argument if present, otherwise the second. The method supports two arguments to be compatible with the common callback pattern of error first. - FLOW CONTROL: - When calling reply(), the framework waits until process.nextTick() to continue processing the request and transmit the response. This enables making changes to the returned response object before the response is sent. This means the framework will resume as soon as the handler method exits. To suspend this behavior, the returned response object supports the following methods: hold(), send() */ - export interface IReply { - (err: Error, - result?: string|number|boolean|Buffer|stream.Stream | Promise | T, - /** Note that when used to return both an error and credentials in the authentication methods, reply() must be called with three arguments function(err, null, data) where data is the additional authentication information. */ - credentialData?: any - ): IBoom; - /** Note that if result is a Stream with a statusCode property, that status code will be used as the default response code. */ - (result?: string|number|boolean|Buffer|stream.Stream | Promise | T): Response; - + interface IReplyMethods { /** Returns control back to the framework without setting a response. If called in the handler, the response defaults to an empty payload with status code 200. * The data argument is only used for passing back authentication data and is ignored elsewhere. */ continue(credentialData?: any): void; @@ -282,8 +268,39 @@ declare module "hapi" { redirect(uri: string): Response; } + /** Concludes the handler activity by setting a response and returning control over to the framework where: + erran optional error response. + resultan optional response payload. + Since an request can only have one response regardless if it is an error or success, the reply() method can only result in a single response value. This means that passing both an err and result will only use the err. There is no requirement for either err or result to be (or not) an Error object. The framework will simply use the first argument if present, otherwise the second. The method supports two arguments to be compatible with the common callback pattern of error first. + FLOW CONTROL: + When calling reply(), the framework waits until process.nextTick() to continue processing the request and transmit the response. This enables making changes to the returned response object before the response is sent. This means the framework will resume as soon as the handler method exits. To suspend this behavior, the returned response object supports the following methods: hold(), send() */ + export interface IReply extends IReplyMethods{ + (err: Error, + result?: string|number|boolean|Buffer|stream.Stream | Promise | T, + /** Note that when used to return both an error and credentials in the authentication methods, reply() must be called with three arguments function(err, null, data) where data is the additional authentication information. */ + credentialData?: any + ): IBoom; + /** Note that if result is a Stream with a statusCode property, that status code will be used as the default response code. */ + (result?: string|number|boolean|Buffer|stream.Stream | Promise | T): Response; + } + + /** Concludes the handler activity by setting a response and returning control over to the framework where: + erran optional error response. + result an optional response payload. + Since an request can only have one response regardless if it is an error or success, the reply() method can only result in a single response value. This means that passing both an err and result will only use the err. There is no requirement for either err or result to be (or not) an Error object. The framework will simply use the first argument if present, otherwise the second. The method supports two arguments to be compatible with the common callback pattern of error first. + FLOW CONTROL: + When calling reply(), the framework waits until process.nextTick() to continue processing the request and transmit the response. This enables making changes to the returned response object before the response is sent. This means the framework will resume as soon as the handler method exits. To suspend this behavior, the returned response object supports the following methods: hold(), send() */ + export interface IStrictReply extends IReplyMethods { + (err: Error, + result?: Promise | T, + /** Note that when used to return both an error and credentials in the authentication methods, reply() must be called with three arguments function(err, null, data) where data is the additional authentication information. */ + credentialData?: any): IBoom; + /** Note that if result is a Stream with a statusCode property, that status code will be used as the default response code. */ + (result: Promise | T): Response; + } export interface ISessionHandler { (request: Request, reply: IReply): void; + (request: Request, reply: IStrictReply): void; } export interface IRequestHandler { (request: Request): T; @@ -868,6 +885,7 @@ declare module "hapi" { }; server.auth.scheme('custom', scheme);*/ authenticate(request: Request, reply: IReply): void; + authenticate(request: Request, reply: IStrictReply): void; /** payload(request, reply) - optional function called to authenticate the request payload where: request - the request object. reply(err, response) - is called if authentication failed where: @@ -876,6 +894,7 @@ declare module "hapi" { reply.continue() - is called if payload authentication succeeded. When the scheme payload() method returns an error with a message, it means payload validation failed due to bad payload. If the error has no message but includes a scheme name (e.g. Boom.unauthorized(null, 'Custom')), authentication may still be successful if the route auth.payload configuration is set to 'optional'.*/ payload? (request: Request, reply: IReply): void; + payload?(request: Request, reply: IStrictReply): void; /** response(request, reply) - optional function called to decorate the response with authentication headers before the response headers or payload is written where: request - the request object. reply(err, response) - is called if an error occurred where: @@ -883,6 +902,7 @@ declare module "hapi" { response - any authentication response to send instead of the current response. Ignored if err is present, otherwise required. reply.continue() - is called if the operation succeeded.*/ response? (request: Request, reply: IReply): void; + response?(request: Request, reply: IStrictReply): void; /** an optional object */ options?: { /** if true, requires payload validation as part of the scheme and forbids routes from disabling payload auth validation. Defaults to false.*/ @@ -1830,6 +1850,7 @@ declare module "hapi" { server.start(); // All requests will get routed to '/test'*/ ext(event: string, method: (request: Request, reply: IReply, bind?: any) => void, options?: { before: string|string[]; after: string|string[]; bind?: any }): void; + ext(event: string, method: (request: Request, reply: IStrictReply, bind?: any) => void, options?: { before: string | string[]; after: string | string[]; bind?: any }): void; /** server.handler(name, method) Registers a new handler type to be used in routes where: diff --git a/hapi/hapi-tests-8.2.0.ts b/hapi/hapi-tests-8.2.0.ts index c61504f0fc..e26ce193bc 100644 --- a/hapi/hapi-tests-8.2.0.ts +++ b/hapi/hapi-tests-8.2.0.ts @@ -104,5 +104,25 @@ server.route([{ } }]); +server.route([{ + method: 'GET', + path: '/hello4', + handler: function (request: Hapi.Request, reply: Hapi.IReply) { + reply('hello world2'); + } +}]); + +interface IHello { + msg: string +} + +server.route([{ + method: 'GET', + path: '/hello5', + handler: function (request: Hapi.Request, reply: Hapi.IStrictReply) { + reply({ msg: 'hello world' }) + } +}]); + // Start the server server.start(); diff --git a/hapi/hapi-tests.ts b/hapi/hapi-tests.ts index d45c03549a..3288618816 100644 --- a/hapi/hapi-tests.ts +++ b/hapi/hapi-tests.ts @@ -79,6 +79,7 @@ server.route({ method: 'GET', path: '/hello', handler: function (request: Hapi.Request, reply: Function) { + request.log('info', { route: '/hello' }, Date.now()); reply('hello world'); } }); @@ -91,6 +92,26 @@ server.route([{ } }]); +server.route([{ + method: 'GET', + path: '/hello3', + handler: function (request: Hapi.Request, reply: Hapi.IReply) { + reply('hello world2'); + } +}]); + +interface IHello { + msg: string +} + +server.route([{ + method: 'GET', + path: '/hello4', + handler: function (request: Hapi.Request, reply: Hapi.IStrictReply) { + reply({ msg: 'hello world' }) + } +}]); + // config.validate parameters should be optional server.route([{ method: 'GET', diff --git a/hapi/hapi.d.ts b/hapi/hapi.d.ts index 9962dd6c62..68f6857110 100644 --- a/hapi/hapi.d.ts +++ b/hapi/hapi.d.ts @@ -240,21 +240,9 @@ declare module "hapi" { /** defines the default filename extension to append to template names when multiple engines are configured and not explicit extension is provided for a given template. No default value.*/ defaultExtension?: string; } - - /** Concludes the handler activity by setting a response and returning control over to the framework where: - erran optional error response. - resultan optional response payload. - Since an request can only have one response regardless if it is an error or success, the reply() method can only result in a single response value. This means that passing both an err and result will only use the err. There is no requirement for either err or result to be (or not) an Error object. The framework will simply use the first argument if present, otherwise the second. The method supports two arguments to be compatible with the common callback pattern of error first. - FLOW CONTROL: - When calling reply(), the framework waits until process.nextTick() to continue processing the request and transmit the response. This enables making changes to the returned response object before the response is sent. This means the framework will resume as soon as the handler method exits. To suspend this behavior, the returned response object supports the following methods: hold(), send() */ - export interface IReply { - (err: Error, - result?: string | number | boolean | Buffer | stream.Stream | IPromise | T, - /** Note that when used to return both an error and credentials in the authentication methods, reply() must be called with three arguments function(err, null, data) where data is the additional authentication information. */ - credentialData?: any): IBoom; - /** Note that if result is a Stream with a statusCode property, that status code will be used as the default response code. */ - (result: string | number | boolean | Buffer | stream.Stream | IPromise | T): Response; - + + + interface IReplyMethods { /** Returns control back to the framework without setting a response. If called in the handler, the response defaults to an empty payload with status code 200. * The data argument is only used for passing back authentication data and is ignored elsewhere. */ continue(credentialData?: any): void; @@ -310,8 +298,39 @@ declare module "hapi" { unstate(name: string, options?: any): void; } + /** Concludes the handler activity by setting a response and returning control over to the framework where: + erran optional error response. + result an optional response payload. + Since an request can only have one response regardless if it is an error or success, the reply() method can only result in a single response value. This means that passing both an err and result will only use the err. There is no requirement for either err or result to be (or not) an Error object. The framework will simply use the first argument if present, otherwise the second. The method supports two arguments to be compatible with the common callback pattern of error first. + FLOW CONTROL: + When calling reply(), the framework waits until process.nextTick() to continue processing the request and transmit the response. This enables making changes to the returned response object before the response is sent. This means the framework will resume as soon as the handler method exits. To suspend this behavior, the returned response object supports the following methods: hold(), send() */ + export interface IReply extends IReplyMethods { + (err: Error, + result?: string | number | boolean | Buffer | stream.Stream | IPromise | T, + /** Note that when used to return both an error and credentials in the authentication methods, reply() must be called with three arguments function(err, null, data) where data is the additional authentication information. */ + credentialData?: any): IBoom; + /** Note that if result is a Stream with a statusCode property, that status code will be used as the default response code. */ + (result: string | number | boolean | Buffer | stream.Stream | IPromise | T): Response; + } + + /** Concludes the handler activity by setting a response and returning control over to the framework where: + erran optional error response. + result an optional response payload. + Since an request can only have one response regardless if it is an error or success, the reply() method can only result in a single response value. This means that passing both an err and result will only use the err. There is no requirement for either err or result to be (or not) an Error object. The framework will simply use the first argument if present, otherwise the second. The method supports two arguments to be compatible with the common callback pattern of error first. + FLOW CONTROL: + When calling reply(), the framework waits until process.nextTick() to continue processing the request and transmit the response. This enables making changes to the returned response object before the response is sent. This means the framework will resume as soon as the handler method exits. To suspend this behavior, the returned response object supports the following methods: hold(), send() */ + export interface IStrictReply extends IReplyMethods { + (err: Error, + result?: IPromise | T, + /** Note that when used to return both an error and credentials in the authentication methods, reply() must be called with three arguments function(err, null, data) where data is the additional authentication information. */ + credentialData?: any): IBoom; + /** Note that if result is a Stream with a statusCode property, that status code will be used as the default response code. */ + (result: IPromise | T): Response; + } + export interface ISessionHandler { (request: Request, reply: IReply): void; + (request: Request, reply: IStrictReply): void; } export interface IRequestHandler { (request: Request): T; @@ -875,7 +894,7 @@ declare module "hapi" { /** - an optional domain string or an array of domain strings for limiting the route to only requests with a matching host header field.Matching is done against the hostname part of the header only (excluding the port).Defaults to all hosts.*/ vhost?: string; /** - (required) the function called to generate the response after successful authentication and validation.The handler function is described in Route handler.If set to a string, the value is parsed the same way a prerequisite server method string shortcut is processed.Alternatively, handler can be assigned an object with a single key using the name of a registered handler type and value with the options passed to the registered handler.*/ - handler: ISessionHandler | string | IRouteHandlerConfig; + handler?: ISessionHandler | string | IRouteHandlerConfig; /** - additional route options.*/ config?: IRouteAdditionalConfigurationOptions; } @@ -926,6 +945,7 @@ declare module "hapi" { }; server.auth.scheme('custom', scheme);*/ authenticate(request: Request, reply: IReply): void; + authenticate(request: Request, reply: IStrictReply): void; /** payload(request, reply) - optional function called to authenticate the request payload where: request - the request object. reply(err, response) - is called if authentication failed where: @@ -934,6 +954,7 @@ declare module "hapi" { reply.continue() - is called if payload authentication succeeded. When the scheme payload() method returns an error with a message, it means payload validation failed due to bad payload. If the error has no message but includes a scheme name (e.g. Boom.unauthorized(null, 'Custom')), authentication may still be successful if the route auth.payload configuration is set to 'optional'.*/ payload?(request: Request, reply: IReply): void; + payload?(request: Request, reply: IStrictReply): void; /** response(request, reply) - optional function called to decorate the response with authentication headers before the response headers or payload is written where: request - the request object. reply(err, response) - is called if an error occurred where: @@ -941,6 +962,7 @@ declare module "hapi" { response - any authentication response to send instead of the current response. Ignored if err is present, otherwise required. reply.continue() - is called if the operation succeeded.*/ response?(request: Request, reply: IReply): void; + response?(request: Request, reply: IStrictReply): void; /** an optional object */ options?: { /** if true, requires payload validation as part of the scheme and forbids routes from disabling payload auth validation. Defaults to false.*/ @@ -964,7 +986,7 @@ declare module "hapi" { payload: string; rawPayload: Buffer; raw: { - req: http.ClientRequest; + req: http.IncomingMessage; res: http.ServerResponse }; result: string; @@ -1199,7 +1221,7 @@ declare module "hapi" { query: any; /** an object containing the Node HTTP server objects. Direct interaction with these raw objects is not recommended.*/ raw: { - req: http.ClientRequest; + req: http.IncomingMessage; res: http.ServerResponse; }; /** the route public interface.*/ @@ -1301,7 +1323,7 @@ declare module "hapi" { log(/** a string or an array of strings (e.g. ['error', 'database', 'read']) used to identify the event. Tags are used instead of log levels and provide a much more expressive mechanism for describing and filtering events.*/ tags: string | string[], /** an optional message string or object with the application data being logged.*/ - data?: string, + data?: any, /** an optional timestamp expressed in milliseconds. Defaults to Date.now() (now).*/ timestamp?: number): void; @@ -2018,6 +2040,7 @@ declare module "hapi" { server.start(); // All requests will get routed to '/test'*/ ext(event: string, method: (request: Request, reply: IReply, bind?: any) => void, options?: { before: string | string[]; after: string | string[]; bind?: any }): void; + ext(event: string, method: (request: Request, reply: IStrictReply, bind?: any) => void, options?: { before: string | string[]; after: string | string[]; bind?: any }): void; /** server.handler(name, method) Registers a new handler type to be used in routes where: diff --git a/he/he.d.ts b/he/he.d.ts index e0fb9847ac..44879577e1 100644 --- a/he/he.d.ts +++ b/he/he.d.ts @@ -6,6 +6,9 @@ // he - "HTML Entities" - A high quality pair of HTML encode and decode functions. declare module "he" { + export = he; +} +declare module he { var version: string; diff --git a/heatmap.js/heatmap.d.ts b/heatmap.js/heatmap.d.ts index 3a0bd2ba08..7cd14fc214 100644 --- a/heatmap.js/heatmap.d.ts +++ b/heatmap.js/heatmap.d.ts @@ -77,8 +77,9 @@ interface HeatmapConfiguration { /* * The property name of the value/weight in a datapoint + * Default value: 'value' */ - valueField: string; + valueField?: string; } /* diff --git a/hellojs/hellojs.d.ts b/hellojs/hellojs.d.ts index 686d5c1adf..8f0a9e9caa 100644 --- a/hellojs/hellojs.d.ts +++ b/hellojs/hellojs.d.ts @@ -18,7 +18,45 @@ interface HelloJSLogoutOptions { force?: boolean; } -interface HelloJSEvent { +interface HelloJSImmediateSuccessCB { + (value: T): TP; +} + +interface HelloJSImmediateErrorCB { + (err: any): TP; +} + +interface HelloJSDeferredSuccessCB { + (value: T): HelloJSThenable; +} + +interface HelloJSDeferredErrorCB { + (error: any): HelloJSThenable; +} + +interface HelloJSThenable { + then( + successCB?: HelloJSDeferredSuccessCB, + errorCB?: HelloJSDeferredErrorCB + ): HelloJSThenable; + + then( + successCB?: HelloJSDeferredSuccessCB, + errorCB?: HelloJSImmediateErrorCB + ): HelloJSThenable; + + then( + successCB?: HelloJSImmediateSuccessCB, + errorCB?: HelloJSDeferredErrorCB + ): HelloJSThenable; + + then( + successCB?: HelloJSImmediateSuccessCB, + errorCB?: HelloJSImmediateErrorCB + ): HelloJSThenable; +} + +interface HelloJSEvent extends HelloJSThenable { on(event: string, callback: (auth: HelloJSEventArgument) => void): HelloJSStatic; off(event: string, callback: (auth: HelloJSEventArgument) => void): HelloJSStatic; findEvents(event: string, callback: (name: string, index: number) => void): void; @@ -30,15 +68,17 @@ interface HelloJSEvent { } + interface HelloJSEventArgument { network: string; authResponse?: any; } + interface HelloJSStatic extends HelloJSEvent { init(serviceAppIds: { [id: string]: string; }, options?: HelloJSLoginOptions): void; - login(network: string, options?: HelloJSLoginOptions, callback?: () => void): void; - logout(network: string, options?: HelloJSLogoutOptions, callback?: () => void): void; + login(network: string, options?: HelloJSLoginOptions, callback?: () => void): HelloJSStatic; + logout(network: string, options?: HelloJSLogoutOptions, callback?: () => void): HelloJSStatic; getAuthResponse(network: string): any; service(network: string): HelloJSServiceDef; settings: HelloJSLoginOptions; @@ -50,7 +90,7 @@ interface HelloJSStaticNamed { login(option?: HelloJSLoginOptions, callback?: () => void): void; logout(callback?: () => void): void; getAuthResponse(): any; - api(path?: string, method?: string, data?: any, callback?: (json?: any) => void): HelloJSStatic; + api(path?: string, method?: string, data?: any, callback?: (json?: any) => void): HelloJSStatic; } interface HelloJSOAuthDef { diff --git a/hellosign-embedded/hellosign-embedded-tests.ts b/hellosign-embedded/hellosign-embedded-tests.ts new file mode 100644 index 0000000000..455171942e --- /dev/null +++ b/hellosign-embedded/hellosign-embedded-tests.ts @@ -0,0 +1,39 @@ +/// + +HelloSign.init('abc123'); + +// some options +HelloSign.open({ + url: 'http://example.org', + messageListener: (e: HelloSign.MessageEvent) => { + if (e.event === HelloSign.EVENT_SIGNED) { + console.log('signed'); + } + }, + uxVersion: 2 +}); + +// all options +HelloSign.open({ + url: 'http://example.org', + redirectUrl: 'https://github.com/DefinitelyTyped/DefinitelyTyped', + allowCancel: true, + messageListener: (e: HelloSign.MessageEvent) => { + if (e.event === HelloSign.EVENT_SIGNED) { + console.log('signed'); + } + }, + userCulture: HelloSign.CULTURES.EN_US, + debug: true, + skipDomainVerification: true, + container: document.getElementById('#hellosign-container'), + height: 1326, + hideHeader: true, + uxVersion: 2, + requester: 'hellosign@example.org', + whiteLabelingOptions: { + "page_background_color": "#f7f8f9" + } +}); + +HelloSign.close(); diff --git a/hellosign-embedded/hellosign-embedded.d.ts b/hellosign-embedded/hellosign-embedded.d.ts new file mode 100644 index 0000000000..f215dac6bc --- /dev/null +++ b/hellosign-embedded/hellosign-embedded.d.ts @@ -0,0 +1,193 @@ +// Type definitions for hellosign-embedded v1.0.3 +// Project: https://github.com/HelloFax/hellosign-embedded +// Definitions by: Brian Surowiec +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +declare module HelloSign { + interface MessageEvent { + event: string; + } + + interface ClientCultures { + /** + * English (United States) + * + * @default en_US + */ + EN_US: string; + + /** + * French (France) + * + * @default fr_FR + */ + FR_FR: string; + + /** + * German (Germany) + * + * @default de_DE + */ + DE_DE: string; + + /** + * Swedish (Sweden) + * + * @default sv_SE + */ + SV_SE: string; + + /** + * Chinese (China) + * + * @default zh_CN + */ + ZH_CN: string; + + /** + * Danish (Denmark) + * + * @default da_DK + */ + DA_DK: string; + + /** + * Dutch (The Netherlands) + * @default nl_NL + */ + NL_NL: string; + + /** + * The available client UI cultures + */ + supportedCultures: string[]; + } + + interface OpenParameters { + /** + * The url to open in the child frame + */ + url?: string; + + /** + * Where to go after the signature is completed + */ + redirectUrl?: string; + + /** + * Whether a cancel button should be displayed + * + * @default true + */ + allowCancel?: boolean; + + /** + * A listener for X-window messages coming from the child frame + */ + messageListener?: (eventData: MessageEvent) => void; + + /** + * One of the HelloSign.CULTURES.supportedCultures + * + * @default HelloSign.CULTURES.EN_US + */ + userCulture?: string; + + /** + * When true, debugging statements will be written to the console + * + * @default false + */ + debug?: boolean; + + /** + * When true, domain verification step will be skipped if and only if the Signature Request was created with test_mode=1 + * + * @default false + */ + skipDomainVerification?: boolean; + + /** + * DOM element that will contain the iframe on the page (defaults to document.body) + */ + container?: Element; + + /** + * Height of the iFrame (only applicable when a container is specified) + */ + height?: number; + + /** + * When true, the header will be hidden. + * This is only functional for customers with embedded branding enabled. + * + * @default false + */ + hideHeader?: boolean; + + /** + * The version of the embedded user experience to display to signers (1 = legacy, 2 = responsive). + * This option is only honored if your account has accessed the API prior to Nov 14, 2015. + */ + uxVersion?: number; + + /** + * The email of the person issuing a signature request. + * Required for allowing 'Me + Others' requests + */ + requester?: string; + + /** + * An associative array to be used to customize the app's signer page + */ + whiteLabelingOptions?: Object; + } + + interface HelloSignStatic { + /** + * The available client UI cultures + */ + CULTURES: ClientCultures; + + /** + * The signature request was signed + * + * @default signature_request_signed + */ + EVENT_SIGNED: string; + + /** + * The user closed the iFrame before completing + * + * @default signature_request_canceled + */ + EVENT_CANCELED: string; + + /** + * An error occurred in the iFrame + * + * @default error + */ + EVENT_ERROR: string; + + /** + * Initialize using your HelloSign API client ID. + * + * @param appClientId The API client ID the request is for. + */ + init(appClientId: string): void; + + /** + * Open the signing window. + * + * @param params The options to use when opening the signing window. + */ + open(params: OpenParameters): void; + + /** + * Close the signing window. + */ + close(): void; + } +} + +declare var HelloSign: HelloSign.HelloSignStatic; diff --git a/helmet/helmet-tests.ts b/helmet/helmet-tests.ts index 0223244cc0..5d8a7515cd 100644 --- a/helmet/helmet-tests.ts +++ b/helmet/helmet-tests.ts @@ -10,22 +10,19 @@ var app = express(); */ function helmetTest() { app.use(helmet()); + app.use(helmet({})); + app.use(helmet({ frameguard: false })); + app.use(helmet({ frameguard: true })); + app.use(helmet({ + frameguard: { + action: 'deny' + } + })); } /** - * @summary Test for {@see helmet#xssFilter} function. + * @summary Test for {@see helmet#contentSecurityPolicy} function. */ -function xssFilterTest() { - app.use(helmet.xssFilter()); - app.use(helmet.xssFilter({})); - app.use(helmet.xssFilter({ setOnOldIE: false })); - app.use(helmet.xssFilter({ setOnOldIE: true })); -} - -/** - * @summary Test for {@see helmet#csp} function. - */ - function contentSecurityPolicyTest() { const emptyArray: string[] = []; const config = { @@ -63,86 +60,6 @@ function contentSecurityPolicyTest() { }, setAllHeaders: true })); - - app.use(helmet.csp()); - app.use(helmet.csp({})); - app.use(helmet.csp(config)); - app.use(helmet.csp({ - directives: { - defaultSrc: ["'self'"] - }, - setAllHeaders: true - })); -} - -/** - * @summary Test for {@see helmet#frameguard} function. - */ -function frameguardTest() { - app.use(helmet.frameguard()); - app.use(helmet.frameguard("sameorigin")); -} - -/** - * @summary Test for {@see helmet#hsts} function. - */ -function hstsTest() { - app.use(helmet.hsts()); - app.use(helmet.hsts({ maxAge: 7776000000 })); -} - -/** - * @summary Test for {@see helmet#ieNoOpen} function. - */ -function ieNoOpenTest() { - app.use(helmet.ieNoOpen()); -} - -/** - * @summary Test for {@see helmet#noSniff} function. - */ -function noSniffTest() { - app.use(helmet.noSniff()); -} - -/** - * @summary Test for {@see helmet#publicKeyPins} function. - */ -function publicKeyPinsTest() { - app.use(helmet.publicKeyPins({ - maxAge: 7776000000, - sha256s: ["AbCdEf123=", "ZyXwVu456="], - })); - - app.use(helmet.publicKeyPins({ - maxAge: 7776000000, - sha256s: ["AbCdEf123=", "ZyXwVu456="], - includeSubdomains: false - })); - - app.use(helmet.publicKeyPins({ - maxAge: 7776000000, - sha256s: ["AbCdEf123=", "ZyXwVu456="], - includeSubdomains: true - })); - - app.use(helmet.publicKeyPins({ - maxAge: 7776000000, - sha256s: ["AbCdEf123=", "ZyXwVu456="], - reportUri: "http://example.com" - })); - - app.use(helmet.publicKeyPins({ - maxAge: 7776000000, - sha256s: ["AbCdEf123=", "ZyXwVu456="], - reportOnly: true - })); - - app.use(helmet.publicKeyPins({ - maxAge: 7776000000, - sha256s: ["AbCdEf123=", "ZyXwVu456="], - setIf: function (req, res) { return true; } - })); } /** @@ -153,3 +70,132 @@ function dnsPrefetchControlTest() { app.use(helmet.dnsPrefetchControl({ allow: false })); app.use(helmet.dnsPrefetchControl({ allow: true })); } + +/** + * @summary Test for {@see helmet#frameguard} function. + */ +function frameguardTest() { + app.use(helmet.frameguard()); + app.use(helmet.frameguard({})); + app.use(helmet.frameguard({ action: 'deny' })); + app.use(helmet.frameguard({ action: 'sameorigin' })); + app.use(helmet.frameguard({ + action: 'allow-from', + domain: 'http://example.com' + })); +} + +/** + * @summary Test for {@see helmet#hidePoweredBy} function. + */ +function hidePoweredBy() { + app.use(helmet.hidePoweredBy()); + app.use(helmet.hidePoweredBy({})); + app.use(helmet.hidePoweredBy({ setTo: 'PHP 4.2.0' })); +} + +/** + * @summary Test for {@see helmet#hpkp} function. + */ +function hpkpTest() { + app.use(helmet.hpkp({ + maxAge: 7776000000, + sha256s: ['AbCdEf123=', 'ZyXwVu456='], + })); + + app.use(helmet.hpkp({ + maxAge: 7776000000, + sha256s: ['AbCdEf123=', 'ZyXwVu456='], + includeSubdomains: false + })); + + app.use(helmet.hpkp({ + maxAge: 7776000000, + sha256s: ['AbCdEf123=', 'ZyXwVu456='], + includeSubdomains: true + })); + + app.use(helmet.hpkp({ + maxAge: 7776000000, + sha256s: ['AbCdEf123=', 'ZyXwVu456='], + reportUri: 'http://example.com' + })); + + app.use(helmet.hpkp({ + maxAge: 7776000000, + sha256s: ['AbCdEf123=', 'ZyXwVu456='], + reportOnly: true + })); + + app.use(helmet.hpkp({ + maxAge: 7776000000, + sha256s: ['AbCdEf123=', 'ZyXwVu456='], + setIf: function (req, res) { return true; } + })); +} + +/** + * @summary Test for {@see helmet#hsts} function. + */ +function hstsTest() { + app.use(helmet.hsts()); + + app.use(helmet.hsts({ maxAge: 7776000000 })); + + app.use(helmet.hsts({ + maxAge: 7776000000, + })); + + app.use(helmet.hsts({ + maxAge: 7776000000, + includeSubdomains: true + })); + + app.use(helmet.hsts({ + maxAge: 7776000000, + preload: true + })); + + app.use(helmet.hsts({ + maxAge: 7776000000, + force: true + })); + + app.use(helmet.hsts({ + maxAge: 7776000000, + setIf: function (req, res) { return true; } + })); +} + +/** + * @summary Test for {@see helmet#ieNoOpen} function. + */ +function ieNoOpenTest() { + app.use(helmet.ieNoOpen()); +} + +/** + * @summary Test for {@see helmet#noCache} function. + */ +function noCacheTest() { + app.use(helmet.noCache()); + app.use(helmet.noCache({})); + app.use(helmet.noCache({ noEtag: true })); +} + +/** + * @summary Test for {@see helmet#noSniff} function. + */ +function noSniffTest() { + app.use(helmet.noSniff()); +} + +/** + * @summary Test for {@see helmet#xssFilter} function. + */ +function xssFilterTest() { + app.use(helmet.xssFilter()); + app.use(helmet.xssFilter({})); + app.use(helmet.xssFilter({ setOnOldIE: false })); + app.use(helmet.xssFilter({ setOnOldIE: true })); +} diff --git a/helmet/helmet.d.ts b/helmet/helmet.d.ts index f32ba0a2d9..6feef0bad8 100644 --- a/helmet/helmet.d.ts +++ b/helmet/helmet.d.ts @@ -1,19 +1,32 @@ // Type definitions for helmet // Project: https://github.com/helmetjs/helmet -// Definitions by: Cyril Schumacher +// Definitions by: Cyril Schumacher , Evan Hahn // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// -declare module "helmet" { - import express = require("express"); - - interface IHelmetCspDirectiveFunction { +declare module 'helmet' { + import express = require('express'); + + interface IHelmetConfiguration { + contentSecurityPolicy? : boolean | IHelmetContentSecurityPolicyConfiguration, + dnsPrefetchControl?: boolean | IHelmetDnsPrefetchControlConfiguration, + frameguard?: boolean | IHelmetFrameguardConfiguration, + hidePoweredBy?: boolean | IHelmetHidePoweredByConfiguration, + hpkp?: boolean | IHelmetHpkpConfiguration, + hsts?: boolean | IHelmetHstsConfiguration, + ieNoOpen?: boolean, + noCache?: boolean, + noSniff?: boolean, + xssFilter?: boolean | IHelmetXssFilterConfiguration + } + + interface IHelmetContentSecurityPolicyDirectiveFunction { (req: express.Request, res: express.Response): string; } - type HelmetCspDirectiveValue = string | IHelmetCspDirectiveFunction; + type HelmetCspDirectiveValue = string | IHelmetContentSecurityPolicyDirectiveFunction; - interface IHelmetCspDirectives { + interface IHelmetContentSecurityPolicyDirectives { baseUri? : HelmetCspDirectiveValue[], childSrc? : HelmetCspDirectiveValue[], connectSrc? : HelmetCspDirectiveValue[], @@ -31,36 +44,53 @@ declare module "helmet" { scriptSrc? : HelmetCspDirectiveValue[], styleSrc? : HelmetCspDirectiveValue[] } - - interface IHelmetCspConfiguration { + + interface IHelmetContentSecurityPolicyConfiguration { reportOnly? : boolean; setAllHeaders? : boolean; disableAndroid? : boolean; browserSniff?: boolean; - directives? : IHelmetCspDirectives + directives? : IHelmetContentSecurityPolicyDirectives } - interface IHelmetPublicKeyPinsSetIfFunction { + interface IHelmetDnsPrefetchControlConfiguration { + allow? : boolean; + } + + interface IHelmetFrameguardConfiguration { + action? : string, + domain? : string + } + + interface IHelmetHidePoweredByConfiguration { + setTo? : string + } + + interface IHelmetSetIfFunction { (req: express.Request, res: express.Response): boolean; } - interface IHelmetPublicKeyPinsConfiguration { + interface IHelmetHpkpConfiguration { maxAge : number; sha256s : string[]; includeSubdomains? : boolean; reportUri? : string; reportOnly? : boolean; - setIf?: IHelmetPublicKeyPinsSetIfFunction + setIf?: IHelmetSetIfFunction + } + + interface IHelmetHstsConfiguration { + maxAge: number; + includeSubdomains? : boolean; + preload? : boolean; + setIf? : IHelmetSetIfFunction, + force? : boolean; } interface IHelmetXssFilterConfiguration { setOnOldIE? : boolean; } - interface IHelmetDnsPrefetchControlConfiguration { - allow? : boolean; - } - /** * @summary Interface for helmet class. * @interface @@ -70,77 +100,74 @@ declare module "helmet" { * @summary Constructor. * @return {RequestHandler} The Request handler. */ - ():express.RequestHandler; + (options ?: IHelmetConfiguration): express.RequestHandler; + + /** + * @summary Set policy around third-party content via headers + * @param {IHelmetContentSecurityPolicyConfiguration} options The options + * @return {RequestHandler} The Request handler + */ + contentSecurityPolicy(options ?: IHelmetContentSecurityPolicyConfiguration): express.RequestHandler; /** * @summary Stop browsers from doing DNS prefetching. + * @param {IHelmetDnsPrefetchControlConfiguration} options The options + * @return {RequestHandler} The Request handler */ - dnsPrefetchControl(options ?: IHelmetDnsPrefetchControlConfiguration):express.RequestHandler; + dnsPrefetchControl(options ?: IHelmetDnsPrefetchControlConfiguration): express.RequestHandler; /** * @summary Prevent clickjacking. - * @param {string} header The header. - * @return {RequestHandler} The Request handler. + * @param {IHelmetFrameguardConfiguration} options The options + * @return {RequestHandler} The Request handler */ - frameguard(header ?: string):express.RequestHandler; + frameguard(options ?: IHelmetFrameguardConfiguration): express.RequestHandler; /** * @summary Hide "X-Powered-By" header. - * @param {Object} options The options. + * @param {IHelmetHidePoweredByConfiguration} options The options * @return {RequestHandler} The Request handler. */ - hidePoweredBy(options ?: Object):express.RequestHandler; + hidePoweredBy(options ?: IHelmetHidePoweredByConfiguration): express.RequestHandler; + + /** + * @summary Adds the "Public-Key-Pins" header. + * @param {IHelmetHpkpConfiguration} options The options + * @return {RequestHandler} The Request handler. + */ + hpkp(options ?: IHelmetHpkpConfiguration): express.RequestHandler; /** * @summary Adds the "Strict-Transport-Security" header. - * @param {Object} options The options. + * @param {IHelmetHstsConfiguration} options The options * @return {RequestHandler} The Request handler. */ - hsts(options ?: Object):express.RequestHandler; + hsts(options ?: IHelmetHstsConfiguration): express.RequestHandler; /** * @summary Add the "X-Download-Options" header. * @return {RequestHandler} The Request handler. */ - ieNoOpen():express.RequestHandler; + ieNoOpen(): express.RequestHandler; /** * @summary Add the "Cache-Control" and "Pragma" headers to stop caching. * @return {RequestHandler} The Request handler. */ - noCache(options ?: Object):express.RequestHandler; + noCache(options ?: Object): express.RequestHandler; /** * @summary Adds the "X-Content-Type-Options" header. * @return {RequestHandler} The Request handler. */ - noSniff():express.RequestHandler; - - /** - * @summary Adds the "Public-Key-Pins" header. - * @return {RequestHandler} The Request handler. - */ - publicKeyPins(options ?: IHelmetPublicKeyPinsConfiguration):express.RequestHandler; + noSniff(): express.RequestHandler; /** * @summary Mitigate cross-site scripting attacks with the "X-XSS-Protection" header. + * @param {IHelmetXssFilterConfiguration} options The options * @return {RequestHandler} The Request handler. - * @param {Object} options The options. */ - xssFilter(options ?: IHelmetXssFilterConfiguration):express.RequestHandler; - - /** - * @summary Set policy around third-party content via headers - * @return {RequestHandler} The Request handler - * @param {Object} options The options - */ - csp(options ?: IHelmetCspConfiguration): express.RequestHandler; - - /** - * @see csp - */ - contentSecurityPolicy(options ?: IHelmetCspConfiguration): express.RequestHandler; - + xssFilter(options ?: IHelmetXssFilterConfiguration): express.RequestHandler; } var helmet: Helmet; diff --git a/highcharts/highcharts-modules-no-data-to-display-tests.ts b/highcharts/highcharts-modules-no-data-to-display-tests.ts new file mode 100644 index 0000000000..64b50f831f --- /dev/null +++ b/highcharts/highcharts-modules-no-data-to-display-tests.ts @@ -0,0 +1,10 @@ +/// +/// +/// + +function test_NoDataToDisplay() { + var chart = $("#container").highcharts(); + var chartHasData = chart.hasData(); + chart.hideNoData(); + chart.showNoData("Custom no data message"); +} diff --git a/highcharts/highcharts-modules-no-data-to-display.d.ts b/highcharts/highcharts-modules-no-data-to-display.d.ts new file mode 100644 index 0000000000..ab5fdd1d0d --- /dev/null +++ b/highcharts/highcharts-modules-no-data-to-display.d.ts @@ -0,0 +1,26 @@ +// Type definitions for Highcharts No Data to Display +// Project: http://www.highcharts.com/ +// Definitions by: Andrey Zolotin +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// +interface HighchartsChartObject { + /** + * Returns true if there are data points within the plot area now + * @return {boolean} If chart has any data. + * @since 3.0.8 + */ + hasData(): boolean; + + /** + * Hide the 'No data to display' message added by the no-data-to-display plugin. + * @since 3.0.8 + */ + hideNoData(): void; + + /** + * Display a no-data message. + * @param {String} message An optional message to show in place of the default one + * @since 3.0.8 + */ + showNoData(message?: string): void; +} diff --git a/highcharts/highcharts-tests.ts b/highcharts/highcharts-tests.ts index ad57f8bc4c..d8b74de31e 100644 --- a/highcharts/highcharts-tests.ts +++ b/highcharts/highcharts-tests.ts @@ -2187,6 +2187,7 @@ function test_ChartObject() { chart.destroy(); chart.drillUp(); chart.exportChart({}, {}); + chart.exportChartLocal({}, {}); var object = chart.get('axisIdOrSeriesIdOrPointId'); var svg1 = chart.getSVG(); var svg2 = chart.getSVG({}); @@ -2257,6 +2258,7 @@ function test_PointObject() { var point = $('#container').highcharts().get('point1'); var category = point.category; var percentage = point.percentage; + point.index; point.remove(); point.remove(false); point.remove(false, {duration: 50}); diff --git a/highcharts/highcharts.d.ts b/highcharts/highcharts.d.ts index 16151be327..7185587190 100644 --- a/highcharts/highcharts.d.ts +++ b/highcharts/highcharts.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Highcharts 4.1.9 +// Type definitions for Highcharts 4.2.5 // Project: http://www.highcharts.com/ // Definitions by: Damiano Gambarotto , Dan Lewi Harkestad // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -3183,6 +3183,14 @@ interface HighchartsPointEvents { * @since 1.2.0 */ update?: (event: Event) => boolean|void; + /** + * Fires when the legend item belonging to the pie point (slice) is clicked. + * The this keyword refers to the point itself. One parameter, event, is passed to the function. + * This contains common event information based on jQuery or MooTools depending on which library is used as the base for Highcharts. + * The default action is to toggle the visibility of the point. This can be prevented by calling event.preventDefault(). + */ + legendItemClick?: (event: Event) => boolean | void; + } interface HighchartsHalo { @@ -4817,6 +4825,17 @@ interface HighchartsPlotOptions { */ interface HighchartsIndividualSeriesOptions { type?: string; + /** + * The main color or the series. In line type series it applies to the line and the point markers unless otherwise + * specified. In bar type series it applies to the bars unless a color is specified per point. The default + * value is pulled from the options.colors array. + */ + color?: string; + /** + * You can set the cursor to "pointer" if you have click events attached to the series, to signal to the user + * that the points and lines can be clicked. + */ + cursor?: string; /** * An array of data points for the series. For the area series type, points can be given in the following ways: * @@ -4867,6 +4886,11 @@ interface HighchartsIndividualSeriesOptions { * The name of the series as shown in the legend, tooltip etc. */ name?: string; + /** + * A pixel value specifying a fixed width for each column or bar. When null, the width is calculated from + * the pointPadding and groupPadding. + */ + pointWidth?: number; /** * This option allows grouping series in a stacked chart. The stack option can be a string or a number or anything * else, as long as the grouped series' stack options match each other. @@ -4954,7 +4978,7 @@ interface HighchartsDataPoint { * The inner radius of an individual point in a solid gauge. Can be given as a number (pixels) or percentage string. * @since 4.1.6 */ - innerRadius?: number; + innerRadius?: number|string; /** * When this property is true, the points acts as a summary column for the values added or substracted since the * last intermediate sum, or since the start of the series. The y value is ignored. @@ -5005,7 +5029,7 @@ interface HighchartsDataPoint { * The outer radius of an individual point in a solid gauge. Can be given as a number (pixels) or percentage string. * @since 4.1.6 */ - radius?: number; + radius?: number|string; /** * Whether the data point is selected initially. * @default false @@ -5472,12 +5496,12 @@ interface HighchartsOptions { * The X axis or category axis. Normally this is the horizontal axis, though if the chart is inverted this is the * vertical axis. In case of multiple axes, the xAxis node is an array of configuration objects. */ - xAxis?: HighchartsAxisOptions | HighchartsAxisOptions[]; + xAxis?: HighchartsAxisOptions[] | HighchartsAxisOptions; /** * The Y axis or value axis. Normally this is the vertical axis, though if the chart is inverted this is the * horizontal axis. In case of multiple axes, the yAxis node is an array of configuration objects. */ - yAxis?: HighchartsAxisOptions | HighchartsAxisOptions[]; + yAxis?: HighchartsAxisOptions[] | HighchartsAxisOptions; } interface HighchartsGlobalOptions extends HighchartsOptions { @@ -5681,6 +5705,30 @@ interface HighchartsChartObject { * @since 2.0 */ exportChart(options: HighchartsExportingOptions, chartOptions: HighchartsOptions): void; + /** + * Export the chart to a PNG or SVG without sending it to a server. Requires + * modules/exporting.js and modules/offline-exporting.js. + * @since 2.0 + */ + exportChartLocal(): void; + /** + * Export the chart to a PNG or SVG without sending it to a server. Requires + * modules/exporting.js and modules/offline-exporting.js. + * @param {HighchartsExportingOptions} options Exporting options. Same as + * the exportChart params. + * @since 2.0 + */ + exportChartLocal(options: HighchartsExportingOptions): void; + /** + * Export the chart to a PNG or SVG without sending it to a server. + * Requires modules/exporting.js and modules/offline-exporting.js. + * @param {HighchartsExportingOptions} options Exporting options. Same as + * the exportChart params. + * @param {HighchartsOptions} chartOptions Additional chart options for the + * exported chart. Same as the exportChart params. + * @since 2.0 + */ + exportChartLocal(options: HighchartsExportingOptions, chartOptions: HighchartsOptions): void; /** * Get an axis, series or point by its id as given in the configuration options. * @param {string} id The id of the axis, series or point to get. @@ -6013,7 +6061,7 @@ interface HighchartsStatic { * throughout the page's lifetime. When a chart is destroyed, the array item becomes undefined. * @since 2.3.4 */ - charts: HighchartsChart[]; + charts: HighchartsChartObject[]; /** * Formats a JavaScript date timestamp (milliseconds since Jan 1st 1970) into a human readable date string. The * format is a subset of the formats for PHP's strftime function. Additional formats can be given in the @@ -6074,6 +6122,7 @@ interface HighchartsPointObject { */ category: string | number; name: string; + index: number; /** * The percentage for points in a stacked series or pies. * @since 1.2.0 diff --git a/howlerjs/howler.d.ts b/howlerjs/howler.d.ts index c52b9c334f..9e245a8058 100644 --- a/howlerjs/howler.d.ts +++ b/howlerjs/howler.d.ts @@ -52,20 +52,20 @@ interface Howl { onpause: Function; onplay: Function; load(): Howl; - play(sprite?: string, callback?: (soundId: number) => void): Howl; - play(callback?: (soundId: number) => void): Howl; - pause(soundId?: number): Howl; - stop(soundId?: number): Howl; - mute(soundId?: number): Howl; - unmute(soundId?: number): Howl; - fade(from: number, to: number, duration: number, callback?: Function, soundId?: number): Howl; + play(sprite?: string, callback?: (soundId: string) => void): Howl; + play(callback?: (soundId: string) => void): Howl; + pause(soundId?: string): Howl; + stop(soundId?: string): Howl; + mute(soundId?: string): Howl; + unmute(soundId?: string): Howl; + fade(from: number, to: number, duration: number, callback?: Function, soundId?: string): Howl; loop(): boolean; loop(loop: boolean): Howl; - pos(position?: number, soundId?: number): number; - pos3d(x: number, y: number, z: number, soundId?: number): any; + pos(position?: number, soundId?: string): number; + pos3d(x: number, y: number, z: number, soundId?: string): any; sprite(definition?: IHowlSoundSpriteDefinition): IHowlSoundSpriteDefinition; volume(): number; - volume(volume?: number, soundId?: number): Howl; + volume(volume?: number, soundId?: string): Howl; urls(): string[]; urls(urls: string[]): Howl; on(event: string, listener?: Function): Howl; diff --git a/html-webpack-plugin/html-webpack-plugin-tests.ts b/html-webpack-plugin/html-webpack-plugin-tests.ts new file mode 100644 index 0000000000..9aac8c9b98 --- /dev/null +++ b/html-webpack-plugin/html-webpack-plugin-tests.ts @@ -0,0 +1,18 @@ +/// + +import {Configuration} from "webpack"; +import HtmlWebpackPlugin = require("html-webpack-plugin"); + +const a: Configuration = { + plugins: [ + new HtmlWebpackPlugin() + ] +}; + +const b: Configuration = { + plugins: [ + new HtmlWebpackPlugin({ + title: "test" + }) + ] +}; diff --git a/html-webpack-plugin/html-webpack-plugin.d.ts b/html-webpack-plugin/html-webpack-plugin.d.ts new file mode 100644 index 0000000000..59917abf62 --- /dev/null +++ b/html-webpack-plugin/html-webpack-plugin.d.ts @@ -0,0 +1,89 @@ +// Type definitions for html-webpack-plugin v2.22.2 +// Project: https://github.com/ampedandwired/html-webpack-plugin +// Definitions by: Simon Hartcher +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module "html-webpack-plugin" { + import {Plugin} from "webpack"; + + interface HtmlWebpackPluginConfiguration { + /** + * The title to use for the generated HTML document. + */ + title?: string; + + /** + * The file to write the HTML to. Defaults to index.html. You can specify a subdirectory here too (eg: `assets/admin.html`). + */ + filename?: string; + + /** + * Webpack require path to the template. Please see the docs for details. + */ + template?: string; + + /** + * `true | 'head' | 'body' | false` + * + * Inject all assets into the given template or templateContent - When passing true or 'body' all javascript resources will be placed at the bottom of the body element. 'head' will place the scripts in the head element. + */ + inject?: boolean | "head" | "body"; + + /** + * Adds the given favicon path to the output html. + */ + favicon?: string; + + /** + * Pass a html-minifier options object to minify the output. + * + * https://github.com/kangax/html-minifier#options-quick-reference + */ + minify?: any; + + /** + * `true | false` if `true` then append a unique webpack compilation hash to all included scripts and css files. This is useful for cache busting. + */ + hash?: boolean; + + /** + * `true | false` if `true` (default) try to emit the file only if it was changed. + */ + cache?: boolean; + + /** + * `true | false` if `true` (default) errors details will be written into the html page. + */ + showErrors?: boolean; + + /** + * Allows you to add only some chunks (e.g. only the unit-test chunk) + */ + chunks?: string[]; + + /** + * Allows to control how chunks should be sorted before they are included to the html. Allowed values: `'none' | 'auto' | 'dependency' | {function}` - default: `'auto'` + */ + chunksSortMode?: "none" | "auto" | "dependency" | Function; + + /** + * Allows you to skip some chunks (e.g. don't add the unit-test chunk) + */ + excludeChunks?: string[]; + + /** + * `true | false` If `true` render the link tags as self-closing, XHTML compliant. Default is `false` + */ + xhtml?: boolean; + } + + interface HtmlWebpackPlugin { + new (): Plugin; + new (options: HtmlWebpackPluginConfiguration): Plugin; + } + + const htmlWebpackPlugin: HtmlWebpackPlugin; + export = htmlWebpackPlugin; +} diff --git a/html2canvas/html2canvas.d.ts b/html2canvas/html2canvas.d.ts index 1d5fd82fe7..f9b85ab992 100644 --- a/html2canvas/html2canvas.d.ts +++ b/html2canvas/html2canvas.d.ts @@ -1,6 +1,6 @@ -// Type definitions for html2canvas.js v0.4.1 +// Type definitions for html2canvas.js v0.5.0-bata.4 // Project: https://github.com/niklasvh/html2canvas -// Definitions by: Richard Hepburn +// Definitions by: Richard Hepburn , Pei-Tang Huang // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -39,23 +39,11 @@ declare namespace Html2Canvas { /** Use svg powered rendering where available (FF11+). */ svgRendering?: boolean; - - /** Callback providing the rendered canvas element after rendering */ - onrendered?(canvas: HTMLCanvasElement): void; } } interface Html2CanvasStatic { - /** - * Renders an HTML element to a canvas so that a screenshot can be generated. - * - * The screenshot is based on the DOM and as such may not be 100% accurate to the real representation as it does not make an actual screenshot, - * but builds the screenshot based on the information available on the page. - * - * @param {HTMLElement} element The HTML element which will be rendered to the canvas. Use the root element to render the entire window. - */ - (element: HTMLElement): void; /** * Renders an HTML element to a canvas so that a screenshot can be generated. * @@ -65,7 +53,25 @@ interface Html2CanvasStatic { * @param {HTMLElement} element The HTML element which will be rendered to the canvas. Use the root element to render the entire window. * @param {Html2CanvasOptions} options The options object that controls how the element will be rendered. */ - (element: HTMLElement, options: Html2Canvas.Html2CanvasOptions): void; + (element: HTMLElement, options?: Html2Canvas.Html2CanvasOptions): Html2CanvasPromise; +} + +// FIXME: +// Find out a way to dependent on real Promise interface. +// And remove following custome Promise interface. +interface Html2CanvasThenable { + then(onFulfilled?: (value: R) => U | Html2CanvasThenable, onRejected?: (error: any) => U | Html2CanvasThenable): Html2CanvasThenable; + then(onFulfilled?: (value: R) => U | Html2CanvasThenable, onRejected?: (error: any) => void): Html2CanvasThenable; +} + +interface Html2CanvasPromise extends Html2CanvasThenable { + then(onFulfilled?: (value: R) => U | Html2CanvasThenable, onRejected?: (error: any) => U | Html2CanvasThenable): Html2CanvasPromise; + then(onFulfilled?: (value: R) => U | Html2CanvasThenable, onRejected?: (error: any) => void): Html2CanvasPromise; + catch(onRejected?: (error: any) => U | Html2CanvasThenable): Html2CanvasPromise; +} + +declare module 'html2canvas' { + export = html2canvas; } declare var html2canvas: Html2CanvasStatic; diff --git a/http-errors/http-errors-tests.ts b/http-errors/http-errors-tests.ts index 4403259008..61fb9091bf 100644 --- a/http-errors/http-errors-tests.ts +++ b/http-errors/http-errors-tests.ts @@ -6,12 +6,19 @@ import * as express from 'express'; var app = express(); +declare global { + namespace Express { + export interface Request { + user?: any + } + } +} + app.use(function (req, res, next) { if (!req.user) return next(createError(401, 'Please login to view this page.')); next(); }); - /* Examples taken from https://github.com/jshttp/http-errors/blob/1.3.1/test/test.js */ // createError(status) diff --git a/i18n-node/i18n-node.d.ts b/i18n-node/i18n-node.d.ts index 568228df45..d5703a825d 100644 --- a/i18n-node/i18n-node.d.ts +++ b/i18n-node/i18n-node.d.ts @@ -50,6 +50,11 @@ declare namespace i18n { * json files prefix */ prefix?: string; + + /** + * object or [obj1, obj2] to bind the i18n api and current locale to - defaults to null + */ + register?: any; } export interface TranslateOptions { phrase: string; diff --git a/i18next-browser-languagedetector/i18next-browser-languagedetector.d.ts b/i18next-browser-languagedetector/i18next-browser-languagedetector.d.ts index cef510304e..a00acb2265 100644 --- a/i18next-browser-languagedetector/i18next-browser-languagedetector.d.ts +++ b/i18next-browser-languagedetector/i18next-browser-languagedetector.d.ts @@ -3,7 +3,6 @@ // Definitions by: Cyril Schumacher // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// /// declare namespace I18next { @@ -81,8 +80,6 @@ declare namespace i18nextBrowserLanguageDetector { } declare module "i18next-browser-languagedetector" { - import * as express from "express"; - import * as i18next from "i18next"; export default i18nextBrowserLanguageDetector.LngDetector; } diff --git a/i18next/i18next-tests.ts b/i18next/i18next-tests.ts index e46a9ed5bf..373b7394b4 100644 --- a/i18next/i18next-tests.ts +++ b/i18next/i18next-tests.ts @@ -62,3 +62,5 @@ i18n.t('helloWorld', { defaultValue: 'default', count: 10 }); +const currentLanguage:string = i18n.language; +const userLanguageCodes:string[] = i18n.languages; diff --git a/i18next/i18next.d.ts b/i18next/i18next.d.ts index 9f976fd751..5ced8aecdb 100644 --- a/i18next/i18next.d.ts +++ b/i18next/i18next.d.ts @@ -39,15 +39,15 @@ declare namespace I18next { count?: number; context?: any; replace?: any; - lng?:string; - lngs?:string[]; - fallbackLng?:string; - ns?:string|string[]; - keySeparator?:string; - nsSeparator?:string; - returnObjects?:boolean; - joinArrays?:string; - postProcess?:string|any[]; + lng?: string; + lngs?: string[]; + fallbackLng?: string; + ns?: string | string[]; + keySeparator?: string; + nsSeparator?: string; + returnObjects?: boolean; + joinArrays?: string; + postProcess?: string | any[]; interpolation?: InterpolationOptions; } @@ -56,10 +56,10 @@ declare namespace I18next { resources?: ResourceStore; lng?: string; fallbackLng?: string; - ns?: string|string[]; + ns?: string | string[]; defaultNS?: string; - fallbackNS?: string|string[]; - whitelist?:string[]; + fallbackNS?: string | string[]; + whitelist?: string[]; lowerCaseLng?: boolean; load?: string preload?: string[]; @@ -69,57 +69,72 @@ declare namespace I18next { contextSeparator?: string; saveMissing?: boolean; saveMissingTo?: string; - missingKeyHandler?: (lng:string, ns:string, key:string, fallbackValue:string) => void; - parseMissingKeyHandler?: (key:string) => void; + missingKeyHandler?: (lng: string, ns: string, key: string, fallbackValue: string) => void; + parseMissingKeyHandler?: (key: string) => void; appendNamespaceToMissingKey?: boolean; - postProcess?: string|any[]; + postProcess?: string | any[]; returnNull?: boolean; returnEmptyString?: boolean; returnObjects?: boolean; - returnedObjectHandler?: (key:string, value:string, options:any) => void; + returnedObjectHandler?: (key: string, value: string, options: any) => void; joinArrays?: string; - overloadTranslationOptionHandler?: (args:any[]) => TranslationOptions; + overloadTranslationOptionHandler?: (args: any[]) => TranslationOptions; interpolation?: InterpolationOptions; detection?: any; backend?: any; cache?: any; } - type TranslationFunction = (key:string, options?:TranslationOptions) => string; + type TranslationFunction = (key: string, options?: TranslationOptions) => string; class I18n { - constructor(options?:Options, callback?:(err:any, t:TranslationFunction) => void); + constructor(options?: Options, callback?: (err: any, t: TranslationFunction) => void); - init(options?:Options, callback?:(err:any, t:TranslationFunction) => void):I18n; + init(options?: Options, callback?: (err: any, t: TranslationFunction) => void): I18n; - loadResources(callback?:(err:any) => void):void; + loadResources(callback?: (err: any) => void): void; - use(module:any):I18n; + language: string; - changeLanguage(lng:string, callback?:(err:any, t:TranslationFunction) => void):void; + languages: string[]; - getFixedT(lng?:string, ns?:string|string[]):TranslationFunction; + use(module: any): I18n; - t(key:string, options?:TranslationOptions):string|any|Array; + changeLanguage(lng: string, callback?: (err: any, t: TranslationFunction) => void): void; - exists():boolean; + getFixedT(lng?: string, ns?: string | string[]): TranslationFunction; - setDefaultNamespace(ns:string):void; + t(key: string, options?: TranslationOptions): string | any | Array; - loadNamespaces(ns:string[], callback?:() => void):void; + exists(): boolean; - loadLanguages(lngs:string[], callback?:()=>void):void; + setDefaultNamespace(ns: string): void; - dir(lng?:string):string; + loadNamespaces(ns: string[], callback?: () => void): void; - createInstance(options?:Options, callback?:(err:any, t:TranslationFunction) => void):I18n; + loadLanguages(lngs: string[], callback?: () => void): void; - cloneInstance(options?:Options, callback?:(err:any, t:TranslationFunction) => void):I18n; + dir(lng?: string): string; + + createInstance(options?: Options, callback?: (err: any, t: TranslationFunction) => void): I18n; + + cloneInstance(options?: Options, callback?: (err: any, t: TranslationFunction) => void): I18n; + + on(event: string, listener: () => void): void; + on(initialized: 'initialized', listener: (options: I18next.Options) => void): void; + on(loaded: 'loaded', listener: (loaded: any) => void): void; + on(failedLoading: 'failedLoading', listener: (lng: string, ns: string, msg: string) => void): void; + on(missingKey: 'missingKey', listener: (lngs: any, namespace: string, key: string, res: any) => void): void; + on(added: 'added', listener: (lng: string, ns: string) => void): void; + on(removed: 'removed', listener: (lng: string, ns: string) => void): void; + on(languageChanged: 'languageChanged', listener: (lng: string) => void): void; + + off(event: string, listener: () => void): void; } } declare module 'i18next' { - var i18n:I18next.I18n; + var i18n: I18next.I18n; export = i18n; } diff --git a/imagemapster/imagemapster-tests.ts b/imagemapster/imagemapster-tests.ts new file mode 100644 index 0000000000..7f9ec9d761 --- /dev/null +++ b/imagemapster/imagemapster-tests.ts @@ -0,0 +1,88 @@ +/// +/// + +const areaOptions: ImageMapster.AreaRenderingOptions = { + key: "foo", + includeKeys: "foo", + isMask: true, + toolTip: "tooltip", +}; + +const onClickData: ImageMapster.OnClickData = { + listTarget: $(), + key: "foo", + e: $.Event("click"), + selected: true, +} + +const onMouseData: ImageMapster.OnMouseData = { + key: "foo", + selected: true, + e: $.Event("click"), + options: areaOptions, +}; + +const onGetListData: ImageMapster.OnGetListData = { + key: "foo", + value: "foo", + area: [{}], + options: areaOptions, +}; + +const onStateChangeData: ImageMapster.OnStateChangeData = { + key: "foo", + state: "highlight", + selected: true, +}; + +const onShowToolTipData: ImageMapster.OnShowToolTipData = { + toolTip: $(), + key: "foo", + selected: true, + areaOptions, +}; + +const bool = true; + +const options: ImageMapster.Options = { + mapKey: "foo", + mapValue: "foo", + clickNavigate: true, + listKey: "foo", + listSelectedAttribute: "foo", + listSelectedClass: "foo", + wrapClass: "foo", + wrapCss: "foo", + mouseoutDelay: 123, + sortList: "asc", + configTimeout: 123, + scaleMap: true, + noHrefIsMask: true, + boundList: $(), + showToolTip: true, + toolTipContainer: $(), + toolTipClose: ["area-mouseout", "area-click", "tooltip-click", "image-mouseout"], + onClick: onClickData => {}, + onMouseover: onMouseData => {}, + onMouseout: onMouseData => {}, + onGetList: onGetListData => $(), + onConfigured: bool => {}, + onStateChange: onStateChangeData => {}, + onShowToolTip: onShowToolTipData => {}, +}; + +$("img").mapster(options) +$("img").mapster("select") +$("img").mapster("deselect") +$("img").mapster("set", true, options) +$("img").mapster("get", "foo") +$("img").mapster("highlight", true) +$("img").mapster("unbind", true) +$("img").mapster("snapshot") +$("img").mapster("rebind", options) +$("img").mapster("resize", 123, 123, 123) +$("img").mapster("keys", "foo", true) +$("img").mapster("keys", true) +$("img").mapster("set_options", options) +$("img").mapster("get_options", "foo", true) +$("img").mapster("tooltip", "foo"); diff --git a/imagemapster/imagemapster.d.ts b/imagemapster/imagemapster.d.ts new file mode 100644 index 0000000000..ad9eed3066 --- /dev/null +++ b/imagemapster/imagemapster.d.ts @@ -0,0 +1,996 @@ +// Type definitions for imagemapster 1.2.10 +// Project: http://www.outsharked.com/imagemapster/ +// Definitions by: delphinus +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare namespace ImageMapster { + + type Select = "select"; + type Deselect = "deselect"; + type Set = "set"; + type Get = "get"; + type Highlight = "highlight"; + type Unbind = "unbind"; + type Resize = "resize"; + type Snapshot = "snapshot"; + type Rebind = "rebind"; + type Keys = "keys"; + type SetOptions = "set_options"; + type GetOptions = "get_options"; + type Tooltip = "tooltip"; + type ToolTipCloseEvent = "area-mouseout" | "area-click" | "tooltip-click" | "image-mouseout"; + type State = "highlight" | "select"; + + interface RenderingOptions { + + /** + * fade effect - can only be applied to "render_highlight". + * + * Use a fade effect when highlighting areas on mouseover. + */ + fade?: boolean; + + /** + * The duration of the fade-in effect, in milliseconds. + */ + fadeDuration?: number; + + /** + * highlight areas on mouseover. When null (default), the behavior is + * disabled for mobile browsers. You can explicitly enable or disable + * it by setting this option to a boolean value. + */ + highlight?: boolean; + + /** + * the map or an area on the map can be selected (or deselected). + * + * When true, the image map will function like a multiple-select menu. + * Users can click any area to select or deselect it. When applied to + * the entire map, it determines whether or not the click-selection + * functionality is enabled. When applied to an area, it determines + * whether that individual area (or group) can be selected. By default, + * the map and all areas are selectable. + */ + isSelectable?: boolean; + + /** + * the map or area on the map can be deselected. + * + * Normally true, this option can be used to prevent users from + * unselecting items once they have been selected. When combined with + * singleSelect, the effect is that one and only one option can be + * selected at any given time. Users cannot deselect the active option. + * This provides a menu-like functionality. It is possible for zero + * items to be selected if this is the default state (or the only + * selected item is deselected programatically). + */ + isDeselectable?: boolean; + + /** + * only one area can be selected at a time + * + * When true, only one or zero areas can be selected at any given time. + * If an area is selected and the user selects another area, the + * previously selected area will become deselected. Unlike + * "staticState", this property cannot be overridden by setting areas + * programatically, only one (or zero) areas can ever be selected when + * this option is true. + */ + singleSelect?: boolean; + + /** + * the map or area is permanently in a selected or deselected state. + * + * When true or false, the map or area to which this option applies + * will be permanently selected or deselected. Typically this is more + * useful applied to individual areas that you want to exclude from the + * interactive part of the map. + * + * staticState forces an area to be always selected or deselected. If + * set, this will supercede isSelectable. Something with a staticState + * will always be in that state and it cannot be changed by the user. + * Note that when setting states programatically, this option will not + * be honored; it only affects user interaction. + */ + staticState?: boolean; + + /** + * initial selection state of an area. + * + * The area in question is selected. To set default selections when + * creating a new mapster, use this option for a specific area (see + * above). + */ + selected?: boolean; + + /** + * Use an alternate image of the same size as the imagemap as the + * source for highlight or select effects. + * + * When specified, the mapster will highlight areas using the image + * data obtained from the same area in an alternate image, instead of + * using a fill effect to highlight or select the area. This feature is + * currently available in browsers with HTML5 canvas support. In + * practical terms, this means it will work in all commonly used + * browsers except IE 8 or lower. + * + * If this feature is enabled when an unsupported browser is used, it + * will fall back to the normal highlight method. + * + * The fill, stroke and opacity effects can be specified independently + * from those used for the normal higlight effect. This ensures that + * when your page is viewed with a non-supported browser, you can still + * control the rendering as would be appropriate for a normal + * fill/stroke effect, which may be different from when you're using an + * alternate image. + */ + altImage?: string; + altImageFill?: boolean; + altImageStroke?: boolean; + altImageOpacity?: number; + + /** + * Areas should be flood-filled when moused over or highlighted. + */ + fill?: boolean; + + /** + * The color used for flood fill. + */ + fillColor?: string; + fillColorMask?: string; + + /** + * The opacity of the fill. This is a number from 0 to 1. + */ + fillOpacity?: number; + + /** + * Areas should be outlined when moused over or highlighted. + */ + stroke?: boolean; + + /** + * The color of the outline. + */ + strokeColor?: string; + + /** + * The opacity of the outline. + */ + strokeOpacity?: number; + + /** + * The width of the outline. + */ + strokeWidth?: number; + + /** + * The options below control the way highlighted areas are rendered. + * Each can be applied globally to the map, or to each element, using + * the areas option to pass area-specific options. These options apply + * to either highlighted or selected areas. Highlighting occurs when + * the mouse enters an area on the image map. Selection occurs when an + * area is clicked, and selection is enabled. These options will be + * applied to both situations if present in the root of the options + * object. They can also be applied to one or the other situations + * specifically using the render_highlight and render_select options. + */ + render_highlight?: string | RenderingOptions; + render_select?: string | RenderingOptions; + } + + interface AreaRenderingOptions extends RenderingOptions { + + key: string; + + /** + * when rendering an area or area group, also render the areas in the + * other group (or groups) specified + * + * This is an area-specific option that allows you to create + * supergroups. A supergroup is a collection of groups that will all be + * highlighted simultaneously, but only when the area that defines the + * supergroup is moused over or activated through code. + * + * When the area for which this option has been set is activated, all + * the areas specified in the includeKeys list will also be rendered. + * This is a one-way relationship. Defining a supergroup in an area + * causes all the other groups to be highlighted, but not the other way + * around. + * + * A typical use of this is to define areas that you want to be + * highlighted when the mouse enters some specific area, but that you + * do not want to be highlighted on their own if the target area is + * moused over. This could be a hidden menu, for example: you want the + * menu to display when the hotspot is moused over, but when it's + * hidden, mousing over the menu area itself should have no effect. + */ + includeKeys?: string; + + /** + * the area is a mask rather than a highlighted area. + * + * Normally, every area in an imagemap is an active area, and would be + * highlighted when moused over (unless its behavior was otherwise + * specified with staticState). The isMask option allows you to + * identify an area as being a mask. When a mask is part of an area + * group, the masked area will be specifically excluded from the + * rendering of a highlight or selected state. + * + * This is usually used in conjunction, or instead of, the nohref + * attribute of the area tag. When nohref is specified on an area tag, + * that area is specifically excluded from the hotspot of any area that + * encompasses it. It will not respond to mouse events, and will not be + * highlighted. This can be used to create "holes" in hotspots. By + * default, ImageMapster will treat any area with nohref or no href tag + * as masks, the same as if this option had been applied. + * + * Sometimes you won't be able to use nohref to identify something as a + * mask, for example, if you intend to re-use an area has both a mask, + * and an independent hotspot. This would be typical if you wanted to a + * selectable area that was completely included within another + * selectable area, but functioned independently, such as concentric + * circles. In this case, you would need to identify the inner circle + * as both a mask, and a hotspot. The nohref attribute would make it + * not act as a hotspot, and only function as a mask. You couldn't also + * select the inner area. You can solve this problem by including the + * inner circle in two different groups - one group which is a mask for + * the main area, and another which is an independent selectable area. + * You can specify different options for each group, so even though + * it's just one area, it can function as two completely independent + * ones. + * + * There may also be situations where you do not want an area marked + * with nohref to be treated as a mask. For example, given "area1" and + * "area2," you may want to create a configuration where mousing over + * "area1" causes both "area1" and "area2" to be highlighted, but + * "area2" should not be highlighted on its own when it is moused over. + * In this situation, you'll need to use "nohref" to prevent the hover + * behavior for the area, but you still want it to be treated normally + * when it's rendered as a result of mousing over "area1." You can + * accomplish this using the noHrefIsMask global option, below. + * + * Generally, masked areas will appear as a window to the underlying + * image. If stroke is in effect, the stroke will be rendered for the + * mask as well as the areas, to create both inner and outer borders. + * You can always specifically enable or disable this, or any other + * effect, for any area as desired. + * + */ + isMask?: boolean; + + /** + * tool tip data for an area + * + * When this area-specific option is present and showToolTips = true, a + * toolTipContainer will be created this will be inserted into it, + * either as inner text (if only text as passed) or as HTML if a jQuery + * object is passed. In order to pass anything other than plain text + * using this option you must use a jQuery object. Any string will be + * treated as plain text (and special characters rendered correctly). + */ + toolTip?: string; + } + + interface OnClickData { + + /** + * $(item) from boundList + */ + listTarget?: JQuery; + + /** + * mapKey for this area + */ + key: string; + + e: JQueryEventObject; + selected: boolean; + } + + interface OnStateChangeData { + + /** + * map key + */ + key: string; + + state: "highlight" | "select"; + + /** + * indicating the current state (following the event) + */ + selected: boolean; + } + + interface OnMouseData { + + /** + * area key + */ + key: string; + + /** + * true if area is currently selected + */ + selected: boolean; + + e: JQueryEventObject; + options: AreaRenderingOptions; + } + + interface OnGetListData { + + /** + * primary mapKey for this area or area group + */ + key: string; + + /** + * mapValue for this area or group + */ + value: string; + + /** + * array of areas that make up this group + */ + area: any[]; + + options: AreaRenderingOptions; + } + + interface OnShowToolTipData { + + /** + * jQuery object of the tooltip container + */ + toolTip: JQuery; + + /** + * map key for this area + */ + key: string; + + /** + * current state of the area + */ + selected: boolean; + + areaOptions: AreaRenderingOptions; + } + + interface Options extends RenderingOptions { + + /** + * an attribute identifying each imagemap area. + * + * If specified, this refers to an attribute on the area tags that will + * be used to group them logically. Any areas containing the same + * mapKey will be considered part of a group, and rendered together + * when any of these areas is activated. If you don't want this + * functionality, ensure each key is unique. When mapKey is omitted, + * then each area is considered to be independent from the other and no + * grouping is applied. + * + * When mapKey is present, any area tags that are missing this + * attribute will be excluded from the image map e ntirely. This is + * functionally identical to setting staticState=false for these areas, + * except they will be inaccessible through the API. + * + * ImageMapster will work with any attribute you identify as a key. If + * you wish to maintain HTML compliance, it's recommeded that you use + * attribute names starting with "data-", for example, data-mapkey. Any + * such names are legal for the HTML5 document type. If you are using + * older document types, the class attribute is part of the HTML spec + * for area and will not cause any visual effects, so this is also a + * good choice. It is not recommended to use id, since the values of + * this attribute must be unique. title and alt also will cause + * possibly undesired side effects. + * + * You can specify more than one value in the mapKey attribute, + * separated by commas. This will cause an area to be a member of more + * than one group. The area may have different options in the context + * of each group. When the area is physically moused over, the first + * key listed will identify the group that's effective for that action. + */ + mapKey?: string; + + /** + * an attribute on each area tag containing additional descriptive + * information about an area. + * + * This option is applicable only when using onGetList. When set, the + * data provided to the callback function will include the value of + * this attribute for each group. This can be used to simplify building + * a list with associated information, without having to match against + * another resource. It also ties this information to the image map + * itself. It is not required to use this option when using onGetList. + * + * For example, you could set mapValue: 'data-statename' to an imagemap + * of the united states, and add an attribute to your areas that + * provided the full name of each state, e.g. data-statename="Alaska". + * This text would be included in the onGetList callback, and so you + * could use it to construct an external list of states. + * + * If there are grouped areas (areas with the same key), then the value + * from the first area found with data in this attribute will be used. + */ + mapValue?: string; + + /** + * Clicking on a link should cause the browser to navigate to the href + * whenever it's not a hash sign (#). Version 1.2.4.050 and later + * + * By default, ImageMapster will prevent the default browser behavior + * in image maps, and "select" areas when they are clicked. If you want + * to navigate to the url for an area, use this option. When enabled, + * all areas that have an href attribute, and its value is not empty or + * "#" (just a hashtag). + * + * When area grouping is used, if an href is present for any area in + * the primary group, this will be used as the navigation target. This + * way you don't need to copy the url for every area in groups, rather, + * you can include it on just one, and clicking any area will cause the + * appropraite navigation. + */ + clickNavigate?: boolean; + + /** + * an attribute on items in a boundList that corresponds to the value + * of the mapKey attributes. + * + * This is used to synchronize the actions on the imagemap with the + * actions on a boundList. Each value should match a value from the + * imageMap mapKey tag. Any item in the boundList with missing or + * mismatched data will be ignored. + */ + listKey?: string; + + /** + * attribute to set or remove when an area is selected or deselected + * + * If boundList is present, when a map area is selected, set or remove + * this attribute on the list element that matches that area based on + * their respective keys. + */ + listSelectedAttribute?: string; + + /** + * a class to add or remove when an area is selected or deselected + * + * If a boundList is present, when a map area is selected, this class + * is added or removed from the corresponding list element. This can be + * used to easily create any kind of associated action when areas on + * the map are changed. + */ + listSelectedClass?: string; + + /** + * + * define area-specific options; each object in the array must contain + * a "key" property identifying a valid mapKey, and additional + * rendering options specific to that area or group + */ + areas?: AreaRenderingOptions[], + + /** + * add "classname" class to the wrapper created around the image, or + * copy classes from the image if "true" + */ + wrapClass?: string | boolean; + + /** + * add CSS to the wrapper created around the image + */ + wrapCss?: string | boolean; + + /** + * delay removing highlight when mouse exits an area (1.2.5b36) + * + * Normally, when the user's mouse pointer exits an area, the highlight + * effect is removed immediately. This behavior can be changed with + * this option. Setting it to a positive number causes a delay of n + * milliseconds before the effect is removed. Setting to -1 causes the + * effect to remain active until another hotspot is entered (e.g., it + * will only be removed when superceded by a different area being + * highlighted). + * + * When using mouseoutDelay, the onMouseover event will still be fired + * at the time the user's mouse pointer leaves the area. However, the + * onStateChange event will be delayed until the highlight is actually + * removed. + * + * Whether or not you are using mouseoutDelay, only one area can be + * highlighted at a time. That is, whenever the mouse pointer moves + * onto a new active area, any previously highlighted area will become + * un-highlighted, regardless of any delay in effect. Hovering over a + * new area will always supercede any delay and cause the new area (and + * only the new area) to be highlighted at that time. So, for dense + * imagemaps where most areas adjoin one another, this option may not + * have much effect within the boundaries of the imagemap. Rather, it + * is intended to help keep the higlights active for imagemaps that are + * sparse, or have very small areas. + */ + mouseoutDelay?: number; + + /** + * sort the values before calling onGetList + * + * If a non-false value or "asc" is passed, the list will be sorted in + * ascending order by the area value from mapValue. If "desc" is + * passed, the list will be sorted in descending order. + */ + sortList?: boolean | "asc" | "desc"; + + /** + * time (in milliseconds) to wait for images to load before giving up + * + * When first bound, ImageMapster has to wait for the source image,and + * any altImage images to load before it can finish binding. This is + * necessary because otherwise it's not alwasy possible to know the + * native size of the images. After this period of time, ImageMapster + * will give up. If you have particularly large pages or images, you + * may want to increase this to account for long load times. + */ + configTimeout?: number; + + /** + * Automatically scale imagemaps to match the size of a + * dynamically-scaled image. + * + * When you render an image, you can optionally define a size through + * CSS or using the "height" and "width" attributes. If omitted, the + * image will be displayed in its native size. If included, browsers + * will automatically resize the image to display in the dimensions you + * have provided. + * + * Starting with 1.1.3, ImageMapster will automatically recalculate all + * area data to match the effective size of the image. This means that + * you can set the size of your image to anything you want and + * ImageMapster will work with no changes at all needed to the "area" + * data. + * + * If this behavior is not desired for some reason, this can be + * disabled by setting this option to false. + */ + scaleMap?: boolean; + + /** + * Treat areas containing the onhref attribute (or missing the href + * attribute) as masks. This is true by default. + * + * Set this to "false" to disable automatic masking of these areas. You + * can control them explicitly by creating independent groups for areas + * you wish to mask and assigning the isMask area-specific option when + * using this option. + * + * There are some things to be aware of when using nohref and masking: + * + * * You must put the area that include the nohref attribute before + * other areas that overlap it, or it will be ignored. + * + * * You should also explicitly omit the href tag when using nohref. + * + * * Due to limitations in rendering with VML (e.g. Internet Explorer + * 6-8), it is not possible to create a true mask, which would allow + * the underlying image to show through the masked area. Instead, the + * "masked" areas are rendered on top of the highlighted area in a + * different color. This can be specified for each area (see the + * fillColorMask option below) to create the best possible effect. + */ + noHrefIsMask?: boolean; + + /** + * a jQuery object whose elements are bound to the map. + * + * boundList can be any list of objects. To be bound to the map, they + * must contain an attribute whose name is identified by the option + * listKey, and whose value matches the value in an area tag's mapKey + * attribute. If more than one element in the list has the same value, + * the action will affect all matching elements. + */ + boundList?: JQuery; + + /** + * enable tooltips + * + * When showToolTip is true, mapster will look for a property called + * toolTip in the areas option for a an area. If present, a tool tip + * dialog will be shown on mouseover for that area. It will + * automatically be closed according to the behavior specified by + * toolTipClose. This option does not apply at the item level, but + * rather enables tooltips for the entire map. At the item level, only + * the presence of tooltip data is necessary for a tooltip to appear. + */ + showToolTip?: boolean; + + /** + * HTML describing the popup that will be created for tooltips. + * + * A div with some simple styling is included as the default tooltip + * container. This can be replaced with anything using this option. + * + * When tooltips are rendered, the code attempts to determine the best + * place for it. It will try to position it in near the top-left part + * of the area, and continue to try other corners in order to render it + * within the confines of the container where the image map resides. If + * it can't be placed within the image, it will be placed in the + * lower-right corner and extend outside the image. + */ + toolTipContainer?: string | JQuery; + + /** + * specify the behavior that causes a toolTip to close. + * + * This option should be passed an array of strings that define the + * events that cause active tooltips to close. The array can include + * one or more of the following stings: + * + * 'area-mouseout' - tooltips close when the mouse pointer leaves the + * area that activated it. This is the default. + * + * 'area-click' - tooltips close when another area (or the same one) is + * clicked + * + * 'tooltip-click' - tooltips close when the tooltip itself is clicked + * anywhere + * + * 'image-mouseout' - tooltips close when the mouse pointer leaves the + * image itself. + * + * Under any circumstances, active tooltip will disappear when a new + * one is created. You don't have to define an automatic closing + * behavior; setting this option to an empty array will result in + * tooltips never closing, leaving it to you to close them manually + * though the tooltip method. + */ + toolTipClose?: ToolTipCloseEvent[]; + + /** + * callback when a hotspot area is clicked. Return false to cancel + * default select action, or true to navigate to the 'href' + */ + + /** + * a callback when an area is clicked.:silent doautocmd FocusLost % + * + * This event occurs when the usual click event happens, but includes + * data from the mapster about the area: + * + * This can be used to perform additional actions on a click without + * binding another event and having to obtain information manually. + */ + onClick?: (data: OnClickData) => void; + + /** + * callback when mouse enters a bound area. + * + * This function is called when the mouse enters a bound area. + */ + onMouseover?: (data: OnMouseData) => void; + + /** + * callback when mouse leavesd a bound area. + * + * Callback when the mouse leaves a bound area. The data structure + * passed to the callback is the same as onMouseover. + */ + onMouseout?: (data: OnMouseData) => void; + + /** + * a callback on mapster initialization that provides summary data + * about the image map, and expects a jQuery list to be returned. + * + * This callback allows you to dynamically provide a boundList based on + * summary data from the imagemap itself, rather than providing the + * list up front. The event passes an array of AreaData objects + * + * The client should return a jQuery object containing all the elements + * that make up the bound list, the same as if it was assigned + * manually. + */ + onGetList?: (data: OnGetListData) => JQuery; + + /** + * a callback when the mapster has finished initial configuration + * + * This event is fired when the mapster configuration completes. When + * control execution continues after a first-time bind operation, the + * mapster is not guaranteed to be configured, because images are + * loaded asynchronously by web browsers. If a mapster is bound to an + * image that is not yet loaded, it will attempt to rebind every 200 + * milliseconds. This event will be fired when it is eventually + * successful, or the length of time specified by configTimeout is + * exceeded (default of ten seconds). + * + * The altImage option will also increase the time needed to configure, + * because the alternate image is loaded by the client at configure + * time to ensure it is available immediately when needed. + */ + onConfigured?: (success: boolean) => void; + + /** + * callback when area state is changed (either highlight or select). + * + * onStateChange can be used to get more specific information than the + * mouseover or click events. + */ + onStateChange?: (data: OnStateChangeData) => void; + + /** + * callback when a toolTip is created + * + * This can be used to control tooltip closing behavior directly, if + * desired. + */ + onShowToolTip?: (data: OnShowToolTipData) => void; + } +} + +interface JQuery { + + /** + * + * All images in the jQuery object will be bound. The specific example + * above will attempt to bind to all images present on the page. Each image + * must be bound to an image map identified with the usemap attribute. If + * there is no usemap attribute, or it does not refer to a valid map, then + * the image will be ignored. Therefore you can use this syntax to activate + * all imagemaps on a page. Because pages often contain many images, + * though, it will be faster to select just the image you are targeting + * using a more specific selector. + * + * Images are often not completely loaded when script execution begins. + * ImageMapster will ensure that all images are loaded before it permits + * interaction from the client. If an alternate image is specified, this + * will also be preloaded. + * + * Because images are loaded asynchronously, code execution will often + * return to your script before the ImageMapster is available. If you apply + * other methods to it (such as selecting or deselecting areas), these + * commands will be queued until the image has been loaded, and then + * executed automatically. So you don't need to worry about using callbacks + * for initial configuration. You can assign a function to a callback when + * configuration is complete if needed to perform other setup activities on + * the page. + */ + mapster(options?: ImageMapster.Options): JQuery; + + /** + * select: Cause an area to become selected. This is similar to a user + * click, but will not cause a click event to be fired. + * + * Programatically select elements from the image map. The programmatic + * selection/deselection methods will not honor the staticState property. + */ + mapster(method: ImageMapster.Select): void; + + /** + * deselect: Cause an area to become deselected + * + * The opposite of select, this causes an area to become deselected. If it + * was not previously selected, nothing changes. + */ + mapster(method: ImageMapster.Deselect): void; + + /** + * set: select or deselect an area + * + * Select or deselect elements from jQuery objects wrapping "area" tags on + * the map based on truthiness of selected. If the area represents a bound + * area on the imagemap, it will be selected or deselected. The method can + * be called from an AREA, or from a bound image, passing a specific key as + * a 2nd parameter + * + * If the selected parameter is omitted (or anything other than "true" or + * "false") then the state of each area will be toggled. + * + * You can include an object containing rendering options as the last + * parameter. When present, these will supercede the default and + * area-specific rendering options. + */ + mapster(method: ImageMapster.Set, selected: boolean, options: ImageMapster.RenderingOptions): JQuery; + mapster(method: ImageMapster.Set, options: ImageMapster.RenderingOptions): JQuery; + + /** + * get: get keys for all selected areas + * + * When no "key" parameter is included, returns a comma-separated list of + * keys representing the areas currently selected. If specified, returns + * true or false indicating whether the area specified is selected. + */ + mapster(method: ImageMapster.Get, key?: string): string | boolean; + + /** + * highlight: highlight, clear, or return highlight state + * + * This method is used to control or obtain the current highlight state. + * Setting the highlight does not mimic a mouseover, rather, it only sets + * the highlight. Events and tooltips will not be activated. Even using + * these methods, it is not possible to highlight more than one area at a + * time. If another area is highlighted programatically, any existing + * highlight will be removed. + * + * Once set this way, the highlight will be removed when any user-event + * that would normally cause a highlight to be removed occurs (e.g. moving + * the mouse into any area), or it is removed programatically. + */ + mapster(method: ImageMapster.Highlight, flag?: string | boolean): void; + + /** + * unbind: unbind ImageMapster from an image + * + * Removes the ImageMapster binding from an image and restores it to its + * original state. All visible elements (selections, tooltips) will be + * removed. + * + * If the optional "preserveState" parameter is true, the selection overlay + * and any active tooltips will be preserved. Tooltips can still be + * dismissed by a user click, but once unbound, the selection states can no + * longer be controlled either by the user or programatically. To remove + * them, the actual DOM elements must be removed. + * + * Notes: When a mapster is first bound, several things happen. A div + * element is created which wraps the image. A copy is made of the original + * image, and the original image is set be transparent. This allows + * creating visible elements for the selections & highlights without + * interfering with the image map. Additionally, canvas elements are + * created (for HTML5 browsers), or a VML elements are created for Internet + * Explorer, to render the effects. Profile information about each bound + * image map is stored in memory, and finally, event handlers are bound to + * the image map. + * + * The "unbind" method cleans up these resources: it removes the wrapper, + * restores the image to its original visibility state, and releases + * internal resources. When using 'preserveState', the internal resources + * are cleaned up and event handling is disabled, but HTML elements are not + * removed. Each element created by ImageMapster is assigned a class of + * "mapster_el", which can be used to target them for later removal, though + * it is not easy to complete this process manually because of the wrapper + * and styles applied during configuration, which will be left intact when + * using "preserveState." + */ + mapster(method: ImageMapster.Unbind, preserveState?: boolean): JQuery; + + /** + * snapshot: take a "snapshot" of the current selection state, and reset + * ImageMapster + * + * This option is similar to unbind with preserveState. After a snapshot, + * any active selections will still appear as they did at the time of the + * snapshot, but they are no longer part of the ImageMapster. This is + * useful for configuring an initial state, or creating complex + * representations that may not be easily accomplished with area + * configuration options. + * + * For example, you could bind in image with a specific set of options; + * programatically select some areas; and take a snapshot; then set new + * options that cause a different rendering mode. This way you could have + * certain areas appear differently from the selection highlight, but be + * "highlighted again" using the new rendering options. Any effects in + * place at the time of the snapshot essentially become part of the image + * and are not affected by future operations. + */ + mapster(method: ImageMapster.Snapshot): JQuery; + + /** + * rebind: rebind ImageMapster with new options + * + * This method is similar to set_options, in that its purpose is to change + * options for an existing bound map. However, unlike set_options rebind + * will immediately apply all the new options to the existing map. This + * means that rendering options will change areas that are already selected + * to be rendered with the new options. If you pass area-specific options, + * these will also be applied, e.g. you could cause new areas to be + * selected by passing selected: true in an area specific options. + * + * set_options, in contrast only changes the options, and does not apply + * them to any existing data. When using set_options the new options only + * apply to future actions. + */ + mapster(method: ImageMapster.Rebind, options: ImageMapster.Options): JQuery; + + /** + * resize: change the size of the image and map + * + * This will resize the image map to the dimensions specified. Note that + * either width or height should be passed, and the other will be + * calculated in the same aspect ratio as the original image. If you pass + * both, only the width will be used to calculate the new dimensions: the + * proportions must remain the same as the original image. (Though I intend + * to allow scaling without constraining proportions, it will be difficult + * to make work for certain shapes -- e.g. circles, which would have to + * become ovals). + * + * This method will recalculate and re-render the entire imagemap, so it + * will work exactly the same under the new sizing scheme. When the image + * is unbound, the imagemap will be restored to its original condition. + * + * When using HTML5 canvases, any existing selections, etc. will be + * preserved during the animation. VML data cannot be resized dynamically, + * however, so in IE<9 the selections will be erased, then redrawn when the + * animation is complete. + */ + mapster(method: ImageMapster.Resize, width: number, height: number, duration?: number): JQuery; + + /** + * keys: get the primary mapKey (or comma-separated list of keys) for an + * area, set of areas, or key group. Version 1.2.4.050 + * + * This method allows you to obtain the primary mapKey (or keys) associated + * with another key, or one or more areas. If the all parameter is true, + * the method returns all keys or groups that include the area. + * + * When using area groups, it is possible for more than one key to be + * associated with a map area. It's also possible for an area to be + * highlighted from code as part of a group, but be inaccessible to the + * end-user. This is because area groups are separate physical entities + * from the areas defined by their primary key. They can have different + * options, and are highlighted independently. Note: the way area groups + * work is not well documented here yet. I am working on a more + * comprehensive tutorial for the site. In the meantime please see this + * example which describes area groups in detail, and shows how they work + * through an active demonstration. + * + * There are reasons you may want to be able to access the primary keys + * that make up an area group directly. Perhaps you want to select a group + * of areas using the options from a group - but not as a separate group. + * Perhaps you want to be able to compare the area clicked against a group + * you have defined to take some action if the area is a member of a + * certain group. This method provides access to that information. + * + * This method allows working with groups in a variety of ways by providing + * access to a complete list of primary keys in any group, or all keys + * which contain a given primary key. + */ + mapster(method: ImageMapster.Keys, key: string, all?: boolean): string | string[]; + mapster(method: ImageMapster.Keys, all: boolean): string | string[]; + + /** + * set_options: set active options + * + * When called without the "options" parameter, returns an object with all + * active options. When the parameter is included, the active options are + * updated for the imagemap, and any area options are merged with existing + * area options. Unlike "rebind", this will not rebind or reapply any + * options, but only update the state. This may affect future actions, but + * it will not change any existing state information. + */ + mapster(method: ImageMapster.SetOptions, options?: ImageMapster.Options): JQuery; + + /** + * get_options: get active options + * + * When called with no parameters, returns the options that the mapster was + * configured using. When called with a single key it returns the + * area-specific options assigned to that area. The final parameter + * effective determines whether the actual options in effect for this area, + * or the specific options assigned are returned. + * + * Areas inherit the global options assigned, but can be overridden by + * area-specific options. The "effective" options contain all options + * including those that are inherited, as well as any specifically assigned + * to the area. + */ + mapster(method: ImageMapster.GetOptions, key?: string, effective?: boolean): ImageMapster.Options | ImageMapster.AreaRenderingOptions; + + /** + * tooltip: show/hide tooltips from code + * + * See the tooltip options section below for options to control how + * tooltips appear and are dismissed. + * + * This method can be used to manipulate tooltips from code. If the global + * showToolTip option is false, these methods will still work, so you have + * the ability to control tooltips bound to areas completely using your own + * logic, if desired. These methods can also be used to have better control + * over events needed to close the tooltip, e.g. you could have no tooltip + * closing event, but add a "close" button to your contianer that will + * cause the tooltip to close when clicked. + */ + mapster(method: ImageMapster.Tooltip, key?: string): JQuery; +} diff --git a/immutable/immutable-tests.ts b/immutable/immutable-tests.ts new file mode 100644 index 0000000000..17240ebe9c --- /dev/null +++ b/immutable/immutable-tests.ts @@ -0,0 +1,329 @@ +/// + +import immutable = require('immutable') + +// List tests + +let list: immutable.List = immutable.List([0, 1, 2, 3, 4, 5]); +let list1: immutable.List = immutable.List(list); + +list = immutable.List.of(0, 1, 2, 3, 4); +let bool: boolean = immutable.List.isList(list); + +list = list.set(0, 1); +list = list.delete(0); +list = list.remove(0); +list = list.insert(0, 1); +list = list.clear(); +list = list.push(0, 1, 2, 3, 4, 5); +list = list.pop(); +list = list.unshift(1, 2, 3); +list = list.shift(); +list = list.update((value: immutable.List) => value); +list = list.update(1, (value: number) => value); +list = list.update(1, 1, (value: number) => value); +list = list.merge(list1, list); +list = list.merge([0, 1, 2], [3, 4, 5]); +list = list.mergeWith((prev: number, next: number, key: number) => prev, list, list1); +list = list.mergeWith((prev: number, next: number, key: number) => prev, [0, 1, 2], [3, 4, 5]); +list = list.mergeDeep(list1, list); +list = list.mergeDeep([0, 1, 2], [3, 4, 5]); +list = list.mergeDeepWith((prev: number, next: number, key: number) => prev, list, list1); +list = list.mergeDeepWith((prev: number, next: number, key: number) => prev, [0, 1, 2], [3, 4, 5]); +list = list.setSize(5); +list = list.setIn([0, 1, 2], 5); +list = list.deleteIn([0, 1, 2]); +list = list.removeIn([0, 1, 2]); +list = list.updateIn([0, 1, 2], value => value); +list = list.updateIn([0, 1, 2], 1, value => value); +list = list.mergeIn([0, 1, 2], list, list1); +list = list.mergeIn([0, 1, 2], [0, 1, 2], [3, 4, 5]); +list = list.mergeDeepIn([0, 1, 2], list, list1); +list = list.mergeDeepIn([0, 1, 2], [0, 1, 2], [3, 4, 5]); +list = list.withMutations((mutable: immutable.List) => mutable); +list = list.asMutable(); +list = list.asImmutable(); + +// Collection.Indexed +let indexedSeq: immutable.Seq.Indexed = list.toSeq(); + +// Iterable tests +let value: number = list.get(0); +value = list.get(0, 1); +list = list.interpose(0); +list = list.interleave(list, list1); +list = list.splice(0, 2, 4, 5, 6); +list = list.zip(list1); +let indexedIterable: immutable.Iterable.Indexed = list.zipWith( + (value: number, other: number) => value + other, + list1 +); +let indexedIterable1: immutable.Iterable.Indexed = list.zipWith( + (value: number, other: number, third: number) => value + other + third, + list1, + indexedIterable +); +indexedIterable = list.zipWith( + (value: number, other: number, third: number) => value + other + third, + list1, + indexedIterable1 +); +value = list.indexOf(1); +value = list.lastIndexOf(1); +value = list.findIndex((value: number, index: number, iter: immutable.List) => true); +value = list.findLastIndex((value: number, index: number, iter: immutable.List) => true); +value = list.size; + +bool = list.equals(list1); +value = list.hashCode(); +bool = list.has(1); +bool = list.includes(1); +bool = list.contains(1); +value = list.first(); +value = list.last(); +let toArr: number[] = list.toArray(); +let toMap: immutable.Map = list.toMap(); +let toOrderedMap: immutable.OrderedMap = list.toOrderedMap(); +let toSet: immutable.Set = list.toSet(); +let toOrderedSet: immutable.OrderedSet = list.toOrderedSet(); +list = list.toList(); +let toStack: immutable.Stack = list.toStack(); +let toKeyedSeq: immutable.Seq.Keyed = list.toKeyedSeq(); +indexedSeq = list.toIndexedSeq(); +let toSetSeq: immutable.Seq.Set = list.toSetSeq(); + +let iter: immutable.Iterator = list.keys(); +iter = list.values(); +let iter1: immutable.Iterator<[number, number]> = list.entries(); + +indexedSeq = list.keySeq(); +indexedSeq = list.valueSeq(); +let indexedSeq1: immutable.Seq.Indexed<[number, number]> = list.entrySeq(); + +let iter2: immutable.Iterable = list.map( + (value: number, key: number, iter: immutable.List) => "foo" +) + +list = list.filterNot((value: number, key: number, iter: immutable.List) => true); +list = list.reverse(); +list = list.sort((valA: number, valB: number) => 0); +list = list.sortBy( + (value: number, key: number, iter: immutable.List) => "foo", + (valueA: string, valueB: string) => 0 +); + +let keyedSeq2: immutable.Seq.Keyed> = list.groupBy( + (value: number, key: number, iter: immutable.List) => "" +); + +value = list.forEach((value: number, key: number, iter: immutable.List) => true); +list = list.slice(0, 1); +list = list.rest(); +list = list.butLast(); +list = list.skip(0); +list = list.skipLast(0); +list = list.skipWhile( + (value: number, key: number, iter: immutable.List) => true +); +list = list.take(2); +list = list.takeLast(2); +list = list.takeWhile( + (value: number, key: number, iter: immutable.List) => true +); +list = list.takeUntil( + (value: number, key: number, iter: immutable.List) => true +); +list = list.concat(list1, 2, 3); +list = list.flatten(1); +list = list.flatten(true); +let str: string = list.reduce( + (red: string, value: number, key: number, iter: immutable.List) => red + "bar", + "foo" +); +str = list.reduceRight( + (red: string, value: number, key: number, iter: immutable.List) => red + "bar", + "foo" +); +bool = list.every( + (value: number, key: number, iter: immutable.List) => true +); +bool = list.some( + (value: number, key: number, iter: immutable.List) => true +); +str = list.join(","); +bool = list.isEmpty(); +value = list.count(); +value = list.count( + (value: number, key: number, iter: immutable.List) => true +); +let keyedSeq3: immutable.Seq.Keyed = list.countBy( + (value: number, key: number, iter: immutable.List) => "foo" +); +value = list.find( + (value: number, key: number, iter: immutable.List) => true, + null, + 0 +); +value = list.findLast( + (value: number, key: number, iter: immutable.List) => true, + null, + 0 +); +let tuple: [number, number] = list.findEntry( + (value: number, key: number, iter: immutable.List) => true, + null, + 0 +); +tuple = list.findLastEntry( + (value: number, key: number, iter: immutable.List) => true, + null, + 0 +); +value = list.findKey( + (value: number, key: number, iter: immutable.List) => true, + null +); +value = list.findLastKey( + (value: number, key: number, iter: immutable.List) => true, + null +); +value = list.keyOf(0); +value = list.lastKeyOf(0); +value = list.max((valA: number, valB: number) => 0); +value = list.maxBy( + (value: number, key: number, iter: immutable.List) => "foo", + (valueA: string, valueB: string) => 0 +); +value = list.min((valA: number, valB: number) => 0); +value = list.minBy( + (value: number, key: number, iter: immutable.List) => "foo", + (valueA: string, valueB: string) => 0 +); +bool = list.isSubset(list1); +bool = list.isSubset([0, 1, 2]); +bool = list.isSuperset(list1); +bool = list.isSuperset([0, 1, 2]); + + +// Map tests + +let map: immutable.Map = immutable.Map(); +map = immutable.Map([["foo", 1], ["bar", 2]]); +let map1: immutable.Map = immutable.Map(map); +map = map.set("baz", 3); +map.delete("foo"); +map.remove("foo"); +map = map.clear(); +map = map.update((value: immutable.Map) => value); +map = map.update("foo", (value: number) => value); +map = map.update("bar", 1, (value: number) => value); +map = map.merge(map1, map); +map = map.merge({ "foo": 0, "bar": 1}, {"baz": 2}); +map = map.mergeWith((prev: number, next: number, key: string) => prev, map, map1); +map = map.mergeWith((prev: number, next: number, key: string) => prev,{ "foo": 0, "bar": 1}, {"baz": 2}); +map = map.mergeDeep(map1, map); +map = map.mergeDeep({ "foo": 0, "bar": 1}, {"baz": 2}); +map = map.mergeDeepWith((prev: number, next: number, key: string) => prev, map, map1); +map = map.mergeDeepWith((prev: number, next: number, key: string) => prev, { "foo": 0, "bar": 1}, {"baz": 2}); +map = map.setIn([0, 1, 2], 5); +map = map.deleteIn([0, 1, 2]); +map = map.removeIn([0, 1, 2]); +map = map.updateIn([0, 1, 2], value => value); +map = map.updateIn([0, 1, 2], 1, value => value); +map = map.mergeIn([0, 1, 2], map, map1); +map = map.mergeIn([0, 1, 2], { "foo": 0, "bar": 1}, {"baz": 2}); +map = map.mergeDeepIn([0, 1, 2], map, map1); +map = map.mergeDeepIn([0, 1, 2], { "foo": 0, "bar": 1}, {"baz": 2}); +map = map.withMutations((mutable: immutable.Map) => mutable); +map = map.asMutable(); +map = map.asImmutable(); + +bool = immutable.Map.isMap(map); +map = immutable.Map.of("foo", 0, "bar", 1); + +// OrderedMap tests +bool = immutable.OrderedMap.isOrderedMap(toOrderedMap); +toOrderedMap = immutable.OrderedMap(toOrderedMap); + +// Set tests +let set: immutable.Set = immutable.Set.of(0, 1, 2, 3); +bool = immutable.Set.isSet(set); +set = immutable.Set.fromKeys(toMap); +let set1: immutable.Set = immutable.Set.fromKeys({ "foo": 1, "bar": 2}); +set = immutable.Set(); +set = immutable.Set(set); +set = set.add(3); +set.delete(1); +set.remove(2); +set = set.clear(); +set = set.union(map, list); +set = set.union([1, 2, 3], [4, 5, 6]); +set = set.merge(map1, list); +set = set.merge([1, 2, 3], [4, 5, 6]); +set = set.intersect(map1, list); +set = set.intersect([1, 2, 3], [4, 5, 6]); +set = set.subtract(map1, list); +set = set.subtract([1, 2, 3], [4, 5, 6]); +set = set.withMutations((mutable: immutable.Set) => mutable); +set = set.asMutable(); +set = set.asImmutable(); + + +// OrderedSet tests +bool = immutable.OrderedSet.isOrderedSet(set); +let orderedSet1: immutable.OrderedSet = immutable.OrderedSet.of(0, 1, 2, 3); +orderedSet1 = immutable.OrderedSet.fromKeys(toMap); +let orderedSet2: immutable.Set = immutable.Set.fromKeys({ "foo": 1, "bar": 2}); + +// Stack tests + +let stack: immutable.Stack = immutable.Stack(); +bool = immutable.Stack.isStack(stack); +stack = immutable.Stack.of(0, 1, 2, 3, 4, 5); +stack = immutable.Stack(list); +value = stack.peek(); +stack = stack.clear(); +stack = stack.unshift(0, 1, 2); +stack = stack.unshiftAll(list); +stack = stack.unshiftAll([1, 2, 3]); +stack = stack.shift(); +stack = stack.push(1, 2, 3); +stack = stack.pushAll(list); +stack = stack.pushAll([1, 2, 3]); +stack = stack.pop(); +stack = stack.withMutations((mutable: immutable.Stack) => mutable); +stack = stack.asMutable(); +stack = stack.asImmutable(); + + +// Range and Repeat function tests + +let funcSeqIndexed: immutable.Seq.Indexed = immutable.Range(0, 3, 1); +funcSeqIndexed = immutable.Repeat(2, 10); + + +// Seq tests +let seq: immutable.Seq = immutable.Seq(); +bool = immutable.Seq.isSeq(seq); +funcSeqIndexed = immutable.Seq.of(0, 1, 2, 3); +seq = immutable.Seq(map); +value = seq.size; +seq = seq.cacheResult(); + + +// keyed +let seqKeyed: immutable.Seq.Keyed = immutable.Seq.Keyed(); +seqKeyed = immutable.Seq.Keyed(map); +seqKeyed = seqKeyed.toSeq(); + +// indexed +let seqIndexed: immutable.Seq.Indexed = immutable.Seq.Indexed(); +seqIndexed = immutable.Seq.Indexed.of(0, 1, 2, 3); +seqIndexed = immutable.Seq.Indexed(list); +seqIndexed = seqIndexed.toSeq(); + +// indexed +let seqSet: immutable.Seq.Set = immutable.Seq.Set(); +seqSet = immutable.Seq.Set.of(0, 1, 2, 3); +seqSet = immutable.Seq.Set(list); +seqSet = seqSet.toSeq(); diff --git a/immutable/immutable.d.ts b/immutable/immutable.d.ts new file mode 100644 index 0000000000..86f23bc6e3 --- /dev/null +++ b/immutable/immutable.d.ts @@ -0,0 +1,2546 @@ +// Type definitions for Facebook's Immutable 3.8.1 +// Project: https://github.com/facebook/immutable-js +// Definitions by: tht13 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// Core of typings are from repository itself + +/** + * Copyright (c) 2014-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +/** + * Immutable data encourages pure functions (data-in, data-out) and lends itself + * to much simpler application development and enabling techniques from + * functional programming such as lazy evaluation. + * + * While designed to bring these powerful functional concepts to JavaScript, it + * presents an Object-Oriented API familiar to Javascript engineers and closely + * mirroring that of Array, Map, and Set. It is easy and efficient to convert to + * and from plain Javascript types. + + * Note: all examples are presented in [ES6][]. To run in all browsers, they + * need to be translated to ES3. For example: + * + * // ES6 + * foo.map(x => x * x); + * // ES3 + * foo.map(function (x) { return x * x; }); + * + * [ES6]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/New_in_JavaScript/ECMAScript_6_support_in_Mozilla + */ + +declare namespace Immutable { + + /** + * Deeply converts plain JS objects and arrays to Immutable Maps and Lists. + * + * If a `reviver` is optionally provided, it will be called with every + * collection as a Seq (beginning with the most nested collections + * and proceeding to the top-level collection itself), along with the key + * refering to each collection and the parent JS object provided as `this`. + * For the top level, object, the key will be `""`. This `reviver` is expected + * to return a new Immutable Iterable, allowing for custom conversions from + * deep JS objects. + * + * This example converts JSON to List and OrderedMap: + * + * Immutable.fromJS({a: {b: [10, 20, 30]}, c: 40}, function (key, value) { + * var isIndexed = Immutable.Iterable.isIndexed(value); + * return isIndexed ? value.toList() : value.toOrderedMap(); + * }); + * + * // true, "b", {b: [10, 20, 30]} + * // false, "a", {a: {b: [10, 20, 30]}, c: 40} + * // false, "", {"": {a: {b: [10, 20, 30]}, c: 40}} + * + * If `reviver` is not provided, the default behavior will convert Arrays into + * Lists and Objects into Maps. + * + * `reviver` acts similarly to the [same parameter in `JSON.parse`][1]. + * + * `Immutable.fromJS` is conservative in its conversion. It will only convert + * arrays which pass `Array.isArray` to Lists, and only raw objects (no custom + * prototype) to Map. + * + * Keep in mind, when using JS objects to construct Immutable Maps, that + * JavaScript Object properties are always strings, even if written in a + * quote-less shorthand, while Immutable Maps accept keys of any type. + * + * ```js + * var obj = { 1: "one" }; + * Object.keys(obj); // [ "1" ] + * obj["1"]; // "one" + * obj[1]; // "one" + * + * var map = Map(obj); + * map.get("1"); // "one" + * map.get(1); // undefined + * ``` + * + * Property access for JavaScript Objects first converts the key to a string, + * but since Immutable Map keys can be of any type the argument to `get()` is + * not altered. + * + * [1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#Example.3A_Using_the_reviver_parameter + * "Using the reviver parameter" + */ + export function fromJS( + json: any, + reviver?: (k: any, v: Iterable) => any + ): any; + + + /** + * Value equality check with semantics similar to `Object.is`, but treats + * Immutable `Iterable`s as values, equal if the second `Iterable` includes + * equivalent values. + * + * It's used throughout Immutable when checking for equality, including `Map` + * key equality and `Set` membership. + * + * var map1 = Immutable.Map({a:1, b:1, c:1}); + * var map2 = Immutable.Map({a:1, b:1, c:1}); + * assert(map1 !== map2); + * assert(Object.is(map1, map2) === false); + * assert(Immutable.is(map1, map2) === true); + * + * Note: Unlike `Object.is`, `Immutable.is` assumes `0` and `-0` are the same + * value, matching the behavior of ES6 Map key equality. + */ + export function is(first: any, second: any): boolean; + + + /** + * Lists are ordered indexed dense collections, much like a JavaScript + * Array. + * + * Lists are immutable and fully persistent with O(log32 N) gets and sets, + * and O(1) push and pop. + * + * Lists implement Deque, with efficient addition and removal from both the + * end (`push`, `pop`) and beginning (`unshift`, `shift`). + * + * Unlike a JavaScript Array, there is no distinction between an + * "unset" index and an index set to `undefined`. `List#forEach` visits all + * indices from 0 to size, regardless of whether they were explicitly defined. + */ + export module List { + + /** + * True if the provided value is a List + */ + function isList(maybeList: any): boolean; + + /** + * Creates a new List containing `values`. + */ + function of(...values: T[]): List; + } + + /** + * Create a new immutable List containing the values of the provided + * iterable-like. + */ + export function List(): List; + export function List(iter: Iterable.Indexed): List; + export function List(iter: Iterable.Set): List; + export function List(iter: Iterable.Keyed): List<[K,V]>; + export function List(array: Array): List; + export function List(iterator: Iterator): List; + export function List(iterable: Iterable): List; + + + export interface List extends Collection.Indexed { + + // Persistent changes + + /** + * Returns a new List which includes `value` at `index`. If `index` already + * exists in this List, it will be replaced. + * + * `index` may be a negative number, which indexes back from the end of the + * List. `v.set(-1, "value")` sets the last item in the List. + * + * If `index` larger than `size`, the returned List's `size` will be large + * enough to include the `index`. + */ + set(index: number, value: T): List; + + /** + * Returns a new List which excludes this `index` and with a size 1 less + * than this List. Values at indices above `index` are shifted down by 1 to + * fill the position. + * + * This is synonymous with `list.splice(index, 1)`. + * + * `index` may be a negative number, which indexes back from the end of the + * List. `v.delete(-1)` deletes the last item in the List. + * + * Note: `delete` cannot be safely used in IE8 + * @alias remove + */ + delete(index: number): List; + remove(index: number): List; + + /** + * Returns a new List with `value` at `index` with a size 1 more than this + * List. Values at indices above `index` are shifted over by 1. + * + * This is synonymous with `list.splice(index, 0, value) + */ + insert(index: number, value: T): List; + + /** + * Returns a new List with 0 size and no values. + */ + clear(): List; + + /** + * Returns a new List with the provided `values` appended, starting at this + * List's `size`. + */ + push(...values: T[]): List; + + /** + * Returns a new List with a size ones less than this List, excluding + * the last index in this List. + * + * Note: this differs from `Array#pop` because it returns a new + * List rather than the removed value. Use `last()` to get the last value + * in this List. + */ + pop(): List; + + /** + * Returns a new List with the provided `values` prepended, shifting other + * values ahead to higher indices. + */ + unshift(...values: T[]): List; + + /** + * Returns a new List with a size ones less than this List, excluding + * the first index in this List, shifting all other values to a lower index. + * + * Note: this differs from `Array#shift` because it returns a new + * List rather than the removed value. Use `first()` to get the first + * value in this List. + */ + shift(): List; + + /** + * Returns a new List with an updated value at `index` with the return + * value of calling `updater` with the existing value, or `notSetValue` if + * `index` was not set. If called with a single argument, `updater` is + * called with the List itself. + * + * `index` may be a negative number, which indexes back from the end of the + * List. `v.update(-1)` updates the last item in the List. + * + * @see `Map#update` + */ + update(updater: (value: List) => List): List; + update(index: number, updater: (value: T) => T): List; + update(index: number, notSetValue: T, updater: (value: T) => T): List; + + /** + * @see `Map#merge` + */ + merge(...iterables: Iterable.Indexed[]): List; + merge(...iterables: Array[]): List; + + /** + * @see `Map#mergeWith` + */ + mergeWith( + merger: (previous?: T, next?: T, key?: number) => T, + ...iterables: Iterable.Indexed[] + ): List; + mergeWith( + merger: (previous?: T, next?: T, key?: number) => T, + ...iterables: Array[] + ): List; + + /** + * @see `Map#mergeDeep` + */ + mergeDeep(...iterables: Iterable.Indexed[]): List; + mergeDeep(...iterables: Array[]): List; + + /** + * @see `Map#mergeDeepWith` + */ + mergeDeepWith( + merger: (previous?: T, next?: T, key?: number) => T, + ...iterables: Iterable.Indexed[] + ): List; + mergeDeepWith( + merger: (previous?: T, next?: T, key?: number) => T, + ...iterables: Array[] + ): List; + + /** + * Returns a new List with size `size`. If `size` is less than this + * List's size, the new List will exclude values at the higher indices. + * If `size` is greater than this List's size, the new List will have + * undefined values for the newly available indices. + * + * When building a new List and the final size is known up front, `setSize` + * used in conjunction with `withMutations` may result in the more + * performant construction. + */ + setSize(size: number): List; + + + // Deep persistent changes + + /** + * Returns a new List having set `value` at this `keyPath`. If any keys in + * `keyPath` do not exist, a new immutable Map will be created at that key. + * + * Index numbers are used as keys to determine the path to follow in + * the List. + */ + setIn(keyPath: Array, value: any): List; + setIn(keyPath: Iterable, value: any): List; + + /** + * Returns a new List having removed the value at this `keyPath`. If any + * keys in `keyPath` do not exist, no change will occur. + * + * @alias removeIn + */ + deleteIn(keyPath: Array): List; + deleteIn(keyPath: Iterable): List; + removeIn(keyPath: Array): List; + removeIn(keyPath: Iterable): List; + + /** + * @see `Map#updateIn` + */ + updateIn( + keyPath: Array, + updater: (value: any) => any + ): List; + updateIn( + keyPath: Array, + notSetValue: any, + updater: (value: any) => any + ): List; + updateIn( + keyPath: Iterable, + updater: (value: any) => any + ): List; + updateIn( + keyPath: Iterable, + notSetValue: any, + updater: (value: any) => any + ): List; + + /** + * @see `Map#mergeIn` + */ + mergeIn( + keyPath: Iterable, + ...iterables: Iterable.Indexed[] + ): List; + mergeIn( + keyPath: Array, + ...iterables: Iterable.Indexed[] + ): List; + mergeIn( + keyPath: Array, + ...iterables: Array[] + ): List; + + /** + * @see `Map#mergeDeepIn` + */ + mergeDeepIn( + keyPath: Iterable, + ...iterables: Iterable.Indexed[] + ): List; + mergeDeepIn( + keyPath: Array, + ...iterables: Iterable.Indexed[] + ): List; + mergeDeepIn( + keyPath: Array, + ...iterables: Array[] + ): List; + + + // Transient changes + + /** + * Note: Not all methods can be used on a mutable collection or within + * `withMutations`! Only `set`, `push`, `pop`, `shift`, `unshift` and + * `merge` may be used mutatively. + * + * @see `Map#withMutations` + */ + withMutations(mutator: (mutable: List) => any): List; + + /** + * @see `Map#asMutable` + */ + asMutable(): List; + + /** + * @see `Map#asImmutable` + */ + asImmutable(): List; + } + + + /** + * Immutable Map is an unordered Iterable.Keyed of (key, value) pairs with + * `O(log32 N)` gets and `O(log32 N)` persistent sets. + * + * Iteration order of a Map is undefined, however is stable. Multiple + * iterations of the same Map will iterate in the same order. + * + * Map's keys can be of any type, and use `Immutable.is` to determine key + * equality. This allows the use of any value (including NaN) as a key. + * + * Because `Immutable.is` returns equality based on value semantics, and + * Immutable collections are treated as values, any Immutable collection may + * be used as a key. + * + * Map().set(List.of(1), 'listofone').get(List.of(1)); + * // 'listofone' + * + * Any JavaScript object may be used as a key, however strict identity is used + * to evaluate key equality. Two similar looking objects will represent two + * different keys. + * + * Implemented by a hash-array mapped trie. + */ + export module Map { + + /** + * True if the provided value is a Map + */ + function isMap(maybeMap: any): boolean; + + /** + * Creates a new Map from alternating keys and values + */ + function of(...keyValues: (K|V)[]): Map; + } + + /** + * Creates a new Immutable Map. + * + * Created with the same key value pairs as the provided Iterable.Keyed or + * JavaScript Object or expects an Iterable of [K, V] tuple entries. + * + * var newMap = Map({key: "value"}); + * var newMap = Map([["key", "value"]]); + * + * Keep in mind, when using JS objects to construct Immutable Maps, that + * JavaScript Object properties are always strings, even if written in a + * quote-less shorthand, while Immutable Maps accept keys of any type. + * + * ```js + * var obj = { 1: "one" }; + * Object.keys(obj); // [ "1" ] + * obj["1"]; // "one" + * obj[1]; // "one" + * + * var map = Map(obj); + * map.get("1"); // "one" + * map.get(1); // undefined + * ``` + * + * Property access for JavaScript Objects first converts the key to a string, + * but since Immutable Map keys can be of any type the argument to `get()` is + * not altered. + */ + export function Map(): Map; + export function Map(iter: Iterable.Keyed): Map; + export function Map(iter: Iterable): Map; + export function Map(array: Array<[K,V]>): Map; + export function Map(obj: {[key: string]: V}): Map; + export function Map(iterator: Iterator<[K,V]>): Map; + export function Map(iterable: Iterable): Map; + + export interface Map extends Collection.Keyed { + + // Persistent changes + + /** + * Returns a new Map also containing the new key, value pair. If an equivalent + * key already exists in this Map, it will be replaced. + */ + set(key: K, value: V): Map; + + /** + * Returns a new Map which excludes this `key`. + * + * Note: `delete` cannot be safely used in IE8, but is provided to mirror + * the ES6 collection API. + * @alias remove + */ + delete(key: K): Map; + remove(key: K): Map; + + /** + * Returns a new Map containing no keys or values. + */ + clear(): Map; + + /** + * Returns a new Map having updated the value at this `key` with the return + * value of calling `updater` with the existing value, or `notSetValue` if + * the key was not set. If called with only a single argument, `updater` is + * called with the Map itself. + * + * Equivalent to: `map.set(key, updater(map.get(key, notSetValue)))`. + */ + update(updater: (value: Map) => Map): Map; + update(key: K, updater: (value: V) => V): Map; + update(key: K, notSetValue: V, updater: (value: V) => V): Map; + + /** + * Returns a new Map resulting from merging the provided Iterables + * (or JS objects) into this Map. In other words, this takes each entry of + * each iterable and sets it on this Map. + * + * If any of the values provided to `merge` are not Iterable (would return + * false for `Immutable.Iterable.isIterable`) then they are deeply converted + * via `Immutable.fromJS` before being merged. However, if the value is an + * Iterable but includes non-iterable JS objects or arrays, those nested + * values will be preserved. + * + * var x = Immutable.Map({a: 10, b: 20, c: 30}); + * var y = Immutable.Map({b: 40, a: 50, d: 60}); + * x.merge(y) // { a: 50, b: 40, c: 30, d: 60 } + * y.merge(x) // { b: 20, a: 10, d: 60, c: 30 } + * + */ + merge(...iterables: Iterable[]): Map; + merge(...iterables: {[key: string]: V}[]): Map; + + /** + * Like `merge()`, `mergeWith()` returns a new Map resulting from merging + * the provided Iterables (or JS objects) into this Map, but uses the + * `merger` function for dealing with conflicts. + * + * var x = Immutable.Map({a: 10, b: 20, c: 30}); + * var y = Immutable.Map({b: 40, a: 50, d: 60}); + * x.mergeWith((prev, next) => prev / next, y) // { a: 0.2, b: 0.5, c: 30, d: 60 } + * y.mergeWith((prev, next) => prev / next, x) // { b: 2, a: 5, d: 60, c: 30 } + * + */ + mergeWith( + merger: (previous?: V, next?: V, key?: K) => V, + ...iterables: Iterable[] + ): Map; + mergeWith( + merger: (previous?: V, next?: V, key?: K) => V, + ...iterables: {[key: string]: V}[] + ): Map; + + /** + * Like `merge()`, but when two Iterables conflict, it merges them as well, + * recursing deeply through the nested data. + * + * var x = Immutable.fromJS({a: { x: 10, y: 10 }, b: { x: 20, y: 50 } }); + * var y = Immutable.fromJS({a: { x: 2 }, b: { y: 5 }, c: { z: 3 } }); + * x.mergeDeep(y) // {a: { x: 2, y: 10 }, b: { x: 20, y: 5 }, c: { z: 3 } } + * + */ + mergeDeep(...iterables: Iterable[]): Map; + mergeDeep(...iterables: {[key: string]: V}[]): Map; + + /** + * Like `mergeDeep()`, but when two non-Iterables conflict, it uses the + * `merger` function to determine the resulting value. + * + * var x = Immutable.fromJS({a: { x: 10, y: 10 }, b: { x: 20, y: 50 } }); + * var y = Immutable.fromJS({a: { x: 2 }, b: { y: 5 }, c: { z: 3 } }); + * x.mergeDeepWith((prev, next) => prev / next, y) + * // {a: { x: 5, y: 10 }, b: { x: 20, y: 10 }, c: { z: 3 } } + * + */ + mergeDeepWith( + merger: (previous?: V, next?: V, key?: K) => V, + ...iterables: Iterable[] + ): Map; + mergeDeepWith( + merger: (previous?: V, next?: V, key?: K) => V, + ...iterables: {[key: string]: V}[] + ): Map; + + + // Deep persistent changes + + /** + * Returns a new Map having set `value` at this `keyPath`. If any keys in + * `keyPath` do not exist, a new immutable Map will be created at that key. + */ + setIn(keyPath: Array, value: any): Map; + setIn(KeyPath: Iterable, value: any): Map; + + /** + * Returns a new Map having removed the value at this `keyPath`. If any keys + * in `keyPath` do not exist, no change will occur. + * + * @alias removeIn + */ + deleteIn(keyPath: Array): Map; + deleteIn(keyPath: Iterable): Map; + removeIn(keyPath: Array): Map; + removeIn(keyPath: Iterable): Map; + + /** + * Returns a new Map having applied the `updater` to the entry found at the + * keyPath. + * + * If any keys in `keyPath` do not exist, new Immutable `Map`s will + * be created at those keys. If the `keyPath` does not already contain a + * value, the `updater` function will be called with `notSetValue`, if + * provided, otherwise `undefined`. + * + * var data = Immutable.fromJS({ a: { b: { c: 10 } } }); + * data = data.updateIn(['a', 'b', 'c'], val => val * 2); + * // { a: { b: { c: 20 } } } + * + * If the `updater` function returns the same value it was called with, then + * no change will occur. This is still true if `notSetValue` is provided. + * + * var data1 = Immutable.fromJS({ a: { b: { c: 10 } } }); + * data2 = data1.updateIn(['x', 'y', 'z'], 100, val => val); + * assert(data2 === data1); + * + */ + updateIn( + keyPath: Array, + updater: (value: any) => any + ): Map; + updateIn( + keyPath: Array, + notSetValue: any, + updater: (value: any) => any + ): Map; + updateIn( + keyPath: Iterable, + updater: (value: any) => any + ): Map; + updateIn( + keyPath: Iterable, + notSetValue: any, + updater: (value: any) => any + ): Map; + + /** + * A combination of `updateIn` and `merge`, returning a new Map, but + * performing the merge at a point arrived at by following the keyPath. + * In other words, these two lines are equivalent: + * + * x.updateIn(['a', 'b', 'c'], abc => abc.merge(y)); + * x.mergeIn(['a', 'b', 'c'], y); + * + */ + mergeIn( + keyPath: Iterable, + ...iterables: Iterable[] + ): Map; + mergeIn( + keyPath: Array, + ...iterables: Iterable[] + ): Map; + mergeIn( + keyPath: Array, + ...iterables: {[key: string]: V}[] + ): Map; + + /** + * A combination of `updateIn` and `mergeDeep`, returning a new Map, but + * performing the deep merge at a point arrived at by following the keyPath. + * In other words, these two lines are equivalent: + * + * x.updateIn(['a', 'b', 'c'], abc => abc.mergeDeep(y)); + * x.mergeDeepIn(['a', 'b', 'c'], y); + * + */ + mergeDeepIn( + keyPath: Iterable, + ...iterables: Iterable[] + ): Map; + mergeDeepIn( + keyPath: Array, + ...iterables: Iterable[] + ): Map; + mergeDeepIn( + keyPath: Array, + ...iterables: {[key: string]: V}[] + ): Map; + + + // Transient changes + + /** + * Every time you call one of the above functions, a new immutable Map is + * created. If a pure function calls a number of these to produce a final + * return value, then a penalty on performance and memory has been paid by + * creating all of the intermediate immutable Maps. + * + * If you need to apply a series of mutations to produce a new immutable + * Map, `withMutations()` creates a temporary mutable copy of the Map which + * can apply mutations in a highly performant manner. In fact, this is + * exactly how complex mutations like `merge` are done. + * + * As an example, this results in the creation of 2, not 4, new Maps: + * + * var map1 = Immutable.Map(); + * var map2 = map1.withMutations(map => { + * map.set('a', 1).set('b', 2).set('c', 3); + * }); + * assert(map1.size === 0); + * assert(map2.size === 3); + * + * Note: Not all methods can be used on a mutable collection or within + * `withMutations`! Only `set` and `merge` may be used mutatively. + * + */ + withMutations(mutator: (mutable: Map) => any): Map; + + /** + * Another way to avoid creation of intermediate Immutable maps is to create + * a mutable copy of this collection. Mutable copies *always* return `this`, + * and thus shouldn't be used for equality. Your function should never return + * a mutable copy of a collection, only use it internally to create a new + * collection. If possible, use `withMutations` as it provides an easier to + * use API. + * + * Note: if the collection is already mutable, `asMutable` returns itself. + * + * Note: Not all methods can be used on a mutable collection or within + * `withMutations`! Only `set` and `merge` may be used mutatively. + */ + asMutable(): Map; + + /** + * The yin to `asMutable`'s yang. Because it applies to mutable collections, + * this operation is *mutable* and returns itself. Once performed, the mutable + * copy has become immutable and can be safely returned from a function. + */ + asImmutable(): Map; + } + + + /** + * A type of Map that has the additional guarantee that the iteration order of + * entries will be the order in which they were set(). + * + * The iteration behavior of OrderedMap is the same as native ES6 Map and + * JavaScript Object. + * + * Note that `OrderedMap` are more expensive than non-ordered `Map` and may + * consume more memory. `OrderedMap#set` is amortized O(log32 N), but not + * stable. + */ + + export module OrderedMap { + + /** + * True if the provided value is an OrderedMap. + */ + function isOrderedMap(maybeOrderedMap: any): boolean; + } + + /** + * Creates a new Immutable OrderedMap. + * + * Created with the same key value pairs as the provided Iterable.Keyed or + * JavaScript Object or expects an Iterable of [K, V] tuple entries. + * + * The iteration order of key-value pairs provided to this constructor will + * be preserved in the OrderedMap. + * + * var newOrderedMap = OrderedMap({key: "value"}); + * var newOrderedMap = OrderedMap([["key", "value"]]); + * + */ + export function OrderedMap(): OrderedMap; + export function OrderedMap(iter: Iterable.Keyed): OrderedMap; + export function OrderedMap(iter: Iterable): OrderedMap; + export function OrderedMap(array: Array<[K,V]>): OrderedMap; + export function OrderedMap(obj: {[key: string]: V}): OrderedMap; + export function OrderedMap(iterator: Iterator<[K,V]>): OrderedMap; + export function OrderedMap(iterable: Iterable): OrderedMap; + + export interface OrderedMap extends Map {} + + + /** + * A Collection of unique values with `O(log32 N)` adds and has. + * + * When iterating a Set, the entries will be (value, value) pairs. Iteration + * order of a Set is undefined, however is stable. Multiple iterations of the + * same Set will iterate in the same order. + * + * Set values, like Map keys, may be of any type. Equality is determined using + * `Immutable.is`, enabling Sets to uniquely include other Immutable + * collections, custom value types, and NaN. + */ + export module Set { + + /** + * True if the provided value is a Set + */ + function isSet(maybeSet: any): boolean; + + /** + * Creates a new Set containing `values`. + */ + function of(...values: T[]): Set; + + /** + * `Set.fromKeys()` creates a new immutable Set containing the keys from + * this Iterable or JavaScript Object. + */ + function fromKeys(iter: Iterable): Set; + function fromKeys(obj: {[key: string]: any}): Set; + } + + /** + * Create a new immutable Set containing the values of the provided + * iterable-like. + */ + export function Set(): Set; + export function Set(iter: Iterable.Set): Set; + export function Set(iter: Iterable.Indexed): Set; + export function Set(iter: Iterable.Keyed): Set<[K,V]>; + export function Set(array: Array): Set; + export function Set(iterator: Iterator): Set; + export function Set(iterable: Iterable): Set; + + export interface Set extends Collection.Set { + + // Persistent changes + + /** + * Returns a new Set which also includes this value. + */ + add(value: T): Set; + + /** + * Returns a new Set which excludes this value. + * + * Note: `delete` cannot be safely used in IE8 + * @alias remove + */ + delete(value: T): Set; + remove(value: T): Set; + + /** + * Returns a new Set containing no values. + */ + clear(): Set; + + /** + * Returns a Set including any value from `iterables` that does not already + * exist in this Set. + * @alias merge + */ + union(...iterables: Iterable[]): Set; + union(...iterables: Array[]): Set; + merge(...iterables: Iterable[]): Set; + merge(...iterables: Array[]): Set; + + + /** + * Returns a Set which has removed any values not also contained + * within `iterables`. + */ + intersect(...iterables: Iterable[]): Set; + intersect(...iterables: Array[]): Set; + + /** + * Returns a Set excluding any values contained within `iterables`. + */ + subtract(...iterables: Iterable[]): Set; + subtract(...iterables: Array[]): Set; + + + // Transient changes + + /** + * Note: Not all methods can be used on a mutable collection or within + * `withMutations`! Only `add` may be used mutatively. + * + * @see `Map#withMutations` + */ + withMutations(mutator: (mutable: Set) => any): Set; + + /** + * @see `Map#asMutable` + */ + asMutable(): Set; + + /** + * @see `Map#asImmutable` + */ + asImmutable(): Set; + } + + + /** + * A type of Set that has the additional guarantee that the iteration order of + * values will be the order in which they were `add`ed. + * + * The iteration behavior of OrderedSet is the same as native ES6 Set. + * + * Note that `OrderedSet` are more expensive than non-ordered `Set` and may + * consume more memory. `OrderedSet#add` is amortized O(log32 N), but not + * stable. + */ + export module OrderedSet { + + /** + * True if the provided value is an OrderedSet. + */ + function isOrderedSet(maybeOrderedSet: any): boolean; + + /** + * Creates a new OrderedSet containing `values`. + */ + function of(...values: T[]): OrderedSet; + + /** + * `OrderedSet.fromKeys()` creates a new immutable OrderedSet containing + * the keys from this Iterable or JavaScript Object. + */ + function fromKeys(iter: Iterable): OrderedSet; + function fromKeys(obj: {[key: string]: any}): OrderedSet; + } + + /** + * Create a new immutable OrderedSet containing the values of the provided + * iterable-like. + */ + export function OrderedSet(): OrderedSet; + export function OrderedSet(iter: Iterable.Set): OrderedSet; + export function OrderedSet(iter: Iterable.Indexed): OrderedSet; + export function OrderedSet(iter: Iterable.Keyed): OrderedSet<[K,V]>; + export function OrderedSet(array: Array): OrderedSet; + export function OrderedSet(iterator: Iterator): OrderedSet; + export function OrderedSet(iterable: Iterable): OrderedSet; + + export interface OrderedSet extends Set {} + + + /** + * Stacks are indexed collections which support very efficient O(1) addition + * and removal from the front using `unshift(v)` and `shift()`. + * + * For familiarity, Stack also provides `push(v)`, `pop()`, and `peek()`, but + * be aware that they also operate on the front of the list, unlike List or + * a JavaScript Array. + * + * Note: `reverse()` or any inherent reverse traversal (`reduceRight`, + * `lastIndexOf`, etc.) is not efficient with a Stack. + * + * Stack is implemented with a Single-Linked List. + */ + export module Stack { + + /** + * True if the provided value is a Stack + */ + function isStack(maybeStack: any): boolean; + + /** + * Creates a new Stack containing `values`. + */ + function of(...values: T[]): Stack; + } + + /** + * Create a new immutable Stack containing the values of the provided + * iterable-like. + * + * The iteration order of the provided iterable is preserved in the + * resulting `Stack`. + */ + export function Stack(): Stack; + export function Stack(iter: Iterable.Indexed): Stack; + export function Stack(iter: Iterable.Set): Stack; + export function Stack(iter: Iterable.Keyed): Stack<[K,V]>; + export function Stack(array: Array): Stack; + export function Stack(iterator: Iterator): Stack; + export function Stack(iterable: Iterable): Stack; + + export interface Stack extends Collection.Indexed { + + // Reading values + + /** + * Alias for `Stack.first()`. + */ + peek(): T; + + + // Persistent changes + + /** + * Returns a new Stack with 0 size and no values. + */ + clear(): Stack; + + /** + * Returns a new Stack with the provided `values` prepended, shifting other + * values ahead to higher indices. + * + * This is very efficient for Stack. + */ + unshift(...values: T[]): Stack; + + /** + * Like `Stack#unshift`, but accepts a iterable rather than varargs. + */ + unshiftAll(iter: Iterable): Stack; + unshiftAll(iter: Array): Stack; + + /** + * Returns a new Stack with a size ones less than this Stack, excluding + * the first item in this Stack, shifting all other values to a lower index. + * + * Note: this differs from `Array#shift` because it returns a new + * Stack rather than the removed value. Use `first()` or `peek()` to get the + * first value in this Stack. + */ + shift(): Stack; + + /** + * Alias for `Stack#unshift` and is not equivalent to `List#push`. + */ + push(...values: T[]): Stack; + + /** + * Alias for `Stack#unshiftAll`. + */ + pushAll(iter: Iterable): Stack; + pushAll(iter: Array): Stack; + + /** + * Alias for `Stack#shift` and is not equivalent to `List#pop`. + */ + pop(): Stack; + + + // Transient changes + + /** + * Note: Not all methods can be used on a mutable collection or within + * `withMutations`! Only `set`, `push`, and `pop` may be used mutatively. + * + * @see `Map#withMutations` + */ + withMutations(mutator: (mutable: Stack) => any): Stack; + + /** + * @see `Map#asMutable` + */ + asMutable(): Stack; + + /** + * @see `Map#asImmutable` + */ + asImmutable(): Stack; + } + + + /** + * Returns a Seq.Indexed of numbers from `start` (inclusive) to `end` + * (exclusive), by `step`, where `start` defaults to 0, `step` to 1, and `end` to + * infinity. When `start` is equal to `end`, returns empty range. + * + * Range() // [0,1,2,3,...] + * Range(10) // [10,11,12,13,...] + * Range(10,15) // [10,11,12,13,14] + * Range(10,30,5) // [10,15,20,25] + * Range(30,10,5) // [30,25,20,15] + * Range(30,30,5) // [] + * + */ + export function Range(start?: number, end?: number, step?: number): Seq.Indexed; + + + /** + * Returns a Seq.Indexed of `value` repeated `times` times. When `times` is + * not defined, returns an infinite `Seq` of `value`. + * + * Repeat('foo') // ['foo','foo','foo',...] + * Repeat('bar',4) // ['bar','bar','bar','bar'] + * + */ + export function Repeat(value: T, times?: number): Seq.Indexed; + + + /** + * Creates a new Class which produces Record instances. A record is similar to + * a JS object, but enforce a specific set of allowed string keys, and have + * default values. + * + * var ABRecord = Record({a:1, b:2}) + * var myRecord = new ABRecord({b:3}) + * + * Records always have a value for the keys they define. `remove`ing a key + * from a record simply resets it to the default value for that key. + * + * myRecord.size // 2 + * myRecord.get('a') // 1 + * myRecord.get('b') // 3 + * myRecordWithoutB = myRecord.remove('b') + * myRecordWithoutB.get('b') // 2 + * myRecordWithoutB.size // 2 + * + * Values provided to the constructor not found in the Record type will + * be ignored. For example, in this case, ABRecord is provided a key "x" even + * though only "a" and "b" have been defined. The value for "x" will be + * ignored for this record. + * + * var myRecord = new ABRecord({b:3, x:10}) + * myRecord.get('x') // undefined + * + * Because Records have a known set of string keys, property get access works + * as expected, however property sets will throw an Error. + * + * Note: IE8 does not support property access. Only use `get()` when + * supporting IE8. + * + * myRecord.b // 3 + * myRecord.b = 5 // throws Error + * + * Record Classes can be extended as well, allowing for custom methods on your + * Record. This is not a common pattern in functional environments, but is in + * many JS programs. + * + * Note: TypeScript does not support this type of subclassing. + * + * class ABRecord extends Record({a:1,b:2}) { + * getAB() { + * return this.a + this.b; + * } + * } + * + * var myRecord = new ABRecord({b: 3}) + * myRecord.getAB() // 4 + * + */ + export module Record { + export interface Class { + new (): Map; + new (values: {[key: string]: any}): Map; + new (values: Iterable): Map; // deprecated + + (): Map; + (values: {[key: string]: any}): Map; + (values: Iterable): Map; // deprecated + } + } + + export function Record( + defaultValues: {[key: string]: any}, name?: string + ): Record.Class; + + + /** + * Represents a sequence of values, but may not be backed by a concrete data + * structure. + * + * **Seq is immutable** — Once a Seq is created, it cannot be + * changed, appended to, rearranged or otherwise modified. Instead, any + * mutative method called on a `Seq` will return a new `Seq`. + * + * **Seq is lazy** — Seq does as little work as necessary to respond to any + * method call. Values are often created during iteration, including implicit + * iteration when reducing or converting to a concrete data structure such as + * a `List` or JavaScript `Array`. + * + * For example, the following performs no work, because the resulting + * Seq's values are never iterated: + * + * var oddSquares = Immutable.Seq.of(1,2,3,4,5,6,7,8) + * .filter(x => x % 2).map(x => x * x); + * + * Once the Seq is used, it performs only the work necessary. In this + * example, no intermediate data structures are ever created, filter is only + * called three times, and map is only called once: + * + * console.log(oddSquares.get(1)); // 9 + * + * Seq allows for the efficient chaining of operations, + * allowing for the expression of logic that can otherwise be very tedious: + * + * Immutable.Seq({a:1, b:1, c:1}) + * .flip().map(key => key.toUpperCase()).flip().toObject(); + * // Map { A: 1, B: 1, C: 1 } + * + * As well as expressing logic that would otherwise be memory or time limited: + * + * Immutable.Range(1, Infinity) + * .skip(1000) + * .map(n => -n) + * .filter(n => n % 2 === 0) + * .take(2) + * .reduce((r, n) => r * n, 1); + * // 1006008 + * + * Seq is often used to provide a rich collection API to JavaScript Object. + * + * Immutable.Seq({ x: 0, y: 1, z: 2 }).map(v => v * 2).toObject(); + * // { x: 0, y: 2, z: 4 } + */ + + export module Seq { + /** + * True if `maybeSeq` is a Seq, it is not backed by a concrete + * structure such as Map, List, or Set. + */ + function isSeq(maybeSeq: any): boolean; + + /** + * Returns a Seq of the values provided. Alias for `Seq.Indexed.of()`. + */ + function of(...values: T[]): Seq.Indexed; + + + /** + * `Seq` which represents key-value pairs. + */ + export module Keyed {} + + /** + * Always returns a Seq.Keyed, if input is not keyed, expects an + * iterable of [K, V] tuples. + */ + export function Keyed(): Seq.Keyed; + export function Keyed(seq: Iterable.Keyed): Seq.Keyed; + export function Keyed(seq: Iterable): Seq.Keyed; + export function Keyed(array: Array<[K,V]>): Seq.Keyed; + export function Keyed(obj: {[key: string]: V}): Seq.Keyed; + export function Keyed(iterator: Iterator<[K,V]>): Seq.Keyed; + export function Keyed(iterable: Iterable): Seq.Keyed; + + export interface Keyed extends Seq, Iterable.Keyed { + + /** + * Returns itself + */ + toSeq(): this + } + + + /** + * `Seq` which represents an ordered indexed list of values. + */ + module Indexed { + + /** + * Provides an Seq.Indexed of the values provided. + */ + function of(...values: T[]): Seq.Indexed; + } + + /** + * Always returns Seq.Indexed, discarding associated keys and + * supplying incrementing indices. + */ + export function Indexed(): Seq.Indexed; + export function Indexed(seq: Iterable.Indexed): Seq.Indexed; + export function Indexed(seq: Iterable.Set): Seq.Indexed; + export function Indexed(seq: Iterable.Keyed): Seq.Indexed<[K,V]>; + export function Indexed(array: Array): Seq.Indexed; + export function Indexed(iterator: Iterator): Seq.Indexed; + export function Indexed(iterable: Iterable): Seq.Indexed; + + export interface Indexed extends Seq, Iterable.Indexed { + + /** + * Returns itself + */ + toSeq(): this + } + + + /** + * `Seq` which represents a set of values. + * + * Because `Seq` are often lazy, `Seq.Set` does not provide the same guarantee + * of value uniqueness as the concrete `Set`. + */ + export module Set { + + /** + * Returns a Seq.Set of the provided values + */ + function of(...values: T[]): Seq.Set; + } + + /** + * Always returns a Seq.Set, discarding associated indices or keys. + */ + export function Set(): Seq.Set; + export function Set(seq: Iterable.Set): Seq.Set; + export function Set(seq: Iterable.Indexed): Seq.Set; + export function Set(seq: Iterable.Keyed): Seq.Set<[K,V]>; + export function Set(array: Array): Seq.Set; + export function Set(iterator: Iterator): Seq.Set; + export function Set(iterable: Iterable): Seq.Set; + + export interface Set extends Seq, Iterable.Set { + + /** + * Returns itself + */ + toSeq(): this + } + + } + + /** + * Creates a Seq. + * + * Returns a particular kind of `Seq` based on the input. + * + * * If a `Seq`, that same `Seq`. + * * If an `Iterable`, a `Seq` of the same kind (Keyed, Indexed, or Set). + * * If an Array-like, an `Seq.Indexed`. + * * If an Object with an Iterator, an `Seq.Indexed`. + * * If an Iterator, an `Seq.Indexed`. + * * If an Object, a `Seq.Keyed`. + * + */ + export function Seq(): Seq; + export function Seq(seq: Seq): Seq; + export function Seq(iterable: Iterable): Seq; + export function Seq(array: Array): Seq.Indexed; + export function Seq(obj: {[key: string]: V}): Seq.Keyed; + export function Seq(iterator: Iterator): Seq.Indexed; + export function Seq(iterable: Iterable): Seq.Indexed; + + export interface Seq extends Iterable { + + /** + * Some Seqs can describe their size lazily. When this is the case, + * size will be an integer. Otherwise it will be undefined. + * + * For example, Seqs returned from `map()` or `reverse()` + * preserve the size of the original `Seq` while `filter()` does not. + * + * Note: `Range`, `Repeat` and `Seq`s made from `Array`s and `Object`s will + * always have a size. + */ + size: number/*?*/; + + + // Force evaluation + + /** + * Because Sequences are lazy and designed to be chained together, they do + * not cache their results. For example, this map function is called a total + * of 6 times, as each `join` iterates the Seq of three values. + * + * var squares = Seq.of(1,2,3).map(x => x * x); + * squares.join() + squares.join(); + * + * If you know a `Seq` will be used multiple times, it may be more + * efficient to first cache it in memory. Here, the map function is called + * only 3 times. + * + * var squares = Seq.of(1,2,3).map(x => x * x).cacheResult(); + * squares.join() + squares.join(); + * + * Use this method judiciously, as it must fully evaluate a Seq which can be + * a burden on memory and possibly performance. + * + * Note: after calling `cacheResult`, a Seq will always have a `size`. + */ + cacheResult(): this; + } + + /** + * The `Iterable` is a set of (key, value) entries which can be iterated, and + * is the base class for all collections in `immutable`, allowing them to + * make use of all the Iterable methods (such as `map` and `filter`). + * + * Note: An iterable is always iterated in the same order, however that order + * may not always be well defined, as is the case for the `Map` and `Set`. + */ + export module Iterable { + /** + * True if `maybeIterable` is an Iterable, or any of its subclasses. + */ + function isIterable(maybeIterable: any): boolean; + + /** + * True if `maybeKeyed` is an Iterable.Keyed, or any of its subclasses. + */ + function isKeyed(maybeKeyed: any): boolean; + + /** + * True if `maybeIndexed` is a Iterable.Indexed, or any of its subclasses. + */ + function isIndexed(maybeIndexed: any): boolean; + + /** + * True if `maybeAssociative` is either a keyed or indexed Iterable. + */ + function isAssociative(maybeAssociative: any): boolean; + + /** + * True if `maybeOrdered` is an Iterable where iteration order is well + * defined. True for Iterable.Indexed as well as OrderedMap and OrderedSet. + */ + function isOrdered(maybeOrdered: any): boolean; + + + /** + * Keyed Iterables have discrete keys tied to each value. + * + * When iterating `Iterable.Keyed`, each iteration will yield a `[K, V]` + * tuple, in other words, `Iterable#entries` is the default iterator for + * Keyed Iterables. + */ + export module Keyed {} + + /** + * Creates an Iterable.Keyed + * + * Similar to `Iterable()`, however it expects iterable-likes of [K, V] + * tuples if not constructed from a Iterable.Keyed or JS Object. + */ + export function Keyed(iter: Iterable.Keyed): Iterable.Keyed; + export function Keyed(iter: Iterable): Iterable.Keyed; + export function Keyed(array: Array<[K,V]>): Iterable.Keyed; + export function Keyed(obj: {[key: string]: V}): Iterable.Keyed; + export function Keyed(iterator: Iterator<[K,V]>): Iterable.Keyed; + export function Keyed(iterable: Iterable): Iterable.Keyed; + + export interface Keyed extends Iterable { + + /** + * Returns Seq.Keyed. + * @override + */ + toSeq(): Seq.Keyed; + + + // Sequence functions + + /** + * Returns a new Iterable.Keyed of the same type where the keys and values + * have been flipped. + * + * Seq({ a: 'z', b: 'y' }).flip() // { z: 'a', y: 'b' } + * + */ + flip(): this; + + /** + * Returns a new Iterable.Keyed of the same type with keys passed through + * a `mapper` function. + * + * Seq({ a: 1, b: 2 }) + * .mapKeys(x => x.toUpperCase()) + * // Seq { A: 1, B: 2 } + * + */ + mapKeys( + mapper: (key?: K, value?: V, iter?: this) => M, + context?: any + ): /*this*/Iterable.Keyed; + + /** + * Returns a new Iterable.Keyed of the same type with entries + * ([key, value] tuples) passed through a `mapper` function. + * + * Seq({ a: 1, b: 2 }) + * .mapEntries(([k, v]) => [k.toUpperCase(), v * 2]) + * // Seq { A: 2, B: 4 } + * + */ + mapEntries( + mapper: ( + entry?: [K, V], + index?: number, + iter?: this + ) => [KM, VM], + context?: any + ): /*this*/Iterable.Keyed; + } + + + /** + * Indexed Iterables have incrementing numeric keys. They exhibit + * slightly different behavior than `Iterable.Keyed` for some methods in order + * to better mirror the behavior of JavaScript's `Array`, and add methods + * which do not make sense on non-indexed Iterables such as `indexOf`. + * + * Unlike JavaScript arrays, `Iterable.Indexed`s are always dense. "Unset" + * indices and `undefined` indices are indistinguishable, and all indices from + * 0 to `size` are visited when iterated. + * + * All Iterable.Indexed methods return re-indexed Iterables. In other words, + * indices always start at 0 and increment until size. If you wish to + * preserve indices, using them as keys, convert to a Iterable.Keyed by + * calling `toKeyedSeq`. + */ + export module Indexed {} + + /** + * Creates a new Iterable.Indexed. + */ + export function Indexed(iter: Iterable.Indexed): Iterable.Indexed; + export function Indexed(iter: Iterable.Set): Iterable.Indexed; + export function Indexed(iter: Iterable.Keyed): Iterable.Indexed<[K,V]>; + export function Indexed(array: Array): Iterable.Indexed; + export function Indexed(iterator: Iterator): Iterable.Indexed; + export function Indexed(iterable: Iterable): Iterable.Indexed; + + export interface Indexed extends Iterable { + + // Reading values + + /** + * Returns the value associated with the provided index, or notSetValue if + * the index is beyond the bounds of the Iterable. + * + * `index` may be a negative number, which indexes back from the end of the + * Iterable. `s.get(-1)` gets the last item in the Iterable. + */ + get(index: number, notSetValue?: T): T; + + + // Conversion to Seq + + /** + * Returns Seq.Indexed. + * @override + */ + toSeq(): Seq.Indexed; + + /** + * If this is an iterable of [key, value] entry tuples, it will return a + * Seq.Keyed of those entries. + */ + fromEntrySeq(): Seq.Keyed; + + + // Combination + + /** + * Returns an Iterable of the same type with `separator` between each item + * in this Iterable. + */ + interpose(separator: T): this; + + /** + * Returns an Iterable of the same type with the provided `iterables` + * interleaved into this iterable. + * + * The resulting Iterable includes the first item from each, then the + * second from each, etc. + * + * I.Seq.of(1,2,3).interleave(I.Seq.of('A','B','C')) + * // Seq [ 1, 'A', 2, 'B', 3, 'C' ] + * + * The shortest Iterable stops interleave. + * + * I.Seq.of(1,2,3).interleave( + * I.Seq.of('A','B'), + * I.Seq.of('X','Y','Z') + * ) + * // Seq [ 1, 'A', 'X', 2, 'B', 'Y' ] + */ + interleave(...iterables: Array>): this; + + /** + * Splice returns a new indexed Iterable by replacing a region of this + * Iterable with new values. If values are not provided, it only skips the + * region to be removed. + * + * `index` may be a negative number, which indexes back from the end of the + * Iterable. `s.splice(-2)` splices after the second to last item. + * + * Seq(['a','b','c','d']).splice(1, 2, 'q', 'r', 's') + * // Seq ['a', 'q', 'r', 's', 'd'] + * + */ + splice( + index: number, + removeNum: number, + ...values: Array | T> + ): this; + + /** + * Returns an Iterable of the same type "zipped" with the provided + * iterables. + * + * Like `zipWith`, but using the default `zipper`: creating an `Array`. + * + * var a = Seq.of(1, 2, 3); + * var b = Seq.of(4, 5, 6); + * var c = a.zip(b); // Seq [ [ 1, 4 ], [ 2, 5 ], [ 3, 6 ] ] + * + */ + zip(...iterables: Array>): this; + + /** + * Returns an Iterable of the same type "zipped" with the provided + * iterables by using a custom `zipper` function. + * + * var a = Seq.of(1, 2, 3); + * var b = Seq.of(4, 5, 6); + * var c = a.zipWith((a, b) => a + b, b); // Seq [ 5, 7, 9 ] + * + */ + zipWith( + zipper: (value: T, otherValue: U) => Z, + otherIterable: Iterable + ): Iterable.Indexed; + zipWith( + zipper: (value: T, otherValue: U, thirdValue: V) => Z, + otherIterable: Iterable, + thirdIterable: Iterable + ): Iterable.Indexed; + zipWith( + zipper: (...any: Array) => Z, + ...iterables: Array> + ): Iterable.Indexed; + + + // Search for value + + /** + * Returns the first index at which a given value can be found in the + * Iterable, or -1 if it is not present. + */ + indexOf(searchValue: T): number; + + /** + * Returns the last index at which a given value can be found in the + * Iterable, or -1 if it is not present. + */ + lastIndexOf(searchValue: T): number; + + /** + * Returns the first index in the Iterable where a value satisfies the + * provided predicate function. Otherwise -1 is returned. + */ + findIndex( + predicate: (value?: T, index?: number, iter?: this) => boolean, + context?: any + ): number; + + /** + * Returns the last index in the Iterable where a value satisfies the + * provided predicate function. Otherwise -1 is returned. + */ + findLastIndex( + predicate: (value?: T, index?: number, iter?: this) => boolean, + context?: any + ): number; + } + + + /** + * Set Iterables only represent values. They have no associated keys or + * indices. Duplicate values are possible in Seq.Sets, however the + * concrete `Set` does not allow duplicate values. + * + * Iterable methods on Iterable.Set such as `map` and `forEach` will provide + * the value as both the first and second arguments to the provided function. + * + * var seq = Seq.Set.of('A', 'B', 'C'); + * assert.equal(seq.every((v, k) => v === k), true); + * + */ + export module Set {} + + /** + * Similar to `Iterable()`, but always returns a Iterable.Set. + */ + export function Set(iter: Iterable.Set): Iterable.Set; + export function Set(iter: Iterable.Indexed): Iterable.Set; + export function Set(iter: Iterable.Keyed): Iterable.Set<[K,V]>; + export function Set(array: Array): Iterable.Set; + export function Set(iterator: Iterator): Iterable.Set; + export function Set(iterable: Iterable): Iterable.Set; + + export interface Set extends Iterable { + + /** + * Returns Seq.Set. + * @override + */ + toSeq(): Seq.Set; + } + + } + + /** + * Creates an Iterable. + * + * The type of Iterable created is based on the input. + * + * * If an `Iterable`, that same `Iterable`. + * * If an Array-like, an `Iterable.Indexed`. + * * If an Object with an Iterator, an `Iterable.Indexed`. + * * If an Iterator, an `Iterable.Indexed`. + * * If an Object, an `Iterable.Keyed`. + * + * This methods forces the conversion of Objects and Strings to Iterables. + * If you want to ensure that a Iterable of one item is returned, use + * `Seq.of`. + */ + export function Iterable(iterable: Iterable): Iterable; + export function Iterable(array: Array): Iterable.Indexed; + export function Iterable(obj: {[key: string]: V}): Iterable.Keyed; + export function Iterable(iterator: Iterator): Iterable.Indexed; + export function Iterable(iterable: Iterable): Iterable.Indexed; + export function Iterable(value: V): Iterable.Indexed; + + export interface Iterable { + + // Value equality + + /** + * True if this and the other Iterable have value equality, as defined + * by `Immutable.is()`. + * + * Note: This is equivalent to `Immutable.is(this, other)`, but provided to + * allow for chained expressions. + */ + equals(other: Iterable): boolean; + + /** + * Computes and returns the hashed identity for this Iterable. + * + * The `hashCode` of an Iterable is used to determine potential equality, + * and is used when adding this to a `Set` or as a key in a `Map`, enabling + * lookup via a different instance. + * + * var a = List.of(1, 2, 3); + * var b = List.of(1, 2, 3); + * assert(a !== b); // different instances + * var set = Set.of(a); + * assert(set.has(b) === true); + * + * If two values have the same `hashCode`, they are [not guaranteed + * to be equal][Hash Collision]. If two values have different `hashCode`s, + * they must not be equal. + * + * [Hash Collision]: http://en.wikipedia.org/wiki/Collision_(computer_science) + */ + hashCode(): number; + + + // Reading values + + /** + * Returns the value associated with the provided key, or notSetValue if + * the Iterable does not contain this key. + * + * Note: it is possible a key may be associated with an `undefined` value, + * so if `notSetValue` is not provided and this method returns `undefined`, + * that does not guarantee the key was not found. + */ + get(key: K, notSetValue?: V): V; + + /** + * True if a key exists within this `Iterable`, using `Immutable.is` to determine equality + */ + has(key: K): boolean; + + /** + * True if a value exists within this `Iterable`, using `Immutable.is` to determine equality + * @alias contains + */ + includes(value: V): boolean; + contains(value: V): boolean; + + /** + * The first value in the Iterable. + */ + first(): V; + + /** + * The last value in the Iterable. + */ + last(): V; + + + // Reading deep values + + /** + * Returns the value found by following a path of keys or indices through + * nested Iterables. + */ + getIn(searchKeyPath: Array, notSetValue?: any): any; + getIn(searchKeyPath: Iterable, notSetValue?: any): any; + + /** + * True if the result of following a path of keys or indices through nested + * Iterables results in a set value. + */ + hasIn(searchKeyPath: Array): boolean; + hasIn(searchKeyPath: Iterable): boolean; + + + // Conversion to JavaScript types + + /** + * Deeply converts this Iterable to equivalent JS. + * + * `Iterable.Indexeds`, and `Iterable.Sets` become Arrays, while + * `Iterable.Keyeds` become Objects. + * + * @alias toJSON + */ + toJS(): any; + + /** + * Shallowly converts this iterable to an Array, discarding keys. + */ + toArray(): Array; + + /** + * Shallowly converts this Iterable to an Object. + * + * Throws if keys are not strings. + */ + toObject(): { [key: string]: V }; + + + // Conversion to Collections + + /** + * Converts this Iterable to a Map, Throws if keys are not hashable. + * + * Note: This is equivalent to `Map(this.toKeyedSeq())`, but provided + * for convenience and to allow for chained expressions. + */ + toMap(): Map; + + /** + * Converts this Iterable to a Map, maintaining the order of iteration. + * + * Note: This is equivalent to `OrderedMap(this.toKeyedSeq())`, but + * provided for convenience and to allow for chained expressions. + */ + toOrderedMap(): OrderedMap; + + /** + * Converts this Iterable to a Set, discarding keys. Throws if values + * are not hashable. + * + * Note: This is equivalent to `Set(this)`, but provided to allow for + * chained expressions. + */ + toSet(): Set; + + /** + * Converts this Iterable to a Set, maintaining the order of iteration and + * discarding keys. + * + * Note: This is equivalent to `OrderedSet(this.valueSeq())`, but provided + * for convenience and to allow for chained expressions. + */ + toOrderedSet(): OrderedSet; + + /** + * Converts this Iterable to a List, discarding keys. + * + * Note: This is equivalent to `List(this)`, but provided to allow + * for chained expressions. + */ + toList(): List; + + /** + * Converts this Iterable to a Stack, discarding keys. Throws if values + * are not hashable. + * + * Note: This is equivalent to `Stack(this)`, but provided to allow for + * chained expressions. + */ + toStack(): Stack; + + + // Conversion to Seq + + /** + * Converts this Iterable to a Seq of the same kind (indexed, + * keyed, or set). + */ + toSeq(): Seq; + + /** + * Returns a Seq.Keyed from this Iterable where indices are treated as keys. + * + * This is useful if you want to operate on an + * Iterable.Indexed and preserve the [index, value] pairs. + * + * The returned Seq will have identical iteration order as + * this Iterable. + * + * Example: + * + * var indexedSeq = Immutable.Seq.of('A', 'B', 'C'); + * indexedSeq.filter(v => v === 'B').toString() // Seq [ 'B' ] + * var keyedSeq = indexedSeq.toKeyedSeq(); + * keyedSeq.filter(v => v === 'B').toString() // Seq { 1: 'B' } + * + */ + toKeyedSeq(): Seq.Keyed; + + /** + * Returns an Seq.Indexed of the values of this Iterable, discarding keys. + */ + toIndexedSeq(): Seq.Indexed; + + /** + * Returns a Seq.Set of the values of this Iterable, discarding keys. + */ + toSetSeq(): Seq.Set; + + + // Iterators + + /** + * An iterator of this `Iterable`'s keys. + * + * Note: this will return an ES6 iterator which does not support Immutable JS sequence algorithms. Use `keySeq` instead, if this is what you want. + */ + keys(): Iterator; + + /** + * An iterator of this `Iterable`'s values. + * + * Note: this will return an ES6 iterator which does not support Immutable JS sequence algorithms. Use `valueSeq` instead, if this is what you want. + */ + values(): Iterator; + + /** + * An iterator of this `Iterable`'s entries as `[key, value]` tuples. + * + * Note: this will return an ES6 iterator which does not support Immutable JS sequence algorithms. Use `entrySeq` instead, if this is what you want. + */ + entries(): Iterator<[K, V]>; + + + // Iterables (Seq) + + /** + * Returns a new Seq.Indexed of the keys of this Iterable, + * discarding values. + */ + keySeq(): Seq.Indexed; + + /** + * Returns an Seq.Indexed of the values of this Iterable, discarding keys. + */ + valueSeq(): Seq.Indexed; + + /** + * Returns a new Seq.Indexed of [key, value] tuples. + */ + entrySeq(): Seq.Indexed<[K, V]>; + + + // Sequence algorithms + + /** + * Returns a new Iterable of the same type with values passed through a + * `mapper` function. + * + * Seq({ a: 1, b: 2 }).map(x => 10 * x) + * // Seq { a: 10, b: 20 } + * + */ + map( + mapper: (value?: V, key?: K, iter?: this) => M, + context?: any + ): /*this*/Iterable; + + /** + * Returns a new Iterable of the same type with only the entries for which + * the `predicate` function returns true. + * + * Seq({a:1,b:2,c:3,d:4}).filter(x => x % 2 === 0) + * // Seq { b: 2, d: 4 } + * + */ + filter( + predicate: (value?: V, key?: K, iter?: this) => boolean, + context?: any + ): this; + + /** + * Returns a new Iterable of the same type with only the entries for which + * the `predicate` function returns false. + * + * Seq({a:1,b:2,c:3,d:4}).filterNot(x => x % 2 === 0) + * // Seq { a: 1, c: 3 } + * + */ + filterNot( + predicate: (value?: V, key?: K, iter?: this) => boolean, + context?: any + ): this; + + /** + * Returns a new Iterable of the same type in reverse order. + */ + reverse(): this; + + /** + * Returns a new Iterable of the same type which includes the same entries, + * stably sorted by using a `comparator`. + * + * If a `comparator` is not provided, a default comparator uses `<` and `>`. + * + * `comparator(valueA, valueB)`: + * + * * Returns `0` if the elements should not be swapped. + * * Returns `-1` (or any negative number) if `valueA` comes before `valueB` + * * Returns `1` (or any positive number) if `valueA` comes after `valueB` + * * Is pure, i.e. it must always return the same value for the same pair + * of values. + * + * When sorting collections which have no defined order, their ordered + * equivalents will be returned. e.g. `map.sort()` returns OrderedMap. + */ + sort(comparator?: (valueA: V, valueB: V) => number): this; + + /** + * Like `sort`, but also accepts a `comparatorValueMapper` which allows for + * sorting by more sophisticated means: + * + * hitters.sortBy(hitter => hitter.avgHits); + * + */ + sortBy( + comparatorValueMapper: (value?: V, key?: K, iter?: this) => C, + comparator?: (valueA: C, valueB: C) => number + ): this; + + /** + * Returns a `Iterable.Keyed` of `Iterable.Keyeds`, grouped by the return + * value of the `grouper` function. + * + * Note: This is always an eager operation. + */ + groupBy( + grouper: (value?: V, key?: K, iter?: this) => G, + context?: any + ): Seq.Keyed; + + + // Side effects + + /** + * The `sideEffect` is executed for every entry in the Iterable. + * + * Unlike `Array#forEach`, if any call of `sideEffect` returns + * `false`, the iteration will stop. Returns the number of entries iterated + * (including the last iteration which returned false). + */ + forEach( + sideEffect: (value?: V, key?: K, iter?: this) => any, + context?: any + ): number; + + + // Creating subsets + + /** + * Returns a new Iterable of the same type representing a portion of this + * Iterable from start up to but not including end. + * + * If begin is negative, it is offset from the end of the Iterable. e.g. + * `slice(-2)` returns a Iterable of the last two entries. If it is not + * provided the new Iterable will begin at the beginning of this Iterable. + * + * If end is negative, it is offset from the end of the Iterable. e.g. + * `slice(0, -1)` returns an Iterable of everything but the last entry. If + * it is not provided, the new Iterable will continue through the end of + * this Iterable. + * + * If the requested slice is equivalent to the current Iterable, then it + * will return itself. + */ + slice(begin?: number, end?: number): this; + + /** + * Returns a new Iterable of the same type containing all entries except + * the first. + */ + rest(): this; + + /** + * Returns a new Iterable of the same type containing all entries except + * the last. + */ + butLast(): this; + + /** + * Returns a new Iterable of the same type which excludes the first `amount` + * entries from this Iterable. + */ + skip(amount: number): this; + + /** + * Returns a new Iterable of the same type which excludes the last `amount` + * entries from this Iterable. + */ + skipLast(amount: number): this; + + /** + * Returns a new Iterable of the same type which includes entries starting + * from when `predicate` first returns false. + * + * Seq.of('dog','frog','cat','hat','god') + * .skipWhile(x => x.match(/g/)) + * // Seq [ 'cat', 'hat', 'god' ] + * + */ + skipWhile( + predicate: (value?: V, key?: K, iter?: this) => boolean, + context?: any + ): this; + + /** + * Returns a new Iterable of the same type which includes entries starting + * from when `predicate` first returns true. + * + * Seq.of('dog','frog','cat','hat','god') + * .skipUntil(x => x.match(/hat/)) + * // Seq [ 'hat', 'god' ] + * + */ + skipUntil( + predicate: (value?: V, key?: K, iter?: this) => boolean, + context?: any + ): this; + + /** + * Returns a new Iterable of the same type which includes the first `amount` + * entries from this Iterable. + */ + take(amount: number): this; + + /** + * Returns a new Iterable of the same type which includes the last `amount` + * entries from this Iterable. + */ + takeLast(amount: number): this; + + /** + * Returns a new Iterable of the same type which includes entries from this + * Iterable as long as the `predicate` returns true. + * + * Seq.of('dog','frog','cat','hat','god') + * .takeWhile(x => x.match(/o/)) + * // Seq [ 'dog', 'frog' ] + * + */ + takeWhile( + predicate: (value?: V, key?: K, iter?: this) => boolean, + context?: any + ): this; + + /** + * Returns a new Iterable of the same type which includes entries from this + * Iterable as long as the `predicate` returns false. + * + * Seq.of('dog','frog','cat','hat','god').takeUntil(x => x.match(/at/)) + * // ['dog', 'frog'] + * + */ + takeUntil( + predicate: (value?: V, key?: K, iter?: this) => boolean, + context?: any + ): this; + + + // Combination + + /** + * Returns a new Iterable of the same type with other values and + * iterable-like concatenated to this one. + * + * For Seqs, all entries will be present in + * the resulting iterable, even if they have the same key. + */ + concat(...valuesOrIterables: Array|V>): this; + + /** + * Flattens nested Iterables. + * + * Will deeply flatten the Iterable by default, returning an Iterable of the + * same type, but a `depth` can be provided in the form of a number or + * boolean (where true means to shallowly flatten one level). A depth of 0 + * (or shallow: false) will deeply flatten. + * + * Flattens only others Iterable, not Arrays or Objects. + * + * Note: `flatten(true)` operates on Iterable> and + * returns Iterable + */ + flatten(depth?: number): this; + flatten(shallow?: boolean): this; + + /** + * Flat-maps the Iterable, returning an Iterable of the same type. + * + * Similar to `iter.map(...).flatten(true)`. + */ + flatMap( + mapper: (value?: V, key?: K, iter?: this) => Iterable, + context?: any + ): /*this*/Iterable; + flatMap( + mapper: (value?: V, key?: K, iter?: this) => /*iterable-like*/any, + context?: any + ): /*this*/Iterable; + + + // Reducing a value + + /** + * Reduces the Iterable to a value by calling the `reducer` for every entry + * in the Iterable and passing along the reduced value. + * + * If `initialReduction` is not provided, or is null, the first item in the + * Iterable will be used. + * + * @see `Array#reduce`. + */ + reduce( + reducer: (reduction?: R, value?: V, key?: K, iter?: this) => R, + initialReduction?: R, + context?: any + ): R; + + /** + * Reduces the Iterable in reverse (from the right side). + * + * Note: Similar to this.reverse().reduce(), and provided for parity + * with `Array#reduceRight`. + */ + reduceRight( + reducer: (reduction?: R, value?: V, key?: K, iter?: this) => R, + initialReduction?: R, + context?: any + ): R; + + /** + * True if `predicate` returns true for all entries in the Iterable. + */ + every( + predicate: (value?: V, key?: K, iter?: this) => boolean, + context?: any + ): boolean; + + /** + * True if `predicate` returns true for any entry in the Iterable. + */ + some( + predicate: (value?: V, key?: K, iter?: this) => boolean, + context?: any + ): boolean; + + /** + * Joins values together as a string, inserting a separator between each. + * The default separator is `","`. + */ + join(separator?: string): string; + + /** + * Returns true if this Iterable includes no values. + * + * For some lazy `Seq`, `isEmpty` might need to iterate to determine + * emptiness. At most one iteration will occur. + */ + isEmpty(): boolean; + + /** + * Returns the size of this Iterable. + * + * Regardless of if this Iterable can describe its size lazily (some Seqs + * cannot), this method will always return the correct size. E.g. it + * evaluates a lazy `Seq` if necessary. + * + * If `predicate` is provided, then this returns the count of entries in the + * Iterable for which the `predicate` returns true. + */ + count(): number; + count( + predicate: (value?: V, key?: K, iter?: this) => boolean, + context?: any + ): number; + + /** + * Returns a `Seq.Keyed` of counts, grouped by the return value of + * the `grouper` function. + * + * Note: This is not a lazy operation. + */ + countBy( + grouper: (value?: V, key?: K, iter?: this) => G, + context?: any + ): Seq.Keyed; + + + // Search for value + + /** + * Returns the first value for which the `predicate` returns true. + */ + find( + predicate: (value?: V, key?: K, iter?: this) => boolean, + context?: any, + notSetValue?: V + ): V; + + /** + * Returns the last value for which the `predicate` returns true. + * + * Note: `predicate` will be called for each entry in reverse. + */ + findLast( + predicate: (value?: V, key?: K, iter?: this) => boolean, + context?: any, + notSetValue?: V + ): V; + + /** + * Returns the first [key, value] entry for which the `predicate` returns true. + */ + findEntry( + predicate: (value?: V, key?: K, iter?: this) => boolean, + context?: any, + notSetValue?: V + ): [K, V]; + + /** + * Returns the last [key, value] entry for which the `predicate` + * returns true. + * + * Note: `predicate` will be called for each entry in reverse. + */ + findLastEntry( + predicate: (value?: V, key?: K, iter?: this) => boolean, + context?: any, + notSetValue?: V + ): [K, V]; + + /** + * Returns the key for which the `predicate` returns true. + */ + findKey( + predicate: (value?: V, key?: K, iter?: this) => boolean, + context?: any + ): K; + + /** + * Returns the last key for which the `predicate` returns true. + * + * Note: `predicate` will be called for each entry in reverse. + */ + findLastKey( + predicate: (value?: V, key?: K, iter?: this) => boolean, + context?: any + ): K; + + /** + * Returns the key associated with the search value, or undefined. + */ + keyOf(searchValue: V): K; + + /** + * Returns the last key associated with the search value, or undefined. + */ + lastKeyOf(searchValue: V): K; + + /** + * Returns the maximum value in this collection. If any values are + * comparatively equivalent, the first one found will be returned. + * + * The `comparator` is used in the same way as `Iterable#sort`. If it is not + * provided, the default comparator is `>`. + * + * When two values are considered equivalent, the first encountered will be + * returned. Otherwise, `max` will operate independent of the order of input + * as long as the comparator is commutative. The default comparator `>` is + * commutative *only* when types do not differ. + * + * If `comparator` returns 0 and either value is NaN, undefined, or null, + * that value will be returned. + */ + max(comparator?: (valueA: V, valueB: V) => number): V; + + /** + * Like `max`, but also accepts a `comparatorValueMapper` which allows for + * comparing by more sophisticated means: + * + * hitters.maxBy(hitter => hitter.avgHits); + * + */ + maxBy( + comparatorValueMapper: (value?: V, key?: K, iter?: this) => C, + comparator?: (valueA: C, valueB: C) => number + ): V; + + /** + * Returns the minimum value in this collection. If any values are + * comparatively equivalent, the first one found will be returned. + * + * The `comparator` is used in the same way as `Iterable#sort`. If it is not + * provided, the default comparator is `<`. + * + * When two values are considered equivalent, the first encountered will be + * returned. Otherwise, `min` will operate independent of the order of input + * as long as the comparator is commutative. The default comparator `<` is + * commutative *only* when types do not differ. + * + * If `comparator` returns 0 and either value is NaN, undefined, or null, + * that value will be returned. + */ + min(comparator?: (valueA: V, valueB: V) => number): V; + + /** + * Like `min`, but also accepts a `comparatorValueMapper` which allows for + * comparing by more sophisticated means: + * + * hitters.minBy(hitter => hitter.avgHits); + * + */ + minBy( + comparatorValueMapper: (value?: V, key?: K, iter?: this) => C, + comparator?: (valueA: C, valueB: C) => number + ): V; + + + // Comparison + + /** + * True if `iter` includes every value in this Iterable. + */ + isSubset(iter: Iterable): boolean; + isSubset(iter: Array): boolean; + + /** + * True if this Iterable includes every value in `iter`. + */ + isSuperset(iter: Iterable): boolean; + isSuperset(iter: Array): boolean; + + + /** + * Note: this is here as a convenience to work around an issue with + * TypeScript https://github.com/Microsoft/TypeScript/issues/285, but + * Iterable does not define `size`, instead `Seq` defines `size` as + * nullable number, and `Collection` defines `size` as always a number. + * + * @ignore + */ + size: number; + } + + + /** + * Collection is the abstract base class for concrete data structures. It + * cannot be constructed directly. + * + * Implementations should extend one of the subclasses, `Collection.Keyed`, + * `Collection.Indexed`, or `Collection.Set`. + */ + export module Collection { + + + /** + * `Collection` which represents key-value pairs. + */ + export module Keyed {} + + export interface Keyed extends Collection, Iterable.Keyed { + + /** + * Returns Seq.Keyed. + * @override + */ + toSeq(): Seq.Keyed; + } + + + /** + * `Collection` which represents ordered indexed values. + */ + export module Indexed {} + + export interface Indexed extends Collection, Iterable.Indexed { + + /** + * Returns Seq.Indexed. + * @override + */ + toSeq(): Seq.Indexed; + } + + + /** + * `Collection` which represents values, unassociated with keys or indices. + * + * `Collection.Set` implementations should guarantee value uniqueness. + */ + export module Set {} + + export interface Set extends Collection, Iterable.Set { + + /** + * Returns Seq.Set. + * @override + */ + toSeq(): Seq.Set; + } + + } + + export interface Collection extends Iterable { + + /** + * All collections maintain their current `size` as an integer. + */ + size: number; + } + + + /** + * ES6 Iterator. + * + * This is not part of the Immutable library, but a common interface used by + * many types in ES6 JavaScript. + * + * @ignore + */ + export interface Iterator { + next(): { value: T; done: boolean; } + } + +} + +declare module "immutable" { + export = Immutable; +} diff --git a/interactjs/interact-tests.ts b/interactjs/interact-tests.ts index 90f43a9668..c7df68f3a4 100644 --- a/interactjs/interact-tests.ts +++ b/interactjs/interact-tests.ts @@ -1,6 +1,6 @@ /// -import interact = require("interact"); +import interact = require("interact.js"); var button: HTMLElement = document.createElement("BUTTON"); var rectangle: ClientRect = { @@ -11,7 +11,9 @@ var rectangle: ClientRect = { bottom: 100, height: 100 }; -var interactable = interact(button); +let context = document.createElement("a"); +let interactable = interact(".foo", {context: context}); +interactable = interact(button); interactable.draggable(); interactable.draggable(true); diff --git a/interactjs/interact.d.ts b/interactjs/interact.d.ts index 5283e73fe9..2a547450d5 100644 --- a/interactjs/interact.d.ts +++ b/interactjs/interact.d.ts @@ -200,6 +200,7 @@ declare namespace Interact { (element: HTMLElement): Interactable; (element: SVGElement): Interactable; (element: string): Interactable; + (element: string, {context: Element}): Interactable; // returns boolean or {[key: string]: any} autoScroll(): any; autoScroll(options: boolean): InteractStatic; @@ -242,6 +243,6 @@ declare namespace Interact { declare var interact: Interact.InteractStatic; -declare module "interact" { +declare module "interact.js" { export = interact; } diff --git a/intl-tel-input/intl-tel-input-tests.ts b/intl-tel-input/intl-tel-input-tests.ts new file mode 100644 index 0000000000..c10acfffa0 --- /dev/null +++ b/intl-tel-input/intl-tel-input-tests.ts @@ -0,0 +1,69 @@ +/// +/// + +$('#phone').intlTelInput(); + +$('#phone').intlTelInput({ + customPlaceholder: function(selectedCountryPlaceholder, selectedCountryData) { + return 'e.g. ' + selectedCountryPlaceholder; + } +}); + +$('#phone').intlTelInput({ + geoIpLookup: function(callback) { + $.get('http://ipinfo.io', function() {}, 'jsonp').always(function(resp) { + let countryCode = (resp && resp.country) ? resp.country : ''; + callback(countryCode); + }); + } +}); + +$('#phone').intlTelInput('destroy'); + +let extension = $('#phone').intlTelInput('getExtension'); + +let intlNumber = $('#phone').intlTelInput('getNumber'); +let ntlNumber = $('#phone').intlTelInput('getNumber', intlTelInputUtils.numberFormat.NATIONAL); + +let numberType = $('#phone').intlTelInput('getNumberType'); +if (numberType === intlTelInputUtils.numberType.MOBILE) {} + +let selectedCountryData = $('#phone').intlTelInput('getSelectedCountryData'); + +let error = $('#phone').intlTelInput('getValidationError'); +if (error === intlTelInputUtils.validationError.TOO_SHORT) {} + +let isValid = $('#phone').intlTelInput('isValidNumber'); + +$('#phone').intlTelInput('setCountry', 'gb'); + +$('#phone').intlTelInput('setNumber', '+447733123456'); + +let countryData = $.fn.intlTelInput.getCountryData(); + +$.fn.intlTelInput.loadUtils('build/js/utils.js'); + +$('#phone').intlTelInput({ + utilsScript: '../../build/js/utils.js' +}); + +$('#phone').intlTelInput({ + initialCountry: 'auto', + geoIpLookup: function(callback) { + $.get('http://ipinfo.io', function() {}, 'jsonp').always(function(resp) { + let countryCode = (resp && resp.country) ? resp.country : ''; + callback(countryCode); + }); + }, + utilsScript: '../../build/js/utils.js' +}); + +$('#phone').intlTelInput({ + nationalMode: true, + utilsScript: '../../build/js/utils.js' +}); + +$('#phone').intlTelInput({ + onlyCountries: ['al'], + utilsScript: '../../build/js/utils.js' +}); diff --git a/intl-tel-input/intl-tel-input.d.ts b/intl-tel-input/intl-tel-input.d.ts new file mode 100644 index 0000000000..c092084738 --- /dev/null +++ b/intl-tel-input/intl-tel-input.d.ts @@ -0,0 +1,238 @@ +// Type definitions for intl-tel-input +// Project: https://github.com/jackocnr/intl-tel-input +// Definitions by: Fidan Hakaj +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// Static methods that are defined in JQueryStatic.fn are not typed +// as jquery.d.ts has no interface for fn +// https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/jquery/jquery.d.ts#L958 +// fn: any; //TODO: Decide how we want to type this + +/// + +declare namespace IntlTelInput { + + interface Options { + /** + * Whether or not to allow the dropdown. If disabled, there is no dropdown + * arrow, and the selected flag is not clickable. Also we display the + * selected flag on the right instead because it is just a marker of state. + */ + allowDropdown?: boolean; + /** + * If there is just a dial code in the input: remove it on blur or submit, + * and re-add it on focus. This is to prevent just a dial code getting + * submitted with the form. Requires nationalMode to be set to false. + */ + autoHideDialCode?: boolean; + /** + * Set the input's placeholder to an example number for the selected country. + * You can specify the number type using the numberType option. + * If there is already a placeholder attribute set on the input then that + * will take precedence. Requires the utilsScript option. + */ + autoPlaceholder?: boolean; + /** + * Change the placeholder generated by autoPlaceholder. Must return a string. + */ + customPlaceholder?: (selectedCountryPlaceholder: string, selectedCountryData: CountryData) => string; + /** + * Specify the container for the country dropdown (use a jQuery selector + * e.g. "body"). This is useful when the input is within a scrolling element, + * or an element with overflow: hidden. Wherever you put the dropdown it + * will automatically close on the window scroll event to prevent positioning + * issues. If you want it to close when a different element is scrolled + * (such as the input's parent), simply listen for the that scroll event, + * and trigger $(window).scroll() e.g. + */ + dropdownContainer?: string; + /** + * Don't display the countries you specify. + */ + excludeCountries?: Array; + /** + * Format the input value during initialisation. + */ + formatOnInit?: boolean; + /** + * When setting initialCountry to "auto", you must use this option to + * specify a custom function that looks up the user's location. Also note + * that when instantiating the plugin, we now return a deferred object, so + * you can use .done(callback) to know when initialisation requests like + * this have completed. + * Note that the callback must still be called in the event of an error. + */ + geoIpLookup?: (callback: (countryCode: string) => void) => void; + /** + * Set the initial country selection by specifying it's country code. + * You can also set it to "auto", which will lookup the user's country based + * on their IP address (requires the geoIpLookup option). + * Note that the "auto" option will not update the country selection if the + * input already contains a number. If you leave initialCountry blank, + * it will default to the first country in the list. + */ + initialCountry?: string; + /** + * Allow users to enter national numbers (and not have to think about + * international dial codes). Formatting, validation and placeholders still + * work. Then you can use getNumber to extract a full international number. + * This option now defaults to true, and it is recommended that you leave it + * that way as it provides a better experience for the user. + */ + nationalMode?: boolean; + /** + * Specify one of the keys from the global enum intlTelInputUtils.numberType + * e.g. "FIXED_LINE" to tell the plugin you're expecting that type of number. + * Currently this is only used to set the placeholder to the right type of number. + */ + numberType?: string; + /** + * Display only the countries you specify. + */ + onlyCountries?: Array; + /** + * Specify the countries to appear at the top of the list. + */ + preferredCountries?: Array; + /** + * Display the country dial code next to the selected flag so it's not part + * of the typed number. Note that this will disable nationalMode because + * technically we are dealing with international numbers, but with the + * dial code separated. + */ + separateDialCode?: boolean; + /** + * Enable formatting/validation etc. by specifying the path to the included + * utils.js script, which is fetched only when the page has finished loading + * (on window.load) to prevent blocking. When instantiating the plugin, + * we return a deferred object, so you can use .done(callback) to know when + * initialisation requests like this have finished. Note that if you're + * lazy loading the plugin script itself (intlTelInput.js) this will not + * work and you will need to use the loadUtils method instead. + */ + utilsScript?: string; + } + + interface CountryData { + name: string; + iso2: string; + dialCode: string; + } +} + +declare namespace intlTelInputUtils { + + const enum numberFormat { + E164 = 0, + INTERNATIONAL = 1, + NATIONAL = 2, + RFC3966 = 3 + } + + const enum numberType { + FIXED_LINE = 0, + MOBILE = 1, + FIXED_LINE_OR_MOBILE = 2, + TOLL_FREE = 3, + PREMIUM_RATE = 4, + SHARED_COST = 5, + VOIP = 6, + PERSONAL_NUMBER = 7, + PAGER = 8, + UAN = 9, + VOICEMAIL = 10, + UNKNOWN = -1 + } + + const enum validationError { + IS_POSSIBLE = 0, + INVALID_COUNTRY_CODE = 1, + TOO_SHORT = 2, + TOO_LONG = 3, + NOT_A_NUMBER = 4 + } +} + +interface JQuery { + /** + * Remove the plugin from the input, and unbind any event listeners. + */ + intlTelInput(method: 'destroy'): void; + /** + * Get the extension from the current number. + * Requires the utilsScript option. + * e.g. if the input value was "(702) 555-5555 ext. 1234", this would + * return "1234". + */ + intlTelInput(method: 'getExtension'): string; + /** + * Get the current number in the given format (defaults to E.164 standard). + * The different formats are available in the enum + * intlTelInputUtils.numberFormat - taken from here. + * Requires the utilsScript option. + * Note that even if nationalMode is enabled, this can still return a full + * international number. + */ + intlTelInput(method: 'getNumber'): string; + /** + * Get the type (fixed-line/mobile/toll-free etc) of the current number. + * Requires the utilsScript option. + * Returns an integer, which you can match against the various options in the + * global enum intlTelInputUtils.numberType. + * Note that in the US there's no way to differentiate between fixed-line and + * mobile numbers, so instead it will return FIXED_LINE_OR_MOBILE. + */ + intlTelInput(method: 'getNumberType'): intlTelInputUtils.numberType; + /** + * Get the country data for the currently selected flag. + */ + intlTelInput(method: 'getSelectedCountryData'): IntlTelInput.CountryData; + /** + * Get more information about a validation error. + * Requires the utilsScript option. + * Returns an integer, which you can match against the various options in the + * global enum intlTelInputUtils.validationError + */ + intlTelInput(method: 'getValidationError'): intlTelInputUtils.validationError; + /** + * Validate the current number. Expects an internationally formatted number + * (unless nationalMode is enabled). If validation fails, you can use + * getValidationError to get more information. + * Requires the utilsScript option. + * Also see getNumberType if you want to make sure the user enters a certain + * type of number e.g. a mobile number. + */ + intlTelInput(method: 'isValidNumber'): boolean; + intlTelInput(method: string): void; + /** + * Change the country selection (e.g. when the user is entering their address). + * @param countryCode country code of the country to be set. + */ + intlTelInput(method: 'setCountry', countryCode: string): void; + /** + * Insert a number, and update the selected flag accordingly. + * Note that by default, if nationalMode is enabled it will try to use + * national formatting. + * @param aNumber number to be set. + */ + intlTelInput(method: 'setNumber', aNumber: string): void; + intlTelInput(method: string, value: string): void; + + /** + * Get the current number in the given format (defaults to E.164 standard). + * The different formats are available in the enum + * intlTelInputUtils.numberFormat - taken from here. + * Requires the utilsScript option. + * Note that even if nationalMode is enabled, this can still return a full + * international number. + * @param numberFormat the format in which the number will be returned. + */ + intlTelInput(method: 'getNumber', numberFormat: intlTelInputUtils.numberFormat): string; + intlTelInput(method: string, numberFormat: intlTelInputUtils.numberFormat): string; + + /** + * initialise the plugin with optional options. + * @param options options that can be provided during initialization. + */ + intlTelInput(options?: IntlTelInput.Options): JQueryDeferred; +} diff --git a/inversify-binding-decorators/inversify-binding-decorators-tests.ts b/inversify-binding-decorators/inversify-binding-decorators-tests.ts new file mode 100644 index 0000000000..9b0dff520e --- /dev/null +++ b/inversify-binding-decorators/inversify-binding-decorators-tests.ts @@ -0,0 +1,159 @@ +/// + +import { inject, Kernel } from "inversify"; +import { autoProvide, makeProvideDecorator, makeFluentProvideDecorator } from "inversify-binding-decorators"; + +module decorator { + let kernel = new Kernel(); + let provide = makeProvideDecorator(kernel); + + interface INinja { + fight(): string; + sneak(): string; + } + + interface IKatana { + hit(): string; + } + + interface IShuriken { + throw(): string; + } + + let TYPE = { + IKatana: "IKatana", + INinja: "INinja", + IShuriken: "IShuriken" + }; + + @provide(TYPE.IKatana) + class Katana implements IKatana { + public hit() { + return "cut!"; + } + } + + @provide(TYPE.IShuriken) + class Shuriken implements IShuriken { + public throw() { + return "hit!"; + } + } + + @provide(TYPE.INinja) + class Ninja implements INinja { + + private _katana: IKatana; + private _shuriken: IShuriken; + + public constructor( + @inject("IKatana") katana: IKatana, + @inject("IShuriken") shuriken: IShuriken + ) { + this._katana = katana; + this._shuriken = shuriken; + } + + public fight() { return this._katana.hit(); }; + public sneak() { return this._shuriken.throw(); }; + + } + + let ninja = kernel.get(TYPE.INinja); + console.log(ninja); + +} + +module fluent_decorator { + let kernel = new Kernel(); + let provide = makeFluentProvideDecorator(kernel); + + let provideSingleton = function(identifier: string) { + return provide(identifier).inSingletonScope().done(); + }; + + let provideTransient = function(identifier: string) { + return provide(identifier).done(); + }; + + interface INinja { + fight(): string; + sneak(): string; + } + + interface IKatana { + hit(): string; + } + + interface IShuriken { + throw(): string; + } + + let TYPE = { + IKatana: "IKatana", + INinja: "INinja", + IShuriken: "IShuriken" + }; + + @provideSingleton(TYPE.IKatana) + class Katana implements IKatana { + private _mark: any; + public constructor() { + this._mark = Math.random(); + } + public hit() { + return "cut! " + this._mark; + } + } + + @provideTransient(TYPE.IShuriken) + class Shuriken implements IShuriken { + private _mark: any; + public constructor() { + this._mark = Math.random(); + } + public throw() { + return "hit! " + this._mark; + } + } + + @provideTransient(TYPE.INinja) + class Ninja implements INinja { + + private _katana: IKatana; + private _shuriken: IShuriken; + + public constructor( + @inject("IKatana") katana: IKatana, + @inject("IShuriken") shuriken: IShuriken + ) { + this._katana = katana; + this._shuriken = shuriken; + } + + public fight() { return this._katana.hit(); }; + public sneak() { return this._shuriken.throw(); }; + + } + + let ninja = kernel.get(TYPE.INinja); + console.log(ninja); + +} + +module auto_provide { + + let warriors = { + Ninja: class Ninja {}, + Samurai: class Samurai {} + }; + + let weapons = { + Katana: class Katana {}, + Shuriken: class Shuriken {}, + }; + + let kernel = new Kernel(); + autoProvide(kernel, warriors, weapons); + +} diff --git a/inversify-binding-decorators/inversify-binding-decorators.d.ts b/inversify-binding-decorators/inversify-binding-decorators.d.ts new file mode 100644 index 0000000000..623b6c32c7 --- /dev/null +++ b/inversify-binding-decorators/inversify-binding-decorators.d.ts @@ -0,0 +1,55 @@ +// Type definitions for inversify 1.0.0-beta.5 +// Project: https://github.com/inversify/inversify-binding-decorators +// Definitions by: inversify +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare namespace inversifyBindingDecorators { + + interface IProvideInSyntax extends IProvideDoneSyntax { + inSingletonScope(): IProvideWhenOnSyntax; + } + + interface IProvideDoneSyntax { + done(): (target: any) => any; + } + + interface IProvideOnSyntax extends IProvideDoneSyntax { + onActivation(fn: (context: inversify.interfaces.Context, injectable: T) => T): IProvideWhenSyntax; + } + + interface IProvideInWhenOnSyntax extends IProvideInSyntax, IProvideWhenSyntax, IProvideOnSyntax {} + + interface IProvideWhenOnSyntax extends IProvideWhenSyntax, IProvideOnSyntax {} + + interface IProvideWhenSyntax extends IProvideDoneSyntax { + when(constraint: (request: inversify.interfaces.Request) => boolean): IProvideOnSyntax; + whenTargetNamed(name: string): IProvideOnSyntax; + whenTargetTagged(tag: string, value: any): IProvideOnSyntax; + whenInjectedInto(parent: (Function|string)): IProvideOnSyntax; + whenParentNamed(name: string): IProvideOnSyntax; + whenParentTagged(tag: string, value: any): IProvideOnSyntax; + whenAnyAncestorIs(ancestor: (Function|string)): IProvideOnSyntax; + whenNoAncestorIs(ancestor: (Function|string)): IProvideOnSyntax; + whenAnyAncestorNamed(name: string): IProvideOnSyntax; + whenAnyAncestorTagged(tag: string, value: any): IProvideOnSyntax; + whenNoAncestorNamed(name: string): IProvideOnSyntax; + whenNoAncestorTagged(tag: string, value: any): IProvideOnSyntax; + whenAnyAncestorMatches(constraint: (request: inversify.interfaces.Request) => boolean): IProvideOnSyntax; + whenNoAncestorMatches(constraint: (request: inversify.interfaces.Request) => boolean): IProvideOnSyntax; + } + + export function autoProvide(kernel: inversify.interfaces.Kernel, ...modules: any[]): void; + + export function makeProvideDecorator(kernel: inversify.interfaces.Kernel): + (serviceIdentifier: (string|Symbol|inversify.interfaces.Newable)) => (target: any) => any; + + export function makeFluentProvideDecorator(kernel: inversify.interfaces.Kernel): + (serviceIdentifier: (string|Symbol|inversify.interfaces.Newable)) => IProvideInWhenOnSyntax; + +} + +declare module "inversify-binding-decorators" { + export = inversifyBindingDecorators; +} diff --git a/inversify-express-utils/inversify-express-utils-tests.ts b/inversify-express-utils/inversify-express-utils-tests.ts new file mode 100644 index 0000000000..1d421e397a --- /dev/null +++ b/inversify-express-utils/inversify-express-utils-tests.ts @@ -0,0 +1,89 @@ +/// + +import { InversifyExpressServer, Controller, Get, All, Delete, Head, Put, Patch, Post, Method } from "inversify-express-utils"; +import * as express from "express"; +import { Kernel } from "inversify"; + +module server { + let kernel = new Kernel(); + let server = new InversifyExpressServer(kernel); + + server + .setConfig((app) => { + app.use((req: express.Request, res: express.Response, next: express.NextFunction) => { + console.log("hello world"); + next(); + }); + }) + .setErrorConfig((app) => { + app.use((err: any, req: express.Request, res: express.Response, next: express.NextFunction) => { + console.error(err.stack); + res.status(500).send("Something broke!"); + }); + }) + .build() + .listen(3000, "localhost"); +} + +module decorators { + + @Controller("/") + class TestController { + + @Get("/") + public testGet() { return "GET"; } + + @All("/") + public testAll() { return "ALL"; } + + @Delete("/") + public testDelete() { return "DELETE"; } + + @Head("/") + public testHead() { return "HEAD"; } + + @Put("/") + public testPut() { return "PUT"; } + + @Patch("/") + public testPatch() { return "PATCH"; } + + @Post("/") + public testPost() { return "POST"; } + + @Method("foo", "/") + public testMethod() { return "METHOD:FOO"; } + } + + function m1(req: express.Request, res: express.Response, next: express.NextFunction) { next(); } + function m2(req: express.Request, res: express.Response, next: express.NextFunction) { next(); } + function m3(req: express.Request, res: express.Response, next: express.NextFunction) { next(); } + + @Controller("/", m1, m2, m3) + class TestMiddlewareController { + + @Get("/", m1, m2, m3) + public testGet() { return "GET"; } + + @All("/", m1, m2, m3) + public testAll() { return "ALL"; } + + @Delete("/", m1, m2, m3) + public testDelete() { return "DELETE"; } + + @Head("/", m1, m2, m3) + public testHead() { return "HEAD"; } + + @Put("/", m1, m2, m3) + public testPut() { return "PUT"; } + + @Patch("/", m1, m2, m3) + public testPatch() { return "PATCH"; } + + @Post("/", m1, m2, m3) + public testPost() { return "POST"; } + + @Method("foo", "/", m1, m2, m3) + public testMethod() { return "METHOD:FOO"; } + } +} diff --git a/inversify-express-utils/inversify-express-utils.d.ts b/inversify-express-utils/inversify-express-utils.d.ts new file mode 100644 index 0000000000..aa9a20d23c --- /dev/null +++ b/inversify-express-utils/inversify-express-utils.d.ts @@ -0,0 +1,50 @@ +// Type definitions for inversify 1.0.0-alpha.4 +// Project: https://github.com/inversify/inversify-express-utils +// Definitions by: inversify +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + +declare module "inversify-express-utils" { + + import * as express from "express"; + import * as inversify from "inversify"; + + interface IInversifyExpressServerConstructor { + new(kernel: inversify.interfaces.Kernel): IInversifyExpressServer; + } + + interface IInversifyExpressServer { + setConfig(fn: IConfigFunction): IInversifyExpressServer; + setErrorConfig(fn: IConfigFunction): IInversifyExpressServer; + build(): express.Application; + } + + interface IConfigFunction { + (app: express.Application): void; + } + + interface IHandlerDecoratorFactory { + (path: string, ...middleware: express.RequestHandler[]): IHandlerDecorator; + } + + interface IHandlerDecorator { + (target: any, key: string, value: any): void; + } + + export interface IController {} + + export var InversifyExpressServer: IInversifyExpressServerConstructor; + + export var Controller: (path: string, ...middleware: express.RequestHandler[]) => (target: any) => void; + + export var All: IHandlerDecoratorFactory; + export var Get: IHandlerDecoratorFactory; + export var Post: IHandlerDecoratorFactory; + export var Put: IHandlerDecoratorFactory; + export var Patch: IHandlerDecoratorFactory; + export var Head: IHandlerDecoratorFactory; + export var Delete: IHandlerDecoratorFactory; + export var Method: (method: string, path: string, ...middleware: express.RequestHandler[]) => IHandlerDecorator; +} diff --git a/inversify-inject-decorators/inversify-inject-decorators-tests.ts b/inversify-inject-decorators/inversify-inject-decorators-tests.ts new file mode 100644 index 0000000000..468bbaf763 --- /dev/null +++ b/inversify-inject-decorators/inversify-inject-decorators-tests.ts @@ -0,0 +1,214 @@ +/// +/// + +import getDecorators from "inversify-inject-decorators"; +import { Kernel, injectable, tagged, named } from "inversify"; + +module lazyInject { + + let kernel = new Kernel(); + let { lazyInject } = getDecorators(kernel); + let TYPES = { Weapon: "Weapon" }; + + interface Weapon { + name: string; + durability: number; + use(): void; + } + + @injectable() + class Sword implements Weapon { + public name: string; + public durability: number; + public constructor() { + this.durability = 100; + this.name = "Sword"; + } + public use() { + this.durability = this.durability - 10; + } + } + + class Warrior { + @lazyInject(TYPES.Weapon) + public weapon: Weapon; + } + + kernel.bind(TYPES.Weapon).to(Sword); + + let warrior = new Warrior(); + console.log(warrior.weapon instanceof Sword); // true + +} + +module lazyInjectNamed { + + let kernel = new Kernel(); + let { lazyInjectNamed } = getDecorators(kernel); + let TYPES = { Weapon: "Weapon" }; + + interface Weapon { + name: string; + durability: number; + use(): void; + } + + @injectable() + class Sword implements Weapon { + public name: string; + public durability: number; + public constructor() { + this.durability = 100; + this.name = "Sword"; + } + public use() { + this.durability = this.durability - 10; + } + } + + @injectable() + class Shuriken implements Weapon { + public name: string; + public durability: number; + public constructor() { + this.durability = 100; + this.name = "Shuriken"; + } + public use() { + this.durability = this.durability - 10; + } + } + + class Warrior { + + @lazyInjectNamed(TYPES.Weapon, "not-throwwable") + @named("not-throwwable") + public primaryWeapon: Weapon; + + @lazyInjectNamed(TYPES.Weapon, "throwwable") + @named("throwwable") + public secondaryWeapon: Weapon; + + } + + kernel.bind(TYPES.Weapon).to(Sword).whenTargetNamed("not-throwwable"); + kernel.bind(TYPES.Weapon).to(Shuriken).whenTargetNamed("throwwable"); + + let warrior = new Warrior(); + console.log(warrior.primaryWeapon instanceof Sword); // true + console.log(warrior.primaryWeapon instanceof Shuriken); // true + +} + +module lazyInjectTagged { + + let kernel = new Kernel(); + let { lazyInjectTagged } = getDecorators(kernel); + let TYPES = { Weapon: "Weapon" }; + + interface Weapon { + name: string; + durability: number; + use(): void; + } + + @injectable() + class Sword implements Weapon { + public name: string; + public durability: number; + public constructor() { + this.durability = 100; + this.name = "Sword"; + } + public use() { + this.durability = this.durability - 10; + } + } + + @injectable() + class Shuriken implements Weapon { + public name: string; + public durability: number; + public constructor() { + this.durability = 100; + this.name = "Shuriken"; + } + public use() { + this.durability = this.durability - 10; + } + } + + class Warrior { + + @lazyInjectTagged(TYPES.Weapon, "throwwable", false) + @tagged("throwwable", false) + public primaryWeapon: Weapon; + + @lazyInjectTagged(TYPES.Weapon, "throwwable", true) + @tagged("throwwable", true) + public secondaryWeapon: Weapon; + + } + + kernel.bind(TYPES.Weapon).to(Sword).whenTargetTagged("throwwable", false); + kernel.bind(TYPES.Weapon).to(Shuriken).whenTargetTagged("throwwable", true); + + let warrior = new Warrior(); + console.log(warrior.primaryWeapon instanceof Sword); // true + console.log(warrior.primaryWeapon instanceof Shuriken); // true + +} + +module lazyMultiInject { + + let kernel = new Kernel(); + let { lazyMultiInject } = getDecorators(kernel); + let TYPES = { Weapon: "Weapon" }; + + interface Weapon { + name: string; + durability: number; + use(): void; + } + + @injectable() + class Sword implements Weapon { + public name: string; + public durability: number; + public constructor() { + this.durability = 100; + this.name = "Sword"; + } + public use() { + this.durability = this.durability - 10; + } + } + + @injectable() + class Shuriken implements Weapon { + public name: string; + public durability: number; + public constructor() { + this.durability = 100; + this.name = "Shuriken"; + } + public use() { + this.durability = this.durability - 10; + } + } + + class Warrior { + + @lazyMultiInject(TYPES.Weapon) + public weapons: Weapon[]; + + } + + kernel.bind(TYPES.Weapon).to(Sword); + kernel.bind(TYPES.Weapon).to(Shuriken); + + let warrior = new Warrior(); + console.log(warrior.weapons[0] instanceof Sword); // true + console.log(warrior.weapons[1] instanceof Shuriken); // true + +} diff --git a/inversify-inject-decorators/inversify-inject-decorators.d.ts b/inversify-inject-decorators/inversify-inject-decorators.d.ts new file mode 100644 index 0000000000..032ed40cdd --- /dev/null +++ b/inversify-inject-decorators/inversify-inject-decorators.d.ts @@ -0,0 +1,32 @@ +// Type definitions for inversify-inject-decorators 1.0.0-beta.1 +// Project: https://github.com/inversify/inversify-inject-decorators +// Definitions by: inversify +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare namespace inversifyInjectDecorators { + + interface InjectDecorators { + + lazyInject: (serviceIdentifier: (string|Symbol|inversify.interfaces.Newable)) => + (proto: any, key: string) => void; + + lazyInjectNamed: (serviceIdentifier: (string|Symbol|inversify.interfaces.Newable), named: string) => + (proto: any, key: string) => void; + + lazyInjectTagged: (serviceIdentifier: (string|Symbol|inversify.interfaces.Newable), key: string, value: any) => + (proto: any, propertyName: string) => void; + + lazyMultiInject: (serviceIdentifier: (string|Symbol|inversify.interfaces.Newable)) => + (proto: any, key: string) => void; + + } + + export function getDecorators(kernel: inversify.interfaces.Kernel): InjectDecorators; + +} + +declare module "inversify-inject-decorators" { + export default inversifyInjectDecorators.getDecorators; +} diff --git a/inversify-logger-middleware/inversify-logger-middleware-tests.ts b/inversify-logger-middleware/inversify-logger-middleware-tests.ts new file mode 100644 index 0000000000..c9c7d5c8a8 --- /dev/null +++ b/inversify-logger-middleware/inversify-logger-middleware-tests.ts @@ -0,0 +1,59 @@ +/// + +declare var kernel: inversify.interfaces.Kernel; + +import { makeLoggerMiddleware, textSerializer } from "inversify-logger-middleware"; + +interface ILoggerOutput { + entry: T; +} + +let makeStringRenderer = function (loggerOutput: ILoggerOutput) { + return function (entry: inversifyLoggerMiddleware.ILogEntry) { + loggerOutput.entry = textSerializer(entry); + }; +}; + +let makeObjRenderer = function (loggerOutput: ILoggerOutput) { + return function (entry: inversifyLoggerMiddleware.ILogEntry) { + loggerOutput.entry = entry; + }; +}; + +let options: inversifyLoggerMiddleware.ILoggerSettings = { + request: { + bindings: { + activated: true, + cache: true, + constraint: true, + dynamicValue: true, + factory: true, + implementationType: true, + onActivation: true, + provider: true, + scope: true, + serviceIdentifier: true, + type: true + }, + serviceIdentifier: true, + target: { + metadata: true, + name: true, + serviceIdentifier: true + } + }, + time: true +}; + +let logger = makeLoggerMiddleware(); +kernel.applyMiddleware(logger); + +let loggerOutput1: ILoggerOutput = { entry: null }; +let stringRenderer1 = makeStringRenderer(loggerOutput1); +let logger1 = makeLoggerMiddleware(options, stringRenderer1); +kernel.applyMiddleware(logger1); + +let loggerOutput2: ILoggerOutput = { entry: null }; +let objRenderer2 = makeObjRenderer(loggerOutput2); +let logger2 = makeLoggerMiddleware(options, objRenderer2); +kernel.applyMiddleware(logger2); diff --git a/inversify-logger-middleware/inversify-logger-middleware.d.ts b/inversify-logger-middleware/inversify-logger-middleware.d.ts new file mode 100644 index 0000000000..3aa4ccca18 --- /dev/null +++ b/inversify-logger-middleware/inversify-logger-middleware.d.ts @@ -0,0 +1,59 @@ +// Type definitions for inversify 1.0.0-beta.6 +// Project: https://github.com/inversify/inversify-logger-middleware +// Definitions by: inversify +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare namespace inversifyLoggerMiddleware { + + export interface ILoggerSettings { + request?: IRequestLoggerSettings; + time?: boolean; + } + + export interface IRequestLoggerSettings { + serviceIdentifier?: boolean; + bindings?: IBindingLoggerSettings; + target?: ITargetLoggerSettings; + } + + export interface IBindingLoggerSettings { + activated?: boolean; + serviceIdentifier?: boolean; + implementationType?: boolean; + factory?: boolean; + provider?: boolean; + constraint?: boolean; + onActivation?: boolean; + cache?: boolean; + dynamicValue?: boolean; + scope?: boolean; + type?: boolean; + } + + export interface ITargetLoggerSettings { + serviceIdentifier?: boolean; + name?: boolean; + metadata?: boolean; + } + + export interface ILogEntry { + error: boolean; + exception: any; + multiInject: boolean; + results: any[]; + rootRequest: inversify.interfaces.Request; + serviceIdentifier: any; + target: any; + time: string; + } + + export function makeLoggerMiddleware(settings?: ILoggerSettings, renderer?: (out: ILogEntry) => void): inversify.interfaces.Middleware; + export function textSerializer(entry: ILogEntry): string; + +} + +declare module "inversify-logger-middleware" { + export = inversifyLoggerMiddleware; +} diff --git a/inversify/inversify-global-tests.ts b/inversify/inversify-global-tests.ts index c39b231b91..e2ead555d4 100644 --- a/inversify/inversify-global-tests.ts +++ b/inversify/inversify-global-tests.ts @@ -1,39 +1,65 @@ -/// +/// +/// -namespace global_module_test { +let injectable = inversify.injectable; +let inject = inversify.inject; +let tagged = inversify.tagged; +let named = inversify.named; +let Kernel = inversify.Kernel; +let KernelModule = inversify.KernelModule; +let targetName = inversify.targetName; +let multiInject = inversify.multiInject; +let traverseAncerstors = inversify.traverseAncerstors; +let taggedConstraint = inversify.taggedConstraint; +let namedConstraint = inversify.namedConstraint; +let typeConstraint = inversify.typeConstraint; +let makePropertyMultiInjectDecorator = inversify.makePropertyMultiInjectDecorator; +let makePropertyInjectTaggedDecorator = inversify.makePropertyInjectTaggedDecorator; +let makePropertyInjectNamedDecorator = inversify.makePropertyInjectNamedDecorator; +let makePropertyInjectDecorator = inversify.makePropertyInjectDecorator; - interface INinja { +module external_module_test { + + interface Warrior { fight(): string; sneak(): string; } - interface IKatana { + interface Weapon { hit(): string; } - interface IShuriken { + interface ThrowableWeapon extends Weapon { throw(): string; } - class Katana implements IKatana { + @injectable() + class Katana implements Weapon { public hit() { return "cut!"; } } - class Shuriken implements IShuriken { + @injectable() + class Shuriken implements ThrowableWeapon { public throw() { return "hit!"; } + public hit() { + return "hit!"; + } } - @inversify.inject("IKatana", "IShuriken") - class Ninja implements INinja { + @injectable() + class Ninja implements Warrior { - private _katana: IKatana; - private _shuriken: IShuriken; + private _katana: Weapon; + private _shuriken: ThrowableWeapon; - public constructor(katana: IKatana, shuriken: IShuriken) { + public constructor( + @inject("Weapon") katana: Weapon, + @inject("ThrowableWeapon") shuriken: ThrowableWeapon + ) { this._katana = katana; this._shuriken = shuriken; } @@ -43,62 +69,73 @@ namespace global_module_test { } - let kernel = new inversify.Kernel(); - kernel.bind("INinja").to(Ninja); - kernel.bind("IKatana").to(Katana); - kernel.bind("IShuriken").to(Shuriken).inSingletonScope(); + let kernel: inversify.interfaces.Kernel = new Kernel(); + kernel.bind("Warrior").to(Ninja); + kernel.bind("Weapon").to(Katana); + kernel.bind("ThrowableWeapon").to(Shuriken).inSingletonScope(); - let ninja = kernel.get("INinja"); + let ninja = kernel.get("Warrior"); console.log(ninja); // Unbind - kernel.unbind("INinja"); + kernel.unbind("Warrior"); kernel.unbindAll(); // Kernel modules - let module: inversify.IKernelModule = (k: inversify.IKernel) => { - k.bind("INinja").to(Ninja); - k.bind("IKatana").to(Katana).inTransientScope(); - k.bind("IShuriken").to(Shuriken).inSingletonScope(); - }; + let warriors: inversify.interfaces.KernelModule = new KernelModule((bind: inversify.interfaces.Bind) => { + bind("Warrior").to(Ninja); + }); - let options: inversify.IKernelOptions = { - middleware: [], - modules: [module] - }; + let weapons: inversify.interfaces.KernelModule = new KernelModule((bind: inversify.interfaces.Bind) => { + bind("Weapon").to(Katana); + bind("ThrowableWeapon").to(Shuriken); + }); - kernel = new inversify.Kernel(options); - let ninja2 = kernel.get("INinja"); + kernel = new Kernel(); + kernel.load(warriors, weapons); + let ninja2 = kernel.get("Warrior"); console.log(ninja2); + // middleware + function logger(planAndResolve: inversify.interfaces.PlanAndResolve): inversify.interfaces.PlanAndResolve { + return (args: inversify.interfaces.PlanAndResolveArgs) => { + let start = new Date().getTime(); + let result = planAndResolve(args); + let end = new Date().getTime(); + console.log(end - start); + return result; + }; + } + + kernel.applyMiddleware(logger, logger); + // binding types - kernel.bind("IKatana").to(Katana); - kernel.bind("IKatana").toValue(new Katana()); + kernel.bind("Weapon").to(Katana); + kernel.bind("Weapon").toConstantValue(new Katana()); + kernel.bind("Weapon").toDynamicValue(() => { return new Katana(); }); - kernel.bind>("IKatana").toConstructor(Katana); + kernel.bind>("Weapon").toConstructor(Katana); - kernel.bind>("IKatana").toFactory((context) => { + kernel.bind>("Weapon").toFactory((context) => { return () => { - return kernel.get("IKatana"); + return kernel.get("Weapon"); }; }); - kernel.bind>("IKatana").toAutoFactory(); + kernel.bind>("Weapon").toAutoFactory("Weapon"); - kernel.bind>("IKatana").toProvider((context) => { + kernel.bind>("Weapon").toProvider((context) => { return () => { - return new Promise((resolve) => { - let katana = kernel.get("IKatana"); + return new Promise((resolve) => { + let katana = kernel.get("Weapon"); resolve(katana); }); }; }); - kernel.bind("IKatana").to(Katana).proxy((katanaToBeInjected: IKatana) => { - // BLOCK http://stackoverflow.com/questions/35906938/how-to-enable-harmony-proxies-in-gulp-mocha - /* + kernel.bind("Weapon").to(Katana).onActivation((context: inversify.interfaces.Context, katanaToBeInjected: Weapon) => { let handler = { - apply: function(target, thisArgument, argumentsList) { + apply: function(target: any, thisArgument: any, argumentsList: any[]) { console.log(`Starting: ${performance.now()}`); let result = target.apply(thisArgument, argumentsList); console.log(`Finished: ${performance.now()}`); @@ -106,88 +143,301 @@ namespace global_module_test { } }; return new Proxy(katanaToBeInjected, handler); - */ - return katanaToBeInjected; }); - interface IWeapon {} - interface ISamurai { - katana: IWeapon; - shuriken: IWeapon; - } - - @inversify.inject("IWeapon", "IWeapon") - class Samurai implements ISamurai { - public katana: IWeapon; - public shuriken: IWeapon; + @injectable() + class Samurai implements Warrior { + public katana: Weapon; + public shuriken: ThrowableWeapon; public constructor( - @inversify.tagged("canThrow", false) katana: IWeapon, - @inversify.tagged("canThrow", true) shuriken: IWeapon + @inject("Weapon") @tagged("canThrow", false) katana: Weapon, + @inject("ThrowableWeapon") @tagged("canThrow", true) shuriken: ThrowableWeapon ) { this.katana = katana; this.shuriken = shuriken; } + public fight() { return this.katana.hit(); }; + public sneak() { return this.shuriken.throw(); }; } kernel.bind("Samurai").to(Samurai); - kernel.bind("IWeapon").to(Katana).whenTargetTagged("canThrow", false); - kernel.bind("IWeapon").to(Shuriken).whenTargetTagged("canThrow", true); + kernel.bind("IWeapon").to(Katana).whenTargetTagged("canThrow", false); + kernel.bind("ThrowableWeapon").to(Shuriken).whenTargetTagged("canThrow", true); - let throwable = inversify.tagged("canThrow", true); - let notThrowable = inversify.tagged("canThrow", false); + let throwable = tagged("canThrow", true); + let notThrowable = tagged("canThrow", false); - @inversify.inject("IWeapon", "IWeapon") - class Samurai2 implements ISamurai { - public katana: IWeapon; - public shuriken: IWeapon; + @injectable() + class Samurai2 implements Samurai { + public katana: Weapon; + public shuriken: ThrowableWeapon; public constructor( - @throwable("canThrow", false) katana: IWeapon, - @notThrowable("canThrow", true) shuriken: IWeapon + @inject("Weapon") @throwable katana: Weapon, + @inject("ThrowableWeapon") @notThrowable shuriken: ThrowableWeapon ) { this.katana = katana; this.shuriken = shuriken; } + public fight() { return this.katana.hit(); }; + public sneak() { return this.shuriken.throw(); }; } - @inversify.inject("IWeapon", "IWeapon") - class Samurai3 implements ISamurai { - public katana: IWeapon; - public shuriken: IWeapon; + @injectable() + class Samurai3 implements Samurai { + public katana: Weapon; + public shuriken: ThrowableWeapon; public constructor( - @inversify.named("strong") katana: IWeapon, - @inversify.named("weak") shuriken: IWeapon + @inject("Weapon") @named("strong") katana: Weapon, + @inject("ThrowableWeapon") @named("weak") shuriken: ThrowableWeapon ) { this.katana = katana; this.shuriken = shuriken; } + public fight() { return this.katana.hit(); }; + public sneak() { return this.shuriken.throw(); }; } - kernel.bind("ISamurai").to(Samurai3); - kernel.bind("IWeapon").to(Katana).whenTargetNamed("strong"); - kernel.bind("IWeapon").to(Shuriken).whenTargetNamed("weak"); + kernel.bind("Warrior").to(Samurai3); + kernel.bind("Weapon").to(Katana).whenTargetNamed("strong"); + kernel.bind("Weapon").to(Shuriken).whenTargetNamed("weak"); - @inversify.inject("IWeapon", "IWeapon") - @inversify.paramNames("katana", "shuriken") - class Samurai4 implements ISamurai { - public katana: IWeapon; - public shuriken: IWeapon; + @injectable() + class Samurai4 implements Samurai { + public katana: Weapon; + public shuriken: ThrowableWeapon; public constructor( - katana: IWeapon, - shuriken: IWeapon + @inject("Weapon") @targetName("katana") katana: Weapon, + @inject("ThrowableWeapon") @targetName("shuriken") shuriken: ThrowableWeapon ) { this.katana = katana; this.shuriken = shuriken; } + public fight() { return this.katana.hit(); }; + public sneak() { return this.shuriken.throw(); }; } - kernel.bind("ISamurai").to(Samurai4); + kernel.bind("Warrior").to(Samurai4); - kernel.bind("IWeapon").to(Katana).when((request: inversify.IRequest) => { + kernel.bind("Weapon").to(Katana).when((request: inversify.interfaces.Request) => { return request.target.name.equals("katana"); }); - kernel.bind("IWeapon").to(Shuriken).when((request: inversify.IRequest) => { + kernel.bind("Weapon").to(Shuriken).when((request: inversify.interfaces.Request) => { return request.target.name.equals("shuriken"); }); + // custom constraints + let whenParentNamedCanThrowConstraint = (request: inversify.interfaces.Request) => { + return namedConstraint("canThrow")(request.parentRequest); + }; + + let whenAnyAncestorIsConstraint = (request: inversify.interfaces.Request) => { + return traverseAncerstors(request, typeConstraint(Ninja)); + }; + + let whenAnyAncestorTaggedConstraint = (request: inversify.interfaces.Request) => { + return traverseAncerstors(request, taggedConstraint("canThrow")(true)); + }; + + kernel.bind("Weapon").to(Shuriken).when(whenParentNamedCanThrowConstraint); + kernel.bind("Weapon").to(Shuriken).when(whenAnyAncestorIsConstraint); + kernel.bind("Weapon").to(Shuriken).when(whenAnyAncestorTaggedConstraint); + + // Constraint helpers + kernel.bind("Weapon").to(Shuriken).whenInjectedInto(Ninja); + kernel.bind("Weapon").to(Shuriken).whenInjectedInto("INinja"); + kernel.bind("Weapon").to(Shuriken).whenParentNamed("chinese"); + kernel.bind("Weapon").to(Shuriken).whenParentTagged("canThrow", true); + kernel.bind("Weapon").to(Shuriken).whenTargetNamed("strong"); + kernel.bind("Weapon").to(Shuriken).whenTargetTagged("canThrow", true); + kernel.bind("Weapon").to(Shuriken).whenAnyAncestorIs(Ninja); + kernel.bind("Weapon").to(Shuriken).whenAnyAncestorIs("INinja"); + kernel.bind("Weapon").to(Shuriken).whenAnyAncestorNamed("strong"); + kernel.bind("Weapon").to(Shuriken).whenAnyAncestorTagged("canThrow", true); + kernel.bind("Weapon").to(Shuriken).whenAnyAncestorMatches(whenParentNamedCanThrowConstraint); + kernel.bind("Weapon").to(Shuriken).whenNoAncestorIs(Ninja); + kernel.bind("Weapon").to(Shuriken).whenNoAncestorIs("INinja"); + kernel.bind("Weapon").to(Shuriken).whenNoAncestorNamed("strong"); + kernel.bind("Weapon").to(Shuriken).whenNoAncestorTagged("canThrow", true); + kernel.bind("Weapon").to(Shuriken).whenNoAncestorMatches(whenParentNamedCanThrowConstraint); + + // multi-injection + @injectable() + class Samurai5 implements Warrior { + public katana: Weapon; + public shuriken: Weapon; + public constructor( + @multiInject("Weapon") wpns: Weapon[] + ) { + this.katana = wpns[0]; + this.shuriken = wpns[1]; + } + public fight() { return this.katana.hit(); }; + public sneak() { return this.shuriken.hit(); }; + } + + // symbols + let SYMBOLS = { + ThrowableWeapon: Symbol("ThrowableWeapon"), + Warrior: Symbol("Warrior"), + Weapon: Symbol("Weapon"), + }; + + @injectable() + class Ninja1 implements Warrior { + + private _katana: Weapon; + private _shuriken: ThrowableWeapon; + + public constructor( + @inject(SYMBOLS.Weapon) katana: Weapon, + @inject(SYMBOLS.ThrowableWeapon) shuriken: ThrowableWeapon + ) { + this._katana = katana; + this._shuriken = shuriken; + } + + public fight() { return this._katana.hit(); }; + public sneak() { return this._shuriken.throw(); }; + + } + + let kernel3 = new Kernel(); + kernel3.bind(SYMBOLS.Warrior).to(Ninja); + kernel3.bind(SYMBOLS.Weapon).to(Katana); + kernel3.bind(SYMBOLS.ThrowableWeapon).to(Shuriken).inSingletonScope(); + + let ninja4 = kernel3.get("Warrior"); + console.log(ninja4); + + // classes + + @injectable() + class Ninja2 implements Warrior { + + private _katana: Katana; + private _shuriken: Shuriken; + + public constructor( + katana: Katana, + shuriken: Shuriken + ) { + this._katana = katana; + this._shuriken = shuriken; + } + + public fight() { return this._katana.hit(); }; + public sneak() { return this._shuriken.throw(); }; + + } + + let kernel4 = new Kernel(); + kernel4.bind(Ninja).to(Ninja); + kernel4.bind(Katana).to(Katana); + kernel4.bind(Shuriken).to(Shuriken).inSingletonScope(); + + let ninja5 = kernel4.get(Ninja); + console.log(ninja5); + +} + +module property_injection { + + let kernel = new Kernel(); + + let TYPES = { Weapon: "Weapon" }; + + interface Weapon { + durability: number; + use(): void; + } + + @injectable() + class Sword implements Weapon { + public durability: number; + public constructor() { + this.durability = 100; + } + public use() { + this.durability = this.durability - 10; + } + } + + @injectable() + class WarHammer implements Weapon { + public durability: number; + public constructor() { + this.durability = 100; + } + public use() { + this.durability = this.durability - 10; + } + } + + let propertyMultiInject = makePropertyMultiInjectDecorator(kernel); + + class Warrior1 { + @propertyMultiInject(TYPES.Weapon) + public weapons: Weapon[]; + } + + let propertyInject = makePropertyInjectDecorator(kernel); + + interface Service { + count: number; + increment(): void; + } + + @injectable() + class SomeService implements Service { + public count: number; + public constructor() { + this.count = 0; + } + public increment() { + this.count = this.count + 1; + } + } + + class SomeWebComponent { + @propertyInject("Service") + private _service: Service; + public doSomething() { + let count = this._service.count; + this._service.increment(); + return count; + } + } + + let propertyInjectNammed = makePropertyInjectNamedDecorator(kernel); + + class Warrior2 { + + @propertyInjectNammed(TYPES.Weapon, "not-throwwable") + @named("not-throwwable") + public primaryWeapon: Weapon; + + @propertyInjectNammed(TYPES.Weapon, "throwwable") + @named("throwwable") + public secondaryWeapon: Weapon; + + } + + let propertyInjectTagged = makePropertyInjectTaggedDecorator(kernel); + + class Warrior3 { + + @propertyInjectTagged(TYPES.Weapon, "throwwable", false) + @tagged("throwwable", false) + public primaryWeapon: Weapon; + + @propertyInjectTagged(TYPES.Weapon, "throwwable", true) + @tagged("throwwable", true) + public secondaryWeapon: Weapon; + + } + + kernel.snapshot(); + kernel.restore(); + } diff --git a/inversify/inversify-tests.ts b/inversify/inversify-tests.ts index 23af8db21f..9b5de8fa0e 100644 --- a/inversify/inversify-tests.ts +++ b/inversify/inversify-tests.ts @@ -1,46 +1,62 @@ -/// +/// +/// import { Kernel, - inject, tagged, named, paramNames, - IKernel, IKernelOptions, INewable, - IKernelModule, IFactory, IProvider, IRequest + injectable, tagged, named, targetName, + inject, multiInject, traverseAncerstors, + taggedConstraint, namedConstraint, typeConstraint, + makePropertyMultiInjectDecorator, + makePropertyInjectTaggedDecorator, + makePropertyInjectNamedDecorator, + makePropertyInjectDecorator, + KernelModule, interfaces } from "inversify"; -namespace external_module_test { +import * as Proxy from "harmony-proxy"; - interface INinja { +module external_module_test { + + interface Warrior { fight(): string; sneak(): string; } - interface IKatana { + interface Weapon { hit(): string; } - interface IShuriken { + interface ThrowableWeapon extends Weapon { throw(): string; } - class Katana implements IKatana { + @injectable() + class Katana implements Weapon { public hit() { return "cut!"; } } - class Shuriken implements IShuriken { + @injectable() + class Shuriken implements ThrowableWeapon { public throw() { return "hit!"; } + public hit() { + return "hit!"; + } } - @inject("IKatana", "IShuriken") - class Ninja implements INinja { + @injectable() + class Ninja implements Warrior { - private _katana: IKatana; - private _shuriken: IShuriken; + private _katana: Weapon; + private _shuriken: ThrowableWeapon; - public constructor(katana: IKatana, shuriken: IShuriken) { + public constructor( + @inject("Weapon") katana: Weapon, + @inject("ThrowableWeapon") shuriken: ThrowableWeapon + ) { this._katana = katana; this._shuriken = shuriken; } @@ -50,62 +66,73 @@ namespace external_module_test { } - let kernel = new Kernel(); - kernel.bind("INinja").to(Ninja); - kernel.bind("IKatana").to(Katana); - kernel.bind("IShuriken").to(Shuriken).inSingletonScope(); + let kernel: interfaces.Kernel = new Kernel(); + kernel.bind("Warrior").to(Ninja); + kernel.bind("Weapon").to(Katana); + kernel.bind("ThrowableWeapon").to(Shuriken).inSingletonScope(); - let ninja = kernel.get("INinja"); + let ninja = kernel.get("Warrior"); console.log(ninja); // Unbind - kernel.unbind("INinja"); + kernel.unbind("Warrior"); kernel.unbindAll(); // Kernel modules - let module: IKernelModule = (k: IKernel) => { - k.bind("INinja").to(Ninja); - k.bind("IKatana").to(Katana).inTransientScope(); - k.bind("IShuriken").to(Shuriken).inSingletonScope(); - }; + let warriors: interfaces.KernelModule = new KernelModule((bind: interfaces.Bind) => { + bind("Warrior").to(Ninja); + }); - let options: IKernelOptions = { - middleware: [], - modules: [module] - }; + let weapons: interfaces.KernelModule = new KernelModule((bind: interfaces.Bind) => { + bind("Weapon").to(Katana); + bind("ThrowableWeapon").to(Shuriken); + }); - kernel = new Kernel(options); - let ninja2 = kernel.get("INinja"); + kernel = new Kernel(); + kernel.load(warriors, weapons); + let ninja2 = kernel.get("Warrior"); console.log(ninja2); + // middleware + function logger(planAndResolve: interfaces.PlanAndResolve): interfaces.PlanAndResolve { + return (args: interfaces.PlanAndResolveArgs) => { + let start = new Date().getTime(); + let result = planAndResolve(args); + let end = new Date().getTime(); + console.log(end - start); + return result; + }; + } + + kernel.applyMiddleware(logger, logger); + // binding types - kernel.bind("IKatana").to(Katana); - kernel.bind("IKatana").toValue(new Katana()); + kernel.bind("Weapon").to(Katana); + kernel.bind("Weapon").toConstantValue(new Katana()); + kernel.bind("Weapon").toDynamicValue(() => { return new Katana(); }); - kernel.bind>("IKatana").toConstructor(Katana); + kernel.bind>("Weapon").toConstructor(Katana); - kernel.bind>("IKatana").toFactory((context) => { + kernel.bind>("Weapon").toFactory((context) => { return () => { - return kernel.get("IKatana"); + return kernel.get("Weapon"); }; }); - kernel.bind>("IKatana").toAutoFactory(); + kernel.bind>("Weapon").toAutoFactory("Weapon"); - kernel.bind>("IKatana").toProvider((context) => { + kernel.bind>("Weapon").toProvider((context) => { return () => { - return new Promise((resolve) => { - let katana = kernel.get("IKatana"); + return new Promise((resolve) => { + let katana = kernel.get("Weapon"); resolve(katana); }); }; }); - kernel.bind("IKatana").to(Katana).proxy((katanaToBeInjected: IKatana) => { - // BLOCK http://stackoverflow.com/questions/35906938/how-to-enable-harmony-proxies-in-gulp-mocha - /* + kernel.bind("Weapon").to(Katana).onActivation((context: interfaces.Context, katanaToBeInjected: Weapon) => { let handler = { - apply: function(target, thisArgument, argumentsList) { + apply: function(target: any, thisArgument: any, argumentsList: any[]) { console.log(`Starting: ${performance.now()}`); let result = target.apply(thisArgument, argumentsList); console.log(`Finished: ${performance.now()}`); @@ -113,88 +140,302 @@ namespace external_module_test { } }; return new Proxy(katanaToBeInjected, handler); - */ - return katanaToBeInjected; }); - interface IWeapon {} - interface ISamurai { - katana: IWeapon; - shuriken: IWeapon; - } - @inject("IWeapon", "IWeapon") - class Samurai implements ISamurai { - public katana: IWeapon; - public shuriken: IWeapon; + @injectable() + class Samurai implements Warrior { + public katana: Weapon; + public shuriken: ThrowableWeapon; public constructor( - @tagged("canThrow", false) katana: IWeapon, - @tagged("canThrow", true) shuriken: IWeapon + @inject("Weapon") @tagged("canThrow", false) katana: Weapon, + @inject("ThrowableWeapon") @tagged("canThrow", true) shuriken: ThrowableWeapon ) { this.katana = katana; this.shuriken = shuriken; } + public fight() { return this.katana.hit(); }; + public sneak() { return this.shuriken.throw(); }; } kernel.bind("Samurai").to(Samurai); - kernel.bind("IWeapon").to(Katana).whenTargetTagged("canThrow", false); - kernel.bind("IWeapon").to(Shuriken).whenTargetTagged("canThrow", true); + kernel.bind("IWeapon").to(Katana).whenTargetTagged("canThrow", false); + kernel.bind("ThrowableWeapon").to(Shuriken).whenTargetTagged("canThrow", true); let throwable = tagged("canThrow", true); let notThrowable = tagged("canThrow", false); - @inject("IWeapon", "IWeapon") - class Samurai2 implements ISamurai { - public katana: IWeapon; - public shuriken: IWeapon; + @injectable() + class Samurai2 implements Samurai { + public katana: Weapon; + public shuriken: ThrowableWeapon; public constructor( - @throwable("canThrow", false) katana: IWeapon, - @notThrowable("canThrow", true) shuriken: IWeapon + @inject("Weapon") @throwable katana: Weapon, + @inject("ThrowableWeapon") @notThrowable shuriken: ThrowableWeapon ) { this.katana = katana; this.shuriken = shuriken; } + public fight() { return this.katana.hit(); }; + public sneak() { return this.shuriken.throw(); }; } - @inject("IWeapon", "IWeapon") - class Samurai3 implements ISamurai { - public katana: IWeapon; - public shuriken: IWeapon; + @injectable() + class Samurai3 implements Samurai { + public katana: Weapon; + public shuriken: ThrowableWeapon; public constructor( - @named("strong") katana: IWeapon, - @named("weak") shuriken: IWeapon + @inject("Weapon") @named("strong") katana: Weapon, + @inject("ThrowableWeapon") @named("weak") shuriken: ThrowableWeapon ) { this.katana = katana; this.shuriken = shuriken; } + public fight() { return this.katana.hit(); }; + public sneak() { return this.shuriken.throw(); }; } - kernel.bind("ISamurai").to(Samurai3); - kernel.bind("IWeapon").to(Katana).whenTargetNamed("strong"); - kernel.bind("IWeapon").to(Shuriken).whenTargetNamed("weak"); + kernel.bind("Warrior").to(Samurai3); + kernel.bind("Weapon").to(Katana).whenTargetNamed("strong"); + kernel.bind("Weapon").to(Shuriken).whenTargetNamed("weak"); - @inject("IWeapon", "IWeapon") - @paramNames("katana", "shuriken") - class Samurai4 implements ISamurai { - public katana: IWeapon; - public shuriken: IWeapon; + @injectable() + class Samurai4 implements Samurai { + public katana: Weapon; + public shuriken: ThrowableWeapon; public constructor( - katana: IWeapon, - shuriken: IWeapon + @inject("Weapon") @targetName("katana") katana: Weapon, + @inject("ThrowableWeapon") @targetName("shuriken") shuriken: ThrowableWeapon ) { this.katana = katana; this.shuriken = shuriken; } + public fight() { return this.katana.hit(); }; + public sneak() { return this.shuriken.throw(); }; } - kernel.bind("ISamurai").to(Samurai4); + kernel.bind("Warrior").to(Samurai4); - kernel.bind("IWeapon").to(Katana).when((request: IRequest) => { + kernel.bind("Weapon").to(Katana).when((request: interfaces.Request) => { return request.target.name.equals("katana"); }); - kernel.bind("IWeapon").to(Shuriken).when((request: IRequest) => { + kernel.bind("Weapon").to(Shuriken).when((request: interfaces.Request) => { return request.target.name.equals("shuriken"); }); + // custom constraints + let whenParentNamedCanThrowConstraint = (request: interfaces.Request) => { + return namedConstraint("canThrow")(request.parentRequest); + }; + + let whenAnyAncestorIsConstraint = (request: interfaces.Request) => { + return traverseAncerstors(request, typeConstraint(Ninja)); + }; + + let whenAnyAncestorTaggedConstraint = (request: interfaces.Request) => { + return traverseAncerstors(request, taggedConstraint("canThrow")(true)); + }; + + kernel.bind("Weapon").to(Shuriken).when(whenParentNamedCanThrowConstraint); + kernel.bind("Weapon").to(Shuriken).when(whenAnyAncestorIsConstraint); + kernel.bind("Weapon").to(Shuriken).when(whenAnyAncestorTaggedConstraint); + + // Constraint helpers + kernel.bind("Weapon").to(Shuriken).whenInjectedInto(Ninja); + kernel.bind("Weapon").to(Shuriken).whenInjectedInto("INinja"); + kernel.bind("Weapon").to(Shuriken).whenParentNamed("chinese"); + kernel.bind("Weapon").to(Shuriken).whenParentTagged("canThrow", true); + kernel.bind("Weapon").to(Shuriken).whenTargetNamed("strong"); + kernel.bind("Weapon").to(Shuriken).whenTargetTagged("canThrow", true); + kernel.bind("Weapon").to(Shuriken).whenAnyAncestorIs(Ninja); + kernel.bind("Weapon").to(Shuriken).whenAnyAncestorIs("INinja"); + kernel.bind("Weapon").to(Shuriken).whenAnyAncestorNamed("strong"); + kernel.bind("Weapon").to(Shuriken).whenAnyAncestorTagged("canThrow", true); + kernel.bind("Weapon").to(Shuriken).whenAnyAncestorMatches(whenParentNamedCanThrowConstraint); + kernel.bind("Weapon").to(Shuriken).whenNoAncestorIs(Ninja); + kernel.bind("Weapon").to(Shuriken).whenNoAncestorIs("INinja"); + kernel.bind("Weapon").to(Shuriken).whenNoAncestorNamed("strong"); + kernel.bind("Weapon").to(Shuriken).whenNoAncestorTagged("canThrow", true); + kernel.bind("Weapon").to(Shuriken).whenNoAncestorMatches(whenParentNamedCanThrowConstraint); + + // multi-injection + @injectable() + class Samurai5 implements Warrior { + public katana: Weapon; + public shuriken: Weapon; + public constructor( + @multiInject("Weapon") wpns: Weapon[] + ) { + this.katana = wpns[0]; + this.shuriken = wpns[1]; + } + public fight() { return this.katana.hit(); }; + public sneak() { return this.shuriken.hit(); }; + } + + // symbols + let SYMBOLS = { + ThrowableWeapon: Symbol("ThrowableWeapon"), + Warrior: Symbol("Warrior"), + Weapon: Symbol("Weapon"), + }; + + @injectable() + class Ninja1 implements Warrior { + + private _katana: Weapon; + private _shuriken: ThrowableWeapon; + + public constructor( + @inject(SYMBOLS.Weapon) katana: Weapon, + @inject(SYMBOLS.ThrowableWeapon) shuriken: ThrowableWeapon + ) { + this._katana = katana; + this._shuriken = shuriken; + } + + public fight() { return this._katana.hit(); }; + public sneak() { return this._shuriken.throw(); }; + + } + + let kernel3 = new Kernel(); + kernel3.bind(SYMBOLS.Warrior).to(Ninja); + kernel3.bind(SYMBOLS.Weapon).to(Katana); + kernel3.bind(SYMBOLS.ThrowableWeapon).to(Shuriken).inSingletonScope(); + + let ninja4 = kernel3.get("Warrior"); + console.log(ninja4); + + // classes + + @injectable() + class Ninja2 implements Warrior { + + private _katana: Katana; + private _shuriken: Shuriken; + + public constructor( + katana: Katana, + shuriken: Shuriken + ) { + this._katana = katana; + this._shuriken = shuriken; + } + + public fight() { return this._katana.hit(); }; + public sneak() { return this._shuriken.throw(); }; + + } + + let kernel4 = new Kernel(); + kernel4.bind(Ninja).to(Ninja); + kernel4.bind(Katana).to(Katana); + kernel4.bind(Shuriken).to(Shuriken).inSingletonScope(); + + let ninja5 = kernel4.get(Ninja); + console.log(ninja5); + +} + +module property_injection { + + let kernel = new Kernel(); + + let TYPES = { Weapon: "Weapon" }; + + interface Weapon { + durability: number; + use(): void; + } + + @injectable() + class Sword implements Weapon { + public durability: number; + public constructor() { + this.durability = 100; + } + public use() { + this.durability = this.durability - 10; + } + } + + @injectable() + class WarHammer implements Weapon { + public durability: number; + public constructor() { + this.durability = 100; + } + public use() { + this.durability = this.durability - 10; + } + } + + let propertyMultiInject = makePropertyMultiInjectDecorator(kernel); + + class Warrior1 { + @propertyMultiInject(TYPES.Weapon) + public weapons: Weapon[]; + } + + let propertyInject = makePropertyInjectDecorator(kernel); + + interface Service { + count: number; + increment(): void; + } + + @injectable() + class SomeService implements Service { + public count: number; + public constructor() { + this.count = 0; + } + public increment() { + this.count = this.count + 1; + } + } + + class SomeWebComponent { + @propertyInject("Service") + private _service: Service; + public doSomething() { + let count = this._service.count; + this._service.increment(); + return count; + } + } + + let propertyInjectNammed = makePropertyInjectNamedDecorator(kernel); + + class Warrior2 { + + @propertyInjectNammed(TYPES.Weapon, "not-throwwable") + @named("not-throwwable") + public primaryWeapon: Weapon; + + @propertyInjectNammed(TYPES.Weapon, "throwwable") + @named("throwwable") + public secondaryWeapon: Weapon; + + } + + let propertyInjectTagged = makePropertyInjectTaggedDecorator(kernel); + + class Warrior3 { + + @propertyInjectTagged(TYPES.Weapon, "throwwable", false) + @tagged("throwwable", false) + public primaryWeapon: Weapon; + + @propertyInjectTagged(TYPES.Weapon, "throwwable", true) + @tagged("throwwable", true) + public secondaryWeapon: Weapon; + + } + + kernel.snapshot(); + kernel.restore(); + } diff --git a/inversify/inversify.d.ts b/inversify/inversify.d.ts index 79cd4e3dec..41200ae470 100644 --- a/inversify/inversify.d.ts +++ b/inversify/inversify.d.ts @@ -1,141 +1,277 @@ -// Type definitions for inversify 2.0.0-alpha.3 +// Type definitions for inversify 2.0.0-beta.9 // Project: https://github.com/inversify/InversifyJS // Definitions by: inversify -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// Definitions: https://github.com/borisyankov/DefinitelyTyped /// +interface Symbol { + toString(): string; + valueOf(): Object; +} + +interface SymbolConstructor { + (description?: string|number): Symbol; +} + +declare var Symbol: SymbolConstructor; + declare namespace inversify { - interface IKernelConstructor { - new(options?: IKernelOptions): IKernel; + namespace interfaces { + + export interface KernelConstructor { + new(): Kernel; + } + + export interface KernelModuleConstructor { + new(registry: (bind: Bind) => void): KernelModule; + } + + export interface Newable { + new(...args: any[]): T; + } + + export type ServiceIdentifier = (string|Symbol|Newable); + + export interface Binding extends Clonable> { + guid: string; + moduleId: string; + activated: boolean; + serviceIdentifier: ServiceIdentifier; + implementationType: Newable; + factory: FactoryCreator; + provider: ProviderCreator; + constraint: (request: Request) => boolean; + onActivation: (context: Context, injectable: T) => T; + cache: T; + dynamicValue: () => T; + scope: number; // BindingScope + type: number; // BindingType + } + + export interface Factory extends Function { + (...args: any[]): (((...args: any[]) => T)|T); + } + + export interface FactoryCreator extends Function { + (context: Context): Factory; + } + + export interface Provider extends Function { + (): Promise; + } + + export interface ProviderCreator extends Function { + (context: Context): Provider; + } + + export interface PlanAndResolve { + (args: PlanAndResolveArgs): T[]; + } + + export interface PlanAndResolveArgs { + multiInject: boolean; + serviceIdentifier: ServiceIdentifier; + target: Target; + contextInterceptor: (contexts: Context) => Context; + } + + export interface Middleware extends Function { + (next: PlanAndResolve): PlanAndResolve; + } + + export interface Context { + guid: string; + kernel: Kernel; + plan: Plan; + addPlan(plan: Plan): void; + } + + export interface ReflectResult { + [key: string]: Metadata[]; + } + + export interface Metadata { + key: string; + value: any; + } + + export interface Plan { + parentContext: Context; + rootRequest: Request; + } + + export interface Planner { + createContext(kernel: Kernel): Context; + createPlan(parentContext: Context, binding: Binding, target: Target): Plan; + getBindings(kernel: Kernel, serviceIdentifier: ServiceIdentifier): Binding[]; + getActiveBindings(parentRequest: Request, target: Target): Binding[]; + } + + export interface QueryableString { + startsWith(searchString: string): boolean; + endsWith(searchString: string): boolean; + contains(searchString: string): boolean; + equals(compareString: string): boolean; + value(): string; + } + + export interface Request { + guid: string; + serviceIdentifier: ServiceIdentifier; + parentContext: Context; + parentRequest: Request; + childRequests: Request[]; + target: Target; + bindings: Binding[]; + addChildRequest( + serviceIdentifier: ServiceIdentifier, + bindings: (Binding|Binding[]), + target: Target + ): Request; + } + + export interface Target { + guid: string; + serviceIdentifier: ServiceIdentifier; + name: QueryableString; + metadata: Array; + hasTag(key: string): boolean; + isArray(): boolean; + matchesArray(name: string|Symbol|Newable): boolean; + isNamed(): boolean; + isTagged(): boolean; + matchesNamedTag(name: string): boolean; + matchesTag(key: string): (value: any) => boolean; + } + + export interface Resolver { + resolve(context: Context): T; + } + + export interface Kernel { + guid: string; + bind(serviceIdentifier: ServiceIdentifier): BindingToSyntax; + unbind(serviceIdentifier: ServiceIdentifier): void; + unbindAll(): void; + isBound(serviceIdentifier: ServiceIdentifier): boolean; + get(serviceIdentifier: ServiceIdentifier): T; + getNamed(serviceIdentifier: ServiceIdentifier, named: string): T; + getTagged(serviceIdentifier: ServiceIdentifier, key: string, value: any): T; + getAll(serviceIdentifier: ServiceIdentifier): T[]; + load(...modules: KernelModule[]): void; + unload(...modules: KernelModule[]): void; + applyMiddleware(...middleware: Middleware[]): void; + getServiceIdentifierAsString(serviceIdentifier: ServiceIdentifier): string; + snapshot(): void; + restore(): void; + } + + export interface Bind extends Function { + (serviceIdentifier: ServiceIdentifier): BindingToSyntax; + } + + export interface KernelModule { + guid: string; + registry: (bind: Bind) => void; + } + + export interface KernelSnapshot { + bindings: Lookup>; + middleware: PlanAndResolve; + } + + export interface Clonable { + clone(): T; + } + + export interface Lookup extends Clonable> { + add(serviceIdentifier: ServiceIdentifier, value: T): void; + get(serviceIdentifier: ServiceIdentifier): Array; + remove(serviceIdentifier: ServiceIdentifier): void; + removeByModuleId(moduleId: string): void; + hasKey(serviceIdentifier: ServiceIdentifier): boolean; + } + + export interface KeyValuePair { + serviceIdentifier: ServiceIdentifier; + value: Array; + } + + export interface BindingInSyntax { + inSingletonScope(): BindingWhenOnSyntax; + } + + export interface BindingInWhenOnSyntax extends BindingInSyntax, BindingWhenOnSyntax {} + + export interface BindingOnSyntax { + onActivation(fn: (context: Context, injectable: T) => T): BindingWhenSyntax; + } + + export interface BindingToSyntax { + to(constructor: { new(...args: any[]): T; }): BindingInWhenOnSyntax; + toConstantValue(value: T): BindingWhenOnSyntax; + toDynamicValue(func: () => T): BindingWhenOnSyntax; + toConstructor(constructor: Newable): BindingWhenOnSyntax; + toFactory(factory: FactoryCreator): BindingWhenOnSyntax; + toFunction(func: T): BindingWhenOnSyntax; + toAutoFactory(serviceIdentifier: ServiceIdentifier): BindingWhenOnSyntax; + toProvider(provider: ProviderCreator): BindingWhenOnSyntax; + } + + export interface BindingWhenOnSyntax extends BindingWhenSyntax, BindingOnSyntax {} + + export interface BindingWhenSyntax { + when(constraint: (request: Request) => boolean): BindingOnSyntax; + whenTargetNamed(name: string): BindingOnSyntax; + whenTargetTagged(tag: string, value: any): BindingOnSyntax; + whenInjectedInto(parent: (Function|string)): BindingOnSyntax; + whenParentNamed(name: string): BindingOnSyntax; + whenParentTagged(tag: string, value: any): BindingOnSyntax; + whenAnyAncestorIs(ancestor: (Function|string)): BindingOnSyntax; + whenNoAncestorIs(ancestor: (Function|string)): BindingOnSyntax; + whenAnyAncestorNamed(name: string): BindingOnSyntax; + whenAnyAncestorTagged(tag: string, value: any): BindingOnSyntax; + whenNoAncestorNamed(name: string): BindingOnSyntax; + whenNoAncestorTagged(tag: string, value: any): BindingOnSyntax; + whenAnyAncestorMatches(constraint: (request: Request) => boolean): BindingOnSyntax; + whenNoAncestorMatches(constraint: (request: Request) => boolean): BindingOnSyntax; + } + } - export interface IKernel { - bind(runtimeIdentifier: string): IBindingToSyntax; - unbind(runtimeIdentifier: string): void; - unbindAll(): void; - get(runtimeIdentifier: string): T; - getAll(runtimeIdentifier: string): T[]; - } + export var Kernel: interfaces.KernelConstructor; + export var KernelModule: interfaces.KernelModuleConstructor; + export var decorate: (decorator: (ClassDecorator|ParameterDecorator), target: any, parameterIndex?: number) => void; + export function injectable(): (typeConstructor: any) => void; + export function tagged(metadataKey: string, metadataValue: any): (target: any, targetKey: string, index?: number) => any; + export function named(name: string): (target: any, targetKey: string, index?: number) => any; + export function targetName(name: string): (target: any, targetKey: string, index: number) => any; + export function inject(serviceIdentifier: interfaces.ServiceIdentifier): (target: any, targetKey: string, index?: number) => any; - export interface IKernelOptions { - middleware?: IMiddleware[]; - modules?: IKernelModule[]; - } + export function multiInject( + serviceIdentifier: interfaces.ServiceIdentifier + ): (target: any, targetKey: string, index?: number) => any; - interface IMiddleware extends Function { - (...args: any[]): any; - } + export function makePropertyInjectDecorator(kernel: interfaces.Kernel): + (serviceIdentifier: (string|Symbol|interfaces.Newable)) => (proto: any, key: string) => void; - export interface IKernelModule extends Function { - (kernel: IKernel): void; - } + export function makePropertyInjectNamedDecorator(kernel: interfaces.Kernel): + (serviceIdentifier: (string|Symbol|interfaces.Newable), named: string) => (proto: any, key: string) => void; - interface IBindingToSyntax { - to(constructor: { new(...args: any[]): T; }): IBindingInWhenProxySyntax; - toValue(value: T): IBindingInWhenProxySyntax; - toConstructor(constructor: INewable): IBindingInWhenProxySyntax; - toFactory(factory: IFactoryCreator): IBindingInWhenProxySyntax; - toAutoFactory(): IBindingInWhenProxySyntax; - toProvider(provider: IProviderCreator): IBindingInWhenProxySyntax; - } + export function makePropertyInjectTaggedDecorator(kernel: interfaces.Kernel): + (serviceIdentifier: (string|Symbol|interfaces.Newable), key: string, value: any) => (proto: any, propertyName: string) => void; - interface IBindingInWhenProxySyntax { - inTransientScope(): IBindingInWhenProxySyntax; - inSingletonScope(): IBindingInWhenProxySyntax; - when(constraint: (request: IRequest) => boolean): IBindingInWhenProxySyntax; - whenTargetNamed(name: string): IBindingInWhenProxySyntax; - whenTargetTagged(tag: string, value: any): IBindingInWhenProxySyntax; - proxy(fn: (injectable: T) => T): IBindingInWhenProxySyntax; - } + export function makePropertyMultiInjectDecorator(kernel: interfaces.Kernel): + (serviceIdentifier: (string|Symbol|interfaces.Newable)) => (proto: any, key: string) => void; - export interface IFactory extends Function { - (): T; - } + // constraint helpers + export var traverseAncerstors: (request: interfaces.Request, constraint: (request: interfaces.Request) => boolean) => boolean; + export var taggedConstraint: (tag: string) => (value: any) => (request: interfaces.Request) => boolean; + export var namedConstraint: (value: any) => (request: interfaces.Request) => boolean; + export var typeConstraint: (type: (Function|string)) => (request: interfaces.Request) => boolean; - interface IFactoryCreator extends Function { - (context: IContext): IFactory; - } - - export interface INewable { - new(...args: any[]): T; - } - - export interface IProvider extends Function { - (): Promise; - } - - interface IProviderCreator extends Function { - (context: IContext): IProvider; - } - - export interface IContext { - kernel: IKernel; - plan: IPlan; - addPlan(plan: IPlan): void; - } - - export interface IPlan { - parentContext: IContext; - rootRequest: IRequest; - } - - export interface IRequest { - service: string; - parentContext: IContext; - parentRequest: IRequest; - childRequests: IRequest[]; - target: ITarget; - bindings: IBinding[]; - addChildRequest( - service: string, - bindings: (IBinding|IBinding[]), - target: ITarget): IRequest; - } - - export interface IBinding { - runtimeIdentifier: string; - implementationType: INewable; - factory: IFactoryCreator; - provider: IProviderCreator; - constraint: (request: IRequest) => boolean; - proxyMaker: (injectable: T) => T; - cache: T; - scope: number; // BindingScope - type: number; // BindingType - } - - export interface ITarget { - service: IQueryableString; - name: IQueryableString; - metadata: Array; - isArray(): boolean; - isNamed(): boolean; - isTagged(): boolean; - matchesName(name: string): boolean; - matchesTag(name: IMetadata): boolean; - } - - export interface IQueryableString { - startsWith(searchString: string): boolean; - endsWith(searchString: string): boolean; - contains(searchString: string): boolean; - equals(compareString: string): boolean; - value(): string; - } - - export interface IMetadata { - key: string; - value: any; - } - - export var Kernel: IKernelConstructor; - export var decorate: any; - export function inject(...typeIdentifiers: string[]): (typeConstructor: any) => void; - export var tagged: any; - export var named: any; - export var paramNames: any; } declare module "inversify" { diff --git a/ionic/ionic-tests.ts b/ionic/ionic-tests.ts index 1790e542f1..d8c98ae25f 100644 --- a/ionic/ionic-tests.ts +++ b/ionic/ionic-tests.ts @@ -9,6 +9,8 @@ testIonic.config(['$ionicConfigProvider', ($ionicConfigProvider: ionic.utility.I $ionicConfigProvider.views.maxCache(10); var forwardCache: boolean = $ionicConfigProvider.views.forwardCache(); $ionicConfigProvider.views.forwardCache(true); + var swipeBackEnabled: boolean = $ionicConfigProvider.views.swipeBackEnabled(); + $ionicConfigProvider.views.swipeBackEnabled(true); var jsScrolling: boolean = $ionicConfigProvider.scrolling.jsScrolling(); $ionicConfigProvider.scrolling.jsScrolling(true); diff --git a/ionic/ionic.d.ts b/ionic/ionic.d.ts index e2cbc195b7..fae9cdbf63 100644 --- a/ionic/ionic.d.ts +++ b/ionic/ionic.d.ts @@ -358,6 +358,7 @@ declare namespace ionic { transition(transition?: string): string; maxCache(maxNumber?: number): number; forwardCache(value?: boolean): boolean; + swipeBackEnabled(value?: boolean): boolean; }; scrolling: { jsScrolling(value?: boolean): boolean; diff --git a/ioredis/ioredis.d.ts b/ioredis/ioredis.d.ts index d8cd4b3c70..983ed39f10 100644 --- a/ioredis/ioredis.d.ts +++ b/ioredis/ioredis.d.ts @@ -41,7 +41,8 @@ declare module IORedis { } interface Redis extends NodeJS.EventEmitter, Commander { - connect(callback: Function): Promise; + status: string; + connect(callback?: Function): Promise; disconnect(): void; duplicate(): Redis; monitor(calback: (error: Error, monitor: NodeJS.EventEmitter) => void): Promise; @@ -59,6 +60,7 @@ declare module IORedis { subscribe(channel: string): any; get(args: any[], callback?: ResCallbackT): any; get(...args: any[]): any; + getBuffer(key: string, callback?: ResCallbackT): any; set(args: any[], callback?: ResCallbackT): any; set(...args: any[]): any; setnx(args: any[], callback?: ResCallbackT): any; @@ -230,8 +232,12 @@ declare module IORedis { renamenx(...args: any[]): any; expire(args: any[], callback?: ResCallbackT): any; expire(...args: any[]): any; + pexpire(args: any[], callback?: ResCallbackT): any; + pexpire(...args: any[]): any; expireat(args: any[], callback?: ResCallbackT): any; expireat(...args: any[]): any; + pexpireat(args: any[], callback?: ResCallbackT): any; + pexpireat(...args: any[]): any; keys(args: any[], callback?: ResCallbackT): any; keys(...args: any[]): any; dbsize(args: any[], callback?: ResCallbackT): any; @@ -507,8 +513,12 @@ declare module IORedis { renamenx(...args: any[]): Pipeline; expire(args: any[], callback?: ResCallbackT): Pipeline; expire(...args: any[]): Pipeline; + pexpire(args: any[], callback?: ResCallbackT): Pipeline; + pexpire(...args: any[]): Pipeline; expireat(args: any[], callback?: ResCallbackT): Pipeline; expireat(...args: any[]): Pipeline; + pexpireat(args: any[], callback?: ResCallbackT): Pipeline; + pexpireat(...args: any[]): Pipeline; keys(args: any[], callback?: ResCallbackT): Pipeline; keys(...args: any[]): Pipeline; dbsize(args: any[], callback?: ResCallbackT): Pipeline; @@ -678,6 +688,10 @@ declare module IORedis { * default: false. */ readOnly?: boolean; + /** + * If you are using the hiredis parser, it's highly recommended to enable this option. Create another instance with dropBufferSupport disabled for other commands that you want to return binary instead of string: + */ + dropBufferSupport?: boolean; } interface ScanStreamOption { diff --git a/irc/irc-tests.ts b/irc/irc-tests.ts index edda5e14fd..9e098f923c 100644 --- a/irc/irc-tests.ts +++ b/irc/irc-tests.ts @@ -3,52 +3,82 @@ import irc = require('irc'); -var bot = new irc.Client('irc.dollyfish.net.nz', 'nodebot', { - debug: true, - channels: ['#blah', '#test'] -}); +function test_bot() { + var bot = new irc.Client('irc.dollyfish.net.nz', 'nodebot', { + debug: true, + channels: ['#blah', '#test'] + }); -bot.addListener('error', ((message: irc.IMessage) => { - console.error('ERROR: %s: %s', message.command, message.args.join(' ')); -})); + bot.connect(function() { + console.log("Connected"); + }); -bot.addListener('message#blah', ((from: string, message: string) => { - console.log('<%s> %s', from, message); -})); + bot.addListener('error', ((message: irc.IMessage) => { + console.error('ERROR: %s: %s', message.command, message.args.join(' ')); + })); -bot.addListener('message', ((from: string, to: string, message: string) => { - console.log('%s => %s: %s', from, to, message); + bot.addListener('message#blah', ((from: string, message: string) => { + console.log('<%s> %s', from, message); + })); - if (to.match(/^[#&]/)) { - // channel message - if (message.match(/hello/i)) { - bot.say(to, 'Hello there ' + from); + bot.addListener('message', ((from: string, to: string, message: string) => { + console.log('%s => %s: %s', from, to, message); + + if (to.match(/^[#&]/)) { + // channel message + if (message.match(/hello/i)) { + bot.say(to, 'Hello there ' + from); + } + if (message.match(/dance/)) { + setTimeout(() => { bot.say(to, '\u0001ACTION dances: :D\\-<\u0001'); }, 1000); + setTimeout(() => { bot.say(to, '\u0001ACTION dances: :D|-<\u0001'); }, 2000); + setTimeout(() => { bot.say(to, '\u0001ACTION dances: :D/-<\u0001'); }, 3000); + setTimeout(() => { bot.say(to, '\u0001ACTION dances: :D|-<\u0001'); }, 4000); + } } - if (message.match(/dance/)) { - setTimeout(() => { bot.say(to, '\u0001ACTION dances: :D\\-<\u0001'); }, 1000); - setTimeout(() => { bot.say(to, '\u0001ACTION dances: :D|-<\u0001'); }, 2000); - setTimeout(() => { bot.say(to, '\u0001ACTION dances: :D/-<\u0001'); }, 3000); - setTimeout(() => { bot.say(to, '\u0001ACTION dances: :D|-<\u0001'); }, 4000); + else { + // private message + console.log('private message'); } - } - else { - // private message - console.log('private message'); - } -})); + })); -bot.addListener('pm', ((nick: string, message: string) => { - console.log('Got private message from %s: %s', nick, message); -})); + bot.addListener('pm', ((nick: string, message: string) => { + console.log('Got private message from %s: %s', nick, message); + })); -bot.addListener('join', ((channel: string, who: string) => { - console.log('%s has joined %s', who, channel); -})); + bot.addListener('join', ((channel: string, who: string) => { + console.log('%s has joined %s', who, channel); + })); -bot.addListener('part', ((channel: string, who: string, reason: string) => { - console.log('%s has left %s: %s', who, channel, reason); -})); + bot.addListener('part', ((channel: string, who: string, reason: string) => { + console.log('%s has left %s: %s', who, channel, reason); + })); -bot.addListener('kick', ((channel: string, who: string, by: string, reason: string) => { - console.log('%s was kicked from %s by %s: %s', who, channel, by, reason); -})); + bot.addListener('kick', ((channel: string, who: string, by: string, reason: string) => { + console.log('%s was kicked from %s by %s: %s', who, channel, by, reason); + })); +} + +function test_secure() { + var options = true; + + var bot = new irc.Client('chat.us.freenode.net', 'nodebot', { + port: 6697, + debug: true, + secure: options, + channels: ['#botwar'] + }); +} + +function test_connect() { + var bot = new irc.Client('chat.us.freenode.net', 'nodebot', { + port: 6697, + autoConnect: false + }); + + bot.connect(5); + + bot.connect(5, function() {}); + + bot.connect(function() {}); +} diff --git a/irc/irc.d.ts b/irc/irc.d.ts index 00dd3220e1..546ca7c3c0 100644 --- a/irc/irc.d.ts +++ b/irc/irc.d.ts @@ -194,7 +194,7 @@ declare module 'irc' { * @param callback */ public connect( - retryCount?: number, + retryCount?: number | handlers.IRaw, callback?: handlers.IRaw ): void; @@ -228,6 +228,12 @@ declare module 'irc' { */ userName?: string; + /** + * IRC username + * @default '' + */ + password?: string; + /** * IRC "real name" * @default 'nodeJS IRC client' diff --git a/iscroll/iscroll-5-tests.ts b/iscroll/iscroll-5-tests.ts index 07255e8333..b04d91c029 100644 --- a/iscroll/iscroll-5-tests.ts +++ b/iscroll/iscroll-5-tests.ts @@ -33,4 +33,10 @@ myScroll1.scrollToElement(document.getElementById('selectedElement'), 250); myScroll2.on('scrollStart', function () { console.log('scroll started'); }); var myScroll9 = new IScroll(document.getElementById('wrapper')); -var myScroll10 = new IScroll(document.getElementById('wrapper'), { scrollbarClass: 'myScrollbar' }); \ No newline at end of file +var myScroll10 = new IScroll(document.getElementById('wrapper'), { scrollbarClass: 'myScrollbar' }); + +var myScroll11 = new IScroll(document.getElementById('wrapper'), { preventDefaultException: [ /^(INPUT|TEXTAREA|BUTTON|SELECT)$/ ] }); +var myScroll12 = new IScroll(document.getElementById('wrapper'), { preventDefaultException: { tagName: /^(INPUT|TEXTAREA|BUTTON|SELECT)$/ } }); + +var myScroll13 = new IScroll(document.getElementById('wrapper'), { bounceEasing: 'circular' }); +var myScroll14 = new IScroll(document.getElementById('wrapper'), { bounceEasing: { style: 'cubic-bezier(0,0,1,1)', fn: function (k) { return k; } } }); diff --git a/iscroll/iscroll-5.d.ts b/iscroll/iscroll-5.d.ts index 0b972e2863..31e9acaf6c 100644 --- a/iscroll/iscroll-5.d.ts +++ b/iscroll/iscroll-5.d.ts @@ -51,10 +51,10 @@ interface IScrollOptions { bounceTime?: number; ///String or function - bounceEasing?: any; + bounceEasing?: string|{ style: string, fn: (k: any) => any }; preventDefault?: boolean; - preventDefaultException?: boolean; + preventDefaultException?: Array|Object; HWCompositing?: boolean; diff --git a/isomorphic-fetch/isomorphic-fetch-tests.ts b/isomorphic-fetch/isomorphic-fetch-tests.ts index 3235912ac1..ddf11f84fe 100644 --- a/isomorphic-fetch/isomorphic-fetch-tests.ts +++ b/isomorphic-fetch/isomorphic-fetch-tests.ts @@ -1,6 +1,9 @@ /// -function test_isomorphicFetchTestCases() { +import fetchImportedViaCommonJS = require('isomorphic-fetch'); +import * as fetchImportedViaES6Module from 'isomorphic-fetch'; + +function test_isomorphicFetchTestCases_ambient() { expectSuccess(fetch('http://localhost:3000/good'), 'Good response'); fetch('http://localhost:3000/bad') @@ -11,7 +14,30 @@ function test_isomorphicFetchTestCases() { }); } -function test_whatwgTestCases() { +function test_isomorphicFetchTestCases_commonjs() { + expectSuccess(fetchImportedViaCommonJS('http://localhost:3000/good'), 'Good response'); + + fetchImportedViaCommonJS('http://localhost:3000/bad') + .then((response: IResponse) => { + return response.text(); + }) + .catch((err) => { + }); +} + +function test_isomorphicFetchTestCases_es6() { + expectSuccess(fetchImportedViaES6Module('http://localhost:3000/good'), 'Good response'); + + fetchImportedViaES6Module('http://localhost:3000/bad') + .then((response: IResponse) => { + return response.text(); + }) + .catch((err) => { + }); +} + + +function test_whatwgTestCases_ambient() { var headers = new Headers(); headers.append("Content-Type", "application/json"); var requestOptions: RequestInit = { @@ -43,6 +69,72 @@ function test_whatwgTestCases() { expectSuccess(fetch(request), 'Post response:'); } + +function test_whatwgTestCases_commonjs() { + var headers = new Headers(); + headers.append("Content-Type", "application/json"); + var requestOptions: RequestInit = { + method: "POST", + headers: headers, + mode: 'same-origin', + credentials: 'omit', + cache: 'default' + }; + + expectSuccess(fetchImportedViaCommonJS('http://localhost:3000/poster', requestOptions), 'Post response:'); + + var requestOptions: RequestInit = { + method: "POST", + headers: { + 'Content-Type': 'application/json' + } + }; + + expectSuccess(fetchImportedViaCommonJS('http://localhost:3000/poster', requestOptions), 'Post response:'); + + var requestOptions: RequestInit = { + method: "POST", + headers: { + 'Content-Type': 'application/json' + } + }; + var request: Request = new Request('http://localhost:3000/poster', requestOptions); + + expectSuccess(fetchImportedViaCommonJS(request), 'Post response:'); +} + +function test_whatwgTestCases_es6() { + var headers = new Headers(); + headers.append("Content-Type", "application/json"); + var requestOptions: RequestInit = { + method: "POST", + headers: headers, + mode: 'same-origin', + credentials: 'omit', + cache: 'default' + }; + + expectSuccess(fetchImportedViaES6Module('http://localhost:3000/poster', requestOptions), 'Post response:'); + + var requestOptions: RequestInit = { + method: "POST", + headers: { + 'Content-Type': 'application/json' + } + }; + + expectSuccess(fetchImportedViaES6Module('http://localhost:3000/poster', requestOptions), 'Post response:'); + + var requestOptions: RequestInit = { + method: "POST", + headers: { + 'Content-Type': 'application/json' + } + }; + var request: Request = new Request('http://localhost:3000/poster', requestOptions); + + expectSuccess(fetchImportedViaES6Module(request), 'Post response:'); +} function expectSuccess(promise: Promise, responseText: string) { promise.then((response: IResponse) => { diff --git a/isomorphic-fetch/isomorphic-fetch.d.ts b/isomorphic-fetch/isomorphic-fetch.d.ts index 824c8a8ae0..19754db0f1 100644 --- a/isomorphic-fetch/isomorphic-fetch.d.ts +++ b/isomorphic-fetch/isomorphic-fetch.d.ts @@ -4,23 +4,23 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare enum RequestContext { - "audio", "beacon", "cspreport", "download", "embed", "eventsource", - "favicon", "fetch", "font", "form", "frame", "hyperlink", "iframe", - "image", "imageset", "import", "internal", "location", "manifest", - "object", "ping", "plugin", "prefetch", "script", "serviceworker", + "audio", "beacon", "cspreport", "download", "embed", "eventsource", + "favicon", "fetch", "font", "form", "frame", "hyperlink", "iframe", + "image", "imageset", "import", "internal", "location", "manifest", + "object", "ping", "plugin", "prefetch", "script", "serviceworker", "sharedworker", "subresource", "style", "track", "video", "worker", "xmlhttprequest", "xslt" } declare enum RequestMode { "same-origin", "no-cors", "cors" } declare enum RequestCredentials { "omit", "same-origin", "include" } -declare enum RequestCache { - "default", "no-store", "reload", "no-cache", "force-cache", +declare enum RequestCache { + "default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached" } declare enum ResponseType { "basic", "cors", "default", "error", "opaque" } declare type HeaderInit = Headers | Array; -declare type BodyInit = Blob | FormData | string; +declare type BodyInit = ArrayBuffer | ArrayBufferView | Blob | FormData | string; declare type RequestInfo = Request | string; interface RequestInit { @@ -112,8 +112,8 @@ interface IFetchStatic { (url: string | IRequest, init?: RequestInit): Promise; } -declare module "isomorphic-fetch" { - export default IFetchStatic; -} - declare var fetch: IFetchStatic; + +declare module "isomorphic-fetch" { + export = fetch; +} diff --git a/istanbul-middleware/istanbul-middleware-tests.ts b/istanbul-middleware/istanbul-middleware-tests.ts new file mode 100644 index 0000000000..01afa92082 --- /dev/null +++ b/istanbul-middleware/istanbul-middleware-tests.ts @@ -0,0 +1,2 @@ +/// +import i = require('istanbul-middleware'); diff --git a/istanbul-middleware/istanbul-middleware.d.ts b/istanbul-middleware/istanbul-middleware.d.ts new file mode 100644 index 0000000000..054e32931e --- /dev/null +++ b/istanbul-middleware/istanbul-middleware.d.ts @@ -0,0 +1,33 @@ +// Type definitions for istanbul-middleware +// Project: https://www.npmjs.com/package/istanbul-middleware +// Definitions by: Hookclaw +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module "istanbul-middleware" { + import * as express from "express"; + + type Matcher = (file:string)=> boolean; + type PostLoadHookFn = (file:any)=> {}; + type PostLoadHook = (matcherfn:Matcher,transformer:any,verbose:boolean)=>PostLoadHookFn; + + export function hookLoader(matcherOrRoot:Matcher|string, opts?:{ + postLoadHook?:PostLoadHook, + verbose?:boolean + //and istanbul.Instrumenter(...opts) + }): void; + + export function createHandler(opts?:{ + resetOnGet?:boolean + }): any; + + type ClientMatcher = (req:express.Request)=> boolean; + type PathTransformer = (req:express.Request)=> string; + + export function createClientHandler(root:string,opts?:{ + matcher?:ClientMatcher, + pathTransformer?:PathTransformer, + verbose?:boolean + }): any; +} diff --git a/jasmine-ajax/jasmine-ajax.d.ts b/jasmine-ajax/jasmine-ajax.d.ts index db25ab73e6..0eb873e048 100644 --- a/jasmine-ajax/jasmine-ajax.d.ts +++ b/jasmine-ajax/jasmine-ajax.d.ts @@ -15,6 +15,7 @@ interface JasmineAjaxResponse { interface JasmineAjaxRequest extends XMLHttpRequest { url: string; method: string; + params: any; username: string; password: string; requestHeaders: { [key: string]: string }; @@ -72,6 +73,9 @@ declare class MockAjax { stubRequest(url: RegExp, data?: string, method?: string): JasmineAjaxRequestStub; stubRequest(url: string, data?: string, method?: string): JasmineAjaxRequestStub; + + stubRequest(url: RegExp, data?: RegExp, method?: string): JasmineAjaxRequestStub; + stubRequest(url: string, data?: RegExp, method?: string): JasmineAjaxRequestStub; requests: JasmineAjaxRequestTracker; stubs: JasmineAjaxStubTracker; diff --git a/jasmine/jasmine-tests.ts b/jasmine/jasmine-tests.ts index 45b2d155a6..d873d2716b 100644 --- a/jasmine/jasmine-tests.ts +++ b/jasmine/jasmine-tests.ts @@ -358,6 +358,40 @@ describe("A spy, when configured to fake a return value", function () { }); }); +describe("A spy, when configured to fake a series of return values", function() { + var foo: any, bar: any; + + beforeEach(function() { + foo = { + setBar: function(value: any) { + bar = value; + }, + getBar: function() { + return bar; + } + }; + + spyOn(foo, "getBar").and.returnValues("fetched first", "fetched second"); + + foo.setBar(123); + }); + + it("tracks that the spy was called", function() { + foo.getBar(123); + expect(foo.getBar).toHaveBeenCalled(); + }); + + it("should not affect other functions", function() { + expect(bar).toEqual(123); + }); + + it("when called multiple times returns the requested values in order", function() { + expect(foo.getBar()).toEqual("fetched first"); + expect(foo.getBar()).toEqual("fetched second"); + expect(foo.getBar()).toBeUndefined(); + }); +}); + describe("A spy, when configured with an alternate implementation", function () { var foo: any, bar: any, fetchedBar: any; diff --git a/jasmine/jasmine.d.ts b/jasmine/jasmine.d.ts index aa3acdfbf8..538aca3fb6 100644 --- a/jasmine/jasmine.d.ts +++ b/jasmine/jasmine.d.ts @@ -179,6 +179,7 @@ declare namespace jasmine { addCustomEqualityTester(equalityTester: CustomEqualityTester): void; addMatchers(matchers: CustomMatcherFactories): void; specFilter(spec: Spec): boolean; + throwOnExpectationFailure(value: boolean): void; } interface FakeTimer { @@ -301,7 +302,7 @@ declare namespace jasmine { toContain(expected: any, expectationFailOutput?: any): boolean; toBeLessThan(expected: number, expectationFailOutput?: any): boolean; toBeGreaterThan(expected: number, expectationFailOutput?: any): boolean; - toBeCloseTo(expected: number, precision: any, expectationFailOutput?: any): boolean; + toBeCloseTo(expected: number, precision?: any, expectationFailOutput?: any): boolean; toThrow(expected?: any): boolean; toThrowError(message?: string | RegExp): boolean; toThrowError(expected?: new (...args: any[]) => Error, message?: string | RegExp): boolean; @@ -431,6 +432,8 @@ declare namespace jasmine { callThrough(): Spy; /** By chaining the spy with and.returnValue, all calls to the function will return a specific value. */ returnValue(val: any): Spy; + /** By chaining the spy with and.returnValues, all calls to the function will return specific values in order until it reaches the end of the return values list. */ + returnValues(...values: any[]): Spy; /** By chaining the spy with and.callFake, all calls to the spy will delegate to the supplied function. */ callFake(fn: Function): Spy; /** By chaining the spy with and.throwError, all calls to the spy will throw the specified value. */ diff --git a/java/java.d.ts b/java/java.d.ts index 04f603db77..e977ec1cac 100644 --- a/java/java.d.ts +++ b/java/java.d.ts @@ -1,6 +1,6 @@ -// Type definitions for java 0.5.4 +// Type definitions for java 0.7.2 // Project: https://github.com/joeferner/node-java -// Definitions by: Jim Lloyd +// Definitions by: Jim Lloyd , Kentaro Teramoto // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -36,16 +36,26 @@ declare namespace NodeJavaCore { // *NodeAPI* declares methods & members exported by the node java module. interface NodeAPI { classpath: string[]; + options: string[]; asyncOptions: AsyncOptions; + nativeBindingLocation: string; + callMethod(instance: any, className: string, methodName: string, args: any[], callback: Callback): void; callMethodSync(instance: any, className: string, methodName: string, ...args: any[]): any; + callStaticMethod(className: string, methodName: string, ...args: Array>): void; callStaticMethodSync(className: string, methodName: string, ...args: any[]): any; + getStaticFieldValue(className: string, fieldName: string): any; + setStaticFieldValue(className: string, fieldName: string, newValue: any): void; instanceOf(javaObject: any, className: string): boolean; registerClient(before: (cb: Callback) => void, after?: (cb: Callback) => void): void; registerClientP(beforeP: () => Promise, afterP?: () => Promise): void; ensureJvm(done: Callback): void; ensureJvm(): Promise; + isJvmCreated(): boolean; + newByte(val: number): any; + newChar(val: string|number): any; + newDouble(val: number): any; newShort(val: number): any; newLong(val: number): any; newFloat(val: number): any; diff --git a/javascript-obfuscator/javascript-obfuscator-tests.ts b/javascript-obfuscator/javascript-obfuscator-tests.ts new file mode 100644 index 0000000000..1c0753c3bf --- /dev/null +++ b/javascript-obfuscator/javascript-obfuscator-tests.ts @@ -0,0 +1,18 @@ +/// + +import { JavaScriptObfuscator } from 'javascript-obfuscator'; + +let sourceCode1: string = JavaScriptObfuscator.obfuscate('var foo = 1;'); +let sourceCode2: string = JavaScriptObfuscator.obfuscate('var foo = 1;', { + compact: true, + debugProtection: false, + debugProtectionInterval: false, + disableConsoleOutput: true, + encodeUnicodeLiterals: false, + reservedNames: ['^foo$'], + rotateUnicodeArray: true, + selfDefending: true, + unicodeArray: true, + unicodeArrayThreshold: 0.8, + wrapUnicodeArrayCalls: true +}); diff --git a/javascript-obfuscator/javascript-obfuscator.d.ts b/javascript-obfuscator/javascript-obfuscator.d.ts new file mode 100644 index 0000000000..17a91c4925 --- /dev/null +++ b/javascript-obfuscator/javascript-obfuscator.d.ts @@ -0,0 +1,25 @@ +// Type definitions for javascript-obfuscator +// Project: https://github.com/sanex3339/javascript-obfuscator +// Definitions by: sanex3339 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module 'javascript-obfuscator' { + export interface IOptions { + compact?: boolean; + debugProtection?: boolean; + debugProtectionInterval?: boolean; + disableConsoleOutput?: boolean; + encodeUnicodeLiterals?: boolean; + reservedNames?: string[]; + rotateUnicodeArray?: boolean; + selfDefending?: boolean; + unicodeArray?: boolean; + unicodeArrayThreshold?: number; + wrapUnicodeArrayCalls?: boolean; + [id: string]: any; + } + + export class JavaScriptObfuscator { + public static obfuscate (sourceCode: string, customOptions?: IOptions): string; + } +} diff --git a/jest/jest.d.ts b/jest/jest.d.ts index 451b9abc88..10949a6691 100644 --- a/jest/jest.d.ts +++ b/jest/jest.d.ts @@ -26,6 +26,7 @@ declare namespace jest { function autoMockOn(): void; function clearAllTimers(): void; function currentTestPath(): string; + function disableAutomock(): void; function fn(implementation?: Function): Mock; function dontMock(moduleName: string): void; function genMockFromModule(moduleName: string): Mock; diff --git a/joi/joi-6.5.0-tests.ts b/joi/joi-6.5.0-tests.ts new file mode 100644 index 0000000000..a00543fe4e --- /dev/null +++ b/joi/joi-6.5.0-tests.ts @@ -0,0 +1,774 @@ +/// +/// + +import Joi = require('joi'); + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +var x: any = null; +var value: any = null; +var num: number = 0; +var str: string = ''; +var bool: boolean = false; +var exp: RegExp = null; +var obj: Object = null; +var date: Date = null; +var bin: NodeBuffer = null; +var err: Error = null; +var func: Function = null; + +var anyArr: any[] = []; +var numArr: number[] = []; +var strArr: string[] = []; +var boolArr: boolean[] = []; +var expArr: RegExp[] = []; +var objArr: Object[] = []; +var bufArr: NodeBuffer[] = []; +var errArr: Error[] = []; +var funcArr: Function[] = []; + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +var schema: Joi.Schema = null; + +var anySchema: Joi.AnySchema = null; +var numSchema: Joi.NumberSchema = null; +var strSchema: Joi.StringSchema = null; +var arrSchema: Joi.ArraySchema = null; +var boolSchema: Joi.BooleanSchema = null; +var binSchema: Joi.BinarySchema = null; +var dateSchema: Joi.DateSchema = null; +var funcSchema: Joi.FunctionSchema = null; +var objSchema: Joi.ObjectSchema = null; +var altSchema: Joi.AlternativesSchema = null; + +var schemaArr: Joi.Schema[] = []; + +var ref: Joi.Reference = null; + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +var validOpts: Joi.ValidationOptions = null; + +validOpts = {abortEarly: bool}; +validOpts = {convert: bool}; +validOpts = {allowUnknown: bool}; +validOpts = {skipFunctions: bool}; +validOpts = {stripUnknown: bool}; +validOpts = {language: bool}; +validOpts = {presence: str}; +validOpts = {context: obj}; + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +var renOpts: Joi.RenameOptions = null; + +renOpts = {alias: bool}; +renOpts = {multiple: bool}; +renOpts = {override: bool}; +renOpts = {ignoreUndefined: bool}; + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +var emailOpts: Joi.EmailOptions = null; + +emailOpts = {errorLevel: num}; +emailOpts = {errorLevel: bool}; +emailOpts = {tldWhitelist: strArr}; +emailOpts = {tldWhitelist: obj}; +emailOpts = {minDomainAtoms: num}; + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +var ipOpts: Joi.IpOptions = null; + +ipOpts = {version: str}; +ipOpts = {version: strArr}; +ipOpts = {cidr: str}; + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +var uriOpts: Joi.UriOptions = null; + +uriOpts = {scheme: str}; +uriOpts = {scheme: exp}; +uriOpts = {scheme: strArr}; +uriOpts = {scheme: expArr}; + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +var whenOpts: Joi.WhenOptions = null; + +whenOpts = {is: x}; +whenOpts = {is: schema, then: schema}; +whenOpts = {is: schema, otherwise: schema}; + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +var refOpts: Joi.ReferenceOptions = null; + +refOpts = {separator: str}; +refOpts = {contextPrefix: str}; + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +var validErr: Joi.ValidationError = null; +var validErrItem: Joi.ValidationErrorItem; + +validErrItem= { + message: str, + type: str, + path: str +}; + +validErrItem = { + message: str, + type: str, + path: str, + options: validOpts +}; + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +schema = anySchema; +schema = numSchema; +schema = strSchema; +schema = arrSchema; +schema = boolSchema; +schema = binSchema; +schema = dateSchema; +schema = funcSchema; +schema = objSchema; + +schema = ref; + +anySchema = anySchema; +anySchema = numSchema; +anySchema = strSchema; +anySchema = arrSchema; +anySchema = boolSchema; +anySchema = binSchema; +anySchema = dateSchema; +anySchema = funcSchema; +anySchema = objSchema; + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +var schemaMap: Joi.SchemaMap = null; + +schemaMap = { + a: numSchema, + b: strSchema +}; + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +anySchema = Joi.any(); + +namespace common { + anySchema = anySchema.allow(x); + anySchema = anySchema.allow(x, x); + anySchema = anySchema.allow([x, x, x]); + anySchema = anySchema.valid(x); + anySchema = anySchema.valid(x, x); + anySchema = anySchema.valid([x, x, x]); + anySchema = anySchema.only(x); + anySchema = anySchema.only(x, x); + anySchema = anySchema.only([x, x, x]); + anySchema = anySchema.equal(x); + anySchema = anySchema.equal(x, x); + anySchema = anySchema.equal([x, x, x]); + anySchema = anySchema.invalid(x); + anySchema = anySchema.invalid(x, x); + anySchema = anySchema.invalid([x, x, x]); + anySchema = anySchema.disallow(x); + anySchema = anySchema.disallow(x, x); + anySchema = anySchema.disallow([x, x, x]); + anySchema = anySchema.not(x); + anySchema = anySchema.not(x, x); + anySchema = anySchema.not([x, x, x]); + + anySchema = anySchema.default(); + anySchema = anySchema.default(x); + anySchema = anySchema.default(x, str); + + anySchema = anySchema.required(); + anySchema = anySchema.optional(); + anySchema = anySchema.forbidden(); + anySchema = anySchema.strip(); + + anySchema = anySchema.description(str); + anySchema = anySchema.notes(str); + anySchema = anySchema.notes(strArr); + anySchema = anySchema.tags(str); + anySchema = anySchema.tags(strArr); + + anySchema = anySchema.meta(obj); + anySchema = anySchema.example(obj); + anySchema = anySchema.unit(str); + + anySchema = anySchema.options(validOpts); + anySchema = anySchema.strict(); + anySchema = anySchema.strict(bool); + anySchema = anySchema.concat(x); + + altSchema = anySchema.when(str, whenOpts); + altSchema = anySchema.when(ref, whenOpts); + + anySchema = anySchema.label(str); + anySchema = anySchema.raw(); + anySchema = anySchema.raw(bool); + anySchema = anySchema.empty(); + anySchema = anySchema.empty(str); + anySchema = anySchema.empty(anySchema); +} + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +arrSchema = Joi.array(); + +arrSchema = arrSchema.sparse(); +arrSchema = arrSchema.sparse(bool); +arrSchema = arrSchema.single(); +arrSchema = arrSchema.single(bool); +arrSchema = arrSchema.min(num); +arrSchema = arrSchema.max(num); +arrSchema = arrSchema.length(num); +arrSchema = arrSchema.unique(); + +arrSchema = arrSchema.items(numSchema); +arrSchema = arrSchema.items(numSchema, strSchema); +arrSchema = arrSchema.items([numSchema, strSchema]); + + +// - - - - - - - - + +namespace common_copy_paste { + // use search & replace from any + arrSchema = arrSchema.allow(x); + arrSchema = arrSchema.allow(x, x); + arrSchema = arrSchema.allow([x, x, x]); + arrSchema = arrSchema.valid(x); + arrSchema = arrSchema.valid(x, x); + arrSchema = arrSchema.valid([x, x, x]); + arrSchema = arrSchema.only(x); + arrSchema = arrSchema.only(x, x); + arrSchema = arrSchema.only([x, x, x]); + arrSchema = arrSchema.equal(x); + arrSchema = arrSchema.equal(x, x); + arrSchema = arrSchema.equal([x, x, x]); + arrSchema = arrSchema.invalid(x); + arrSchema = arrSchema.invalid(x, x); + arrSchema = arrSchema.invalid([x, x, x]); + arrSchema = arrSchema.disallow(x); + arrSchema = arrSchema.disallow(x, x); + arrSchema = arrSchema.disallow([x, x, x]); + arrSchema = arrSchema.not(x); + arrSchema = arrSchema.not(x, x); + arrSchema = arrSchema.not([x, x, x]); + + arrSchema = arrSchema.default(x); + + arrSchema = arrSchema.required(); + arrSchema = arrSchema.optional(); + arrSchema = arrSchema.forbidden(); + + arrSchema = arrSchema.description(str); + arrSchema = arrSchema.notes(str); + arrSchema = arrSchema.notes(strArr); + arrSchema = arrSchema.tags(str); + arrSchema = arrSchema.tags(strArr); + + arrSchema = arrSchema.meta(obj); + arrSchema = arrSchema.example(obj); + arrSchema = arrSchema.unit(str); + + arrSchema = arrSchema.options(validOpts); + arrSchema = arrSchema.strict(); + arrSchema = arrSchema.concat(x); + + altSchema = arrSchema.when(str, whenOpts); + altSchema = arrSchema.when(ref, whenOpts); +} + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +boolSchema = Joi.bool(); +boolSchema = Joi.boolean(); + +namespace common_copy_paste { + boolSchema = boolSchema.allow(x); + boolSchema = boolSchema.allow(x, x); + boolSchema = boolSchema.allow([x, x, x]); + boolSchema = boolSchema.valid(x); + boolSchema = boolSchema.valid(x, x); + boolSchema = boolSchema.valid([x, x, x]); + boolSchema = boolSchema.only(x); + boolSchema = boolSchema.only(x, x); + boolSchema = boolSchema.only([x, x, x]); + boolSchema = boolSchema.equal(x); + boolSchema = boolSchema.equal(x, x); + boolSchema = boolSchema.equal([x, x, x]); + boolSchema = boolSchema.invalid(x); + boolSchema = boolSchema.invalid(x, x); + boolSchema = boolSchema.invalid([x, x, x]); + boolSchema = boolSchema.disallow(x); + boolSchema = boolSchema.disallow(x, x); + boolSchema = boolSchema.disallow([x, x, x]); + boolSchema = boolSchema.not(x); + boolSchema = boolSchema.not(x, x); + boolSchema = boolSchema.not([x, x, x]); + + boolSchema = boolSchema.default(x); + + boolSchema = boolSchema.required(); + boolSchema = boolSchema.optional(); + boolSchema = boolSchema.forbidden(); + + boolSchema = boolSchema.description(str); + boolSchema = boolSchema.notes(str); + boolSchema = boolSchema.notes(strArr); + boolSchema = boolSchema.tags(str); + boolSchema = boolSchema.tags(strArr); + + boolSchema = boolSchema.meta(obj); + boolSchema = boolSchema.example(obj); + boolSchema = boolSchema.unit(str); + + boolSchema = boolSchema.options(validOpts); + boolSchema = boolSchema.strict(); + boolSchema = boolSchema.concat(x); + + altSchema = boolSchema.when(str, whenOpts); + altSchema = boolSchema.when(ref, whenOpts); +} + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +binSchema = Joi.binary(); + +binSchema = binSchema.encoding(str); +binSchema = binSchema.min(num); +binSchema = binSchema.max(num); +binSchema = binSchema.length(num); + +namespace common { + binSchema = binSchema.allow(x); + binSchema = binSchema.allow(x, x); + binSchema = binSchema.allow([x, x, x]); + binSchema = binSchema.valid(x); + binSchema = binSchema.valid(x, x); + binSchema = binSchema.valid([x, x, x]); + binSchema = binSchema.only(x); + binSchema = binSchema.only(x, x); + binSchema = binSchema.only([x, x, x]); + binSchema = binSchema.equal(x); + binSchema = binSchema.equal(x, x); + binSchema = binSchema.equal([x, x, x]); + binSchema = binSchema.invalid(x); + binSchema = binSchema.invalid(x, x); + binSchema = binSchema.invalid([x, x, x]); + binSchema = binSchema.disallow(x); + binSchema = binSchema.disallow(x, x); + binSchema = binSchema.disallow([x, x, x]); + binSchema = binSchema.not(x); + binSchema = binSchema.not(x, x); + binSchema = binSchema.not([x, x, x]); + + binSchema = binSchema.default(x); + + binSchema = binSchema.required(); + binSchema = binSchema.optional(); + binSchema = binSchema.forbidden(); + + binSchema = binSchema.description(str); + binSchema = binSchema.notes(str); + binSchema = binSchema.notes(strArr); + binSchema = binSchema.tags(str); + binSchema = binSchema.tags(strArr); + + binSchema = binSchema.meta(obj); + binSchema = binSchema.example(obj); + binSchema = binSchema.unit(str); + + binSchema = binSchema.options(validOpts); + binSchema = binSchema.strict(); + binSchema = binSchema.concat(x); + + altSchema = binSchema.when(str, whenOpts); + altSchema = binSchema.when(ref, whenOpts); +} + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +dateSchema = Joi.date(); + +dateSchema = dateSchema.min(date); +dateSchema = dateSchema.max(date); + +dateSchema = dateSchema.min(str); +dateSchema = dateSchema.max(str); + +dateSchema = dateSchema.min(num); +dateSchema = dateSchema.max(num); + +dateSchema = dateSchema.min(ref); +dateSchema = dateSchema.max(ref); + +dateSchema = dateSchema.format(str); +dateSchema = dateSchema.format(strArr); + +dateSchema = dateSchema.iso(); + +namespace common { + dateSchema = dateSchema.allow(x); + dateSchema = dateSchema.allow(x, x); + dateSchema = dateSchema.allow([x, x, x]); + dateSchema = dateSchema.valid(x); + dateSchema = dateSchema.valid(x, x); + dateSchema = dateSchema.valid([x, x, x]); + dateSchema = dateSchema.only(x); + dateSchema = dateSchema.only(x, x); + dateSchema = dateSchema.only([x, x, x]); + dateSchema = dateSchema.equal(x); + dateSchema = dateSchema.equal(x, x); + dateSchema = dateSchema.equal([x, x, x]); + dateSchema = dateSchema.invalid(x); + dateSchema = dateSchema.invalid(x, x); + dateSchema = dateSchema.invalid([x, x, x]); + dateSchema = dateSchema.disallow(x); + dateSchema = dateSchema.disallow(x, x); + dateSchema = dateSchema.disallow([x, x, x]); + dateSchema = dateSchema.not(x); + dateSchema = dateSchema.not(x, x); + dateSchema = dateSchema.not([x, x, x]); + + dateSchema = dateSchema.default(x); + + dateSchema = dateSchema.required(); + dateSchema = dateSchema.optional(); + dateSchema = dateSchema.forbidden(); + + dateSchema = dateSchema.description(str); + dateSchema = dateSchema.notes(str); + dateSchema = dateSchema.notes(strArr); + dateSchema = dateSchema.tags(str); + dateSchema = dateSchema.tags(strArr); + + dateSchema = dateSchema.meta(obj); + dateSchema = dateSchema.example(obj); + dateSchema = dateSchema.unit(str); + + dateSchema = dateSchema.options(validOpts); + dateSchema = dateSchema.strict(); + dateSchema = dateSchema.concat(x); + + altSchema = dateSchema.when(str, whenOpts); + altSchema = dateSchema.when(ref, whenOpts); +} + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +funcSchema = Joi.func(); + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +numSchema = Joi.number(); + +numSchema = numSchema.min(num); +numSchema = numSchema.min(ref); +numSchema = numSchema.max(num); +numSchema = numSchema.max(ref); +numSchema = numSchema.greater(num); +numSchema = numSchema.greater(ref); +numSchema = numSchema.less(num); +numSchema = numSchema.less(ref); +numSchema = numSchema.integer(); +numSchema = numSchema.precision(num); +numSchema = numSchema.multiple(num); +numSchema = numSchema.positive(); +numSchema = numSchema.negative(); + +namespace common { + numSchema = numSchema.allow(x); + numSchema = numSchema.allow(x, x); + numSchema = numSchema.allow([x, x, x]); + numSchema = numSchema.valid(x); + numSchema = numSchema.valid(x, x); + numSchema = numSchema.valid([x, x, x]); + numSchema = numSchema.only(x); + numSchema = numSchema.only(x, x); + numSchema = numSchema.only([x, x, x]); + numSchema = numSchema.equal(x); + numSchema = numSchema.equal(x, x); + numSchema = numSchema.equal([x, x, x]); + numSchema = numSchema.invalid(x); + numSchema = numSchema.invalid(x, x); + numSchema = numSchema.invalid([x, x, x]); + numSchema = numSchema.disallow(x); + numSchema = numSchema.disallow(x, x); + numSchema = numSchema.disallow([x, x, x]); + numSchema = numSchema.not(x); + numSchema = numSchema.not(x, x); + numSchema = numSchema.not([x, x, x]); + + numSchema = numSchema.default(x); + + numSchema = numSchema.required(); + numSchema = numSchema.optional(); + numSchema = numSchema.forbidden(); + + numSchema = numSchema.description(str); + numSchema = numSchema.notes(str); + numSchema = numSchema.notes(strArr); + numSchema = numSchema.tags(str); + numSchema = numSchema.tags(strArr); + + numSchema = numSchema.meta(obj); + numSchema = numSchema.example(obj); + numSchema = numSchema.unit(str); + + numSchema = numSchema.options(validOpts); + numSchema = numSchema.strict(); + numSchema = numSchema.concat(x); + + altSchema = numSchema.when(str, whenOpts); + altSchema = numSchema.when(ref, whenOpts); +} + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +objSchema = Joi.object(); +objSchema = Joi.object(schemaMap); + +objSchema = objSchema.keys(); +objSchema = objSchema.keys(schemaMap); + +objSchema = objSchema.min(num); +objSchema = objSchema.max(num); +objSchema = objSchema.length(num); + +objSchema = objSchema.pattern(exp, schema); + +objSchema = objSchema.and(str); +objSchema = objSchema.and(str, str); +objSchema = objSchema.and(str, str, str); +objSchema = objSchema.and(strArr); + +objSchema = objSchema.nand(str); +objSchema = objSchema.nand(str, str); +objSchema = objSchema.nand(str, str, str); +objSchema = objSchema.nand(strArr); + +objSchema = objSchema.or(str); +objSchema = objSchema.or(str, str); +objSchema = objSchema.or(str, str, str); +objSchema = objSchema.or(strArr); + +objSchema = objSchema.xor(str); +objSchema = objSchema.xor(str, str); +objSchema = objSchema.xor(str, str, str); +objSchema = objSchema.xor(strArr); + +objSchema = objSchema.with(str, str); +objSchema = objSchema.with(str, strArr); + +objSchema = objSchema.without(str, str); +objSchema = objSchema.without(str, strArr); + +objSchema = objSchema.rename(str, str); +objSchema = objSchema.rename(str, str, renOpts); + +objSchema = objSchema.assert(str, schema); +objSchema = objSchema.assert(str, schema, str); +objSchema = objSchema.assert(ref, schema); +objSchema = objSchema.assert(ref, schema, str); + +objSchema = objSchema.unknown(); +objSchema = objSchema.unknown(bool); + +objSchema = objSchema.type(func); +objSchema = objSchema.type(func, str); + +objSchema = objSchema.requiredKeys(str); +objSchema = objSchema.requiredKeys(str, str); +objSchema = objSchema.requiredKeys(strArr); + +objSchema = objSchema.optionalKeys(str); +objSchema = objSchema.optionalKeys(str, str); +objSchema = objSchema.optionalKeys(strArr); + +namespace common { + objSchema = objSchema.allow(x); + objSchema = objSchema.allow(x, x); + objSchema = objSchema.allow([x, x, x]); + objSchema = objSchema.valid(x); + objSchema = objSchema.valid(x, x); + objSchema = objSchema.valid([x, x, x]); + objSchema = objSchema.only(x); + objSchema = objSchema.only(x, x); + objSchema = objSchema.only([x, x, x]); + objSchema = objSchema.equal(x); + objSchema = objSchema.equal(x, x); + objSchema = objSchema.equal([x, x, x]); + objSchema = objSchema.invalid(x); + objSchema = objSchema.invalid(x, x); + objSchema = objSchema.invalid([x, x, x]); + objSchema = objSchema.disallow(x); + objSchema = objSchema.disallow(x, x); + objSchema = objSchema.disallow([x, x, x]); + objSchema = objSchema.not(x); + objSchema = objSchema.not(x, x); + objSchema = objSchema.not([x, x, x]); + + objSchema = objSchema.default(x); + + objSchema = objSchema.required(); + objSchema = objSchema.optional(); + objSchema = objSchema.forbidden(); + + objSchema = objSchema.description(str); + objSchema = objSchema.notes(str); + objSchema = objSchema.notes(strArr); + objSchema = objSchema.tags(str); + objSchema = objSchema.tags(strArr); + + objSchema = objSchema.meta(obj); + objSchema = objSchema.example(obj); + objSchema = objSchema.unit(str); + + objSchema = objSchema.options(validOpts); + objSchema = objSchema.strict(); + objSchema = objSchema.concat(x); + + altSchema = objSchema.when(str, whenOpts); + altSchema = objSchema.when(ref, whenOpts); +} + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +strSchema = Joi.string(); + +strSchema = strSchema.insensitive(); +strSchema = strSchema.min(num); +strSchema = strSchema.min(num, str); +strSchema = strSchema.min(ref); +strSchema = strSchema.min(ref, str); +strSchema = strSchema.max(num); +strSchema = strSchema.max(num, str); +strSchema = strSchema.max(ref); +strSchema = strSchema.max(ref, str); +strSchema = strSchema.creditCard(); +strSchema = strSchema.length(num); +strSchema = strSchema.length(num, str); +strSchema = strSchema.length(ref); +strSchema = strSchema.length(ref, str); +strSchema = strSchema.regex(exp); +strSchema = strSchema.regex(exp, str); +strSchema = strSchema.replace(exp, str); +strSchema = strSchema.replace(str, str); +strSchema = strSchema.alphanum(); +strSchema = strSchema.token(); +strSchema = strSchema.email(); +strSchema = strSchema.email(emailOpts); +strSchema = strSchema.ip(); +strSchema = strSchema.ip(ipOpts); +strSchema = strSchema.uri(); +strSchema = strSchema.uri(uriOpts); +strSchema = strSchema.guid(); +strSchema = strSchema.hex(); +strSchema = strSchema.hostname(); +strSchema = strSchema.isoDate(); +strSchema = strSchema.lowercase(); +strSchema = strSchema.uppercase(); +strSchema = strSchema.trim(); + +namespace common { + strSchema = strSchema.allow(x); + strSchema = strSchema.allow(x, x); + strSchema = strSchema.allow([x, x, x]); + strSchema = strSchema.valid(x); + strSchema = strSchema.valid(x, x); + strSchema = strSchema.valid([x, x, x]); + strSchema = strSchema.only(x); + strSchema = strSchema.only(x, x); + strSchema = strSchema.only([x, x, x]); + strSchema = strSchema.equal(x); + strSchema = strSchema.equal(x, x); + strSchema = strSchema.equal([x, x, x]); + strSchema = strSchema.invalid(x); + strSchema = strSchema.invalid(x, x); + strSchema = strSchema.invalid([x, x, x]); + strSchema = strSchema.disallow(x); + strSchema = strSchema.disallow(x, x); + strSchema = strSchema.disallow([x, x, x]); + strSchema = strSchema.not(x); + strSchema = strSchema.not(x, x); + strSchema = strSchema.not([x, x, x]); + + strSchema = strSchema.default(x); + + strSchema = strSchema.required(); + strSchema = strSchema.optional(); + strSchema = strSchema.forbidden(); + + strSchema = strSchema.description(str); + strSchema = strSchema.notes(str); + strSchema = strSchema.notes(strArr); + strSchema = strSchema.tags(str); + strSchema = strSchema.tags(strArr); + + strSchema = strSchema.meta(obj); + strSchema = strSchema.example(obj); + strSchema = strSchema.unit(str); + + strSchema = strSchema.options(validOpts); + strSchema = strSchema.strict(); + strSchema = strSchema.concat(x); + + altSchema = strSchema.when(str, whenOpts); + altSchema = strSchema.when(ref, whenOpts); +} + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +schema = Joi.alternatives(schemaArr); +schema = Joi.alternatives(schema, anySchema, boolSchema); + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +Joi.validate(value, obj); +Joi.validate(value, schema); +Joi.validate(value, schema, validOpts); +Joi.validate(value, schema, validOpts, (err, value) => { + x = value; + str = err.message; + str = err.details[0].path; + str = err.details[0].message; + str = err.details[0].type; +}); +Joi.validate(value, schema, (err, value) => { + x = value; + str = err.message; + str = err.details[0].path; + str = err.details[0].message; + str = err.details[0].type; +}); +// variant +Joi.validate(num, schema, validOpts, (err, value) => { + num = value; +}); + +// plain opts +Joi.validate(value, {}); + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +schema = Joi.compile(obj); + +Joi.assert(obj, schema); +Joi.assert(obj, schema, str); +Joi.assert(obj, schema, err); + +ref = Joi.ref(str, refOpts); +ref = Joi.ref(str); diff --git a/joi/joi-6.5.0.d.ts b/joi/joi-6.5.0.d.ts new file mode 100644 index 0000000000..d9ee7c20d1 --- /dev/null +++ b/joi/joi-6.5.0.d.ts @@ -0,0 +1,778 @@ +// Type definitions for joi v6.5.0 +// Project: https://github.com/spumko/joi +// Definitions by: Bart van der Schoor , Laurence Dougal Myers , Christopher Glantschnig , David Broder-Rodgers +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// TODO express type of Schema in a type-parameter (.default, .valid, .example etc) + +declare module 'joi' { + + export interface ValidationOptions { + /** + * when true, stops validation on the first error, otherwise returns all the errors found. Defaults to true. + */ + abortEarly?: boolean; + /** + * when true, attempts to cast values to the required types (e.g. a string to a number). Defaults to true. + */ + convert?: boolean; + /** + * when true, allows object to contain unknown keys which are ignored. Defaults to false. + */ + allowUnknown?: boolean; + /** + * when true, ignores unknown keys with a function value. Defaults to false. + */ + skipFunctions?: boolean; + /** + * when true, unknown keys are deleted (only when value is an object). Defaults to false. + */ + stripUnknown?: boolean; + /** + * overrides individual error messages. Defaults to no override ({}). + */ + language?: Object; + /** + * sets the default presence requirements. Supported modes: 'optional', 'required', and 'forbidden'. Defaults to 'optional'. + */ + presence?: string; + /** + * provides an external data set to be used in references + */ + context?: Object; + } + + export interface RenameOptions { + /** + * if true, does not delete the old key name, keeping both the new and old keys in place. Defaults to false. + */ + alias?: boolean; + /** + * if true, allows renaming multiple keys to the same destination where the last rename wins. Defaults to false. + */ + multiple?: boolean; + /** + * if true, allows renaming a key over an existing key. Defaults to false. + */ + override?: boolean; + /** + * if true, skip renaming of a key if it's undefined. Defaults to false. + */ + ignoreUndefined?: boolean; + } + + export interface EmailOptions { + /** + * Numerical threshold at which an email address is considered invalid + */ + errorLevel?: number | boolean; + /** + * Specifies a list of acceptable TLDs. + */ + tldWhitelist?: string[] | Object; + /** + * Number of atoms required for the domain. Be careful since some domains, such as io, directly allow email. + */ + minDomainAtoms?: number; + } + + export interface IpOptions { + /** + * One or more IP address versions to validate against. Valid values: ipv4, ipv6, ipvfuture + */ + version ?: string | string[]; + /** + * Used to determine if a CIDR is allowed or not. Valid values: optional, required, forbidden + */ + cidr?: string; + } + + export interface UriOptions { + /** + * Specifies one or more acceptable Schemes, should only include the scheme name. + * Can be an Array or String (strings are automatically escaped for use in a Regular Expression). + */ + scheme ?: string | RegExp | Array; + } + + export interface WhenOptions { + /** + * the required condition joi type. + */ + is: T; + /** + * the alternative schema type if the condition is true. Required if otherwise is missing. + */ + then?: Schema; + /** + * the alternative schema type if the condition is false. Required if then is missing + */ + otherwise?: Schema; + } + + export interface ReferenceOptions { + separator?: string; + contextPrefix?: string; + } + + export interface IPOptions { + version?: Array; + cidr?: string + } + + export interface ValidationError extends Error { + message: string; + details: ValidationErrorItem[]; + simple(): string; + annotated(): string; + } + + export interface ValidationErrorItem { + message: string; + type: string; + path: string; + options?: ValidationOptions; + } + + export interface ValidationResult { + error: ValidationError; + value: T; + } + + export interface SchemaMap { + [key: string]: Schema; + } + + export interface Schema extends AnySchema { + + } + + export interface Reference extends Schema { + + } + + export interface AnySchema> { + /** + * Whitelists a value + */ + allow(value: any, ...values: any[]): T; + allow(values: any[]): T; + + /** + * Adds the provided values into the allowed whitelist and marks them as the only valid values allowed. + */ + valid(value: any, ...values: any[]): T; + valid(values: any[]): T; + only(value: any, ...values : any[]): T; + only(values: any[]): T; + equal(value: any, ...values : any[]): T; + equal(values: any[]): T; + + /** + * Blacklists a value + */ + invalid(value: any, ...values: any[]): T; + invalid(values: any[]): T; + disallow(value: any, ...values : any[]): T; + disallow(values: any[]): T; + not(value: any, ...values : any[]): T; + not(values: any[]): T; + + /** + * Marks a key as required which will not allow undefined as value. All keys are optional by default. + */ + required(): T; + + /** + * Marks a key as optional which will allow undefined as values. Used to annotate the schema for readability as all keys are optional by default. + */ + optional(): T; + + /** + * Marks a key as forbidden which will not allow any value except undefined. Used to explicitly forbid keys. + */ + forbidden(): T; + + /** + * Marks a key to be removed from a resulting object or array after validation. Used to sanitize output. + */ + strip(): T; + + /** + * Annotates the key + */ + description(desc: string): T; + + /** + * Annotates the key + */ + notes(notes: string): T; + notes(notes: string[]): T; + + /** + * Annotates the key + */ + tags(notes: string): T; + tags(notes: string[]): T; + + /** + * Attaches metadata to the key. + */ + meta(meta: Object): T; + + /** + * Annotates the key with an example value, must be valid. + */ + example(value: any): T; + + /** + * Annotates the key with an unit name. + */ + unit(name: string): T; + + /** + * Overrides the global validate() options for the current key and any sub-key. + */ + options(options: ValidationOptions): T; + + /** + * Sets the options.convert options to false which prevent type casting for the current key and any child keys. + */ + strict(isStrict?: boolean): T; + + /** + * Sets a default value if the original value is undefined. + * @param value - the value. + * value supports references. + * value may also be a function which returns the default value. + * If value is specified as a function that accepts a single parameter, that parameter will be a context + * object that can be used to derive the resulting value. This clones the object however, which incurs some + * overhead so if you don't need access to the context define your method so that it does not accept any + * parameters. + * Without any value, default has no effect, except for object that will then create nested defaults + * (applying inner defaults of that object). + * + * Note that if value is an object, any changes to the object after default() is called will change the + * reference and any future assignment. + * + * Additionally, when specifying a method you must either have a description property on your method or the + * second parameter is required. + */ + default(value: any, description?: string): T; + default(): T; + + /** + * Returns a new type that is the result of adding the rules of one type to another. + */ + concat(schema: T): T; + + /** + * Converts the type into an alternatives type where the conditions are merged into the type definition where: + */ + when(ref: string, options: WhenOptions): AlternativesSchema; + when(ref: Reference, options: WhenOptions): AlternativesSchema; + + /** + * Overrides the key name in error messages. + */ + label(name: string): T; + + /** + * Outputs the original untouched value instead of the casted value. + */ + raw(isRaw?: boolean): T; + + /** + * Considers anything that matches the schema to be empty (undefined). + * @param schema - any object or joi schema to match. An undefined schema unsets that rule. + */ + empty(schema?: any) : T; + } + + export interface BooleanSchema extends AnySchema { + + } + + export interface NumberSchema extends AnySchema { + /** + * Specifies the minimum value. + * It can also be a reference to another field. + */ + min(limit: number): NumberSchema; + min(limit: Reference): NumberSchema; + + /** + * Specifies the maximum value. + * It can also be a reference to another field. + */ + max(limit: number): NumberSchema; + max(limit: Reference): NumberSchema; + + /** + * Specifies that the value must be greater than limit. + * It can also be a reference to another field. + */ + greater(limit: number): NumberSchema; + greater(limit: Reference): NumberSchema; + + /** + * Specifies that the value must be less than limit. + * It can also be a reference to another field. + */ + less(limit: number): NumberSchema; + less(limit: Reference): NumberSchema; + + /** + * Requires the number to be an integer (no floating point). + */ + integer(): NumberSchema; + + /** + * Specifies the maximum number of decimal places where: + * limit - the maximum number of decimal places allowed. + */ + precision(limit: number): NumberSchema; + + /** + * Specifies that the value must be a multiple of base. + */ + multiple(base: number): NumberSchema; + + /** + * Requires the number to be positive. + */ + positive(): NumberSchema; + + /** + * Requires the number to be negative. + */ + negative(): NumberSchema; + } + + export interface StringSchema extends AnySchema { + /** + * Allows the value to match any whitelist of blacklist item in a case insensitive comparison. + */ + insensitive(): StringSchema; + + /** + * Specifies the minimum number string characters. + * @param limit - the minimum number of string characters required. It can also be a reference to another field. + * @param encoding - if specified, the string length is calculated in bytes using the provided encoding. + */ + min(limit: number, encoding?: string): StringSchema; + min(limit: Reference, encoding?: string): StringSchema; + + /** + * Specifies the maximum number of string characters. + * @param limit - the maximum number of string characters allowed. It can also be a reference to another field. + * @param encoding - if specified, the string length is calculated in bytes using the provided encoding. + */ + max(limit: number, encoding?: string): StringSchema; + max(limit: Reference, encoding?: string): StringSchema; + + /** + * Requires the number to be a credit card number (Using Lunh Algorithm). + */ + creditCard(): StringSchema; + + /** + * Specifies the exact string length required + * @param limit - the required string length. It can also be a reference to another field. + * @param encoding - if specified, the string length is calculated in bytes using the provided encoding. + */ + length(limit: number, encoding?: string): StringSchema; + length(limit: Reference, encoding?: string): StringSchema; + + /** + * Defines a regular expression rule. + * @param pattern - a regular expression object the string value must match against. + * @param name - optional name for patterns (useful with multiple patterns). Defaults to 'required'. + */ + regex(pattern: RegExp, name?: string): StringSchema; + + /** + * Replace characters matching the given pattern with the specified replacement string where: + * @param pattern - a regular expression object to match against, or a string of which all occurrences will be replaced. + * @param replacement - the string that will replace the pattern. + */ + replace(pattern: RegExp, replacement: string): StringSchema; + replace(pattern: string, replacement: string): StringSchema; + + /** + * Requires the string value to only contain a-z, A-Z, and 0-9. + */ + alphanum(): StringSchema; + + /** + * Requires the string value to only contain a-z, A-Z, 0-9, and underscore _. + */ + token(): StringSchema; + + /** + * Requires the string value to be a valid email address. + */ + email(options?: EmailOptions): StringSchema; + + /** + * Requires the string value to be a valid ip address. + */ + ip(options?: IpOptions): StringSchema; + + /** + * Requires the string value to be a valid RFC 3986 URI. + */ + uri(options?: UriOptions): StringSchema; + + /** + * Requires the string value to be a valid GUID. + */ + guid(): StringSchema; + + /** + * Requires the string value to be a valid hexadecimal string. + */ + hex(): StringSchema; + + /** + * Requires the string value to be a valid hostname as per RFC1123. + */ + hostname(): StringSchema; + + /** + * Requires the string value to be in valid ISO 8601 date format. + */ + isoDate(): StringSchema; + + /** + * Requires the string value to be all lowercase. If the validation convert option is on (enabled by default), the string will be forced to lowercase. + */ + lowercase(): StringSchema; + + /** + * Requires the string value to be all uppercase. If the validation convert option is on (enabled by default), the string will be forced to uppercase. + */ + uppercase(): StringSchema; + + /** + * Requires the string value to contain no whitespace before or after. If the validation convert option is on (enabled by default), the string will be trimmed. + */ + trim(): StringSchema; + } + + export interface ArraySchema extends AnySchema { + /** + * Allow this array to be sparse. + * enabled can be used with a falsy value to go back to the default behavior. + */ + sparse(enabled?: any): ArraySchema; + + /** + * Allow single values to be checked against rules as if it were provided as an array. + * enabled can be used with a falsy value to go back to the default behavior. + */ + single(enabled?: any): ArraySchema; + + /** + * List the types allowed for the array values. + * type can be an array of values, or multiple values can be passed as individual arguments. + * If a given type is .required() then there must be a matching item in the array. + * If a type is .forbidden() then it cannot appear in the array. + * Required items can be added multiple times to signify that multiple items must be found. + * Errors will contain the number of items that didn't match. + * Any unmatched item having a label will be mentioned explicitly. + * + * @param type - a joi schema object to validate each array item against. + */ + items(type: Schema, ...types: Schema[]): ArraySchema; + items(types: Schema[]): ArraySchema; + + /** + * Specifies the minimum number of items in the array. + */ + min(limit: number): ArraySchema; + + /** + * Specifies the maximum number of items in the array. + */ + max(limit: number): ArraySchema; + + /** + * Specifies the exact number of items in the array. + */ + length(limit: number): ArraySchema; + + /** + * Requires the array values to be unique. + * Be aware that a deep equality is performed on elements of the array having a type of object, + * a performance penalty is to be expected for this kind of operation. + */ + unique(): ArraySchema; + } + + export interface ObjectSchema extends AnySchema { + /** + * Sets the allowed object keys. + */ + keys(schema?: SchemaMap): ObjectSchema; + + /** + * Specifies the minimum number of keys in the object. + */ + min(limit: number): ObjectSchema; + + /** + * Specifies the maximum number of keys in the object. + */ + max(limit: number): ObjectSchema; + + /** + * Specifies the exact number of keys in the object. + */ + length(limit: number): ObjectSchema; + + /** + * Specify validation rules for unknown keys matching a pattern. + */ + pattern(regex: RegExp, schema: Schema): ObjectSchema; + + /** + * Defines an all-or-nothing relationship between keys where if one of the peers is present, all of them are required as well. + * @param peers - the key names of which if one present, all are required. peers can be a single string value, + * an array of string values, or each peer provided as an argument. + */ + and(peer1: string, ...peers: string[]): ObjectSchema; + and(peers: string[]): ObjectSchema; + + /** + * Defines a relationship between keys where not all peers can be present at the same time. + * @param peers - the key names of which if one present, the others may not all be present. + * peers can be a single string value, an array of string values, or each peer provided as an argument. + */ + nand(peer1: string, ...peers: string[]): ObjectSchema; + nand(peers: string[]): ObjectSchema; + + /** + * Defines a relationship between keys where one of the peers is required (and more than one is allowed). + */ + or(peer1: string, ...peers: string[]): ObjectSchema; + or(peers: string[]): ObjectSchema; + + /** + * Defines an exclusive relationship between a set of keys. one of them is required but not at the same time where: + */ + xor(peer1: string, ...peers: string[]): ObjectSchema; + xor(peers: string[]): ObjectSchema; + + /** + * Requires the presence of other keys whenever the specified key is present. + */ + with(key: string, peers: string): ObjectSchema; + with(key: string, peers: string[]): ObjectSchema; + + /** + * Forbids the presence of other keys whenever the specified is present. + */ + without(key: string, peers: string): ObjectSchema; + without(key: string, peers: string[]): ObjectSchema; + + /** + * Renames a key to another name (deletes the renamed key). + */ + rename(from: string, to: string, options?: RenameOptions): ObjectSchema; + + /** + * Verifies an assertion where. + */ + assert(ref: string, schema: Schema, message?: string): ObjectSchema; + assert(ref: Reference, schema: Schema, message?: string): ObjectSchema; + + /** + * Overrides the handling of unknown keys for the scope of the current object only (does not apply to children). + */ + unknown(allow?: boolean): ObjectSchema; + + /** + * Requires the object to be an instance of a given constructor. + * + * @param constructor - the constructor function that the object must be an instance of. + * @param name - an alternate name to use in validation errors. This is useful when the constructor function does not have a name. + */ + type(constructor: Function, name?: string): ObjectSchema; + + /** + * Sets the specified children to required. + * + * @param children - can be a single string value, an array of string values, or each child provided as an argument. + * + * var schema = Joi.object().keys({ a: { b: Joi.number() }, c: { d: Joi.string() } }); + * var requiredSchema = schema.requiredKeys('', 'a.b', 'c', 'c.d'); + * + * Note that in this example '' means the current object, a is not required but b is, as well as c and d. + */ + requiredKeys(children: string): ObjectSchema; + requiredKeys(children: string[]): ObjectSchema; + requiredKeys(child:string, ...children: string[]): ObjectSchema; + + /** + * Sets the specified children to optional. + * + * @param children - can be a single string value, an array of string values, or each child provided as an argument. + * + * The behavior is exactly the same as requiredKeys. + */ + optionalKeys(children: string): ObjectSchema; + optionalKeys(children: string[]): ObjectSchema; + optionalKeys(child:string, ...children: string[]): ObjectSchema; + } + + export interface BinarySchema extends AnySchema { + /** + * Sets the string encoding format if a string input is converted to a buffer. + */ + encoding(encoding: string): BinarySchema; + + /** + * Specifies the minimum length of the buffer. + */ + min(limit: number): BinarySchema; + + /** + * Specifies the maximum length of the buffer. + */ + max(limit: number): BinarySchema; + + /** + * Specifies the exact length of the buffer: + */ + length(limit: number): BinarySchema; + } + + export interface DateSchema extends AnySchema { + + /** + * Specifies the oldest date allowed. + * Notes: 'now' can be passed in lieu of date so as to always compare relatively to the current date, + * allowing to explicitly ensure a date is either in the past or in the future. + * It can also be a reference to another field. + */ + min(date: Date): DateSchema; + min(date: number): DateSchema; + min(date: string): DateSchema; + min(date: Reference): DateSchema; + + /** + * Specifies the latest date allowed. + * Notes: 'now' can be passed in lieu of date so as to always compare relatively to the current date, + * allowing to explicitly ensure a date is either in the past or in the future. + * It can also be a reference to another field. + */ + max(date: Date): DateSchema; + max(date: number): DateSchema; + max(date: string): DateSchema; + max(date: Reference): DateSchema; + + /** + * Specifies the allowed date format: + * @param format - string or array of strings that follow the moment.js format. + */ + format(format: string): DateSchema; + format(format: string[]): DateSchema; + + /** + * Requires the string value to be in valid ISO 8601 date format. + */ + iso(): DateSchema; + } + + export interface FunctionSchema extends AnySchema { + + } + + export interface AlternativesSchema extends AnySchema { + try(schemas: Schema[]): AlternativesSchema; + when(ref: string, options: WhenOptions): AlternativesSchema; + when(ref: Reference, options: WhenOptions): AlternativesSchema; + } + + // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + + /** + * Generates a schema object that matches any data type. + */ + export function any(): Schema; + + /** + * Generates a schema object that matches an array data type. + */ + export function array(): ArraySchema; + + /** + * Generates a schema object that matches a boolean data type (as well as the strings 'true', 'false', 'yes', and 'no'). Can also be called via bool(). + */ + export function bool(): BooleanSchema; + + export function boolean(): BooleanSchema; + + /** + * Generates a schema object that matches a Buffer data type (as well as the strings which will be converted to Buffers). + */ + export function binary(): BinarySchema; + + /** + * Generates a schema object that matches a date type (as well as a JavaScript date string or number of milliseconds). + */ + export function date(): DateSchema; + + /** + * Generates a schema object that matches a function type. + */ + export function func(): FunctionSchema; + + /** + * Generates a schema object that matches a number data type (as well as strings that can be converted to numbers). + */ + export function number(): NumberSchema; + + /** + * Generates a schema object that matches an object data type (as well as JSON strings that parsed into objects). + */ + export function object(schema?: SchemaMap): ObjectSchema; + + /** + * Generates a schema object that matches a string data type. Note that empty strings are not allowed by default and must be enabled with allow(''). + */ + export function string(): StringSchema; + + /** + * Generates a type that will match one of the provided alternative schemas + */ + export function alternatives(types: Schema[]): Schema; + export function alternatives(type1: Schema, type2: Schema, ...types: Schema[]): Schema; + + /** + * Validates a value using the given schema and options. + */ + export function validate(value: T, schema: Schema, callback: (err: ValidationError, value: T) => void): void; + export function validate(value: T, schema: Object, callback: (err: ValidationError, value: T) => void): void; + export function validate(value: T, schema: Object, options?: ValidationOptions, callback?: (err: ValidationError, value: T) => void): ValidationResult; + + /** + * Converts literal schema definition to joi schema object (or returns the same back if already a joi schema object). + */ + export function compile(schema: Object): Schema; + + /** + * Validates a value against a schema and throws if validation fails. + * + * @param value - the value to validate. + * @param schema - the schema object. + * @param message - optional message string prefix added in front of the error message. may also be an Error object. + */ + export function assert(value: any, schema: Schema, message?: string | Error): void; + + /** + * Generates a reference to the value of the named key. + */ + export function ref(key: string, options?: ReferenceOptions): Reference; +} diff --git a/joi/joi-tests.ts b/joi/joi-tests.ts index a00543fe4e..37848203df 100644 --- a/joi/joi-tests.ts +++ b/joi/joi-tests.ts @@ -231,16 +231,18 @@ arrSchema = arrSchema.sparse(); arrSchema = arrSchema.sparse(bool); arrSchema = arrSchema.single(); arrSchema = arrSchema.single(bool); +arrSchema = arrSchema.ordered(anySchema); +arrSchema = arrSchema.ordered(anySchema, numSchema, strSchema, arrSchema, boolSchema, binSchema, dateSchema, funcSchema, objSchema); arrSchema = arrSchema.min(num); arrSchema = arrSchema.max(num); arrSchema = arrSchema.length(num); arrSchema = arrSchema.unique(); + arrSchema = arrSchema.items(numSchema); arrSchema = arrSchema.items(numSchema, strSchema); arrSchema = arrSchema.items([numSchema, strSchema]); - // - - - - - - - - namespace common_copy_paste { @@ -420,6 +422,10 @@ dateSchema = dateSchema.format(strArr); dateSchema = dateSchema.iso(); +dateSchema = dateSchema.timestamp(); +dateSchema = dateSchema.timestamp('javascript'); +dateSchema = dateSchema.timestamp('unix'); + namespace common { dateSchema = dateSchema.allow(x); dateSchema = dateSchema.allow(x, x); @@ -471,6 +477,11 @@ namespace common { funcSchema = Joi.func(); +funcSchema = funcSchema.arity(num); +funcSchema = funcSchema.minArity(num); +funcSchema = funcSchema.maxArity(num); +funcSchema = funcSchema.ref(); + // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- numSchema = Joi.number(); @@ -732,6 +743,10 @@ namespace common { // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- +schema = Joi.alternatives(); +schema = Joi.alternatives().try(schemaArr); +schema = Joi.alternatives().try(schema, schema); + schema = Joi.alternatives(schemaArr); schema = Joi.alternatives(schema, anySchema, boolSchema); @@ -770,5 +785,15 @@ Joi.assert(obj, schema); Joi.assert(obj, schema, str); Joi.assert(obj, schema, err); +Joi.attempt(obj, schema); +Joi.attempt(obj, schema, str); +Joi.attempt(obj, schema, err); + ref = Joi.ref(str, refOpts); ref = Joi.ref(str); + +Joi.isRef(ref); + +schema = Joi.reach(schema, ''); + +const Joi2 = Joi.extend({ name: '', base: schema }); diff --git a/joi/joi.d.ts b/joi/joi.d.ts index d9ee7c20d1..3ba51d7383 100644 --- a/joi/joi.d.ts +++ b/joi/joi.d.ts @@ -1,6 +1,6 @@ -// Type definitions for joi v6.5.0 -// Project: https://github.com/spumko/joi -// Definitions by: Bart van der Schoor , Laurence Dougal Myers , Christopher Glantschnig , David Broder-Rodgers +// Type definitions for joi v9.0.0 +// Project: https://github.com/hapijs/joi +// Definitions by: Bart van der Schoor , Laurence Dougal Myers , Christopher Glantschnig , David Broder-Rodgers , Gael Magnan de Bornier // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TODO express type of Schema in a type-parameter (.default, .valid, .example etc) @@ -487,6 +487,13 @@ declare module 'joi' { items(type: Schema, ...types: Schema[]): ArraySchema; items(types: Schema[]): ArraySchema; + /** + * Lists the types in sequence order for the array values where: + * @param type - a joi schema object to validate against each array item in sequence order. type can be an array of values, or multiple values can be passed as individual arguments. + * If a given type is .required() then there must be a matching item with the same index position in the array. Errors will contain the number of items that didn't match. Any unmatched item having a label will be mentioned explicitly. + */ + ordered(type: Schema, ...types: Schema[]): ArraySchema; + /** * Specifies the minimum number of items in the array. */ @@ -683,18 +690,77 @@ declare module 'joi' { * Requires the string value to be in valid ISO 8601 date format. */ iso(): DateSchema; + + + /** + * Requires the value to be a timestamp interval from Unix Time. + * @param type - the type of timestamp (allowed values are unix or javascript [default]) + */ + timestamp(type?: 'javascript' | 'unix'): DateSchema; } export interface FunctionSchema extends AnySchema { + /** + * Specifies the arity of the function where: + * @param n - the arity expected. + */ + arity(n: number): FunctionSchema; + + + /** + * Specifies the minimal arity of the function where: + * @param n - the minimal arity expected. + */ + minArity(n: number): FunctionSchema; + + + /** + * Specifies the minimal arity of the function where: + * @param n - the minimal arity expected. + */ + maxArity(n: number): FunctionSchema; + + /** + * Requires the function to be a Joi reference. + */ + ref(): FunctionSchema; } export interface AlternativesSchema extends AnySchema { try(schemas: Schema[]): AlternativesSchema; + try(type1: Schema, type2: Schema, ...types: Schema[]): AlternativesSchema; when(ref: string, options: WhenOptions): AlternativesSchema; when(ref: Reference, options: WhenOptions): AlternativesSchema; } + export interface Terms { + value: any; + state: { + key: string, + path: string, + parent: any + }; + options: ValidationOptions; + } + + export interface Rules { + name: string; + params?: ObjectSchema | { [key: string]: Schema }; + setup?: Function; + validate?: Function; + description: string | Function; + } + + export interface Extension { + name: string; + base?: Schema; + pre?: Function; + language?: {}; + describe?: Function; + rules?: Rules[]; + } + // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- /** @@ -747,8 +813,9 @@ declare module 'joi' { /** * Generates a type that will match one of the provided alternative schemas */ - export function alternatives(types: Schema[]): Schema; - export function alternatives(type1: Schema, type2: Schema, ...types: Schema[]): Schema; + export function alternatives(): AlternativesSchema; + export function alternatives(types: Schema[]): AlternativesSchema; + export function alternatives(type1: Schema, type2: Schema, ...types: Schema[]): AlternativesSchema; /** * Validates a value using the given schema and options. @@ -771,8 +838,38 @@ declare module 'joi' { */ export function assert(value: any, schema: Schema, message?: string | Error): void; + + /** + * Validates a value against a schema, returns valid object, and throws if validation fails where: + * + * @param value - the value to validate. + * @param schema - the schema object. + * @param message - optional message string prefix added in front of the error message. may also be an Error object. + */ + export function attempt(value: T, schema: Schema, message?: string | Error): T; + + /** * Generates a reference to the value of the named key. */ export function ref(key: string, options?: ReferenceOptions): Reference; + + + /** + * Checks whether or not the provided argument is a reference. It's especially useful if you want to post-process error messages. + */ + export function isRef(ref: any): boolean; + + + /** + * Get a sub-schema of an existing schema based on a path. Path separator is a dot (.). + */ + export function reach(schema: Schema, path: string): Schema; + + + /** + * Creates a new Joi instance customized with the extension(s) you provide included. + */ + export function extend(extention: Extension): any; + } diff --git a/jpm/jpm-tests.ts b/jpm/jpm-tests.ts new file mode 100644 index 0000000000..33ecad5b87 --- /dev/null +++ b/jpm/jpm-tests.ts @@ -0,0 +1,110 @@ +/// + +import * as base64 from "sdk/base64"; +base64.decode("jesus", "abc"); +base64.decode(base64.encode("easy")); + +import * as panel from "sdk/panel"; +let p = panel.Panel({width: 10, height: 20, onError: (e) => e.message}); +p.port.on("damn", () => console.log("damn")); +p.on("show", () => console.log("panel shown")); +p.destroy(); + +import * as passwords from "sdk/passwords"; +passwords.search({onComplete: (credentials) => credentials.forEach((cred) => passwords.remove(cred)), + username: "mhamdy"}); +passwords.store({username: "mhamdy", password: "secret", onError: (error) => console.error(error.toString())}); + +import * as pageMod from "sdk/page-mod"; +import * as privateBrowsing from "sdk/private-browsing"; +pageMod.PageMod({include: "http://example.com", onAttach: (worker) => privateBrowsing.isPrivate(worker)}); + +import * as requests from "sdk/request"; +requests.Request<{value: string}>({url: "http://example.com", onComplete: (response) => console.log(response.json["value"])}).get(); + +import * as selection from "sdk/selection"; +selection.on("select", () => { + console.log(selection.text); + selection.html = "

      Hello There!

      "; + if (selection.isContiguous) { + console.log("selection is not not contiguous"); + } +}); + +import * as self from "sdk/self"; +p.contentScriptFile = self.data.url("./hello.js"); +p.show(); + +import * as prefs from "sdk/simple-prefs"; +type prefType = {pref1: string}; +(prefs.prefs as prefType)["pref1"] = "value"; +prefs.on("pref1", () => console.log("pref1 changed")); +prefs.removeListener("pref1", new Function()); + +import * as storage from "sdk/simple-storage"; +storage.storage.value = 10; +storage.storage.x = "hello"; +delete storage.storage.value; +storage.on("OverQuota", () => { + if (storage.quotaUsage > 1) { + console.log("you no longer have shelves to store anything. Successful!"); + } +}); + +import * as system from "sdk/system"; +console.log(system.env.PATH); +system.env.PATH = "/path/to/my/virus"; + +import * as tabs from "sdk/tabs"; +tabs.open({url: "http://example.com", onOpen: (tab) => tab.close()}); +tabs.open("http://example.com"); +console.info(tabs.length); + +import * as timers from "sdk/timers"; +timers.clearTimeout(timers.setInterval(() => console.log("hello"), 100)); +timers.clearInterval(timers.setTimeout(() => console.log("hello again"), 100)); + +import * as action from "sdk/ui/button/action"; +let button = action.ActionButton({id: "my button", label: "my button", icon: "./myicon.png"}); +button.on("click", (state) => { + if (state.label == "destroy") { + button.destroy(); + } +}); + +import * as toggle from "sdk/ui/button/toggle"; +let toggleButton = toggle.ToggleButton({id: "my button", label: "my button", icon: "./hello.png", + onChange: (state) => { + if (state.disabled) { + toggleButton.state("window", null); + } + }}); + + +import * as frame from "sdk/ui/frame"; +let frm = frame.Frame({url: "./frame.html", onMessage: (message) => { + frm.postMessage("hello", message.origin); +}}); + +import * as toolbar from "sdk/ui/toolbar"; +let tlbr = toolbar.Toolbar({title: "my toolbar", items: [button, toggleButton, frm], onShow: (toolbar) => { + toolbar.on("detach", () => console.info("toolbar detached")); +}}); + +import * as sidebar from "sdk/ui/sidebar"; +let sdbr = sidebar.Sidebar({url: "./sidebar.html", title: "my sidebar"}); +sdbr.on("attach", (worker) => { + worker.port.emit("hello sidebar"); +}); + +import * as urls from "sdk/url"; +console.log(urls.toFilename(urls.URL("http://example.com"))); +console.log(urls.DataURL("file:///my/path/file.txt").mimeType); + +import * as windows from "sdk/windows"; +import {stringify} from "sdk/querystring"; +for (let window of windows.browserWindows) { + console.info(window.title); +} +console.info(windows.browserWindows.length); +windows.browserWindows.open("http://example.com"); diff --git a/jpm/jpm.d.ts b/jpm/jpm.d.ts new file mode 100644 index 0000000000..512f768680 --- /dev/null +++ b/jpm/jpm.d.ts @@ -0,0 +1,1133 @@ +// Type definitions for Firefox Addon SDK +// Project: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/Add-on_SDK +// Definitions by: Mohammed Hamdy +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + + +declare module "sdk/base64" { + + /** + * Creates a base-64 encoded ASCII string from a string of binary data + * @param data the data to encode + * @param charset The charset of the string to encode (optional). The only accepted value is "utf-8". + * In order to encode and decode Unicode strings, the charset parameter needs to be set + */ + export function encode(data: string, charset?: string): string; + + /** + * + * @param data the encoded data + * @param charset + */ + export function decode(data: string, charset?: string): string; +} + +declare module "sdk/clipboard" { + + /** + * get the contents of the system clipboard + * @param datatype [text|html|image] Retrieve the clipboard contents only if matching this type + */ + export function get(datatype?: "text" | "html" | "image"): string; + + /** + * Replace the contents of the user's clipboard with the provided data + * @param data The data to put on the clipboard + * @param datatype [text|html|image] The type of the data + */ + export function set(data: string, datatype?: "text" | "html" | "image"): void; +} + +declare module "sdk/context-menu" { + + /** + * The context determines when the menu item will be visible + */ + interface Context { + // a base context + } + + /** + * The page context occurs when the user invokes the context menu on a non-interactive portion of the page + */ + export var PageContext: PageContext; + + interface PageContext extends Context { + (): Object; + } + + /** + * This context occurs when the menu is invoked on a page in which the user has made a selection + */ + export var SelectionContext: SelectionContext; + + interface SelectionContext extends Context { + (): Object; + } + + /** + * This context occurs when the menu is invoked on a node that either matches selector, a CSS selector, + * or has an ancestor that matches + * @param selector may include multiple selectors separated by commas, e.g., "a[href], img" + */ + export var SelectorContext: SelectorContext; + + interface SelectorContext extends Context { + (selector: string): Object; + } + + /** + * This context occurs when the menu is invoked on pages with particular URLs + * also see {@link sdk/page-mod} module which uses a similar match pattern + * @param matchPattern pattern string or an array of match pattern strings + */ + export var URLContext: URLContext; + + interface URLContext extends Context { + (matchPattern: string): Object; + } + + /** + * This context occurs when the function returns a true value + * @param predicateFunction The function is passed an object with properties describing the menu invocation context + */ + export var PredicateContext: PredicateContext; + + interface PredicateContext extends Context { + (predicateFunction: (context: {documentType: string, documentURL: string, targetName: string, targetID?: string, + isEditable: boolean, selectionText?: string, srcURL?: string, linkURL?: string, + value?: string}) => boolean): Object; + } + + interface ItemContext extends Array { + // a list of Context that also has add, remove methods + add: (context: Context) => void; + remove: (context: Context) => void; + } + + interface Item { + context: ItemContext; + destroy: () => void; + label: string; + image: string | URL; + data: any; + parentMenu?: Menu; + contentScript?: string | string[]; + contentScriptFile?: string | string[]; + } + /** + * A menu item + * @constructor + */ + export function Item(options: {label: string, image?: string, accessKey?: string, context?: Context | Context[], + contentScript?: string, contentScriptFile?: string, data?: any, onMessage?: (message?: any) => any}): Item; + + /** + * @constructor + * A menu separator + */ + export function Separator(): Separator; + + interface Separator { + parentMenu: Menu; + destroy: () => void; + } + + interface Menu { + addItem: (item: ItemMenuSeparator) => void; + removeItem: (item: ItemMenuSeparator) => void; + destroy: () => void; + label: string; + items: ItemMenuSeparator[]; + image: string | URL; + context: ItemContext; + parentMenu?: Menu; + contentScript: string | string[]; + contentScriptFile: string | string[]; + } + + type ItemMenuSeparator = Item | Menu | Separator; + + /** + * A labeled menu item that expands into a submenu + * @contructor + * @param options + */ + export function Menu(options: {label: string, items: ItemMenuSeparator[], image?: string, context?: Context[], + contentScript?: string | string[], contentScriptFile?: string | string[], onMessage: (message?: any) => void}): Menu; + +} + +declare module "sdk/hotkeys" { + interface Hotkey { + destroy: () => void; + } + /** + * @contructor + * Hotkey + * Used to define a hotkey combination passing it the combination and a function to be called when the user + * presses that combination + */ + export function Hotkey(options: {combo: string, onPress: () => void}): Hotkey; +} + +declare module "sdk/indexed-db" { + + // these interfaces are already provided by TypeScript + + interface IndexedImpl { + indexedDB: IDBFactory; + IDBKeyRange: IDBKeyRange; + DOMException: DOMException; + } + + export = IndexedImpl; +} + +declare module "sdk/l10n" { + /** + * This function takes a string parameter which it uses as an identifier to look up and return a localized string in + * the locale currently set for Firefox. Localized strings are supplied by the add-on developer in .properties + * files stored in the add-ons "locale" directory + * See {@link https://developer.mozilla.org/en-US/Add-ons/SDK/High-Level_APIs/l10n} + * @param identifier An identifier for the localization of a particular string in the current locale + * @param count If you're supplying different localizations for a string for singular or plural forms, + * this parameter is the number of items there are in this case + * @param placeholder If you do not include the count parameter, you can supply one or more placeholder strings that + * are to be inserted into the translated string at locations defined by the translator + */ + export function get(identifier: string, count?: number, ...placeholder: string[]): string; +} + +/** + * Display transient, toaster-style desktop messages to the user + */ +declare module "sdk/notifications" { + /** + * @param options + * @param options.title A string to display as the message's title + * @param options.text A string to display as the body of the message + * @param options.iconURL The URL of an icon to display inside the message. It may be a remote URL, a data URI, + * or a URL returned by the {@link sdk/self} module + * @param options.onClick A function to be called when the user clicks the message. It will be passed the value of data + * @param options.data A string that will be passed to onClick + */ + export function notify(options: {title?: string, text?: string, iconURL?: string, onClick?: (data: string) => any, + data?: string}): void; +} + +/** + * Run scripts in the context of web pages whose URL matches a given pattern + */ +declare module "sdk/page-mod" { + /** + * @constructor + * @param options.include + * @param options.contentStyle Lists stylesheets to attach, supplied as strings + * @param options.contentStyleFile Lists stylesheets to attach, supplied in separate files + * @param options.contentScriptOptions Defines read-only values accessible to content scripts + * @param options.attachTo Controls whether to attach scripts to tabs that were already open when the page-mod + * was created, and whether to attach scripts to iframes as well as the topmost document + * @param options.contentScriptWhen Controls the point during document load at which content scripts are attached + * @param options.exclude Has the same syntax as include, but specifies the URLs to which content scripts should not + * be attached, even if they match include: so it's a way of excluding a subset of the URLs + * that include specifies. The exclude option is new in Firefox 32 + * @param options.onAttach This event is emitted when the page-mod's content scripts are attached to a document + * whose URL matches the page-mod's include pattern + * @param options.onError This event is emitted when an uncaught runtime error occurs in one of the page-mod's content scripts + */ + export function PageMod(options: {include: string | string[] | RegExp | RegExp[], contentScript?: string | string[], + contentScriptFile?: string | string[], contentStyle?: string | string[], contentStyleFile?: string | string[], + contentScriptOptions?: any, attachTo?: attachmentMode | attachmentMode[], contentScriptWhen?: "start" | "ready" | "end", + exclude?: string | string[], onAttach?: (worker: FFAddonSDK.ContentWorker) => any, onError?: (error: Error) => any}): PageMod; + + type attachmentMode = "existing" | "top" | "frame" + + interface PageMod { + destroy: () => void; + include: string | string[] | RegExp | RegExp[]; + } + +} + +/** + * Create a permanent, invisible page and access its DOM + */ +declare module "sdk/page-worker" { + + /** + * @constructor + * @param options.contentURL The URL of the content to load in the worker + * @param options.contentScript A string or an array of strings containing the texts of content scripts to load. + * Content scripts specified by this option are loaded after those specified by the + * contentScriptFile option. + * @param options.contentScriptFile A local file URL or an array of local file URLs of content scripts to load + * Content scripts specified by this option are loaded before those specified + * by the contentScript option + * @param options.include This is useful when your page worker loads a page which will redirect to other pages. + * These define the documents to which the page-worker's content worker applies + * @param options.contentScriptWhen When to load the content scripts + * "start": load content scripts immediately after the document element for the page + * is inserted into the DOM, but before the DOM content itself has been loaded + * "ready": load content scripts once DOM content has been loaded, corresponding + * to the DOMContentLoaded event + * "end": load content scripts once all the content (DOM, JS, CSS, images) for the + * page has been loaded, at the time the window.onload event fires + * @param options.contentScriptOptions Read-only value exposed to content scripts under self.options property + */ + export function Page(options: {contentURL?: string, contentScript?: string | string[], + contentScriptFile?: string | string[], contentScriptWhen?: "start" | "ready" | "end", + onMessage?: (message: string) => any, allow?: {script: boolean}, contentScriptOptions?: any, + include?: string | string[] | RegExp | RegExp[]}): PageWorker; + + interface PageWorker { + port: FFAddonSDK.Port; + contentURL?: string; + destroy: () => void; + postMessage: (message: string) => void; + on: (event: "message" | "error", handler: (arg?: "message" | Error) => any) => void; + removeListener: (event: string, listener: Function) => void; + allow?: {script: boolean}; + include?: string | string[] | RegExp | RegExp[]; + contentScriptFile?: string | string[]; + contentScript?: string | string[]; + } + +} + +/** + * Creates transient dialogs to implement part of an add-on's user interface + */ +declare module "sdk/panel" { + /** + * @constructor + * @param options.contentURL The URL of the content to load in the panel. That is, they can't refer to remote scripts + * @param options.width The width of the panel in pixels + * @param options.height The height of the panel in pixels + * @param options.contentScript A string or an array of strings containing the texts of content scripts to load. + * Content scripts specified by this property are loaded after those specified by the + * contentScriptFile property + * @param options.contentScriptFile A URL or an array of URLs. The URLs point to scripts to load into the panel + * @param [options.contentScriptWhen="end"] + * @param options.contentStyle A string or an array of strings containing the texts of stylesheets to load. + * Stylesheets specified by this property are loaded after those specified by the + * contentStyleFile property + * @param options.contentStyleFile A URL or an array of URLs. The URLs point to CSS stylesheets to load into the panel + * @param options.position The position of the panel. Ignored if the panel is opened by a widget. + This may be one of three things: + 1. a toggle button. If this is supplied the panel will be shown attached to the button + 2. a widget object. If this is supplied the panel will be shown attached to the widget. + 3. an object which specifies where in the window the panel should be shown + * @param [options.focus=true] Set to false to prevent taking the focus away when the panel is shown. + * Only turn this off if necessary, to prevent accessibility issues + * @param options.allow An optional object describing permissions for the content. It should contain a single key + * named script whose value is a boolean that indicates whether or not to execute script in the content + * @param [options.contextMenu=false] Whether to show a context menu when the user context-clicks in the panel. + * The context menu will be the same one that's displayed in web pages + */ + + export function Panel(options: {contentURL?: string | URL, width?: number, height?: number, contentScript?: string | string[], + contentScriptFile?: string | string[], contentScriptWhen?: "start" | "ready" | "end", + contentScriptOptions?: any, contentStyle?: string | string[], + contentStyleFile?: string | string[], position?: PanelPosition, + allow?: {script?: boolean}, focus?: boolean, contextMenu?: boolean, + onMessage?: (message: string) => any, onShow?: () => any, onHide?: () => any, + onError?: (error: Error) => any}): Panel; + + interface Panel { + show: (options?: {width?: number, height?: number, position?: PanelPosition, focus?: boolean}) => void; + hide: () => void; + resize: (width: number, height: number) => void; + destroy: () => void; + postMessage: (message: string) => void; + on: (event: "show" | "hide" | "message" | "error", handler: (arg?: Error | any) => any) => void; + removeListener: (event: string, listener: Function) => void; + port: FFAddonSDK.Port; + isShowing: boolean; + height: number; + width: number; + focus: boolean; + contentURL?: string | URL; + allow?: {script: boolean}; + contentScriptFile?: string | string[]; + contentScript?: string | string[]; + contentScriptWhen: "start" | "ready" | "end"; + contentScriptOptions?: any; + } + type PanelPosition = FFAddonSDK.ToggleButton | FFAddonSDK.Widget | {top?: number, right?: number, bottom?: number, left?: number}; +} + +/** + * Interact with Firefox's Password Manager to add, retrieve and remove stored credentials + */ +declare module "sdk/passwords" { + /** + * This function is used to retrieve a credential, or a list of credentials, stored in the Password Manager + * @param options.onComplete The callback function that is called once the function completes successfully + */ + export function search(options: {onComplete: (credentials: Credential[]) => any, username?: string, url?: string, + password?: string, formSubmitURL?: string, realm?: string, usernameField?: string, + passwordField?: string, onError?: (error: FFAddonSDK.NSIException) => any}): void; + + /** + * This function is used to store a credential in the Password Manager. + * It takes an options object as an argument: this contains all the properties for the new credential. + * As different sorts of credentials contain different properties, the appropriate options differ depending + * on the sort of credential being stored + */ + export function store(options: Credential & {onComplete?: () => any, onError?: (error: FFAddonSDK.NSIException) => any}): void; + + /** + * Removes a stored credential + */ + export function remove(options: Credential & {onComplete?: () => any, onError?: (error: FFAddonSDK.NSIException) => any}): void; + + interface Credential { + username: string; + password: string; + url?: string; + formSubmitURL?: string; + realm?: string; + usernameField?: string; + passwordField?: string; + } +} + +/** + * Check whether a given object is private, so an add-on can respect private browsing + */ +declare module "sdk/private-browsing" { + + export function isPrivate(object: FFAddonSDK.Tab | FFAddonSDK.ContentWorker | FFAddonSDK.BrowserWindow): boolean; +} + +declare module "sdk/querystring" { + /** + * Utility functions for working with query strings + */ + + /** + * Serializes an object containing name:value pairs into a query string + * @param object {Object} The data to convert to a query string + * @param [separator='&'] The string to use as a separator between each name:value pair + * @param [assignment='='] The string to use between each name and its corresponding value + */ + export function stringify(object: Object, separator?: string, assignment?: string): string; + + /** + * Parse a query string into an object containing name:value pairs + */ + export function parse(querystring: string, separator?: string, assignment?: string): Object; + + /** + * The escape function used by stringify to encodes a string safely matching RFC 3986 for + * application/x-www-form-urlencoded + */ + export function escape(query: string): string; + + /** + * The unescape function used by parse to decode a string safely + */ + export function unescape(query: string): string; +} + +/** + * Make simple network requests + */ +declare module "sdk/request" { + /** + * This constructor creates a request object that can be used to make network requests + * @param options.url This is the url to which the request will be made + * @param options.onComplete This function will be called when the request has received a response + * (or in terms of XHR, when readyState == 4) + * @param options.headers An unordered collection of name/value pairs representing headers to send with the request + * @param options.content The content to send to the server. If content is a string, it should be URL-encoded + * (use encodeURIComponent). If content is an object, it should be a collection of name/value pairs. + * Nested objects & arrays should encode safely. + * For GET and HEAD requests, the query string (content) will be appended to the URL. + * For POST and PUT requests, it will be sent as the body of the request + * @param [options.contentType='application/x-www-form-urlencoded'] The type of content to send to the server + * This explicitly sets the Content-Type header + * @param options.overrideMimeType Use this string to override the MIME type returned by the server in the response's + * Content-Type header. You can use this to treat the content as a different MIME type, + * or to force text to be interpreted using a specific character + * @param [options.anonymous=false] If true, the request will be sent without cookies or authentication headers + * @constructor + */ + export function Request(options: {url?: string | FFAddonSDK.SDKURL, onComplete?: (response: Response) => any, + headers?: Object, content?: string | Object, contentType?: string, anonymous?: boolean, + overrideMimeType?: string}): Request; + // a strongly-typed generic variant of the request + export function Request(options: {url?: string | FFAddonSDK.SDKURL, onComplete?: (response: STResponse) => any, + headers?: Object, content?: string | Object, contentType?: string, anonymous?: boolean, + overrideMimeType?: string}): STRequest; + + interface BaseRequest { + get: () => void; + post: () => void; + head: () => void; + put: () => void; + delete: () => void; + url: string | FFAddonSDK.SDKURL; + headers: Object; + content: string; + contentType: string; + } + + interface Request extends BaseRequest { + response: Response; + } + + interface STRequest extends BaseRequest{ + response: STResponse; + } + + interface BaseResponse { + url: string; + text: string; + status: number; + statusText: string; + headers: Object; + anonymous: boolean; + } + + interface Response extends BaseResponse { + json: Object; + } + + interface STResponse { + json: T; + } +} + +/** + * Get and set text and HTML selections in the current web page + */ +declare module "sdk/selection" { + // TODO: enable module iteration to return 'selection' items + + // there's no way I know of to limit the event to 'select' only and so this hack + // this should not even be an argument to the function but I'm not Firefox + export function on(event: "select" | "select", handler: () => any): void; + export function removeListener(event: "select" | "select", handler: Function): void; + /** + * Gets or sets the current selection as plain text. Setting the selection removes all current selections, + * inserts the specified text at the location of the first selection, and selects the new text. + * Getting the selection when there is no current selection returns null. + * Setting the selection when there is no current selection throws an exception + * Getting the selection when isContiguous is true returns the text of the first selection + */ + export var text: string; + /** + * Gets or sets the current selection as HTML. Setting the selection removes all current selections, + * inserts the specified text at the location of the first selection, and selects the new text. + * Getting the selection when there is no current selection returns null. + * Setting the selection when there is no current selection throws an exception. + * Getting the selection when isContiguous is true returns the text of the first selection + */ + export var html: string; + /** + * true if the current selection is a single, contiguous selection, + * and false if there are two or more discrete selections, each of which may or may not be spatially adjacent. + */ + export const isContiguous: boolean; +} + +/** + * Access data that is bundled with the add-on, and add-on metadata + */ + +declare module "sdk/self" { + /** + * This property represents an add-on associated unique URI string + * This URI can be used for APIs which require a valid URI string, such as the passwords module + */ + export const uri: string; + + /** + * This property is a printable string that is unique for each add-on. + * It comes from the id property set in the package.json file in the main package (i.e. the package in which you run jpm xpi) + * While not generally of use to add-on code directly, it can be used by internal API code to index local storage + * and other resources that are associated with a particular add-on. + */ + export const id: string; + + /** + * This property contains the add-on's short name. It comes from the name property in the main package's package.json file + */ + export const name: string; + + /** + * This property contains the add-on's version string. It comes from the version property set in the package.json file in the main package + */ + export const version: string; + + /** + * A property that indicates why the addon was loaded + */ + export const loadReason: "install" | "enable" | "startup" | "upgrade" | "downgrade"; + + /** + * This property indicates whether or not the add-on supports private browsing + * It comes from the private-browsing key in the add-on's package.json file + */ + export const isPrivateBrowsingSupported: boolean; + + export namespace data { + + /** + * The data.load() method returns the contents of an embedded data file, as a string. + * It is most useful for data that will be modified or parsed in some way, such as JSON, XML, plain text, + * or perhaps an HTML template. For data that can be displayed directly in a content frame, use data.url() + * @param name The filename to be read, relative to the package's data directory. + * Each package that uses the self module will see its own data directory + */ + export function load(name: string): string; + + /** + * The data.url() method returns a resource:// url that points at an embedded data file. + * It is most useful for data that can be displayed directly in a content frame. + * The url can be passed to a content frame constructor, such as the {@link Panel} + */ + export function url(name: string): string; + + } + +} + +/** + * Store preferences across application restarts + */ +declare module "sdk/simple-prefs" { + + /** + * Registers an event listener that will be called when a preference is changed + * @param prefName The name of the preference to watch for changes. Empty name '' listens for all preferences + * @param listener + */ + export function on(prefName: string, listener: (prefName: string) => any): void; + + /** + * Unregisters an event listener for the specified preference + */ + export function removeListener(prefName: string, listener: Function): void; + + export const prefs: Object; + +} + +/** + * Lets an add-on store data so that it's retained across Firefox restarts + */ +declare module "sdk/simple-storage" { + + export const storage: any; + export const quotaUsage: number; + export function on(event: "OverQuota" | "OverQuota", handler: () => any): void; +} + +/** + * Query the add-on's environment and access arguments passed to it + */ +declare module "sdk/system" { + + /** + * Quits the host application with the specified code + * @param [code=0] + */ + export function exit(code: number): void; + + /** + * Firefox enables you to get the path to certain "special" directories, such as the desktop or the profile directory. + * This function exposes that functionality to add-on authors + * @param id see [@link https://developer.mozilla.org/en-US/docs/Code_snippets/File_I_O#Getting_files_in_special_directories} + */ + export function pathFor(id: string): string; + + /** + * This object provides access to environment variables + */ + export const env: any; + + /** + * The type of operating system you're running on + */ + export const platform: string; + + /** + * The type of processor architecture you're running on. This will be one of: "arm","ia32", or"x64" + */ + export const architecture: string; + + /** + * The type of compiler used to build the host application. For example: "msvc", "n32", "gcc2", "gcc3", "sunc", "ibmc" + */ + export const compiler: string; + + /** + * An identifier for the specific build, derived from the build date. This is useful if you're trying to target individual nightly builds + */ + export const build: string; + + /** + * The UUID for the host application. For example, "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}" for Firefox + */ + export const id: string; + + /** + * The human-readable name for the host application. For example, "Firefox" + */ + export const name: string; + + /** + * The version of the host application + */ + export const version: string; + + /** + * The version of XULRunner that underlies the host application + */ + export const platformVersion: string; + + /** + * The name of the host application's vendor, for example: "Mozilla" + */ + export const vendor: string; +} + +/** + * Open, manipulate, and access tabs, and receive tab events + */ +declare module "sdk/tabs" { + // TODO: allow enumerating this module as a list of tabs + + /** + * Opens a new tab. The new tab will open in the active window or in a new window, depending on the inNewWindow option + * @param options String URL to be opened in the new tab or an options object + * @param [options.inNewWindow=false] Determine whether the new tab should be private or not + * If your add-on does not support private browsing this will have no effect + * @param options.inBackground tab will be opened to the right of the active tab and will not be active + * @param options.onOpen This event is emitted when a new tab is opened. This does not mean that the content has loaded, + * only that the browser tab itself is fully visible to the user. + * Properties relating to the tab's content (for example: title, favicon, and url) will not be + * correct at this point. If you need to access these properties, listen for the ready event. + * @param options.onClose This event is emitted when a tab is closed. When a window is closed this event will be + * emitted for each of the open tabs in that window + * @param options.onReady This event is emitted when the DOM for a tab's content is ready. + * It is equivalent to the DOMContentLoaded event for the given content page. + * A single tab will emit this event every time the DOM is loaded: so it will be emitted again + * if the tab's location changes or the content is reloaded. + * After this event has been emitted, all properties relating to the tab's content can be used. + */ + export function open(options: string | {url: string, inNewWindow?: boolean, inBackground?: boolean, isPinned?: boolean, + onOpen?: (tab: FFAddonSDK.Tab) => any, onClose?: (tab: FFAddonSDK.Tab) => any, onReady?: (tab: FFAddonSDK.Tab) => any, + onLoad?: (tab: FFAddonSDK.Tab) => any, onPageShow?: (tab: FFAddonSDK.Tab) => any, onActivate?: (tab: FFAddonSDK.Tab) => any, + onDeactivate?: (tab: FFAddonSDK.Tab) => any}): void; + + export function on(event: "open" | "close" | "ready" | "load" | "pageshow" | "activate" | "deactivate", + handler: (tab: FFAddonSDK.Tab) => any): void; + + /** + * The currently active tab in the active window + */ + export const activeTab: FFAddonSDK.Tab; + + /** + * The number of open tabs across all windows + */ + export const length: number; +} + +/** + * Set one-off and periodic timers + */ +declare module "sdk/timers" { + + /** + * Schedules callback to be called in ms milliseconds. Any additional arguments are passed straight through to the callback + */ + export function setTimeout(callback: (...args: any[]) => any, timeoutMS: number): TIMEOUT_ID; + + /** + * Given an ID returned from setTimeout(), prevents the callback with the ID from being called (if it hasn't yet been called) + */ + export function clearTimeout(timerID: TIMEOUT_ID): void; + + /** + * Schedules callback to be called repeatedly every ms milliseconds + * Any additional arguments are passed straight through to the callback + */ + export function setInterval(callback: (...args: any[]) => any, timeoutMS: number): INTERVAL_ID; + + /** + * Given an ID returned from setInterval(), prevents the callback with the ID from being called again + */ + export function clearInterval(intervalID: INTERVAL_ID): void; + + type TIMEOUT_ID = number; + type INTERVAL_ID = number; + +} + +/** + * Add a button to the Firefox user interface + * With this module you can create buttons that display icons and can respond to click events + */ +declare module "sdk/ui/button/action" { + /** + * Creates an action button + * @constructor + * @param options.id The button's ID. This is used internally to keep track of this button + * The ID must be unique within your add-on + * @param options.label The button's human-readable label. When the button is in the toolbar, + * this appears in a tooltip, and when the button is in the menu, + * it appears underneath the button as a legend + * @param options.icon One or more icons for the button + */ + export function ActionButton(options: {id: string, label: string, + icon: FFAddonSDK.Icon, onClick?: (state: FFAddonSDK.ActionButton) => any, + onChange?: (state: FFAddonSDK.ActionButtonState) => any, disabled?: boolean, + badge?: string | number, badgeColor?: string}): FFAddonSDK.ActionButton; +} + +/** + * Add a toggle button to the Firefox user interface + * With this module you can create buttons that function like a check box, representing an on/off choice + */ +declare module "sdk/ui/button/toggle" { + /** + * Creates a toggle button + * @constructor + * @param options.id The button's ID. This is used internally to keep track of this button + * The ID must be unique within your add-on + * @param options.label The button's human-readable label. When the button is in the toolbar, + * this appears in a tooltip, and when the button is in the menu, + * it appears underneath the button as a legend + * @param options.icon One or more icons for the button + */ + export function ToggleButton(options: {id: string, label: string, icon: FFAddonSDK.Icon, + onChange?: (state: FFAddonSDK.ToggleButtonState) => any, + onClick?: (state: FFAddonSDK.ToggleButtonState) => any, badge?: string | number, + badgeColor?: string, disabled?: boolean, checked?: boolean}): FFAddonSDK.ToggleButton; + +} + +/** + * Create HTML iframes, using bundled HTML, CSS and JavaScript, + * that can be added to a designated area of the Firefox user interface. At the moment you can only add frames to a toolbar + */ + +declare module "sdk/ui/frame" { + + /** + * Creates a frame. Once created, the frame needs to be added to a toolbar for it to be visible + * @param options.url A URL pointing to the HTML file specifying the frame's content. + * The file must be bundled with the add-on under its "data" directory + * @param options.name The frame's name. This must be unique within your add-on. + This is used to generate an ID to to keep track of the frame. If you don't supply a name, the ID is derived from + the frame's URL, meaning that if you don't supply a name, you may not create two frames with the same URL + * @param options.onReady This event is emitted while a frame instance is being loaded, at the point where it becomes + * possible to interact with the frame although sub-resources may still be in the process of loading + * It's the equivalent of the point where the frame's document.readyState becomes "interactive" + * @param options.onAttach This event is emitted whenever a new frame instance is constructed and the browser has + * started to load its document: for example, when the user opens a new browser window, if that window has a + * toolbar containing this frame. Since the event is dispatched asynchronously, the document may already be + * loaded by the time the event is received. + * At this point, you should not try to send messages to scripts hosted in the frame + * because the frame scripts may not have been loaded + * @param options.onDetach This event is emitted when a frame instance is unloaded: for example, when the user + * closes a browser window, if that window has a toolbar containing this frame. + * After receiving this message, you ahould not attempt to communicate with the frame scripts + * @constructor + */ + export function Frame(options: {url: string, name?: string, onMessage?: (message: FFAddonSDK.FrameEvent) => any, + onReady?: (event: FFAddonSDK.FrameEvent) => any, onLoad?: (event: FFAddonSDK.FrameEvent) => any, + onAttach?: (event: FFAddonSDK.FrameEvent) => any, onDetach?: (event: FFAddonSDK.FrameEvent) => any}): FFAddonSDK.Frame; + +} + +/** + * Add a toolbar to the Firefox user interface. A toolbar is a horizontal strip of user interface real estate + */ +declare module "sdk/ui/toolbar" { + /** + * @constructor + * @param options.title The toolbar's title. This appears as the name of the toolbar in the Firefox "Toolbars" menu + * It must be unique + * @param options.title An array of items to appear in the toolbar. Each item in items must be an action button, + * a toggle button, or a frame instance. Buttons each take up a fixed width. + * If more than one frame is supplied here, the frames each occupy an equal vertical strip of the toolbar + * @param options.onAttach This event is emitted when the toolbar is first loaded. + * Note that since there is only one toolbar for the whole browser, opening another browser window does not + * cause this event to be emitted again. After this event the toolbar's properties are available + */ + export function Toolbar(options: {title: string, items: ToolbarItem[], hidden?: boolean, + onAttach?: (toolbar: Toolbar) => any, onDetach?: (toolbar: Toolbar) => any, + onShow?: (toolbar: Toolbar) => any, onHide?: (toolbar: Toolbar) => any}): Toolbar; + + interface Toolbar { + title: string; + items: ToolbarItem[]; + hidden: boolean; + on: (event: "show" | "hide" | "attach" | "detach", handler: (toolbar: Toolbar) => any) => void; + once: (event: "show" | "hide" | "attach" | "detach", handler: (toolbar: Toolbar) => any) => void; + removeListener: (event: "show" | "hide" | "attach" | "detach", handler: Function) => void; + off: (event: "show" | "hide" | "attach" | "detach", handler: Function) => void; + destroy: () => void; + } + + type ToolbarItem = FFAddonSDK.Frame | FFAddonSDK.ActionButton | FFAddonSDK.ToggleButton; +} + +/** + * Enables you to create sidebars. A sidebar is a vertical strip of user interface real estate for your add-on that's + * attached to the left-hand side of the browser window. You specify its content using HTML, CSS, and JavaScript, + * and the user can show or hide it in the same way they can show or hide the built-in sidebars + */ +declare module "sdk/ui/sidebar" { + + /** + * @constructor + * @param options.id The id of the sidebar. This is used to identify this sidebar in its chrome window. It must be unique + */ + export function Sidebar(options: {id?: string, title: string, url: string, onShow?: () => any, onHide?: () => any, + onAttach?: (worker: SidebarWorker) => any, onDetach?: () => any, + onReady?: (worker: SidebarWorker) => any}): Sidebar; + + interface Sidebar { + id: string; + title: string; + url: string; + show: (window?: FFAddonSDK.BrowserWindow) => void; + hide: (window?: FFAddonSDK.BrowserWindow) => void; + on: (event: "show" | "hide" | "attach" | "detach" | "ready", handler: (worker: SidebarWorker) => any) => void; + once: (event: "show" | "hide" | "attach" | "detach" | "ready", handler: (worker: SidebarWorker) => any) => void; + removeListener: (event: "show" | "hide" | "attach" | "detach" | "ready", handler: Function) => void; + dispose: () => void; + } + + interface SidebarWorker { + port: FFAddonSDK.Port; + } +} + +/** + * Construct, validate, and parse URLs + */ +declare module "sdk/url" { + /** + * The URL constructor creates an object that represents a URL, verifying that the provided string is a valid URL in the process. + * Any API in the SDK which has a URL parameter will accept URL objects, not raw strings, unless otherwise noted + * @constructor + * @param source A string to be converted into a URL. If source is not a valid URI, this constructor will throw an exception + * @param base Used to resolve relative source URLs into absolute ones + */ + export function URL(source: string, base?: string): FFAddonSDK.SDKURL; + + /** + * The DataURL constructor creates an object that represents a data: URL, + * verifying that the provided string is a valid data: URL in the process + * @constructor + * @param uri A string to be parsed as Data URL. If is not a valid URI, this constructor will throw an exception + */ + export function DataURL(uri: string): DataURL; + + /** + * Attempts to convert the given URL to a native file path. This function will automatically attempt to resolve + * non-file protocols, such as the resource: protocol, to their place on the file system. + * An exception is raised if the URL can't be converted; otherwise, the native file path is returned as a string + */ + export function toFilename(url: FFAddonSDK.SDKURL): string; + + /** + * Converts the given native file path to a file: URL + */ + export function toFileName(url: string): string; + + /** + * Checks the validity of a URI. isValidURI("http://mozilla.org") would return true, + * whereas isValidURI("mozilla.org") would return false + */ + export function isValidURI(uri: string): boolean; + + /** + * Returns the top-level domain for the given URL: that is, the highest-level domain under which individual domains may be registered + */ + export function getTLD(url: string): string; + + interface DataURL { + toString: () => string; + mimeType: string; + parameters: Object; + base64: string; + data: string; + } +} + +/** + * Enumerate and examine open browser windows, open new windows, and listen for window events + */ +declare module "sdk/windows" { + + export const browserWindows: BrowserWindows; + + interface BrowserWindows extends Array { + /** + * Open a new window + * @param options.isPrivate determines whether the new window should be private or not + */ + open: (options: string | {url: string, isPrivate?: boolean, onOpen?: (window: FFAddonSDK.BrowserWindow) => any, + onClose?: (window: FFAddonSDK.BrowserWindow) => any, onActivate?: (window: FFAddonSDK.BrowserWindow) => any, + onDeactivate?: (window: FFAddonSDK.BrowserWindow) => any}) => FFAddonSDK.BrowserWindow; + on: (event: "open" | "close" | "activate" | "deactivate", handler: (window: FFAddonSDK.BrowserWindow) => any) => void; + activeWindow: FFAddonSDK.BrowserWindow; + } + +} + +declare namespace FFAddonSDK { + + interface BrowserWindow { + title: string; + activate: () => void; + close: (callback?: () => void) => void; + tabs: Tab[]; + } + + interface SDKURL { + scheme: string; + userPass: string; + host: string; + port: string; + path: string; + hostname: string; + pathname: string; + hash: string; + href: string; + origin: string; + protocol: string; + search: string; + toString: () => string; + toJSON: () => string; + } + + interface FrameEvent { + origin: string; + source: Frame; + data?: any; + } + + interface Frame { + url: URL; + postMessage: (message: string, target: string) => void; + on: (event: "attach" | "detach" | "load" | "ready" | "message", handler: (event: FrameEvent) => any) => void; + once: (event: "attach" | "detach" | "load" | "ready" | "message", handler: (event: FrameEvent) => any) => void; + removeListener: (event: "attach" | "detach" | "load" | "ready" | "message", handler: Function) => void; + off: (event: "attach" | "detach" | "load" | "ready" | "message", handler: Function) => void; + destroy: () => void; + } + + type Icon = string | {"16"?: string, "32"?: string, "64"?: string}; + + interface ToggleButtonState { + id: string; + label: string; + badge: string; + checked: boolean; + disabled: boolean; + } + + interface ToggleButton extends ToggleButtonState { + click: () => void; + on: (event: "click" | "change", handler: (state: ToggleButtonState) => any) => void; + once: (event: "click" | "change", handler: (state: ToggleButtonState) => any) => void; + removeListener: (event: string, handler: Function) => void; + state: (target: "window" | "tab" | Tab | BrowserWindow | ToggleButton, state?: {disabled?: boolean, label?: string, icon?: Icon, + checked?: boolean, badge?: string | number, badgeColor?: string}) => ToggleButtonState; + destroy: () => void; + } + + + interface ActionButtonState { + id: string; + label: string; + disabled: boolean; + icon: FFAddonSDK.Icon; + badge: string | number; + badgeColor: string; + } + + interface ActionButton extends ActionButtonState { + // there's a compromise here by always returning ActionButtonState. It will return undefined if no options are passed + state: (target: BrowserWindow | Tab | ActionButton | "window" | "tab", + state?: {disabled?: boolean, label?: string, icon?: Icon}) => ActionButtonState; + click: () => void; + destroy: () => void; + on: (event: "click" | "click", handler: (state: ActionButtonState) => any) => void ; + once: (event: "click" | "click", handler: (state: ActionButtonState) => any) => void; + removeListener: (event: "click" | "click", handler: Function) => void; + } + + interface Tab { + title: string; + url: string; + id: string; + favicon: string; + contentType: string; + index: number; + isPinned: boolean; + window: BrowserWindow; + readyState: "uninitialized" | "loading" | "interactive" | "complete"; + on: (event: "ready" | "load" | "pageshow" | "activate" | "deactivate" | "close", handler: (tab: Tab) => any)=> void; + attach: (options: {contentScript?: string | string[], contentScriptFile?: string | string[], contentScriptOptions?: Object, + onMessage?: (message: string) => any, onError?: (error: Error) => any}) => ContentWorker; + activate: () => void; + pin: () => void; + unpin: () => void; + close: (afterClose?: () => any) => void; + reload: () => void; + getThumbnail: () => string; + } + + + /** + * The SDK port API + * @see [port API]{@link https://developer.mozilla.org/en-US/Add-ons/SDK/Guides/using_port} + */ + interface Port { + emit: (event: string, data?: any) => void; + on: (event: string, handler: (data?: any) => any) => void; + } + + interface ContentWorker { + new(options: {window: Window, contentScript?: string | string[], contentScriptFile?: string | string[], + onMessage: (data?: any) => any, onError: (data?: any) => any}): ContentWorker; + url: URL; + port: Port, + tab: Tab; + on: (event: "detach" | "message" | "error", handler: () => any) => void; + postMessage: (data?: any) => void; + destroy: () => void; + } + + interface Widget { + + } + + /** + * @see [nsIException]{@link https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIException} + */ + interface NSIException { + lineNumber: number; + columnNumber: number; + data: any; + filename: string; + inner?: NSIException; + location?: any; + message: string; + name: string; + result: any; + toString: () => string; + } + +} diff --git a/jqgrid/jqgrid-tests.ts b/jqgrid/jqgrid-tests.ts index 6f112d2976..b9012185bc 100644 --- a/jqgrid/jqgrid-tests.ts +++ b/jqgrid/jqgrid-tests.ts @@ -2,5 +2,25 @@ // Definitions by: Lokesh Peta // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// -/// \ No newline at end of file +/// +/// + +var mydata: any[] = []; + +$('#jqGrid') + .jqGrid({ + datatype: 'local', + data: mydata, + loadonce: true, + gridview: true, + height: 400, + shrinkToFit: true, + width: null, + colModel: [ + { label: 'Name', name: 'id', width: 75, key: true, align: 'left' }, + { label: 'Description', name: 'description', width: 100 } + ], + viewrecords: true, // show the current page, data rang and total records on the toolbar + caption: 'Matches', + onSelectRow(id: any, status: any, e: Event) { } + }); diff --git a/jqgrid/jqgrid.d.ts b/jqgrid/jqgrid.d.ts index 82807282a0..6b7d4cb2e0 100644 --- a/jqgrid/jqgrid.d.ts +++ b/jqgrid/jqgrid.d.ts @@ -4,44 +4,337 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// + +// http://www.trirand.com/jqgridwiki/doku.php?id=wiki:colmodel_options interface JQueryJqGridColumn { - name: string; - index: string; + + /** + * Defines the alignment of the cell in the Body layer, not in header cell. Possible values: left, center, right + */ + align?: "left" | "center" | "right"; + + /** + * This function add attributes to the cell during the creation of the data - i.e dynamically. + * By example all valid attributes for the table cell can be used or a style attribute with different properties. + * @param rowId the id of the row + * @param val the value which will be added in the cell + * @param rowObject the raw object of the data row - i.e if datatype is json - array, if datatype is xml xml node. + * @param cm all the properties of this column listed in the colModel + * @param rdata the data row which will be inserted in the row. This parameter is array of type name:value, where name is the name in colModel + * @returns {} + */ + cellattr?: (rowId: any, val: any, rowObject: any, cm: any, rdata: any) => string; + + /** + * This option allow to add classes to the column. If more than one class will be used a space should be set. + * By example classes:'class1 class2' will set a class1 and class2 to every cell on that column. + * In the grid css there is a predefined class ui-ellipsis which allow to attach ellipsis to a particular row. + * Also this will work in FireFox too. + */ + classes?: string; + + /** + * Governs format of sorttype:date (when datetype is set to local) and editrules {date:true} fields. + * Determines the expected date format for that column. Uses a PHP-like date formatting. Currently "/", "-", and "." are supported as date separators. Valid formats are: + * y,Y,yyyy for four digits year + * YY, yy for two digits year + * m,mm for months + * d,dd for days. + */ + datefmt?: string; + + /** + * Defines if the field is editable. This option is used in cell, inline and form modules. + */ + editable?: boolean; + + /** + * The predefined types (string) or custom function name that controls the format of this field + * @param cellvalue is the value to be formatted + * @param options is an object containing the following element: rowId - is the id of the row colModel is the object of the properties for this column getted from colModel array of jqGrid + * @param rowObject is a row data represented in the format determined from datatype option. If we have datatype: xml/xmlstring - the rowObject is xml node,provided according to the rules from xmlReader If we have datatype: json/jsonstring - the rowObject is array, provided according to the rules from jsonReader + * @returns {} the formatted value + */ + formatter?: "integer" | "number" | "currency" | "date" | "email" | "link" | "showlink" | "checkbox" | "select" | "actions" | ((cellvalue: any, options: { rowId: any, colModel: any }, rowObject: any) => any); + + /** + * Defines if this column is hidden at initialization. + */ hidden?: boolean; - sortable?: boolean; + + /** + * Set the index name when sorting. Passed as sidx parameter. + */ + index?: string; + + /** + * Overwrite the id (defined in readers) from server. Can be set as id for the unique row id. Only one column can have this property. + * This option have higher priority as those from the readers. + * If there are more than one key set the grid finds the first one and the second is ignored. + */ + key?: boolean; + + /** + * When colNames array is empty, defines the heading for this column. + * If both the colNames array and this setting are empty, the heading for this column comes from the name property. + */ + label?: string; + + /** + * Set the unique name in the grid for the column. + * This property is required. + * As well as other words used as property/event names, the reserved words (which cannot be used for names) include subgrid, cb and rn. + */ + name: string; + + /** + * When used in search modules, disables or enables searching on that column + */ search?: boolean; + + /** + * Defines is this can be sorted + */ + sortable?: boolean; + + /** + * Set the initial width of the column, in pixels. This value currently can not be set as percentage + */ width?: number; - formatter?: (cellvalue: any, options: any, rowObject: any) => any; } interface IJqGridJsonReader { + /** + * tells jqGrid that the information for the data in the row is repeatable - i.e. the elements have the same tag cell described in cell element. Setting this option to false instructs jqGrid to search elements in the json data by name. + * This is the name from colModel or the name described with the jsonmap option in colModel + */ repeatitems: boolean; - root(obj: any): any; - page(obj: any): any; - total(obj: any): number; - records(obj: {data: any[]}): number; + + /** + * Name of the root property + * @param obj + * @returns {} + */ + root: string | ((obj: any) => any); + + /** + * current page of the query + * @param obj + * @returns {} + */ + page: string | ((obj: any) => number); + + /** + * total pages for the query + * @param obj + * @returns {} + */ + total: string | ((obj: any) => number); + + /** + * total number of records for the query + * @param obj + * @returns {} + */ + records: string | ((obj: {data: any[]}) => number); } interface JQueryJqGridOptions { - datatype?: string; - mtype?: string; + /** + * When set to true encodes (html encode) the incoming (from server) and posted data (from editing modules). + */ autoencode?: boolean; - pager?: string; - rowNum?: number; - rowList?: number[]; - colNames?: string[]; + + /** + * When set to true, the grid width is recalculated automatically to the width of the parent element. + * This is done only initially when the grid is created. + * In order to resize the grid when the parent element changes width you should apply custom code and use the setGridWidth method for this purpose + */ + autoWidth?: boolean; + + /** + * Defines the caption for the grid. This caption appears in the caption layer, which is above the header layer + */ + caption?: string; + + /** + * Array which describes the parameters of the columns. This is the most important part of the grid. + */ colModel?: JQueryJqGridColumn[]; - sortname?: string; - sortorder?: string; - multiselect?: boolean; - multiboxonly?: boolean; + + /** + * An array in which we place the names of the columns. + * This is the text that appears in the head of the grid (header layer). The names are separated with commas. + * Note that the number of elements in this array should be equal of the number elements in the colModel array. + */ + colNames?: string[]; + + /** + * An array that stores the local data passed to the grid. You can directly point to this variable in case you want to load an array data. + * It can replace the addRowData method which is slow on relative big data + */ + data?: any[]; + + /** + * Defines in what format to expect the data that fills the grid. + * Valid options are xml (we expect data in xml format), xmlstring (we expect xml data as string), json (we expect data in JSON format), + * jsonstring (we expect JSON data as a string), local (we expect data defined at client side (array data)), + * javascript (we expect javascript as data), function (custom defined function for retrieving data), + * or clientSide to manually load data via the data array + */ + datatype?: "xml" | "xmlstring" | "json" | "jsonstring" | "local" | "javascript" | Function | "clientSide"; + + /** + * If set to true, and a column's width is changed, the adjacent column (to the right) will resize so that the overall grid width is maintained + * (e.g., reducing the width of column 2 by 30px will increase the size of column 3 by 30px). In this case there is no horizontal scrollbar. + * Note: This option is not compatible with shrinkToFit option - i.e if shrinkToFit is set to false, forceFit is ignored. + */ forceFit?: boolean; - height?: number; - width?: number; - shrinkToFit?: boolean; - url?: string; + /** + * What will be the result if we insert all the data at once? + * Yes, this can be done with a help of gridview option (set it to true). + * The result is a grid that is 5 to 10 times faster. Of course, when this option is set to true we have some limitations. + * If set to true we can not use treeGrid, subGrid, or the afterInsertRow event. + * If you do not use these three options in the grid you can set this option to true and enjoy the speed. + */ + gridview?: boolean; + + /** + * The height of the grid. + * Can be set as number (in this case we mean pixels) or as percentage (only 100% is accepted) or value of auto is acceptable. + */ + height?: number | string | "auto"; + + /** + * If this flag is set to true, the grid loads the data from the server only once (using the appropriate datatype). + * After the first request, the datatype parameter is automatically changed to local and all further manipulations are done on the client side. + * The functions of the pager (if present) are disabled. + */ + loadonce?: boolean; + + /** + * An array which describes the structure of the expected json data. + */ jsonReader?: IJqGridJsonReader; - gridComplete?:()=>void; + + /** + * Defines the type of request to make ("POST" or "GET") + */ + mtype?: "GET" | "POST"; + + /** + * This option works only when the multiselect option is set to true. + * When multiselect is set to true, clicking anywhere on a row selects that row; + * when multiboxonly is also set to true, the multiselection is done only when the checkbox is clicked (Yahoo style). + * Clicking in any other row (suppose the checkbox is not clicked) deselects all rows and selects the current row. + */ + multiboxonly?: boolean; + + /** + * If this flag is set to true a multi selection of rows is enabled. A new column at left side containing checkboxes is added. + * Can be used with any datatype option + */ + multiselect?: boolean; + + /** + * Defines that we want to use a pager bar to navigate through the records. + * This must be a valid HTML element; in our example we gave the div the id of "pager", but any name is acceptable. + * Note that the navigation layer (the "pager" div) can be positioned anywhere you want, determined by your HTML; + * in our example we specified that the pager will appear after the body layer. + * The valid settings can be (in the context of our example) pager, #pager, jQuery('#pager'). + * I recommend to use the second one - #pager + */ + pager?: string; + + /** + * An array to construct a select box element in the pager in which we can change the number of the visible rows. + * When changed during the execution, this parameter replaces the rowNum parameter that is passed to the url. + * If the array is empty, this element does not appear in the pager. Typically you can set this like [10,20,30]. + * If the rowNum parameter is set to 30 then the selected value in the select box is 30 + */ + rowList?: number[]; + + /** + * Sets how many records we want to view in the grid. This parameter is passed to the url for use by the server routine retrieving the data. + * Note that if you set this parameter to 10 (i.e. retrieve 10 records) and your server return 15 then only 10 records will be loaded + */ + rowNum?: number; + + /** + * This option, if set, defines how the the width of the columns of the grid should be re-calculated, taking into consideration the width of the grid. + * If this value is true, and the width of the columns is also set, then every column is scaled in proportion to its width. + * For example, if we define two columns with widths 80 and 120 pixels, but want the grid to have a width of 300 pixels, + * then the columns will stretch to fit the entire grid, and the extra width assigned to them will depend on the width of the columns themselves and the extra width available. + * The re-calculation is done as follows: the first column gets the width (300(new width)/200(sum of all widths))*80(first column width) = 120 pixels, + * and the second column gets the width (300(new width)/200(sum of all widths))*120(second column width) = 180 pixels. + * Now the widths of the columns sum up to 300 pixels, which is the width of the grid. + * If the value is false and the value in width option is set, then no re-sizing happens whatsoever. + * So in this example, if shrinkToFit is set to false, column one will have a width of 80 pixels, + * column two will have a width of 120 pixels and the grid will retain the width of 300 pixels. + * If the value of shrinkToFit is an integer, the width is calculated according to it. + */ + shrinkToFit?: boolean | number; + + /** + * The column according to which the data is to be sorted when it is initially loaded from the server + * (note that you will have to use datatypes xml or json to load remote data). This parameter is appended to the url. + * If this value is set and the index (name) matches the name from colModel, + * then an icon indicating that the grid is sorted according to this column is added to the column header. + * This icon also indicates the sorting order - descending or ascending (see the parameter sortorder). Also see prmNames + */ + sortname?: string; + + /** + * The initial sorting order (ascending or descending) when we fetch data from the server using datatypes xml or json. + * This parameter is appended to the url - see prnNames. The two allowed values are - asc or desc. + */ + sortorder?: "asc" | "desc"; + + /** + * The url of the file that returns the data needed to populate the grid. May be set to clientArray to manualy post data to server + */ + url?: string | "clientArray"; + + /** + * If true, jqGrid displays the beginning and ending record number in the grid, out of the total number of records in the query. + * This information is shown in the pager bar (bottom right by default)in this format: "View X to Y out of Z". + * If this value is true, there are other parameters that can be adjusted, including emptyrecords and recordtext. + */ + viewrecords?: boolean; + + /** + * If this option is not set, the width of the grid is the sum of the widths of the columns defined in the colModel (in pixels). + * If this option is set, the initial width of each column is set according to the value of the shrinkToFit option. + */ + width?: number; + + // events + + /** + * This fires after all the data is loaded into the grid and all other processes are complete. + * Also the event fires independent from the datatype parameter and after sorting paging and etc. + * @returns {} + */ + gridComplete?: () => void; + + /** + * Raised immediately after row was right clicked + * @param rowid is the id of the row + * @param iRow is the index of the row (do not mix this with the rowid) + * @param iCol is the index of the cell + * @param e is the event object + * @returns {} + */ + onRightClickRow?: (rowid: any, iRow: number, iCol: number, e: Event) => void; + + /** + * Raised immediately after row was clicked. + * @param id is the id of the row + * @param status is the status of the selection + * @param e is the event object. Can be used when multiselect is set to true. true if the row is selected, false if the row is deselected. + * @returns {} + */ + onSelectRow?: (id: string, status: any, e: Event) => void; } interface JQueryJqGridStatic { @@ -60,5 +353,64 @@ interface JQueryStatic { interface JQuery { jqGrid?: JQueryJqGridStatic; + /** + * Populates a grid with the passed data (an array) + * @param data + * @returns {} + */ + addJSONData(data: any[]): void; + + /** + * Edits the row specified by rowid. + * keys is a boolean value, indicating if to use the Enter key to accept the value ane Esc to cancel the edit, or not. + * @param rowid the id of the row to edit + * @param keys when set to true we can use [Enter] key to save the row and [Esc] to cancel editing + * @returns {} + */ + editRow(rowid: any, keys?: boolean): void; + + /** + * Returns the value of the requested parameter. name is the name from the options array. If the name is not set, the entry options are returned. + * @param name + * @returns {} + */ + getGridParam(name: string): any; + + /** + * This method restores the data to original values before the editing of the row + * @param rowId the row to restore + * @param afterRestoreFunc if defined this function is called in after the row is restored. + * @returns {} + */ + restoreRow(rowId: any, afterRestoreFunc?: (response: any) => void): void; + + /** + * Saves the edited row. + * @param rowid the id of the row to save + * @param successfunc + * @param url if defined, this parameter replaces the editurl parameter from the options array. If set to 'clientArray', the data is not posted to the server but rather is saved only to the grid (presumably for later manual saving). + * @param extraparam an array of type name: value. When set these values are posted along with the other values to the server. + * @returns {} + */ + saveRow(rowid: string, successfunc?: (response: any) => boolean, url?: string, extraparam?: any): void; + + /** + * Saves the edited row. + * @param rowid the id of the row to save + * @param successfunc + * @param url + * @param extraparam + * @returns {} + */ + saveRow(rowid: string, successfunc?: boolean, url?: string, extraparam?: any): void; + + /** + * Sets a particular parameter. + * Note - for some parameters to take effect a trigger("reloadGrid") should be executed. + * Note that with this method we can override events. + * The name (in the name:value pair) is the name from options array + * @param obj + * @returns {} + */ setGridParam(obj: any): void; } \ No newline at end of file diff --git a/jquery-mousewheel/jquery-mousewheel-tests.ts b/jquery-mousewheel/jquery-mousewheel-tests.ts new file mode 100644 index 0000000000..7f8807d7bb --- /dev/null +++ b/jquery-mousewheel/jquery-mousewheel-tests.ts @@ -0,0 +1,11 @@ +/// + +$('#my_elem').on('mousewheel', (event: JQueryMousewheel.JQueryMousewheelEventObject) => { + console.log(event.deltaX, event.deltaY, event.deltaFactor, event.deltaMode, event.absDelta); +}); + +$('#my_elem').mousewheel(event => { + console.log(event.deltaX, event.deltaY, event.deltaFactor, event.deltaMode, event.absDelta); +}); + +$('#my_elem').unmousewheel(); diff --git a/jquery-mousewheel/jquery-mousewheel.d.ts b/jquery-mousewheel/jquery-mousewheel.d.ts new file mode 100644 index 0000000000..1061e49f28 --- /dev/null +++ b/jquery-mousewheel/jquery-mousewheel.d.ts @@ -0,0 +1,21 @@ +// Type definitions for jquery-mousewheel v3.1.13 +// Project: https://github.com/jquery/jquery-mousewheel +// Definitions by: Brian Surowiec +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare namespace JQueryMousewheel { + interface JQueryMousewheelEventObject extends JQueryEventObject { + deltaX: number; + deltaY: number; + deltaFactor: number; + deltaMode: number; + absDelta: number; + } +} + +interface JQuery { + mousewheel(handler: (eventObject: JQueryMousewheel.JQueryMousewheelEventObject, ...args: any[]) => any): JQuery + unmousewheel(): JQuery; +} diff --git a/jquery-steps/jquery-steps-tests.ts b/jquery-steps/jquery-steps-tests.ts new file mode 100644 index 0000000000..e0125a3c0f --- /dev/null +++ b/jquery-steps/jquery-steps-tests.ts @@ -0,0 +1,101 @@ +/// +/// + +var labels: JQuerySteps.LabelSettings = { + cancel: 'Cancel', + current: 'Current:', + pagination: 'Paging', + finish: 'Done', + next: 'Next >', + previous: '< Previous', + loading: 'Loading...' +} + +var onStepChangingFunc: JQuerySteps.FunctionOnStepChanging = (event, currentIndex, newIndex): boolean => true; + +var onStepChangedFunc: JQuerySteps.FunctionOnStepChanged = (event, currentIndex, priorIndex) => {}; + +var onCancelledFunc: JQuerySteps.FunctionOnCancelled = (event) => {}; + +var onFinishingFunc: JQuerySteps.FunctionOnFinishing= (event, currentIndex): boolean => true; + +var onFinishedFunc: JQuerySteps.FunctionOnFinished = (event, currentIndex) => {}; + +var onInitFunc: JQuerySteps.FunctionOnInit = (event, currentIndex) => {}; + +var onContentLoadedFunc: JQuerySteps.FunctionOnContentLoaded = (event, currentIndex) => {}; + +var settings: JQuerySteps.Settings = { + headerTag: 'h3', + bodyTag: 'section', + contentContainerTag: 'div', + actionContainerTag: 'div', + stepsContainerTag: 'div', + cssClass: 'wizard', + stepsOrientation: 'vertical', + titleTemplate: '#title#', + loadingTemplate: ' #text#', + autoFocus: true, + enableAllSteps: true, + enableKeyNavigation: false, + enablePagination: false, + suppressPaginationOnFocus: false, + enableContentCache: false, + enableCancelButton: true, + enableFinishButton: false, + showFinishButtonAlways: true, + forceMoveForward: true, + saveState: true, + startIndex: 1, + transitionEffect: 'slideLeft', + transitionEffectSpeed: 400, + labels: labels, + onCanceled: onCancelledFunc, + onContentLoaded: onContentLoadedFunc, + onFinished: onFinishedFunc, + onFinishing: onFinishingFunc, + onInit: onInitFunc, + onStepChanged: onStepChangedFunc, + onStepChanging: onStepChangingFunc +} + +var wizard = $('.wizard').JQuerySteps(settings); + +var newStep1: JQuerySteps.Step = { + content: '
      Content
      ', + title: 'Step 1' +} + +var test1 = wizard.add(newStep1); + +var newStep2: JQuerySteps.Step = { + content: '
      Content
      ', + title: 'Step 2', + contentMode: 'async', + contentUrl: 'data.xml' +} + +var test2 = wizard.insert(0, newStep2); + +var test3 = wizard.remove(1); + +var test4 = wizard.getCurrentStep(); + +var test5 = wizard.getCurrentIndex(); + +var test6 = wizard.getStep(0); + +var newStep3: JQuerySteps.Step = { + content: '
      Content
      ', + title: 'Step 1' +} + +var test7 = wizard.insert(0, newStep3); + +var test8 = wizard.next(); + +var test9 = wizard.previous(); + +wizard.finish(); + +wizard.destroy(); diff --git a/jquery-steps/jquery-steps.d.ts b/jquery-steps/jquery-steps.d.ts new file mode 100644 index 0000000000..4b250e6708 --- /dev/null +++ b/jquery-steps/jquery-steps.d.ts @@ -0,0 +1,357 @@ +// Type definitions for jQuery Steps v1.1.0 +// Project: http://www.jquery-steps.com/ +// Definitions by: Joseph Blank +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface JQuery { + JQuerySteps(param?: JQuerySteps.Settings): JQuerySteps.JQuerySteps; +} + +declare module JQuerySteps { + + //#region "JQuerySteps" + + export interface JQuerySteps { + /** + * Adds a new step. (chainable) + */ + add(step: Step): JQuerySteps; + + /** + * Inserts a new step to a specific position. (chainable) + */ + insert(index: number, step: Step): JQuerySteps; + + /** + * Removes a specific step by an given index. + */ + remove(index: number): boolean; + + /** + * Gets the current step object. + */ + getCurrentStep(): Step; + + /** + * Gets the current step index. + */ + getCurrentIndex(): number; + + /** + * Gets a specific step object by index. + */ + getStep(index: number): Step; + + /** + * Routes to the previous step. + */ + next(): boolean; + + /** + * Routes to the next step. + */ + previous(): boolean; + + /** + * Triggers the onFinishing and onFinished event. + */ + finish(): void; + + /** + * Removes the control functionality completely and transforms the current state to the initial HTML structure. + */ + destroy(): void; + + /** + * Skips a certain amount of steps. Not yet implemented! + */ + skip(count: number): boolean; + } + + //#endregion "JQuerySteps" + + //#region "Settings" + export interface Settings { + //#region "Appearance" + + /** + * The header tag is used to find the step button text within the declared wizard area. Default value is h1. + */ + headerTag?: string; + + /** + * The body tag is used to find the step content within the declared wizard area. Default value is div. + */ + bodyTag?: string; + + /** + * The content container tag which will be used to wrap all step contents. Default value is div. + */ + contentContainerTag?: string; + + /** + * The action container tag which will be used to wrap the pagination navigation. Default value is div. + */ + actionContainerTag?: string; + + /** + * The steps container tag which will be used to wrap the steps navigation. Default value is div. + */ + stepsContainerTag?: string; + + /** + * The css class which will be added to the outer component wrapper. Default value is wizard. + */ + cssClass?: string; + + /** + * Determines whether the steps are vertically or horizontally oriented. Default value is horizontal or 0. + * This can be horizontal (0) or vertical (1). + */ + stepsOrientation?: string|number; + + //#endregion "Appearance" + + //#region "Templates" + + /** + * The title template which will be used to create a step button. Default value is span class="number">#index#. #title#. + */ + titleTemplate?: string; + + /** + * The loading template which will be used to create the loading animation. Default value is #text#. + */ + loadingTemplate?: string; + + //#endregion "Templates" + + //#region "Behavior" + + /** + * Sets the focus to the first wizard instance in order to enable the key navigation from the begining if true. Default value is false. + */ + autoFocus?: boolean; + + /** + * Enables all steps from the begining if true (all steps are clickable). Default value is false. + */ + enableAllSteps?: boolean; + + /** + * Enables keyboard navigation if true (arrow left and arrow right). Default value is true. + */ + enableKeyNavigation?: boolean; + + /** + * Enables pagination (next, previous and finish button) if true. Default value is true. + */ + enablePagination?: boolean; + + /** + * Suppresses pagination if a form field is focused. Default value is true. + */ + suppressPaginationOnFocus?: boolean; + + /** + * Enables cache for async loaded or iframe embedded content. Default value is true. + */ + enableContentCache?: boolean; + + /** + * Shows the cancel button if enabled. Default value is false. + */ + enableCancelButton?: boolean; + + /** + * Shows the finish button if enabled. Default value is true. + */ + enableFinishButton?: boolean; + + /** + * Shows the finish button always (on each step; right beside the next button) if true. Otherwise the next button will be replaced by the finish button if the last step becomes active. Default value is false. + */ + showFinishButtonAlways?: boolean; + + /** + * Prevents jumping to a previous step. Default value is false. + */ + forceMoveForward?: boolean; + + /** + * Saves the current state (step position) to a cookie. By coming next time the last active step becomes activated. Default value is false. + */ + saveState?: boolean; + + /** + * The position to start on (zero-based). Default value is 0. + */ + startIndex?: number; + + //#endregion "Behavior" + + //#region "Transition Effects" + + /** + * The animation effect which will be used for step transitions. Default value is none or 0. + * This can be none (0), fade (1), slide (2) or slideLeft (3). + */ + transitionEffect?: string|number; + + /** + * Animation speed for step transitions (in milliseconds). Default value is 200. + */ + transitionEffectSpeed?: number; + + //#endregion "Transition Effects" + + //#region "Events" + + /** + * Fires before the step changes and can be used to prevent step changing by returning false. + */ + onStepChanging?: FunctionOnStepChanging; + + /** + * Fires after the step has changed. + */ + onStepChanged?: FunctionOnStepChanged; + + /** + * Fires after cancellation. + */ + onCanceled?: FunctionOnCancelled; + + /** + * Fires before finishing and can be used to prevent completion by returning false. Very useful for form validation. + */ + onFinishing?: FunctionOnFinishing; + + /** + * Fires after completion. + */ + onFinished?: FunctionOnFinished; + + /** + * Fires when the wizard is initialized. + */ + onInit?: FunctionOnInit; + + /** + * Fires after async content is loaded. + */ + onContentLoaded?: FunctionOnContentLoaded; + + //#endregion "Events" + + //#region "Labels" + + labels?: LabelSettings; + + //#endregion "Labels" + } + //#endregion "Settings" + + //#region "Label Settings" + + interface LabelSettings { + + /** + * Label for the cancel button. Default value is Cancel. + */ + cancel?: string; + + /** + * This label is important for accessability reasons. Indicates which step is activated. Default value is current step:. + */ + current?: string; + + /** + * This label is important for accessability reasons and describes the kind of navigation. Default value is Pagination. + */ + pagination?: string; + + /** + * Label for the finish button. Default value is Finish. + */ + finish?: string; + + /** + * Label for the next button. Default value is Next. + */ + next?: string; + + /** + * Label for the previous button. Default value is Previous. + */ + previous?: string; + + /** + * Label for the loading animation. Default value is Loading ... . + */ + loading?: string; + + } + + //#endregion "Label Settings" + + //#region "Callback Functions" + + interface FunctionOnStepChanging { + (event: string, currentIndex: number, newIndex: number): boolean; + } + + interface FunctionOnStepChanged { + (event: string, currentIndex: number, priorIndex: number): void; + } + + interface FunctionOnCancelled { + (event: string): void; + } + + interface FunctionOnFinishing { + (event: string, currentIndex: number): boolean; + } + + interface FunctionOnFinished { + (event: string, currentIndex: number): void; + } + + interface FunctionOnInit { + (event: string, currentIndex: number): void; + } + + interface FunctionOnContentLoaded { + (event: string, currentIndex: number): void; + } + + //#endregion "Callback Functions" + + //#region "Step Object" + + interface Step { + + /** + * The step title (HTML). + */ + title?: string; + + /** + * The step content (HTML). + */ + content?: string; + + /** + * Indicates how the content will be loaded. + * This can be html (0), iframe (1), or async (2). + */ + contentMode?: string|number; + + /** + * The URI that refers to the content. + */ + contentUrl?: string; + } + + //#endregion "Step Object" +} diff --git a/jquery-truncate-html/jquery-truncate-html-tests.ts b/jquery-truncate-html/jquery-truncate-html-tests.ts new file mode 100644 index 0000000000..e20f9c22ee --- /dev/null +++ b/jquery-truncate-html/jquery-truncate-html-tests.ts @@ -0,0 +1,14 @@ +/// + + +function truncateHtmlString(): string { + return $.truncate('

      Stuff and Nonsense

      ', { + length: 13 + }); +} + +function truncateVirtualElement (): JQuery { + return $('

      Stuff and Nonsense

      ').truncate({ + length: 13 + }); +} diff --git a/jquery-truncate-html/jquery-truncate-html.d.ts b/jquery-truncate-html/jquery-truncate-html.d.ts new file mode 100644 index 0000000000..e410716b0a --- /dev/null +++ b/jquery-truncate-html/jquery-truncate-html.d.ts @@ -0,0 +1,22 @@ +// Type definitions for jQuery-truncate-html.js +// Project: https://github.com/kbwood/timeentry +// Definitions by: Abraão Alves +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +interface TruncateOptions{ + length?: number; + stripTags?: boolean; + words?: boolean; + noBreaks?: boolean; + ellipsis?: string; +} + +interface JQuery{ + truncate(options: TruncateOptions) : JQuery; +} + +interface JQueryStatic { + truncate(html: string, options: TruncateOptions) : string; +} diff --git a/jquery-validation-unobtrusive/jquery-validation-unobtrusive.d.ts b/jquery-validation-unobtrusive/jquery-validation-unobtrusive.d.ts index fcc3bac9da..9c13b5a28f 100644 --- a/jquery-validation-unobtrusive/jquery-validation-unobtrusive.d.ts +++ b/jquery-validation-unobtrusive/jquery-validation-unobtrusive.d.ts @@ -1,5 +1,5 @@ // Type definitions for Microsoft jQuery Unobtrusive Validation v3.2.3 -// Project: http://aspnetwebstack.codeplex.com/ +// Project: https://github.com/aspnet/jquery-validation-unobtrusive // Definitions by: Matt Brooks // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/jquery.colorbox/jquery.colorbox.d.ts b/jquery.colorbox/jquery.colorbox.d.ts index 4af0e7e87f..5437c0bf18 100644 --- a/jquery.colorbox/jquery.colorbox.d.ts +++ b/jquery.colorbox/jquery.colorbox.d.ts @@ -252,7 +252,7 @@ interface ColorboxStatic { /** * This method allows you to call Colorbox without having to assign it to an element. */ - (settings: ColorboxSettings); + (settings: ColorboxSettings): any; /** * This method moves to the next item in a group and are the same as pressing the 'next' or 'previous' buttons. */ diff --git a/jquery.contextMenu/jquery.contextMenu.d.ts b/jquery.contextMenu/jquery.contextMenu.d.ts index 030a83f9f6..4b52a0ed84 100644 --- a/jquery.contextMenu/jquery.contextMenu.d.ts +++ b/jquery.contextMenu/jquery.contextMenu.d.ts @@ -28,6 +28,7 @@ interface JQueryContextMenuOptions { items: any; reposition?: boolean; className?: string; + itemClickEvent?: string; } interface JQueryStatic { diff --git a/jquery.fileupload/jquery.fileupload-tests.ts b/jquery.fileupload/jquery.fileupload-tests.ts index 87149e0151..f07c60b87d 100644 --- a/jquery.fileupload/jquery.fileupload-tests.ts +++ b/jquery.fileupload/jquery.fileupload-tests.ts @@ -13,6 +13,18 @@ var __handleAddingFile = function (event:any, data:any) data.submit(); }; +var options: JQueryFileInputOptions = { + dataType: 'json', + singleFileUploads: true, + limitMultiFileUploads: 1, + add: __handleAddingFile, + done: (e, data) => { + data.result; + data.jqXHR; + data.textStatus; + } +} + class TestFileInput { // The whole body will be the container for this test @@ -24,20 +36,6 @@ class TestFileInput { constructor() { // The file upload object receives a fileInputOptions configuration object - this.fileInput = this.$el.fileupload({ - - dataType: 'json', - - // By default, each file of a selection is uploaded using an individual - // request for XHR type uploads. Set to false to upload file - // selections in one request each: - singleFileUploads: true, - // To limit the number of files uploaded with one XHR request, - // set the following option to an integer greater than 0: - limitMultiFileUploads: 1, - - add: __handleAddingFile - - }); + this.fileInput = this.$el.fileupload(options); } } diff --git a/jquery.fileupload/jquery.fileupload.d.ts b/jquery.fileupload/jquery.fileupload.d.ts index 3575ab2738..7e46241999 100644 --- a/jquery.fileupload/jquery.fileupload.d.ts +++ b/jquery.fileupload/jquery.fileupload.d.ts @@ -17,13 +17,13 @@ interface JQueryFileInputOptions { * The drop target element(s), by the default the complete document. * Set to null to disable drag & drop support: */ - dropZone?: HTMLElement; + dropZone?: Element | Element[] | JQuery | string; /** * The paste target element(s), by the default the complete document. * Set to null to disable paste support: */ - pasteZone?: HTMLElement; + pasteZone?: Element | Element[] | JQuery | string; /** * The file input field(s), that are listened to for change events. @@ -31,7 +31,7 @@ interface JQueryFileInputOptions { * of the widget element on plugin initialization. * Set to null to disable the change listener. */ - fileInput?: HTMLElement; + fileInput?: Element | Element[] | JQuery | string; /** * By default, the file input field is replaced with a clone after @@ -207,25 +207,25 @@ interface JQueryFileInputOptions { timeout?: number; active?: Function; - progress?: Function; - send?: Function; + progress?: (e: JQueryEventObject, data: JQueryFileUploadProgressObject) => void; + send?: (e: JQueryEventObject, data: JQueryFileUploadProgressObject) => void; // Other callbacks: submit?: Function; - done?: Function; - fail?: Function; - always?: Function; - progressall?: Function; - start?: Function; - stop?: Function; - change?: Function; - paste?: Function; - drop?: Function; - dragover?: Function; - chunksend?: Function; - chunkdone?: Function; - chunkfail?: Function; - chunkalways?: Function; + done?: (e: JQueryEventObject, data: JQueryFileUploadDone) => void; + fail?: (e: JQueryEventObject, data: JQueryFileInputOptions) => void; + always?: (e: JQueryEventObject, data: JQueryFileInputOptions) => void; + progressall?: (e: JQueryEventObject, data: JQueryFileUploadProgressAllObject) => void; + start?: (e: JQueryEventObject) => void; + stop?: (e: JQueryEventObject) => void; + change?: (e: JQueryEventObject, data: JQueryFileUploadChangeObject) => void; + paste?: (e: JQueryEventObject, data: JQueryFileUploadFilesObject) => void; + drop?: (e: JQueryEventObject, data: JQueryFileUploadFilesObject) => void; + dragover?: (e: JQueryEventObject) => void; + chunksend?: (e: JQueryEventObject, data: JQueryFileUploadChunkObject) => void; + chunkdone?: (e: JQueryEventObject, data: JQueryFileUploadChunkObject) => void; + chunkfail?: (e: JQueryEventObject, data: JQueryFileUploadChunkObject) => void; + chunkalways?: (e: JQueryEventObject, data: JQueryFileUploadChunkObject) => void; // Others url?: string; @@ -250,3 +250,40 @@ interface JQuery { interface JQuerySupport { fileInput?: boolean; } + +interface JQueryFileUploadChangeObject { + fileInput?: JQuery; + fileInputClone?: JQuery; + files: File[]; + form?: JQuery; + originalFiles: File[]; +} + +interface JQueryFileUploadProgressAllObject { + loaded?: number; + total?: number; + bitrate?: number; +} + +interface JQueryFileUploadXhr { + jqXHR: JQueryXHR; + result: any; + textStatus: string; +} + +interface JQueryFileUploadFilesObject { + files: File[]; +} + +interface JQueryFileUploadChunkObject extends JQueryFileInputOptions, JQueryFileUploadXhr { + blob: any; + chunkSize: number; + contentRange: string; + errorThrown: any; +} + +interface JQueryFileUploadProgressObject extends JQueryFileInputOptions, JQueryFileUploadProgressAllObject { +} + +interface JQueryFileUploadDone extends JQueryFileInputOptions, JQueryFileUploadXhr { +} diff --git a/jquery.payment/jquery.payment-tests.ts b/jquery.payment/jquery.payment-tests.ts new file mode 100644 index 0000000000..6ef1c2154d --- /dev/null +++ b/jquery.payment/jquery.payment-tests.ts @@ -0,0 +1,45 @@ +/// +/// + +$.payment.cards.push({ + // Card type, as returned by $.payment.cardType. + type: 'mastercard', + // Array of prefixes used to identify the card type. + patterns: [ + 51, 52, 53, 54, 55, + 22, 23, 24, 25, 26, 27 + ], + // Array of valid card number lengths. + length: [16], + // Array of valid card CVC lengths. + cvcLength: [3], + // Boolean indicating whether a valid card number should satisfy the Luhn check. + luhn: true, + // Regex used to format the card number. Each match is joined with a space. + format: /(\d{1,4})/g +}) + +$('[data-numeric]').payment('restrictNumeric'); + +$.payment.validateCardNumber('4242 4242 4242 4242') === true; //=> true + +$.payment.validateCardExpiry('05', '20') === true; //=> true +$.payment.validateCardExpiry('05', '2015') === true; //=> true +$.payment.validateCardExpiry('05', '05') === true; //=> false + +$.payment.validateCardCVC('123') === true; //=> true +$.payment.validateCardCVC('123', 'amex') === true; //=> true +$.payment.validateCardCVC('1234', 'amex') === true; //=> true +$.payment.validateCardCVC('12344') === false; //=> false + +$.payment.cardType('4242 4242 4242 4242') === 'visa'; //=> 'visa' + +$.payment.cardExpiryVal('03 / 2025') === {month: 3, year: 2025}; //=> {month: 3, year: 2025} +$.payment.cardExpiryVal('05 / 04') === {month: 3, year: 2025}; //=> {month: 5, year: 2004} +$('input.cc-exp').payment('cardExpiryVal') //=> {month: 4, year: 2020} + +var valid = $.payment.validateCardNumber($('input.cc-num').val()); + +if (!valid) { + alert('Your card is not valid!'); +} \ No newline at end of file diff --git a/jquery.payment/jquery.payment.d.ts b/jquery.payment/jquery.payment.d.ts index 61408d6ca9..1899eceaf4 100644 --- a/jquery.payment/jquery.payment.d.ts +++ b/jquery.payment/jquery.payment.d.ts @@ -77,33 +77,38 @@ declare namespace JQueryPayment { /** * Card type */ - type: string; + type?: string; - /* + /** * Regex used to identify the card type. For the best experience, this should be * the shortest pattern that can guarantee the card is of a particular type. */ - pattern: RegExp; + pattern?: RegExp; + + /** + * Array of prefixes used to identify the card type. + */ + patterns?: number[]; /** * Array of valid card number lengths. */ - length: number[]; + length?: number[]; /** * Array of valid card CVC lengths. */ - cvcLength: number[]; + cvcLength?: number[]; /** * Boolean indicating whether a valid card number should satisfy the Luhn check. */ - luhn: boolean; + luhn?: boolean; /** * Regex used to format the card number. Each match is joined with a space. */ - format: RegExp; + format?: RegExp; } } diff --git a/jquery.pnotify/jquery.pnotify.d.ts b/jquery.pnotify/jquery.pnotify.d.ts index edb7e2468c..8daee5da1e 100644 --- a/jquery.pnotify/jquery.pnotify.d.ts +++ b/jquery.pnotify/jquery.pnotify.d.ts @@ -1,10 +1,15 @@ -// Type definitions for jquery.pnotify 2.x +// Type definitions for jquery.pnotify 3.x // Project: https://github.com/sciactive/pnotify // Definitions by: David Sichau // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// +// could not pass the Travis Test if enabled +//type NoticeTypeOptions = "notice" | "info" | "success" | "error"; +//type StylingOptions = "brighttheme" | "jqueryui" | "bootstrap2" | "bootstrap3" | "fontawesome"; +//type StateOptions = "initializing" | "opening" | "open" | "closing" | "closed"; + interface PNotifyStack { dir1?: string; dir2?: string; @@ -13,7 +18,8 @@ interface PNotifyStack { spacing2?: number; firstpos1?: number; firstpos2?: number; - context?: JQuery + context?: JQuery; + modal?: boolean; } interface PNotifyLabel { @@ -24,11 +30,98 @@ interface PNotifyLabel { stick?: string; } + +interface PNotifyconfirmButton { + text?: string; + addClass?: string; + /** + * Whether to trigger this button when the user hits enter in a single line prompt. + */ + promptTrigger?: boolean; + click: (notice: PNotify, value: any) => void +} + +interface PNotifyconfirm { + /** + * Make a confirmation box. + */ + confirm?: boolean; + + /** + * Make a prompt. + */ + prompt?: boolean; + /** + * Classes to add to the input element of the prompt. + */ + prompt_class?: string + + /** + * The default value of the prompt. + */ + prompt_default?: string + + /** + * Whether the prompt should accept multiple lines of text. + */ + prompt_multi_line?: boolean; + + /** + * Where to align the buttons. (right, center, left, justify) + */ + align?: string; + + /** + * The buttons to display, and their callbacks. + */ + buttons?: PNotifyconfirmButton[]; + +} + +interface PNotifyButtons { + /** + * Provide a button for the user to manually close the notice. + */ + closer?: boolean; + /** + * Only show the closer button on hover. + */ + closer_hover?: boolean; + /** + * Provide a button for the user to manually stick the notice. + */ + sticker?: boolean; + /** + * Only show the sticker button on hover. + */ + sticker_hover?: boolean; + /** + * Show the buttons even when the nonblock module is in use. + */ + show_on_nonblock?: boolean; + /** + * The various displayed text, helps facilitating internationalization. + */ + labels?: { + close?: string; + stick?: string; + unstick?: string; + }; + /** + * The classes to use for button icons. Leave them null to use the classes from the styling you're using. + */ + classes?: { + closer?: string; + pin_up?: string; + pin_down?: string; + }; +} + interface PNotifyOptions { /** * The notice's title. Either boolean false or string */ - title?: any; + title?: string | boolean; /** * Whether to escape the content of the title. (Not allow HTML.) */ @@ -36,13 +129,13 @@ interface PNotifyOptions { /** * The notice's text. Either boolean false or string */ - text?: any; + text?: string | boolean; /** * Whether to escape the content of the text. (Not allow HTML.) */ text_escape?: boolean; /** - * What styling classes to use. (Can be either jqueryui or bootstrap.) + * What styling classes to use. (Can be either "brighttheme", "jqueryui", "bootstrap2", "bootstrap3", or "fontawesome".) */ styling?: string; /** @@ -58,7 +151,7 @@ interface PNotifyOptions { /** * Create a non-blocking notice. It lets the user click elements underneath it. */ - nonblock: boolean; + nonblock?: boolean; /** * The opacity of the notice (if it's non-blocking) when the mouse is over it. @@ -136,7 +229,7 @@ interface PNotifyOptions { } /** - * After a delay, remove the notice. + * After a delay, remove the notice, set to false for sticky note. */ hide?: boolean; /** @@ -166,17 +259,38 @@ interface PNotifyOptions { } interface PNotify { - elem: JQuery; - - update(options?: PNotifyOptions): void; + + /** + * The state can be "initializing", "opening", "open", "closing", and "closed" + */ + state?: string; + + /** + * This function is for updating the notice. + */ + update(options?: PNotifyOptions): PNotify; + + /** + * Remove the notice. + */ remove(): void; + + /** + * Display the notice. + */ + open(): void; + + /** + * Get the DOM element. + */ + get(): JQuery; + } interface PNotifyConstructor { new (options?: PNotifyOptions): PNotify; - + removeAll(): void; } declare var PNotify: PNotifyConstructor; - diff --git a/jquery.slimScroll/jquery.SlimScroll-tests.ts b/jquery.slimScroll/jquery.SlimScroll-tests.ts index deb4f2406d..046eda840f 100644 --- a/jquery.slimScroll/jquery.SlimScroll-tests.ts +++ b/jquery.slimScroll/jquery.SlimScroll-tests.ts @@ -41,6 +41,21 @@ $('#slimtest3').slimScroll({ alwaysVisible: true }); +$('#slimtest3').slimScroll({ + color: '#00f', + size: '10px', + height: '180px', + alwaysVisible: true, + destroy: true +}); + $("div").slimScroll().bind('slimscroll', function(e){ console.log("Reached " + e); -}); \ No newline at end of file +}); + +var options : IJQuerySlimScrollOptions = { + destroy: true, + position: 'left' +}; + +$('#slimtest3').slimScroll(options); diff --git a/jquery.slimScroll/jquery.slimScroll.d.ts b/jquery.slimScroll/jquery.slimScroll.d.ts index 4d77d28817..b5d3dab17f 100644 --- a/jquery.slimScroll/jquery.slimScroll.d.ts +++ b/jquery.slimScroll/jquery.slimScroll.d.ts @@ -1,58 +1,110 @@ -// Type definitions for jQuery.slimScroll v1.3.3 +// Type definitions for jQuery.slimScroll v1.3.8 // Project: https://github.com/rochal/jQuery-slimScroll // Definitions by: Chintan Shah // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// interface IJQuerySlimScrollOptions { - // width in pixels of the visible scroll area + /** + * width in pixels of the visible scroll area + */ width? :string; - // height in pixels of the visible scroll area + /** + * height in pixels of the visible scroll area + */ height? :string; - // width in pixels of the scrollbar and rail + /** + * width in pixels of the scrollbar and rail + */ size? :string; - // scrollbar color, accepts any hex/color value + /** + * scrollbar color, accepts any hex/color value + */ color?:string; - // scrollbar position - left/right + /** + * scrollbar position - left/right + */ position?:string; - // distance in pixels between the side edge and the scrollbar + /** + * distance in pixels between the side edge and the scrollbar + */ distance?:string; - // default scroll position on load - top / bottom / $('selector') + /** + * default scroll position on load - top / bottom / $('selector') + */ start?:any; - // sets scrollbar opacity + /** + * sets scrollbar opacity + */ opacity? :number; - // enables always-on mode for the scrollbar + /** + * enables always-on mode for the scrollbar + */ alwaysVisible?: boolean; - // check if we should hide the scrollbar when user is hovering over + /** + * check if we should hide the scrollbar when user is hovering over + */ disableFadeOut?: boolean; - // sets visibility of the rail + /** + * sets visibility of the rail + */ railVisible?: boolean; - // sets rail color + /** + * sets rail color + */ railColor?: string; - // sets rail opacity + /** + * sets rail opacity + */ railOpacity?:number; - // whether we should use jQuery UI Draggable to enable bar dragging + /** + * whether we should use jQuery UI Draggable to enable bar dragging + */ railDraggable?: boolean; - // defautlt CSS class of the slimscroll rail + /** + * default CSS class of the slimscroll rail + */ railClass?: string; - // defautlt CSS class of the slimscroll bar + /** + * default CSS class of the slimscroll bar + */ barClass?: string; - // defautlt CSS class of the slimscroll wrapper + /** + * default CSS class of the slimscroll wrapper + */ wrapperClass?: string; - // check if mousewheel should scroll the window if we reach top/bottom + /** + * check if mousewheel should scroll the window if we reach top/bottom + */ allowPageScroll?: boolean; - // scroll amount applied to each mouse wheel step + /** + * scroll amount applied to each mouse wheel step + */ wheelStep?: number; - // scroll amount applied when user is using gestures + /** + * scroll amount applied when user is using gestures + */ touchScrollStep?: number; - // sets border radius + /** + * sets border radius + */ borderRadius?: string; - // sets border radius of the rail + /** + * sets border radius of the rail + */ railBorderRadius?: string; - // jumps to the specified scroll value + /** + * jumps to the specified scroll value + */ scrollTo?: string; - // increases/decreases current scroll value by specified amount + /** + * increases/decreases current scroll value by specified amount + */ scrollBy?: string; + /** + * release resources held by the plugin + */ + destroy?:boolean; } interface JQuery { diff --git a/jquery.timer/jquery.timer.d.ts b/jquery.timer/jquery.timer.d.ts index 6b8c5d6358..86cb3d4ec6 100644 --- a/jquery.timer/jquery.timer.d.ts +++ b/jquery.timer/jquery.timer.d.ts @@ -28,4 +28,9 @@ interface JQueryTimer { interface JQuery { timer: JQueryTimer; -} \ No newline at end of file +} + + +interface JQueryStatic { + timer: JQueryTimer; +} diff --git a/jquery.tooltipster/jquery.tooltipster-tests.ts b/jquery.tooltipster/jquery.tooltipster-tests.ts index 8a8f29acae..2542f4c0a8 100644 --- a/jquery.tooltipster/jquery.tooltipster-tests.ts +++ b/jquery.tooltipster/jquery.tooltipster-tests.ts @@ -1,8 +1,8 @@ /// -// Type definition tests for jQuery Tooltipster 3.0.5 +// Type definition tests for jQuery Tooltipster 3.3.0 // Project: https://github.com/iamceege/tooltipster -// Definitions by: Patrick Magee +// Definitions by: Patrick Magee , Dmitry Pesterev // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // Tests taken from the getting started section of the Tooltipster website @@ -13,6 +13,10 @@ $(document).ready(function () { $('#my-tooltip').tooltipster({ content: $(' This text is in bold case !') }); + + $('#my-tooltip').tooltipster({ + content: 'string test' + }); }); @@ -59,6 +63,9 @@ $('.tooltip').tooltipster('content'); // update tooltip content $('.tooltip').tooltipster('content', myNewContent); +//update option +$('.tooltip').tooltipster('option', 'delay', '200'); + // reposition and resize the tooltip $('.tooltip').tooltipster('reposition'); @@ -163,6 +170,14 @@ $(document).ready(function () { // first on page load, initiate the Tooltipster plugin $('.tooltip').tooltipster(); + $('.tooltip').tooltipster({ + contentAsHTML: true + }); + + $('.tooltip').tooltipster({ + content: $(' This text is in bold case !') + }); + // then immediately show the tooltip $('#example').tooltipster('show'); @@ -170,11 +185,6 @@ $(document).ready(function () { $(window).keypress(function () { $('#example').tooltipster('hide'); }); -}); - -$(document).ready(function () { - - $('.tooltip').tooltipster(); $('#example').tooltipster('show', function () { alert('The tooltip is now fully open. The content is: ' + this.tooltipster('content')); @@ -190,5 +200,3 @@ $(document).ready(function () { }); }); }); - -$('#my-special-tooltip').tooltipster('content', 'My new content'); \ No newline at end of file diff --git a/jquery.tooltipster/jquery.tooltipster.d.ts b/jquery.tooltipster/jquery.tooltipster.d.ts index a4df0a36e3..7197c6583e 100644 --- a/jquery.tooltipster/jquery.tooltipster.d.ts +++ b/jquery.tooltipster/jquery.tooltipster.d.ts @@ -1,6 +1,6 @@ -// Type definitions for jQuery Tooltipster 3.0.5 +// Type definitions for jQuery Tooltipster 3.3.0 // Project: https://github.com/iamceege/tooltipster -// Definitions by: Patrick Magee +// Definitions by: Patrick Magee , Dmitry Pesterev // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -19,7 +19,7 @@ interface JQueryTooltipsterOptions { * Select a specific color for the "speech bubble arrow". Default: will inherit the tooltip's background color * hex code / rgb */ - arrowColor?: any; + arrowColor?: string; /** * If autoClose is set to false, the tooltip will never close unless you call the 'close' method yourself. Default: true */ @@ -28,7 +28,7 @@ interface JQueryTooltipsterOptions { * If set, this will override the content of the tooltip. Default: null * @type string, jQuery object */ - content?: any; + content?: string | JQuery; /** * If the content of the tooltip is provided as a string, it is displayed as plain text by default. If this content should actually be interpreted as HTML, set this option to true. Default: false */ @@ -37,14 +37,18 @@ interface JQueryTooltipsterOptions { * If you provide a jQuery object to the 'content' option, this sets if it is a clone of this object that should actually be used. Default: true */ contentCloning?: boolean; + /** + * Tooltipster logs notices into the console when you're doing something you ideally shouldn't be doing. Set to false to disable logging. Default: true + */ + debug?: boolean; /** * Delay how long it takes (in milliseconds) for the tooltip to start animating in. Default: 200 */ delay?: number; /** - * Set a fixed width for the tooltip. The tooltip will always be a consistent width - no matter your content size. Default: 0 (auto width) - */ - fixedWidth?: number; + * Set a minimum width for the tooltip. Default: 0 (auto width) + */ + minWidth?: number; /** * Set a max width for the tooltip. If the tooltip ends up being smaller than the set max width, the tooltip's width will be set automatically. Default: 0 (no max width) */ @@ -52,24 +56,28 @@ interface JQueryTooltipsterOptions { /** * Create a custom function to be fired only once at instantiation. If the function returns a value, this value will become the content of the tooltip. See the advanced section to learn more. Default: function(origin, content) {} */ - functionInit?: (origin, content) => any; + functionInit?: (origin: JQuery, content: string) => void | string; /** * Create a custom function to be fired before the tooltip opens. This function may prevent or hold off the opening. See the advanced section to learn more. Default: function(origin, continueTooltip) { continueTooltip(); } */ - functionBefore?: (origin, continueTooltip) => void; + functionBefore?: (origin: JQuery, continueTooltip: Function) => void; /** * Create a custom function to be fired when the tooltip and its contents have been added to the DOM. Default: function(origin, tooltip) {} */ - functionReady?: (origin, tooltip) => void; + functionReady?: (origin: JQuery, tooltip: JQuery) => void; /** * Create a custom function to be fired once the tooltip has been closed and removed from the DOM. Default: function(origin) {} */ - functionAfter?: (origin) => void; + functionAfter?: (origin: JQuery) => void; + /** + * If true, the tooltip will close if its origin is clicked. This option only applies when 'trigger' is 'hover' and 'autoClose' is false. Default: false + */ + hideOnClick?: boolean; /** * If using the iconDesktop or iconTouch options, this sets the content for your icon. Default: '(?)' * @type string, jQuery object */ - icon?: any; + icon?: string | JQuery; /** * If you provide a jQuery object to the 'icon' option, this sets if it is a clone of this object that should actually be used. Default: true */ @@ -94,6 +102,10 @@ interface JQueryTooltipsterOptions { * If the tooltip is interactive and activated by a hover event, set the amount of time (milliseconds) allowed for a user to hover off of the tooltip activator (origin) on to the tooltip itself - keeping the tooltip from closing. Default: 350 */ interactiveTolerance?: number; + /** + * Allows you to put multiple tooltips on a single element. Read further instructions down this page. Default: false + */ + multiple?: boolean; /** * Offsets the tooltip (in pixels) farther left/right from the origin. Default: 0 */ @@ -115,6 +127,14 @@ interface JQueryTooltipsterOptions { * Will reposition the tooltip if the origin moves. As this option may have an impact on performance, we suggest you enable it only if you need to. Default: false */ positionTracker?: boolean; + /** + * Called after the tooltip has been repositioned by the position tracker (if enabled). Default: A function that will close the tooltip if the trigger is 'hover' and autoClose is false. + */ + positionTrackerCallback?: (origin: JQuery) => void; + /** + * Specify if a TITLE attribute should be restored on the HTML element after a call to the 'destroy' method. This attribute may be omitted, or be restored with the value that existed before Tooltipster was initialized, or be restored with the stringified value of the current content. Note: in case of multiple tooltips on a single element, only the last destroyed tooltip may trigger a restoration. Default: 'current' + */ + restoration?: string; /** * Set the speed of the animation. Default: 350 */ @@ -143,10 +163,12 @@ interface JQueryTooltipsterOptions { } interface JQuery { + /** * Initiate the Tooltipster plugin */ - tooltipster(): void; + tooltipster(): JQuery; + /** * Creates a new tooltip with the specified, or default, options. * @param options The options @@ -160,27 +182,91 @@ interface JQuery { * }); */ tooltipster(options?: JQueryTooltipsterOptions): JQuery; - /** - * Updates an existing tinyscrollbar with the specified, or default, options. - * @param options The options - * @param callback optional argument callback - * @example - * $(window).keypress(function() { - * $('#example').tooltipster('hide', function() { - * alert('The tooltip is now fully closed'); - * }); - * }); - */ - tooltipster(method: string, callback?: Function): JQuery; - /** - * Call a method trigger with optional paramter - * @example $('#my-special-tooltip').tooltipster('content', 'My new content'); - * @example - * $('#example').tooltipster('show', function() { - * alert('The tooltip is now fully open. The content is: ' + this.tooltipster('content')); - * }); - */ - tooltipster(method: string, param?: string): any; + /** + * Show a tooltip (the 'callback' argument is optional) + * @param methodName show + * @param callback Function for call back + */ + tooltipster(methodName: "show", callback?: Function): JQuery; + + /** + * Hide a tooltip (the 'callback' argument is optional) + * @param methodName hide + * @param callback Function for call back + */ + tooltipster(methodName: "hide", callback?: Function): JQuery; + + /** + * Update tooltip content + * @param methodName content + * @param newContent New content + */ + tooltipster(methodName: "content", newContent: string): JQuery; + + /** + * Update tooltip content + * @param methodName option + * @param optionName Option name + */ + tooltipster(methodName: "option", optionName: string): JQuery; + + /** + * Set the value of an option (use at your own risk, we do not provide support for issues you may encounter when using this method) + * @param methodName option + * @param optionName Option name + * @param optionValue New vale for option + */ + tooltipster(methodName: "option", optionName: string, optionValue: string): JQuery; + + + /** + * Temporarily disable a tooltip from being able to open + * @param methodName disable + */ + tooltipster(methodName: "disable"): JQuery; + + /** + * Temporarily disable a tooltip from being able to open + * @param methodName enable + */ + tooltipster(methodName: "enable"): JQuery; + + /** + * Hide and destroy tooltip functionality + * @param methodName destroy + */ + tooltipster(methodName: "destroy"): JQuery; + + /** + * Return a tooltip's current content (if selector contains multiple origins, only the value of the first will be returned) + * @param methodName content + */ + tooltipster(methodName: "content"): string; + + /** + * Reposition and resize the tooltip + * @param methodName reposition + */ + tooltipster(methodName: "reposition"): JQuery; + + /** + * Return the HTML root element of the tooltip + * @param methodName elementTooltip + */ + tooltipster(methodName: "elementTooltip"): JQuery; + + /** + * Return the HTML root element of the icon if there is one, 'undefined' otherwise + * @param methodName elementIcon + */ + tooltipster(methodName: "elementIcon"): JQuery; + + /** + * Generics + */ + tooltipster(methodName: string, optionName: string, optionValue: string): JQuery; + tooltipster(methodName: string, param: string): JQuery; + tooltipster(methodName: string): JQuery; + tooltipster(methodName: string): string; } - diff --git a/jquery.validation/jquery.validation.d.ts b/jquery.validation/jquery.validation.d.ts index 7527652e80..78cf13a05e 100644 --- a/jquery.validation/jquery.validation.d.ts +++ b/jquery.validation/jquery.validation.d.ts @@ -188,6 +188,14 @@ declare namespace JQueryValidation * @param method The actual method implementation, returning true if an element is valid. First argument: Current value. Second argument: Validated element. Third argument: Parameters. */ addMethod(name: string, method: (value: any, element: HTMLElement, params: any) => boolean, message?: string): void; + /** + * Add a custom validation method. It must consist of a name (must be a legal javascript identifier), a predicate function and a message generating function. + * + * @param name The name of the method used to identify it and referencing it; this must be a valid JavaScript identifier + * @param method The actual method implementation, returning true if an element is valid. First argument: Current value. Second argument: Validated element. Third argument: Parameters. + * @param message Message generator. First argument: Parameters. Second argument: Validated element. + */ + addMethod(name: string, method: (value: any, element: HTMLElement, params: any) => boolean, message?: (params: any, element: HTMLElement) => string): void; /** * Replaces {n} placeholders with arguments. * @@ -213,6 +221,8 @@ declare namespace JQueryValidation * Validates the form, returns true if it is valid, false otherwise. */ form(): boolean; + + elementValue(element: Element): any; invalidElements(): HTMLElement[]; diff --git a/jquery/jquery-tests.ts b/jquery/jquery-tests.ts index a3a8e6581d..d031535184 100644 --- a/jquery/jquery-tests.ts +++ b/jquery/jquery-tests.ts @@ -41,7 +41,7 @@ function test_addClass() { function test_after() { $('.inner').after('

      Test

      '); - $('
      ').after('

      '); + $('
      ').after('

      ').after(document.createDocumentFragment()); $('
      ').after('

      ').addClass('foo') .filter('p').attr('id', 'bar').html('hello') .end() @@ -88,7 +88,7 @@ function test_ajax() { alert('Load was performed.'); }, error: function (jqXHR, textStatus, errorThrown) { - alert('Load failed. responseJSON=' + jqXHR.responseJSON); + alert('Load failed. responseJSON=' + jqXHR.responseJSON); } }); var _super = jQuery.ajaxSettings.xhr; @@ -509,7 +509,7 @@ function test_toggle() { function test_append() { $('.inner').append('

      Test

      '); - $('.container').append($('h2')); + $('.container').append($('h2')).append(document.createDocumentFragment()); var $newdiv1 = $('
      '), newdiv2 = document.createElement('div'), @@ -559,7 +559,7 @@ function test_attributeSelectors() { function test_before() { $('.inner').before('

      Test

      '); - $('.container').before($('h2')); + $('.container').before($('h2')).before(document.createDocumentFragment()); $("
      ").before("

      "); var $newdiv1 = $('
      '), newdiv2 = document.createElement('div'), @@ -946,6 +946,17 @@ function test_clone() { .clone()); } +function test_prepend() { + $('.inner').prepend('

      Test

      '); + $('.container').prepend($('h2')).prepend(document.createDocumentFragment()); + + var $newdiv1 = $('
      '), + newdiv2 = document.createElement('div'), + existingdiv1 = document.getElementById('foo'); + + $('body').prepend($newdiv1, [newdiv2, existingdiv1]); +} + function test_prependTo() { $("

      Test

      ").prependTo(".inner"); $("h2").prependTo($(".container")); @@ -1514,6 +1525,9 @@ function test_eventParams() { $(window).on('mousewheel', (e) => { var delta = (e.originalEvent).deltaY; }); + $( "p" ).click(function( event ) { + alert( event.currentTarget === this ); // true + }); } function test_extend() { @@ -3249,7 +3263,7 @@ function test_not() { $("p").not("#selected"); $("p").not($("div p.selected")); - + var el1 = $("
      ")[0]; var el2 = $("
      ")[0]; $("p").not([el1, el2]); diff --git a/jquery/jquery.d.ts b/jquery/jquery.d.ts index 6478529dad..0f72c709cf 100644 --- a/jquery/jquery.d.ts +++ b/jquery/jquery.d.ts @@ -442,6 +442,7 @@ interface JQueryDeferred extends JQueryGenericPromise { * Interface of the JQuery extension of the W3C event object */ interface BaseJQueryEventObject extends Event { + currentTarget: Element; data: any; delegateTarget: Element; isDefaultPrevented(): boolean; @@ -1024,7 +1025,7 @@ interface JQueryStatic { * @param func The function to process each item against. The first argument to the function is the item, and the second argument is the index. The function should return a Boolean value. this will be the global window object. * @param invert If "invert" is false, or not provided, then the function returns an array consisting of all elements for which "callback" returns true. If "invert" is true, then the function returns an array consisting of all elements for which "callback" returns false. */ - grep(array: T[], func: (elementOfArray: T, indexInArray: number) => boolean, invert?: boolean): T[]; + grep(array: T[], func: (elementOfArray?: T, indexInArray?: number) => boolean, invert?: boolean): T[]; /** * Search for a specified value within an array and return its index (or -1 if not found). @@ -1091,14 +1092,14 @@ interface JQueryStatic { * @param array The Array to translate. * @param callback The function to process each item against. The first argument to the function is the array item, the second argument is the index in array The function can return any value. Within the function, this refers to the global (window) object. */ - map(array: T[], callback: (elementOfArray: T, indexInArray: number) => U): U[]; + map(array: T[], callback: (elementOfArray?: T, indexInArray?: number) => U): U[]; /** * Translate all items in an array or object to new array of items. * * @param arrayOrObject The Array or Object to translate. * @param callback The function to process each item against. The first argument to the function is the value; the second argument is the index or key of the array or object property. The function can return any value to add to the array. A returned array will be flattened into the resulting array. Within the function, this refers to the global (window) object. */ - map(arrayOrObject: any, callback: (value: any, indexOrKey: any) => any): any; + map(arrayOrObject: any, callback: (value?: any, indexOrKey?: any) => any): any; /** * Merge the contents of two arrays together into the first array. @@ -1987,6 +1988,24 @@ interface JQuery { */ click(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Trigger the "contextmenu" event on an element. + */ + contextmenu(): JQuery; + /** + * Bind an event handler to the "contextmenu" JavaScript event. + * + * @param handler A function to execute when the event is triggered. + */ + contextmenu(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + /** + * Bind an event handler to the "contextmenu" JavaScript event. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute when the event is triggered. + */ + contextmenu(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + /** * Trigger the "dblclick" event on an element. */ @@ -2614,10 +2633,10 @@ interface JQuery { /** * Insert content, specified by the parameter, after each element in the set of matched elements. * - * param content1 HTML string, DOM element, array of elements, or jQuery object to insert after each element in the set of matched elements. + * param content1 HTML string, DOM element, DocumentFragment, array of elements, or jQuery object to insert after each element in the set of matched elements. * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert after each element in the set of matched elements. */ - after(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): JQuery; + after(content1: JQuery|any[]|Element|DocumentFragment|Text|string, ...content2: any[]): JQuery; /** * Insert content, specified by the parameter, after each element in the set of matched elements. * @@ -2628,10 +2647,10 @@ interface JQuery { /** * Insert content, specified by the parameter, to the end of each element in the set of matched elements. * - * param content1 DOM element, array of elements, HTML string, or jQuery object to insert at the end of each element in the set of matched elements. + * param content1 DOM element, DocumentFragment, array of elements, HTML string, or jQuery object to insert at the end of each element in the set of matched elements. * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the end of each element in the set of matched elements. */ - append(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): JQuery; + append(content1: JQuery|any[]|Element|DocumentFragment|Text|string, ...content2: any[]): JQuery; /** * Insert content, specified by the parameter, to the end of each element in the set of matched elements. * @@ -2649,10 +2668,10 @@ interface JQuery { /** * Insert content, specified by the parameter, before each element in the set of matched elements. * - * param content1 HTML string, DOM element, array of elements, or jQuery object to insert before each element in the set of matched elements. + * param content1 HTML string, DOM element, DocumentFragment, array of elements, or jQuery object to insert before each element in the set of matched elements. * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert before each element in the set of matched elements. */ - before(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): JQuery; + before(content1: JQuery|any[]|Element|DocumentFragment|Text|string, ...content2: any[]): JQuery; /** * Insert content, specified by the parameter, before each element in the set of matched elements. * @@ -2697,10 +2716,10 @@ interface JQuery { /** * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements. * - * param content1 DOM element, array of elements, HTML string, or jQuery object to insert at the beginning of each element in the set of matched elements. + * param content1 DOM element, DocumentFragment, array of elements, HTML string, or jQuery object to insert at the beginning of each element in the set of matched elements. * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the beginning of each element in the set of matched elements. */ - prepend(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): JQuery; + prepend(content1: JQuery|any[]|Element|DocumentFragment|Text|string, ...content2: any[]): JQuery; /** * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements. * diff --git a/jqueryui/jqueryui-tests.ts b/jqueryui/jqueryui-tests.ts index 607a5bd1dd..042d822332 100644 --- a/jqueryui/jqueryui-tests.ts +++ b/jqueryui/jqueryui-tests.ts @@ -1475,6 +1475,59 @@ function test_menu() { $(".selector").menu({ select: (e, ui) => { } }); } +function test_selectmenu() { + // Options + $("#selectmenu").selectmenu(); + $(".selector").selectmenu({ appendTo: ".selector" }); + $(".selector").selectmenu({ disabled: true }); + $(".selector").selectmenu({ icons: { submenu: "ui-icon-circle-triangle-e" } }); + $(".selector").selectmenu({ position: { my: "left top", at: "right-5 top+5" } }); + $(".selector").selectmenu({ width: 47 }); + + // Events + $("#selectmenu").selectmenu({ change: (event, ui) => {}}); + $("#selectmenu").selectmenu({ close: (event, ui) => {}}); + $("#selectmenu").selectmenu({ create: (event, ui) => {}}); + $("#selectmenu").selectmenu({ focus: (event, ui) => {}}); + $("#selectmenu").selectmenu({ open: (event, ui) => {}}); + $("#selectmenu").selectmenu({ select: (event, ui) => {}}); + + // Events and options + $("#selectmenu").selectmenu({ + appendTo: ".selector", + disabled: true, + icons: { submenu: "ui-icon-circle-triangle-e" }, + position: { my: "left top", at: "right-5 top+5" }, + width: 47, + change: (event, ui) => {}, + close: (event, ui) => {}, + create: (event, ui) => {}, + focus: (event, ui) => {}, + open: (event, ui) => {}, + select: (event, ui) => {} + }); + + // passing in option + $(".selector").selectmenu("option", { disabled: true }); + + // Fetching option value + var disabled = $(".selector").selectmenu("option", "disabled"); + + // Setting option value + $(".selector").selectmenu("option", "disabled", true); + $(".selector").selectmenu("option", "position", { my: "left top", at: "right-5 top+5" } ); + + // Methods + $(".selector").selectmenu("close"); + $(".selector").selectmenu("destroy"); + + // Chaining + $("#number") + .selectmenu() + .selectmenu("menuWidget") + .addClass("overflow"); +} + function test_progressbar() { $("#progressbar").progressbar({ diff --git a/jqueryui/jqueryui.d.ts b/jqueryui/jqueryui.d.ts index 63a1591a21..5f6a279b80 100644 --- a/jqueryui/jqueryui.d.ts +++ b/jqueryui/jqueryui.d.ts @@ -1,4 +1,4 @@ -// Type definitions for jQueryUI 1.9 +// Type definitions for jQueryUI 1.11 // Project: http://jqueryui.com/ // Definitions by: Boris Yankov , John Reilly // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -427,7 +427,7 @@ declare namespace JQueryUI { appendTo?: any; axis?: string; cancel?: string; - connectToSortable?: string; + connectToSortable?: Element | Element[] | JQuery | string; containment?: any; cursor?: string; cursorAt?: any; @@ -477,9 +477,10 @@ declare namespace JQueryUI { } interface DroppableOptions extends DroppableEvents { - disabled?: boolean; accept?: any; activeClass?: string; + addClasses?: boolean; + disabled?: boolean; greedy?: boolean; hoverClass?: string; scope?: string; @@ -625,6 +626,36 @@ declare namespace JQueryUI { interface Selectable extends Widget, SelectableOptions { } + // SelectMenu ////////////////////////////////////////////////// + + interface SelectMenuOptions extends SelectMenuEvents { + appendTo?: string; + disabled?: boolean; + icons?: any; + position?: JQueryPositionOptions; + width?: number; + } + + interface SelectMenuUIParams { + item?: JQuery; + } + + interface SelectMenuEvent { + (event: Event, ui: SelectMenuUIParams): void; + } + + interface SelectMenuEvents { + change?: SelectMenuEvent; + close?: SelectMenuEvent; + create?: SelectMenuEvent; + focus?: SelectMenuEvent; + open?: SelectMenuEvent; + select?: SelectMenuEvent; + } + + interface SelectMenu extends Widget, SelectMenuOptions { + } + // Slider ////////////////////////////////////////////////// interface SliderOptions extends SliderEvents { @@ -1675,6 +1706,22 @@ interface JQuery { selectable(optionLiteral: string, options: JQueryUI.SelectableOptions): any; selectable(optionLiteral: string, optionName: string, optionValue: any): JQuery; + selectmenu(): JQuery; + selectmenu(methodName: 'close'): JQuery; + selectmenu(methodName: 'destroy'): JQuery; + selectmenu(methodName: 'disable'): JQuery; + selectmenu(methodName: 'enable'): JQuery; + selectmenu(methodName: 'instance'): any; + selectmenu(methodName: 'menuWidget'): JQuery; + selectmenu(methodName: 'open'): JQuery; + selectmenu(methodName: 'refresh'): JQuery; + selectmenu(methodName: 'widget'): JQuery; + selectmenu(methodName: string): JQuery; + selectmenu(options: JQueryUI.SelectMenuOptions): JQuery; + selectmenu(optionLiteral: string, optionName: string): any; + selectmenu(optionLiteral: string, options: JQueryUI.SelectMenuOptions): any; + selectmenu(optionLiteral: string, optionName: string, optionValue: any): JQuery; + slider(): JQuery; slider(methodName: 'destroy'): void; slider(methodName: 'disable'): void; @@ -1794,7 +1841,7 @@ interface JQuery { uniqueId(): JQuery; removeUniqueId(): JQuery; scrollParent(): JQuery; - zIndex(): JQuery; + zIndex(): number; zIndex(zIndex: number): JQuery; widget: JQueryUI.Widget; diff --git a/js-base64/js-base64-test.ts b/js-base64/js-base64-test.ts new file mode 100644 index 0000000000..c10943df2e --- /dev/null +++ b/js-base64/js-base64-test.ts @@ -0,0 +1,12 @@ +/// + +import { Base64 } from 'js-base64' + +Base64.encode('dankogai'); // ZGFua29nYWk= +Base64.encode('小飼弾'); // 5bCP6aO85by+ +Base64.encodeURI('小飼弾'); // 5bCP6aO85by- + +Base64.decode('ZGFua29nYWk='); // dankogai +Base64.decode('5bCP6aO85by+'); // 小飼弾 +// note .decodeURI() is unnecessary since it accepts both flavors +Base64.decode('5bCP6aO85by-'); // 小飼弾 diff --git a/js-base64/js-base64.d.ts b/js-base64/js-base64.d.ts new file mode 100644 index 0000000000..30fd18620d --- /dev/null +++ b/js-base64/js-base64.d.ts @@ -0,0 +1,52 @@ +// Type definitions for js-base64 v2.1.9 +// Project: https://github.com/dankogai/js-base64 +// Definitions by: Denis Carriere +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** +## TODO + +add methods: +- [x] encode +- [x] encodeURI +- [x] decode +- [ ] atob +- [ ] btoa +- [ ] fromBase64 +- [ ] toBase64 +- [ ] utob +- [ ] btou +- [ ] noConflict + */ + +interface Base64 { + /** + * .encode + * @param {String} string + * @return {String} + */ + encode(base64: string): string; + + /** + * .encodeURI + * @param {String} string + * @return {String} + */ + encodeURI(base64: string): string + + /** + * .decode + * @param {String} string + * @return {String} + */ + decode(base64: string): string + + /** + * Library version + */ + VERSION:string +} + +declare module 'js-base64' { + const Base64: Base64 +} \ No newline at end of file diff --git a/js-priority-queue/js-priority-queue-tests.ts b/js-priority-queue/js-priority-queue-tests.ts new file mode 100644 index 0000000000..e63cd0a8b8 --- /dev/null +++ b/js-priority-queue/js-priority-queue-tests.ts @@ -0,0 +1,26 @@ +/// + +import * as PriorityQueue from "js-priority-queue"; + +{ + var queue = new PriorityQueue({ comparator: (a, b) => b - a }); + queue.queue(5); + queue.queue(3); + queue.queue(2); + var lowest = queue.dequeue(); // returns 5 +} +{ + var compareNumbers = (a: number, b: number) => a - b; + new PriorityQueue({ comparator: compareNumbers }); +} +{ + new PriorityQueue({ initialValues: [1, 2, 3] }) +} +{ + new PriorityQueue({ strategy: PriorityQueue.ArrayStrategy }); // Array + new PriorityQueue({ strategy: PriorityQueue.BinaryHeapStrategy }); // Default + new PriorityQueue({ strategy: PriorityQueue.BHeapStrategy }); // Slower +} +{ + var a: PriorityQueue.PriorityQueueOptions; +} diff --git a/js-priority-queue/js-priority-queue.d.ts b/js-priority-queue/js-priority-queue.d.ts new file mode 100644 index 0000000000..dda0c47097 --- /dev/null +++ b/js-priority-queue/js-priority-queue.d.ts @@ -0,0 +1,64 @@ +// Type definitions for js-priority-queue +// Project: https://github.com/adamhooper/js-priority-queue +// Definitions by: York Yao +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/* =================== USAGE =================== + import * as PriorityQueue from "js-priority-queue"; + var queue = new PriorityQueue({ comparator: (a, b) => b - a }); + queue.queue(5); + =============================================== */ + +declare module "js-priority-queue" { + class AbstractPriorityQueue { + /** + * Returns the number of elements in the queue + */ + public length: number; + /** + * Creates a priority queue + */ + constructor(options?: PriorityQueue.PriorityQueueOptions); + /** + * Inserts a new value in the queue + */ + public queue(value: T): void; + /** + * Returns the smallest item in the queue and leaves the queue unchanged + */ + public peek(): T; + /** + * Returns the smallest item in the queue and removes it from the queue + */ + public dequeue(): T; + /** + * Removes all values from the queue + */ + public clear(): void; + } + namespace PriorityQueue { + type PriorityQueueOptions = { + /** + * This is the argument we would pass to Array.prototype.sort + */ + comparator?: (a: T, b: T) => number; + /** + * You can also pass initial values, in any order. + * With lots of values, it's faster to load them all at once than one at a time. + */ + initialValues?: T[]; + /** + * According to JsPerf, the fastest strategy for most cases is BinaryHeapStrategy. + * Only use ArrayStrategy only if you're queuing items in a very particular order. + * Don't use BHeapStrategy, except as a lesson in how sometimes miracles in one programming language aren't great in other languages. + */ + strategy?: typeof AbstractPriorityQueue; + } + class ArrayStrategy extends AbstractPriorityQueue{ } + class BinaryHeapStrategy extends AbstractPriorityQueue{ } + class BHeapStrategy extends AbstractPriorityQueue{ } + + } + class PriorityQueue extends AbstractPriorityQueue { } + export = PriorityQueue; +} diff --git a/js-quantities/js-quantities-tests.ts b/js-quantities/js-quantities-tests.ts new file mode 100644 index 0000000000..c8d00eef53 --- /dev/null +++ b/js-quantities/js-quantities-tests.ts @@ -0,0 +1,9 @@ +/// + +var Val1 = Qty('1 m') + +var Val2 = Qty(1); + +var Val3 = Qty(1, 'm'); + +var Val4 = Qty(Val1); \ No newline at end of file diff --git a/js-quantities/js-quantities.d.ts b/js-quantities/js-quantities.d.ts new file mode 100644 index 0000000000..a2e3c2d96c --- /dev/null +++ b/js-quantities/js-quantities.d.ts @@ -0,0 +1,79 @@ +// Type definitions for JS-quantities +// Project: http://gentooboontoo.github.io/js-quantities/ +// Definitions by: William Comartin +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare var Qty: QtyModule.QtyStatic; + +declare namespace QtyModule { + interface QtyStatic { + (value: string): Qty; + (value: number): Qty; + (value: number, unit: string): Qty; + (value: Qty): Qty; + } + + interface Qty { + version: string; + + scalar: number; + baseScalar: number; + + parse(value: string): Qty; + + swiftConverter(srcUnits:string, dstUnits:string): (value:number) => number; + + getkinds(): string[]; + + getUnits(kind:string): string[]; + + getAliases(unitName:string): string[]; + + formatter(scalar:number, units:string):string; + + toFloat(): number; + + isUnitless(): boolean; + + isCompatible(other:string|Qty): boolean; + + isInverse(other:string|Qty): boolean + + kind(): string; + + isBase(): boolean; + + toBase(): Qty; + + units(): string; + + eq(other:Qty): boolean; + lt(other:Qty): boolean; + lte(other:Qty): boolean; + gt(other:Qty): boolean; + gte(other:Qty): boolean; + + toPrec(precQuantity: Qty|string|number): Qty; + + toString(targetUnitsOrMaxDecimalsOrPrec?:number|string|Qty, maxDecimals?: number): string; + + format(targetUnits?:string, formatter?:(scalar:number, units:string) => string): string; + + compareTo(other:Qty|string): number; + + same(other: Qty): boolean; + + inverse(): Qty; + + isDegrees(): boolean; + + isTemperature(): boolean; + + to(other:string|Qty): Qty; + + add(other:string|Qty): Qty; + sub(other:string|Qty): Qty; + mul(other:number|string|Qty): Qty; + div(other:number|string|Qty): Qty; + } +} \ No newline at end of file diff --git a/jsnlog/jsnlog-tests.ts b/jsnlog/jsnlog-tests.ts index dfb32a6c85..d37a7370dc 100644 --- a/jsnlog/jsnlog-tests.ts +++ b/jsnlog/jsnlog-tests.ts @@ -3,12 +3,14 @@ // ---------------------------------------------------------- // JL +var offLevel: number = JL.getOffLevel(); var traceLevel: number = JL.getTraceLevel(); var debugLevel: number = JL.getDebugLevel(); var infoLevel: number = JL.getInfoLevel(); var warnLevel: number = JL.getWarnLevel(); var errorLevel: number = JL.getErrorLevel(); var fatalLevel: number = JL.getFatalLevel(); +var allLevel: number = JL.getAllLevel(); JL.setOptions({ enabled: true, @@ -19,10 +21,15 @@ JL.setOptions({ defaultBeforeSend: null }); +// ---------------------------------------------------------- +// Exception + +var e = new JL.Exception("i is too small!"); + // ---------------------------------------------------------- // Ajax Appender -var ajaxAppender1: JSNLog.JSNLogAjaxAppender = JL.createAjaxAppender('ajaxAppender'); +var ajaxAppender1: JL.JSNLogAjaxAppender = JL.createAjaxAppender('ajaxAppender'); ajaxAppender1.setOptions({ level: 5000, @@ -40,7 +47,7 @@ ajaxAppender1.setOptions({ // ---------------------------------------------------------- // Console Appender -var consoleAppender1: JSNLog.JSNLogConsoleAppender = JL.createConsoleAppender('consoleAppender'); +var consoleAppender1: JL.JSNLogConsoleAppender = JL.createConsoleAppender('consoleAppender'); consoleAppender1.setOptions({ level: 5000, @@ -57,7 +64,7 @@ consoleAppender1.setOptions({ // ---------------------------------------------------------- // Loggers -var logger1: JSNLog.JSNLogLogger = JL('mylogger'); +var logger1: JL.JSNLogLogger = JL('mylogger'); var exception = {}; diff --git a/jsnlog/jsnlog.d.ts b/jsnlog/jsnlog.d.ts index 07d8aebe25..40daf96b24 100644 --- a/jsnlog/jsnlog.d.ts +++ b/jsnlog/jsnlog.d.ts @@ -1,30 +1,30 @@ -// Type definitions for JSNLog v2.11.0+ +// Type definitions for JSNLog v2.17.3+ // Project: https://github.com/mperdeck/jsnlog.js // Definitions by: Mattijs Perdeck // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // ------------------------------- -// Full documentation is at +// Full documentation is at // http://jsnlog.com // ------------------------------- /** -* Copyright 2015 Mattijs Perdeck. +* Copyright 2016 Mattijs Perdeck. * * This project is licensed under the MIT license. -* +* * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -* +* * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ // Declarations of all interfaces and ambient objects, except for JL itself. -// Provides strong typing in both jsnlog.ts itself and in TypeScript programs that use -// JSNLog. +// Provides strong typing in both jsnlog.ts itself and in TypeScript programs that use +// JSNLog. -declare namespace JSNLog { +declare namespace JL { interface JSNLogOptions { enabled?: boolean; @@ -83,30 +83,33 @@ declare namespace JSNLog { interface JSNLogConsoleAppender extends JSNLogAppender { } - - interface JSNLogStatic { - (loggerName?: string): JSNLogLogger; - - setOptions(options: JSNLogOptions): JSNLogStatic; - createAjaxAppender(appenderName: string): JSNLogAjaxAppender; - createConsoleAppender(appenderName: string): JSNLogConsoleAppender; - - getTraceLevel(): number; - getDebugLevel(): number; - getInfoLevel(): number; - getWarnLevel(): number; - getErrorLevel(): number; - getFatalLevel(): number; - } } -declare function __jsnlog_configure(jsnlog: JSNLog.JSNLogStatic): void; +declare function __jsnlog_configure(jsnlog: any): void;  -// Ambient declaration of the JL object itself - -declare var JL: JSNLog.JSNLogStatic; - +// Ambient declaration of the JL function itself +declare function JL(loggerName?: string): JL.JSNLogLogger; +// Definitions that need to be kept out of the main namespace definition, +// because otherwise during compilation of jsnlog.ts it complains that you can't +// overload ambient declarations with non-ambient declarations. +declare namespace JL { + export function setOptions(options: JSNLogOptions): void; + export function createAjaxAppender(appenderName: string): JSNLogAjaxAppender; + export function createConsoleAppender(appenderName: string): JSNLogConsoleAppender; + export class Exception { + constructor(data: any, inner?: any); + } + + export function getOffLevel(): number; + export function getTraceLevel(): number; + export function getDebugLevel(): number; + export function getInfoLevel(): number; + export function getWarnLevel(): number; + export function getErrorLevel(): number; + export function getFatalLevel(): number; + export function getAllLevel(): number; +} diff --git a/json-editor/json-editor-tests.ts b/json-editor/json-editor-tests.ts new file mode 100644 index 0000000000..0492324555 --- /dev/null +++ b/json-editor/json-editor-tests.ts @@ -0,0 +1,146 @@ +/// + +var element = document.getElementById('editor_holder'); +var editor = new JSONEditor(element, {}); + +// Set an option globally +JSONEditor.defaults.options.theme = 'bootstrap2'; +// Set an option during instantiation +editor = new JSONEditor(element, { + theme: 'bootstrap2' +}); +editor.on('ready', function () { + // Now the api methods will be available + editor.validate(); +}); + +var editor2 = new JSONEditor<{ name: string; }>(element, {}); +editor2.setValue({ name: "John Smith" }); +var value = editor2.getValue(); +console.log(value.name) // Will log "John Smith" + +// Get a reference to a node within the editor +var name2 = editor.getEditor('root.name'); + +// `getEditor` will return null if the path is invalid +if (name2) { + name2.setValue("John Smith"); + + console.log(name2.getValue()); +} + +var errors = editor.validate(); + +if (errors.length) { + // errors is an array of objects, each with a `path`, `property`, and `message` parameter + // `property` is the schema keyword that triggered the validation error (e.g. "minLength") + // `path` is a dot separated path into the JSON object (e.g. "root.path.to.field") + console.log(errors); +} +else { + // It's valid! +} + +// Validate an arbitrary value against the editor's schema +var errors = editor.validate({ + value: { + to: "test" + } +}); + +editor.on('change', function () { + // Do something +}); + +editor.off('change', function () { + // Do something +}); + +editor.watch('path.to.field', function () { + // Do something +}); + +editor.unwatch('path.to.field', function () { + // Do something +}); + +// Disable entire form +editor.disable(); + +// Disable part of the form +editor.getEditor('root.location').disable(); + +// Enable entire form +editor.enable(); + +// Enable part of the form +editor.getEditor('root.location').enable(); + +// Check if form is currently enabled +if (editor.isEnabled()) alert("It's editable!"); + +editor.destroy(); + +JSONEditor.defaults.options.theme = 'foundation5'; + +JSONEditor.plugins.sceditor.emoticonsEnabled = false; + +JSONEditor.plugins.epiceditor.basePath = 'epiceditor'; + +JSONEditor.plugins.ace.theme = 'twilight'; + +JSONEditor.defaults.editors.object.options.collapsed = true; + +JSONEditor.defaults.options.template = 'handlebars'; + +var myengine = { + compile: function (template: any) { + // Compile should return a render function + return function (vars: any) { + // A real template engine would render the template here + var result = template; + return result; + } + } +}; + +// Set globally +JSONEditor.defaults.options.template = myengine; + +// Override a specific translation +JSONEditor.defaults.languages.en.error_minLength = + "This better be at least {{0}} characters long or else!"; + + +// Create your own language mapping +// Any keys not defined here will fall back to the "en" language +JSONEditor.defaults.languages.es = { + error_notset: "propiedad debe existir" +}; + +JSONEditor.defaults.language = "es"; + +JSONEditor.defaults.resolvers.unshift(function (schema) { + if (schema.type === "object" && schema.format === "location") { + return "location"; + } + + // If no valid editor is returned, the next resolver function will be used +}); + +JSONEditor.plugins.selectize.enable = true; + +JSONEditor.defaults.custom_validators.push(function (schema, value, path) { + var errors: JSONEditorError[] = []; + if (schema.format === "date") { + if (!/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/.test(value)) { + // Errors must be an object with `path`, `property`, and `message` + errors.push({ + path: path, + property: 'format', + message: 'Dates must be in the format "YYYY-MM-DD"' + }); + } + } + return errors; +}); diff --git a/json-editor/json-editor.d.ts b/json-editor/json-editor.d.ts new file mode 100644 index 0000000000..cbb0c9c29c --- /dev/null +++ b/json-editor/json-editor.d.ts @@ -0,0 +1,184 @@ +// Type definitions for json-editor +// Project: https://github.com/jdorn/json-editor +// Definitions by: York Yao +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +type JSONEditorOptions = { + /** + * If true, JSON Editor will load external URLs in $ref via ajax. + */ + ajax?: boolean; + /** + * If true, remove all "add row" buttons from arrays. + */ + disable_array_add?: boolean; + /** + * If true, remove all "delete row" buttons from arrays. + */ + disable_array_delete?: boolean; + /** + * If true, remove all "move up" and "move down" buttons from arrays. + */ + disable_array_reorder?: boolean; + /** + * If true, remove all collapse buttons from objects and arrays. + */ + disable_collapse?: boolean; + /** + * If true, remove all Edit JSON buttons from objects. + */ + disable_edit_json?: boolean; + /** + * If true, remove all Edit Properties buttons from objects. + */ + disable_properties?: boolean; + /** + * The first part of the `name` attribute of form inputs in the editor. An full example name is `root[person][name]` where "root" is the form_name_root. + */ + form_name_root?: string; + /** + * The icon library to use for the editor. + */ + iconlib?: boolean; + /** + * If true, objects can only contain properties defined with the properties keyword. + */ + no_additional_properties?: boolean; + /** + * An object containing schema definitions for URLs. Allows you to pre-define external schemas. + */ + refs?: any; + /** + * If true, all schemas that don't explicitly set the required property will be required. + */ + required_by_default?: boolean; + /** + * If true, makes oneOf copy properties over when switching. + */ + keep_oneof_values?: boolean; + /** + * A valid JSON Schema to use for the editor. Version 3 and Version 4 of the draft specification are supported. + */ + schema?: any; + /** + * When to show validation errors in the UI. Valid values are interaction, change, always, and never. + */ + show_errors?: "interaction" | "change" | "always" | "never"; + /** + * Seed the editor with an initial value. This should be valid against the editor's schema. + */ + startval?: TValue; + /** + * The JS template engine to use. + */ + template?: string | { compile: (template: string) => (vars: any) => string }; + /** + * The CSS theme to use. + */ + theme?: string; + /** + * If true, only required properties will be included by default. + */ + display_required_only?: boolean; +} +type JSONEditorError = { + path: string; + property: string; + message: string; +} +type JSONEditorObjectOptions = { + /** + * If set to true, the editor will start collapsed + */ + collapsed?: boolean; + /** + * If set to true, the collapse button will be hidden + */ + disable_collapse?: boolean; + /** + * If set to true, the Edit JSON button will be hidden + */ + disable_edit_json?: boolean; + /** + * If set to true, the Edit Properties button will be hidden + */ + disable_properties?: boolean; +} +type JSONEditorArrayOptions = { + /** + * If set to true, the editor will start collapsed + */ + collapsed?: boolean; + /** + * If set to true, the "add row" button will be hidden + */ + disable_array_add?: boolean; + /** + * If set to true, all of the "delete" buttons will be hidden + */ + disable_array_delete?: boolean; + /** + * If set to true, just the "delete all rows" button will be hidden + */ + disable_array_delete_all_rows?: boolean; + /** + * If set to true, just the "delete last row" buttons will be hidden + */ + disable_array_delete_last_row?: boolean; + /** + * If set to true, the "move up/down" buttons will be hidden + */ + disable_array_reorder?: boolean; + /** + * If set to true, the collapse button will be hidden + */ + disable_collapse?: boolean; +} +declare class JSONEditor { + public static defaults: { + options: JSONEditorOptions; + editors: { + object: { + options: JSONEditorObjectOptions; + }; + array: { + options: JSONEditorArrayOptions; + } + }; + languages: any; + language: string; + resolvers: ((schema: any) => string)[]; + custom_validators: (((schema: any, value: string, path: string) => JSONEditorError[]))[]; + }; + public static plugins: { + sceditor: { + emoticonsEnabled: boolean; + }; + epiceditor: { + basePath: string; + }; + ace: { + theme: string; + }; + selectize: { + enable: boolean; + }; + }; + constructor(element: HTMLElement, options: JSONEditorOptions); + public on(event: string, fn: Function): JSONEditor; + public off(event: string, fn: Function): JSONEditor; + public watch(event: string, fn: Function): JSONEditor; + public unwatch(event: string, fn: Function): JSONEditor; + public validate(value?: TValue): JSONEditorError[]; + public setValue(value: TValue): void; + public getValue(): TValue; + public getEditor(name: string): JSONEditor; + public disable(): void; + public enable(): void; + public isEnabled(): boolean; + public destroy(): void; +} + +declare module "json-editor" { + export = JSONEditor; +} diff --git a/json-merge-patch/json-merge-patch-tests.ts b/json-merge-patch/json-merge-patch-tests.ts new file mode 100644 index 0000000000..36d0d34a8a --- /dev/null +++ b/json-merge-patch/json-merge-patch-tests.ts @@ -0,0 +1,225 @@ +/// + +import * as jmp from "json-merge-patch"; + +var merge = jmp.merge; +var apply = jmp.apply; +var generate = jmp.generate; +var assert = {deepEqual: function (a: Object, b: Object) { + return JSON.stringify(a) === JSON.stringify(b); +}}; + +assert.deepEqual( + merge({a: 'b'}, {b: 'c'}), + {a: 'b', b: 'c'} +); + +assert.deepEqual( + merge({a: 'b'}, {a: 'c'}), + {a: 'c'} +); + +assert.deepEqual( + merge({a: 'b', b: 'd'}, {a: 'c'}), + {a: 'c', b: 'd'} +); + +assert.deepEqual( + merge({a: null}, {b: 'c'}), + {a: null, b: 'c'} +); + +assert.deepEqual( + merge({a: null}, {a: 'b'}), + {a: 'b'} +); + +assert.deepEqual( + merge({a: 'b'}, {a: null}), + {a: null} +); + +assert.deepEqual( + merge([], {a: 'b'}), + {a: 'b'} +); + +assert.deepEqual( + merge({a: 'b'}, []), + [] +); + +assert.deepEqual( + merge({a: {b: {c: 'd'}}, d: 'e'}, {a: {b: 'a'}}), + {a: {b: 'a'}, d: 'e'} +); + +assert.deepEqual( + merge({a: {b: {c: 'd'}, d: 'e'}}, {a: {b: {c: 'e'}}}), + {a: {b: {c: 'e'}, d: 'e'}} +); + +assert.deepEqual( + merge({a: 'b'}, null), + null +); + +assert.deepEqual( + generate({a: 'b'}, {a: 'c'}), + {a: 'c'} +); + +assert.deepEqual( + generate({a: 'b'}, { a: 'b', b: 'c'}), + {b: 'c'} +); + +assert.deepEqual( + generate({a: 'b'}, {}), + {a: null} +); + +assert.deepEqual( + generate({a: 'b', b: 'c'}, {b: 'c'}), + {a: null} +); + +assert.deepEqual( + generate({a: ['b']}, {a: 'c'}), + {a: 'c'} +); + +assert.deepEqual( + generate({a: 'c'}, {a: ['b']}), + {a: ['b']} +); + +assert.deepEqual( + generate({a: [{b: 'c'}]}, {a: [1]}), + {a: [1]} +); + +assert.deepEqual( + generate(['a', 'b'], ['c', 'd']), + ['c', 'd'] +); + +assert.deepEqual( + generate(['a', 'b'], ['a']), + ['a'] +); + +assert.deepEqual( + generate({a: 'b'}, ['c']), + ['c'] +); + +assert.deepEqual( + generate({a: 'foo'}, null), + null +); + +assert.deepEqual( + generate({a: 'foo'}, 'bar'), + 'bar' +); + +assert.deepEqual( + generate({e: null}, {e: null, a: 1}), + {a: 1} +); + +assert.deepEqual( + generate({}, {a: {bb: {}}}), + {a: {bb: {}}} +); + +assert.deepEqual( + generate({a: 'a'}, {a: 'a'}), + undefined +); + +assert.deepEqual( + generate({a: {b: 'c'}}, {a: {b: 'c'}}), + undefined +); + +assert.deepEqual( + generate([1,2,3], [1,2,3]), + undefined +); + +assert.deepEqual( + apply({a: 'b'}, {a: 'c'}), + {a: 'c'} +); + +assert.deepEqual( + apply({a: 'b'}, {b: 'c'}), + {a: 'b', b: 'c'} +); + +assert.deepEqual( + apply({a: 'b'}, {a: null}), + {} +); + +assert.deepEqual( + apply({a: 'b', b: 'c'}, {a: null}), + {b: 'c'} +); + +assert.deepEqual( + apply({a: ['b']}, {a: 'c'}), + {a: 'c'} +); + +assert.deepEqual( + apply({a: 'c'}, {a: ['b']}), + {a: ['b']} +); + +assert.deepEqual( + apply({a: {b: 'c'}}, {a: {b: 'd', c: null}}), + {a: {b: 'd'}} +); + +assert.deepEqual( + apply({a: [{b: 'c'}]}, {a: [1]}), + {a: [1]} +); + +assert.deepEqual( + apply(['a', 'b'], ['c', 'd']), + ['c', 'd'] +); + +assert.deepEqual( + apply({a: 'b'}, ['c']), + ['c'] +); + +assert.deepEqual( + apply({a: 'foo'}, null), + null +); + +assert.deepEqual( + apply({a: 'foo'}, 'bar'), + 'bar' +); + +assert.deepEqual( + apply({e: null}, {a: 1}), + {e: null, a: 1} +); + +assert.deepEqual( + apply([1, 2], {a: 'b', c: null}), + {a: 'b'} +); + +assert.deepEqual( + apply({}, {a: {bb: {ccc: null}}}), + {a: {bb: {}}} +); \ No newline at end of file diff --git a/json-merge-patch/json-merge-patch.d.ts b/json-merge-patch/json-merge-patch.d.ts new file mode 100644 index 0000000000..bbf7c1d810 --- /dev/null +++ b/json-merge-patch/json-merge-patch.d.ts @@ -0,0 +1,11 @@ +// Type definitions for json-merge-patch +// Project: https://github.com/pierreinglebert/json-merge-patch +// Definitions by: Arsenij Schuetzer +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + + +declare module "json-merge-patch" { + function apply(target: Object, patch: Object): Object; + function generate(before: Object, after: Object): Object; + function merge(patch1: Object, patch2: Object): Object; +} \ No newline at end of file diff --git a/jsonnet/jsonnet-tests.ts b/jsonnet/jsonnet-tests.ts new file mode 100644 index 0000000000..88b3c82bed --- /dev/null +++ b/jsonnet/jsonnet-tests.ts @@ -0,0 +1,6 @@ +/// +import Jsonnet = require('jsonnet'); +var jsonnet = new Jsonnet(); +var code = '{a:1}'; +var result = jsonnet.eval(code); +console.log(result); diff --git a/jsonnet/jsonnet.d.ts b/jsonnet/jsonnet.d.ts new file mode 100644 index 0000000000..5a5aa5b619 --- /dev/null +++ b/jsonnet/jsonnet.d.ts @@ -0,0 +1,13 @@ +// Type definitions for jsonnet +// Project: https://github.com/yosuke-furukawa/node-jsonnet +// Definitions by: Hookclaw +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +declare module "jsonnet" { + class Jsonnet { + constructor(); + eval(code: string): any; + evalFile(): any; + destroy(): void; + } + export = Jsonnet; +} diff --git a/jsonschema/jsonschema-tests.ts b/jsonschema/jsonschema-tests.ts new file mode 100644 index 0000000000..e8acc29886 --- /dev/null +++ b/jsonschema/jsonschema-tests.ts @@ -0,0 +1,6 @@ +/// +import { Validator, IJSONSchemaValidationError } from "jsonschema"; + +const v: Validator = new Validator(); + +const validationResults: { errors: Array } = v.validate("Smith", {"type": "string"}); diff --git a/jsonschema/jsonschema.d.ts b/jsonschema/jsonschema.d.ts new file mode 100644 index 0000000000..1c2f0f915e --- /dev/null +++ b/jsonschema/jsonschema.d.ts @@ -0,0 +1,103 @@ +// Type definitions for jsonschema +// Project: https://github.com/tdegrunt/jsonschema +// Definitions by: Vlado Tešanovic +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +declare module "jsonschema" { + + export interface IJSONSchemaResult { + errors: Array; + instance: any; + arguments: Array<{}>; + propertyPath: string; + name: string; + schema: {}; + throwError: any; + disableFormat: boolean; + } + + export interface IJSONSchemaValidationError { + message: string; + property: string; + stack: string; + schema: {}; + name: string; + instance: any; + argument: {}; + } + + export interface IJSONSchemaOptions { + propertyName?: string; + base?: string; + } + + /** + * How to; + * + * const v: Validator = new Validator(); + * + * const schema: {} = { + * "type": "object", + * "properties": { + * "key": { + * "type": "string", + * "required": true + * }, + * "value": { + * "type": "string", + * "required": true + * } + * } + * }; + * + * const validationResults: { errors: Array } = + * v.validate({ key: "Name", value: "A10" }, {"type": "string"}); + * + */ + export class Validator { + + /** + * Creates a new Validator object + * @name Validator + * @constructor + */ + new(): this; + + /** + * Validates instance against the provided schema + * @param instance + * @param schema + * @param [options] + * @param [ctx] + * @return {Array} + */ + validate(instance: any, schema: {}, options?: IJSONSchemaOptions, ctx?: {}): IJSONSchemaResult; + + /** + * Adds a schema with a certain urn to the Validator instance. + * @param schema + * @param urn + * @return {Object} + */ + addSchema(schema: {}, urn: string): {}; + + /** + * Add Sub schema to existing one + * @param baseuri + * @param schema + */ + addSubSchema(baseuri: string, schema: {}): {} + + /** + * Sets all the schemas of the Validator instance. + * @param schemas + */ + setSchemas (schemas: Array<{}>): void; + + /** + * Returns the schema of a certain urn + * @param urn + */ + getSchema(urn: string): {}; + } +} + diff --git a/jsonwebtoken/jsonwebtoken-tests.ts b/jsonwebtoken/jsonwebtoken-tests.ts index d7ac4c8e2b..44a39dfedb 100644 --- a/jsonwebtoken/jsonwebtoken-tests.ts +++ b/jsonwebtoken/jsonwebtoken-tests.ts @@ -25,7 +25,7 @@ cert = fs.readFileSync('private.key'); // get private key token = jwt.sign({ foo: 'bar' }, cert, { algorithm: 'RS256'}); // sign asynchronously -jwt.sign({ foo: 'bar' }, cert, { algorithm: 'RS256' }, function(token: string) { +jwt.sign({ foo: 'bar' }, cert, { algorithm: 'RS256' }, function(err: Error, token: string) { console.log(token); }); diff --git a/jsonwebtoken/jsonwebtoken.d.ts b/jsonwebtoken/jsonwebtoken.d.ts index bddb01226b..091301e2b2 100644 --- a/jsonwebtoken/jsonwebtoken.d.ts +++ b/jsonwebtoken/jsonwebtoken.d.ts @@ -1,4 +1,4 @@ -// Type definitions for jsonwebtoken 5.7.0 +// Type definitions for jsonwebtoken 7.1.6 // Project: https://github.com/auth0/node-jsonwebtoken // Definitions by: Maxime LUCE , Daniel Heim // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -7,6 +7,24 @@ declare module "jsonwebtoken" { + export class JsonWebTokenError extends Error { + inner: Error; + + constructor(message: string, error?: Error); + } + + export class TokenExpiredError extends JsonWebTokenError { + expiredAt: number; + + constructor(message: string, expiredAt: number); + } + + export class NotBeforeError extends JsonWebTokenError { + date: Date; + + constructor(message: string, date: Date); + } + export interface SignOptions { /** * Signature algorithm. Could be one of these values : @@ -22,28 +40,26 @@ declare module "jsonwebtoken" { * - none: No digital signature or MAC value included */ algorithm?: string; - /** - *@deprecated - see expiresIn - *@member {number} - Lifetime for the token in minutes - */ - expiresInMinutes?: number; /** @member {string} - Lifetime for the token expressed in a string describing a time span [rauchg/ms](https://github.com/rauchg/ms.js). Eg: `60`, `"2 days"`, `"10h"`, `"7d"` */ - expiresIn?: string; + expiresIn?: string | number; notBefore?: string; audience?: string; subject?: string; issuer?: string; jwtid?: string; noTimestamp?: boolean; - headers?: Object; + header?: Object; + encoding?: string; } export interface VerifyOptions { algorithms?: string[]; - audience?: string; - issuer?: string; + audience?: string | string[]; + clockTolerance?: number; + issuer?: string | string[]; ignoreExpiration?: boolean; ignoreNotBefore?: boolean; + jwtId?: string; subject?: string; /** *@deprecated @@ -58,11 +74,11 @@ declare module "jsonwebtoken" { } export interface VerifyCallback { - (err: Error, decoded: any): void; + (err: JsonWebTokenError | TokenExpiredError | NotBeforeError, decoded: any): void; } export interface SignCallback { - (encoded: string): void; + (err: Error, encoded: string): void; } /** diff --git a/jstree/jstree-tests.ts b/jstree/jstree-tests.ts index 1c8ef86c48..a6ea0eb290 100644 --- a/jstree/jstree-tests.ts +++ b/jstree/jstree-tests.ts @@ -109,3 +109,8 @@ var tree = $('a').jstree(); tree.move_node('a', 'b', 0, (node: any, new_par: any, pos: any) => { }, true, true); tree.copy_node('a', 'b', 0, (node: any, new_par: any, pos: any) => { }, true, true); +// #10271 jstree - get_path params not marked to be optional +tree.get_path('nodeId'); +tree.get_path('nodeId', '/'); +tree.get_path('nodeId', '/', true); + diff --git a/jstree/jstree.d.ts b/jstree/jstree.d.ts index db60de893d..dde9a24b67 100644 --- a/jstree/jstree.d.ts +++ b/jstree/jstree.d.ts @@ -1,8 +1,8 @@ -// Type definitions for jsTree v3.0.9 +// Type definitions for jsTree v3.3.1 // Project: http://www.jstree.com/ // Definitions by: Adam Pluciński // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// 45 commit df38535 2015-03-02 13:23 +2:00 +// 1 commit 3b8f55d3797cd299eb36695b62d75c2313a3e3b3 2016-05-10 /// @@ -65,10 +65,12 @@ interface JSTreeStatic { /** * stores all loaded jstree plugins (used internally) + * @name $.jstree.plugins */ plugins: any[]; path: string; idregex: any; + root: string; /** * creates a jstree instance @@ -77,7 +79,7 @@ interface JSTreeStatic { * @param {Object} options options for this instance (extends `$.jstree.defaults`) * @return {jsTree} the new instance */ - create(el: any, options?: JSTreeStaticDefaults): JSTree; + create(el: HTMLElement|JQuery|string, options?: JSTreeStaticDefaults): JSTree; /** * remove all traces of jstree from the DOM and destroy all instances @@ -98,41 +100,22 @@ interface JSTreeStatic { * * __Examples__ * - * $.jstree.reference('tree'); - * $.jstree.reference('#tree'); - * $.jstree.reference('branch'); - * $.jstree.reference('#branch'); - * - * @param {String} selector - * @returns {JSTree|null} the instance or `null` if not found - */ - reference(selector: string): JSTree; - - /** - * get a reference to an existing instance - * - * __Examples__ - * - * $.jstree.reference(document.getElementByID('tree')); - * $.jstree.reference(document.getElementByID('branch')); - * - * @param {HTMLElement} element - * @returns {JSTree|null} the instance or `null` if not found - */ - reference(element: HTMLElement): JSTree; - - /** - * get a reference to an existing instance - * - * __Examples__ - * - * $.jstree.reference($('#tree')); - * $.jstree.reference($('#branch')); - * - * @param {JQuery} object - * @returns {JSTree|null} the instance or `null` if not found - */ - reference(object: JQuery): JSTree; + * // provided a container with an ID of "tree", and a nested node with an ID of "branch" + * // all of there will return the same instance + * $.jstree.reference('tree'); + * $.jstree.reference('#tree'); + * $.jstree.reference($('#tree')); + * $.jstree.reference(document.getElementByID('tree')); + * $.jstree.reference('branch'); + * $.jstree.reference('#branch'); + * $.jstree.reference($('#branch')); + * $.jstree.reference(document.getElementByID('branch')); + * + * @name $.jstree.reference(needle) + * @param {DOMElement|jQuery|String} needle + * @return {jsTree|null} the instance or `null` if not found + */ + reference(needle: HTMLElement|JQuery|string): JSTree; } interface JSTreeStaticDefaults { @@ -475,18 +458,19 @@ interface JSTreeStaticDefaultsContextMenu { /** * an object of actions, or a function that accepts a node and a callback function and calls the callback function with an object of actions available for that node (you can also return the items too). - * - * Each action consists of a key (a unique name) and a value which is an object with the following properties (only label and action are required): - * + * + * Each action consists of a key (a unique name) and a value which is an object with the following properties (only label and action are required). Once a menu item is activated the `action` function will be invoked with an object containing the following keys: item - the contextmenu item definition as seen below, reference - the DOM node that was used (the tree node), element - the contextmenu DOM element, position - an object with x/y properties indicating the position of the menu. + * * * `separator_before` - a boolean indicating if there should be a separator before this item * * `separator_after` - a boolean indicating if there should be a separator after this item * * `_disabled` - a boolean indicating if this action should be disabled * * `label` - a string - the name of the action (could be a function returning a string) - * * `action` - a function to be executed if this item is chosen + * * `action` - a function to be executed if this item is chosen, the function will receive * * `icon` - a string, can be a path to an icon or a className, if using an image that is in the current directory use a `./` prefix, otherwise it will be detected as a class * * `shortcut` - keyCode which will trigger the action if the menu is open (for example `113` for rename, which equals F2) * * `shortcut_label` - shortcut label (like for example `F2` for rename) - * + * * `submenu` - an object with the same structure as $.jstree.defaults.contextmenu.items which can be used to create a submenu - each key will be rendered as a separate option in a submenu that will appear once the current item is hovered + * * @name $.jstree.defaults.contextmenu.items * @plugin contextmenu */ @@ -563,6 +547,14 @@ interface JSTreeStaticDefaultsDragNDrop { * @plugin dnd */ large_drag_target: boolean; + + /** + * controls whether use HTML5 dnd api instead of classical. That will allow better integration of dnd events with other HTML5 controls. + * @reference http://caniuse.com/#feat=dragndrop + * @name $.jstree.defaults.dnd.use_html5 + * @plugin dnd + */ + use_html5: boolean; } interface JSTreeStaticDefaultsMassload { @@ -627,6 +619,14 @@ interface JSTreeStaticDefaultsSearch { * @plugin search */ show_only_matches: boolean; + + /** + * Indicates if the children of matched element are shown (when show_only_matches is true) + * This setting can be changed at runtime when calling the search method. Default is `false`. + * @name $.jstree.defaults.search.show_only_matches_children + * @plugin search + */ + show_only_matches_children: boolean; /** * Indicates if all nodes opened to reveal the search result, @@ -720,7 +720,7 @@ interface JSTree extends JQuery { * @param {Object} options options for this instance * @trigger init.jstree, loading.jstree, loaded.jstree, ready.jstree, changed.jstree */ - init: (el:any, options:any) => void; + init: (el: HTMLElement|JQuery|string, options:any) => void; /** * destroy an instance @@ -830,7 +830,7 @@ interface JSTree extends JQuery { * @param {Boolean} ids if set to true build the path using ID, otherwise node text is used * @return {mixed} */ - get_path: (obj: any, glue: string, ids: boolean) => any; + get_path: (obj: any, glue?: string, ids?: boolean) => any; /** * get the next visible node that is below the `obj` node. If `strict` is set to `true` only sibling nodes are returned. @@ -932,8 +932,9 @@ interface JSTree extends JQuery { * @param {array} nodes * @param {function} callback a function to be executed once loading is complete, the function is executed in the instance's scope and receives one argument - the array passed to _load_nodes * @param {Boolean} is_callback - if false reloads node (AP - original comment missing in source code) + * @param {Boolean} force_reload - if true force reloads node (AP - original comment missing in source code) */ - _load_nodes: (nodes: any[], callback?: (nodes: any[]) => void, is_callback?: boolean) => void; + _load_nodes: (nodes: any[], callback?: (nodes: any[]) => void, is_callback?: boolean, force_reload?: boolean) => void; /** * loads all unloaded nodes @@ -1130,6 +1131,45 @@ interface JSTree extends JQuery { * @trigger disable_node.jstree */ disable_node: (obj: any) => boolean; + + /** + * determines if a node is hidden + * @name is_hidden(obj) + * @param {mixed} obj the node + */ + is_hidden: (obj: any) => boolean; + + /** + * hides a node - it is still in the structure but will not be visible + * @name hide_node(obj) + * @param {mixed} obj the node to hide + * @param {Boolean} skip_redraw internal parameter controlling if redraw is called + * @trigger hide_node.jstree + */ + hide_node: (obj: any, skip_redraw: boolean) => boolean; + + /** + * shows a node + * @name show_node(obj) + * @param {mixed} obj the node to show + * @param {Boolean} skip_redraw internal parameter controlling if redraw is called + * @trigger show_node.jstree + */ + show_node: (obj: any, skip_redraw: boolean) => boolean; + + /** + * hides all nodes + * @name hide_all() + * @trigger hide_all.jstree + */ + hide_all: (skip_redraw: boolean) => boolean; + + /** + * shows all nodes + * @name show_all() + * @trigger show_all.jstree + */ + show_all: (skip_redraw: boolean) => boolean; /** * called when a node is selected by the user. Used internally. @@ -1432,11 +1472,12 @@ interface JSTree extends JQuery { /** * put a node in edit mode (input field to rename the node) - * @name edit(obj [, default_text]) + * @name edit(obj [, default_text, callback]) * @param {mixed} obj - * @param {String} default_text the text to populate the input with (if omitted the node text value is used) - */ - edit: (obj: any, default_text?: string) => void; + * @param {String} default_text the text to populate the input with (if omitted or set to a non-string value the node's text value is used) + * @param {Function} callback a function to be called once the text box is blurred, it is called in the instance's scope and receives the node, a status parameter (true if the rename is successful, false otherwise) and a boolean indicating if the user cancelled the edit. You can access the node's title using .text + */ + edit: (obj: any, default_text?: string, callback?: (node: any, status: boolean, canceled: boolean) => void) => void; /** * changes the theme @@ -1553,6 +1594,10 @@ interface JSTree extends JQuery { * @param {mixed} obj */ show_icon: (obj: any) => void; + + /** + * checkbox plugin + */ /** * set the undetermined state where and if necessary. Used internally. @@ -1590,6 +1635,24 @@ interface JSTree extends JQuery { * @return {Boolean} */ is_undetermined: (obj: any) => boolean; + + /** + * disable a node's checkbox + * @name disable_checkbox(obj) + * @param {mixed} obj an array can be used too + * @trigger disable_checkbox.jstree + * @plugin checkbox + */ + disable_checkbox: (obj: any) => boolean; + + /** + * enable a node's checkbox + * @name disable_checkbox(obj) + * @param {mixed} obj an array can be used too + * @trigger enable_checkbox.jstree + * @plugin checkbox + */ + enable_checkbox: (obj: any) => boolean; /** * check a node (only if tie_selection in checkbox settings is false, otherwise select_node will be called internally) @@ -1689,6 +1752,10 @@ interface JSTree extends JQuery { * @private */ _show_contextmenu: (obj: any, x: number, y: number, i: number) => void; + + /** + * search plugin + */ /** * used to search the tree nodes for a given string @@ -1698,10 +1765,11 @@ interface JSTree extends JQuery { * @param {Boolean} show_only_matches if set to true only matching nodes will be shown (keep in mind this can be very slow on large trees or old browsers) * @param {mixed} inside an optional node to whose children to limit the search * @param {Boolean} append if set to true the results of this search are appended to the previous search + * @param {Boolean} show_only_matches_children show only matched children * @plugin search * @trigger search.jstree */ - search: (str: string, skip_async?: boolean, show_only_matches?: boolean, inside?: any, append?: boolean) => void; + search: (str: string, skip_async?: boolean, show_only_matches?: boolean, inside?: any, append?: boolean, show_only_matches_children?: boolean) => void; /** * used to clear the last search (removes classes and shows all nodes if filtering is on) @@ -1719,6 +1787,10 @@ interface JSTree extends JQuery { * @plugin search */ _search_open: (d: string[]) => void; + + /** + * sort plugin + */ /** * used to sort a node's children @@ -1730,6 +1802,10 @@ interface JSTree extends JQuery { * @trigger search.jstree */ sort: (obj: any, deep?: boolean) => void; + + /** + * state plugin + */ /** * save the state @@ -1751,6 +1827,10 @@ interface JSTree extends JQuery { * @plugin state */ clear_state: () => void; + + /** + * types plugin + */ /** * used to retrieve the type settings object for a node diff --git a/jsuite/jsuite.d.ts b/jsuite/jsuite.d.ts new file mode 100644 index 0000000000..2d32c88e68 --- /dev/null +++ b/jsuite/jsuite.d.ts @@ -0,0 +1,42 @@ +// Type definitions for jSuite +// Project: https://github.com/darrenthill/jsuite +// Definitions by: Darren Hill +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// + +interface Iconfig { + logging?: boolean; + smartConvert?: boolean; + searchId?: string; + recordType?: string; + filterExpression?: any; + columns?: string; + start?: number; + end?: number; + maxUnitsUsage?: number; +} +declare module jSuite { + function getVersion(): string; + function setLogging(toggle: boolean): void; + function getRoleCenter(): any; + function getUser(): any; + function getScriptParameter(paramName: string): any; + function getDeploymentId(): any; + function getScriptId(): any; + function isProduction(): any; + function clearSublist(transaction: nlobjRecord, listType: string): void; + function getCompanyPreference(paramName: string): any; + function roundNum(num: number, length: number): number; + function isNumber(n: any): boolean; + function runSearch(config?: Iconfig): any; + function lookupField(dataIn: any): string; + function submitField(dataIn: any): any; + function asyncLookupField(config: any, callback: any): void; + function asyncSubmitField(config: any): JQueryXHR; + function audit(title: string, message: string): void; + function debug(title: string, message: string): void; + function error(title: string, message: string): void; + function emergency(title: string, message: string): void; +} diff --git a/jszip/jszip-tests.ts b/jszip/jszip-tests.ts index 514beb5012..3cf442e1a9 100644 --- a/jszip/jszip-tests.ts +++ b/jszip/jszip-tests.ts @@ -8,112 +8,121 @@ var SEVERITY = { FATAL: 4 } -function testJSZip() { - var newJszip = new JSZip(); +function createTestZip(): JSZip { + var zip = new JSZip(); + zip.file("test.txt", "test string"); + zip.file("test/test.txt", "test string"); + return zip +} - newJszip.file("test.txt", "test string"); - newJszip.file("test/test.txt", "test string"); - - var serializedZip = newJszip.generate({compression: "DEFLATE", type: "base64"}); - - newJszip = new JSZip(); - newJszip.load(serializedZip, {base64: true, checkCRC32: true}); - - if (newJszip.file("test.txt").asText() === "test string") { - log(SEVERITY.INFO, "all ok"); - } else { - log(SEVERITY.ERROR, "no matching file found"); - } - if (newJszip.file("test/test.txt").asText() === "test string") { - log(SEVERITY.INFO, "all ok"); - } else { - log(SEVERITY.ERROR, "no matching file found"); - } - - var folder = newJszip.folder("test"); - if(folder.file("test.txt").asText() == "test string") { - log(SEVERITY.INFO, "all ok"); - } - else { - log(SEVERITY.ERROR, "wrong file"); - } - - var folders = newJszip.folder(new RegExp("^test")); - - if(folders.length == 1) { - log(SEVERITY.INFO, "all ok"); - if(folders[0].dir == true) { - log(SEVERITY.INFO, "all ok"); - } - else { - log(SEVERITY.ERROR, "wrong file"); - } - } else { - log(SEVERITY.ERROR, "wrong number of folder"); - } - - var files = newJszip.file(new RegExp("^test")); - if(files.length == 2) { - log(SEVERITY.INFO, "all ok"); - if (files[0].asText() == "test string" && files[1].asText() == "test string") { - log(SEVERITY.INFO, "all ok"); - } - else { - log(SEVERITY.ERROR, "wrong data in files"); - } - } - else { - log(SEVERITY.ERROR, "wrong number of files"); - } - - var filterFiles = newJszip.filter((relativePath: string, file: JSZipObject) => { - if (file.asText() == "test string") { - return true; - } - return false; +function filterWithFileAsync(zip: JSZip, as: Serialization, + cb: (relativePath: string, file: JSZipObject, value: any) => boolean) + : Promise { + var promises: Promise[] = []; + var promiseIndices: {[key: string]: number} = {}; + zip.forEach((relativePath: string, file: JSZipObject) => { + var promise = file.async(as); + promiseIndices[file.name] = promises.length; + promises.push(promise); }); + return Promise.all(promises).then(function(values: any[]) { + var filtered = zip.filter((relativePath: string, file: JSZipObject) => { + var index = promiseIndices[file.name]; + return cb(relativePath, file, values[index]); + }); + return Promise.resolve(filtered); + }); +} - if(filterFiles.length == 2) { - log(SEVERITY.INFO, "all ok"); - } - else { - log(SEVERITY.ERROR, "wrong number of files"); - } +function testJSZip() { + var zip = createTestZip(); + zip.generateAsync({compression: "DEFLATE", type: "base64"}).then(function(serializedZip: any) { + var newJszip = new JSZip(); + return newJszip.loadAsync(serializedZip, {base64: true/*, checkCRC32: true*/}); + }).then(function(newJszip: JSZip) { + newJszip.file("test.txt").async('text').then(function(text: string) { + if (text === "test string") { + log(SEVERITY.INFO, "all ok"); + } else { + log(SEVERITY.ERROR, "no matching file found"); + } + }).catch((e: any) => log(SEVERITY.ERROR, e)); + newJszip.file("test/test.txt").async('text').then(function(text: string) { + if (text === "test string") { + log(SEVERITY.INFO, "all ok"); + } else { + log(SEVERITY.ERROR, "no matching file found"); + } + }).catch((e: any) => log(SEVERITY.ERROR, e)); + + var folder = newJszip.folder("test"); + folder.file("test.txt").async('text').then(function(text: string) { + if (text == "test string") { + log(SEVERITY.INFO, "all ok"); + } else { + log(SEVERITY.ERROR, "wrong file"); + } + }).catch((e: any) => log(SEVERITY.ERROR, e)); + + var folders = newJszip.folder(new RegExp("^test")); + + if (folders.length == 1) { + log(SEVERITY.INFO, "all ok"); + if (folders[0].dir == true) { + log(SEVERITY.INFO, "all ok"); + } else { + log(SEVERITY.ERROR, "wrong file"); + } + } else { + log(SEVERITY.ERROR, "wrong number of folder"); + } + + var files = newJszip.file(new RegExp("^test")); + if (files.length == 2) { + log(SEVERITY.INFO, "all ok"); + Promise.all([files[0].async('text'), files[1].async('text')]).then(function(texts: string[]) { + if (texts[0] == "test string" && texts[1] == 'test string') { + log(SEVERITY.INFO, "all ok"); + } else { + log(SEVERITY.ERROR, "wrong data in files"); + } + }); + } else { + log(SEVERITY.ERROR, "wrong number of files"); + } + + filterWithFileAsync(newJszip, 'text', (relativePath: string, file: JSZipObject, text: string) => { + if (text == "test string") { + return true; + } + return false; + }).then(function(filterFiles: JSZipObject[]) { + if (filterFiles.length == 2) { + log(SEVERITY.INFO, "all ok"); + } else { + log(SEVERITY.ERROR, "wrong number of files"); + } + }).catch((e: any) => log(SEVERITY.ERROR, e)); + }).catch((e: any)=> { console.error(e) }); +} + +function testJSZipRemove() { + var newJszip = createTestZip(); newJszip.remove("test/test.txt"); - filterFiles = newJszip.filter((relativePath: string, file: JSZipObject) => { - if (file.asText() == "test string") { + filterWithFileAsync(newJszip, 'text', (relativePath: string, file: JSZipObject, text: string) => { + if (text == "test string") { return true; } return false; - }); - - if(filterFiles.length == 1) { - log(SEVERITY.INFO, "all ok"); - } - else { - log(SEVERITY.ERROR, "wrong number of files"); - } - - var uncompressedStr = JSZip.compressions.DEFLATE.uncompress( - JSZip.compressions.DEFLATE.compress("\0\1\2\3\4\5\6\7",{level:9})); - var uncompressedArr = JSZip.compressions.DEFLATE.uncompress( - JSZip.compressions.DEFLATE.compress([0,1,2,3,4,5,6,7],{level:9})); - var uncompressedUint8Arr = JSZip.compressions.DEFLATE.uncompress( - JSZip.compressions.DEFLATE.compress(new Uint8Array([0,1,2,3,4,5,6,7]),{level:9})); - - var every_match = [0,1,2,3,4,5,6,7].every(function(val, i){ - return uncompressedStr[i] === val && - uncompressedArr[i] === val && - uncompressedUint8Arr[i] === val; - }); - if(every_match) { - log(SEVERITY.INFO, "compress and uncompress ok."); - }else{ - log(SEVERITY.ERROR, "compress or uncompress failed."); - } - + }).then(function(filterFiles: JSZipObject[]) { + if (filterFiles.length == 1) { + log(SEVERITY.INFO, "all ok"); + } else { + log(SEVERITY.ERROR, "wrong number of files"); + } + }).catch((e: any) => log(SEVERITY.ERROR, e)); } function log(severity:number, message: any) { @@ -142,3 +151,4 @@ function log(severity:number, message: any) { } testJSZip(); +testJSZipRemove(); diff --git a/jszip/jszip.d.ts b/jszip/jszip.d.ts index ef17f15cbc..46fe0f870c 100644 --- a/jszip/jszip.d.ts +++ b/jszip/jszip.d.ts @@ -4,6 +4,8 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped interface JSZip { + files: {[key: string]: JSZipObject}; + /** * Get a file from the archive * @@ -46,6 +48,13 @@ interface JSZip { */ folder(name: RegExp): JSZipObject[]; + /** + * Call a callback function for each entry at this folder level. + * + * @param callback function + */ + forEach(callback: (relativePath: string, file: JSZipObject) => void): void; + /** * Get all files wchich match the given filter function * @@ -63,23 +72,40 @@ interface JSZip { remove(path: string): JSZip; /** - * Generates a new archive - * - * @param options Optional options for the generator - * @return The serialized archive + * @deprecated since version 3.0 + * @see {@link generateAsync} + * http://stuk.github.io/jszip/documentation/upgrade_guide.html */ generate(options?: JSZipGeneratorOptions): any; /** - * Deserialize zip file + * Generates a new archive asynchronously + * + * @param options Optional options for the generator + * @return The serialized archive + */ + generateAsync(options?: JSZipGeneratorOptions, onUpdate?: Function): Promise; + + /** + * @deprecated since version 3.0 + * @see {@link loadAsync} + * http://stuk.github.io/jszip/documentation/upgrade_guide.html + */ + load(): void; + + /** + * Deserialize zip file asynchronously * * @param data Serialized zip file * @param options Options for deserializing - * @return Returns the JSZip instance + * @return Returns promise */ - load(data: any, options: JSZipLoadOptions): JSZip; + loadAsync(data: any, options?: JSZipLoadOptions): Promise; } +type Serialization = ("string" | "text" | "base64" | "binarystring" | "uint8array" | + "arraybuffer" | "blob" | "nodebuffer"); + interface JSZipObject { name: string; dir: boolean; @@ -87,11 +113,31 @@ interface JSZipObject { comment: string; options: JSZipObjectOptions; - asText(): string; - asBinary(): string; - asArrayBuffer(): ArrayBuffer; - asUint8Array(): Uint8Array; - //asNodeBuffer(): Buffer; + /** + * Prepare the content in the asked type. + * @param {String} type the type of the result. + * @param {Function} onUpdate a function to call on each internal update. + * @return Promise the promise of the result. + */ + async(type: Serialization, onUpdate?: Function): Promise; + + /** + * @deprecated since version 3.0 + */ + asText(): void; + /** + * @deprecated since version 3.0 + */ + asBinary(): void; + /** + * @deprecated since version 3.0 + */ + asArrayBuffer(): void; + /** + * @deprecated since version 3.0 + */ + asUint8Array(): void; + //asNodeBuffer(): void; } interface JSZipFileOptions { @@ -140,18 +186,6 @@ interface JSZipSupport { nodebuffer: boolean; } -interface DEFLATE { - /** pako.deflateRaw, level:0-9 */ - compress(input: string, compressionOptions: {level:number}): Uint8Array; - compress(input: number[], compressionOptions: {level:number}): Uint8Array; - compress(input: Uint8Array, compressionOptions: {level:number}): Uint8Array; - - /** pako.inflateRaw */ - uncompress(input: string): Uint8Array; - uncompress(input: number[]): Uint8Array; - uncompress(input: Uint8Array): Uint8Array; -} - declare var JSZip: { /** * Create JSZip instance @@ -181,9 +215,6 @@ declare var JSZip: { prototype: JSZip; support: JSZipSupport; - compressions: { - DEFLATE: DEFLATE; - } } declare module "jszip" { diff --git a/jwt-simple/jwt-simple-0.2.0-tests.ts b/jwt-simple/jwt-simple-0.2.0-tests.ts new file mode 100644 index 0000000000..8a0cc59c52 --- /dev/null +++ b/jwt-simple/jwt-simple-0.2.0-tests.ts @@ -0,0 +1,12 @@ +/// + +import jwt = require('jwt-simple'); +var payload = { foo: 'bar' }; +var secret:string = 'xxx'; + +// encode +var token = jwt.encode(payload, secret); + +// decode +var decoded = jwt.decode(token, secret); +console.log(decoded); //=> { foo: 'bar' } \ No newline at end of file diff --git a/jwt-simple/jwt-simple-0.2.0.d.ts b/jwt-simple/jwt-simple-0.2.0.d.ts new file mode 100644 index 0000000000..0ee3cc6799 --- /dev/null +++ b/jwt-simple/jwt-simple-0.2.0.d.ts @@ -0,0 +1,22 @@ +// Type definitions for jwt-simple v0.2.0 +// Project: https://github.com/hokaccha/node-jwt-simple +// Definitions by: Ken Fukuyama +// Definitions: https://github.com/borisyankov/DefinitelyTyped +declare module "jwt-simple" { + /** + * Decode jwt + * @param token + * @param key + * @param noVerify + * @api public + */ + export function decode(token:any, key:string, noVerify?:boolean):any; + /** + * Encode jwt + * @param payload + * @param key + * @param algorithm default is HS256 + * @api public + */ + export function encode(payload:any, key:string, algorithm?:string):string; +} diff --git a/jwt-simple/jwt-simple.d.ts b/jwt-simple/jwt-simple.d.ts index 208c7e6beb..ea78b13e88 100644 --- a/jwt-simple/jwt-simple.d.ts +++ b/jwt-simple/jwt-simple.d.ts @@ -1,6 +1,6 @@ -// Type definitions for jwt-simple v0.2.0 +// Type definitions for jwt-simple v0.5.0 // Project: https://github.com/hokaccha/node-jwt-simple -// Definitions by: Ken Fukuyama +// Definitions by: Ken Fukuyama , Gael Magnan // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare module "jwt-simple" { /** @@ -8,15 +8,17 @@ declare module "jwt-simple" { * @param token * @param key * @param noVerify + * @param algorithm default is HS256 * @api public */ - export function decode(token:any, key:string, noVerify?:boolean):any; + export function decode(token:any, key:string, noVerify?:boolean, algorithm?:string):any; /** * Encode jwt * @param payload * @param key * @param algorithm default is HS256 + * @param options * @api public */ - export function encode(payload:any, key:string, algorithm?:string):string; + export function encode(payload:any, key:string, algorithm?:string, options?:any):string; } diff --git a/kafka-node/kafka-node.d.ts b/kafka-node/kafka-node.d.ts index 5af357021d..19d9bc3010 100644 --- a/kafka-node/kafka-node.d.ts +++ b/kafka-node/kafka-node.d.ts @@ -28,7 +28,7 @@ declare module 'kafka-node' { } export class Consumer { - constructor(client: Client, fetchRequests: Array, options: ConsumerOptions); + constructor(client: Client, fetchRequests: Array, options: ConsumerOptions); on(eventName: string, cb: (message: string) => any): void; on(eventName: string, cb: (error: any) => any): void; addTopics(topics: Array, cb: (error: any, added: boolean) => any): void; diff --git a/karma-chai-sinon/karma-chai-sinon.d.ts b/karma-chai-sinon/karma-chai-sinon.d.ts new file mode 100644 index 0000000000..059a1b80ef --- /dev/null +++ b/karma-chai-sinon/karma-chai-sinon.d.ts @@ -0,0 +1,12 @@ +// Type definitions for karma-chai-sinon 0.1.5 +// Project: https://github.com/tubalmartin/karma-chai-sinon +// Definitions by: Václav Ostrožlík +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + +declare var should: Chai.Should; +declare var expect: Chai.ExpectStatic; +declare var assert: Chai.AssertStatic; +declare var sinon: Sinon.SinonStatic; diff --git a/karma/karma-tests.ts b/karma/karma-tests.ts index 7dbd533b59..712f4f119b 100644 --- a/karma/karma-tests.ts +++ b/karma/karma-tests.ts @@ -28,6 +28,12 @@ karma.runner.run({port: 9876}, (exitCode: number) => { process.exit(exitCode); }); +karma.stopper.stop({port: 9876}, function(exitCode) { + if (exitCode === 0) { + console.log('Server stop as initiated') + } + process.exit(exitCode) +}); //var Server = require('karma').Server; => cannot use this syntax otherwise Server is of type any var server = new karma.Server({logLevel: 'debug', port: 9876}, function(exitCode: number) { @@ -43,6 +49,14 @@ server.on('browser_register', function (browser: any) { console.log('A new browser was registered'); }); +server.on('run_complete', (browsers, results) => { + results.disconnected = false; + results.error = false; + results.exitCode = 0; + results.failed = 9; + results.success = 10; +}); + //var runner = require('karma').runner; => cannot use this syntax otherwise runner is of type any karma.runner.run({port: 9876}, function(exitCode: number) { console.log('Karma has exited with ' + exitCode); diff --git a/karma/karma.d.ts b/karma/karma.d.ts index 455d1df911..95c1baede4 100644 --- a/karma/karma.d.ts +++ b/karma/karma.d.ts @@ -27,6 +27,7 @@ declare module 'karma' { server: DeprecatedServer; Server: Server; runner: Runner; + stopper: Stopper; launcher: Launcher; VERSION: string; } @@ -34,7 +35,7 @@ declare module 'karma' { interface LauncherStatic { generateId(): string; //TODO: injector should be of type `di.Injector` - new(emitter: NodeJS.EventEmitter, injector: any): Launcher; + new (emitter: NodeJS.EventEmitter, injector: any): Launcher; } interface Launcher { @@ -53,11 +54,28 @@ declare module 'karma' { } interface Runner { - run(options?: ConfigOptions|ConfigFile, callback?: ServerCallback): void; + run(options?: ConfigOptions | ConfigFile, callback?: ServerCallback): void; + } + + + interface Stopper { + /** + * This function will signal a running server to stop. The equivalent of karma stop. + */ + stop(options?: ConfigOptions, callback?: ServerCallback): void; + } + + + interface TestResults { + disconnected: boolean; + error: boolean; + exitCode: number; + failed: number; + success: number; } interface Server extends NodeJS.EventEmitter { - new(options?: ConfigOptions|ConfigFile, callback?: ServerCallback): Server; + new (options?: ConfigOptions | ConfigFile, callback?: ServerCallback): Server; /** * Start the server */ @@ -72,6 +90,13 @@ declare module 'karma' { */ refreshFiles(): Promise; + on(event: string, listener: Function): this; + + /** + * Listen to the 'run_complete' event. + */ + on(event: 'run_complete', listener: (browsers: any, results: TestResults ) => void): this; + ///** // * Backward-compatibility with karma-intellij bundled with WebStorm. // * Deprecated since version 0.13, to be removed in 0.14 @@ -191,7 +216,7 @@ declare module 'karma' { * @default [] * @description List of files/patterns to load in the browser. */ - files?: (FilePattern|string)[]; + files?: (FilePattern | string)[]; /** * @default [] * @description List of test frameworks you want to use. Typically, you will set this to ['jasmine'], ['mocha'] or ['qunit']... @@ -257,7 +282,7 @@ declare module 'karma' { * but your interactive debugging does not. * */ - preprocessors?: { [name: string]: string|string[] } + preprocessors?: { [name: string]: string | string[] } /** * @default 'http:' * Possible Values: diff --git a/kendo-ui/kendo-ui.d.ts b/kendo-ui/kendo-ui.d.ts index 20b6bf16a2..d90c5f2356 100644 --- a/kendo-ui/kendo-ui.d.ts +++ b/kendo-ui/kendo-ui.d.ts @@ -262,7 +262,7 @@ declare namespace kendo { static fn: Observable; static extend(prototype: Object): Observable; - init(...args: any[]): void + init(...args: any[]): void; bind(eventName: string, handler: Function): Observable; one(eventName: string, handler: Function): Observable; first(eventName: string, handler: Function): Observable; @@ -843,6 +843,7 @@ declare namespace kendo.data { axes?: any; catalogs?: any; cubes?: any; + cube?: any; data?: any; dimensions?: any; hierarchies?: any; @@ -1281,6 +1282,7 @@ declare namespace kendo.data { interface DataSourceRequestStartEvent extends DataSourceEvent { type?: string; + preventDefault(): void; } interface DataSourceRequestEndEvent extends DataSourceEvent { @@ -1456,14 +1458,20 @@ declare namespace kendo.mobile { } interface ApplicationOptions { + browserHistory?: boolean; hideAddressBar?: boolean; updateDocumentTitle?: boolean; initial?: string; layout?: string; loading?: string; + modelScope?: Object; platform?: string; + retina?: boolean; serverNavigation?: boolean; + skin?: string; + statusBarStyle?: string; transition?: string; + useNativeScrolling?: boolean; } interface ApplicationEvent { @@ -1682,7 +1690,7 @@ declare namespace kendo.geometry { origin: kendo.geometry.Point; size: kendo.geometry.Size; - constructor(origin: kendo.geometry.Point, size: kendo.geometry.Size); + constructor(origin: kendo.geometry.Point|any, size: kendo.geometry.Size|any); static fromPoints(pointA: kendo.geometry.Point, pointB: kendo.geometry.Point): kendo.geometry.Rect; static union(rectA: kendo.geometry.Rect, rectB: kendo.geometry.Rect): kendo.geometry.Rect; @@ -1792,6 +1800,7 @@ declare namespace kendo.drawing { clip(): kendo.drawing.Path; clip(clip: kendo.drawing.Path): void; clippedBBox(): kendo.geometry.Rect; + containsPoint(point: kendo.geometry.Point): boolean; geometry(): kendo.geometry.Arc; geometry(value: kendo.geometry.Arc): void; fill(color: string, opacity?: number): kendo.drawing.Arc; @@ -1812,6 +1821,7 @@ declare namespace kendo.drawing { fill?: kendo.drawing.FillOptions; opacity?: number; stroke?: kendo.drawing.StrokeOptions; + tooltip?: kendo.drawing.TooltipOptions; transform?: kendo.geometry.Transformation; visible?: boolean; } @@ -1835,6 +1845,7 @@ declare namespace kendo.drawing { clip(): kendo.drawing.Path; clip(clip: kendo.drawing.Path): void; clippedBBox(): kendo.geometry.Rect; + containsPoint(point: kendo.geometry.Point): boolean; geometry(): kendo.geometry.Circle; geometry(value: kendo.geometry.Circle): void; fill(color: string, opacity?: number): kendo.drawing.Circle; @@ -1855,6 +1866,7 @@ declare namespace kendo.drawing { fill?: kendo.drawing.FillOptions; opacity?: number; stroke?: kendo.drawing.StrokeOptions; + tooltip?: kendo.drawing.TooltipOptions; transform?: kendo.geometry.Transformation; visible?: boolean; } @@ -1870,6 +1882,7 @@ declare namespace kendo.drawing { options: ElementOptions; + parent: kendo.drawing.Group; constructor(options?: ElementOptions); @@ -1878,6 +1891,7 @@ declare namespace kendo.drawing { clip(): kendo.drawing.Path; clip(clip: kendo.drawing.Path): void; clippedBBox(): kendo.geometry.Rect; + containsPoint(point: kendo.geometry.Point): boolean; opacity(): number; opacity(opacity: number): void; transform(): kendo.geometry.Transformation; @@ -1982,6 +1996,7 @@ declare namespace kendo.drawing { clip(): kendo.drawing.Path; clip(clip: kendo.drawing.Path): void; clippedBBox(): kendo.geometry.Rect; + containsPoint(point: kendo.geometry.Point): boolean; insert(position: number, element: kendo.drawing.Element): void; opacity(): number; opacity(opacity: number): void; @@ -1998,6 +2013,7 @@ declare namespace kendo.drawing { cursor?: string; opacity?: number; pdf?: kendo.drawing.PDFOptions; + tooltip?: kendo.drawing.TooltipOptions; transform?: kendo.geometry.Transformation; visible?: boolean; } @@ -2021,6 +2037,7 @@ declare namespace kendo.drawing { clip(): kendo.drawing.Path; clip(clip: kendo.drawing.Path): void; clippedBBox(): kendo.geometry.Rect; + containsPoint(point: kendo.geometry.Point): boolean; opacity(): number; opacity(opacity: number): void; src(): string; @@ -2039,6 +2056,7 @@ declare namespace kendo.drawing { clip?: kendo.drawing.Path; cursor?: string; opacity?: number; + tooltip?: kendo.drawing.TooltipOptions; transform?: kendo.geometry.Transformation; visible?: boolean; } @@ -2128,6 +2146,7 @@ declare namespace kendo.drawing { clip(clip: kendo.drawing.Path): void; clippedBBox(): kendo.geometry.Rect; close(): kendo.drawing.MultiPath; + containsPoint(point: kendo.geometry.Point): boolean; curveTo(controlOut: any, controlIn: any, endPoint: any): kendo.drawing.MultiPath; curveTo(controlOut: any, controlIn: any, endPoint: kendo.geometry.Point): kendo.drawing.MultiPath; curveTo(controlOut: any, controlIn: kendo.geometry.Point, endPoint: any): kendo.drawing.MultiPath; @@ -2160,6 +2179,7 @@ declare namespace kendo.drawing { fill?: kendo.drawing.FillOptions; opacity?: number; stroke?: kendo.drawing.StrokeOptions; + tooltip?: kendo.drawing.TooltipOptions; transform?: kendo.geometry.Transformation; visible?: boolean; } @@ -2233,6 +2253,7 @@ declare namespace kendo.drawing { clip(clip: kendo.drawing.Path): void; clippedBBox(): kendo.geometry.Rect; close(): kendo.drawing.Path; + containsPoint(point: kendo.geometry.Point): boolean; curveTo(controlOut: any, controlIn: any, endPoint: any): kendo.drawing.Path; curveTo(controlOut: any, controlIn: any, endPoint: kendo.geometry.Point): kendo.drawing.Path; curveTo(controlOut: any, controlIn: kendo.geometry.Point, endPoint: any): kendo.drawing.Path; @@ -2265,6 +2286,7 @@ declare namespace kendo.drawing { fill?: kendo.drawing.FillOptions; opacity?: number; stroke?: kendo.drawing.StrokeOptions; + tooltip?: kendo.drawing.TooltipOptions; transform?: kendo.geometry.Transformation; visible?: boolean; } @@ -2321,6 +2343,7 @@ declare namespace kendo.drawing { clip(): kendo.drawing.Path; clip(clip: kendo.drawing.Path): void; clippedBBox(): kendo.geometry.Rect; + containsPoint(point: kendo.geometry.Point): boolean; geometry(): kendo.geometry.Rect; geometry(value: kendo.geometry.Rect): void; fill(color: string, opacity?: number): kendo.drawing.Rect; @@ -2341,6 +2364,7 @@ declare namespace kendo.drawing { fill?: kendo.drawing.FillOptions; opacity?: number; stroke?: kendo.drawing.StrokeOptions; + tooltip?: kendo.drawing.TooltipOptions; transform?: kendo.geometry.Transformation; visible?: boolean; } @@ -2411,18 +2435,43 @@ declare namespace kendo.drawing { clear(): void; draw(element: kendo.drawing.Element): void; eventTarget(e: any): kendo.drawing.Element; + hideTooltip(): void; resize(force?: boolean): void; + showTooltip(element: kendo.drawing.Element, options?: any): void; } + interface SurfaceTooltipAnimationClose { + effects?: string; + duration?: number; + } + + interface SurfaceTooltipAnimationOpen { + effects?: string; + duration?: number; + } + + interface SurfaceTooltipAnimation { + close?: SurfaceTooltipAnimationClose; + open?: SurfaceTooltipAnimationOpen; + } + + interface SurfaceTooltip { + animation?: boolean|SurfaceTooltipAnimation; + appendTo?: string|JQuery; + } + interface SurfaceOptions { name?: string; type?: string; height?: string; width?: string; + tooltip?: SurfaceTooltip; click?(e: SurfaceClickEvent): void; mouseenter?(e: SurfaceMouseenterEvent): void; mouseleave?(e: SurfaceMouseleaveEvent): void; + tooltipClose?(e: SurfaceTooltipCloseEvent): void; + tooltipOpen?(e: SurfaceTooltipOpenEvent): void; } interface SurfaceEvent { sender: Surface; @@ -2445,6 +2494,16 @@ declare namespace kendo.drawing { originalEvent?: any; } + interface SurfaceTooltipCloseEvent extends SurfaceEvent { + element?: kendo.drawing.Element; + target?: kendo.drawing.Element; + } + + interface SurfaceTooltipOpenEvent extends SurfaceEvent { + element?: kendo.drawing.Element; + target?: kendo.drawing.Element; + } + class Text extends kendo.drawing.Element { @@ -2459,6 +2518,7 @@ declare namespace kendo.drawing { clip(): kendo.drawing.Path; clip(clip: kendo.drawing.Path): void; clippedBBox(): kendo.geometry.Rect; + containsPoint(point: kendo.geometry.Point): boolean; content(): string; content(value: string): void; fill(color: string, opacity?: number): kendo.drawing.Text; @@ -2482,6 +2542,7 @@ declare namespace kendo.drawing { font?: string; opacity?: number; stroke?: kendo.drawing.StrokeOptions; + tooltip?: kendo.drawing.TooltipOptions; transform?: kendo.geometry.Transformation; visible?: boolean; } @@ -2492,6 +2553,28 @@ declare namespace kendo.drawing { } + interface TooltipOptions { + + + + autoHide?: boolean; + content?: string|Function; + position?: string; + height?: number|string; + hideDelay?: number; + offset?: number; + shared?: boolean; + showAfter?: number; + showOn?: string; + width?: number|string; + + + + + } + + + } declare namespace kendo.ui { class AutoComplete extends kendo.ui.Widget { @@ -2553,7 +2636,7 @@ declare namespace kendo.ui { interface AutoCompleteOptions { name?: string; - animation?: AutoCompleteAnimation; + animation?: boolean|AutoCompleteAnimation; dataSource?: any|any|kendo.data.DataSource; dataTextField?: string; delay?: number; @@ -2572,7 +2655,7 @@ declare namespace kendo.ui { headerTemplate?: string|Function; template?: string|Function; valuePrimitive?: boolean; - virtual?: AutoCompleteVirtual; + virtual?: boolean|AutoCompleteVirtual; change?(e: AutoCompleteChangeEvent): void; close?(e: AutoCompleteCloseEvent): void; dataBound?(e: AutoCompleteDataBoundEvent): void; @@ -2914,7 +2997,7 @@ declare namespace kendo.ui { text?: string; value?: string; valuePrimitive?: boolean; - virtual?: ComboBoxVirtual; + virtual?: boolean|ComboBoxVirtual; change?(e: ComboBoxChangeEvent): void; close?(e: ComboBoxCloseEvent): void; dataBound?(e: ComboBoxDataBoundEvent): void; @@ -3009,7 +3092,7 @@ declare namespace kendo.ui { interface ContextMenuOptions { name?: string; alignToAnchor?: boolean; - animation?: ContextMenuAnimation; + animation?: boolean|ContextMenuAnimation; closeOnClick?: boolean; dataSource?: any|any; direction?: string; @@ -3119,7 +3202,7 @@ declare namespace kendo.ui { interface DatePickerOptions { name?: string; - animation?: DatePickerAnimation; + animation?: boolean|DatePickerAnimation; ARIATemplate?: string; culture?: string; dates?: any; @@ -3209,7 +3292,7 @@ declare namespace kendo.ui { interface DateTimePickerOptions { name?: string; - animation?: DateTimePickerAnimation; + animation?: boolean|DateTimePickerAnimation; ARIATemplate?: string; culture?: string; dates?: any; @@ -3252,6 +3335,7 @@ declare namespace kendo.ui { static fn: DropDownList; options: DropDownListOptions; + popup: kendo.ui.Popup; dataSource: kendo.data.DataSource; span: JQuery; @@ -3319,7 +3403,7 @@ declare namespace kendo.ui { interface DropDownListOptions { name?: string; - animation?: DropDownListAnimation; + animation?: boolean|DropDownListAnimation; autoBind?: boolean; cascadeFrom?: string; cascadeFromField?: string; @@ -3344,7 +3428,7 @@ declare namespace kendo.ui { text?: string; value?: string; valuePrimitive?: boolean; - virtual?: DropDownListVirtual; + virtual?: boolean|DropDownListVirtual; change?(e: DropDownListChangeEvent): void; close?(e: DropDownListCloseEvent): void; dataBound?(e: DropDownListDataBoundEvent): void; @@ -3418,6 +3502,10 @@ declare namespace kendo.ui { } + interface EditorDeserialization { + custom?: Function; + } + interface EditorFileBrowserMessages { uploadFile?: string; orderBy?: string; @@ -3646,6 +3734,18 @@ declare namespace kendo.ui { deleteColumn?: string; } + interface EditorPasteCleanup { + all?: boolean; + css?: boolean; + custom?: Function; + keepNewLines?: boolean; + msAllFormatting?: boolean; + msConvertLists?: boolean; + msTags?: boolean; + none?: boolean; + span?: boolean; + } + interface EditorPdfMargin { bottom?: number|string; left?: number|string; @@ -3678,6 +3778,7 @@ declare namespace kendo.ui { } interface EditorSerialization { + custom?: Function; entities?: boolean; scripts?: boolean; semantic?: boolean; @@ -3707,11 +3808,13 @@ declare namespace kendo.ui { interface EditorOptions { name?: string; + deserialization?: EditorDeserialization; domain?: string; encoded?: boolean; messages?: EditorMessages; + pasteCleanup?: EditorPasteCleanup; pdf?: EditorPdf; - resizable?: EditorResizable; + resizable?: boolean|EditorResizable; serialization?: EditorSerialization; stylesheets?: any; tools?: EditorTool[]; @@ -3745,6 +3848,101 @@ declare namespace kendo.ui { } + class FilterMenu extends kendo.ui.Widget { + + static fn: FilterMenu; + + options: FilterMenuOptions; + + field: string; + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): FilterMenu; + + constructor(element: Element, options?: FilterMenuOptions); + + + clear(): void; + + } + + interface FilterMenuMessages { + and?: string; + clear?: string; + filter?: string; + info?: string; + isFalse?: string; + isTrue?: string; + or?: string; + selectValue?: string; + } + + interface FilterMenuOperatorsDate { + eq?: string; + neq?: string; + isnull?: string; + isnotnull?: string; + gte?: string; + gt?: string; + lte?: string; + lt?: string; + } + + interface FilterMenuOperatorsEnums { + eq?: string; + neq?: string; + isnull?: string; + isnotnull?: string; + } + + interface FilterMenuOperatorsNumber { + eq?: string; + neq?: string; + isnull?: string; + isnotnull?: string; + gte?: string; + gt?: string; + lte?: string; + lt?: string; + } + + interface FilterMenuOperatorsString { + eq?: string; + neq?: string; + isnull?: string; + isnotnull?: string; + isempty?: string; + isnotempty?: string; + startswith?: string; + contains?: string; + doesnotcontain?: string; + endswith?: string; + } + + interface FilterMenuOperators { + string?: FilterMenuOperatorsString; + number?: FilterMenuOperatorsNumber; + date?: FilterMenuOperatorsDate; + enums?: FilterMenuOperatorsEnums; + } + + interface FilterMenuOptions { + name?: string; + dataSource?: any|any|kendo.data.DataSource; + extra?: boolean; + field?: string; + messages?: FilterMenuMessages; + operators?: FilterMenuOperators; + } + interface FilterMenuEvent { + sender: FilterMenu; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + class FlatColorPicker extends kendo.ui.Widget { static fn: FlatColorPicker; @@ -3964,10 +4162,10 @@ declare namespace kendo.ui { autoBind?: boolean; columnResizeHandleWidth?: number; columns?: GanttColumn[]; - currentTimeMarker?: GanttCurrentTimeMarker; + currentTimeMarker?: boolean|GanttCurrentTimeMarker; dataSource?: any|any|kendo.data.GanttDataSource; dependencies?: any|any|kendo.data.GanttDependencyDataSource; - editable?: GanttEditable; + editable?: boolean|GanttEditable; navigatable?: boolean; workDayStart?: Date; workDayEnd?: Date; @@ -4213,6 +4411,7 @@ declare namespace kendo.ui { name?: string; text?: GridColumnCommandItemText; className?: string; + template?: string; imageClass?: string; click?: Function; } @@ -4253,7 +4452,8 @@ declare namespace kendo.ui { command?: GridColumnCommandItem[]; encoded?: boolean; field?: string; - filterable?: GridColumnFilterable; + filterable?: boolean|GridColumnFilterable; + footerAttributes?: any; footerTemplate?: string|Function; format?: string; groupable?: boolean; @@ -4265,7 +4465,7 @@ declare namespace kendo.ui { locked?: boolean; lockable?: boolean; minScreenWidth?: number; - sortable?: GridColumnSortable; + sortable?: boolean|GridColumnSortable; template?: string|Function; title?: string; width?: string|number; @@ -4301,8 +4501,10 @@ declare namespace kendo.ui { isFalse?: string; isTrue?: string; or?: string; + search?: string; selectValue?: string; cancel?: string; + selectedItemsFormat?: string; operator?: string; value?: string; checkAll?: string; @@ -4441,7 +4643,7 @@ declare namespace kendo.ui { paperSize?: string|any; template?: string; repeatHeaders?: boolean; - scale?: number|any|any; + scale?: number; proxyURL?: string; proxyTarget?: string; subject?: string; @@ -4465,31 +4667,31 @@ declare namespace kendo.ui { interface GridOptions { name?: string; - allowCopy?: GridAllowCopy; + allowCopy?: boolean|GridAllowCopy; altRowTemplate?: string|Function; autoBind?: boolean; columnResizeHandleWidth?: number; columns?: GridColumn[]; - columnMenu?: GridColumnMenu; + columnMenu?: boolean|GridColumnMenu; dataSource?: any|any|kendo.data.DataSource; detailTemplate?: string|Function; - editable?: GridEditable; + editable?: boolean|GridEditable; excel?: GridExcel; - filterable?: GridFilterable; - groupable?: GridGroupable; + filterable?: boolean|GridFilterable; + groupable?: boolean|GridGroupable; height?: number|string; messages?: GridMessages; mobile?: boolean|string; navigatable?: boolean; - noRecords?: GridNoRecords; - pageable?: GridPageable; + noRecords?: boolean|GridNoRecords; + pageable?: boolean|GridPageable; pdf?: GridPdf; reorderable?: boolean; resizable?: boolean; rowTemplate?: string|Function; - scrollable?: GridScrollable; + scrollable?: boolean|GridScrollable; selectable?: boolean|string; - sortable?: GridSortable; + sortable?: boolean|GridSortable; toolbar?: string | ((...args:any[]) => string) | GridToolbarItem[]; cancel?(e: GridCancelEvent): void; change?(e: GridChangeEvent): void; @@ -4806,7 +5008,7 @@ declare namespace kendo.ui { interface MenuOptions { name?: string; - animation?: MenuAnimation; + animation?: boolean|MenuAnimation; closeOnClick?: boolean; dataSource?: any|any; direction?: string; @@ -4913,7 +5115,7 @@ declare namespace kendo.ui { interface MultiSelectOptions { name?: string; - animation?: MultiSelectAnimation; + animation?: boolean|MultiSelectAnimation; autoBind?: boolean; autoClose?: boolean; dataSource?: any|any|kendo.data.DataSource; @@ -4937,7 +5139,7 @@ declare namespace kendo.ui { tagMode?: string; value?: any; valuePrimitive?: boolean; - virtual?: MultiSelectVirtual; + virtual?: boolean|MultiSelectVirtual; change?(e: MultiSelectChangeEvent): void; close?(e: MultiSelectCloseEvent): void; dataBound?(e: MultiSelectDataBoundEvent): void; @@ -5274,7 +5476,7 @@ declare namespace kendo.ui { interface PanelBarOptions { name?: string; - animation?: PanelBarAnimation; + animation?: boolean|PanelBarAnimation; contentUrls?: any; dataSource?: any|any; expandMode?: string; @@ -5382,7 +5584,7 @@ declare namespace kendo.ui { name?: string; dataSource?: any|kendo.data.PivotDataSource; filterable?: boolean; - sortable?: PivotConfiguratorSortable; + sortable?: boolean|PivotConfiguratorSortable; height?: number|string; messages?: PivotConfiguratorMessages; } @@ -5494,7 +5696,7 @@ declare namespace kendo.ui { excel?: PivotGridExcel; pdf?: PivotGridPdf; filterable?: boolean; - sortable?: PivotGridSortable; + sortable?: boolean|PivotGridSortable; columnWidth?: number; height?: number|string; columnHeaderTemplate?: string|Function; @@ -5583,7 +5785,7 @@ declare namespace kendo.ui { interface PopupOptions { name?: string; adjustSize?: any; - animation?: PopupAnimation; + animation?: boolean|PopupAnimation; anchor?: string|JQuery; appendTo?: string|JQuery; collision?: string; @@ -6021,7 +6223,7 @@ declare namespace kendo.ui { columnWidth?: number; dateHeaderTemplate?: string|Function; dayTemplate?: string|Function; - editable?: SchedulerViewEditable; + editable?: boolean|SchedulerViewEditable; endTime?: Date; eventHeight?: number; eventTemplate?: string|Function; @@ -6055,14 +6257,14 @@ declare namespace kendo.ui { allDayEventTemplate?: string|Function; allDaySlot?: boolean; autoBind?: boolean; - currentTimeMarker?: SchedulerCurrentTimeMarker; + currentTimeMarker?: boolean|SchedulerCurrentTimeMarker; dataSource?: any|any|kendo.data.SchedulerDataSource; date?: Date; dateHeaderTemplate?: string|Function; - editable?: SchedulerEditable; + editable?: boolean|SchedulerEditable; endTime?: Date; eventTemplate?: string|Function; - footer?: SchedulerFooter; + footer?: boolean|SchedulerFooter; group?: SchedulerGroup; height?: number|string; majorTick?: number; @@ -6574,6 +6776,7 @@ declare namespace kendo.ui { format?: string; formula?: string; index?: number; + link?: string; textAlign?: string; underline?: boolean; value?: number|string|boolean|Date; @@ -6643,7 +6846,7 @@ declare namespace kendo.ui { rows?: number; sheets?: SpreadsheetSheet[]; sheetsbar?: boolean; - toolbar?: SpreadsheetToolbar; + toolbar?: boolean|SpreadsheetToolbar; change?(e: SpreadsheetChangeEvent): void; render?(e: SpreadsheetRenderEvent): void; excelExport?(e: SpreadsheetExcelExportEvent): void; @@ -6769,7 +6972,7 @@ declare namespace kendo.ui { interface TabStripOptions { name?: string; - animation?: TabStripAnimation; + animation?: boolean|TabStripAnimation; collapsible?: boolean; contentUrls?: any; dataContentField?: string; @@ -6780,7 +6983,7 @@ declare namespace kendo.ui { dataTextField?: string; dataUrlField?: string; navigatable?: boolean; - scrollable?: TabStripScrollable; + scrollable?: boolean|TabStripScrollable; tabPosition?: string; value?: string; activate?(e: TabStripActivateEvent): void; @@ -6871,7 +7074,7 @@ declare namespace kendo.ui { interface TimePickerOptions { name?: string; - animation?: TimePickerAnimation; + animation?: boolean|TimePickerAnimation; culture?: string; dates?: any; format?: string; @@ -7078,7 +7281,7 @@ declare namespace kendo.ui { interface TooltipOptions { name?: string; autoHide?: boolean; - animation?: TooltipAnimation; + animation?: boolean|TooltipAnimation; content?: TooltipContent; callout?: boolean; filter?: string; @@ -7241,6 +7444,9 @@ declare namespace kendo.ui { addRow(parentRow: string): void; addRow(parentRow: Element): void; addRow(parentRow: JQuery): void; + autoFitColumn(column: number): void; + autoFitColumn(column: string): void; + autoFitColumn(column: any): void; cancelRow(): void; clearSelection(): void; collapse(): void; @@ -7313,13 +7519,13 @@ declare namespace kendo.ui { encoded?: boolean; expandable?: boolean; field?: string; - filterable?: TreeListColumnFilterable; + filterable?: boolean|TreeListColumnFilterable; footerTemplate?: string|Function; format?: string; headerAttributes?: any; headerTemplate?: string|Function; minScreenWidth?: number; - sortable?: TreeListColumnSortable; + sortable?: boolean|TreeListColumnSortable; template?: string|Function; title?: string; width?: string|number; @@ -7420,17 +7626,17 @@ declare namespace kendo.ui { columns?: TreeListColumn[]; resizable?: boolean; reorderable?: boolean; - columnMenu?: TreeListColumnMenu; + columnMenu?: boolean|TreeListColumnMenu; dataSource?: any|any|kendo.data.TreeListDataSource; - editable?: TreeListEditable; + editable?: boolean|TreeListEditable; excel?: TreeListExcel; - filterable?: TreeListFilterable; + filterable?: boolean|TreeListFilterable; height?: number|string; messages?: TreeListMessages; pdf?: TreeListPdf; scrollable?: boolean|any; selectable?: boolean|string; - sortable?: TreeListSortable; + sortable?: boolean|TreeListSortable; toolbar?: TreeListToolbarItem[]; cancel?(e: TreeListCancelEvent): void; change?(e: TreeListChangeEvent): void; @@ -7645,8 +7851,8 @@ declare namespace kendo.ui { } interface TreeViewAnimation { - collapse?: TreeViewAnimationCollapse; - expand?: TreeViewAnimationExpand; + collapse?: boolean|TreeViewAnimationCollapse; + expand?: boolean|TreeViewAnimationExpand; } interface TreeViewCheckboxes { @@ -7663,10 +7869,10 @@ declare namespace kendo.ui { interface TreeViewOptions { name?: string; - animation?: TreeViewAnimation; + animation?: boolean|TreeViewAnimation; autoBind?: boolean; autoScroll?: boolean; - checkboxes?: TreeViewCheckboxes; + checkboxes?: boolean|TreeViewCheckboxes; dataImageUrlField?: string; dataSource?: any|any|kendo.data.HierarchicalDataSource; dataSpriteCssClassField?: string; @@ -7978,7 +8184,7 @@ declare namespace kendo.ui { interface WindowOptions { name?: string; actions?: any; - animation?: WindowAnimation; + animation?: boolean|WindowAnimation; appendTo?: any|string; autoFocus?: boolean; content?: WindowContent; @@ -9211,7 +9417,7 @@ declare namespace kendo.dataviz.ui { size?: number; sizeField?: string; spacing?: number; - stack?: ChartSeriesItemStack; + stack?: boolean|ChartSeriesItemStack; startAngle?: number; target?: ChartSeriesItemTarget; targetField?: string; @@ -9427,7 +9633,7 @@ declare namespace kendo.dataviz.ui { scatter?: any; scatterLine?: any; spacing?: number; - stack?: ChartSeriesDefaultsStack; + stack?: boolean|ChartSeriesDefaultsStack; type?: string; tooltip?: ChartSeriesDefaultsTooltip; verticalArea?: any; @@ -10357,8 +10563,8 @@ declare namespace kendo.dataviz.ui { } interface ChartZoomable { - mousewheel?: ChartZoomableMousewheel; - selection?: ChartZoomableSelection; + mousewheel?: boolean|ChartZoomableMousewheel; + selection?: boolean|ChartZoomableSelection; } interface ChartExportImageOptions { @@ -10397,7 +10603,7 @@ declare namespace kendo.dataviz.ui { dataSource?: any|any|kendo.data.DataSource; legend?: ChartLegend; panes?: ChartPane[]; - pannable?: ChartPannable; + pannable?: boolean|ChartPannable; pdf?: ChartPdf; plotArea?: ChartPlotArea; renderAs?: string; @@ -10411,7 +10617,7 @@ declare namespace kendo.dataviz.ui { valueAxis?: ChartValueAxisItem[]; xAxis?: ChartXAxisItem[]; yAxis?: ChartYAxisItem[]; - zoomable?: ChartZoomable; + zoomable?: boolean|ChartZoomable; axisLabelClick?(e: ChartAxisLabelClickEvent): void; legendItemClick?(e: ChartLegendItemClickEvent): void; legendItemHover?(e: ChartLegendItemHoverEvent): void; @@ -10422,6 +10628,7 @@ declare namespace kendo.dataviz.ui { noteClick?(e: ChartNoteClickEvent): void; noteHover?(e: ChartNoteHoverEvent): void; plotAreaClick?(e: ChartPlotAreaClickEvent): void; + plotAreaHover?(e: ChartPlotAreaHoverEvent): void; render?(e: ChartEvent): void; select?(e: ChartSelectEvent): void; selectEnd?(e: ChartSelectEndEvent): void; @@ -10508,6 +10715,15 @@ declare namespace kendo.dataviz.ui { y?: any; } + interface ChartPlotAreaHoverEvent extends ChartEvent { + category?: any; + element?: any; + originalEvent?: any; + value?: any; + x?: any; + y?: any; + } + interface ChartSelectEvent extends ChartEvent { axis?: any; from?: any; @@ -10571,9 +10787,9 @@ declare namespace kendo.dataviz.ui { options: DiagramOptions; dataSource: kendo.data.DataSource; - connections: DiagramConnection[]; + connections: kendo.dataviz.diagram.Connection[]; connectionsDataSource: kendo.data.DataSource; - shapes: DiagramShape[]; + shapes: kendo.dataviz.diagram.Shape[]; element: JQuery; wrapper: JQuery; @@ -10604,7 +10820,13 @@ declare namespace kendo.dataviz.ui { exportPDF(options?: kendo.drawing.PDFOptions): JQueryPromise; exportSVG(options: any): JQueryPromise; focus(): void; + getConnectionByModelId(id: string): kendo.dataviz.diagram.Connection; + getConnectionByModelId(id: number): kendo.dataviz.diagram.Connection; + getConnectionByModelUid(uid: string): kendo.dataviz.diagram.Connection; getShapeById(id: string): any; + getShapeByModelId(id: string): kendo.dataviz.diagram.Shape; + getShapeByModelId(id: number): kendo.dataviz.diagram.Shape; + getShapeByModelUid(uid: string): kendo.dataviz.diagram.Shape; layerToModel(point: any): any; layout(options: any): void; load(json: string): void; @@ -10643,6 +10865,8 @@ declare namespace kendo.dataviz.ui { color?: string; fontFamily?: string; fontSize?: number; + fontStyle?: string; + fontWeight?: string; template?: string|Function; text?: string; visual?: Function; @@ -10724,7 +10948,7 @@ declare namespace kendo.dataviz.ui { interface DiagramConnectionDefaults { content?: DiagramConnectionDefaultsContent; - editable?: DiagramConnectionDefaultsEditable; + editable?: boolean|DiagramConnectionDefaultsEditable; endCap?: DiagramConnectionDefaultsEndCap; fromConnector?: string; hover?: DiagramConnectionDefaultsHover; @@ -10740,6 +10964,8 @@ declare namespace kendo.dataviz.ui { color?: string; fontFamily?: string; fontSize?: number; + fontStyle?: string; + fontWeight?: string; template?: string|Function; text?: string; visual?: Function; @@ -10834,7 +11060,7 @@ declare namespace kendo.dataviz.ui { interface DiagramConnection { content?: DiagramConnectionContent; - editable?: DiagramConnectionEditable; + editable?: boolean|DiagramConnectionEditable; endCap?: DiagramConnectionEndCap; from?: DiagramConnectionFrom; fromConnector?: string; @@ -10853,7 +11079,7 @@ declare namespace kendo.dataviz.ui { } interface DiagramEditableDrag { - snap?: DiagramEditableDragSnap; + snap?: boolean|DiagramEditableDragSnap; } interface DiagramEditableResizeHandlesFill { @@ -10917,10 +11143,10 @@ declare namespace kendo.dataviz.ui { interface DiagramEditable { connectionTemplate?: string|Function; - drag?: DiagramEditableDrag; + drag?: boolean|DiagramEditableDrag; remove?: boolean; - resize?: DiagramEditableResize; - rotate?: DiagramEditableRotate; + resize?: boolean|DiagramEditableResize; + rotate?: boolean|DiagramEditableRotate; shapeTemplate?: string|Function; tools?: DiagramEditableTool[]; } @@ -11067,6 +11293,8 @@ declare namespace kendo.dataviz.ui { color?: string; fontFamily?: string; fontSize?: number; + fontStyle?: string; + fontWeight?: string; template?: string|Function; text?: string; } @@ -11127,7 +11355,7 @@ declare namespace kendo.dataviz.ui { connectors?: DiagramShapeDefaultsConnector[]; connectorDefaults?: DiagramShapeDefaultsConnectorDefaults; content?: DiagramShapeDefaultsContent; - editable?: DiagramShapeDefaultsEditable; + editable?: boolean|DiagramShapeDefaultsEditable; fill?: DiagramShapeDefaultsFill; height?: number; hover?: DiagramShapeDefaultsHover; @@ -11223,6 +11451,8 @@ declare namespace kendo.dataviz.ui { color?: string; fontFamily?: string; fontSize?: number; + fontStyle?: string; + fontWeight?: string; template?: string|Function; text?: string; } @@ -11281,7 +11511,7 @@ declare namespace kendo.dataviz.ui { connectors?: DiagramShapeConnector[]; connectorDefaults?: DiagramShapeConnectorDefaults; content?: DiagramShapeContent; - editable?: DiagramShapeEditable; + editable?: boolean|DiagramShapeEditable; fill?: DiagramShapeFill; height?: number; hover?: DiagramShapeHover; @@ -11320,11 +11550,11 @@ declare namespace kendo.dataviz.ui { connections?: DiagramConnection[]; connectionsDataSource?: any|any|kendo.data.DataSource; dataSource?: any|any|kendo.data.DataSource; - editable?: DiagramEditable; + editable?: boolean|DiagramEditable; layout?: DiagramLayout; - pannable?: DiagramPannable; + pannable?: boolean|DiagramPannable; pdf?: DiagramPdf; - selectable?: DiagramSelectable; + selectable?: boolean|DiagramSelectable; shapeDefaults?: DiagramShapeDefaults; shapes?: DiagramShape[]; template?: string|Function; @@ -11385,16 +11615,19 @@ declare namespace kendo.dataviz.ui { } interface DiagramDragEvent extends DiagramEvent { + connectionHandle?: string; connections?: any; shapes?: any; } interface DiagramDragEndEvent extends DiagramEvent { + connectionHandle?: string; connections?: any; shapes?: any; } interface DiagramDragStartEvent extends DiagramEvent { + connectionHandle?: string; connections?: any; shapes?: any; } @@ -11700,9 +11933,9 @@ declare namespace kendo.dataviz.ui { } interface MapControls { - attribution?: MapControlsAttribution; - navigator?: MapControlsNavigator; - zoom?: MapControlsZoom; + attribution?: boolean|MapControlsAttribution; + navigator?: boolean|MapControlsNavigator; + zoom?: boolean|MapControlsZoom; } interface MapLayerDefaultsBing { @@ -11995,6 +12228,7 @@ declare namespace kendo.dataviz.ui { reset?(e: MapResetEvent): void; shapeClick?(e: MapShapeClickEvent): void; shapeCreated?(e: MapShapeCreatedEvent): void; + shapeFeatureCreated?(e: MapShapeFeatureCreatedEvent): void; shapeMouseEnter?(e: MapShapeMouseEnterEvent): void; shapeMouseLeave?(e: MapShapeMouseLeaveEvent): void; zoomStart?(e: MapZoomStartEvent): void; @@ -12056,6 +12290,13 @@ declare namespace kendo.dataviz.ui { originalEvent?: any; } + interface MapShapeFeatureCreatedEvent extends MapEvent { + dataItem?: any; + layer?: kendo.dataviz.map.layer.Shape; + group?: kendo.drawing.Group; + properties?: any; + } + interface MapShapeMouseEnterEvent extends MapEvent { layer?: kendo.dataviz.map.layer.Shape; shape?: kendo.drawing.Element; @@ -12773,7 +13014,7 @@ declare namespace kendo.dataviz.ui { size?: number; startAngle?: number; spacing?: number; - stack?: SparklineSeriesItemStack; + stack?: boolean|SparklineSeriesItemStack; tooltip?: SparklineSeriesItemTooltip; width?: number; target?: SparklineSeriesItemTarget; @@ -12836,7 +13077,7 @@ declare namespace kendo.dataviz.ui { overlay?: any; pie?: any; spacing?: number; - stack?: SparklineSeriesDefaultsStack; + stack?: boolean|SparklineSeriesDefaultsStack; type?: string; tooltip?: SparklineSeriesDefaultsTooltip; } @@ -14041,7 +14282,7 @@ declare namespace kendo.dataviz.ui { openField?: string; overlay?: StockChartNavigatorSeriesItemOverlay; spacing?: number; - stack?: StockChartNavigatorSeriesItemStack; + stack?: boolean|StockChartNavigatorSeriesItemStack; tooltip?: StockChartNavigatorSeriesItemTooltip; width?: number; } @@ -14311,7 +14552,7 @@ declare namespace kendo.dataviz.ui { openField?: string; overlay?: StockChartSeriesItemOverlay; spacing?: number; - stack?: StockChartSeriesItemStack; + stack?: boolean|StockChartSeriesItemStack; tooltip?: StockChartSeriesItemTooltip; visibleInLegend?: boolean; width?: number; @@ -14376,7 +14617,7 @@ declare namespace kendo.dataviz.ui { overlay?: any; pie?: any; spacing?: number; - stack?: StockChartSeriesDefaultsStack; + stack?: boolean|StockChartSeriesDefaultsStack; type?: string; tooltip?: StockChartSeriesDefaultsTooltip; } @@ -14702,6 +14943,7 @@ declare namespace kendo.dataviz.ui { noteClick?(e: StockChartNoteClickEvent): void; noteHover?(e: StockChartNoteHoverEvent): void; plotAreaClick?(e: StockChartPlotAreaClickEvent): void; + plotAreaHover?(e: StockChartPlotAreaHoverEvent): void; render?(e: StockChartEvent): void; seriesClick?(e: StockChartSeriesClickEvent): void; seriesHover?(e: StockChartSeriesHoverEvent): void; @@ -14782,6 +15024,15 @@ declare namespace kendo.dataviz.ui { y?: any; } + interface StockChartPlotAreaHoverEvent extends StockChartEvent { + category?: any; + element?: any; + originalEvent?: any; + value?: any; + x?: any; + y?: any; + } + interface StockChartSeriesClickEvent extends StockChartEvent { value?: any; category?: any; @@ -14920,7 +15171,7 @@ declare namespace kendo.dataviz.map { nw: kendo.dataviz.map.Location; se: kendo.dataviz.map.Location; - constructor(nw: kendo.dataviz.map.Location, se: kendo.dataviz.map.Location); + constructor(nw: kendo.dataviz.map.Location|any, se: kendo.dataviz.map.Location|any); static create(a: kendo.dataviz.map.Location, b?: kendo.dataviz.map.Location): kendo.dataviz.map.Extent; static create(a: kendo.dataviz.map.Location, b?: any): kendo.dataviz.map.Extent; @@ -15167,15 +15418,15 @@ declare namespace kendo.dataviz { range(): any; - slot(from: string, to?: string): kendo.geometry.Rect; - slot(from: string, to?: number): kendo.geometry.Rect; - slot(from: string, to?: Date): kendo.geometry.Rect; - slot(from: number, to?: string): kendo.geometry.Rect; - slot(from: number, to?: number): kendo.geometry.Rect; - slot(from: number, to?: Date): kendo.geometry.Rect; - slot(from: Date, to?: string): kendo.geometry.Rect; - slot(from: Date, to?: number): kendo.geometry.Rect; - slot(from: Date, to?: Date): kendo.geometry.Rect; + slot(from: string, to?: string, limit?: boolean): kendo.geometry.Rect; + slot(from: string, to?: number, limit?: boolean): kendo.geometry.Rect; + slot(from: string, to?: Date, limit?: boolean): kendo.geometry.Rect; + slot(from: number, to?: string, limit?: boolean): kendo.geometry.Rect; + slot(from: number, to?: number, limit?: boolean): kendo.geometry.Rect; + slot(from: number, to?: Date, limit?: boolean): kendo.geometry.Rect; + slot(from: Date, to?: string, limit?: boolean): kendo.geometry.Rect; + slot(from: Date, to?: number, limit?: boolean): kendo.geometry.Rect; + slot(from: Date, to?: Date, limit?: boolean): kendo.geometry.Rect; } @@ -15196,6 +15447,7 @@ declare namespace kendo.dataviz.diagram { options: CircleOptions; + drawingElement: kendo.drawing.Circle; constructor(options?: CircleOptions); @@ -15285,6 +15537,8 @@ declare namespace kendo.dataviz.diagram { color?: string; fontFamily?: string; fontSize?: number; + fontStyle?: string; + fontWeight?: string; template?: string|Function; text?: string; visual?: Function; @@ -15425,6 +15679,7 @@ declare namespace kendo.dataviz.diagram { options: GroupOptions; + drawingElement: kendo.drawing.Group; constructor(options?: GroupOptions); @@ -15457,6 +15712,7 @@ declare namespace kendo.dataviz.diagram { options: ImageOptions; + drawingElement: kendo.drawing.Image; constructor(options?: ImageOptions); @@ -15489,6 +15745,7 @@ declare namespace kendo.dataviz.diagram { options: LayoutOptions; + drawingElement: kendo.drawing.Layout; constructor(rect: kendo.dataviz.diagram.Rect, options?: LayoutOptions); @@ -15526,6 +15783,7 @@ declare namespace kendo.dataviz.diagram { options: LineOptions; + drawingElement: kendo.drawing.Path; constructor(options?: LineOptions); @@ -15561,6 +15819,7 @@ declare namespace kendo.dataviz.diagram { options: PathOptions; + drawingElement: kendo.drawing.Path; constructor(options?: PathOptions); @@ -15680,6 +15939,7 @@ declare namespace kendo.dataviz.diagram { options: PolylineOptions; + drawingElement: kendo.drawing.Path; constructor(options?: PolylineOptions); @@ -15801,6 +16061,7 @@ declare namespace kendo.dataviz.diagram { options: RectangleOptions; + drawingElement: kendo.drawing.Path; constructor(options?: RectangleOptions); @@ -15873,6 +16134,7 @@ declare namespace kendo.dataviz.diagram { getConnector(): void; getPosition(side: string): void; redraw(options: any): void; + redrawVisual(): void; } @@ -15922,6 +16184,8 @@ declare namespace kendo.dataviz.diagram { color?: string; fontFamily?: string; fontSize?: number; + fontStyle?: string; + fontWeight?: string; text?: string; } @@ -15972,7 +16236,7 @@ declare namespace kendo.dataviz.diagram { interface ShapeOptions { name?: string; id?: string; - editable?: ShapeEditable; + editable?: boolean|ShapeEditable; path?: string; stroke?: ShapeStroke; type?: string; @@ -16003,6 +16267,7 @@ declare namespace kendo.dataviz.diagram { options: TextBlockOptions; + drawingElement: kendo.drawing.Text; constructor(options?: TextBlockOptions); @@ -16022,6 +16287,8 @@ declare namespace kendo.dataviz.diagram { color?: string; fontFamily?: string; fontSize?: number; + fontStyle?: string; + fontWeight?: string; height?: number; text?: string; width?: number; @@ -16222,6 +16489,8 @@ declare namespace kendo.spreadsheet { isFilterable(): boolean; italic(): boolean; italic(value?: boolean): void; + link(): string; + link(url?: string): void; merge(): void; select(): void; sort(sort: number): void; @@ -16280,10 +16549,10 @@ declare namespace kendo.spreadsheet { rowHeight(): void; rowHeight(index: number, width?: number): void; selection(): kendo.spreadsheet.Range; + setDataSource(dataSource: kendo.data.DataSource, columns?: any): void; showGridLines(): boolean; showGridLines(showGridLiens?: boolean): void; toJSON(): void; - setDataSource(dataSource: kendo.data.DataSource, columns?: any): void; unhideColumn(index: number): void; unhideRow(index: number): void; @@ -16752,7 +17021,7 @@ declare namespace kendo.mobile.ui { style?: string; template?: string|Function; type?: string; - filterable?: ListViewFilterable; + filterable?: boolean|ListViewFilterable; virtualViewSize?: number; click?(e: ListViewClickEvent): void; dataBound?(e: ListViewEvent): void; @@ -17360,22 +17629,22 @@ declare namespace kendo.ooxml { interface WorkbookSheetRowCellBorderBottom { color?: string; - size?: string; + size?: number; } interface WorkbookSheetRowCellBorderLeft { color?: string; - size?: string; + size?: number; } interface WorkbookSheetRowCellBorderRight { color?: string; - size?: string; + size?: number; } interface WorkbookSheetRowCellBorderTop { color?: string; - size?: string; + size?: number; } interface WorkbookSheetRowCell { @@ -17607,7 +17876,7 @@ declare namespace kendo.dataviz.geometry { origin: kendo.geometry.Point; size: kendo.geometry.Size; - constructor(origin: kendo.geometry.Point, size: kendo.geometry.Size); + constructor(origin: kendo.geometry.Point|any, size: kendo.geometry.Size|any); static fromPoints(pointA: kendo.geometry.Point, pointB: kendo.geometry.Point): kendo.geometry.Rect; static union(rectA: kendo.geometry.Rect, rectB: kendo.geometry.Rect): kendo.geometry.Rect; @@ -17717,6 +17986,7 @@ declare namespace kendo.dataviz.drawing { clip(): kendo.drawing.Path; clip(clip: kendo.drawing.Path): void; clippedBBox(): kendo.geometry.Rect; + containsPoint(point: kendo.geometry.Point): boolean; geometry(): kendo.geometry.Arc; geometry(value: kendo.geometry.Arc): void; fill(color: string, opacity?: number): kendo.drawing.Arc; @@ -17737,6 +18007,7 @@ declare namespace kendo.dataviz.drawing { fill?: kendo.drawing.FillOptions; opacity?: number; stroke?: kendo.drawing.StrokeOptions; + tooltip?: kendo.drawing.TooltipOptions; transform?: kendo.geometry.Transformation; visible?: boolean; } @@ -17760,6 +18031,7 @@ declare namespace kendo.dataviz.drawing { clip(): kendo.drawing.Path; clip(clip: kendo.drawing.Path): void; clippedBBox(): kendo.geometry.Rect; + containsPoint(point: kendo.geometry.Point): boolean; geometry(): kendo.geometry.Circle; geometry(value: kendo.geometry.Circle): void; fill(color: string, opacity?: number): kendo.drawing.Circle; @@ -17780,6 +18052,7 @@ declare namespace kendo.dataviz.drawing { fill?: kendo.drawing.FillOptions; opacity?: number; stroke?: kendo.drawing.StrokeOptions; + tooltip?: kendo.drawing.TooltipOptions; transform?: kendo.geometry.Transformation; visible?: boolean; } @@ -17795,6 +18068,7 @@ declare namespace kendo.dataviz.drawing { options: ElementOptions; + parent: kendo.drawing.Group; constructor(options?: ElementOptions); @@ -17803,6 +18077,7 @@ declare namespace kendo.dataviz.drawing { clip(): kendo.drawing.Path; clip(clip: kendo.drawing.Path): void; clippedBBox(): kendo.geometry.Rect; + containsPoint(point: kendo.geometry.Point): boolean; opacity(): number; opacity(opacity: number): void; transform(): kendo.geometry.Transformation; @@ -17907,6 +18182,7 @@ declare namespace kendo.dataviz.drawing { clip(): kendo.drawing.Path; clip(clip: kendo.drawing.Path): void; clippedBBox(): kendo.geometry.Rect; + containsPoint(point: kendo.geometry.Point): boolean; insert(position: number, element: kendo.drawing.Element): void; opacity(): number; opacity(opacity: number): void; @@ -17923,6 +18199,7 @@ declare namespace kendo.dataviz.drawing { cursor?: string; opacity?: number; pdf?: kendo.drawing.PDFOptions; + tooltip?: kendo.drawing.TooltipOptions; transform?: kendo.geometry.Transformation; visible?: boolean; } @@ -17946,6 +18223,7 @@ declare namespace kendo.dataviz.drawing { clip(): kendo.drawing.Path; clip(clip: kendo.drawing.Path): void; clippedBBox(): kendo.geometry.Rect; + containsPoint(point: kendo.geometry.Point): boolean; opacity(): number; opacity(opacity: number): void; src(): string; @@ -17964,6 +18242,7 @@ declare namespace kendo.dataviz.drawing { clip?: kendo.drawing.Path; cursor?: string; opacity?: number; + tooltip?: kendo.drawing.TooltipOptions; transform?: kendo.geometry.Transformation; visible?: boolean; } @@ -18053,6 +18332,7 @@ declare namespace kendo.dataviz.drawing { clip(clip: kendo.drawing.Path): void; clippedBBox(): kendo.geometry.Rect; close(): kendo.drawing.MultiPath; + containsPoint(point: kendo.geometry.Point): boolean; curveTo(controlOut: any, controlIn: any, endPoint: any): kendo.drawing.MultiPath; curveTo(controlOut: any, controlIn: any, endPoint: kendo.geometry.Point): kendo.drawing.MultiPath; curveTo(controlOut: any, controlIn: kendo.geometry.Point, endPoint: any): kendo.drawing.MultiPath; @@ -18085,6 +18365,7 @@ declare namespace kendo.dataviz.drawing { fill?: kendo.drawing.FillOptions; opacity?: number; stroke?: kendo.drawing.StrokeOptions; + tooltip?: kendo.drawing.TooltipOptions; transform?: kendo.geometry.Transformation; visible?: boolean; } @@ -18158,6 +18439,7 @@ declare namespace kendo.dataviz.drawing { clip(clip: kendo.drawing.Path): void; clippedBBox(): kendo.geometry.Rect; close(): kendo.drawing.Path; + containsPoint(point: kendo.geometry.Point): boolean; curveTo(controlOut: any, controlIn: any, endPoint: any): kendo.drawing.Path; curveTo(controlOut: any, controlIn: any, endPoint: kendo.geometry.Point): kendo.drawing.Path; curveTo(controlOut: any, controlIn: kendo.geometry.Point, endPoint: any): kendo.drawing.Path; @@ -18190,6 +18472,7 @@ declare namespace kendo.dataviz.drawing { fill?: kendo.drawing.FillOptions; opacity?: number; stroke?: kendo.drawing.StrokeOptions; + tooltip?: kendo.drawing.TooltipOptions; transform?: kendo.geometry.Transformation; visible?: boolean; } @@ -18246,6 +18529,7 @@ declare namespace kendo.dataviz.drawing { clip(): kendo.drawing.Path; clip(clip: kendo.drawing.Path): void; clippedBBox(): kendo.geometry.Rect; + containsPoint(point: kendo.geometry.Point): boolean; geometry(): kendo.geometry.Rect; geometry(value: kendo.geometry.Rect): void; fill(color: string, opacity?: number): kendo.drawing.Rect; @@ -18266,6 +18550,7 @@ declare namespace kendo.dataviz.drawing { fill?: kendo.drawing.FillOptions; opacity?: number; stroke?: kendo.drawing.StrokeOptions; + tooltip?: kendo.drawing.TooltipOptions; transform?: kendo.geometry.Transformation; visible?: boolean; } @@ -18336,18 +18621,43 @@ declare namespace kendo.dataviz.drawing { clear(): void; draw(element: kendo.drawing.Element): void; eventTarget(e: any): kendo.drawing.Element; + hideTooltip(): void; resize(force?: boolean): void; + showTooltip(element: kendo.drawing.Element, options?: any): void; } + interface SurfaceTooltipAnimationClose { + effects?: string; + duration?: number; + } + + interface SurfaceTooltipAnimationOpen { + effects?: string; + duration?: number; + } + + interface SurfaceTooltipAnimation { + close?: SurfaceTooltipAnimationClose; + open?: SurfaceTooltipAnimationOpen; + } + + interface SurfaceTooltip { + animation?: boolean|SurfaceTooltipAnimation; + appendTo?: string|JQuery; + } + interface SurfaceOptions { name?: string; type?: string; height?: string; width?: string; + tooltip?: SurfaceTooltip; click?(e: SurfaceClickEvent): void; mouseenter?(e: SurfaceMouseenterEvent): void; mouseleave?(e: SurfaceMouseleaveEvent): void; + tooltipClose?(e: SurfaceTooltipCloseEvent): void; + tooltipOpen?(e: SurfaceTooltipOpenEvent): void; } interface SurfaceEvent { sender: Surface; @@ -18370,6 +18680,16 @@ declare namespace kendo.dataviz.drawing { originalEvent?: any; } + interface SurfaceTooltipCloseEvent extends SurfaceEvent { + element?: kendo.drawing.Element; + target?: kendo.drawing.Element; + } + + interface SurfaceTooltipOpenEvent extends SurfaceEvent { + element?: kendo.drawing.Element; + target?: kendo.drawing.Element; + } + class Text extends kendo.drawing.Element { @@ -18384,6 +18704,7 @@ declare namespace kendo.dataviz.drawing { clip(): kendo.drawing.Path; clip(clip: kendo.drawing.Path): void; clippedBBox(): kendo.geometry.Rect; + containsPoint(point: kendo.geometry.Point): boolean; content(): string; content(value: string): void; fill(color: string, opacity?: number): kendo.drawing.Text; @@ -18407,6 +18728,7 @@ declare namespace kendo.dataviz.drawing { font?: string; opacity?: number; stroke?: kendo.drawing.StrokeOptions; + tooltip?: kendo.drawing.TooltipOptions; transform?: kendo.geometry.Transformation; visible?: boolean; } @@ -18417,6 +18739,28 @@ declare namespace kendo.dataviz.drawing { } + interface TooltipOptions { + + + + autoHide?: boolean; + content?: string|Function; + position?: string; + height?: number|string; + hideDelay?: number; + offset?: number; + shared?: boolean; + showAfter?: number; + showOn?: string; + width?: number|string; + + + + + } + + + } interface HTMLElement { @@ -18501,6 +18845,10 @@ interface JQuery { kendoEditor(options: kendo.ui.EditorOptions): JQuery; data(key: "kendoEditor"): kendo.ui.Editor; + kendoFilterMenu(): JQuery; + kendoFilterMenu(options: kendo.ui.FilterMenuOptions): JQuery; + data(key: "kendoFilterMenu"): kendo.ui.FilterMenu; + kendoFlatColorPicker(): JQuery; kendoFlatColorPicker(options: kendo.ui.FlatColorPickerOptions): JQuery; data(key: "kendoFlatColorPicker"): kendo.ui.FlatColorPicker; diff --git a/kii-cloud-sdk/kii-cloud-sdk-tests.ts b/kii-cloud-sdk/kii-cloud-sdk-tests.ts index a7118d78d3..6ca7d611db 100644 --- a/kii-cloud-sdk/kii-cloud-sdk-tests.ts +++ b/kii-cloud-sdk/kii-cloud-sdk-tests.ts @@ -26,6 +26,9 @@ function main() { endpoint.installationID; }); + user.setLocale("en"); + var locale: string = user.getLocale(); + var anotherUser: KiiUser = KiiUserBuilder .builderWithIdentifier("id", "password") .setEmailAddress("mail@example.org") @@ -67,4 +70,30 @@ function main() { removeMembersArray: KiiUser[]) { } }); + + Kii.authenticateAsThing("thing id", "password", { + success: function (thingAuthContext: KiiThingContext) { + thingAuthContext.bucketWithName(""); + }, + failure: function (error) { + } + }) + .then(function (thingAuthContext: KiiThingContext) { + }); + + Kii.authenticateAsThingWithToken("thing id", "token", { + success: function (thingAuthContext: KiiThingContext) { + thingAuthContext.bucketWithName(""); + }, + failure: function (error) { + } + }) + .then(function (thingAuthContext: KiiThingContext) { + }); + + KiiThing.loadWithVendorThingID("thing ID") + .then(function (thing) { + var isOnline: boolean = thing.isOnline(); + var onlineStatusModifiedAt: Date = thing.getOnlineStatusModifiedAt(); + }); } diff --git a/kii-cloud-sdk/kii-cloud-sdk.d.ts b/kii-cloud-sdk/kii-cloud-sdk.d.ts index 970061e8d1..26decd07a0 100644 --- a/kii-cloud-sdk/kii-cloud-sdk.d.ts +++ b/kii-cloud-sdk/kii-cloud-sdk.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Kii Cloud SDK v2.4.3 +// Type definitions for Kii Cloud SDK v2.4.6 // Project: http://en.kii.com/ // Definitions by: Kii Consortium // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -17,7 +17,8 @@ declare namespace KiiCloud { JP, CN, SG, - CN3 + CN3, + EU } export enum KiiAnalyticsSite { @@ -25,7 +26,8 @@ declare namespace KiiCloud { JP, CN, SG, - CN3 + CN3, + EU } enum KiiSocialNetworkName { @@ -512,6 +514,104 @@ declare namespace KiiCloud { * ); */ static listTopics(callbacks?: { success(topicList: KiiTopic[], nextPaginationKey: string): any; failure(anErrorString: string): any; }, paginationKey?: string): Promise<[KiiTopic[], string]>; + + /** + * Authenticate as Thing. + *

      + * This api is intended to be used in a Thing device, where the user + * credentials or app admin context is not configured. This Thing must be + * already registered in Kii Cloud. + * + * + * @param vendorThingID vendorThingID of a registered Thing. + * @param password password for the registered Thing. + * @param callbacks The callback methods called when authentication succeeded/failed. + * + * @return return promise object. + *
        + *
      • fulfill callback function: function(thingAuthContext). thingAuthContext is a KiiThingContext instance.
      • + *
      • reject callback function: function(error). error is an Error instance. + *
          + *
        • error.message
        • + *
        + *
      • + *
      + * + * @example + * // example to use callbacks directly + * Kii.authenticateAsThing("vendor thing id", "password of this thing", { + * success: function(thingAuthContext) { + * // thingAuthContext : KiiThingContext instance + * // Operate entities with thingAuthContext. + * }, + * failure: function(error) { + * // Authentication failed. + * } + * ); + * + * // example to use Promise + * Kii.authenticateAsThing("vendor thing id", "password of this thing").then( + * function(thingAuthContext) { // fulfill callback function + * // thingAuthContext : KiiThingContext instance + * // Operate entities with thingAuthContext. + * + * }, + * function(error) { // reject callback function + * // Authentication failed. + * var errorString = error.message; + * } + * ); + */ + static authenticateAsThing(vendorThingID: string, password: string, callbacks?: { success(thingAuthContext: KiiThingContext): any; failure(error: Error): any; }): Promise; + + /** + * Create a KiiThingContext reference + *

      + * This api is intended to be used in a Thing device, where the user + * credentials or app admin context is not configured. This Thing must be + * already registered in Kii Cloud. + * + * + * @param thingID thingID of a registered Thing. + * @param token token for the registered Thing. + * @param callbacks The callback methods called when creation succeeded/failed. + * + * @return return promise object. + *
        + *
      • fulfill callback function: function(thingContext). thingContext is a KiiThingContext instance.
      • + *
      • reject callback function: function(error). error is an Error instance. + *
          + *
        • error.message
        • + *
        + *
      • + *
      + * + * @example + * // example to use callbacks directly + * Kii.authenticateAsThingWithToken("thing_id", "thing_token", { + * success: function(thingContext) { + * // thingContext : KiiThingContext instance + * // Operate entities with thingContext. + * }, + * failure: function(error) { + * // Creation failed. + * } + * ); + * + * // example to use Promise + * Kii.authenticateAsThingWithToken("thing_id", "thing_token").then( + * function(thingContext) { // fulfill callback function + * // thingContext : KiiThingContext instance + * // Operate entities with thingContext. + * + * }, + * function(error) { // reject callback function + * // Creation failed. + * var errorString = error.message; + * } + * ); + */ + static authenticateAsThingWithToken(thingID: string, token: string, callbacks?: { success(thingContext: KiiThingContext): any; failure(error: Error): any; }): Promise; } /** @@ -3744,7 +3844,7 @@ declare namespace KiiCloud { *
    • response.username is username to use for connecting to the MQTT broker.
    • *
    • response.password is assword to use for connecting to the MQTT broker.
    • *
    • response.mqttTopic is topic to subscribe in the MQTT broker.
    • - *
    • response.host is URL of the MQTT broker host to connect.
    • + *
    • response.host is hostname of the MQTT broker.
    • *
    • response.X-MQTT-TTL is the amount of time in seconds that specifies how long the mqttTopic will be valid, after that the client needs to request new MQTT endpoint info.
    • *
    • response.portTCP is port to connect using plain TCP.
    • *
    • response.portSSL is port to connect using SSL/TLS.
    • @@ -4986,6 +5086,20 @@ declare namespace KiiCloud { */ getDisabled(): boolean; + /** + * Get online status of the thing. + * + * @return true if the thing is online, false otherwise. The return value will be null initially until the thing is connected for the first time. + */ + isOnline(): boolean; + + /** + * Get online status modified date of the thing. + * + * @return online status modified time of this thing. The date will be null initially until the thing is connected for the first time. + */ + getOnlineStatusModifiedAt(): Date; + /** * Register thing in KiiCloud.
      * This API doesnt require users login Anonymous user can register thing. @@ -5794,6 +5908,156 @@ declare namespace KiiCloud { pushSubscription(): KiiPushSubscription; } + /** + * represents a KiiThingContext object + */ + export class KiiThingContext { + /** + * Creates a reference to a bucket in App scope operated by thing. + * + * @param bucketName The name of the bucket the app should create/access + * + * @return A working KiiBucket object + * + * @example + * Kii.authenticateAsThing("vendorThingID", "password", { + * success: function(thingAuthContext) { + * var bucket = thingAuthContext.bucketWithName("myAppBucket"); + * }, + * failure: function(errorString, errorCode) { + * // auth failed. + * } + * }); + */ + bucketWithName(bucketName: string): KiiBucket; + + /** + * Creates a reference to a encrypted bucket in App scope operated by thing. + *

      The bucket will be created/accessed within this app's scope + * + * @param bucketName The name of the bucket the app should create/access + * + * @return A working KiiBucket object + * + * @example + * Kii.authenticateAsThing("vendorThingID", "password", { + * success: function(thingAuthContext) { + * var bucket = thingAuthContext.encryptedBucketWithName("myAppBucket"); + * }, + * failure: function(errorString, errorCode) { + * // auth failed. + * } + * }); + */ + encryptedBucketWithName(bucketName: string): KiiBucket; + + /** + * Creates a reference to an object operated by thing using object`s URI. + * + * @param object URI. + * + * @return A working KiiObject instance + * + * @throws If the URI is null, empty or does not have correct format. + */ + objectWithURI(object: string): KiiObject; + + /** + * Creates a reference to a topic in App scope operated by thing. + *

      The Topic will be created/accessed within this app's scope + * + * @param topicName name of the topic. Must be a not empty string. + * + * @return topic instance. + */ + topicWithName(topicName: string): KiiTopic; + + /** + * Gets a list of topics in app scope + * + * @param callbacks An object with callback methods defined + * @param paginationKey You can specify the pagination key with the nextPaginationKey passed by callbacks.success. If empty string or no string object is provided, this API regards no paginationKey specified. + * + * @return return promise object. + *
        + *
      • fulfill callback function: function(params). params is Array instance. + *
          + *
        • params[0] is array of KiiTopic instances.
        • + *
        • params[1] is string of nextPaginationKey.
        • + *
        + *
      • + *
      • reject callback function: function(error). error is an Error instance. + *
          + *
        • error.target is a KiiAppAdminContext instance which this method was called on.
        • + *
        • error.message
        • + *
        + *
      • + *
      + * + * @example + * // example to use callbacks directly + * // Assume you already have thingAuthContext instance. + * thingAuthContext.listTopics({ + * success: function(topicList, nextPaginationKey) { + * // do something with the result + * for(var i=0; i<topicList.length; i++){ + * var topic = topicList[i]; + * } + * if (nextPaginationKey != null) { + * thingAuthContext.listTopics({ + * success: function(topicList, nextPaginationKey) {...}, + * failure: function(anErrorString) {...} + * }, nextPaginationKey); + * } + * }, + * failure: function(anErrorString) { + * // do something with the error response + * } + * }); + * + * // example to use Promise + * // Assume you already have thingAuthContext instance. + * thingAuthContext.listTopics().then( + * function(params) { + * var topicList = params[0]; + * var nextPaginationKey = params[1]; + * // do something with the result + * for(var i=0; i<topicList.length; i++){ + * var topic = topicList[i]; + * } + * if (nextPaginationKey != null) { + * thingAuthContext.listTopics(null, nextPaginationKey).then( + * function(params) {...}, + * function(error) {...} + * ); + * } + * }, + * function(error) { + * // do something with the error response + * } + * ); + */ + listTopics(callbacks?: { success(topicList: KiiTopic[], nextPaginationKey: string): any; failure(anErrorString: string): any; }, paginationKey?: string): Promise<[KiiTopic[], string]>; + + /** + * Gets authenticated KiiThing instance. + *
      Returned thing instance only have thingID, vendorThingID and accessToken. + * (vendorThingID is not included when you used + * {@link Kii.authenticateAsThingWithToken()} to obtain KiiThingContext.) + *
      Please execute {@link KiiThing#refresh()} to obtain other properties. + * + * @return return authenticated KiiThing instance. + */ + getAuthenticatedThing(): KiiThing; + + /** + * Instantiate push installation for this thing. + * + * @return push installation object. + */ + pushInstallation(): KiiPushInstallation; + } + /** * Represents a Topic object. */ @@ -6059,6 +6323,18 @@ declare namespace KiiCloud { */ getEmailAddress(): string; + /** + * Get the email of this user that has not been verified. + * When the user's email has been changed and email verification is required in you app configuration, + * New email is stored as pending email. + * After the new email has been verified, the address can be obtained by {@link KiiUser.getEmailAddress} + * + * @return User's new email address has not been verified. + * null if no pending email field is included in refresh + * response or undefined when no refresh operation has been done before. + */ + getPendingEmailAddress(): string; + /** * Get the phone number associated with this user * @@ -6066,6 +6342,18 @@ declare namespace KiiCloud { */ getPhoneNumber(): string; + /** + * Get the phone of this user that has not been verified. + * When the user's phone has been changed and phone verification is required in you app configuration, + * New phone is stored as pending phone. + * After the new phone has been verified, the address can be obtained by {@link KiiUser.getPhoneNumber} + * + * @return User's new phone number has not been verified. + * null if no pending phone field is included in refresh + * response or undefined when no refresh operation has been done before. + */ + getPendingPhoneNumber(): string; + /** * Get the country code associated with this user * @@ -6082,6 +6370,25 @@ declare namespace KiiCloud { */ setCountry(value: string): void; + /** + * Get the locale associated with this user + * + * @return + */ + getLocale(): string; + + /** + * Set the locale associated with this user + * The locale argument must be BCP 47 language tag. + * Examples: + * "en": English + * "de-AT": German as used in Austria. + * "zh-Hans-CN": Chinese written in simplified characters as used in China. + * + * @param value The locale to set. + */ + setLocale(value: string): void; + /** * Get the server's creation date of this user * @@ -6172,7 +6479,7 @@ declare namespace KiiCloud { /** * Sets a key/value pair to a KiiUser * - *

      If the key already exists, its value will be written over. If the object is of invalid type, it will return false and a KiiError will be thrown (quietly). Accepted types are any JSON-encodable objects. + *

      If the key already exists, its value will be written over. If key is empty or starting with '_', it will do nothing. Accepted types are any JSON-encodable objects. * * @param key The key to set. The key must not be a system key (created, metadata, modified, type, uuid) or begin with an underscore (_) * @param value The value to be set. Object must be of a JSON-encodable type (Ex: dictionary, array, string, number, etc) @@ -7126,7 +7433,12 @@ declare namespace KiiCloud { ownerOfGroups(callbacks?: { success(theUser: KiiUser, groupList: KiiGroup[]): any; failure(theUser: KiiUser, anErrorString: string): any; }): Promise<[KiiUser, KiiGroup[]]>; /** - * Updates the user's phone number on the server + * Change phone number of logged in user. + * If the phone number verification is required by your app configuration, + * User's phone number would not changed to new one until the new phone number verification has been done. + * In this case, new phone can be obtained by {@link KiiUser#getPendingPhoneNumber()}. + * This API does not refresh the KiiUser automatically. + * Please execute {@link KiiUser#refresh()} before checking the value of {@link KiiUser#getPhoneNumber()} or {@link KiiUser#getPendingPhoneNumber()}. * * @param newPhoneNumber The new phone number to change to * @param callbacks An object with callback methods defined @@ -7169,7 +7481,12 @@ declare namespace KiiCloud { changePhone(newPhoneNumber: string, callbacks?: { success(theUser: KiiUser): any; failure(theUser: KiiUser, anErrorString: string): any; }): Promise; /** - * Updates the user's email address on the server + * Change email of logged in user. + * If the email address verification is required by your app configuration, + * User's email would not changed to new one until the new email verification has been done. + * In this case, new mail address can be obtained by {@link KiiUser#getPendingEmailAddress()}. + * This API does not refresh the KiiUser automatically. + * Please execute {@link KiiUser#refresh()} before checking the value of {@link KiiUser#getEmailAddress()} or {@link KiiUser#getPendingEmailAddress()} * * @param newEmail The new email address to change to * @param callbacks An object with callback methods defined @@ -7792,6 +8109,7 @@ import KiiServerCodeEntry = KiiCloud.KiiServerCodeEntry; import KiiServerCodeExecResult = KiiCloud.KiiServerCodeExecResult; import KiiSocialConnect = KiiCloud.KiiSocialConnect; import KiiThing = KiiCloud.KiiThing; +import KiiThingContext = KiiCloud.KiiThingContext; import KiiTopic = KiiCloud.KiiTopic; import KiiUser = KiiCloud.KiiUser; import KiiUserBuilder = KiiCloud.KiiUserBuilder; diff --git a/kik-browser/kik-browser-tests.ts b/kik-browser/kik-browser-tests.ts new file mode 100644 index 0000000000..ebd7bed113 --- /dev/null +++ b/kik-browser/kik-browser-tests.ts @@ -0,0 +1,310 @@ +/// + +if (kik.enabled) { + // running in kik +} + +if (kik.send) { + // can send messages +} + +kik.getUser(function (user) { + if (!user) { + // user denied access to their information + } else { + typeof user.username; // "string" + typeof user.fullName; // "string" + typeof user.firstName; // "string" + typeof user.lastName; // "string" + typeof user.pic; // "string" + typeof user.thumbnail; // "string" + } +}); + +if (kik.hasPermission()) { + // your webpage has permission +} + +kik.getAnonymousUser(function (token) { + typeof token; // "string" +}); + +kik.sign("my data", function (signedData, username, host) { + if (!signedData) { + // failed to sign + // perhaps user denied permissions + } else { + // successfully signed + typeof signedData; // "string", signed data + typeof username; // "string", user who signed + typeof host; // "string", host of your webpage + // all of these fields must be passed to the + // verification service to be successful + } +}); + +kik.anonymousSign("my data", function (signedData, anonToken, host) { + if (!signedData) { + // failed to sign + } else { + // successfully signed + typeof signedData; // "string", signed data + typeof anonToken; // "string", anonymous user who signed + typeof host; // "string", host of your webpage + } +}); + +kik.send({ + title : "Message title" , + text : "Message body" , + pic : "http://mysite.com/pic" , // optional + big : true , // optional + noForward : true , // optional + data : { some : "json" } // optional +}); + +kik.send("myFriend", { + title : "Message title" , + text : "Message body" , +}); + +if (kik.message) { + // your webpage was launched from a message + // kik.message is exactly what was provided in kik.send + // in this case: { some "json" } +} + +kik.openConversation("kikteam"); + +kik.metrics.enableGoogleAnalytics("id", "mydomain.com"); +kik.metrics.enableGoogleAnalytics(); +kik.showProfile("kikteam"); + +kik.pickUsers(function (users) { + if (!users) { + // action was cancelled by user + } else { + users.forEach(function (user) { + typeof user.username; // "string" + typeof user.fullName; // "string" + typeof user.firstName; // "string" + typeof user.lastName; // "string" + typeof user.pic; // "string" + typeof user.thumbnail; // "string" + }); + } +}); + +kik.pickUsers({ + minResults : 2 , // number >= 0 + maxResults : 4 // number > 0 +}, function (users) { + // do something with data +}); + +kik.pickUsers({ + preselected : [ + { username : "foo" /*, etc */ }, + // any user object obtained from previous call to pickUsers + ] +}, function (users) { + // do something with data +}); + +kik.pickUsers({ + filterSelf: false +}, function (users) { + // do something with data +}); + +kik.photo.get(function (photos) { + if (!photos) { + // action cancelled by user + } else { + // photos is a list of data URLs + } +}); + +kik.photo.get({ + quality : 0.7 , // number between 0-1 + minResults : 2 , // number between 1-25 + maxResults : 25 , // number between 1-25 + maxHeight : 1280 , // number in pixels between 0-1280 + maxWidth : 1280 , // number in pixels between 0-1280 +}, function (photos) { + // do something with the photos +}); + +kik.photo.getFromCamera({ + onSelect : function (numPhotos) { + // called immediately after the user has selected photos + // "numPhotos" is the number of photos selected by the user + // that many "onPhoto" events will be fired after this + // "onComplete" will fire after all "onPhoto" events are done + }, + onPhoto : function (photo, index) { + // "photo" is a data URL representing a single image + // "photo" may be null if there was an error in processing + // this will be called once for each image when it is ready + // "index" is an integer relating to the order of selection + // event may not come in order so use index if you care + }, + onComplete : function (photos) { + // "photos" is list of all photos from all photo events + // this event is identical to normal callback + }, + onCancel : function () { + // the action was cancelled by the user + // no other events will be called + } +}); + +kik.photo.get({ + quality : 0.7 , // number between 0-1 + minResults : 2 , // number between 1-25 + maxResults : 25 , // number between 1-25 + maxHeight : 1280 , // number in pixels between 0-1280 + maxWidth : 1280 , // number in pixels between 0-1280 +}, function (photos) { + // do something with the photos +}); + +kik.photo.getFromCamera({ + onSelect : function (numPhotos) { + // called immediately after the user has selected photos + // 'numPhotos' is the number of photos selected by the user + // that many 'onPhoto' events will be fired after this + // 'onComplete' will fire after all 'onPhoto' events are done + }, + onPhoto : function (photo, index) { + // 'photo' is a data URL representing a single image + // 'photo' may be null if there was an error in processing + // this will be called once for each image when it is ready + // 'index' is an integer relating to the order of selection + // event may not come in order so use index if you care + }, + onComplete : function (photos) { + // 'photos' is list of all photos from all photo events + // this event is identical to normal callback + }, + onCancel : function () { + // the action was cancelled by the user + // no other events will be called + } +}); + +kik.photo.getFromGallery(function (photos) { + // do something with the photos +}); + +kik.photo.saveToGallery("url", function (status) { + if (status) { + // save succeeded + } else { + // save failed + } +}); + +kik.picker( + "http://othersite.com/", + { arbitrary : "request data" }, + function (response) { + // do something with the picked data! + } +); + +if (kik.picker.reply) { + // webpage was launched in "picker mode" + // kik.picker.url === the url of the calling webpage + // kik.picker.data === { arbitrary : "request data" } + kik.picker.reply({ arbitrary : "response data" }); +} + +kik.ready(function () { + // expensive task that should not block loading +}); + +function handleBackButton () { + // called when back button is pressed + return false; // optionally cancel default behavior +} + +kik.browser.back(handleBackButton); // handle back button +kik.browser.unbindBack(handleBackButton); // unbind from handling back button + +kik.open("http://www.google.com/"); +kik.open("https://pop.kik.com/"); +kik.open("twitter://post"); + +kik.open("http://mysite.com/", true); // opens in popup mode + +kik.open("https://thirdparty.com/auth/page/path", true); + +kik.open("http://mysite.com/#response-data"); + +kik.linkData; // "response-data" + +kik.on("linkData", function () { + kik.linkData; // "response-data" +}); + +if (kik.browser.background) { + // the webpage is in the background +} + +kik.browser.on("background", function () { + // the webpage is now in the background +}); +kik.browser.on("foreground", function () { + // the webpage has returned to the foreground +}); + +// lock the orientation in landscape mode +kik.browser.setOrientationLock("landscape"); + +// unlock the orientation +kik.browser.setOrientationLock("free"); + +kik.browser.statusBar(false); // hide status bar +kik.browser.statusBar(true); // show status bar + +kik.formHelpers.show(); // show helpers +kik.formHelpers.hide(); // hide helpers +kik.formHelpers.isEnabled(); // check if enabled + +// backlight will not turn off as long +// as your webpage is visible to the user +kik.browser.backlightTimeout(false); + +// backlight will timeout as per OS rules +kik.browser.backlightTimeout(true); + +function eventHandler () { + // do something when event occurs +} + +// bind to event +kik.on("message", eventHandler); + +// unbind from event +kik.off("message", eventHandler); + +// bind to an event once (ignoring subsequent occurrences) +kik.once("message", eventHandler); + +kik.trigger("message", { + title : "Fake message" , + // object will be passed to all event listeners +}); + +let os = kik.utils.platform.os; +typeof os.name === "string"; // "ios", "android", "osx", "windows", etc +typeof os.version === "number"; // numeric version number + +let browser = kik.utils.platform.browser; +typeof browser.name === "string"; // "chrome", "safari", "opera", etc +typeof browser.version === "number"; // numeric version number + +let version = kik.utils.platform.version; +typeof browser.name === "string"; +typeof browser.version === "number"; // numeric version number \ No newline at end of file diff --git a/kik-browser/kik-browser.d.ts b/kik-browser/kik-browser.d.ts new file mode 100644 index 0000000000..3e183b0e21 --- /dev/null +++ b/kik-browser/kik-browser.d.ts @@ -0,0 +1,135 @@ +// Type definitions for Kik Cards v2.3.6 +// Project: https://dev.kik.com +// Definitions by: Joel Day +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface Kik { + enabled: boolean; + message: KikMessage; + + send(user: string, message: KikMessage): void; + send(message: KikMessage): void; + ready(callback: () => void): void; + hasPermission(): boolean; + open(url: string, popupMode?: boolean): void; + on(property: string, eventHandler: () => void): void; + off(property: string, eventHandler: () => void): void; + once(property: string, eventHandler: () => void): void; + trigger(property: string, data?: any): void; + linkData: string; + getUser(callback: (user: KikUser) => void): void; + getAnonymousUser(callback: (token: string) => void): void; + sign(data: string, callback: (signedData: string, username: string, host: string) => void): void; + anonymousSign(data: string, callback: (signedData: string, anonToken: string, host: string) => void): void; + openConversation(username: string): void; + showProfile(username: string): void; + pickUsers(options: KikPickUsersOptions, callback: (users: KikUser[]) => void): void; + pickUsers(callback: (users: KikUser[]) => void): void; + + formHelpers: { + show(): void; + hide(): void; + isEnabled(): boolean; + }; + + metrics: { + enableGoogleAnalytics(): void; + enableGoogleAnalytics(trackingId: string, domain: string, oldApi?: boolean): void; + }; + + photo: { + get(options: KikGetOptions, callback: (photos: string[]) => void): void; + getFromCamera(callbacks: KikGetFromCameraCallbacks): void; + getFromCamera(options: KikGetFromCameraOptions, callbacks: KikGetFromCameraCallbacks): void; + getFromGallery(callback: (photos: string[]) => void): void; + getFromGallery(options: KikGetOptions, callback: (photos: string[]) => void): void; + saveToGallery(url: string, callback: (status: boolean) => void): void; + get(callback: (photos: string[]) => void): void; + }; + + picker: { + (url: string, data: any, callback: (response: any) => void): void; + reply: (data: any) => void; + }; + + browser: { + background: boolean; + back(callback: () => boolean | void): void; + unbindBack(callback: () => boolean | void): void; + on(property: string, callback: () => void): void; + off(property: string, callback: () => void): void; + once(property: string, callback: () => void): void; + trigger(property: string, data?: any): void; + getOrientationLock(): string; + setOrientationLock(lock: "free" | "landscape" | "portrait"): void; + setOrientationLock(lock: string): void; + statusBar(show: boolean): void; + backlightTimeout(timeout: boolean): void; + }; + + utils: { + platform: { + os: { + name: string; + version: string; + }; + browser: { + name: string; + version: string; + }; + version: { + name: string; + version: string; + }; + }; + }; +} + +interface KikUser { + username: string; + fullName: string; + firstName: string; + lastName: string; + pic: string; + thumbnail: string; +} + +interface KikMessage { + title: string; + text: string; + pic?: string; + big?: boolean; + noForward?: boolean; + data?: any; +} + +interface KikPickUsersOptions { + minResults?: number; + maxResults?: number; + preselected?: { username: string }[]; + filtered?: string[]; + filterSelf?: boolean; +} + +interface KikGetOptions { + quality?: number; + minResults?: number; + maxResults?: number; + maxHeight?: number; + maxWidth?: number; +} + +interface KikGetFromCameraOptions { + quality?: number; + maxHeight?: number; + maxWidth?: number; +} + +interface KikGetFromCameraCallbacks { + onSelect: (numPhotos: number) => void; + onPhoto: (photo: string, index: number) => void; + onComplete: (photos: string[]) => void; + onCancel: () => void; +} + +declare const kik: Kik; \ No newline at end of file diff --git a/knex/knex-tests.ts b/knex/knex-tests.ts index e983ec1084..e894a6be47 100644 --- a/knex/knex-tests.ts +++ b/knex/knex-tests.ts @@ -1,8 +1,10 @@ /// + /// -import Knex = require('knex'); -import _ = require('lodash'); -'use strict'; + +import * as Knex from 'knex'; +import * as _ from 'lodash'; + // Initializing the Library var knex = Knex({ client: 'sqlite3', @@ -55,6 +57,19 @@ var knex = Knex({ } }); +// acquireConnectionTimeout +var knex = Knex({ + debug: true, + client: 'mysql', + connection: { + socketPath : '/path/to/socket.sock', + user : 'your_database_user', + password : 'your_database_password', + database : 'myapp_test' + }, + acquireConnectionTimeout: 60000, +}); + // Pure Query Builder without a connection var knex = Knex({}); @@ -63,6 +78,18 @@ var knex = Knex({ client: 'pg' }); +// searchPath +var knex = Knex({ + client: 'pg', + searchPath: 'public', +}); + +// useNullAsDefault +var knex = Knex({ + client: 'sqlite', + useNullAsDefault: true, +}); + knex('books').insert({title: 'Test'}).returning('*').toString(); // Migrations @@ -154,12 +181,18 @@ knex('users') .join('contacts', 'users.id', 'contacts.user_id') .select('users.id', 'contacts.phone'); +knex('users') + .join(knex('contacts').select('user_id', 'phone').as('contacts'), 'users.id', 'contacts.user_id') + .select('users.id', 'contacts.phone'); + knex.select('*').from('users').join('accounts', function() { this.on('accounts.id', '=', 'users.account_id').orOn('accounts.owner_id', '=', 'users.id') }); knex.select('*').from('users').join('accounts', 'accounts.type', knex.raw('?', ['admin'])); +knex.raw('select * from users where id = :user_id', { user_id: 1 }); + knex.from('users').innerJoin('accounts', 'users.id', 'accounts.user_id'); knex.table('users').innerJoin('accounts', 'users.id', '=', 'accounts.user_id'); @@ -347,6 +380,8 @@ knex.transaction(function(trx) { // Using trx as a transaction object: knex.transaction(function(trx) { + + trx.raw('') var info: any; var books: any[] = [ @@ -594,8 +629,8 @@ knex.migrate.latest(); knex.migrate.rollback(config); knex.migrate.rollback(); -knex.migrate.currentversion(config); -knex.migrate.currentversion(); +knex.migrate.currentVersion(config); +knex.migrate.currentVersion(); knex.seed.make(name, config); knex.seed.make(name); diff --git a/knex/knex.d.ts b/knex/knex.d.ts index 52740662c8..75c9f67a43 100644 --- a/knex/knex.d.ts +++ b/knex/knex.d.ts @@ -3,17 +3,18 @@ // Definitions by: Qubo // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// +/// /// declare module "knex" { - // import Promise = require("bluebird"); + import Promise = require("bluebird"); import * as events from "events"; type Callback = Function; type Client = Function; - type Value = string|number|boolean|Date; + type Value = string|number|boolean|Date|Array|Array|Array|Array; type ColumnName = string|Knex.Raw|Knex.QueryBuilder; + type TableName = string|Knex.Raw|Knex.QueryBuilder; interface Knex extends Knex.QueryInterface { (tableName?: string): Knex.QueryBuilder; @@ -28,9 +29,10 @@ declare module "knex" { schema: Knex.SchemaBuilder; client: any; - migrate: any; + migrate: Knex.Migrator; seed: any; fn: any; + on(eventName: string, callback: Function): Knex.QueryBuilder; } function Knex(config: Knex.Config) : Knex; @@ -66,10 +68,14 @@ declare module "knex" { where: Where; andWhere: Where; orWhere: Where; + whereNot: Where; + andWhereNot: Where; + orWhereNot: Where; whereRaw: WhereRaw; + orWhereRaw: WhereRaw; + andWhereRaw: WhereRaw; whereWrapped: WhereWrapped; havingWrapped: WhereWrapped; - orWhereRaw: WhereRaw; whereExists: WhereExists; orWhereExists: WhereExists; whereNotExists: WhereExists; @@ -83,9 +89,11 @@ declare module "knex" { whereNotNull: WhereNull; orWhereNotNull: WhereNull; whereBetween: WhereBetween; - whereNotBetween: WhereBetween; orWhereBetween: WhereBetween; + andWhereBetween: WhereBetween; + whereNotBetween: WhereBetween; orWhereNotBetween: WhereBetween; + andWhereNotBetween: WhereBetween; // Group by groupBy: GroupBy; @@ -101,6 +109,7 @@ declare module "knex" { // Having having: Having; + andHaving: Having; havingRaw: RawQueryBuilder; orHaving: Having; orHavingRaw: RawQueryBuilder; @@ -127,7 +136,7 @@ declare module "knex" { insert(data: any, returning?: string | string[]): QueryBuilder; update(data: any, returning?: string | string[]): QueryBuilder; update(columnName: string, value: Value, returning?: string | string[]): QueryBuilder; - returning(column: string): QueryBuilder; + returning(column: string | string[]): QueryBuilder; del(returning?: string | string[]): QueryBuilder; delete(returning?: string | string[]): QueryBuilder; @@ -156,10 +165,35 @@ declare module "knex" { interface Join { (raw: Raw): QueryBuilder; - (tableName: string, callback: Function): QueryBuilder; - (tableName: string, column1: string, column2: string): QueryBuilder; - (tableName: string, column1: string, raw: Raw): QueryBuilder; - (tableName: string, column1: string, operator: string, column2: string): QueryBuilder; + (tableName: TableName, callback: (joinClause: JoinClause) => any): QueryBuilder; + (tableName: TableName, columns: {[key: string]: string|Raw}): QueryBuilder; + (tableName: TableName, raw: Raw): QueryBuilder; + (tableName: TableName, column1: string, column2: string): QueryBuilder; + (tableName: TableName, column1: string, raw: Raw): QueryBuilder; + (tableName: TableName, column1: string, operator: string, column2: string): QueryBuilder; + } + + interface JoinClause { + on(raw: Raw): JoinClause; + on(callback: Function): JoinClause; + on(columns: {[key: string]: string|Raw}): JoinClause; + on(column1: string, column2: string): JoinClause; + on(column1: string, raw: Raw): JoinClause; + on(column1: string, operator: string, column2: string): JoinClause; + andOn(raw: Raw): JoinClause; + andOn(callback: Function): JoinClause; + andOn(columns: {[key: string]: string|Raw}): JoinClause; + andOn(column1: string, column2: string): JoinClause; + andOn(column1: string, raw: Raw): JoinClause; + andOn(column1: string, operator: string, column2: string): JoinClause; + orOn(raw: Raw): JoinClause; + orOn(callback: Function): JoinClause; + orOn(columns: {[key: string]: string|Raw}): JoinClause; + orOn(column1: string, column2: string): JoinClause; + orOn(column1: string, raw: Raw): JoinClause; + orOn(column1: string, operator: string, column2: string): JoinClause; + using(column: string|string[]|Raw|{[key: string]: string|Raw}): JoinClause; + type(type: string): JoinClause; } interface JoinRaw { @@ -167,6 +201,8 @@ declare module "knex" { } interface Where extends WhereRaw, WhereWrapped, WhereNull { + (raw: Raw): QueryBuilder; + (callback: (queryBuilder: QueryBuilder) => any): QueryBuilder; (object: Object): QueryBuilder; (columnName: string, value: Value): QueryBuilder; (columnName: string, operator: string, value: Value): QueryBuilder; @@ -249,6 +285,7 @@ declare module "knex" { (value: Value): Raw; (sql: string, ...bindings: Value[]): Raw; (sql: string, bindings: Value[]): Raw; + (sql: string, bindings: Object): Raw; } // @@ -293,16 +330,18 @@ declare module "knex" { interface Transaction extends QueryBuilder { commit: any; rollback: any; + raw: Knex.RawBuilder; } // // Schema builder // - interface SchemaBuilder { - createTable(tableName: string, callback: (tableBuilder: CreateTableBuilder) => any): Promise; + interface SchemaBuilder extends Promise { + createTable(tableName: string, callback: (tableBuilder: CreateTableBuilder) => any): SchemaBuilder; + createTableIfNotExists(tableName: string, callback: (tableBuilder: CreateTableBuilder) => any): SchemaBuilder; renameTable(oldTableName: string, newTableName: string): Promise; - dropTable(tableName: string): Promise; + dropTable(tableName: string): SchemaBuilder; hasTable(tableName: string): Promise; hasColumn(tableName: string, columnName: string): Promise; table(tableName: string, callback: (tableBuilder: AlterTableBuilder) => any): Promise; @@ -312,6 +351,7 @@ declare module "knex" { interface TableBuilder { increments(columnName?: string): ColumnBuilder; + bigIncrements(columnName?: string): ColumnBuilder; dropColumn(columnName: string): TableBuilder; dropColumns(...columnNames: string[]): TableBuilder; renameColumn(from: string, to: string): ColumnBuilder; @@ -331,6 +371,7 @@ declare module "knex" { enum(columnName: string, values: Value[]): ColumnBuilder; enu(columnName: string, values: Value[]): ColumnBuilder; json(columnName: string): ColumnBuilder; + jsonb(columnName: string): ColumnBuilder; uuid(columnName: string): ColumnBuilder; comment(val: string): TableBuilder; specificType(columnName: string, type: string): ColumnBuilder; @@ -339,6 +380,7 @@ declare module "knex" { unique(columnNames: string[], indexName?: string) : TableBuilder; foreign(column: string): ForeignConstraintBuilder; foreign(columns: string[]): MultikeyForeignConstraintBuilder; + dropForeign(columnNames: string[], foreignKeyName?: string): TableBuilder; } interface CreateTableBuilder extends TableBuilder { @@ -369,15 +411,15 @@ declare module "knex" { nullable(): ColumnBuilder; comment(value: string): ColumnBuilder; } - + interface ForeignConstraintBuilder { references(columnName: string): ReferencingColumnBuilder; } - + interface MultikeyForeignConstraintBuilder { references(columnNames: string[]): ReferencingColumnBuilder; } - + interface PostgreSqlColumnBuilder extends ColumnBuilder { index(indexName?: string, indexType?: string): ColumnBuilder; } @@ -412,7 +454,10 @@ declare module "knex" { connection?: string|ConnectionConfig|MariaSqlConnectionConfig| Sqlite3ConnectionConfig|SocketConnectionConfig; pool?: PoolConfig; - migrations?: MigrationConfig; + migrations?: MigratorConfig; + acquireConnectionTimeout?: number; + useNullAsDefault?: boolean; + searchPath?: string; } interface ConnectionConfig { @@ -486,12 +531,20 @@ declare module "knex" { log?: boolean; } - interface MigrationConfig { + interface MigratorConfig { database?: string; directory?: string; extension?: string; tableName?: string; } + + interface Migrator { + make(name:string, config?: MigratorConfig):Promise; + latest(config?: MigratorConfig):Promise; + rollback(config?: MigratorConfig):Promise; + status(config?: MigratorConfig):Promise; + currentVersion(config?: MigratorConfig):Promise; + } } export = Knex; diff --git a/knockout.deferred.updates/knockout.deferred.updates-tests.ts b/knockout.deferred.updates/knockout.deferred.updates-tests.ts deleted file mode 100644 index 060ff3984a..0000000000 --- a/knockout.deferred.updates/knockout.deferred.updates-tests.ts +++ /dev/null @@ -1,252 +0,0 @@ -/// - -// Turn *off* deferred updates for computed observables and subscriptions -ko.computed.deferUpdates = false; - -var myComputed = ko.computed(() => { /* ... */ }); -// Turn *on* deferred updates for this computed observable -myComputed.deferUpdates = true; - -var myObservable = ko.observable(); -var mySubscription = myObservable.subscribe((value) => { /* ... */ }); -// Turn *on* deferred updates for this subscription -mySubscription.deferUpdates = true; - -// Turn *off* deferred updates for this computed observable -myComputed.extend({ deferred: false }); - - -// -// Examples -// - -function nestedComputedNoPlugin() { - var vm: any = { - a: ko.observable(0), - b: ko.observable(0), - c: ko.observable(0), - d: ko.observable(0), - e: ko.observable(0), - f: ko.observable(0) - }; - - var startTime = new Date().getTime(); - var updateArray = []; - - function firstUpdate() { - var updateList = document.getElementById('updates'); - while (updateList.firstChild) updateList.removeChild(updateList.firstChild); - } - - function pushUpdate(name, value, color) { - var li = document.createElement('li'); - li.appendChild(document.createTextNode(name + ' ' + value + '; ' + (new Date().getTime() - startTime) + ' ms')); - li.style.color = color; - document.getElementById('updates').appendChild(li); - } - - function lastUpdate() { - } - - var updateCounter = 0, plusminus = 1; - - vm.doUpdate = function () { - var u = updateCounter += plusminus; - startTime = new Date().getTime(); - vm.a(u); - vm.b(u); - vm.c(u); - vm.d(u); - vm.e(u); - vm.f(u); - plusminus = !u ? 1 : (u == 9) ? -1 : plusminus; - }; - - vm.setThrottle = function (value) { - vm.A.throttleEvaluation = value; - vm._B.throttleEvaluation = value; - vm.C.throttleEvaluation = value; - vm.D.throttleEvaluation = value; - vm.E.throttleEvaluation = value; - vm.F.throttleEvaluation = value; - }; - - vm.runNormal = function () { - ko.computed.deferUpdates = false; - vm.setThrottle(undefined); - vm.doUpdate(); - }; - - vm.runThrottle = function () { - ko.computed.deferUpdates = false; - vm.setThrottle(1); - vm.doUpdate(); - }; - - vm.A = ko.computed(function () { - var result = '' + vm.a(); - firstUpdate(); - pushUpdate('A', result, 'green'); - return result; - }, null, { deferEvaluation: true }); - - vm._B = ko.computed(function () { - var result = '' + vm.A() + vm.b(); - pushUpdate('B', result, 'darkturquoise'); - return result; - }, null, { deferEvaluation: true }); - - vm.C = ko.computed(function () { - var result = '' + vm._B() + vm.c(); - pushUpdate('C', result, 'royalblue'); - return result; - }, null, { deferEvaluation: true }); - - vm.D = ko.computed(function () { - var result = '' + vm.C() + vm.d(); - pushUpdate('D', result, 'indigo'); - return result; - }, null, { deferEvaluation: true }); - - vm.E = ko.computed(function () { - var result = '' + vm.D() + vm.e(); - pushUpdate('E', result, 'firebrick'); - return result; - }, null, { deferEvaluation: true }); - - vm.F = ko.computed(function () { - var f = vm.f(), result = '' + vm.E() + f; - pushUpdate('F', result, 'orangered'); - if (result === '' + f + f + f + f + f + f) lastUpdate(); - return result; - }, null, { deferEvaluation: true }); - - vm.A(); - vm._B(); - vm.C(); - vm.D(); - vm.E(); - vm.F(); - - ko.applyBindings(vm); -}; - -function nestedComputedPlugin() { - var vm: any = { - a: ko.observable(0), - b: ko.observable(0), - c: ko.observable(0), - d: ko.observable(0), - e: ko.observable(0), - f: ko.observable(0) - }; - - var startTime = new Date().getTime(); - var updateArray = []; - - function firstUpdate() { - var updateList = document.getElementById('updates'); - while (updateList.firstChild) - updateList.removeChild(updateList.firstChild); - } - - function pushUpdate(name, value, color) { - var li = document.createElement('li'); - li.appendChild(document.createTextNode(name + ' ' + value + '; ' + (new Date().getTime() - startTime) + ' ms')); - li.style.color = color; - document.getElementById('updates').appendChild(li); - } - - function lastUpdate() { - } - - var updateCounter = 0, plusminus = 1; - - vm.doUpdate = function () { - var u = updateCounter += plusminus; - startTime = new Date().getTime(); - vm.a(u); - vm.b(u); - vm.c(u); - vm.d(u); - vm.e(u); - vm.f(u); - plusminus = !u ? 1 : (u == 9) ? -1 : plusminus; - }; - - vm.setThrottle = function (value) { - vm.A.throttleEvaluation = value; - vm._B.throttleEvaluation = value; - vm.C.throttleEvaluation = value; - vm.D.throttleEvaluation = value; - vm.E.throttleEvaluation = value; - vm.F.throttleEvaluation = value; - }; - - vm.runNormal = function () { - ko.computed.deferUpdates = false; - vm.setThrottle(undefined); - vm.doUpdate(); - }; - - vm.runThrottle = function () { - ko.computed.deferUpdates = false; - vm.setThrottle(1); - vm.doUpdate(); - }; - - vm.runDefer = function () { - ko.computed.deferUpdates = true; - vm.setThrottle(undefined); - vm.doUpdate(); - }; - - vm.runWrappedDefer = ko.tasks.makeProcessedCallback(vm.runDefer); - - vm.A = ko.computed(function () { - var result = '' + vm.a(); - firstUpdate(); - pushUpdate('A', result, 'green'); - return result; - }, null, { deferEvaluation: true }); - - vm._B = ko.computed(function () { - var result = '' + vm.A() + vm.b(); - pushUpdate('B', result, 'darkturquoise'); - return result; - }, null, { deferEvaluation: true }); - - vm.C = ko.computed(function () { - var result = '' + vm._B() + vm.c(); - pushUpdate('C', result, 'royalblue'); - return result; - }, null, { deferEvaluation: true }); - - vm.D = ko.computed(function () { - var result = '' + vm.C() + vm.d(); - pushUpdate('D', result, 'indigo'); - return result; - }, null, { deferEvaluation: true }); - - vm.E = ko.computed(function () { - var result = '' + vm.D() + vm.e(); - pushUpdate('E', result, 'firebrick'); - return result; - }, null, { deferEvaluation: true }); - - vm.F = ko.computed(function () { - var f = vm.f(), result = '' + vm.E() + f; - pushUpdate('F', result, 'orangered'); - if (result === '' + f + f + f + f + f + f) lastUpdate(); - return result; - }, null, { deferEvaluation: true }); - - vm.A(); - vm._B(); - vm.C(); - vm.D(); - vm.E(); - vm.F(); - - ko.applyBindings(vm); -} diff --git a/knockout.deferred.updates/knockout.deferred.updates-tests.ts.tscparams b/knockout.deferred.updates/knockout.deferred.updates-tests.ts.tscparams deleted file mode 100644 index 8b13789179..0000000000 --- a/knockout.deferred.updates/knockout.deferred.updates-tests.ts.tscparams +++ /dev/null @@ -1 +0,0 @@ - diff --git a/knockout.deferred.updates/knockout.deferred.updates.d.ts b/knockout.deferred.updates/knockout.deferred.updates.d.ts deleted file mode 100644 index d3c5d7b40d..0000000000 --- a/knockout.deferred.updates/knockout.deferred.updates.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -// Type definitions for Knockout Deferred Updates -// Project: https://github.com/mbest/knockout-deferred-updates -// Definitions by: Sebastián Galiano -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -interface KnockoutDeferredTasks { - processImmediate(evaluator: Function, object?: any, args?: any[]): any; - processDelayed(evaluator: Function, distinct?: boolean, options?: any[]): boolean; - makeProcessedCallback(evaluator: Function): void; -} - -// Knockout global -interface KnockoutStatic { - tasks: KnockoutDeferredTasks; - processAllDeferredBindingUpdates(): void; - processAllDeferredUpdates(): void; - evaluateAsynchronously(evaluator: Function, timeout?: any): number; - ignoreDependencies(callback: Function, callbackTarget: any, callbackArgs?: any[]); -} - -// Observables -interface KnockoutSubscribableFunctions { - deferUpdates: boolean; -} - -// Computed -interface KnockoutComputedStatic { - deferUpdates: boolean; -} - -interface KnockoutSubscription { - deferUpdates: boolean; -} - -// Utils -interface KnockoutUtils { - objectForEach(obj: any, action: Function): void; - objectMap(source: any, mapping: Function): any; -} - -// Deferred extender -interface KnockoutExtenders { - deferred(target: any, value: boolean): any; -} \ No newline at end of file diff --git a/knockout.deferred.updates/knockout.deferred.updates.d.ts.tscparams b/knockout.deferred.updates/knockout.deferred.updates.d.ts.tscparams deleted file mode 100644 index 8b13789179..0000000000 --- a/knockout.deferred.updates/knockout.deferred.updates.d.ts.tscparams +++ /dev/null @@ -1 +0,0 @@ - diff --git a/knockout.es5/knockout.es5.d.ts b/knockout.es5/knockout.es5.d.ts index 06309059ef..10e0054bf6 100644 --- a/knockout.es5/knockout.es5.d.ts +++ b/knockout.es5/knockout.es5.d.ts @@ -6,10 +6,10 @@ /// interface KnockoutStatic { - track(obj: any, propertyNames?: Array): any; - untrack(obj: any, propertyNames?: Array): any; - defineProperty(obj: any, propertyName: string, evaluator: Function): any; - defineProperty(obj: any, propertyName: string, options: KnockoutDefinePropertyOptions): any; + track(obj: T, propertyNames?: Array): T; + untrack(obj: any, propertyNames?: Array): void; + defineProperty(obj: T, propertyName: string, evaluator: Function): T; + defineProperty(obj: T, propertyName: string, options: KnockoutDefinePropertyOptions): T; getObservable(obj: any, propertyName: string): KnockoutObservable; valueHasMutated(obj: any, propertyName: string): void; } diff --git a/knockout.kogrid/ko-grid.d.ts b/knockout.kogrid/ko-grid.d.ts index cc10fa4d9e..a8f3984acf 100644 --- a/knockout.kogrid/ko-grid.d.ts +++ b/knockout.kogrid/ko-grid.d.ts @@ -6,188 +6,274 @@ // These are very definitely preliminary. Please feel free to improve. /// +/// declare namespace kg { - export interface DomUtilityService { - UpdateGridLayout(grid: Grid): void; - BuildStyles(grid: Grid): void; - } + interface DomUtilityService { + UpdateGridLayout(grid: Grid): void; + BuildStyles(grid: Grid): void; + } - var domUtilityService: DomUtilityService; + interface Row { + selected: KnockoutObservable; + entity: EntityType; + } - export interface Row { - selected: KnockoutObservable; - entity: EntityType; - } + interface RowFactory { + rowCache: Row[]; + } - export interface RowFactory { - rowCache: Row[]; - } + interface SelectionService { + setSelection(row: Row, selected: boolean): void; + multi: boolean; + lastClickedRow: Row; + } - export interface SelectionService { - setSelection(row: Row, selected: boolean): void; - multi: boolean; - lastClickedRow: Row; - } + interface Grid { + configureColumnWidths(): void; + rowFactory: RowFactory; + config: GridOptions; + $$selectionPhase: boolean; + selectionService: SelectionService; + } - export interface Grid { - configureColumnWidths(): void; - rowFactory: RowFactory; - config: GridOptions; - $$selectionPhase: boolean; - selectionService: SelectionService; - } + interface Plugin { + onGridInit(grid: Grid): void; + } - export interface Plugin { - onGridInit(grid: Grid): void; - } + interface GridOptions { + /** Callback for when you want to validate something after selection. */ + afterSelectionChange?(row: Row): void; - export interface GridOptions { - /** Callback for when you want to validate something after selection. */ - afterSelectionChange?(row: Row): void; + /** Callback if you want to inspect something before selection, + return false if you want to cancel the selection. return true otherwise. + If you need to wait for an async call to proceed with selection you can + use rowItem.changeSelection(event) method after returning false initially. + Note: when shift+ Selecting multiple items in the grid this will only get called + once and the rowItem will be an array of items that are queued to be selected. */ + beforeSelectionChange?(row: Row): boolean; - /** Callback if you want to inspect something before selection, - return false if you want to cancel the selection. return true otherwise. - If you need to wait for an async call to proceed with selection you can - use rowItem.changeSelection(event) method after returning false initially. - Note: when shift+ Selecting multiple items in the grid this will only get called - once and the rowItem will be an array of items that are queued to be selected. */ - beforeSelectionChange?: Function; + /** To be able to have selectable rows in grid. */ + canSelectRows?:boolean; - /** definitions of columns as an array [], if not defined columns are auto-generated. See github wiki for more details. */ - columnDefs?: ColumnDef[]; + /** definitions of columns as an array [], if not defined columns are auto-generated. See github wiki for more details. */ + columnDefs?: ColumnDef[] | KnockoutObservable; - /** Column width of columns in grid. */ - columnWidth?: number; + /** Column width of columns in grid. */ + columnWidth?: number; - /** Data being displayed in the grid. Each item in the array is mapped to a row being displayed. */ - data?: KnockoutObservableArray; + /** Data being displayed in the grid. Each item in the array is mapped to a row being displayed. */ + data?: KnockoutObservableArray; - /** Row selection check boxes appear as the first column. */ - displaySelectionCheckbox: boolean; + /** Row selection check boxes appear as the first column. */ + displaySelectionCheckbox: boolean; - /** Enable or disable resizing of columns */ - enableColumnResize?: boolean; + /** Enable or disable resizing of columns */ + enableColumnResize?: boolean; - /** Enables the server-side paging feature */ - enablePaging?: boolean; + /** Enables the server-side paging feature */ + enablePaging?: boolean; - /** Enable column pinning */ - enablePinning?: boolean; + /** Enable drag and drop row reordering. Only works in HTML5 compliant browsers. */ + enableRowReordering?: boolean; - /** Enable drag and drop row reordering. Only works in HTML5 compliant browsers. */ - enableRowReordering?: boolean; + /** Enables or disables sorting in grid. */ + enableSorting?: boolean; - /** To be able to have selectable rows in grid. */ - enableRowSelection?: boolean; + /** filterOptions - + filterText: The text bound to the built-in search box. + useExternalFilter: Bypass internal filtering if you want to roll your own filtering mechanism but want to use builtin search box. + */ + filterOptions?: FilterOptions; - /** Enables or disables sorting in grid. */ - enableSorting?: boolean; + /** Defining the height of the footer in pixels. */ + footerRowHeight?: number; - /** filterOptions - - filterText: The text bound to the built-in search box. - useExternalFilter: Bypass internal filtering if you want to roll your own filtering mechanism but want to use builtin search box. - */ - filterOptions?: FilterOptions; + /** Show or hide the footer alltogether the footer is enabled by default */ + footerVisible?: boolean; - /** Defining the height of the footer in pixels. */ - footerRowHeight?: number; + /** Initial fields to group data by. Array of field names, not displayName. */ + groups?: string[]; - /** Show or hide the footer alltogether the footer is enabled by default */ - footerVisible?: boolean; + /** The height of the header row in pixels. */ + headerRowHeight?: number; - /** Initial fields to group data by. Array of field names, not displayName. */ - groups?: string[]; + /** Define a header row template for further customization. See github wiki for more details. */ + headerRowTemplate?: string | JQueryGenericPromise; - /** The height of the header row in pixels. */ - headerRowHeight?: number; + /** Enables the use of jquery UI reaggable/droppable plugin. requires jqueryUI to work if enabled. + Useful if you want drag + drop but your users insist on crappy browsers. */ + jqueryUIDraggable?: boolean; - /** Define a header row template for further customization. See github wiki for more details. */ - headerRowTemplate?: any; + /** Enable the use jqueryUIThemes */ + jqueryUITheme?: boolean; - /** Enables the use of jquery UI reaggable/droppable plugin. requires jqueryUI to work if enabled. - Useful if you want drag + drop but your users insist on crappy browsers. */ - jqueryUIDraggable?: boolean; + /** Prevent unselections when in single selection mode. */ + keepLastSelected?: boolean; - /** Enable the use jqueryUIThemes */ - jqueryUITheme?: boolean; + /** Maintains the column widths while resizing. + Defaults to true when using *'s or undefined widths. Can be ovverriden by setting to false. */ + maintainColumnRatios?: any; - /** Prevent unselections when in single selection mode. */ - keepLastSelected?: boolean; + /** Set this to false if you only want one item selected at a time */ + multiSelect?: boolean; - /** Maintains the column widths while resizing. - Defaults to true when using *'s or undefined widths. Can be ovverriden by setting to false. */ - maintainColumnRatios?: any; + /** pagingOptions - */ + pagingOptions?: PagingOptions; - /** Set this to false if you only want one item selected at a time */ - multiSelect?: boolean; + /** Array of plugin functions to register in ng-grid */ + plugins?: Plugin[]; - /** pagingOptions - */ - pagingOptions?: PagingOptions; + /** Row height of rows in grid. */ + rowHeight?: number; - /** Array of plugin functions to register in ng-grid */ - plugins?: Plugin[]; + /** Define a row template to customize output. See github wiki for more details. */ + rowTemplate?: string | JQueryGenericPromise; - /** Row height of rows in grid. */ - rowHeight?: number; + /** Defines the binding to select all at once */ + selectAllState?: KnockoutObservable; - /** Define a row template to customize output. See github wiki for more details. */ - rowTemplate?: any; + /** all of the items selected in the grid. In single select mode there will only be one item in the array. */ + selectedItems?: KnockoutObservableArray; - /** all of the items selected in the grid. In single select mode there will only be one item in the array. */ - selectedItems?: KnockoutObservableArray; + /** Disable row selections by clicking on the row and only when the checkbox is clicked. */ + selectWithCheckboxOnly?: boolean; - /** Disable row selections by clicking on the row and only when the checkbox is clicked. */ - selectWithCheckboxOnly?: boolean; + /** Enables menu to choose which columns to display and group by. + If both showColumnMenu and showFilter are false the menu button will not display.*/ + showColumnMenu?: boolean; - /** Enables menu to choose which columns to display and group by. - If both showColumnMenu and showFilter are false the menu button will not display.*/ - showColumnMenu?: boolean; + /** Enables display of the filterbox in the column menu. + If both showColumnMenu and showFilter are false the menu button will not display.*/ + showFilter?: boolean; - /** Enables display of the filterbox in the column menu. - If both showColumnMenu and showFilter are false the menu button will not display.*/ - showFilter?: boolean; + /** Show the dropzone for drag and drop grouping */ + showGroupPanel?: boolean; - /** Show the dropzone for drag and drop grouping */ - showGroupPanel?: boolean; + /** Define a sortInfo object to specify a default sorting state. + You can also observe this variable to utilize server-side sorting (see useExternalSorting). + Syntax is sortinfo: { fields: ['fieldName1',' fieldName2'], direction: 'ASC'/'asc' || 'desc'/'DESC'}*/ + sortInfo?: SortInfo | KnockoutObservable; - /** Define a sortInfo object to specify a default sorting state. - You can also observe this variable to utilize server-side sorting (see useExternalSorting). - Syntax is sortinfo: { fields: ['fieldName1',' fieldName2'], direction: 'ASC'/'asc' || 'desc'/'DESC'}*/ - sortInfo?: any; + /** Set the tab index of the Vieport. */ + tabIndex?: number; - /** Set the tab index of the Vieport. */ - tabIndex?: number; + /** Prevents the internal sorting from executing. + The sortInfo object will be updated with the sorting information so you can handle sorting (see sortInfo)*/ + useExternalSorting?: boolean; + } - /** Prevents the internal sorting from executing. - The sortInfo object will be updated with the sorting information so you can handle sorting (see sortInfo)*/ - useExternalSorting?: boolean; - } + type Direction = "asc" | "desc"; - export interface ColumnDef { - /** The string name of the property in your data model you want that column to represent. Can also be a property path on your data model. 'foo.bar.myField', 'Name.First', etc.. */ - field: string; + interface SortInfo { + /** Which column to sort */ + column: SortColumn; - /** Sets the pretty display name of the column. default is the field given */ - displayName?: string; + /** Which direction to sort */ + direction: Direction; + } + + interface SortColumn { + /** The string name of the property in your data model you want that column to represent. Can also be a property path on your data model. 'foo.bar.myField', 'Name.First', etc.. */ + field: string; - /** Sets the width of the column. Can be a fixed width in pixels as an int (42), string px('42px'), percentage string ('42%'), weighted asterisks (width divided by total number of *'s is all column definition widths) See github wiki for more details. */ - width?: string; - } + /** Sets the sort function for the column. Useful when you have data that is formatted in an unusal way or if you want to sort on an underlying data type. Example: function(a,b){return a > b} */ + sortingAlgorithm?: ((a:any, b:any) => number); + } - export interface FilterOptions { - filterText?: string; - useExternalFilter?: boolean; - } + interface ColumnDef { + /** Appends a css class for the column cells */ + cellClass?:string; - export interface PagingOptions { - /** pageSizes: list of available page sizes. */ - pageSizes?: number[]; - /** pageSize: currently selected page size. */ - pageSize?: number; - /** totalServerItems: Total items are on the server. */ - totalServerItems?: number; - /** currentPage: the uhm... current page. */ - currentPage?: number; - } + /** + * A function which takes the value of the cell and returns the display value. Useful when your data model has an underlying value which you need to convert to a human readable format. + * @param val + * @returns the display value + * @example function(unixTimeTicks) { return new Date(unixTimeTicks); } + */ + cellFormatter?(val:any): string; + + /**Sets the cell template for the column. See github wiki for more details.*/ + cellTemplate?: string | JQueryGenericPromise; + + /** Sets the pretty display name of the column. default is the field given */ + displayName?: string; + + /** The string name of the property in your data model you want that column to represent. Can also be a property path on your data model. 'foo.bar.myField', 'Name.First', etc.. */ + field: string; + + /** Sets the template for the column header cell. See github wiki for more details. */ + headerCellTemplate?: string | JQueryGenericPromise; + + /** Appends a css class for the column header. */ + headerClass?: string; + + /**Sets the maximum width of the column.*/ + maxWidth?: number; + + /**Whether or not column is resizable. */ + resizable?: boolean; + + /**Whether or not column is sortable. */ + sortable?: boolean; + + /** Sets the sort function for the column. Useful when you have data that is formatted in an unusal way or if you want to sort on an underlying data type. Example: function(a,b){return a > b} */ + sortFn?: ((a: any, b: any) => number); + + /** Sets the width of the column. Can be a fixed width in pixels as an int (42), string px('42px'), percentage string ('42%'), weighted asterisks (width divided by total number of *'s is all column definition widths) See github wiki for more details. */ + width?: string; + } + + interface FilterOptions { + /** Variable to contain the current search filter */ + filterText?: KnockoutObservable; + + /** Is the filtering internal or does it require a server visit. You should subscribe to filterText to refresh */ + useExternalFilter?: boolean; + + /** Number of seconds to throttle before reapplying search */ + filterThrottle?: number; + } + + interface PagingOptions { + /** pageSizes: list of available page sizes. */ + pageSizes?: KnockoutObservableArray; + + /** pageSize: currently selected page size. */ + pageSize?: KnockoutObservable; + + /** totalServerItems: Total items are on the server. */ + totalServerItems?: KnockoutObservable; + + /** currentPage: the uhm... current page. */ + currentPage?: KnockoutObservable; + } +} + +interface IKg { + domUtilityService: kg.DomUtilityService; + + /** Default grid template */ + defaultGridTemplate():string; + + /** Default row template. Can be overriden in GridOptions.rowTemplate */ + defaultRowTemplate(): string; + + /** Default cell template. Can be overriden in GridOptions.cellTemplate */ + defaultCellTemplate(): string; + + /** Default aggregate template */ + aggregateTemplate(): string; + + /** Default headerrow template. Can be overriden in GridOptions.headerRowTemplate */ + defaultHeaderRowTemplate(): string; + + /** Default headercell template. Can be overriden in GridOptions.headerCellTemplate */ + defaultHeaderCellTemplate():string; +} + +declare var kg: IKg; + +declare module "kg" { + export = kg; } diff --git a/knockout.punches/knockout.punches-tests.ts b/knockout.punches/knockout.punches-tests.ts index bd5d53a5c5..bec2b1a4ef 100644 --- a/knockout.punches/knockout.punches-tests.ts +++ b/knockout.punches/knockout.punches-tests.ts @@ -2,7 +2,29 @@ function test_enable() { - ko.punches.enableAll(); +} +function test_filters() { + ko.filters.default([], 'Empty'); + ko.filters.default(null, 'Empty'); + ko.filters.default(0, 'Empty'); + ko.filters.default(' ', 'Empty'); + + ko.filters.fit('abcdef0123456789', 10); + ko.filters.fit('abcdef0123456789', 10, '_'); + ko.filters.fit('abcdef0123456789', 10, '_', 'left'); + ko.filters.fit('abcdef0123456789', 10, '_', 'middle'); + ko.filters.fit('abcdef0123456789', 10, '_', 'right'); + + ko.filters.json({}); + ko.filters.json({}, null, 4); + + ko.filters.number('123456789'); + ko.filters.number(12345.6789); + + ko.filters.lowercase('TEST'); + ko.filters.uppercase('test'); + + ko.filters.replace('1234abcd', '1234', ''); } \ No newline at end of file diff --git a/knockout.punches/knockout.punches.d.ts b/knockout.punches/knockout.punches.d.ts index 82c741ab45..2a596cdc04 100644 --- a/knockout.punches/knockout.punches.d.ts +++ b/knockout.punches/knockout.punches.d.ts @@ -9,8 +9,36 @@ interface KnockoutPunchesStatic { enableAll(): void; } +interface KnockoutPunchesFilters { + // Convert the value to uppercase. + uppercase(value: string): string; + + // Convert the value to lowercase. + lowercase(value: string): string; + + // Perform a search and replace on the value using String#replace. + replace(value: string, search: string, replace: string): string; + + // Trim the value if it’s longer than the given length. The trimmed portion is + // replaced with ... or the replacement value, if given. By default, the value + // is trimmed on the right but can be changed to left or middle through the + // where option. For example: name | fit:10::'middle' will + // convert Shakespeare to Shak...are. + fit(value: number | string, length?: number, replacement?: string, trimWhere?: string): string; + + // Convert the value to a JSON string using ko.toJSON. You can give a space value to format the JSON output. + json(rootObject: any, space?: any, replacer?: any): string; + + // Format the value using toLocaleString. + number(value: number | string): string; + + // If the value is blank, null, or an empty array, replace it with the given default value + default(value: any, defaultValue?: any): any; +} + interface KnockoutStatic { punches: KnockoutPunchesStatic; + filters: KnockoutPunchesFilters; } declare module "knockout.punches" { diff --git a/knockout.validation/knockout.validation.d.ts b/knockout.validation/knockout.validation.d.ts index 40a8a83d4f..df4cdade1c 100644 --- a/knockout.validation/knockout.validation.d.ts +++ b/knockout.validation/knockout.validation.d.ts @@ -6,22 +6,95 @@ /// interface KnockoutValidationGroupingOptions { + /** + * indicates whether to walk the ViewModel (or object) + * recursively, or only walk first-level properties. + */ deep?: boolean; + /** + * indicates whether the returned errors object + * is a ko.computed or a simple function + */ observable?: boolean; + /** + * indicates whether changes to observableArrays inside + * the model should cause the validator to re-run + */ + live?: boolean; +} + +interface KnockoutValidationValidateOptions { + throttle?: number; } interface KnockoutValidationConfiguration { - registerExtenders?: boolean; - messagesOnModified?: boolean; - messageTemplate?: string; - insertMessages?: boolean; - parseInputAttributes?: boolean; - writeInputAttributes?: boolean; + /** + * Allows HTML in validation messages + */ + allowHtmlMessages?: boolean; + /** + * Indicates whether css error classes are added only + * when properties are modified or at all times + * @type {[type]} + */ + decorateElementOnModified?: boolean; + /** + * Indicates whether to assign an error class to the tag + * when your property is invalid + */ decorateInputElement?: boolean; + /** + * If defined, the CSS class assigned to both and validation message elements + */ errorClass?: string; + /** + * The CSS class assigned to validation error elements, must have decorateInputElement set to true + */ errorElementClass?: string; + /** + * The CSS class assigned to validation error messages + */ errorMessageClass?: string; + /** + * Shows tooltips using input 'title' attribute. False hides them + */ + errorsAsTitle?: boolean; + /** + * Shows the error when hovering the input field (decorateElement must be true) + */ + errorsAsTitleOnModified?: boolean; grouping?: KnockoutValidationGroupingOptions; + /** + * If true validation will insert either a element or the template + * specified by messageTemplate after any element (e.g. ) + * that uses a KO value binding with a validated field + */ + insertMessages?: boolean; + /** + * Indicates whether validation messages are triggered only + * when properties are modified or at all times + */ + messagesOnModified?: boolean; + /** + * The id of the + * that you want to use for all your validation messages + */ + messageTemplate?: string; + /** + * Indicates whether to assign validation rules to your ViewModel + * using HTML5 validation attributes + */ + parseInputAttributes?: boolean; + /** + * Register custom validation rules defined via ko.validation.rules + */ + registerExtenders?: boolean; + validate?: KnockoutValidationValidateOptions; + /** + * Add HTML5 input validation attributes to form elements + * that ko observable's are bound to + */ + writeInputAttributes?: boolean; } interface KnockoutValidationUtils { @@ -154,7 +227,7 @@ interface KnockoutSubscribableFunctions { } declare module "knockout.validation" { - export = validation; + export = validation; } -declare var validation: KnockoutValidationStatic +declare var validation: KnockoutValidationStatic diff --git a/knockout/knockout.d.ts b/knockout/knockout.d.ts index 962a776333..6321cff0a5 100644 --- a/knockout/knockout.d.ts +++ b/knockout/knockout.d.ts @@ -1,6 +1,6 @@ -// Type definitions for Knockout v3.2.0 +// Type definitions for Knockout v3.4.0 // Project: http://knockoutjs.com -// Definitions by: Boris Yankov , Igor Oleinikov , Clément Bourgeois +// Definitions by: Boris Yankov , Igor Oleinikov , Clément Bourgeois , Matt Brooks // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -387,6 +387,17 @@ interface KnockoutTemplateEngine extends KnockoutNativeTemplateEngine { rewriteTemplate(template: any, rewriterCallback: Function, templateDocument: Document): void; } +////////////////////////////////// +// tasks.js +////////////////////////////////// + +interface KnockoutTasks { + scheduler: (callback: Function) => any; + schedule(task: Function): number; + cancel(handle: number): void; + runEarly(): void; +} + ///////////////////////////////// interface KnockoutStatic { @@ -512,8 +523,26 @@ interface KnockoutStatic { renderTemplateForEach(template: any, arrayOrObservableArray: KnockoutObservable, options: Object, targetNode: Node, parentBindingContext: KnockoutBindingContext): any; expressionRewriting: { - bindingRewriteValidators: any; - parseObjectLiteral: { (objectLiteralString: string): any[] } + bindingRewriteValidators: any[]; + twoWayBindings: any; + parseObjectLiteral: (objectLiteralString: string) => any[]; + + /** + Internal, private KO utility for updating model properties from within bindings + property: If the property being updated is (or might be) an observable, pass it here + If it turns out to be a writable observable, it will be written to directly + allBindings: An object with a get method to retrieve bindings in the current execution context. + This will be searched for a '_ko_property_writers' property in case you're writing to a non-observable + (See note below) + key: The key identifying the property to be written. Example: for { hasFocus: myValue }, write to 'myValue' by specifying the key 'hasFocus' + value: The value to be written + checkIfDifferent: If true, and if the property being written is a writable observable, the value will only be written if + it is !== existing value on that writable observable + + Note that if you need to write to the viewModel without an observable property, + you need to set ko.expressionRewriting.twoWayBindings[key] = true; *before* the binding evaluation. + */ + writeValueToProperty: (property: KnockoutObservable | any, allBindings: KnockoutAllBindingsAccessor, key: string, value: any, checkIfDifferent?: boolean) => void; }; ///////////////////////////////// @@ -544,7 +573,13 @@ interface KnockoutStatic { deferUpdates: boolean, useOnlyNativeEvents: boolean - } + }; + + ///////////////////////////////// + // tasks.js + ///////////////////////////////// + + tasks: KnockoutTasks; } interface KnockoutBindingProvider { diff --git a/knockout/tests/knockout-tests.ts b/knockout/tests/knockout-tests.ts index e9334a7534..8da6c12950 100644 --- a/knockout/tests/knockout-tests.ts +++ b/knockout/tests/knockout-tests.ts @@ -570,8 +570,8 @@ function test_misc() { $(element).datepicker("destroy"); }); - this.observableFactory = function(): KnockoutObservable{ - if (true) { + this.observableFactory = function(flag = true): KnockoutObservable{ + if (flag) { return ko.computed({ read:function(){ return 3; @@ -655,3 +655,28 @@ function testUnwrapUnion() { var num = ko.unwrap(possibleObs); } + +function test_tasks() { + // Schedule an empty task + ko.tasks.schedule(function() { + }); + + // Schedule a task with arguments and return type + let logSomethingTask = (message: string) => { + console.log("Log message"); + return true; + }; + + let taskHandle = ko.tasks.schedule(logSomethingTask); + + // Cancel a task + ko.tasks.cancel(taskHandle); + + // Process the current microtask queue on demand + ko.tasks.runEarly(); + + // Redefine or augment how Knockout schedules the event to process and flush the queue + ko.tasks.scheduler = function (callback) { + setTimeout(callback, 0); + }; +} diff --git a/koa-compress/koa-compress-tests.ts b/koa-compress/koa-compress-tests.ts new file mode 100644 index 0000000000..564fd53e2c --- /dev/null +++ b/koa-compress/koa-compress-tests.ts @@ -0,0 +1,16 @@ +/// +/// + +import * as Koa from "koa"; +import compress = require("koa-compress"); + +const app = new Koa(); + +app.use(compress({ + filter: (ctype) => { + return /text/i.test(ctype) + }, + threshold: 2048 +})); + +app.listen(80) \ No newline at end of file diff --git a/koa-compress/koa-compress.d.ts b/koa-compress/koa-compress.d.ts new file mode 100644 index 0000000000..c4cd2af582 --- /dev/null +++ b/koa-compress/koa-compress.d.ts @@ -0,0 +1,41 @@ +// Type definitions for koa-compress v2.x +// Project: https://github.com/koajs/compress +// Definitions by: Jerry Chin +// Definitions: https://github.com/hellopao/DefinitelyTyped + +/* =================== USAGE =================== + + import compress = require("koa-compress"); + var Koa = require('koa'); + + var app = new Koa(); + app.use(compress()); + + =============================================== */ +/// +/// + +declare module "koa-compress" { + + import * as Koa from "koa"; + import * as zlib from "zlib"; + + interface CompressOptions extends zlib.ZlibOptions { + /** + * An optional function that checks the response content type to decide whether to compress. By default, it uses compressible. + */ + filter?: (content_type: string) => boolean; + + /** + * Minimum response size in bytes to compress. Default 1024 bytes or 1kb. + */ + threshold?: number + } + + /** + * Compress middleware for Koa + */ + function compress(options?: CompressOptions): { (ctx: Koa.Context, next?: () => any): any }; + + export = compress; +} diff --git a/koa-hbs/koa-hbs-tests.ts b/koa-hbs/koa-hbs-tests.ts new file mode 100644 index 0000000000..373c3ab8b9 --- /dev/null +++ b/koa-hbs/koa-hbs-tests.ts @@ -0,0 +1,21 @@ +/// +/// + +import * as Hbs from 'koa-hbs'; +import * as Koa from 'koa'; +import * as Path from 'path'; + +const app = new Koa(); +const hbs = new Hbs(); + +app.use(hbs.middleware({ + viewPath: Path.join(__dirname, './views') +})); + +app.use(function *(next: any) { + yield this.render('index', { + title: 'Hello World!' + }); +}); + +app.listen(3000); diff --git a/koa-hbs/koa-hbs.d.ts b/koa-hbs/koa-hbs.d.ts new file mode 100644 index 0000000000..cd8fc9c5b4 --- /dev/null +++ b/koa-hbs/koa-hbs.d.ts @@ -0,0 +1,55 @@ +// Type definitions for koa-favicon v2.x +// Project: https://github.com/gilt/koa-hbs +// Definitions by: Jacob Malone +// Definitions: https://github.com/jcbmln/DefinitelyTyped + +/* =================== USAGE =================== + + import * as Hbs from "koa-hbs"; + import * as Koa from "koa"; + + var hbs = new Hbs(); + var app = new Koa(); + + app.use(hbs.middleware({ + viewPath: __dirname + '/views' + })); + + app.use(function *() { + yield this.render('main', { + title: 'koa-hbs' + }); + }); + + =============================================== */ + +/// + +declare module "koa-hbs" { + + import * as Koa from "koa"; + + namespace Hbs { + export interface Middleware { + viewPath: Array | string, + handlebars?: Function, + templateOptions?: {}, + extname?: string, + partialsPath?: Array | string, + defaultLayout?: string, + layoutsPath?: string, + contentHelperName?: string, + blockHelperName?: string, + disableCache?: boolean + } + } + + class Hbs { + constructor(); + + middleware(opts: Hbs.Middleware): any; + } + + namespace Hbs {} + export = Hbs; +} diff --git a/koa-mount/koa-mount-tests.ts b/koa-mount/koa-mount-tests.ts index 560938b22f..795089a76c 100644 --- a/koa-mount/koa-mount-tests.ts +++ b/koa-mount/koa-mount-tests.ts @@ -2,7 +2,7 @@ /// import * as Koa from "koa"; -import mount = require("koa-mount"); +import * as mount from "koa-mount"; const a = new Koa(); diff --git a/koa-mount/koa-mount.d.ts b/koa-mount/koa-mount.d.ts index 6c9c83bb73..f0a742a560 100644 --- a/koa-mount/koa-mount.d.ts +++ b/koa-mount/koa-mount.d.ts @@ -19,5 +19,7 @@ declare module "koa-mount" { function mount(prefix: string, app: Koa): Function; + namespace mount {} + export = mount; } diff --git a/koa-router/koa-router-tests.ts b/koa-router/koa-router-tests.ts index deaa7e083d..36d3e6c1c8 100644 --- a/koa-router/koa-router-tests.ts +++ b/koa-router/koa-router-tests.ts @@ -11,6 +11,9 @@ const router = new Router({ }); router + .param('id', function(id, ctx, next) { + next(); + }) .get('/', function (ctx, next) { ctx.body = 'Hello World!'; }) @@ -23,7 +26,7 @@ router .del('/users/:id', function (ctx, next) { // ... }); - + router.get('user', '/users/:id', function (ctx, next) { ctx.body = "sdsd"; }); diff --git a/koa-router/koa-router.d.ts b/koa-router/koa-router.d.ts index d289657c84..25ec962dad 100644 --- a/koa-router/koa-router.d.ts +++ b/koa-router/koa-router.d.ts @@ -30,7 +30,7 @@ declare module "koa-router" { export interface IRouterOptions { /** - * Router prefixes + * Router prefixes */ prefix?: string; /** @@ -52,6 +52,10 @@ declare module "koa-router" { (ctx: Router.IRouterContext, next?: () => any): any; } + export interface IParamMiddleware { + (param: string, ctx: Router.IRouterContext, next?: () => any): any; + } + export interface IRouterAllowedMethodsOptions { /** * throw error instead of setting status and header @@ -141,13 +145,13 @@ declare module "koa-router" { */ get(name: string, path: string, ...middleware: Array): Router; get(path: string, ...middleware: Array): Router; - + /** * HTTP post method */ post(name: string, path: string, ...middleware: Array): Router; post(path: string, ...middleware: Array): Router; - + /** * HTTP put method */ @@ -214,7 +218,7 @@ declare module "koa-router" { /** * Redirect `source` to `destination` URL with optional 30x status `code`. - * + * * Both `source` and `destination` can be route names. */ redirect(source: string, destination: string, code?: number): Router; @@ -245,7 +249,7 @@ declare module "koa-router" { /** * Run middleware for named route parameters. Useful for auto-loading or validation. */ - param(param: string, middleware: Router.IMiddleware): Router; + param(param: string, middleware: Router.IParamMiddleware): Router; /** * Generate URL from url pattern and given `params`. diff --git a/koa-static/koa-static.d.ts b/koa-static/koa-static.d.ts index 4b95eca3be..feba76fb8d 100644 --- a/koa-static/koa-static.d.ts +++ b/koa-static/koa-static.d.ts @@ -46,6 +46,6 @@ declare module "koa-static" { */ gzip?: boolean; }): { (ctx: Koa.Context, next?: () => any): any }; - + namespace serve{} export = serve; } diff --git a/koa/koa-tests.ts b/koa/koa-tests.ts index e984364973..71814fe4fc 100644 --- a/koa/koa-tests.ts +++ b/koa/koa-tests.ts @@ -9,6 +9,7 @@ app.use((ctx, next) => { const end: any = new Date(); const ms = end - start; console.log(`${ctx.method} ${ctx.url} - ${ms}ms`); + ctx.assert(true, 404, 'Yep!'); }); }); diff --git a/koa/koa.d.ts b/koa/koa.d.ts index 922b243511..1356ffdb0e 100644 --- a/koa/koa.d.ts +++ b/koa/koa.d.ts @@ -13,129 +13,170 @@ } =============================================== */ -/// +/// +/// declare module "koa" { - import { EventEmitter } from "events"; - import * as http from "http"; - import * as net from "net"; + import { EventEmitter } from "events"; + import * as cookies from "cookies"; + import * as http from "http"; + import * as net from "net"; - namespace Koa { - export interface Context extends Request, Response { - body?: any; - request?: Request; - response?: Response; - originalUrl?: string; - state?: any; - name?: string; - cookies?: any; - writable?: Boolean; - respond?: Boolean; - app?: Koa; - req?: http.IncomingMessage; - res?: http.ServerResponse; + namespace Koa { + export interface Context extends Request, Response { + app: Koa; + req: http.IncomingMessage; + res: http.ServerResponse; + request: Request; + response: Response; + + cookies: cookies.ICookies; + originalUrl: string; + state: any; + + name?: string; + respond?: boolean; + + assert(test: any, ...args: any[]): void; + onerror(err?: any): void; + throw(...args: any[]): void; + + toJSON(): any; + inspect(): any; + } + + export interface Request { + app: Koa; + req: http.IncomingMessage; + res: http.ServerResponse; + ctx: Context; + response: Response; + + fresh: boolean; + header: any; + headers: any; + host: string; + hostname: string; + href: string; + idempotent: boolean; + ip: string; + ips: string[]; + method: string; + origin: string; + originalUrl: string; + path: string; + protocol: string; + query: any; + querystring: string; + search: string; + secure: boolean; + socket: net.Socket; + stale: boolean; + subdomains: string[]; + type: string; + url: string; + + charset?: string; + length?: number; + + accepts(): string[]; + accepts(arg: string): void | string; + accepts(arg: string[]): void | string; + accepts(...args: string[]): void | string; + acceptsCharsets(): string[]; + acceptsCharsets(arg: string): void | string; + acceptsCharsets(arg: string[]): void | string; + acceptsCharsets(...args: string[]): void | string; + acceptsEncodings(): string[]; + acceptsEncodings(arg: string): void | string; + acceptsEncodings(arg: string[]): void | string; + acceptsEncodings(...args: string[]): void | string; + acceptsLanguages(): string[]; + acceptsLanguages(arg: string): void | string; + acceptsLanguages(arg: string[]): void | string; + acceptsLanguages(...args: string[]): void | string; + get(field: string): string; + is(): string[]; + is(arg: string): void | string; + is(arg: string[]): void | string; + is(...args: string[]): void | string; + + toJSON(): any; + inspect(): any; + } + + export interface Response { + app: Koa; + req: http.IncomingMessage; + res: http.ServerResponse; + ctx: Context; + request: Request; + + body: any; + etag: string; + header: any; + headers: any; + headerSent: boolean; + lastModified: Date; + message: string; + socket: net.Socket; + status: number; + type: string; + writable: boolean; + + charset?: string; + length?: number; + + append(field: string, val: string | string[]): void; + attachment(filename?: string): void; + get(field: string): string; + is(): string[]; + is(arg: string): void | string; + is(arg: string[]): void | string; + is(...args: string[]): void | string; + redirect(url: string, alt?: string): void; + remove(field: string): void; + set(field: string, val: string | string[]): void; + set(field: any): void; + vary(field: string): void; + + toJSON(): any; + inspect(): any; + } + } + + class Koa extends EventEmitter { + context: Koa.Context; + env: string; + keys: string[]; + proxy: boolean; + request: Koa.Request; + response: Koa.Response; + server: http.Server; + silent: boolean; + subdomainOffset: number; + + constructor(); + + // From node.d.ts + listen(port: number, hostname?: string, backlog?: number, listeningListener?: Function): http.Server; + listen(port: number, hostname?: string, listeningListener?: Function): http.Server; + listen(port: number, backlog?: number, listeningListener?: Function): http.Server; + listen(port: number, listeningListener?: Function): http.Server; + listen(path: string, backlog?: number, listeningListener?: Function): http.Server; + listen(path: string, listeningListener?: Function): http.Server; + listen(handle: any, backlog?: number, listeningListener?: Function): http.Server; + listen(handle: any, listeningListener?: Function): http.Server; + listen(options: net.ListenOptions, listeningListener?: Function): http.Server; + + callback(): (req: http.IncomingMessage, res: http.ServerResponse) => void; onerror(err: any): void; + use(middleware: (ctx: Koa.Context, next: () => Promise) => any): Koa; + toJSON(): any; inspect(): any; - throw(code?: any, message?: any): void; - assert(): void; } - export interface Request { - _querycache?: string; - app?: Koa; - req?: http.IncomingMessage; - res?: http.ServerResponse; - response?: Response; - ctx?: Context; - headers?: any; - header?: any; - method?: string; - length?: any; - url?: string; - origin?: string; - originalUrl?: string; - href?: string; - path?: string; - querystring?: string; - query?: any; - search?: string; - idempotent?: Boolean; - socket?: net.Socket; - protocol?: string; - host?: string; - hostname?: string; - fresh?: Boolean; - stale?: Boolean; - charset?: string; - secure?: Boolean; - ips?: Array; - ip?: string; - subdomains?: Array; - accept?: any; - type?: string; - accepts?: () => any; - acceptsEncodings?: () => any; - acceptsCharsets?: () => any; - acceptsLanguages?: () => any; - is?: (types: any) => any; - toJSON?: () => any; - inspect?: () => any; - get?: (field: string) => string; - } - - export interface Response { - _body?: any; - _explicitStatus?: Boolean; - app?: Koa; - res?: http.ServerResponse; - req?: http.IncomingMessage; - ctx?: Context; - request?: Request; - socket?: net.Socket; - header?: any; - headers?: any; - status?: number; - message?: string; - type?: string; - body?: any; - length?: any; - headerSent?: Boolean; - lastModified?: Date; - etag?: string; - writable?: Boolean; - is?: (types: any) => any; - redirect?: (url: string, alt: string) => void; - attachment?: (filename?: string) => void; - vary?: (field: string) => void; - get?: (field: string) => string; - set?: (field: any, val: any) => void; - remove?: (field: string) => void; - append?: (field: string, val: any) => void; - toJSON?: () => any; - inspect?: () => any; - } - } - - class Koa extends EventEmitter { - keys: Array; - subdomainOffset: number; - proxy: Boolean; - server: http.Server; - env: string; - context: Koa.Context; - request: Koa.Request; - response: Koa.Response; - silent: Boolean; - constructor(); - use(middleware: (ctx: Koa.Context, next: Function) => any): Koa; - callback(): (req: http.IncomingMessage, res: http.ServerResponse) => void; - listen(port: number, callback?: Function): http.Server; - toJSON(): any; - inspect(): any; - onerror(err: any): void; - } - - namespace Koa {} - export = Koa; + namespace Koa {} + export = Koa; } diff --git a/kolite/knockout.activity.d.ts b/kolite/knockout.activity.d.ts index c5d876f630..02d7e75f37 100644 --- a/kolite/knockout.activity.d.ts +++ b/kolite/knockout.activity.d.ts @@ -28,8 +28,18 @@ interface KoLiteActivity { getOpacity(options: { steps?: number; segments?: number; opacity?: number; }, i: number): number; } +interface KoLiteActivityDefaultOptions { + activityClass?: string, + container?: string, + inactiveClass?: string +} + +interface KoLiteActivityBindingHandler extends KnockoutBindingHandler { + defaultOptions: KoLiteActivityDefaultOptions +} + interface KnockoutBindingHandlers { - activity: KnockoutBindingHandler; + activity: KoLiteActivityBindingHandler; } interface JQuery { diff --git a/kolite/kolite-tests.ts b/kolite/kolite-tests.ts index a7b6d08f01..8cafcf6946 100644 --- a/kolite/kolite-tests.ts +++ b/kolite/kolite-tests.ts @@ -2,6 +2,20 @@ /// /// +function test_activityDefaults() { + ko.bindingHandlers.activity.defaultOptions = { + activityClass: 'fa fa-spinner fa-spin', + container: 'i', + inactiveClass: '' + }; + + ko.bindingHandlers.activity.defaultOptions = { + activityClass: 'some Value' + }; + + ko.bindingHandlers.activity.defaultOptions = { + }; +} function test_asyncCommand() { var saveCmd = ko.asyncCommand({ execute: function (complete) { diff --git a/leaflet-geocoder-mapzen/leaflet-geocoder-mapzen-tests.ts b/leaflet-geocoder-mapzen/leaflet-geocoder-mapzen-tests.ts new file mode 100644 index 0000000000..c6519ab371 --- /dev/null +++ b/leaflet-geocoder-mapzen/leaflet-geocoder-mapzen-tests.ts @@ -0,0 +1,10 @@ +/// +/// + +var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', + osmAttrib = '© OpenStreetMap contributors', + osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib}), + map = new L.Map('map', {layers: [osm], center: new L.LatLng(-37.7772, 175.2756), zoom: 15 }); + +// Add geocoding plugin +L.control.geocoder('search-MKZrG6M').addTo(map); diff --git a/leaflet-geocoder-mapzen/leaflet-geocoder-mapzen.d.ts b/leaflet-geocoder-mapzen/leaflet-geocoder-mapzen.d.ts new file mode 100644 index 0000000000..8809472e43 --- /dev/null +++ b/leaflet-geocoder-mapzen/leaflet-geocoder-mapzen.d.ts @@ -0,0 +1,177 @@ +// Type definitions for leaflet-geocoder-mapzen v1.6.3 +// Project: https://github.com/mapzen/leaflet-geocoder +// Definitions by: Leonard Lausen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + + +/// + +declare namespace L { + namespace Control { + export interface GeocoderStatic extends ClassStatic { + /** + * Creates a geocoder control. + */ + new (options?: GeocoderOptions): Geocoder; + } + + export interface Geocoder extends L.Control { + } + + export interface GeocoderOptions { + /** + * Host endpoint for a Pelias-compatible search API. + * + * Default value: 'https://search.mapzen.com/v1'. + */ + url?: string; + + /** + * If true, search is bounded by the current map view. + * You may also provide a custom bounding box in form of a LatLngBounds object. + * Note: bounds is not supported by autocomplete. + * + * Default value: false. + */ + bounds?: LatLngBounds | boolean; + + /** + * If true, search and autocomplete prioritizes results near the center + * of the current view. + * You may also provide a custom LatLng value + * (in any of the accepted Leaflet formats) to act as the center bias. + * + * Default value: 'true'. + */ + focus?: LatLng | boolean; + + /** + * Filters results by layers (documentation). + * If left blank, results will come from all available layers. + * + * Default value: null. + */ + layers?: string | any[] ; + + /** + * An object of key-value pairs which will be serialized + * into query parameters that will be passed to the API. + * This allows custom queries that are not already supported + * by the convenience options listed above. + * For a full list of supported parameters, + * please read the Mapzen Search documentation. + * + * IMPORTANT: some parameters only work with the /search endpoint, + * and do not apply to /autocomplete requests! + * All supplied parameters are passed through; + * this library doesn't know which are valid parameters and which are not. + * In the event that other options conflict with parameters passed through params, + * the params option takes precedence. + * + * Default value: null. + */ + params?: Object; + + /** + * The position of the control (one of the map corners). + * Can be 'topleft', 'topright', 'bottomleft', or 'bottomright'. + * + * Default value: 'topleft'. + */ + position?: PositionString; + + /** + * Attribution text to include. + * Set to blank or null to disable. + * + * Default value: 'Geocoding by Mapzen' + */ + attribution?: string; + + /** + * Placeholder text to display in the search input box. + * Set to blank or null to disable. + * + * Default value: 'Search' + */ + placeholder?: string; + + /** + * Tooltip text to display on the search icon. Set to blank or null to disable. + * + * Default value: 'Search' + */ + title?: string; + + /** + * If true, highlighting a search result pans the map to that location. + * + * Default value: true + */ + panToPoint?: boolean; + + /** + * If true, an icon is used to indicate a polygonal result, + * matching any non-"venue" or non-"address" layer type. + * If false, no icon is displayed. + * For custom icons, pass a string containing a path to the image. + * + * Default value: true + */ + polygonIcon?: boolean | string; + + /** + * If true, search results drops Leaflet's default blue markers onto the map. + * You may customize this marker's appearance and + * behavior using Leaflet marker options. + * + * Default value: true + */ + markers?: MarkerOptions | boolean; + + /** + * If true, the input box will expand to take up the full width of the map container. + * If an integer breakpoint is provided, + * the full width applies only if the map container width is below this breakpoint. + * + * Default value: 650 + */ + fullWidth?: number | boolean; + + /** + * If true, the search input is always expanded. + * It does not collapse into a button-only state. + * + * Default value: false + */ + expanded?: boolean; + + /** + * If true, suggested results are fetched on each keystroke. + * If false, this is disabled and users must obtain results + * by pressing the Enter key after typing in their query. + * + * Default value: true + */ + autocomplete?: boolean; + + /** + * If true, selected results will make a request to the service /place endpoint. + * If false, this is disabled. + * The geocoder does not handle responses to /place, + * you will need to do handle it yourself in the results event listener (see below). + * + * Default value: false + */ + place?: boolean; + } + } + + export namespace control { + + /** + * Creates a geocoder control. + */ + export function geocoder(api_key: string, options?: Control.GeocoderOptions): L.Control.Geocoder; + } +} diff --git a/leaflet-markercluster/leaflet-markercluster.d.ts b/leaflet-markercluster/leaflet-markercluster.d.ts index c9a3140fda..7d8757be03 100644 --- a/leaflet-markercluster/leaflet-markercluster.d.ts +++ b/leaflet-markercluster/leaflet-markercluster.d.ts @@ -51,9 +51,10 @@ declare namespace L { /* * The maximum radius that a cluster will cover from the central marker (in pixels). Default 80. - * Decreasing will make more, smaller clusters. + * Decreasing will make more, smaller clusters. You can also use a function that accepts + * the current map zoom and returns the maximum cluster radius in pixels */ - maxClusterRadius?: number; + maxClusterRadius?: number | ((zoom: number) => number); /* * Options to pass when creating the L.Polygon(points, options) to show the bounds of a cluster. @@ -82,11 +83,21 @@ declare namespace L { * Function used to create the cluster icon */ iconCreateFunction?: any; + + /* + * Boolean to split the addLayers processing in to small intervals so that the page does not freeze. + */ + chunkedLoading?: boolean; + + /* + * Time delay (in ms) between consecutive periods of processing for addLayers. Default to 50ms. + */ + chunkDelay?: number; } export class MarkerClusterGroup extends FeatureGroup { - initialize(): void; - initialize(options: MarkerClusterGroupOptions): void; + constructor(); + constructor(options: MarkerClusterGroupOptions); /* * Bulk methods for adding and removing markers and should be favoured over the @@ -121,5 +132,11 @@ declare namespace L { * Returns the array of total markers contained within that cluster. */ getAllChildMarkers(): Marker[]; + + /* + * Zooms to show the given marker (spiderfying if required), + * calls the callback when the marker is visible on the map. + */ + zoomToShowLayer(layer: any, callback: () => void): void; } } diff --git a/leaflet/leaflet.d.ts b/leaflet/leaflet.d.ts index 37abb90fb1..3bf19a1771 100644 --- a/leaflet/leaflet.d.ts +++ b/leaflet/leaflet.d.ts @@ -1,11 +1,14 @@ -// Type definitions for Leaflet.js 0.7.3 +// Type definitions for Leaflet.js 1.0.0 // Project: https://github.com/Leaflet/Leaflet // Definitions by: Vladimir Zotov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// + declare namespace L { type LatLngExpression = LatLng | number[] | ({ lat: number; lng: number }) type LatLngBoundsExpression = LatLngBounds | LatLngExpression[]; + type PositionString = 'topleft' | 'topright' | 'bottomleft' | 'bottomright'; } declare namespace L { @@ -16,7 +19,7 @@ declare namespace L { * The position of the control (one of the map corners). See control positions. * Default value: 'bottomright'. */ - position?: string; + position?: PositionString; /** * The HTML text shown before the attributions. Pass false to disable. @@ -219,7 +222,7 @@ declare namespace L { /** * Returns a GeoJSON representation of the circle (GeoJSON Point Feature). */ - toGeoJSON(): any; + toGeoJSON(): GeoJSON.Feature; } } @@ -254,11 +257,6 @@ declare namespace L { * Sets the radius of a circle marker. Units are in pixels. */ setRadius(radius: number): CircleMarker; - - /** - * Returns a GeoJSON representation of the circle marker (GeoJSON Point Feature). - */ - toGeoJSON(): any; } } @@ -343,12 +341,12 @@ declare namespace L { /** * Sets the position of the control. See control positions. */ - setPosition(position: string): Control; + setPosition(position: PositionString): Control; /** * Returns the current position of the control. */ - getPosition(): string; + getPosition(): PositionString; /** * Adds the control to the map. @@ -400,7 +398,7 @@ declare namespace L { * * Default value: 'topright'. */ - position?: string; // 'topleft' | 'topright' | 'bottomleft' | 'bottomright' + position?: PositionString; /** * The text set on the zoom in button. @@ -550,7 +548,7 @@ declare namespace L { * positions. * Default value: 'topright'. */ - position?: string; + position?: PositionString; } } @@ -613,7 +611,7 @@ declare namespace L { /** * Size of the icon in pixels. Can be also set through CSS. */ - iconSize?: Point; + iconSize?: Point|[number, number]; /** * The coordinates of the "tip" of the icon (relative to its top left corner). @@ -621,7 +619,7 @@ declare namespace L { * location. Centered by default if size is specified, also can be set in CSS * with negative margins. */ - iconAnchor?: Point; + iconAnchor?: Point|[number, number]; /** * A custom class name to assign to the icon. @@ -637,6 +635,12 @@ declare namespace L { */ html?: string; + /** + * The coordinates of the point from which popups will "open", relative to the + * icon anchor. + */ + popupAnchor?: Point|[number, number]; + } } @@ -1504,7 +1508,7 @@ declare namespace L { * Returns a new LatLng object with the longitude wrapped around left and right * boundaries (-180 to 180 by default). */ - wrap(left: number, right: number): LatLng; + wrap(left?: number, right?: number): LatLng; /** * Latitude in degrees. @@ -1709,8 +1713,9 @@ declare namespace L { /** * Returns a GeoJSON representation of the layer group (GeoJSON FeatureCollection). + * Note: Descendent classes MultiPolygon & MultiPolyLine return `Feature`s, not `FeatureCollection`s */ - toGeoJSON(): any; + toGeoJSON(): GeoJSON.FeatureCollection|GeoJSON.Feature; //////////// //////////// @@ -1739,7 +1744,7 @@ declare namespace L { * * Default value: 'topright'. */ - position?: string; + position?: PositionString; /** * If true, the control will be collapsed into an icon and expanded on mouse hover @@ -2000,7 +2005,7 @@ declare namespace L { export function closestPointOnSegment(p: Point, p1: Point, p2: Point): Point; /** - * Clips the segment a to b by rectangular bounds. Used by Leaflet to only show + * Clips the segment a to b by rectangular bounds. Used by Leaflet to only show * polyline points that are on the screen or near, increasing performance. Returns * either false or a length-2 array of clipped points. */ @@ -2734,6 +2739,22 @@ declare namespace L.Map { * If true, it will delay moveend event so that it doesn't happen many times in a row. */ debounceMoveend?: boolean; + + /** + * Duration of animated panning, in seconds. + */ + duration?: number; + + /** + * The curvature factor of panning animation easing (third parameter of the Cubic Bezier curve). + * 1.0 means linear animation, the less the more bowed the curve. + */ + easeLinearity?: number; + + /** + * If true, panning won't fire movestart event on start (used internally for panning inertia). + */ + noMoveStart?: boolean; } export interface FitBoundsOptions extends ZoomPanOptions { @@ -2921,7 +2942,7 @@ declare namespace L { /** * Returns a GeoJSON representation of the marker (GeoJSON Point Feature). */ - toGeoJSON(): any; + toGeoJSON(): GeoJSON.Feature; /** * Marker dragging handler (by both mouse and touch). @@ -3081,7 +3102,7 @@ declare namespace L { /** * Returns a GeoJSON representation of the multipolygon (GeoJSON MultiPolygon Feature). */ - toGeoJSON(): any; + toGeoJSON(): GeoJSON.Feature; } } @@ -3122,7 +3143,7 @@ declare namespace L { /** * Returns a GeoJSON representation of the multipolyline (GeoJSON MultiLineString Feature). */ - toGeoJSON(): any; + toGeoJSON(): GeoJSON.Feature; } } @@ -3384,7 +3405,7 @@ declare namespace L { className?: string; /** - * Sets the radius of a circle marker. + * Sets the radius of a circle marker. */ radius?: number; @@ -3543,7 +3564,7 @@ declare namespace L { /** * Returns a GeoJSON representation of the polyline (GeoJSON LineString Feature). */ - toGeoJSON(): any; + toGeoJSON(): GeoJSON.Feature; } } @@ -3858,7 +3879,7 @@ declare namespace L { * The position of the control (one of the map corners). See control positions. * Default value: 'bottomleft'. */ - position?: string; + position?: PositionString; /** * Maximum width of the control in pixels. The width is set dynamically to show @@ -4076,7 +4097,7 @@ declare namespace L { * * Default value: 'abc'. */ - subdomains?: string[]; + subdomains?: string|string[]; /** * URL to the tile image to show in place of the tile that failed to load. diff --git a/less/less.d.ts b/less/less.d.ts index d8d04809ec..f8389d3d9b 100644 --- a/less/less.d.ts +++ b/less/less.d.ts @@ -47,6 +47,11 @@ declare namespace Less { sourceMapFileInline: boolean; } + interface StaticOptions { + async: boolean; + fileAsync: boolean; + } + interface Options { sourceMap?: SourceMapOption; filename?: string; @@ -72,6 +77,8 @@ declare namespace Less { } interface LessStatic { + options: Less.StaticOptions; + render(input: string, callback: (error: Less.RenderError, output: Less.RenderOutput) => void): void; render(input: string, options: Less.Options, callback: (error: Less.RenderError, output: Less.RenderOutput) => void): void; diff --git a/linq/linq-tests.ts b/linq/linq-tests.ts index fb9c3f3d6e..d30ccc8f8c 100644 --- a/linq/linq-tests.ts +++ b/linq/linq-tests.ts @@ -30,7 +30,7 @@ describe("Linq.js tests", function () { it("Grouping Methods", function () { expect(Enumerable.From(["a","aa","aaa","a","a","aaa"]) .GroupBy((item:string) => item.length) - .Select((g: linq.Grouping) => { return { key: g.Key(), count: g.Count() }; }) + .Select((g: linq.Grouping) => { return { key: g.Key(), count: g.Count() }; }) .OrderBy(g => g.key) .Select(g => g.key+":"+g.count) .ToString(",")).toBe("1:3,2:1,3:2"); diff --git a/linq/linq.3.0.3-Beta4.d.ts b/linq/linq.3.0.3-Beta4.d.ts deleted file mode 100644 index 812d4a4494..0000000000 --- a/linq/linq.3.0.3-Beta4.d.ts +++ /dev/null @@ -1,196 +0,0 @@ -// Type definitions for linq.js v3.0.3-Beta4 -// Project: http://linqjs.codeplex.com/ -// Definitions by: neuecc -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare namespace linqjs { - interface IEnumerator { - current(): any; - moveNext(): boolean; - dispose(): void; - } - - interface EnumerableStatic { - Utils: { - createLambda(expression: any): (...params: any[]) => any; - createEnumerable(getEnumerator: () => IEnumerator): Enumerable; - createEnumerator(initialize: () => void , tryGetNext: () => boolean, dispose: () => void ): IEnumerator; - extendTo(type: any): void; - }; - choice(...params: any[]): Enumerable; - cycle(...params: any[]): Enumerable; - empty(): Enumerable; - from(): Enumerable; - from(obj: Enumerable): Enumerable; - from(obj: string): Enumerable; - from(obj: number): Enumerable; - from(obj: { length: number;[x: number]: any; }): Enumerable; - from(obj: any): Enumerable; - make(element: any): Enumerable; - matches(input: string, pattern: RegExp): Enumerable; - matches(input: string, pattern: string, flags?: string): Enumerable; - range(start: number, count: number, step?: number): Enumerable; - rangeDown(start: number, count: number, step?: number): Enumerable; - rangeTo(start: number, to: number, step?: number): Enumerable; - repeat(element: any, count?: number): Enumerable; - repeatWithFinalize(initializer: () => any, finalizer: (element: any) => void ): Enumerable; - generate(func: () => any, count?: number): Enumerable; - toInfinity(start?: number, step?: number): Enumerable; - toNegativeInfinity(start?: number, step?: number): Enumerable; - unfold(seed: any, func: (value: any) => any): Enumerable; - defer(enumerableFactory: () => Enumerable): Enumerable; - } - - interface Enumerable { - constructor(getEnumerator: () => IEnumerator): Enumerable; - getEnumerator(): IEnumerator; - - // Extension Methods - traverseBreadthFirst(func: (element: any) => Enumerable, resultSelector?: (element: any, nestLevel: number) => any): Enumerable; - traverseDepthFirst(func: (element: any) => Enumerable, resultSelector?: (element: any, nestLevel: number) => any): Enumerable; - flatten(): Enumerable; - pairwise(selector: (prev: any, current: any) => any): Enumerable; - scan(func: (prev: any, current: any) => any): Enumerable; - scan(seed: any, func: (prev: any, current: any) => any): Enumerable; - select(selector: (element: any, index: number) => any): Enumerable; - selectMany(collectionSelector: (element: any, index: number) => any[], resultSelector?: (outer: any, inner: any) => any): Enumerable; - selectMany(collectionSelector: (element: any, index: number) => Enumerable, resultSelector?: (outer: any, inner: any) => any): Enumerable; - selectMany(collectionSelector: (element: any, index: number) => { length: number;[x: number]: any; }, resultSelector?: (outer: any, inner: any) => any): Enumerable; - where(predicate: (element: any, index: number) => boolean): Enumerable; - choose(selector: (element: any, index: number) => any): Enumerable; - ofType(type: any): Enumerable; - zip(second: any[], resultSelector: (first: any, second: any, index: number) => any): Enumerable; - zip(second: Enumerable, resultSelector: (first: any, second: any, index: number) => any): Enumerable; - zip(second: { length: number;[x: number]: any; }, resultSelector: (first: any, second: any, index: number) => any): Enumerable; - zip(...params: any[]): Enumerable; // last one is selector - merge(second: any[], resultSelector: (first: any, second: any, index: number) => any): Enumerable; - merge(second: Enumerable, resultSelector: (first: any, second: any, index: number) => any): Enumerable; - merge(second: { length: number;[x: number]: any; }, resultSelector: (first: any, second: any, index: number) => any): Enumerable; - merge(...params: any[]): Enumerable; // last one is selector - join(inner: Enumerable, outerKeySelector: (outer: any) =>any, innerKeySelector: (inner: any) =>any, resultSelector: (outer: any, inner: any) => any, compareSelector?: (obj: any) => any): Enumerable; - groupJoin(inner: Enumerable, outerKeySelector: (outer: any) =>any, innerKeySelector: (inner: any) =>any, resultSelector: (outer: any, inner: any) => any, compareSelector?: (obj: any) => any): Enumerable; - all(predicate: (element: any) => boolean): boolean; - any(predicate?: (element: any) => boolean): boolean; - isEmpty(): boolean; - concat(...sequences: any[]): Enumerable; - insert(index: number, second: any[]): Enumerable; - insert(index: number, second: Enumerable): Enumerable; - insert(index: number, second: { length: number;[x: number]: any; }): Enumerable; - alternate(alternateValue: any): Enumerable; - alternate(alternateSequence: any[]): Enumerable; - alternate(alternateSequence: Enumerable): Enumerable; - contains(value: any, compareSelector: (element: any) => any): Enumerable; - contains(value: any): Enumerable; - defaultIfEmpty(defaultValue?: any): Enumerable; - distinct(compareSelector?: (element: any) => any): Enumerable; - distinctUntilChanged(compareSelector: (element: any) => any): Enumerable; - except(second: any[], compareSelector?: (element: any) => any): Enumerable; - except(second: { length: number;[x: number]: any; }, compareSelector?: (element: any) => any): Enumerable; - except(second: Enumerable, compareSelector?: (element: any) => any): Enumerable; - intersect(second: any[], compareSelector?: (element: any) => any): Enumerable; - intersect(second: { length: number;[x: number]: any; }, compareSelector?: (element: any) => any): Enumerable; - intersect(second: Enumerable, compareSelector?: (element: any) => any): Enumerable; - sequenceEqual(second: any[], compareSelector?: (element: any) => any): Enumerable; - sequenceEqual(second: { length: number;[x: number]: any; }, compareSelector?: (element: any) => any): Enumerable; - sequenceEqual(second: Enumerable, compareSelector?: (element: any) => any): Enumerable; - union(second: any[], compareSelector?: (element: any) => any): Enumerable; - union(second: { length: number;[x: number]: any; }, compareSelector?: (element: any) => any): Enumerable; - union(second: Enumerable, compareSelector?: (element: any) => any): Enumerable; - orderBy(keySelector: (element: any) => any): OrderedEnumerable; - orderByDescending(keySelector: (element: any) => any): OrderedEnumerable; - reverse(): Enumerable; - shuffle(): Enumerable; - weightedSample(weightSelector: (element: any) => any): Enumerable; - groupBy(keySelector: (element: any) => any, elementSelector?: (element: any) => any, resultSelector?: (key: any, element: any) => any, compareSelector?: (element: any) => any): Enumerable; - partitionBy(keySelector: (element: any) => any, elementSelector?: (element: any) => any, resultSelector?: (key: any, element: any) => any, compareSelector?: (element: any) => any): Enumerable; - buffer(count: number): Enumerable; - aggregate(func: (prev: any, current: any) => any): any; - aggregate(seed: any, func: (prev: any, current: any) => any, resultSelector?: (last: any) => any): any; - average(selector?: (element: any) => any): number; - count(predicate?: (element: any, index: number) => boolean): number; - max(selector?: (element: any) => any): number; - min(selector?: (element: any) => any): number; - maxBy(keySelector: (element: any) => any): any; - minBy(keySelector: (element: any) => any): any; - sum(selector?: (element: any) => any): number; - elementAt(index: number): any; - elementAtOrDefault(index: number, defaultValue?: any): any; - first(predicate?: (element: any, index: number) => boolean): any; - firstOrDefault(predicate?: (element: any, index: number) => boolean, defaultValue?: any): any; - last(predicate?: (element: any, index: number) => boolean): any; - lastOrDefault(predicate?: (element: any, index: number) => boolean, defaultValue?: any): any; - single(predicate?: (element: any, index: number) => boolean): any; - singleOrDefault(predicate?: (element: any, index: number) => boolean, defaultValue?: any): any; - skip(count: number): Enumerable; - skipWhile(predicate: (element: any, index: number) => boolean): Enumerable; - take(count: number): Enumerable; - takeWhile(predicate: (element: any, index: number) => boolean): Enumerable; - takeExceptLast(count?: number): Enumerable; - takeFromLast(count: number): Enumerable; - indexOf(item: any): number; - indexOf(predicate: (element: any, index: number) => boolean): number; - lastIndexOf(item: any): number; - lastIndexOf(predicate: (element: any, index: number) => boolean): number; - asEnumerable(): Enumerable; - toArray(): any[]; - toLookup(keySelector: (element: any) => any, elementSelector?: (element: any) => any, compareSelector?: (element: any) => any): Lookup; - toObject(keySelector: (element: any) => any, elementSelector?: (element: any) => any): Object; - toDictionary(keySelector: (element: any) => any, elementSelector?: (element: any) => any, compareSelector?: (element: any) => any): Dictionary; - toJSONString(replacer: (key: string, value: any) => any): string; - toJSONString(replacer: any[]): string; - toJSONString(replacer: (key: string, value: any) => any, space: any): string; - toJSONString(replacer: any[], space: any): string; - toJoinedString(separator?: string, selector?: (element: any, index: number) => any): string; - doAction(action: (element: any, index: number) => void ): Enumerable; - doAction(action: (element: any, index: number) => boolean): Enumerable; - forEach(action: (element: any, index: number) => void ): void; - forEach(action: (element: any, index: number) => boolean): void; - write(separator?: string, selector?: (element: any) => any): void; - writeLine(selector?: (element: any) => any): void; - force(): void; - letBind(func: (source: Enumerable) => any[]): Enumerable; - letBind(func: (source: Enumerable) => { length: number;[x: number]: any; }): Enumerable; - letBind(func: (source: Enumerable) => Enumerable): Enumerable; - share(): DisposableEnumerable; - memoize(): DisposableEnumerable; - catchError(handler: (exception: any) => void ): Enumerable; - finallyAction(finallyAction: () => void ): Enumerable; - log(selector?: (element: any) => void ): Enumerable; - trace(message?: string, selector?: (element: any) => void ): Enumerable; - } - - interface OrderedEnumerable extends Enumerable { - createOrderedEnumerable(keySelector: (element: any) => any, descending: boolean): OrderedEnumerable; - thenBy(keySelector: (element: any) => any): OrderedEnumerable; - thenByDescending(keySelector: (element: any) => any): OrderedEnumerable; - } - - interface DisposableEnumerable extends Enumerable { - dispose(): void; - } - - interface Dictionary { - add(key: any, value: any): void; - get(key: any): any; - set(key: any, value: any): boolean; - contains(key: any): boolean; - clear(): void; - remove(key: any): void; - count(): number; - toEnumerable(): Enumerable; // Enumerable - } - - interface Lookup { - count(): number; - get(key: any): Enumerable; - contains(key: any): boolean; - toEnumerable(): Enumerable; // Enumerable - } - - interface Grouping extends Enumerable { - key(): any; - } -} - -// export definition -declare var Enumerable: linqjs.EnumerableStatic; diff --git a/linq/linq.3.0.4-Beta5.d.ts b/linq/linq.3.0.4-Beta5.d.ts new file mode 100644 index 0000000000..b6ae876eee --- /dev/null +++ b/linq/linq.3.0.4-Beta5.d.ts @@ -0,0 +1,276 @@ +// Type definitions for linq.js v3.0.4-Beta5 +// Project: https://linqjs.codeplex.com/ +// Definitions by: neuecc +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module linqjs { + interface IEnumerator { + current(): T; + moveNext(): boolean; + dispose(): void; + } + + interface IEqualityComparer { + equals(x: T, y: T): boolean; + getHashCode(obj: any): string; + } + + interface ITuple { + equals(other: ITuple): boolean; + getHashCode(): string; + } + + interface ITupleArray { + equals(other: ITupleArray): boolean; + getHashCode(): string; + } + + interface Enumerable { + Utils: { + createLambda(expression: any): (...params: any[]) => any; + createEnumerable(getEnumerator: () => IEnumerator): IEnumerable; + createEnumerator(initialize: () => void, tryGetNext: () => boolean, dispose: () => void): IEnumerator; + getDefaultEqualityComparer(): IEqualityComparer; + createEqualityComparer(equals: (x: T, y: T) => boolean, getHashCode: (obj: any) => string): IEqualityComparer; + createKeyedEqualityComparer(keySelector: (element: TValue) => TKey): IEqualityComparer; + createDictionary(compareSelector: (element: TValue) => TKey): IDictionary; + createDictionary(equalityComparer: IEqualityComparer): IDictionary; + createList(): IList; + createTuple(item1: T1, item2: T2, item3?: T3, item4?: T4, item5?: T5, item6?: T6, item7?: T7, item8?: T8): ITuple; + extendTo(type: any, forceAppend?: boolean): void; + }; + choice(...params: T[]): IEnumerable; + cycle(...params: T[]): IEnumerable; + empty(): IEnumerable; + // from, obj as JScript's IEnumerable or WinMD IIterable is IEnumerable but it can't define. + from(): IEnumerable; // empty + from(obj: IEnumerable): IEnumerable; + from(obj: number): IEnumerable; + from(obj: boolean): IEnumerable; + from(obj: string): IEnumerable; + from(obj: T[]): IEnumerable; + from(obj: { length: number; [x: number]: T; }): IEnumerable; + from(obj: any): IEnumerable<{ key: string; value: any }>; + make(element: T): IEnumerable; + matches(input: string, pattern: RegExp): IEnumerable; + matches(input: string, pattern: string, flags?: string): IEnumerable; + range(start: number, count: number, step?: number): IEnumerable; + rangeDown(start: number, count: number, step?: number): IEnumerable; + rangeTo(start: number, to: number, step?: number): IEnumerable; + repeat(element: T, count?: number): IEnumerable; + repeatWithFinalize(initializer: () => T, finalizer: (element: T) => void): IEnumerable; + generate(func: () => T, count?: number): IEnumerable; + toInfinity(start?: number, step?: number): IEnumerable; + toNegativeInfinity(start?: number, step?: number): IEnumerable; + unfold(seed: T, func: (value: T) => T): IEnumerable; + defer(enumerableFactory: () => IEnumerable): IEnumerable; + } + + interface IEnumerable { + constructor(getEnumerator: () => IEnumerator): IEnumerable; + getEnumerator(): IEnumerator; + + // Extension Methods + traverseBreadthFirst(func: (element: T) => IEnumerable): IEnumerable; + traverseBreadthFirst(func: (element: T) => IEnumerable, resultSelector: (element: T, nestLevel: number) => TResult): IEnumerable; + traverseDepthFirst(func: (element: T) => Enumerable): IEnumerable; + traverseDepthFirst(func: (element: T) => Enumerable, resultSelector?: (element: T, nestLevel: number) => TResult): IEnumerable; + flatten(): IEnumerable; + pairwise(selector: (prev: T, current: T) => TResult): IEnumerable; + scan(func: (prev: T, current: T) => T): IEnumerable; + scan(seed: TAccumulate, func: (prev: TAccumulate, current: T) => TAccumulate): IEnumerable; + select(selector: (element: T, index: number) => TResult): IEnumerable; + selectMany(collectionSelector: (element: T, index: number) => IEnumerable): IEnumerable; + selectMany(collectionSelector: (element: T, index: number) => IEnumerable, resultSelector: (outer: T, inner: TCollection) => TResult): IEnumerable; + selectMany(collectionSelector: (element: T, index: number) => TOther[]): IEnumerable; + selectMany(collectionSelector: (element: T, index: number) => TCollection[], resultSelector: (outer: T, inner: TCollection) => TResult): IEnumerable; + selectMany(collectionSelector: (element: T, index: number) => { length: number; [x: number]: TOther; }): IEnumerable; + selectMany(collectionSelector: (element: T, index: number) => { length: number; [x: number]: TCollection; }, resultSelector: (outer: T, inner: TCollection) => TResult): IEnumerable; + where(predicate: (element: T, index: number) => boolean): IEnumerable; + choose(selector: (element: T, index: number) => T): IEnumerable; + ofType(type: any): IEnumerable; + zip(second: IEnumerable, resultSelector: (first: T, second: T, index: number) => TResult): IEnumerable; + zip(second: { length: number; [x: number]: T; }, resultSelector: (first: T, second: T, index: number) => TResult): IEnumerable; + zip(second: T[], resultSelector: (first: T, second: T, index: number) => TResult): IEnumerable; + zip(...params: any[]): IEnumerable; // last one is selector + merge(...params: IEnumerable[]): IEnumerable; + merge(...params: { length: number; [x: number]: T; }[]): IEnumerable; + merge(...params: T[][]): IEnumerable; + join(inner: IEnumerable, outerKeySelector: (outer: T) => TKey, innerKeySelector: (inner: TInner) => TKey, resultSelector: (outer: T, inner: TKey) => TResult, compareSelector?: (obj: T) => TKey): IEnumerable; + join(inner: { length: number; [x: number]: TInner; }, outerKeySelector: (outer: T) => TKey, innerKeySelector: (inner: TInner) => TKey, resultSelector: (outer: T, inner: TKey) => TResult, compareSelector?: (obj: T) => TKey): IEnumerable; + join(inner: TInner[], outerKeySelector: (outer: T) => TKey, innerKeySelector: (inner: TInner) => TKey, resultSelector: (outer: T, inner: TKey) => TResult, compareSelector?: (obj: T) => TKey): IEnumerable; + groupJoin(inner: IEnumerable, outerKeySelector: (outer: T) => TKey, innerKeySelector: (inner: TInner) => TKey, resultSelector: (outer: T, inner: TKey) => TResult, compareSelector?: (obj: T) => TKey): IEnumerable; + groupJoin(inner: { length: number; [x: number]: TInner; }, outerKeySelector: (outer: T) => TKey, innerKeySelector: (inner: TInner) => TKey, resultSelector: (outer: T, inner: TKey) => TResult, compareSelector?: (obj: T) => TKey): IEnumerable; + groupJoin(inner: TInner[], outerKeySelector: (outer: T) => TKey, innerKeySelector: (inner: TInner) => TKey, resultSelector: (outer: T, inner: TKey) => TResult, compareSelector?: (obj: T) => TKey): IEnumerable; + all(predicate: (element: T) => boolean): boolean; + any(predicate?: (element: T) => boolean): boolean; + isEmpty(): boolean; + concat(...sequences: IEnumerable[]): IEnumerable; + concat(...sequences: { length: number; [x: number]: T; }[]): IEnumerable; + concat(...sequences: T[]): IEnumerable; + insert(index: number, second: IEnumerable): IEnumerable; + insert(index: number, second: { length: number; [x: number]: T; }): IEnumerable; + alternate(alternateValue: T): IEnumerable; + alternate(alternateSequence: { length: number; [x: number]: T; }): IEnumerable; + alternate(alternateSequence: IEnumerable): IEnumerable; + alternate(alternateSequence: T[]): IEnumerable; + contains(value: T): boolean; + contains(value: T, compareSelector?: (element: T) => TCompare): boolean; + contains(value: T, equalityComparer?: IEqualityComparer): boolean; + defaultIfEmpty(defaultValue?: T): IEnumerable; + distinct(): IEnumerable; + distinct(compareSelector: (element: T) => TCompare): IEnumerable; + distinctUntilChanged(): IEnumerable; + distinctUntilChanged(compareSelector: (element: T) => TCompare): IEnumerable; + except(second: { length: number; [x: number]: T; }): IEnumerable; + except(second: { length: number; [x: number]: T; }, compareSelector: (element: T) => TCompare): IEnumerable; + except(second: IEnumerable): IEnumerable; + except(second: IEnumerable, compareSelector: (element: T) => TCompare): IEnumerable; + except(second: T[]): IEnumerable; + except(second: T[], compareSelector: (element: T) => TCompare): IEnumerable; + intersect(second: { length: number; [x: number]: T; }): IEnumerable; + intersect(second: { length: number; [x: number]: T; }, compareSelector: (element: T) => TCompare): IEnumerable; + intersect(second: IEnumerable): IEnumerable; + intersect(second: IEnumerable, compareSelector: (element: T) => TCompare): IEnumerable; + intersect(second: T[]): IEnumerable; + intersect(second: T[], compareSelector: (element: T) => TCompare): IEnumerable; + union(second: { length: number; [x: number]: T; }): IEnumerable; + union(second: { length: number; [x: number]: T; }, compareSelector: (element: T) => TCompare): IEnumerable; + union(second: IEnumerable): IEnumerable; + union(second: IEnumerable, compareSelector: (element: T) => TCompare): IEnumerable; + union(second: T[]): IEnumerable; + union(second: T[], compareSelector: (element: T) => TCompare): IEnumerable; + sequenceEqual(second: { length: number; [x: number]: T; }): boolean; + sequenceEqual(second: { length: number; [x: number]: T; }, compareSelector: (element: T) => TCompare): boolean; + sequenceEqual(second: IEnumerable): boolean; + sequenceEqual(second: IEnumerable, compareSelector: (element: T) => TCompare): boolean; + sequenceEqual(second: T[]): boolean; + sequenceEqual(second: T[], compareSelector: (element: T) => TCompare): boolean; + orderBy(keySelector: (element: T) => TKey): IOrderedEnumerable; + orderBy(keySelector: (element: T) => TKey, comparison: (x: TKey, y: TKey) => number): IOrderedEnumerable; + orderByDescending(keySelector: (element: T) => TKey): IOrderedEnumerable; + orderByDescending(keySelector: (element: T) => TKey, comparison: (x: TKey, y: TKey) => number): IOrderedEnumerable; + reverse(): IEnumerable; + shuffle(): IEnumerable; + weightedSample(weightSelector: (element: T) => number): IEnumerable; + // truly, return type is IEnumerable> but Visual Studio + TypeScript Compiler can't compile. + groupBy(keySelector: (element: T) => TKey): IEnumerable>; + groupBy(keySelector: (element: T) => TKey, elementSelector: (element: T) => TElement): IEnumerable>; + groupBy(keySelector: (element: T) => TKey, elementSelector: (element: T) => TElement, resultSelector: (key: TKey, element: IEnumerable) => TResult): IEnumerable; + groupBy(keySelector: (element: T) => TKey, elementSelector: (element: T) => TElement, resultSelector: (key: TKey, element: IEnumerable) => TResult, compareSelector: (element: TKey) => TCompare): IEnumerable; + // :IEnumerable> + partitionBy(keySelector: (element: T) => TKey): IEnumerable>; + // :IEnumerable> + partitionBy(keySelector: (element: T) => TKey, elementSelector: (element: T) => TElement): IEnumerable>; + partitionBy(keySelector: (element: T) => TKey, elementSelector: (element: T) => TElement, resultSelector: (key: TKey, element: IEnumerable) => TResult): IEnumerable; + partitionBy(keySelector: (element: T) => TKey, elementSelector: (element: T) => TElement, resultSelector: (key: TKey, element: IEnumerable) => TResult, compareSelector: (element: T) => TCompare): IEnumerable; + buffer(count: number): IEnumerable; + aggregate(func: (prev: T, current: T) => T): T; + aggregate(seed: TAccumulate, func: (prev: TAccumulate, current: T) => TAccumulate): TAccumulate; + aggregate(seed: TAccumulate, func: (prev: TAccumulate, current: T) => TAccumulate, resultSelector: (last: TAccumulate) => TResult): TResult; + average(selector?: (element: T) => number): number; + count(predicate?: (element: T, index: number) => boolean): number; + max(selector?: (element: T) => number): number; + min(selector?: (element: T) => number): number; + maxBy(keySelector: (element: T) => TKey): T; + minBy(keySelector: (element: T) => TKey): T; + sum(selector?: (element: T) => number): number; + elementAt(index: number): T; + elementAtOrDefault(index: number, defaultValue?: T): T; + first(predicate?: (element: T, index: number) => boolean): T; + firstOrDefault(predicate?: (element: T, index: number) => boolean, defaultValue?: T): T; + last(predicate?: (element: T, index: number) => boolean): T; + lastOrDefault(predicate?: (element: T, index: number) => boolean, defaultValue?: T): T; + single(predicate?: (element: T, index: number) => boolean): T; + singleOrDefault(predicate?: (element: T, index: number) => boolean, defaultValue?: T): T; + skip(count: number): IEnumerable; + skipWhile(predicate: (element: T, index: number) => boolean): IEnumerable; + take(count: number): IEnumerable; + takeWhile(predicate: (element: T, index: number) => boolean): IEnumerable; + takeExceptLast(count?: number): IEnumerable; + takeFromLast(count: number): IEnumerable; + indexOf(item: T): number; + indexOf(predicate: (element: T, index: number) => boolean): number; + lastIndexOf(item: T): number; + lastIndexOf(predicate: (element: T, index: number) => boolean): number; + asEnumerable(): IEnumerable; + cast(): IEnumerable; + toArray(): T[]; + toList(): IList; + // truly, return type is ILookup but Visual Studio + TypeScript Compiler can't compile. + toLookup(keySelector: (element: T) => TKey): ILookup; + toLookup(keySelector: (element: T) => TKey, elementSelector: (element: T) => TElement): ILookup; + toLookup(keySelector: (element: T) => TKey, elementSelector: (element: T) => TElement, compareSelector: (key: TKey) => TCompare): ILookup; + toObject(keySelector: (element: T) => any, elementSelector?: (element: T) => any): Object; + // :IDictionary + toDictionary(keySelector: (element: T) => TKey): IDictionary; + toDictionary(keySelector: (element: T) => TKey, elementSelector: (element: T) => TValue): IDictionary; + toDictionary(keySelector: (element: T) => TKey, elementSelector: (element: T) => TValue, compareSelector: (key: TKey) => TCompare): IDictionary; + toJSONString(replacer: (key: string, value: any) => any): string; + toJSONString(replacer: any[]): string; + toJSONString(replacer: (key: string, value: any) => any, space: any): string; + toJSONString(replacer: any[], space: any): string; + toJoinedString(separator?: string): string; + toJoinedString(separator: string, selector: (element: T, index: number) => TResult): string; + doAction(action: (element: T, index: number) => void): IEnumerable; + doAction(action: (element: T, index: number) => boolean): IEnumerable; + forEach(action: (element: T, index: number) => void): void; + forEach(action: (element: T, index: number) => boolean): void; + write(separator?: string): void; + write(separator: string, selector: (element: T) => TResult): void; + writeLine(): void; + writeLine(selector: (element: T) => TResult): void; + force(): void; + letBind(func: (source: IEnumerable) => { length: number; [x: number]: TResult; }): IEnumerable; + letBind(func: (source: IEnumerable) => TResult[]): IEnumerable; + letBind(func: (source: IEnumerable) => IEnumerable): IEnumerable; + share(): IDisposableEnumerable; + memoize(): IDisposableEnumerable; + catchError(handler: (exception: any) => void): IEnumerable; + finallyAction(finallyAction: () => void): IEnumerable; + log(): IEnumerable; + log(selector: (element: T) => TValue): IEnumerable; + trace(message?: string): IEnumerable; + trace(message: string, selector: (element: T) => TValue): IEnumerable; + } + + interface IOrderedEnumerable extends IEnumerable { + createOrderedEnumerable(keySelector: (element: T) => TKey, comparison: (x: TKey, y: TKey) => number, descending: boolean): IOrderedEnumerable; + thenBy(keySelector: (element: T) => TKey) : IOrderedEnumerable; + thenBy(keySelector: (element: T) => TKey, comparison: (x: TKey, y: TKey) => number) : IOrderedEnumerable; + thenByDescending(keySelector: (element: T) => TKey): IOrderedEnumerable; + thenByDescending(keySelector: (element: T) => TKey, comparison: (x: TKey, y: TKey) => number): IOrderedEnumerable; + } + + interface IDisposableEnumerable extends IEnumerable { + dispose(): void; + } + + interface IDictionary { + add(key: TKey, value: TValue): void; + get(key: TKey): TValue; + set(key: TKey, value: TValue): boolean; + contains(key: TKey): boolean; + clear(): void; + remove(key: TKey): void; + count(): number; + toEnumerable(): IEnumerable<{ key: TKey; value: TValue }>; + } + + interface ILookup { + count(): number; + get(key: TKey): IEnumerable; + contains(key: TKey): boolean; + toEnumerable(): IEnumerable>; + } + + interface IGrouping extends IEnumerable { + key(): TKey; + } + + interface IList extends Array { + } +} + +// export definition +declare var Enumerable: linqjs.Enumerable; diff --git a/linq/linq.d.ts b/linq/linq.d.ts index e9fa44df41..f7417fc8da 100644 --- a/linq/linq.d.ts +++ b/linq/linq.d.ts @@ -30,43 +30,45 @@ declare namespace linq { Generate(func: string, count?: number): Enumerable; ToInfinity(start?: number, step?: number): Enumerable; ToNegativeInfinity(start?: number, step?: number): Enumerable; - Unfold(seed, func: ($) => T): Enumerable; - Unfold(seed, func: string): Enumerable; + Unfold(seed: T, func: ($: T) => T): Enumerable; + Unfold(seed: any, func: string): Enumerable; } interface Enumerable { //Projection and Filtering Methods - CascadeBreadthFirst(func: ($) => any[], resultSelector: (v, i: number) => any): Enumerable; + CascadeBreadthFirst(func: ($: T) => any[], resultSelector: (v: any, i: number) => any): Enumerable; CascadeBreadthFirst(func: string, resultSelector: string): Enumerable; - CascadeDepthFirst(func: ($) => any[], resultSelector: (v, i: number) => any): Enumerable; + CascadeDepthFirst(func: ($: T) => any[], resultSelector: (v: any, i: number) => any): Enumerable; CascadeDepthFirst(func: string, resultSelector: string): Enumerable; Flatten(...items: any[]): Enumerable; - Pairwise(selector: (prev, next) => any): Enumerable; + Pairwise(selector: (prev: any, next: any) => any): Enumerable; Pairwise(selector: string): Enumerable; - Scan(func: (a, b) => any): Enumerable; + Scan(func: (a: any, b: any) => any): Enumerable; Scan(func: string): Enumerable; - Scan(seed, func: (a, b) => any, resultSelector?: ($) => any): Enumerable; - Scan(seed, func: string, resultSelector?: string): Enumerable; + Scan(seed: any, func: (a: any, b: any) => any, resultSelector?: ($: T) => any): Enumerable; + Scan(seed: any, func: string, resultSelector?: string): Enumerable; Select(selector: ($: T, i: number) => TResult): Enumerable; Select(selector: string): Enumerable; - SelectMany(collectionSelector: ($, i: number) => any[], resultSelector?: ($, item) => any): Enumerable; - SelectMany(collectionSelector: ($, i: number) => Enumerable, resultSelector?: ($, item) => any): Enumerable; + SelectMany(collectionSelector: ($: T, i: number) => TResult[]): Enumerable; + SelectMany(collectionSelector: ($: T, i: number) => Enumerable): Enumerable; + SelectMany(collectionSelector: ($: T, i: number) => TCollectionItem[], resultSelector: ($: T, item: TCollectionItem) => TResult): Enumerable; + SelectMany(collectionSelector: ($: T, i: number) => Enumerable, resultSelector: ($: T, item: TCollectionItem) => TResult): Enumerable; SelectMany(collectionSelector: string, resultSelector?: string): Enumerable; Where(predicate: ($ : T, i: number) => boolean): Enumerable; Where(predicate: string): Enumerable; OfType(type: Function): Enumerable; - Zip(second: any[], selector: (v1, v2, i: number) => any): Enumerable; + Zip(second: any[], selector: (v1: any, v2: any, i: number) => any): Enumerable; Zip(second: any[], selector: string): Enumerable; - Zip(second: Enumerable, selector: (v1, v2, i: number) => any): Enumerable; + Zip(second: Enumerable, selector: (v1: any, v2: any, i: number) => any): Enumerable; Zip(second: Enumerable, selector: string): Enumerable; //Join Methods - Join(inner: any[], outerKeySelector: (v1) => any, innerKeySelector: (v1) => any, resultSelector: (v1, v2) => any, compareSelector?: (v) => any): Enumerable; + Join(inner: any[], outerKeySelector: (v1: any) => any, innerKeySelector: (v1: any) => any, resultSelector: (v1: any, v2: any) => any, compareSelector?: (v: any) => any): Enumerable; Join(inner: any[], outerKeySelector: string, innerKeySelector: string, resultSelector: string, compareSelector?: string): Enumerable; - Join(inner: Enumerable, outerKeySelector: (v1) => any, innerKeySelector: (v1) => any, resultSelector: (v1, v2) => any, compareSelector?: (v) => any): Enumerable; + Join(inner: Enumerable, outerKeySelector: (v1: any) => any, innerKeySelector: (v1: any) => any, resultSelector: (v1: any, v2: any) => any, compareSelector?: (v: any) => any): Enumerable; Join(inner: Enumerable, outerKeySelector: string, innerKeySelector: string, resultSelector: string, compareSelector?: string): Enumerable; - GroupJoin(inner: any[], outerKeySelector: (v1) => any, innerKeySelector: (v1) => any, resultSelector: (v1, v2: Enumerable) => any, compareSelector?: (v) => any): Enumerable; + GroupJoin(inner: any[], outerKeySelector: (v1: any) => any, innerKeySelector: (v1: any) => any, resultSelector: (v1: any, v2: Enumerable) => any, compareSelector?: (v: any) => any): Enumerable; GroupJoin(inner: any[], outerKeySelector: string, innerKeySelector: string, resultSelector: string, compareSelector?: string): Enumerable; - GroupJoin(inner: Enumerable, outerKeySelector: (v1) => any, innerKeySelector: (v1) => any, resultSelector: (v1, v2: Enumerable) => any, compareSelector?: (v) => any): Enumerable; + GroupJoin(inner: Enumerable, outerKeySelector: (v1: any) => any, innerKeySelector: (v1: any) => any, resultSelector: (v1: any, v2: Enumerable) => any, compareSelector?: (v: any) => any): Enumerable; GroupJoin(inner: Enumerable, outerKeySelector: string, innerKeySelector: string, resultSelector: string, compareSelector?: string): Enumerable; //Set Methods All(predicate: ($ : T) => boolean): boolean; @@ -77,49 +79,49 @@ declare namespace linq { Concat(second: Enumerable): Enumerable; Insert(index: number, second: any[]): Enumerable; Insert(index: number, second: Enumerable): Enumerable; - Alternate(value): Enumerable; - Contains(value, compareSelector?: ($) => any): boolean; - Contains(value, compareSelector?: string): boolean; - DefaultIfEmpty(defaultValue): Enumerable; - Distinct(compareSelector?: ($) => any): Enumerable; + Alternate(value: any): Enumerable; + Contains(value: any, compareSelector?: ($: T) => any): boolean; + Contains(value: any, compareSelector?: string): boolean; + DefaultIfEmpty(defaultValue: any): Enumerable; + Distinct(compareSelector?: ($: T) => any): Enumerable; Distinct(compareSelector?: string): Enumerable; - Except(second: any[], compareSelector?: ($) => any): Enumerable; + Except(second: any[], compareSelector?: ($: T) => any): Enumerable; Except(second: any[], compareSelector?: string): Enumerable; - Except(second: Enumerable, compareSelector?: ($) => any): Enumerable; + Except(second: Enumerable, compareSelector?: ($: T) => any): Enumerable; Except(second: Enumerable, compareSelector?: string): Enumerable; - Intersect(second: any[], compareSelector?: ($) => any): Enumerable; + Intersect(second: any[], compareSelector?: ($: T) => any): Enumerable; Intersect(second: any[], compareSelector?: string): Enumerable; - Intersect(second: Enumerable, compareSelector?: ($) => any): Enumerable; + Intersect(second: Enumerable, compareSelector?: ($: T) => any): Enumerable; Intersect(second: Enumerable, compareSelector?: string): Enumerable; - SequenceEqual(second: any[], compareSelector?: ($) => any): boolean; + SequenceEqual(second: any[], compareSelector?: ($: T) => any): boolean; SequenceEqual(second: any[], compareSelector?: string): boolean; - SequenceEqual(second: Enumerable, compareSelector?: ($) => any): boolean; + SequenceEqual(second: Enumerable, compareSelector?: ($: T) => any): boolean; SequenceEqual(second: Enumerable, compareSelector?: string): boolean; - Union(second: any[], compareSelector?: ($) => any): Enumerable; + Union(second: any[], compareSelector?: ($: T) => any): Enumerable; Union(second: any[], compareSelector?: string): Enumerable; - Union(second: Enumerable, compareSelector?: ($) => any): Enumerable; + Union(second: Enumerable, compareSelector?: ($: T) => any): Enumerable; Union(second: Enumerable, compareSelector?: string): Enumerable; //Ordering Methods OrderBy(keySelector?: ($: T) => any): OrderedEnumerable; OrderBy(keySelector?: string): OrderedEnumerable; - OrderByDescending(keySelector?: ($) => any): OrderedEnumerable; + OrderByDescending(keySelector?: ($: T) => any): OrderedEnumerable; OrderByDescending(keySelector?: string): OrderedEnumerable; Reverse(): Enumerable; Shuffle(): Enumerable; //Grouping Methods - GroupBy(keySelector: ($) => any, elementSelector?: ($) => any, resultSelector?: (key, e) => any, compareSelector?: ($) =>any): Enumerable; + GroupBy(keySelector: ($: T) => any, elementSelector?: ($: T) => any, resultSelector?: (key: any, e: any) => any, compareSelector?: ($: T) =>any): Enumerable; GroupBy(keySelector: string, elementSelector?: string, resultSelector?: string, compareSelector?: string): Enumerable; - PartitionBy(keySelector: ($) => any, elementSelector?: ($) => any, resultSelector?: (key, e) => any, compareSelector?: ($) =>any): Enumerable; + PartitionBy(keySelector: ($: T) => any, elementSelector?: ($: T) => any, resultSelector?: (key: any, e: any) => any, compareSelector?: ($: T) =>any): Enumerable; PartitionBy(keySelector: string, elementSelector?: string, resultSelector?: string, compareSelector?: string): Enumerable; BufferWithCount(count: number): Enumerable; // Aggregate Methods - Aggregate(func: (a, b) => any); - Aggregate(seed, func: (a, b) => any, resultSelector?: ($) => any); - Aggregate(func: string); - Aggregate(seed, func: string, resultSelector?: string); - Average(selector?: ($) => number): number; + Aggregate(func: (a: any, b: any) => any): any; + Aggregate(seed: any, func: (a: any, b: any) => any, resultSelector?: ($: T) => any): any; + Aggregate(func: string): any; + Aggregate(seed: any, func: string, resultSelector?: string): any; + Average(selector?: ($: T) => number): number; Average(selector?: string): number; - Count(predicate?: ($) => boolean): number; + Count(predicate?: ($: T) => boolean): number; Count(predicate?: string): number; Max(selector?: ($: T) => any): any; Max(selector?: ($: T) => Date): Date; @@ -141,7 +143,7 @@ declare namespace linq { MinBy(selector: ($: T) => string): string; MinBy(selector: ($: T) => any): any; MinBy(selector: string): any; - Sum(selector?: ($) => number): number; + Sum(selector?: ($: T) => number): number; Sum(selector?: string): number; //Paging Methods ElementAt(index: number): T; @@ -166,29 +168,29 @@ declare namespace linq { TakeWhile(predicate: string): Enumerable; TakeExceptLast(count?: number): Enumerable; TakeFromLast(count: number): Enumerable; - IndexOf(item): number; - LastIndexOf(item): number; + IndexOf(item: T): number; + LastIndexOf(item: T): number; // Convert Methods ToArray(): T[]; - ToLookup(keySelector: ($) => any, elementSelector?: ($) => any, compareSelector?: (key) => any): Lookup; - ToLookup(keySelector: string, elementSelector?: string, compareSelector?: string): Lookup; - ToObject(keySelector: ($) => string, elementSelector: ($) => any): any; + ToLookup(keySelector: ($: T) => TKey, elementSelector?: ($: T) => TValue, compareSelector?: (key: TKey) => any): Lookup; + ToLookup(keySelector: string, elementSelector?: string, compareSelector?: string): Lookup; + ToObject(keySelector: ($: T) => string, elementSelector: ($: T) => any): any; ToObject(keySelector: string, elementSelector: string): any; - ToDictionary(keySelector: ($) => any, elementSelector: ($) => any, compareSelector?: (key) => any): Dictionary; - ToDictionary(keySelector: string, elementSelector: string, compareSelector?: string): Dictionary; - ToJSON(replacer?: (key, value) => any, space?: number): string; + ToDictionary(keySelector: ($: T) => TKey, elementSelector: ($: T) => TValue, compareSelector?: (key: TKey) => any): Dictionary; + ToDictionary(keySelector: string, elementSelector: string, compareSelector?: string): Dictionary; + ToJSON(replacer?: (key: any, value: any) => any, space?: number): string; ToJSON(replacer?: string, space?: number): string; - ToString(separator?: string, selector?: ($) =>any): string; + ToString(separator?: string, selector?: ($: T) =>any): string; ToString(separator?: string, selector?: string): string; //Action Methods - Do(action: ($, i: number) => void ): Enumerable; + Do(action: ($: T, i: number) => void ): Enumerable; Do(action: string): Enumerable; ForEach(action: ($: T, i: number) => void ): void; ForEach(func: ($: T, i: number) => boolean): void; ForEach(action_func: string): void; - Write(separator?: string, selector?: ($) =>any): void; + Write(separator?: string, selector?: ($: T) =>any): void; Write(separator?: string, selector?: string): void; - WriteLine(selector?: ($) =>any): void; + WriteLine(selector?: ($: T) =>any): void; Force(): void; //Functional Methods Let(func: (e: Enumerable) => Enumerable): Enumerable; @@ -200,7 +202,7 @@ declare namespace linq { Finally(finallyAction: () => void ): Enumerable; Finally(finallyAction: string): Enumerable; //For Debug Methods - Trace(message?: string, selector?: ($) =>any): Enumerable; + Trace(message?: string, selector?: ($: T) =>any): Enumerable; Trace(message?: string, selector?: string): Enumerable; } @@ -211,26 +213,26 @@ declare namespace linq { ThenByDescending(keySelector: string): OrderedEnumerable; } - interface Grouping extends Enumerable { - Key(); + interface Grouping extends Enumerable { + Key(): TKey; } - interface Lookup { + interface Lookup { Count(): number; - Get(key): Enumerable; - Contains(key): boolean; - ToEnumerable(): Enumerable; + Get(key: TKey): Enumerable; + Contains(key: TKey): boolean; + ToEnumerable(): Enumerable>; } - interface Dictionary { - Add(key, value): void; - Get(key): any; - Set(key, value): boolean; - Contains(key): boolean; + interface Dictionary { + Add(key: TKey, value: TValue): void; + Get(key: TKey): TValue; + Set(key: TKey, value: TValue): boolean; + Contains(key: TKey): boolean; Clear(): void; - Remove(key): void; + Remove(key: TKey): void; Count(): number; - ToEnumerable(): Enumerable; + ToEnumerable(): Enumerable>; } interface KeyValuePair { diff --git a/linq/linq.jquery.3.0.4-Beta5.d.ts b/linq/linq.jquery.3.0.4-Beta5.d.ts new file mode 100644 index 0000000000..4f80a55769 --- /dev/null +++ b/linq/linq.jquery.3.0.4-Beta5.d.ts @@ -0,0 +1,18 @@ +// Type definitions for linq.jquery (from linq.js) +// Project: https://linqjs.codeplex.com/ +// Definitions by: neuecc +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// + +declare module linqjs { + interface IEnumerable { + tojQuery(): JQuery; + tojQueryAsArray(): JQuery; + } +} + +interface JQuery { + toEnumerable(): linqjs.IEnumerable; +} diff --git a/load-json-file/load-json-file-tests.ts b/load-json-file/load-json-file-tests.ts new file mode 100644 index 0000000000..89884bf78a --- /dev/null +++ b/load-json-file/load-json-file-tests.ts @@ -0,0 +1,15 @@ +/// +import * as loadJsonFile from 'load-json-file'; + +function assert(actual: string, expected: string): void { + if (actual !== expected) { + throw new Error(`${JSON.stringify(actual)} !== ${JSON.stringify(expected)}`); + } +} + +loadJsonFile('../package.json').then(pkg => { + assert(pkg.name, 'definitely-typed'); +}); + +const pkg = loadJsonFile.sync('../package.json'); +assert(pkg.name, 'definitely-typed'); diff --git a/load-json-file/load-json-file.d.ts b/load-json-file/load-json-file.d.ts new file mode 100644 index 0000000000..3da3c5ac2f --- /dev/null +++ b/load-json-file/load-json-file.d.ts @@ -0,0 +1,26 @@ +// Type definitions for load-json-file v2.0.0 +// Project: https://github.com/sindresorhus/load-json-file +// Definitions by: Sam Verschueren +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module "load-json-file" { + + interface LoadJsonFile { + /** + * Returns a promise for the parsed JSON. + * + * @param filepath + */ + (filepath: string): Promise; + /** + * Returns the parsed JSON. + * + * @param filepath + */ + sync(filepath: string): any; + } + + const loadJsonFile: LoadJsonFile; + + export = loadJsonFile; +} diff --git a/localForage/localForage.d.ts b/localForage/localForage.d.ts index fb3146988f..803bde9e57 100644 --- a/localForage/localForage.d.ts +++ b/localForage/localForage.d.ts @@ -52,7 +52,7 @@ interface LocalForage { config(options: LocalForageOptions): boolean; createInstance(options: LocalForageOptions): LocalForage; - driver(): LocalForageDriver; + driver(): string; /** * Force usage of a particular driver or drivers, if available. * @param {string} driver @@ -86,6 +86,13 @@ interface LocalForage { iterate(iteratee: (value: any, key: string, iterationNumber: number) => any): Promise; iterate(iteratee: (value: any, key: string, iterationNumber: number) => any, callback: (err: any, result: any) => void): void; + + /** + * Create a new instance of localForage to point to a different store. + * All the configuration options used by config are supported. + * @param {LocalForageOptions} options + */ + createInstance(options: LocalForageOptions): LocalForage; } declare module "localforage" { diff --git a/lockr/lockr-tests.ts b/lockr/lockr-tests.ts new file mode 100644 index 0000000000..c8b3596630 --- /dev/null +++ b/lockr/lockr-tests.ts @@ -0,0 +1,23 @@ +/// + +Lockr.set('test', 123); +Lockr.sadd('array', 2); +Lockr.sadd('array', 3); +Lockr.set('hash', {"test": 123, "hey": "whatsup"}); +Lockr.set('hash', [1, 2, 3]); +Lockr.set('valueFalse', false); +Lockr.set('value0', 0); + +let value = Lockr.get('test'); +Lockr.rm('test'); + +let contents = Lockr.getAll(); +Lockr.flush(); + +Lockr.sadd('test_set', 1); +Lockr.sadd('test_set', 2); +Lockr.smembers('test_set'); +Lockr.sismember('test_set', 1); +Lockr.srem('test_set', 1); + +Lockr.prefix = "imaprefix"; diff --git a/lockr/lockr.d.ts b/lockr/lockr.d.ts new file mode 100644 index 0000000000..c615c13e5d --- /dev/null +++ b/lockr/lockr.d.ts @@ -0,0 +1,113 @@ +// Type definitions for lockr 0.8.3 +// Project: https://github.com/tsironis/lockr +// Definitions by: Dror Weiss +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare var Lockr: lockr.LockrStatic; + +declare module lockr { + interface LockrStatic { + + /** + * The prefix used by lockr. + */ + prefix: string; + + /** + * Set a key to a particular value or a hash object (Object or Array) under a hash key. + * @param key + * @param value + */ + set(key: string, value: string | number | Object): void; + + /** + * Set a key to a particular value or a hash object (Object or Array) under a hash key. + * @param key + * @param value + */ + set(key: string, value: Array): void; + + /** + * Removes all data associated to a key. + * @param key + */ + rm(key: string): void; + + /** + * Returns the saved value for given key, even if the saved value is hash object. + * If value is null or undefined it returns a default value. + * @param key + * @param defaultValue + */ + get(key: string, defaultValue?: T): T; + + /** + * Adds a unique value to a particular set under a hash key. + * @param key + * @param value + */ + sadd(key: string, value: string | number | Object): void; + + /** + * Adds a unique value to a particular set under a hash key. + * @param key + * @param value + */ + sadd(key: string, value: Array): void; + + /** + * Returns the values of a particular set under a hash key. + * @param key + */ + smembers(key: string): (string | number | Object)[]; + + /** + * Returns the values of a particular set under a hash key. + * @param key + */ + smembers(key: string): Array; + + /** + * Returns whether the value exists in a particular set under a hash key. + * @param key + * @param value + */ + sismember(key: string, value: string | number | Object): boolean; + + /** + * Returns whether the value exists in a particular set under a hash key. + * @param key + * @param value + */ + sismember(key: string, value: Array): boolean; + + /** + * Removes a value from a particular set under a hash key. + * @param key + * @param value + */ + srem(key: string, value: string | number | Object): void; + + /** + * Removes a value from a particular set under a hash key. + * @param key + * @param value + */ + srem(key: string, value: Array): void; + + /** + * Returns all saved values & objects, in an Array. + */ + getAll(): (string | number | Object)[]; + + /** + * Empties localStorage. + */ + flush(): void; + } +} + + +declare module "lockr" { + export = Lockr; +} diff --git a/locutus/locutus-tests.ts b/locutus/locutus-tests.ts new file mode 100644 index 0000000000..a465bbd4fa --- /dev/null +++ b/locutus/locutus-tests.ts @@ -0,0 +1,353 @@ +/// +import locutus_c_math_abs = require('locutus/c/math/abs'); +import locutus_golang_strings_Contains = require('locutus/golang/strings/Contains'); +import locutus_golang_strings_Count = require('locutus/golang/strings/Count'); +import locutus_golang_strings_Index = require('locutus/golang/strings/Index'); +import locutus_golang_strings_LastIndex = require('locutus/golang/strings/LastIndex'); +import locutus_php_array_array_change_key_case = require('locutus/php/array/array_change_key_case'); +import locutus_php_array_array_chunk = require('locutus/php/array/array_chunk'); +import locutus_php_array_array_combine = require('locutus/php/array/array_combine'); +import locutus_php_array_array_count_values = require('locutus/php/array/array_count_values'); +import locutus_php_array_array_diff = require('locutus/php/array/array_diff'); +import locutus_php_array_array_diff_assoc = require('locutus/php/array/array_diff_assoc'); +import locutus_php_array_array_diff_key = require('locutus/php/array/array_diff_key'); +import locutus_php_array_array_diff_uassoc = require('locutus/php/array/array_diff_uassoc'); +import locutus_php_array_array_diff_ukey = require('locutus/php/array/array_diff_ukey'); +import locutus_php_array_array_fill = require('locutus/php/array/array_fill'); +import locutus_php_array_array_fill_keys = require('locutus/php/array/array_fill_keys'); +import locutus_php_array_array_filter = require('locutus/php/array/array_filter'); +import locutus_php_array_array_flip = require('locutus/php/array/array_flip'); +import locutus_php_array_array_intersect = require('locutus/php/array/array_intersect'); +import locutus_php_array_array_intersect_assoc = require('locutus/php/array/array_intersect_assoc'); +import locutus_php_array_array_intersect_key = require('locutus/php/array/array_intersect_key'); +import locutus_php_array_array_intersect_uassoc = require('locutus/php/array/array_intersect_uassoc'); +import locutus_php_array_array_intersect_ukey = require('locutus/php/array/array_intersect_ukey'); +import locutus_php_array_array_key_exists = require('locutus/php/array/array_key_exists'); +import locutus_php_array_array_keys = require('locutus/php/array/array_keys'); +import locutus_php_array_array_map = require('locutus/php/array/array_map'); +import locutus_php_array_array_merge = require('locutus/php/array/array_merge'); +import locutus_php_array_array_merge_recursive = require('locutus/php/array/array_merge_recursive'); +import locutus_php_array_array_multisort = require('locutus/php/array/array_multisort'); +import locutus_php_array_array_pad = require('locutus/php/array/array_pad'); +import locutus_php_array_array_pop = require('locutus/php/array/array_pop'); +import locutus_php_array_array_product = require('locutus/php/array/array_product'); +import locutus_php_array_array_push = require('locutus/php/array/array_push'); +import locutus_php_array_array_rand = require('locutus/php/array/array_rand'); +import locutus_php_array_array_reduce = require('locutus/php/array/array_reduce'); +import locutus_php_array_array_replace = require('locutus/php/array/array_replace'); +import locutus_php_array_array_replace_recursive = require('locutus/php/array/array_replace_recursive'); +import locutus_php_array_array_reverse = require('locutus/php/array/array_reverse'); +import locutus_php_array_array_search = require('locutus/php/array/array_search'); +import locutus_php_array_array_shift = require('locutus/php/array/array_shift'); +import locutus_php_array_array_slice = require('locutus/php/array/array_slice'); +import locutus_php_array_array_splice = require('locutus/php/array/array_splice'); +import locutus_php_array_array_sum = require('locutus/php/array/array_sum'); +import locutus_php_array_array_udiff = require('locutus/php/array/array_udiff'); +import locutus_php_array_array_udiff_assoc = require('locutus/php/array/array_udiff_assoc'); +import locutus_php_array_array_udiff_uassoc = require('locutus/php/array/array_udiff_uassoc'); +import locutus_php_array_array_uintersect = require('locutus/php/array/array_uintersect'); +import locutus_php_array_array_uintersect_uassoc = require('locutus/php/array/array_uintersect_uassoc'); +import locutus_php_array_array_unique = require('locutus/php/array/array_unique'); +import locutus_php_array_array_unshift = require('locutus/php/array/array_unshift'); +import locutus_php_array_array_values = require('locutus/php/array/array_values'); +import locutus_php_array_array_walk = require('locutus/php/array/array_walk'); +import locutus_php_array_arsort = require('locutus/php/array/arsort'); +import locutus_php_array_asort = require('locutus/php/array/asort'); +import locutus_php_array_count = require('locutus/php/array/count'); +import locutus_php_array_current = require('locutus/php/array/current'); +import locutus_php_array_each = require('locutus/php/array/each'); +import locutus_php_array_end = require('locutus/php/array/end'); +import locutus_php_array_in_array = require('locutus/php/array/in_array'); +import locutus_php_array_key = require('locutus/php/array/key'); +import locutus_php_array_krsort = require('locutus/php/array/krsort'); +import locutus_php_array_ksort = require('locutus/php/array/ksort'); +import locutus_php_array_natcasesort = require('locutus/php/array/natcasesort'); +import locutus_php_array_natsort = require('locutus/php/array/natsort'); +import locutus_php_array_next = require('locutus/php/array/next'); +import locutus_php_array_pos = require('locutus/php/array/pos'); +import locutus_php_array_prev = require('locutus/php/array/prev'); +import locutus_php_array_range = require('locutus/php/array/range'); +import locutus_php_array_reset = require('locutus/php/array/reset'); +import locutus_php_array_rsort = require('locutus/php/array/rsort'); +import locutus_php_array_shuffle = require('locutus/php/array/shuffle'); +import locutus_php_array_sizeof = require('locutus/php/array/sizeof'); +import locutus_php_array_sort = require('locutus/php/array/sort'); +import locutus_php_array_uasort = require('locutus/php/array/uasort'); +import locutus_php_array_uksort = require('locutus/php/array/uksort'); +import locutus_php_array_usort = require('locutus/php/array/usort'); +import locutus_php_bc_bcadd = require('locutus/php/bc/bcadd'); +import locutus_php_bc_bccomp = require('locutus/php/bc/bccomp'); +import locutus_php_bc_bcdiv = require('locutus/php/bc/bcdiv'); +import locutus_php_bc_bcmul = require('locutus/php/bc/bcmul'); +import locutus_php_bc_bcround = require('locutus/php/bc/bcround'); +import locutus_php_bc_bcscale = require('locutus/php/bc/bcscale'); +import locutus_php_bc_bcsub = require('locutus/php/bc/bcsub'); +import locutus_php_ctype_ctype_alnum = require('locutus/php/ctype/ctype_alnum'); +import locutus_php_ctype_ctype_alpha = require('locutus/php/ctype/ctype_alpha'); +import locutus_php_ctype_ctype_cntrl = require('locutus/php/ctype/ctype_cntrl'); +import locutus_php_ctype_ctype_digit = require('locutus/php/ctype/ctype_digit'); +import locutus_php_ctype_ctype_graph = require('locutus/php/ctype/ctype_graph'); +import locutus_php_ctype_ctype_lower = require('locutus/php/ctype/ctype_lower'); +import locutus_php_ctype_ctype_print = require('locutus/php/ctype/ctype_print'); +import locutus_php_ctype_ctype_punct = require('locutus/php/ctype/ctype_punct'); +import locutus_php_ctype_ctype_space = require('locutus/php/ctype/ctype_space'); +import locutus_php_ctype_ctype_upper = require('locutus/php/ctype/ctype_upper'); +import locutus_php_ctype_ctype_xdigit = require('locutus/php/ctype/ctype_xdigit'); +import locutus_php_datetime_checkdate = require('locutus/php/datetime/checkdate'); +import locutus_php_datetime_date = require('locutus/php/datetime/date'); +import locutus_php_datetime_date_parse = require('locutus/php/datetime/date_parse'); +import locutus_php_datetime_getdate = require('locutus/php/datetime/getdate'); +import locutus_php_datetime_gettimeofday = require('locutus/php/datetime/gettimeofday'); +import locutus_php_datetime_gmdate = require('locutus/php/datetime/gmdate'); +import locutus_php_datetime_gmmktime = require('locutus/php/datetime/gmmktime'); +import locutus_php_datetime_gmstrftime = require('locutus/php/datetime/gmstrftime'); +import locutus_php_datetime_idate = require('locutus/php/datetime/idate'); +import locutus_php_datetime_microtime = require('locutus/php/datetime/microtime'); +import locutus_php_datetime_mktime = require('locutus/php/datetime/mktime'); +import locutus_php_datetime_strftime = require('locutus/php/datetime/strftime'); +import locutus_php_datetime_strptime = require('locutus/php/datetime/strptime'); +import locutus_php_datetime_strtotime = require('locutus/php/datetime/strtotime'); +import locutus_php_datetime_time = require('locutus/php/datetime/time'); +import locutus_php_exec_escapeshellarg = require('locutus/php/exec/escapeshellarg'); +import locutus_php_filesystem_basename = require('locutus/php/filesystem/basename'); +import locutus_php_filesystem_dirname = require('locutus/php/filesystem/dirname'); +import locutus_php_filesystem_file_get_contents = require('locutus/php/filesystem/file_get_contents'); +import locutus_php_filesystem_pathinfo = require('locutus/php/filesystem/pathinfo'); +import locutus_php_filesystem_realpath = require('locutus/php/filesystem/realpath'); +import locutus_php_funchand_call_user_func = require('locutus/php/funchand/call_user_func'); +import locutus_php_funchand_call_user_func_array = require('locutus/php/funchand/call_user_func_array'); +import locutus_php_funchand_create_function = require('locutus/php/funchand/create_function'); +import locutus_php_funchand_function_exists = require('locutus/php/funchand/function_exists'); +import locutus_php_funchand_get_defined_functions = require('locutus/php/funchand/get_defined_functions'); +import locutus_php_i18n_i18n_loc_get_default = require('locutus/php/i18n/i18n_loc_get_default'); +import locutus_php_i18n_i18n_loc_set_default = require('locutus/php/i18n/i18n_loc_set_default'); +import locutus_php_info_assert_options = require('locutus/php/info/assert_options'); +import locutus_php_info_getenv = require('locutus/php/info/getenv'); +import locutus_php_info_ini_get = require('locutus/php/info/ini_get'); +import locutus_php_info_ini_set = require('locutus/php/info/ini_set'); +import locutus_php_info_set_time_limit = require('locutus/php/info/set_time_limit'); +import locutus_php_info_version_compare = require('locutus/php/info/version_compare'); +import locutus_php_json_json_decode = require('locutus/php/json/json_decode'); +import locutus_php_json_json_encode = require('locutus/php/json/json_encode'); +import locutus_php_json_json_last_error = require('locutus/php/json/json_last_error'); +import locutus_php_math_abs = require('locutus/php/math/abs'); +import locutus_php_math_acos = require('locutus/php/math/acos'); +import locutus_php_math_acosh = require('locutus/php/math/acosh'); +import locutus_php_math_asin = require('locutus/php/math/asin'); +import locutus_php_math_asinh = require('locutus/php/math/asinh'); +import locutus_php_math_atan = require('locutus/php/math/atan'); +import locutus_php_math_atan2 = require('locutus/php/math/atan2'); +import locutus_php_math_atanh = require('locutus/php/math/atanh'); +import locutus_php_math_base_convert = require('locutus/php/math/base_convert'); +import locutus_php_math_bindec = require('locutus/php/math/bindec'); +import locutus_php_math_ceil = require('locutus/php/math/ceil'); +import locutus_php_math_cos = require('locutus/php/math/cos'); +import locutus_php_math_cosh = require('locutus/php/math/cosh'); +import locutus_php_math_decbin = require('locutus/php/math/decbin'); +import locutus_php_math_dechex = require('locutus/php/math/dechex'); +import locutus_php_math_decoct = require('locutus/php/math/decoct'); +import locutus_php_math_deg2rad = require('locutus/php/math/deg2rad'); +import locutus_php_math_exp = require('locutus/php/math/exp'); +import locutus_php_math_expm1 = require('locutus/php/math/expm1'); +import locutus_php_math_floor = require('locutus/php/math/floor'); +import locutus_php_math_fmod = require('locutus/php/math/fmod'); +import locutus_php_math_getrandmax = require('locutus/php/math/getrandmax'); +import locutus_php_math_hexdec = require('locutus/php/math/hexdec'); +import locutus_php_math_hypot = require('locutus/php/math/hypot'); +import locutus_php_math_is_finite = require('locutus/php/math/is_finite'); +import locutus_php_math_is_infinite = require('locutus/php/math/is_infinite'); +import locutus_php_math_is_nan = require('locutus/php/math/is_nan'); +import locutus_php_math_lcg_value = require('locutus/php/math/lcg_value'); +import locutus_php_math_log = require('locutus/php/math/log'); +import locutus_php_math_log10 = require('locutus/php/math/log10'); +import locutus_php_math_log1p = require('locutus/php/math/log1p'); +import locutus_php_math_max = require('locutus/php/math/max'); +import locutus_php_math_min = require('locutus/php/math/min'); +import locutus_php_math_mt_getrandmax = require('locutus/php/math/mt_getrandmax'); +import locutus_php_math_mt_rand = require('locutus/php/math/mt_rand'); +import locutus_php_math_octdec = require('locutus/php/math/octdec'); +import locutus_php_math_pi = require('locutus/php/math/pi'); +import locutus_php_math_pow = require('locutus/php/math/pow'); +import locutus_php_math_rad2deg = require('locutus/php/math/rad2deg'); +import locutus_php_math_rand = require('locutus/php/math/rand'); +import locutus_php_math_round = require('locutus/php/math/round'); +import locutus_php_math_sin = require('locutus/php/math/sin'); +import locutus_php_math_sinh = require('locutus/php/math/sinh'); +import locutus_php_math_sqrt = require('locutus/php/math/sqrt'); +import locutus_php_math_tan = require('locutus/php/math/tan'); +import locutus_php_math_tanh = require('locutus/php/math/tanh'); +import locutus_php_misc_pack = require('locutus/php/misc/pack'); +import locutus_php_misc_uniqid = require('locutus/php/misc/uniqid'); +import locutus_php_net_gopher_gopher_parsedir = require('locutus/php/net-gopher/gopher_parsedir'); +import locutus_php_network_inet_ntop = require('locutus/php/network/inet_ntop'); +import locutus_php_network_inet_pton = require('locutus/php/network/inet_pton'); +import locutus_php_network_ip2long = require('locutus/php/network/ip2long'); +import locutus_php_network_long2ip = require('locutus/php/network/long2ip'); +import locutus_php_network_setcookie = require('locutus/php/network/setcookie'); +import locutus_php_network_setrawcookie = require('locutus/php/network/setrawcookie'); +import locutus_php_pcre_preg_quote = require('locutus/php/pcre/preg_quote'); +import locutus_php_pcre_sql_regcase = require('locutus/php/pcre/sql_regcase'); +import locutus_php_strings_addcslashes = require('locutus/php/strings/addcslashes'); +import locutus_php_strings_addslashes = require('locutus/php/strings/addslashes'); +import locutus_php_strings_bin2hex = require('locutus/php/strings/bin2hex'); +import locutus_php_strings_chop = require('locutus/php/strings/chop'); +import locutus_php_strings_chr = require('locutus/php/strings/chr'); +import locutus_php_strings_chunk_split = require('locutus/php/strings/chunk_split'); +import locutus_php_strings_convert_cyr_string = require('locutus/php/strings/convert_cyr_string'); +import locutus_php_strings_convert_uuencode = require('locutus/php/strings/convert_uuencode'); +import locutus_php_strings_count_chars = require('locutus/php/strings/count_chars'); +import locutus_php_strings_crc32 = require('locutus/php/strings/crc32'); +import locutus_php_strings_echo = require('locutus/php/strings/echo'); +import locutus_php_strings_explode = require('locutus/php/strings/explode'); +import locutus_php_strings_get_html_translation_table = require('locutus/php/strings/get_html_translation_table'); +import locutus_php_strings_hex2bin = require('locutus/php/strings/hex2bin'); +import locutus_php_strings_html_entity_decode = require('locutus/php/strings/html_entity_decode'); +import locutus_php_strings_htmlentities = require('locutus/php/strings/htmlentities'); +import locutus_php_strings_htmlspecialchars = require('locutus/php/strings/htmlspecialchars'); +import locutus_php_strings_htmlspecialchars_decode = require('locutus/php/strings/htmlspecialchars_decode'); +import locutus_php_strings_implode = require('locutus/php/strings/implode'); +import locutus_php_strings_join = require('locutus/php/strings/join'); +import locutus_php_strings_lcfirst = require('locutus/php/strings/lcfirst'); +import locutus_php_strings_levenshtein = require('locutus/php/strings/levenshtein'); +import locutus_php_strings_localeconv = require('locutus/php/strings/localeconv'); +import locutus_php_strings_ltrim = require('locutus/php/strings/ltrim'); +import locutus_php_strings_md5 = require('locutus/php/strings/md5'); +import locutus_php_strings_md5_file = require('locutus/php/strings/md5_file'); +import locutus_php_strings_metaphone = require('locutus/php/strings/metaphone'); +import locutus_php_strings_money_format = require('locutus/php/strings/money_format'); +import locutus_php_strings_nl2br = require('locutus/php/strings/nl2br'); +import locutus_php_strings_nl_langinfo = require('locutus/php/strings/nl_langinfo'); +import locutus_php_strings_number_format = require('locutus/php/strings/number_format'); +import locutus_php_strings_ord = require('locutus/php/strings/ord'); +import locutus_php_strings_parse_str = require('locutus/php/strings/parse_str'); +import locutus_php_strings_printf = require('locutus/php/strings/printf'); +import locutus_php_strings_quoted_printable_decode = require('locutus/php/strings/quoted_printable_decode'); +import locutus_php_strings_quoted_printable_encode = require('locutus/php/strings/quoted_printable_encode'); +import locutus_php_strings_quotemeta = require('locutus/php/strings/quotemeta'); +import locutus_php_strings_rtrim = require('locutus/php/strings/rtrim'); +import locutus_php_strings_setlocale = require('locutus/php/strings/setlocale'); +import locutus_php_strings_sha1 = require('locutus/php/strings/sha1'); +import locutus_php_strings_sha1_file = require('locutus/php/strings/sha1_file'); +import locutus_php_strings_similar_text = require('locutus/php/strings/similar_text'); +import locutus_php_strings_soundex = require('locutus/php/strings/soundex'); +import locutus_php_strings_split = require('locutus/php/strings/split'); +import locutus_php_strings_sprintf = require('locutus/php/strings/sprintf'); +import locutus_php_strings_sscanf = require('locutus/php/strings/sscanf'); +import locutus_php_strings_str_getcsv = require('locutus/php/strings/str_getcsv'); +import locutus_php_strings_str_ireplace = require('locutus/php/strings/str_ireplace'); +import locutus_php_strings_str_pad = require('locutus/php/strings/str_pad'); +import locutus_php_strings_str_repeat = require('locutus/php/strings/str_repeat'); +import locutus_php_strings_str_replace = require('locutus/php/strings/str_replace'); +import locutus_php_strings_str_rot13 = require('locutus/php/strings/str_rot13'); +import locutus_php_strings_str_shuffle = require('locutus/php/strings/str_shuffle'); +import locutus_php_strings_str_split = require('locutus/php/strings/str_split'); +import locutus_php_strings_str_word_count = require('locutus/php/strings/str_word_count'); +import locutus_php_strings_strcasecmp = require('locutus/php/strings/strcasecmp'); +import locutus_php_strings_strchr = require('locutus/php/strings/strchr'); +import locutus_php_strings_strcmp = require('locutus/php/strings/strcmp'); +import locutus_php_strings_strcoll = require('locutus/php/strings/strcoll'); +import locutus_php_strings_strcspn = require('locutus/php/strings/strcspn'); +import locutus_php_strings_strip_tags = require('locutus/php/strings/strip_tags'); +import locutus_php_strings_stripos = require('locutus/php/strings/stripos'); +import locutus_php_strings_stripslashes = require('locutus/php/strings/stripslashes'); +import locutus_php_strings_stristr = require('locutus/php/strings/stristr'); +import locutus_php_strings_strlen = require('locutus/php/strings/strlen'); +import locutus_php_strings_strnatcasecmp = require('locutus/php/strings/strnatcasecmp'); +import locutus_php_strings_strnatcmp = require('locutus/php/strings/strnatcmp'); +import locutus_php_strings_strncasecmp = require('locutus/php/strings/strncasecmp'); +import locutus_php_strings_strncmp = require('locutus/php/strings/strncmp'); +import locutus_php_strings_strpbrk = require('locutus/php/strings/strpbrk'); +import locutus_php_strings_strpos = require('locutus/php/strings/strpos'); +import locutus_php_strings_strrchr = require('locutus/php/strings/strrchr'); +import locutus_php_strings_strrev = require('locutus/php/strings/strrev'); +import locutus_php_strings_strripos = require('locutus/php/strings/strripos'); +import locutus_php_strings_strrpos = require('locutus/php/strings/strrpos'); +import locutus_php_strings_strspn = require('locutus/php/strings/strspn'); +import locutus_php_strings_strstr = require('locutus/php/strings/strstr'); +import locutus_php_strings_strtok = require('locutus/php/strings/strtok'); +import locutus_php_strings_strtolower = require('locutus/php/strings/strtolower'); +import locutus_php_strings_strtoupper = require('locutus/php/strings/strtoupper'); +import locutus_php_strings_strtr = require('locutus/php/strings/strtr'); +import locutus_php_strings_substr = require('locutus/php/strings/substr'); +import locutus_php_strings_substr_compare = require('locutus/php/strings/substr_compare'); +import locutus_php_strings_substr_count = require('locutus/php/strings/substr_count'); +import locutus_php_strings_substr_replace = require('locutus/php/strings/substr_replace'); +import locutus_php_strings_trim = require('locutus/php/strings/trim'); +import locutus_php_strings_ucfirst = require('locutus/php/strings/ucfirst'); +import locutus_php_strings_ucwords = require('locutus/php/strings/ucwords'); +import locutus_php_strings_vprintf = require('locutus/php/strings/vprintf'); +import locutus_php_strings_vsprintf = require('locutus/php/strings/vsprintf'); +import locutus_php_strings_wordwrap = require('locutus/php/strings/wordwrap'); +import locutus_php_url_base64_decode = require('locutus/php/url/base64_decode'); +import locutus_php_url_base64_encode = require('locutus/php/url/base64_encode'); +import locutus_php_url_http_build_query = require('locutus/php/url/http_build_query'); +import locutus_php_url_parse_url = require('locutus/php/url/parse_url'); +import locutus_php_url_rawurldecode = require('locutus/php/url/rawurldecode'); +import locutus_php_url_rawurlencode = require('locutus/php/url/rawurlencode'); +import locutus_php_url_urldecode = require('locutus/php/url/urldecode'); +import locutus_php_url_urlencode = require('locutus/php/url/urlencode'); +import locutus_php_var_doubleval = require('locutus/php/var/doubleval'); +import locutus_php_var_empty = require('locutus/php/var/empty'); +import locutus_php_var_floatval = require('locutus/php/var/floatval'); +import locutus_php_var_gettype = require('locutus/php/var/gettype'); +import locutus_php_var_intval = require('locutus/php/var/intval'); +import locutus_php_var_is_array = require('locutus/php/var/is_array'); +import locutus_php_var_is_binary = require('locutus/php/var/is_binary'); +import locutus_php_var_is_bool = require('locutus/php/var/is_bool'); +import locutus_php_var_is_buffer = require('locutus/php/var/is_buffer'); +import locutus_php_var_is_callable = require('locutus/php/var/is_callable'); +import locutus_php_var_is_double = require('locutus/php/var/is_double'); +import locutus_php_var_is_float = require('locutus/php/var/is_float'); +import locutus_php_var_is_int = require('locutus/php/var/is_int'); +import locutus_php_var_is_integer = require('locutus/php/var/is_integer'); +import locutus_php_var_is_long = require('locutus/php/var/is_long'); +import locutus_php_var_is_null = require('locutus/php/var/is_null'); +import locutus_php_var_is_numeric = require('locutus/php/var/is_numeric'); +import locutus_php_var_is_object = require('locutus/php/var/is_object'); +import locutus_php_var_is_real = require('locutus/php/var/is_real'); +import locutus_php_var_is_scalar = require('locutus/php/var/is_scalar'); +import locutus_php_var_is_string = require('locutus/php/var/is_string'); +import locutus_php_var_is_unicode = require('locutus/php/var/is_unicode'); +import locutus_php_var_isset = require('locutus/php/var/isset'); +import locutus_php_var_print_r = require('locutus/php/var/print_r'); +import locutus_php_var_serialize = require('locutus/php/var/serialize'); +import locutus_php_var_strval = require('locutus/php/var/strval'); +import locutus_php_var_unserialize = require('locutus/php/var/unserialize'); +import locutus_php_var_var_dump = require('locutus/php/var/var_dump'); +import locutus_php_var_var_export = require('locutus/php/var/var_export'); +import locutus_php_xdiff_xdiff_string_diff = require('locutus/php/xdiff/xdiff_string_diff'); +import locutus_php_xdiff_xdiff_string_patch = require('locutus/php/xdiff/xdiff_string_patch'); +import locutus_php_xml_utf8_decode = require('locutus/php/xml/utf8_decode'); +import locutus_php_xml_utf8_encode = require('locutus/php/xml/utf8_encode'); +import locutus_python_string_capwords = require('locutus/python/string/capwords'); +import locutus_ruby_Math_acos = require('locutus/ruby/Math/acos'); +import locutus_c_math = require('locutus/c/math'); +import locutus_golang_strings = require('locutus/golang/strings'); +import locutus_php_array = require('locutus/php/array'); +import locutus_php_bc = require('locutus/php/bc'); +import locutus_php_ctype = require('locutus/php/ctype'); +import locutus_php_datetime = require('locutus/php/datetime'); +import locutus_php_exec = require('locutus/php/exec'); +import locutus_php_filesystem = require('locutus/php/filesystem'); +import locutus_php_funchand = require('locutus/php/funchand'); +import locutus_php_i18n = require('locutus/php/i18n'); +import locutus_php_info = require('locutus/php/info'); +import locutus_php_json = require('locutus/php/json'); +import locutus_php_math = require('locutus/php/math'); +import locutus_php_misc = require('locutus/php/misc'); +import locutus_php_net_gopher = require('locutus/php/net-gopher'); +import locutus_php_network = require('locutus/php/network'); +import locutus_php_pcre = require('locutus/php/pcre'); +import locutus_php_strings = require('locutus/php/strings'); +import locutus_php_url = require('locutus/php/url'); +import locutus_php_var = require('locutus/php/var'); +import locutus_php_xdiff = require('locutus/php/xdiff'); +import locutus_php_xml = require('locutus/php/xml'); +import locutus_python_string = require('locutus/python/string'); +import locutus_ruby_Math = require('locutus/ruby/Math'); +import locutus_c = require('locutus/c'); +import locutus_golang = require('locutus/golang'); +import locutus_php = require('locutus/php'); +import locutus_python = require('locutus/python'); +import locutus_ruby = require('locutus/ruby'); +import locutus = require('locutus'); diff --git a/locutus/locutus.d.ts b/locutus/locutus.d.ts new file mode 100644 index 0000000000..4e1077a937 --- /dev/null +++ b/locutus/locutus.d.ts @@ -0,0 +1,1734 @@ +// Type definitions for locutus +// Project: http://locutusjs.io +// Definitions by: Hookclaw +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module "locutus/c/math/abs" { + function abs(mixedNumber?:any):any; + export = abs; +} +declare module "locutus/golang/strings/Contains" { + function Contains(s?:any, substr?:any):any; + export = Contains; +} +declare module "locutus/golang/strings/Count" { + function Count(s?:any, sep?:any):any; + export = Count; +} +declare module "locutus/golang/strings/Index" { + function Index(s?:any, sep?:any):any; + export = Index; +} +declare module "locutus/golang/strings/LastIndex" { + function LastIndex(s?:any, sep?:any):any; + export = LastIndex; +} +declare module "locutus/php/array/array_change_key_case" { + function array_change_key_case(array?:any, cs?:any):any; + export = array_change_key_case; +} +declare module "locutus/php/array/array_chunk" { + function array_chunk(input?:any, size?:any, preserveKeys?:any):any; + export = array_chunk; +} +declare module "locutus/php/array/array_combine" { + function array_combine(keys?:any, values?:any):any; + export = array_combine; +} +declare module "locutus/php/array/array_count_values" { + function array_count_values(array?:any):any; + export = array_count_values; +} +declare module "locutus/php/array/array_diff" { + function array_diff(...args:any[]):any; + export = array_diff; +} +declare module "locutus/php/array/array_diff_assoc" { + function array_diff_assoc(...args:any[]):any; + export = array_diff_assoc; +} +declare module "locutus/php/array/array_diff_key" { + function array_diff_key(...args:any[]):any; + export = array_diff_key; +} +declare module "locutus/php/array/array_diff_uassoc" { + function array_diff_uassoc(...args:any[]):any; + export = array_diff_uassoc; +} +declare module "locutus/php/array/array_diff_ukey" { + function array_diff_ukey(...args:any[]):any; + export = array_diff_ukey; +} +declare module "locutus/php/array/array_fill" { + function array_fill(startIndex?:any, num?:any, mixedVal?:any):any; + export = array_fill; +} +declare module "locutus/php/array/array_fill_keys" { + function array_fill_keys(keys?:any, value?:any):any; + export = array_fill_keys; +} +declare module "locutus/php/array/array_filter" { + function array_filter(arr?:any, func?:any):any; + export = array_filter; +} +declare module "locutus/php/array/array_flip" { + function array_flip(trans?:any):any; + export = array_flip; +} +declare module "locutus/php/array/array_intersect" { + function array_intersect(...args:any[]):any; + export = array_intersect; +} +declare module "locutus/php/array/array_intersect_assoc" { + function array_intersect_assoc(...args:any[]):any; + export = array_intersect_assoc; +} +declare module "locutus/php/array/array_intersect_key" { + function array_intersect_key(...args:any[]):any; + export = array_intersect_key; +} +declare module "locutus/php/array/array_intersect_uassoc" { + function array_intersect_uassoc(...args:any[]):any; + export = array_intersect_uassoc; +} +declare module "locutus/php/array/array_intersect_ukey" { + function array_intersect_ukey(...args:any[]):any; + export = array_intersect_ukey; +} +declare module "locutus/php/array/array_key_exists" { + function array_key_exists(key?:any, search?:any):any; + export = array_key_exists; +} +declare module "locutus/php/array/array_keys" { + function array_keys(input?:any, searchValue?:any, argStrict?:any):any; + export = array_keys; +} +declare module "locutus/php/array/array_map" { + function array_map(...args:any[]):any; + export = array_map; +} +declare module "locutus/php/array/array_merge" { + function array_merge(...args:any[]):any; + export = array_merge; +} +declare module "locutus/php/array/array_merge_recursive" { + function array_merge_recursive(arr1?:any, arr2?:any):any; + export = array_merge_recursive; +} +declare module "locutus/php/array/array_multisort" { + function array_multisort(...args:any[]):any; + export = array_multisort; +} +declare module "locutus/php/array/array_pad" { + function array_pad(input?:any, padSize?:any, padValue?:any):any; + export = array_pad; +} +declare module "locutus/php/array/array_pop" { + function array_pop(inputArr?:any):any; + export = array_pop; +} +declare module "locutus/php/array/array_product" { + function array_product(input?:any):any; + export = array_product; +} +declare module "locutus/php/array/array_push" { + function array_push(...args:any[]):any; + export = array_push; +} +declare module "locutus/php/array/array_rand" { + function array_rand(input?:any, numReq?:any):any; + export = array_rand; +} +declare module "locutus/php/array/array_reduce" { + function array_reduce(aInput?:any, callback?:any):any; + export = array_reduce; +} +declare module "locutus/php/array/array_replace" { + function array_replace(...args:any[]):any; + export = array_replace; +} +declare module "locutus/php/array/array_replace_recursive" { + function array_replace_recursive(...args:any[]):any; + export = array_replace_recursive; +} +declare module "locutus/php/array/array_reverse" { + function array_reverse(array?:any, preserveKeys?:any):any; + export = array_reverse; +} +declare module "locutus/php/array/array_search" { + function array_search(needle?:any, haystack?:any, argStrict?:any):any; + export = array_search; +} +declare module "locutus/php/array/array_shift" { + function array_shift(inputArr?:any):any; + export = array_shift; +} +declare module "locutus/php/array/array_slice" { + function array_slice(arr?:any, offst?:any, lgth?:any, preserveKeys?:any):any; + export = array_slice; +} +declare module "locutus/php/array/array_splice" { + function array_splice(arr?:any, offst?:any, lgth?:any, replacement?:any):any; + export = array_splice; +} +declare module "locutus/php/array/array_sum" { + function array_sum(array?:any):any; + export = array_sum; +} +declare module "locutus/php/array/array_udiff" { + function array_udiff(...args:any[]):any; + export = array_udiff; +} +declare module "locutus/php/array/array_udiff_assoc" { + function array_udiff_assoc(...args:any[]):any; + export = array_udiff_assoc; +} +declare module "locutus/php/array/array_udiff_uassoc" { + function array_udiff_uassoc(...args:any[]):any; + export = array_udiff_uassoc; +} +declare module "locutus/php/array/array_uintersect" { + function array_uintersect(...args:any[]):any; + export = array_uintersect; +} +declare module "locutus/php/array/array_uintersect_uassoc" { + function array_uintersect_uassoc(...args:any[]):any; + export = array_uintersect_uassoc; +} +declare module "locutus/php/array/array_unique" { + function array_unique(inputArr?:any):any; + export = array_unique; +} +declare module "locutus/php/array/array_unshift" { + function array_unshift(...args:any[]):any; + export = array_unshift; +} +declare module "locutus/php/array/array_values" { + function array_values(input?:any):any; + export = array_values; +} +declare module "locutus/php/array/array_walk" { + function array_walk(...args:any[]):any; + export = array_walk; +} +declare module "locutus/php/array/arsort" { + function arsort(inputArr?:any, sortFlags?:any):any; + export = arsort; +} +declare module "locutus/php/array/asort" { + function asort(inputArr?:any, sortFlags?:any):any; + export = asort; +} +declare module "locutus/php/array/count" { + function count(mixedVar?:any, mode?:any):any; + export = count; +} +declare module "locutus/php/array/current" { + function current(arr?:any):any; + export = current; +} +declare module "locutus/php/array/each" { + function each(arr?:any):any; + export = each; +} +declare module "locutus/php/array/end" { + function end(arr?:any):any; + export = end; +} +declare module "locutus/php/array/in_array" { + function in_array(needle?:any, haystack?:any, argStrict?:any):any; + export = in_array; +} +declare module "locutus/php/array/key" { + function key(arr?:any):any; + export = key; +} +declare module "locutus/php/array/krsort" { + function krsort(inputArr?:any, sortFlags?:any):any; + export = krsort; +} +declare module "locutus/php/array/ksort" { + function ksort(inputArr?:any, sortFlags?:any):any; + export = ksort; +} +declare module "locutus/php/array/natcasesort" { + function natcasesort(inputArr?:any):any; + export = natcasesort; +} +declare module "locutus/php/array/natsort" { + function natsort(inputArr?:any):any; + export = natsort; +} +declare module "locutus/php/array/next" { + function next(arr?:any):any; + export = next; +} +declare module "locutus/php/array/pos" { + function pos(arr?:any):any; + export = pos; +} +declare module "locutus/php/array/prev" { + function prev(arr?:any):any; + export = prev; +} +declare module "locutus/php/array/range" { + function range(low?:any, high?:any, step?:any):any; + export = range; +} +declare module "locutus/php/array/reset" { + function reset(arr?:any):any; + export = reset; +} +declare module "locutus/php/array/rsort" { + function rsort(inputArr?:any, sortFlags?:any):any; + export = rsort; +} +declare module "locutus/php/array/shuffle" { + function shuffle(inputArr?:any):any; + export = shuffle; +} +declare module "locutus/php/array/sizeof" { + function sizeof(mixedVar?:any, mode?:any):any; + export = sizeof; +} +declare module "locutus/php/array/sort" { + function sort(inputArr?:any, sortFlags?:any):any; + export = sort; +} +declare module "locutus/php/array/uasort" { + function uasort(inputArr?:any, sorter?:any):any; + export = uasort; +} +declare module "locutus/php/array/uksort" { + function uksort(inputArr?:any, sorter?:any):any; + export = uksort; +} +declare module "locutus/php/array/usort" { + function usort(inputArr?:any, sorter?:any):any; + export = usort; +} +declare module "locutus/php/bc/bcadd" { + function bcadd(leftOperand?:any, rightOperand?:any, scale?:any):any; + export = bcadd; +} +declare module "locutus/php/bc/bccomp" { + function bccomp(leftOperand?:any, rightOperand?:any, scale?:any):any; + export = bccomp; +} +declare module "locutus/php/bc/bcdiv" { + function bcdiv(leftOperand?:any, rightOperand?:any, scale?:any):any; + export = bcdiv; +} +declare module "locutus/php/bc/bcmul" { + function bcmul(leftOperand?:any, rightOperand?:any, scale?:any):any; + export = bcmul; +} +declare module "locutus/php/bc/bcround" { + function bcround(val?:any, precision?:any):any; + export = bcround; +} +declare module "locutus/php/bc/bcscale" { + function bcscale(scale?:any):any; + export = bcscale; +} +declare module "locutus/php/bc/bcsub" { + function bcsub(leftOperand?:any, rightOperand?:any, scale?:any):any; + export = bcsub; +} +declare module "locutus/php/ctype/ctype_alnum" { + function ctype_alnum(text?:any):any; + export = ctype_alnum; +} +declare module "locutus/php/ctype/ctype_alpha" { + function ctype_alpha(text?:any):any; + export = ctype_alpha; +} +declare module "locutus/php/ctype/ctype_cntrl" { + function ctype_cntrl(text?:any):any; + export = ctype_cntrl; +} +declare module "locutus/php/ctype/ctype_digit" { + function ctype_digit(text?:any):any; + export = ctype_digit; +} +declare module "locutus/php/ctype/ctype_graph" { + function ctype_graph(text?:any):any; + export = ctype_graph; +} +declare module "locutus/php/ctype/ctype_lower" { + function ctype_lower(text?:any):any; + export = ctype_lower; +} +declare module "locutus/php/ctype/ctype_print" { + function ctype_print(text?:any):any; + export = ctype_print; +} +declare module "locutus/php/ctype/ctype_punct" { + function ctype_punct(text?:any):any; + export = ctype_punct; +} +declare module "locutus/php/ctype/ctype_space" { + function ctype_space(text?:any):any; + export = ctype_space; +} +declare module "locutus/php/ctype/ctype_upper" { + function ctype_upper(text?:any):any; + export = ctype_upper; +} +declare module "locutus/php/ctype/ctype_xdigit" { + function ctype_xdigit(text?:any):any; + export = ctype_xdigit; +} +declare module "locutus/php/datetime/checkdate" { + function checkdate(m?:any, d?:any, y?:any):any; + export = checkdate; +} +declare module "locutus/php/datetime/date" { + function date(format?:any, timestamp?:any):any; + export = date; +} +declare module "locutus/php/datetime/date_parse" { + function date_parse(date?:any):any; + export = date_parse; +} +declare module "locutus/php/datetime/getdate" { + function getdate(timestamp?:any):any; + export = getdate; +} +declare module "locutus/php/datetime/gettimeofday" { + function gettimeofday(returnFloat?:any):any; + export = gettimeofday; +} +declare module "locutus/php/datetime/gmdate" { + function gmdate(format?:any, timestamp?:any):any; + export = gmdate; +} +declare module "locutus/php/datetime/gmmktime" { + function gmmktime(...args:any[]):any; + export = gmmktime; +} +declare module "locutus/php/datetime/gmstrftime" { + function gmstrftime(format?:any, timestamp?:any):any; + export = gmstrftime; +} +declare module "locutus/php/datetime/idate" { + function idate(format?:any, timestamp?:any):any; + export = idate; +} +declare module "locutus/php/datetime/microtime" { + function microtime(getAsFloat?:any):any; + export = microtime; +} +declare module "locutus/php/datetime/mktime" { + function mktime(...args:any[]):any; + export = mktime; +} +declare module "locutus/php/datetime/strftime" { + function strftime(fmt?:any, timestamp?:any):any; + export = strftime; +} +declare module "locutus/php/datetime/strptime" { + function strptime(dateStr?:any, format?:any):any; + export = strptime; +} +declare module "locutus/php/datetime/strtotime" { + function strtotime(text?:any, now?:any):any; + export = strtotime; +} +declare module "locutus/php/datetime/time" { + function time():any; + export = time; +} +declare module "locutus/php/exec/escapeshellarg" { + function escapeshellarg(arg?:any):any; + export = escapeshellarg; +} +declare module "locutus/php/filesystem/basename" { + function basename(path?:any, suffix?:any):any; + export = basename; +} +declare module "locutus/php/filesystem/dirname" { + function dirname(path?:any):any; + export = dirname; +} +declare module "locutus/php/filesystem/file_get_contents" { + function file_get_contents(url?:any, flags?:any, context?:any, offset?:any, maxLen?:any):any; + export = file_get_contents; +} +declare module "locutus/php/filesystem/pathinfo" { + function pathinfo(...args:any[]):any; + export = pathinfo; +} +declare module "locutus/php/filesystem/realpath" { + function realpath(path?:any):any; + export = realpath; +} +declare module "locutus/php/funchand/call_user_func" { + function call_user_func(...args:any[]):any; + export = call_user_func; +} +declare module "locutus/php/funchand/call_user_func_array" { + function call_user_func_array(cb?:any, parameters?:any):any; + export = call_user_func_array; +} +declare module "locutus/php/funchand/create_function" { + function create_function(args?:any, code?:any):any; + export = create_function; +} +declare module "locutus/php/funchand/function_exists" { + function function_exists(funcName?:any):any; + export = function_exists; +} +declare module "locutus/php/funchand/get_defined_functions" { + function get_defined_functions():any; + export = get_defined_functions; +} +declare module "locutus/php/i18n/i18n_loc_get_default" { + function i18n_loc_get_default():any; + export = i18n_loc_get_default; +} +declare module "locutus/php/i18n/i18n_loc_set_default" { + function i18n_loc_set_default(name?:any):any; + export = i18n_loc_set_default; +} +declare module "locutus/php/info/assert_options" { + function assert_options(what?:any, value?:any):any; + export = assert_options; +} +declare module "locutus/php/info/getenv" { + function getenv(varname?:any):any; + export = getenv; +} +declare module "locutus/php/info/ini_get" { + function ini_get(varname?:any):any; + export = ini_get; +} +declare module "locutus/php/info/ini_set" { + function ini_set(varname?:any, newvalue?:any):any; + export = ini_set; +} +declare module "locutus/php/info/set_time_limit" { + function set_time_limit(seconds?:any):any; + export = set_time_limit; +} +declare module "locutus/php/info/version_compare" { + function version_compare(v1?:any, v2?:any, operator?:any):any; + export = version_compare; +} +declare module "locutus/php/json/json_decode" { + function json_decode(strJson?:any):any; + export = json_decode; +} +declare module "locutus/php/json/json_encode" { + function json_encode(mixedVal?:any):any; + export = json_encode; +} +declare module "locutus/php/json/json_last_error" { + function json_last_error():any; + export = json_last_error; +} +declare module "locutus/php/math/abs" { + function abs(mixedNumber?:any):any; + export = abs; +} +declare module "locutus/php/math/acos" { + function acos(arg?:any):any; + export = acos; +} +declare module "locutus/php/math/acosh" { + function acosh(arg?:any):any; + export = acosh; +} +declare module "locutus/php/math/asin" { + function asin(arg?:any):any; + export = asin; +} +declare module "locutus/php/math/asinh" { + function asinh(arg?:any):any; + export = asinh; +} +declare module "locutus/php/math/atan" { + function atan(arg?:any):any; + export = atan; +} +declare module "locutus/php/math/atan2" { + function atan2(y?:any, x?:any):any; + export = atan2; +} +declare module "locutus/php/math/atanh" { + function atanh(arg?:any):any; + export = atanh; +} +declare module "locutus/php/math/base_convert" { + function base_convert(number?:any, frombase?:any, tobase?:any):any; + export = base_convert; +} +declare module "locutus/php/math/bindec" { + function bindec(binaryString?:any):any; + export = bindec; +} +declare module "locutus/php/math/ceil" { + function ceil(value?:any):any; + export = ceil; +} +declare module "locutus/php/math/cos" { + function cos(arg?:any):any; + export = cos; +} +declare module "locutus/php/math/cosh" { + function cosh(arg?:any):any; + export = cosh; +} +declare module "locutus/php/math/decbin" { + function decbin(number?:any):any; + export = decbin; +} +declare module "locutus/php/math/dechex" { + function dechex(number?:any):any; + export = dechex; +} +declare module "locutus/php/math/decoct" { + function decoct(number?:any):any; + export = decoct; +} +declare module "locutus/php/math/deg2rad" { + function deg2rad(angle?:any):any; + export = deg2rad; +} +declare module "locutus/php/math/exp" { + function exp(arg?:any):any; + export = exp; +} +declare module "locutus/php/math/expm1" { + function expm1(x?:any):any; + export = expm1; +} +declare module "locutus/php/math/floor" { + function floor(value?:any):any; + export = floor; +} +declare module "locutus/php/math/fmod" { + function fmod(x?:any, y?:any):any; + export = fmod; +} +declare module "locutus/php/math/getrandmax" { + function getrandmax():any; + export = getrandmax; +} +declare module "locutus/php/math/hexdec" { + function hexdec(hexString?:any):any; + export = hexdec; +} +declare module "locutus/php/math/hypot" { + function hypot(x?:any, y?:any):any; + export = hypot; +} +declare module "locutus/php/math/is_finite" { + function is_finite(val?:any):any; + export = is_finite; +} +declare module "locutus/php/math/is_infinite" { + function is_infinite(val?:any):any; + export = is_infinite; +} +declare module "locutus/php/math/is_nan" { + function is_nan(val?:any):any; + export = is_nan; +} +declare module "locutus/php/math/lcg_value" { + function lcg_value():any; + export = lcg_value; +} +declare module "locutus/php/math/log" { + function log(arg?:any, base?:any):any; + export = log; +} +declare module "locutus/php/math/log10" { + function log10(arg?:any):any; + export = log10; +} +declare module "locutus/php/math/log1p" { + function log1p(x?:any):any; + export = log1p; +} +declare module "locutus/php/math/max" { + function max(...args:any[]):any; + export = max; +} +declare module "locutus/php/math/min" { + function min(...args:any[]):any; + export = min; +} +declare module "locutus/php/math/mt_getrandmax" { + function mt_getrandmax():any; + export = mt_getrandmax; +} +declare module "locutus/php/math/mt_rand" { + function mt_rand(...args:any[]):any; + export = mt_rand; +} +declare module "locutus/php/math/octdec" { + function octdec(octString?:any):any; + export = octdec; +} +declare module "locutus/php/math/pi" { + function pi():any; + export = pi; +} +declare module "locutus/php/math/pow" { + function pow(base?:any, exp?:any):any; + export = pow; +} +declare module "locutus/php/math/rad2deg" { + function rad2deg(angle?:any):any; + export = rad2deg; +} +declare module "locutus/php/math/rand" { + function rand(...args:any[]):any; + export = rand; +} +declare module "locutus/php/math/round" { + function round(...args:any[]):any; + export = round; +} +declare module "locutus/php/math/sin" { + function sin(arg?:any):any; + export = sin; +} +declare module "locutus/php/math/sinh" { + function sinh(arg?:any):any; + export = sinh; +} +declare module "locutus/php/math/sqrt" { + function sqrt(arg?:any):any; + export = sqrt; +} +declare module "locutus/php/math/tan" { + function tan(arg?:any):any; + export = tan; +} +declare module "locutus/php/math/tanh" { + function tanh(arg?:any):any; + export = tanh; +} +declare module "locutus/php/misc/pack" { + function pack(...args:any[]):any; + export = pack; +} +declare module "locutus/php/misc/uniqid" { + function uniqid(prefix?:any, moreEntropy?:any):any; + export = uniqid; +} +declare module "locutus/php/net-gopher/gopher_parsedir" { + function gopher_parsedir(dirent?:any):any; + export = gopher_parsedir; +} +declare module "locutus/php/network/inet_ntop" { + function inet_ntop(a?:any):any; + export = inet_ntop; +} +declare module "locutus/php/network/inet_pton" { + function inet_pton(a?:any):any; + export = inet_pton; +} +declare module "locutus/php/network/ip2long" { + function ip2long(argIP?:any):any; + export = ip2long; +} +declare module "locutus/php/network/long2ip" { + function long2ip(ip?:any):any; + export = long2ip; +} +declare module "locutus/php/network/setcookie" { + function setcookie(name?:any, value?:any, expires?:any, path?:any, domain?:any, secure?:any):any; + export = setcookie; +} +declare module "locutus/php/network/setrawcookie" { + function setrawcookie(name?:any, value?:any, expires?:any, path?:any, domain?:any, secure?:any):any; + export = setrawcookie; +} +declare module "locutus/php/pcre/preg_quote" { + function preg_quote(str?:any, delimiter?:any):any; + export = preg_quote; +} +declare module "locutus/php/pcre/sql_regcase" { + function sql_regcase(str?:any):any; + export = sql_regcase; +} +declare module "locutus/php/strings/addcslashes" { + function addcslashes(str?:any, charlist?:any):any; + export = addcslashes; +} +declare module "locutus/php/strings/addslashes" { + function addslashes(str?:any):any; + export = addslashes; +} +declare module "locutus/php/strings/bin2hex" { + function bin2hex(s?:any):any; + export = bin2hex; +} +declare module "locutus/php/strings/chop" { + function chop(str?:any, charlist?:any):any; + export = chop; +} +declare module "locutus/php/strings/chr" { + function chr(codePt?:any):any; + export = chr; +} +declare module "locutus/php/strings/chunk_split" { + function chunk_split(body?:any, chunklen?:any, end?:any):any; + export = chunk_split; +} +declare module "locutus/php/strings/convert_cyr_string" { + function convert_cyr_string(str?:any, from?:any, to?:any):any; + export = convert_cyr_string; +} +declare module "locutus/php/strings/convert_uuencode" { + function convert_uuencode(str?:any):any; + export = convert_uuencode; +} +declare module "locutus/php/strings/count_chars" { + function count_chars(str?:any, mode?:any):any; + export = count_chars; +} +declare module "locutus/php/strings/crc32" { + function crc32(str?:any):any; + export = crc32; +} +declare module "locutus/php/strings/echo" { + function echo(...args:any[]):any; + export = echo; +} +declare module "locutus/php/strings/explode" { + function explode(...args:any[]):any; + export = explode; +} +declare module "locutus/php/strings/get_html_translation_table" { + function get_html_translation_table(...args:any[]):any; + export = get_html_translation_table; +} +declare module "locutus/php/strings/hex2bin" { + function hex2bin(s?:any):any; + export = hex2bin; +} +declare module "locutus/php/strings/html_entity_decode" { + function html_entity_decode(string?:any, quoteStyle?:any):any; + export = html_entity_decode; +} +declare module "locutus/php/strings/htmlentities" { + function htmlentities(string?:any, quoteStyle?:any, charset?:any, doubleEncode?:any):any; + export = htmlentities; +} +declare module "locutus/php/strings/htmlspecialchars" { + function htmlspecialchars(string?:any, quoteStyle?:any, charset?:any, doubleEncode?:any):any; + export = htmlspecialchars; +} +declare module "locutus/php/strings/htmlspecialchars_decode" { + function htmlspecialchars_decode(string?:any, quoteStyle?:any):any; + export = htmlspecialchars_decode; +} +declare module "locutus/php/strings/implode" { + function implode(...args:any[]):any; + export = implode; +} +declare module "locutus/php/strings/join" { + function join(glue?:any, pieces?:any):any; + export = join; +} +declare module "locutus/php/strings/lcfirst" { + function lcfirst(str?:any):any; + export = lcfirst; +} +declare module "locutus/php/strings/levenshtein" { + function levenshtein(s1?:any, s2?:any, costIns?:any, costRep?:any, costDel?:any):any; + export = levenshtein; +} +declare module "locutus/php/strings/localeconv" { + function localeconv():any; + export = localeconv; +} +declare module "locutus/php/strings/ltrim" { + function ltrim(str?:any, charlist?:any):any; + export = ltrim; +} +declare module "locutus/php/strings/md5" { + function md5(str?:any):any; + export = md5; +} +declare module "locutus/php/strings/md5_file" { + function md5_file(str_filename?:any):any; + export = md5_file; +} +declare module "locutus/php/strings/metaphone" { + function metaphone(word?:any, maxPhonemes?:any):any; + export = metaphone; +} +declare module "locutus/php/strings/money_format" { + function money_format(format?:any, number?:any):any; + export = money_format; +} +declare module "locutus/php/strings/nl2br" { + function nl2br(str?:any, isXhtml?:any):any; + export = nl2br; +} +declare module "locutus/php/strings/nl_langinfo" { + function nl_langinfo(item?:any):any; + export = nl_langinfo; +} +declare module "locutus/php/strings/number_format" { + function number_format(number?:any, decimals?:any, decPoint?:any, thousandsSep?:any):any; + export = number_format; +} +declare module "locutus/php/strings/ord" { + function ord(string?:any):any; + export = ord; +} +declare module "locutus/php/strings/parse_str" { + function parse_str(str?:any, array?:any):any; + export = parse_str; +} +declare module "locutus/php/strings/printf" { + function printf(...args:any[]):any; + export = printf; +} +declare module "locutus/php/strings/quoted_printable_decode" { + function quoted_printable_decode(str?:any):any; + export = quoted_printable_decode; +} +declare module "locutus/php/strings/quoted_printable_encode" { + function quoted_printable_encode(str?:any):any; + export = quoted_printable_encode; +} +declare module "locutus/php/strings/quotemeta" { + function quotemeta(str?:any):any; + export = quotemeta; +} +declare module "locutus/php/strings/rtrim" { + function rtrim(str?:any, charlist?:any):any; + export = rtrim; +} +declare module "locutus/php/strings/setlocale" { + function setlocale(category?:any, locale?:any):any; + export = setlocale; +} +declare module "locutus/php/strings/sha1" { + function sha1(str?:any):any; + export = sha1; +} +declare module "locutus/php/strings/sha1_file" { + function sha1_file(str_filename?:any):any; + export = sha1_file; +} +declare module "locutus/php/strings/similar_text" { + function similar_text(first?:any, second?:any, percent?:any):any; + export = similar_text; +} +declare module "locutus/php/strings/soundex" { + function soundex(str?:any):any; + export = soundex; +} +declare module "locutus/php/strings/split" { + function split(delimiter?:any, string?:any):any; + export = split; +} +declare module "locutus/php/strings/sprintf" { + function sprintf(...args:any[]):any; + export = sprintf; +} +declare module "locutus/php/strings/sscanf" { + function sscanf(...args:any[]):any; + export = sscanf; +} +declare module "locutus/php/strings/str_getcsv" { + function str_getcsv(input?:any, delimiter?:any, enclosure?:any, escape?:any):any; + export = str_getcsv; +} +declare module "locutus/php/strings/str_ireplace" { + function str_ireplace(search?:any, replace?:any, subject?:any, countObj?:any):any; + export = str_ireplace; +} +declare module "locutus/php/strings/str_pad" { + function str_pad(input?:any, padLength?:any, padString?:any, padType?:any):any; + export = str_pad; +} +declare module "locutus/php/strings/str_repeat" { + function str_repeat(input?:any, multiplier?:any):any; + export = str_repeat; +} +declare module "locutus/php/strings/str_replace" { + function str_replace(search?:any, replace?:any, subject?:any, countObj?:any):any; + export = str_replace; +} +declare module "locutus/php/strings/str_rot13" { + function str_rot13(str?:any):any; + export = str_rot13; +} +declare module "locutus/php/strings/str_shuffle" { + function str_shuffle(...args:any[]):any; + export = str_shuffle; +} +declare module "locutus/php/strings/str_split" { + function str_split(string?:any, splitLength?:any):any; + export = str_split; +} +declare module "locutus/php/strings/str_word_count" { + function str_word_count(str?:any, format?:any, charlist?:any):any; + export = str_word_count; +} +declare module "locutus/php/strings/strcasecmp" { + function strcasecmp(fString1?:any, fString2?:any):any; + export = strcasecmp; +} +declare module "locutus/php/strings/strchr" { + function strchr(haystack?:any, needle?:any, bool?:any):any; + export = strchr; +} +declare module "locutus/php/strings/strcmp" { + function strcmp(str1?:any, str2?:any):any; + export = strcmp; +} +declare module "locutus/php/strings/strcoll" { + function strcoll(str1?:any, str2?:any):any; + export = strcoll; +} +declare module "locutus/php/strings/strcspn" { + function strcspn(str?:any, mask?:any, start?:any, length?:any):any; + export = strcspn; +} +declare module "locutus/php/strings/strip_tags" { + function strip_tags(input?:any, allowed?:any):any; + export = strip_tags; +} +declare module "locutus/php/strings/stripos" { + function stripos(fHaystack?:any, fNeedle?:any, fOffset?:any):any; + export = stripos; +} +declare module "locutus/php/strings/stripslashes" { + function stripslashes(str?:any):any; + export = stripslashes; +} +declare module "locutus/php/strings/stristr" { + function stristr(haystack?:any, needle?:any, bool?:any):any; + export = stristr; +} +declare module "locutus/php/strings/strlen" { + function strlen(string?:any):any; + export = strlen; +} +declare module "locutus/php/strings/strnatcasecmp" { + function strnatcasecmp(str1?:any, str2?:any):any; + export = strnatcasecmp; +} +declare module "locutus/php/strings/strnatcmp" { + function strnatcmp(fString1?:any, fString2?:any, fVersion?:any):any; + export = strnatcmp; +} +declare module "locutus/php/strings/strncasecmp" { + function strncasecmp(argStr1?:any, argStr2?:any, len?:any):any; + export = strncasecmp; +} +declare module "locutus/php/strings/strncmp" { + function strncmp(str1?:any, str2?:any, lgth?:any):any; + export = strncmp; +} +declare module "locutus/php/strings/strpbrk" { + function strpbrk(haystack?:any, charList?:any):any; + export = strpbrk; +} +declare module "locutus/php/strings/strpos" { + function strpos(haystack?:any, needle?:any, offset?:any):any; + export = strpos; +} +declare module "locutus/php/strings/strrchr" { + function strrchr(haystack?:any, needle?:any):any; + export = strrchr; +} +declare module "locutus/php/strings/strrev" { + function strrev(string?:any):any; + export = strrev; +} +declare module "locutus/php/strings/strripos" { + function strripos(haystack?:any, needle?:any, offset?:any):any; + export = strripos; +} +declare module "locutus/php/strings/strrpos" { + function strrpos(haystack?:any, needle?:any, offset?:any):any; + export = strrpos; +} +declare module "locutus/php/strings/strspn" { + function strspn(str1?:any, str2?:any, start?:any, lgth?:any):any; + export = strspn; +} +declare module "locutus/php/strings/strstr" { + function strstr(haystack?:any, needle?:any, bool?:any):any; + export = strstr; +} +declare module "locutus/php/strings/strtok" { + function strtok(str?:any, tokens?:any):any; + export = strtok; +} +declare module "locutus/php/strings/strtolower" { + function strtolower(str?:any):any; + export = strtolower; +} +declare module "locutus/php/strings/strtoupper" { + function strtoupper(str?:any):any; + export = strtoupper; +} +declare module "locutus/php/strings/strtr" { + function strtr(str?:any, trFrom?:any, trTo?:any):any; + export = strtr; +} +declare module "locutus/php/strings/substr" { + function substr(str?:any, start?:any, len?:any):any; + export = substr; +} +declare module "locutus/php/strings/substr_compare" { + function substr_compare(mainStr?:any, str?:any, offset?:any, length?:any, caseInsensitivity?:any):any; + export = substr_compare; +} +declare module "locutus/php/strings/substr_count" { + function substr_count(haystack?:any, needle?:any, offset?:any, length?:any):any; + export = substr_count; +} +declare module "locutus/php/strings/substr_replace" { + function substr_replace(str?:any, replace?:any, start?:any, length?:any):any; + export = substr_replace; +} +declare module "locutus/php/strings/trim" { + function trim(str?:any, charlist?:any):any; + export = trim; +} +declare module "locutus/php/strings/ucfirst" { + function ucfirst(str?:any):any; + export = ucfirst; +} +declare module "locutus/php/strings/ucwords" { + function ucwords(str?:any):any; + export = ucwords; +} +declare module "locutus/php/strings/vprintf" { + function vprintf(format?:any, args?:any):any; + export = vprintf; +} +declare module "locutus/php/strings/vsprintf" { + function vsprintf(format?:any, args?:any):any; + export = vsprintf; +} +declare module "locutus/php/strings/wordwrap" { + function wordwrap(...args:any[]):any; + export = wordwrap; +} +declare module "locutus/php/url/base64_decode" { + function base64_decode(encodedData?:any):any; + export = base64_decode; +} +declare module "locutus/php/url/base64_encode" { + function base64_encode(stringToEncode?:any):any; + export = base64_encode; +} +declare module "locutus/php/url/http_build_query" { + function http_build_query(formdata?:any, numericPrefix?:any, argSeparator?:any):any; + export = http_build_query; +} +declare module "locutus/php/url/parse_url" { + function parse_url(str?:any, component?:any):any; + export = parse_url; +} +declare module "locutus/php/url/rawurldecode" { + function rawurldecode(str?:any):any; + export = rawurldecode; +} +declare module "locutus/php/url/rawurlencode" { + function rawurlencode(str?:any):any; + export = rawurlencode; +} +declare module "locutus/php/url/urldecode" { + function urldecode(str?:any):any; + export = urldecode; +} +declare module "locutus/php/url/urlencode" { + function urlencode(str?:any):any; + export = urlencode; +} +declare module "locutus/php/var/doubleval" { + function doubleval(mixedVar?:any):any; + export = doubleval; +} +declare module "locutus/php/var/empty" { + function empty(mixedVar?:any):any; + export = empty; +} +declare module "locutus/php/var/floatval" { + function floatval(mixedVar?:any):any; + export = floatval; +} +declare module "locutus/php/var/gettype" { + function gettype(mixedVar?:any):any; + export = gettype; +} +declare module "locutus/php/var/intval" { + function intval(mixedVar?:any, base?:any):any; + export = intval; +} +declare module "locutus/php/var/is_array" { + function is_array(mixedVar?:any):any; + export = is_array; +} +declare module "locutus/php/var/is_binary" { + function is_binary(vr?:any):any; + export = is_binary; +} +declare module "locutus/php/var/is_bool" { + function is_bool(mixedVar?:any):any; + export = is_bool; +} +declare module "locutus/php/var/is_buffer" { + function is_buffer(vr?:any):any; + export = is_buffer; +} +declare module "locutus/php/var/is_callable" { + function is_callable(mixedVar?:any, syntaxOnly?:any, callableName?:any):any; + export = is_callable; +} +declare module "locutus/php/var/is_double" { + function is_double(mixedVar?:any):any; + export = is_double; +} +declare module "locutus/php/var/is_float" { + function is_float(mixedVar?:any):any; + export = is_float; +} +declare module "locutus/php/var/is_int" { + function is_int(mixedVar?:any):any; + export = is_int; +} +declare module "locutus/php/var/is_integer" { + function is_integer(mixedVar?:any):any; + export = is_integer; +} +declare module "locutus/php/var/is_long" { + function is_long(mixedVar?:any):any; + export = is_long; +} +declare module "locutus/php/var/is_null" { + function is_null(mixedVar?:any):any; + export = is_null; +} +declare module "locutus/php/var/is_numeric" { + function is_numeric(mixedVar?:any):any; + export = is_numeric; +} +declare module "locutus/php/var/is_object" { + function is_object(mixedVar?:any):any; + export = is_object; +} +declare module "locutus/php/var/is_real" { + function is_real(mixedVar?:any):any; + export = is_real; +} +declare module "locutus/php/var/is_scalar" { + function is_scalar(mixedVar?:any):any; + export = is_scalar; +} +declare module "locutus/php/var/is_string" { + function is_string(mixedVar?:any):any; + export = is_string; +} +declare module "locutus/php/var/is_unicode" { + function is_unicode(vr?:any):any; + export = is_unicode; +} +declare module "locutus/php/var/isset" { + function isset(...args:any[]):any; + export = isset; +} +declare module "locutus/php/var/print_r" { + function print_r(array?:any, returnVal?:any):any; + export = print_r; +} +declare module "locutus/php/var/serialize" { + function serialize(mixedValue?:any):any; + export = serialize; +} +declare module "locutus/php/var/strval" { + function strval(str?:any):any; + export = strval; +} +declare module "locutus/php/var/unserialize" { + function unserialize(data?:any):any; + export = unserialize; +} +declare module "locutus/php/var/var_dump" { + function var_dump(...args:any[]):any; + export = var_dump; +} +declare module "locutus/php/var/var_export" { + function var_export(...args:any[]):any; + export = var_export; +} +declare module "locutus/php/xdiff/xdiff_string_diff" { + function xdiff_string_diff(...args:any[]):any; + export = xdiff_string_diff; +} +declare module "locutus/php/xdiff/xdiff_string_patch" { + function xdiff_string_patch(...args:any[]):any; + export = xdiff_string_patch; +} +declare module "locutus/php/xml/utf8_decode" { + function utf8_decode(strData?:any):any; + export = utf8_decode; +} +declare module "locutus/php/xml/utf8_encode" { + function utf8_encode(argString?:any):any; + export = utf8_encode; +} +declare module "locutus/python/string/capwords" { + function capwords(str?:any):any; + export = capwords; +} +declare module "locutus/ruby/Math/acos" { + function acos(arg?:any):any; + export = acos; +} +declare module "locutus/c/math" { + import abs = require("locutus/c/math/abs"); + export {abs}; +} +declare module "locutus/golang/strings" { + import Contains = require("locutus/golang/strings/Contains"); + import Count = require("locutus/golang/strings/Count"); + import Index = require("locutus/golang/strings/Index"); + import LastIndex = require("locutus/golang/strings/LastIndex"); + export {Contains,Count,Index,LastIndex}; +} +declare module "locutus/php/array" { + import array_change_key_case = require("locutus/php/array/array_change_key_case"); + import array_chunk = require("locutus/php/array/array_chunk"); + import array_combine = require("locutus/php/array/array_combine"); + import array_count_values = require("locutus/php/array/array_count_values"); + import array_diff = require("locutus/php/array/array_diff"); + import array_diff_assoc = require("locutus/php/array/array_diff_assoc"); + import array_diff_key = require("locutus/php/array/array_diff_key"); + import array_diff_uassoc = require("locutus/php/array/array_diff_uassoc"); + import array_diff_ukey = require("locutus/php/array/array_diff_ukey"); + import array_fill = require("locutus/php/array/array_fill"); + import array_fill_keys = require("locutus/php/array/array_fill_keys"); + import array_filter = require("locutus/php/array/array_filter"); + import array_flip = require("locutus/php/array/array_flip"); + import array_intersect = require("locutus/php/array/array_intersect"); + import array_intersect_assoc = require("locutus/php/array/array_intersect_assoc"); + import array_intersect_key = require("locutus/php/array/array_intersect_key"); + import array_intersect_uassoc = require("locutus/php/array/array_intersect_uassoc"); + import array_intersect_ukey = require("locutus/php/array/array_intersect_ukey"); + import array_key_exists = require("locutus/php/array/array_key_exists"); + import array_keys = require("locutus/php/array/array_keys"); + import array_map = require("locutus/php/array/array_map"); + import array_merge = require("locutus/php/array/array_merge"); + import array_merge_recursive = require("locutus/php/array/array_merge_recursive"); + import array_multisort = require("locutus/php/array/array_multisort"); + import array_pad = require("locutus/php/array/array_pad"); + import array_pop = require("locutus/php/array/array_pop"); + import array_product = require("locutus/php/array/array_product"); + import array_push = require("locutus/php/array/array_push"); + import array_rand = require("locutus/php/array/array_rand"); + import array_reduce = require("locutus/php/array/array_reduce"); + import array_replace = require("locutus/php/array/array_replace"); + import array_replace_recursive = require("locutus/php/array/array_replace_recursive"); + import array_reverse = require("locutus/php/array/array_reverse"); + import array_search = require("locutus/php/array/array_search"); + import array_shift = require("locutus/php/array/array_shift"); + import array_slice = require("locutus/php/array/array_slice"); + import array_splice = require("locutus/php/array/array_splice"); + import array_sum = require("locutus/php/array/array_sum"); + import array_udiff = require("locutus/php/array/array_udiff"); + import array_udiff_assoc = require("locutus/php/array/array_udiff_assoc"); + import array_udiff_uassoc = require("locutus/php/array/array_udiff_uassoc"); + import array_uintersect = require("locutus/php/array/array_uintersect"); + import array_uintersect_uassoc = require("locutus/php/array/array_uintersect_uassoc"); + import array_unique = require("locutus/php/array/array_unique"); + import array_unshift = require("locutus/php/array/array_unshift"); + import array_values = require("locutus/php/array/array_values"); + import array_walk = require("locutus/php/array/array_walk"); + import arsort = require("locutus/php/array/arsort"); + import asort = require("locutus/php/array/asort"); + import count = require("locutus/php/array/count"); + import current = require("locutus/php/array/current"); + import each = require("locutus/php/array/each"); + import end = require("locutus/php/array/end"); + import in_array = require("locutus/php/array/in_array"); + import key = require("locutus/php/array/key"); + import krsort = require("locutus/php/array/krsort"); + import ksort = require("locutus/php/array/ksort"); + import natcasesort = require("locutus/php/array/natcasesort"); + import natsort = require("locutus/php/array/natsort"); + import next = require("locutus/php/array/next"); + import pos = require("locutus/php/array/pos"); + import prev = require("locutus/php/array/prev"); + import range = require("locutus/php/array/range"); + import reset = require("locutus/php/array/reset"); + import rsort = require("locutus/php/array/rsort"); + import shuffle = require("locutus/php/array/shuffle"); + import sizeof = require("locutus/php/array/sizeof"); + import sort = require("locutus/php/array/sort"); + import uasort = require("locutus/php/array/uasort"); + import uksort = require("locutus/php/array/uksort"); + import usort = require("locutus/php/array/usort"); + export {array_change_key_case,array_chunk,array_combine,array_count_values,array_diff,array_diff_assoc,array_diff_key,array_diff_uassoc,array_diff_ukey,array_fill,array_fill_keys,array_filter,array_flip,array_intersect,array_intersect_assoc,array_intersect_key,array_intersect_uassoc,array_intersect_ukey,array_key_exists,array_keys,array_map,array_merge,array_merge_recursive,array_multisort,array_pad,array_pop,array_product,array_push,array_rand,array_reduce,array_replace,array_replace_recursive,array_reverse,array_search,array_shift,array_slice,array_splice,array_sum,array_udiff,array_udiff_assoc,array_udiff_uassoc,array_uintersect,array_uintersect_uassoc,array_unique,array_unshift,array_values,array_walk,arsort,asort,count,current,each,end,in_array,key,krsort,ksort,natcasesort,natsort,next,pos,prev,range,reset,rsort,shuffle,sizeof,sort,uasort,uksort,usort}; +} +declare module "locutus/php/bc" { + import bcadd = require("locutus/php/bc/bcadd"); + import bccomp = require("locutus/php/bc/bccomp"); + import bcdiv = require("locutus/php/bc/bcdiv"); + import bcmul = require("locutus/php/bc/bcmul"); + import bcround = require("locutus/php/bc/bcround"); + import bcscale = require("locutus/php/bc/bcscale"); + import bcsub = require("locutus/php/bc/bcsub"); + export {bcadd,bccomp,bcdiv,bcmul,bcround,bcscale,bcsub}; +} +declare module "locutus/php/ctype" { + import ctype_alnum = require("locutus/php/ctype/ctype_alnum"); + import ctype_alpha = require("locutus/php/ctype/ctype_alpha"); + import ctype_cntrl = require("locutus/php/ctype/ctype_cntrl"); + import ctype_digit = require("locutus/php/ctype/ctype_digit"); + import ctype_graph = require("locutus/php/ctype/ctype_graph"); + import ctype_lower = require("locutus/php/ctype/ctype_lower"); + import ctype_print = require("locutus/php/ctype/ctype_print"); + import ctype_punct = require("locutus/php/ctype/ctype_punct"); + import ctype_space = require("locutus/php/ctype/ctype_space"); + import ctype_upper = require("locutus/php/ctype/ctype_upper"); + import ctype_xdigit = require("locutus/php/ctype/ctype_xdigit"); + export {ctype_alnum,ctype_alpha,ctype_cntrl,ctype_digit,ctype_graph,ctype_lower,ctype_print,ctype_punct,ctype_space,ctype_upper,ctype_xdigit}; +} +declare module "locutus/php/datetime" { + import checkdate = require("locutus/php/datetime/checkdate"); + import date = require("locutus/php/datetime/date"); + import date_parse = require("locutus/php/datetime/date_parse"); + import getdate = require("locutus/php/datetime/getdate"); + import gettimeofday = require("locutus/php/datetime/gettimeofday"); + import gmdate = require("locutus/php/datetime/gmdate"); + import gmmktime = require("locutus/php/datetime/gmmktime"); + import gmstrftime = require("locutus/php/datetime/gmstrftime"); + import idate = require("locutus/php/datetime/idate"); + import microtime = require("locutus/php/datetime/microtime"); + import mktime = require("locutus/php/datetime/mktime"); + import strftime = require("locutus/php/datetime/strftime"); + import strptime = require("locutus/php/datetime/strptime"); + import strtotime = require("locutus/php/datetime/strtotime"); + import time = require("locutus/php/datetime/time"); + export {checkdate,date,date_parse,getdate,gettimeofday,gmdate,gmmktime,gmstrftime,idate,microtime,mktime,strftime,strptime,strtotime,time}; +} +declare module "locutus/php/exec" { + import escapeshellarg = require("locutus/php/exec/escapeshellarg"); + export {escapeshellarg}; +} +declare module "locutus/php/filesystem" { + import basename = require("locutus/php/filesystem/basename"); + import dirname = require("locutus/php/filesystem/dirname"); + import file_get_contents = require("locutus/php/filesystem/file_get_contents"); + import pathinfo = require("locutus/php/filesystem/pathinfo"); + import realpath = require("locutus/php/filesystem/realpath"); + export {basename,dirname,file_get_contents,pathinfo,realpath}; +} +declare module "locutus/php/funchand" { + import call_user_func = require("locutus/php/funchand/call_user_func"); + import call_user_func_array = require("locutus/php/funchand/call_user_func_array"); + import create_function = require("locutus/php/funchand/create_function"); + import function_exists = require("locutus/php/funchand/function_exists"); + import get_defined_functions = require("locutus/php/funchand/get_defined_functions"); + export {call_user_func,call_user_func_array,create_function,function_exists,get_defined_functions}; +} +declare module "locutus/php/i18n" { + import i18n_loc_get_default = require("locutus/php/i18n/i18n_loc_get_default"); + import i18n_loc_set_default = require("locutus/php/i18n/i18n_loc_set_default"); + export {i18n_loc_get_default,i18n_loc_set_default}; +} +declare module "locutus/php/info" { + import assert_options = require("locutus/php/info/assert_options"); + import getenv = require("locutus/php/info/getenv"); + import ini_get = require("locutus/php/info/ini_get"); + import ini_set = require("locutus/php/info/ini_set"); + import set_time_limit = require("locutus/php/info/set_time_limit"); + import version_compare = require("locutus/php/info/version_compare"); + export {assert_options,getenv,ini_get,ini_set,set_time_limit,version_compare}; +} +declare module "locutus/php/json" { + import json_decode = require("locutus/php/json/json_decode"); + import json_encode = require("locutus/php/json/json_encode"); + import json_last_error = require("locutus/php/json/json_last_error"); + export {json_decode,json_encode,json_last_error}; +} +declare module "locutus/php/math" { + import abs = require("locutus/php/math/abs"); + import acos = require("locutus/php/math/acos"); + import acosh = require("locutus/php/math/acosh"); + import asin = require("locutus/php/math/asin"); + import asinh = require("locutus/php/math/asinh"); + import atan = require("locutus/php/math/atan"); + import atan2 = require("locutus/php/math/atan2"); + import atanh = require("locutus/php/math/atanh"); + import base_convert = require("locutus/php/math/base_convert"); + import bindec = require("locutus/php/math/bindec"); + import ceil = require("locutus/php/math/ceil"); + import cos = require("locutus/php/math/cos"); + import cosh = require("locutus/php/math/cosh"); + import decbin = require("locutus/php/math/decbin"); + import dechex = require("locutus/php/math/dechex"); + import decoct = require("locutus/php/math/decoct"); + import deg2rad = require("locutus/php/math/deg2rad"); + import exp = require("locutus/php/math/exp"); + import expm1 = require("locutus/php/math/expm1"); + import floor = require("locutus/php/math/floor"); + import fmod = require("locutus/php/math/fmod"); + import getrandmax = require("locutus/php/math/getrandmax"); + import hexdec = require("locutus/php/math/hexdec"); + import hypot = require("locutus/php/math/hypot"); + import is_finite = require("locutus/php/math/is_finite"); + import is_infinite = require("locutus/php/math/is_infinite"); + import is_nan = require("locutus/php/math/is_nan"); + import lcg_value = require("locutus/php/math/lcg_value"); + import log = require("locutus/php/math/log"); + import log10 = require("locutus/php/math/log10"); + import log1p = require("locutus/php/math/log1p"); + import max = require("locutus/php/math/max"); + import min = require("locutus/php/math/min"); + import mt_getrandmax = require("locutus/php/math/mt_getrandmax"); + import mt_rand = require("locutus/php/math/mt_rand"); + import octdec = require("locutus/php/math/octdec"); + import pi = require("locutus/php/math/pi"); + import pow = require("locutus/php/math/pow"); + import rad2deg = require("locutus/php/math/rad2deg"); + import rand = require("locutus/php/math/rand"); + import round = require("locutus/php/math/round"); + import sin = require("locutus/php/math/sin"); + import sinh = require("locutus/php/math/sinh"); + import sqrt = require("locutus/php/math/sqrt"); + import tan = require("locutus/php/math/tan"); + import tanh = require("locutus/php/math/tanh"); + export {abs,acos,acosh,asin,asinh,atan,atan2,atanh,base_convert,bindec,ceil,cos,cosh,decbin,dechex,decoct,deg2rad,exp,expm1,floor,fmod,getrandmax,hexdec,hypot,is_finite,is_infinite,is_nan,lcg_value,log,log10,log1p,max,min,mt_getrandmax,mt_rand,octdec,pi,pow,rad2deg,rand,round,sin,sinh,sqrt,tan,tanh}; +} +declare module "locutus/php/misc" { + import pack = require("locutus/php/misc/pack"); + import uniqid = require("locutus/php/misc/uniqid"); + export {pack,uniqid}; +} +declare module "locutus/php/net-gopher" { + import gopher_parsedir = require("locutus/php/net-gopher/gopher_parsedir"); + export {gopher_parsedir}; +} +declare module "locutus/php/network" { + import inet_ntop = require("locutus/php/network/inet_ntop"); + import inet_pton = require("locutus/php/network/inet_pton"); + import ip2long = require("locutus/php/network/ip2long"); + import long2ip = require("locutus/php/network/long2ip"); + import setcookie = require("locutus/php/network/setcookie"); + import setrawcookie = require("locutus/php/network/setrawcookie"); + export {inet_ntop,inet_pton,ip2long,long2ip,setcookie,setrawcookie}; +} +declare module "locutus/php/pcre" { + import preg_quote = require("locutus/php/pcre/preg_quote"); + import sql_regcase = require("locutus/php/pcre/sql_regcase"); + export {preg_quote,sql_regcase}; +} +declare module "locutus/php/strings" { + import addcslashes = require("locutus/php/strings/addcslashes"); + import addslashes = require("locutus/php/strings/addslashes"); + import bin2hex = require("locutus/php/strings/bin2hex"); + import chop = require("locutus/php/strings/chop"); + import chr = require("locutus/php/strings/chr"); + import chunk_split = require("locutus/php/strings/chunk_split"); + import convert_cyr_string = require("locutus/php/strings/convert_cyr_string"); + import convert_uuencode = require("locutus/php/strings/convert_uuencode"); + import count_chars = require("locutus/php/strings/count_chars"); + import crc32 = require("locutus/php/strings/crc32"); + import echo = require("locutus/php/strings/echo"); + import explode = require("locutus/php/strings/explode"); + import get_html_translation_table = require("locutus/php/strings/get_html_translation_table"); + import hex2bin = require("locutus/php/strings/hex2bin"); + import html_entity_decode = require("locutus/php/strings/html_entity_decode"); + import htmlentities = require("locutus/php/strings/htmlentities"); + import htmlspecialchars = require("locutus/php/strings/htmlspecialchars"); + import htmlspecialchars_decode = require("locutus/php/strings/htmlspecialchars_decode"); + import implode = require("locutus/php/strings/implode"); + import join = require("locutus/php/strings/join"); + import lcfirst = require("locutus/php/strings/lcfirst"); + import levenshtein = require("locutus/php/strings/levenshtein"); + import localeconv = require("locutus/php/strings/localeconv"); + import ltrim = require("locutus/php/strings/ltrim"); + import md5 = require("locutus/php/strings/md5"); + import md5_file = require("locutus/php/strings/md5_file"); + import metaphone = require("locutus/php/strings/metaphone"); + import money_format = require("locutus/php/strings/money_format"); + import nl2br = require("locutus/php/strings/nl2br"); + import nl_langinfo = require("locutus/php/strings/nl_langinfo"); + import number_format = require("locutus/php/strings/number_format"); + import ord = require("locutus/php/strings/ord"); + import parse_str = require("locutus/php/strings/parse_str"); + import printf = require("locutus/php/strings/printf"); + import quoted_printable_decode = require("locutus/php/strings/quoted_printable_decode"); + import quoted_printable_encode = require("locutus/php/strings/quoted_printable_encode"); + import quotemeta = require("locutus/php/strings/quotemeta"); + import rtrim = require("locutus/php/strings/rtrim"); + import setlocale = require("locutus/php/strings/setlocale"); + import sha1 = require("locutus/php/strings/sha1"); + import sha1_file = require("locutus/php/strings/sha1_file"); + import similar_text = require("locutus/php/strings/similar_text"); + import soundex = require("locutus/php/strings/soundex"); + import split = require("locutus/php/strings/split"); + import sprintf = require("locutus/php/strings/sprintf"); + import sscanf = require("locutus/php/strings/sscanf"); + import str_getcsv = require("locutus/php/strings/str_getcsv"); + import str_ireplace = require("locutus/php/strings/str_ireplace"); + import str_pad = require("locutus/php/strings/str_pad"); + import str_repeat = require("locutus/php/strings/str_repeat"); + import str_replace = require("locutus/php/strings/str_replace"); + import str_rot13 = require("locutus/php/strings/str_rot13"); + import str_shuffle = require("locutus/php/strings/str_shuffle"); + import str_split = require("locutus/php/strings/str_split"); + import str_word_count = require("locutus/php/strings/str_word_count"); + import strcasecmp = require("locutus/php/strings/strcasecmp"); + import strchr = require("locutus/php/strings/strchr"); + import strcmp = require("locutus/php/strings/strcmp"); + import strcoll = require("locutus/php/strings/strcoll"); + import strcspn = require("locutus/php/strings/strcspn"); + import strip_tags = require("locutus/php/strings/strip_tags"); + import stripos = require("locutus/php/strings/stripos"); + import stripslashes = require("locutus/php/strings/stripslashes"); + import stristr = require("locutus/php/strings/stristr"); + import strlen = require("locutus/php/strings/strlen"); + import strnatcasecmp = require("locutus/php/strings/strnatcasecmp"); + import strnatcmp = require("locutus/php/strings/strnatcmp"); + import strncasecmp = require("locutus/php/strings/strncasecmp"); + import strncmp = require("locutus/php/strings/strncmp"); + import strpbrk = require("locutus/php/strings/strpbrk"); + import strpos = require("locutus/php/strings/strpos"); + import strrchr = require("locutus/php/strings/strrchr"); + import strrev = require("locutus/php/strings/strrev"); + import strripos = require("locutus/php/strings/strripos"); + import strrpos = require("locutus/php/strings/strrpos"); + import strspn = require("locutus/php/strings/strspn"); + import strstr = require("locutus/php/strings/strstr"); + import strtok = require("locutus/php/strings/strtok"); + import strtolower = require("locutus/php/strings/strtolower"); + import strtoupper = require("locutus/php/strings/strtoupper"); + import strtr = require("locutus/php/strings/strtr"); + import substr = require("locutus/php/strings/substr"); + import substr_compare = require("locutus/php/strings/substr_compare"); + import substr_count = require("locutus/php/strings/substr_count"); + import substr_replace = require("locutus/php/strings/substr_replace"); + import trim = require("locutus/php/strings/trim"); + import ucfirst = require("locutus/php/strings/ucfirst"); + import ucwords = require("locutus/php/strings/ucwords"); + import vprintf = require("locutus/php/strings/vprintf"); + import vsprintf = require("locutus/php/strings/vsprintf"); + import wordwrap = require("locutus/php/strings/wordwrap"); + export {addcslashes,addslashes,bin2hex,chop,chr,chunk_split,convert_cyr_string,convert_uuencode,count_chars,crc32,echo,explode,get_html_translation_table,hex2bin,html_entity_decode,htmlentities,htmlspecialchars,htmlspecialchars_decode,implode,join,lcfirst,levenshtein,localeconv,ltrim,md5,md5_file,metaphone,money_format,nl2br,nl_langinfo,number_format,ord,parse_str,printf,quoted_printable_decode,quoted_printable_encode,quotemeta,rtrim,setlocale,sha1,sha1_file,similar_text,soundex,split,sprintf,sscanf,str_getcsv,str_ireplace,str_pad,str_repeat,str_replace,str_rot13,str_shuffle,str_split,str_word_count,strcasecmp,strchr,strcmp,strcoll,strcspn,strip_tags,stripos,stripslashes,stristr,strlen,strnatcasecmp,strnatcmp,strncasecmp,strncmp,strpbrk,strpos,strrchr,strrev,strripos,strrpos,strspn,strstr,strtok,strtolower,strtoupper,strtr,substr,substr_compare,substr_count,substr_replace,trim,ucfirst,ucwords,vprintf,vsprintf,wordwrap}; +} +declare module "locutus/php/url" { + import base64_decode = require("locutus/php/url/base64_decode"); + import base64_encode = require("locutus/php/url/base64_encode"); + import http_build_query = require("locutus/php/url/http_build_query"); + import parse_url = require("locutus/php/url/parse_url"); + import rawurldecode = require("locutus/php/url/rawurldecode"); + import rawurlencode = require("locutus/php/url/rawurlencode"); + import urldecode = require("locutus/php/url/urldecode"); + import urlencode = require("locutus/php/url/urlencode"); + export {base64_decode,base64_encode,http_build_query,parse_url,rawurldecode,rawurlencode,urldecode,urlencode}; +} +declare module "locutus/php/var" { + import doubleval = require("locutus/php/var/doubleval"); + import empty = require("locutus/php/var/empty"); + import floatval = require("locutus/php/var/floatval"); + import gettype = require("locutus/php/var/gettype"); + import intval = require("locutus/php/var/intval"); + import is_array = require("locutus/php/var/is_array"); + import is_binary = require("locutus/php/var/is_binary"); + import is_bool = require("locutus/php/var/is_bool"); + import is_buffer = require("locutus/php/var/is_buffer"); + import is_callable = require("locutus/php/var/is_callable"); + import is_double = require("locutus/php/var/is_double"); + import is_float = require("locutus/php/var/is_float"); + import is_int = require("locutus/php/var/is_int"); + import is_integer = require("locutus/php/var/is_integer"); + import is_long = require("locutus/php/var/is_long"); + import is_null = require("locutus/php/var/is_null"); + import is_numeric = require("locutus/php/var/is_numeric"); + import is_object = require("locutus/php/var/is_object"); + import is_real = require("locutus/php/var/is_real"); + import is_scalar = require("locutus/php/var/is_scalar"); + import is_string = require("locutus/php/var/is_string"); + import is_unicode = require("locutus/php/var/is_unicode"); + import isset = require("locutus/php/var/isset"); + import print_r = require("locutus/php/var/print_r"); + import serialize = require("locutus/php/var/serialize"); + import strval = require("locutus/php/var/strval"); + import unserialize = require("locutus/php/var/unserialize"); + import var_dump = require("locutus/php/var/var_dump"); + import var_export = require("locutus/php/var/var_export"); + export {doubleval,empty,floatval,gettype,intval,is_array,is_binary,is_bool,is_buffer,is_callable,is_double,is_float,is_int,is_integer,is_long,is_null,is_numeric,is_object,is_real,is_scalar,is_string,is_unicode,isset,print_r,serialize,strval,unserialize,var_dump,var_export}; +} +declare module "locutus/php/xdiff" { + import xdiff_string_diff = require("locutus/php/xdiff/xdiff_string_diff"); + import xdiff_string_patch = require("locutus/php/xdiff/xdiff_string_patch"); + export {xdiff_string_diff,xdiff_string_patch}; +} +declare module "locutus/php/xml" { + import utf8_decode = require("locutus/php/xml/utf8_decode"); + import utf8_encode = require("locutus/php/xml/utf8_encode"); + export {utf8_decode,utf8_encode}; +} +declare module "locutus/python/string" { + import capwords = require("locutus/python/string/capwords"); + export {capwords}; +} +declare module "locutus/ruby/Math" { + import acos = require("locutus/ruby/Math/acos"); + export {acos}; +} +declare module "locutus/c" { + import math = require("locutus/c/math"); + export {math}; +} +declare module "locutus/golang" { + import strings = require("locutus/golang/strings"); + export {strings}; +} +declare module "locutus/php" { + import array = require("locutus/php/array"); + import bc = require("locutus/php/bc"); + import ctype = require("locutus/php/ctype"); + import datetime = require("locutus/php/datetime"); + import exec = require("locutus/php/exec"); + import filesystem = require("locutus/php/filesystem"); + import funchand = require("locutus/php/funchand"); + import i18n = require("locutus/php/i18n"); + import info = require("locutus/php/info"); + import json = require("locutus/php/json"); + import math = require("locutus/php/math"); + import misc = require("locutus/php/misc"); + // import net_gopher = require("locutus/php/net-gopher"); + import network = require("locutus/php/network"); + import pcre = require("locutus/php/pcre"); + import strings = require("locutus/php/strings"); + import url = require("locutus/php/url"); + // import Var = require("locutus/php/var"); + import xdiff = require("locutus/php/xdiff"); + import xml = require("locutus/php/xml"); + export {array,bc,ctype,datetime,exec,filesystem,funchand,i18n,info,json,math,misc,network,pcre,strings,url,xdiff,xml /* ,"net-gopher":net_gopher */ /* ,"var":Var */}; +} +declare module "locutus/python" { + import string = require("locutus/python/string"); + export {string}; +} +declare module "locutus/ruby" { + import Math = require("locutus/ruby/Math"); + export {Math}; +} +declare module "locutus" { + import c = require("locutus/c"); + import golang = require("locutus/golang"); + import php = require("locutus/php"); + import python = require("locutus/python"); + import ruby = require("locutus/ruby"); + export {c,golang,php,python,ruby}; +} diff --git a/locutus/locutus_print.ts b/locutus/locutus_print.ts new file mode 100644 index 0000000000..fc21294639 --- /dev/null +++ b/locutus/locutus_print.ts @@ -0,0 +1,188 @@ +// Automatically generate script for locutus +// Written by: Hookclaw + +/* Usage + tsc locutus_print.ts + node locutus_print.js define + */ + +/// +/// + +var locutus = require('locutus'); + +type f = (...args:any[]) => any; +type e = {[key:string]:f}; +type d = {[key:string]:e}; +type c = {[key:string]:d}; + +let loc:c = locutus; + +let run = ():void => { + if(process.argv.length > 1) { + switch(process.argv[2]) { + case 'define': + define(); + return; + case 'test': + test(); + return; + case 'settings': + settings(); + return; + } + } + console.log('settings,list,define'); +}; + +let define = ():void => { + console.log('// Type definitions for locutus'); + console.log('// Project: http://locutusjs.io'); + console.log('// Definitions by: Hookclaw '); + console.log('// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped'); + console.log(''); + + for(let key1 in loc) { + for(let key2 in loc[key1]) { + for(let key3 in loc[key1][key2]) { + printSingle(loc,key1,key2,key3); + } + } + } + for(let key1 in loc) { + for(let key2 in loc[key1]) { + let modulename = 'locutus/' + key1 + '/' + key2; + printGroup(modulename, loc[key1][key2]); + } + } + for(let key1 in loc) { + let modulename = 'locutus/' + key1; + printGroup(modulename, loc[key1]); + } + let modulename = 'locutus'; + printGroup(modulename, loc); +} + +let printSingle = (loc:c,key1:string,key2:string,key3:string):void => { + console.log('declare module "locutus/' + key1 + '/' + key2 + '/' + key3 + '" {'); + console.log('\tfunction ' + key3 + arg(loc,key1,key2,key3) + ':any;'); + console.log('\texport = ' + key3 + ';'); + console.log('}'); +} + +let printGroup = (modulename:string,loc:{}):void => { + let s:string[] = []; + let c = ''; + console.log('declare module "' + modulename + '" {'); + for(let key in loc) { + let com = ''; + let tmp = replace(key); + if(tmp == key) { + s.push(key); + } else { + com = '// '; + // s.push('"' + key + '":' + tmp); + c += ' /* ,"' + key + '":' + tmp + ' */'; + } + console.log('\t' + com + 'import ' + tmp + ' = require("' + modulename + '/' + key + '");'); + } + console.log('\texport {' + s.join(',') + c + '};'); + console.log('}'); +} + +let replace = (name:string):string => { + if(name == 'var') { + return 'Var'; + } + // if(name == 'string') { + // return 'String'; + // } + return name.replace('-','_'); +} + +let func = (loc:c,key1:string,key2:string,key3:string):string => { + return '"' + key3 + '":' + arg(loc,key1,key2,key3) + ' => any'; +} + +const ARG1 = "(...args:any[])"; + +let arg = (loc:c,key1:string,key2:string,key3:string):string => { + let src = loc[key1][key2][key3].toString(); + let mArguments = /[^a-zA-Z0-9_]arguments[^a-zA-Z0-9_]/; + if(mArguments.test(src)) { + return ARG1; + } + let mFunction = /^function [a-zA-Z0-9_]+\(/g; + let result1 = mFunction.exec(src); + if(result1 == null) { + return ARG1; + } + let mFunction2 = /(\s*[,]?\s*[a-zA-Z0-9_]+)*\)/g; + mFunction2.lastIndex = mFunction.lastIndex; + let result12 = mFunction2.exec(src); + let mParameter = /\s*[,]?\s*[a-zA-Z0-9_]+/g; + let args:string[] = []; + let i = 0; + let result2:any; + while((result2 = mParameter.exec(result12[0])) != null) { + args.push(result2[0]+'?:any'); + i++; + } + return '('+args.join('')+')'; +} + +let test = ():void => { + console.log('/// '); + for(let key1 in loc) { + for(let key2 in loc[key1]) { + for(let key3 in loc[key1][key2]) { + let modulename = 'locutus/' + key1 + '/' + key2 + '/' + key3; + testsub(modulename); + } + } + } + for(let key1 in loc) { + for(let key2 in loc[key1]) { + let modulename = 'locutus/' + key1 + '/' + key2; + testsub(modulename); + } + } + for(let key1 in loc) { + let modulename = 'locutus/' + key1; + testsub(modulename); + } + let modulename = 'locutus'; + testsub(modulename); +} + +let testsub = (modulename:string):void => { + let varname = modulename.replace(/[-/]/g,'_'); + console.log("import " + varname + " = require('" + modulename + "');"); +} + +let settings = ():void => { + let s = ''; + for(let key1 in loc) { + if(key1 != 'php') { + continue; + } + for(let key2 in loc[key1]) { + for(let key3 in loc[key1][key2]) { + if(s != '') { + s += ',\n'; + } + let len = 21 - key3.length; + let tab = ''; + while(len > 0) { + tab += '\t'; + len -= 4; + } + //"var_dump": {"cod":"var_dump", "mod":["var_dump","locutus/php/var/var_dump"]} + s += '\t\t\t\t"' + key3 + '":' + tab + '{"cod":"' + key3 + '","mod":["' + key3 + '","locutus/' + key1 + '/' + key2 + '/' + key3 + '"]}'; + } + } + } + console.log(s); +} + +run(); diff --git a/lodash/lodash-3.10-tests.ts b/lodash/lodash-3.10-tests.ts index 0a2debfa00..2616822f6e 100644 --- a/lodash/lodash-3.10-tests.ts +++ b/lodash/lodash-3.10-tests.ts @@ -7700,8 +7700,13 @@ namespace TestRound { // _.sum namespace TestSum { let array: number[]; + let objectArray: { 'age': number }[]; + let list: _.List; + let objectList: _.List<{ 'age': number }>; + let dictionary: _.Dictionary; + let objectDictionary: _.Dictionary<{ 'age': number }>; let listIterator: (value: number, index: number, collection: _.List) => number; let dictionaryIterator: (value: number, key: string, collection: _.Dictionary) => number; @@ -7713,36 +7718,36 @@ namespace TestSum { result = _.sum(array); result = _.sum(array, listIterator); result = _.sum(array, listIterator, any); - result = _.sum(array, ''); + result = _.sum(objectArray, 'age'); result = _.sum(list); result = _.sum(list); result = _.sum(list, listIterator); result = _.sum(list, listIterator, any); - result = _.sum(list, ''); + result = _.sum(objectList, 'age'); result = _.sum(dictionary); result = _.sum(dictionary); result = _.sum(dictionary, dictionaryIterator); result = _.sum(dictionary, dictionaryIterator, any); - result = _.sum(dictionary, ''); + result = _.sum(objectDictionary, 'age'); result = _(array).sum(); result = _(array).sum(listIterator); result = _(array).sum(listIterator, any); - result = _(array).sum(''); + result = _(objectArray).sum('age'); result = _(list).sum(); result = _(list).sum(listIterator); result = _(list).sum(listIterator, any); - result = _(list).sum(''); + result = _(objectList).sum('age'); result = _(dictionary).sum(); result = _(dictionary).sum(dictionaryIterator); result = _(dictionary).sum(dictionaryIterator, any); - result = _(dictionary).sum(''); + result = _(objectDictionary).sum('age'); } { @@ -7751,18 +7756,18 @@ namespace TestSum { result = _(array).chain().sum(); result = _(array).chain().sum(listIterator); result = _(array).chain().sum(listIterator, any); - result = _(array).chain().sum(''); + result = _(objectArray).chain().sum(''); result = _(list).chain().sum(); result = _(list).chain().sum(listIterator); result = _(list).chain().sum(listIterator, any); - result = _(list).chain().sum(''); + result = _(objectList).chain().sum('age'); result = _(dictionary).chain().sum(); result = _(dictionary).chain().sum(dictionaryIterator); result = _(dictionary).chain().sum(dictionaryIterator, any); - result = _(dictionary).chain().sum(''); + result = _(objectDictionary).chain().sum('age'); } } diff --git a/lodash/lodash-3.10.d.ts b/lodash/lodash-3.10.d.ts index b92de15c89..aea06a8362 100644 --- a/lodash/lodash-3.10.d.ts +++ b/lodash/lodash-3.10.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Lo-Dash +// Type definitions for Lo-Dash 3.10 // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -7732,6 +7732,53 @@ declare module _ { thisArg?: any): TResult; } + interface LoDashExplicitObjectWrapper { + /** + * @see _.reduce + **/ + reduce( + callback: MemoIterator, + accumulator: TResult, + thisArg?: any): LoDashExplicitObjectWrapper; + + /** + * @see _.reduce + **/ + reduce( + callback: MemoIterator, + thisArg?: any): LoDashExplicitObjectWrapper; + + /** + * @see _.reduce + **/ + inject( + callback: MemoIterator, + accumulator: TResult, + thisArg?: any): LoDashExplicitObjectWrapper; + + /** + * @see _.reduce + **/ + inject( + callback: MemoIterator, + thisArg?: any): LoDashExplicitObjectWrapper; + + /** + * @see _.reduce + **/ + foldl( + callback: MemoIterator, + accumulator: TResult, + thisArg?: any): LoDashExplicitObjectWrapper; + + /** + * @see _.reduce + **/ + foldl( + callback: MemoIterator, + thisArg?: any): LoDashExplicitObjectWrapper; + } + //_.reduceRight interface LoDashStatic { /** @@ -12018,8 +12065,8 @@ declare module _ { /** * @see _.sum */ - sum( - collection: List|Dictionary, + sum( + collection: List<{}>|Dictionary<{}>, iteratee: string ): number; diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 2d5f5b50f3..8ec22e98de 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -973,19 +973,26 @@ namespace TestFlattenDeep { // _.fromPairs namespace TestFromPairs { - let array: string[][]; - let result: _.Dictionary; + let twoDimensionalArray: string[][]; + let numberTupleArray: [string, number][]; + let stringDict: _.Dictionary; + let numberDict: _.Dictionary; { - result = _.fromPairs(array); + stringDict = _.fromPairs(twoDimensionalArray); + numberDict = _.fromPairs(numberTupleArray); + // Ensure we're getting the parameterized overload rather than the 'any' catch-all. + numberDict = _.fromPairs(numberTupleArray); + // This doesn't compile because you can't assign arrays to tuples. + // stringDict = _.fromPairs(twoDimensionalArray); } { - result = _(array).fromPairs().value(); + stringDict = _(twoDimensionalArray).fromPairs().value(); } { - result = _.chain(array).fromPairs().value(); + stringDict = _.chain(twoDimensionalArray).fromPairs().value(); } } @@ -5724,6 +5731,21 @@ namespace TestFlip { namespace TestFlow { let Fn1: (n: number) => number; let Fn2: (m: number, n: number) => number; + let Fn3: (a: number) => string; + let Fn4: (a: string) => number; + + { + // type infer test + let result: (m: number, n: number) => number; + + result = _.flow(Fn2, Fn1); + result = _.flow(Fn2, Fn1, Fn1); + result = _.flow(Fn2, Fn1, Fn1, Fn1); + result = _.flow(Fn2, Fn1, Fn1, Fn1, Fn1); + result = _.flow(Fn2, Fn1, Fn1, Fn1, Fn1, Fn1); + result = _.flow(Fn2, Fn1, Fn1, Fn1, Fn1, Fn1, Fn1); + result = _.flow(Fn2, Fn1, Fn3, Fn4); + } { let result: (m: number, n: number) => number; @@ -7874,49 +7896,41 @@ namespace TestSum { // _.sumBy namespace TestSumBy { let array: number[]; + let objectArray: { 'age': number }[]; + let list: _.List; - let dictionary: _.Dictionary; + let objectList: _.List<{ 'age': number }>; let listIterator: (value: number, index: number, collection: _.List) => number; - let dictionaryIterator: (value: number, key: string, collection: _.Dictionary) => number; { let result: number; - result = _.sumBy(array); - result = _.sumBy(array, listIterator); - result = _.sumBy(array, ''); + result = _.sumBy(array); + result = _.sumBy(array, listIterator); + result = _.sumBy(objectArray, 'age'); + result = _.sumBy(objectArray, { 'age': 30 }); - - result = _.sumBy(list); - result = _.sumBy(list, listIterator); - result = _.sumBy(list, ''); - - result = _.sumBy(dictionary); - result = _.sumBy(dictionary, dictionaryIterator); - result = _.sumBy(dictionary, ''); + result = _.sumBy(list); + result = _.sumBy(list, listIterator); + result = _.sumBy(objectList, 'age'); + result = _.sumBy(objectList, { 'age': 30 }); result = _(array).sumBy(listIterator); - result = _(array).sumBy(''); + result = _(objectArray).sumBy('age'); - result = _(list).sumBy(listIterator); - result = _(list).sumBy(''); - - result = _(dictionary).sumBy(dictionaryIterator); - result = _(dictionary).sumBy(''); + result = _(list).sumBy(listIterator); + result = _(objectList).sumBy('age'); } { let result: _.LoDashExplicitWrapper; result = _(array).chain().sumBy(listIterator); - result = _(array).chain().sumBy(''); + result = _(objectArray).chain().sumBy('age'); - result = _(list).chain().sumBy(listIterator); - result = _(list).chain().sumBy(''); - - result = _(dictionary).chain().sumBy(dictionaryIterator); - result = _(dictionary).chain().sumBy(''); + result = _(list).chain().sumBy(listIterator); + result = _(objectList).chain().sumBy('age'); } } @@ -8014,12 +8028,12 @@ namespace TestRandom { // _.assign namespace TestAssign { - interface Obj {a: string}; - interface S1 {a: number}; - interface S2 {b: number}; - interface S3 {c: number}; - interface S4 {d: number}; - interface S5 {e: number}; + interface Obj { a: string }; + interface S1 { a: number }; + interface S2 { b: number }; + interface S3 { c: number }; + interface S4 { d: number }; + interface S5 { e: number }; let obj: Obj; let s1: S1; @@ -8033,37 +8047,37 @@ namespace TestAssign { { let result: Obj; - result = _.assign(obj); + result = _.assign(obj); } { - let result: {a: number}; + let result: { a: number }; - result = _.assign(obj, s1); + result = _.assign(obj, s1); } { - let result: {a: number, b: number}; + let result: { a: number, b: number }; - result = _.assign(obj, s1, s2); + result = _.assign(obj, s1, s2); } { - let result: {a: number, b: number, c: number}; + let result: { a: number, b: number, c: number }; - result = _.assign(obj, s1, s2, s3); + result = _.assign(obj, s1, s2, s3); } { - let result: {a: number, b: number, c: number, d: number}; + let result: { a: number, b: number, c: number, d: number }; - result = _.assign(obj, s1, s2, s3, s4); + result = _.assign(obj, s1, s2, s3, s4); } { - let result: {a: number, b: number, c: number, d: number, e: number}; + let result: { a: number, b: number, c: number, d: number, e: number }; - result = _.assign(obj, s1, s2, s3, s4, s5); + result = _.assign<{ a: number, b: number, c: number, d: number, e: number }>(obj, s1, s2, s3, s4, s5); } { @@ -8073,33 +8087,33 @@ namespace TestAssign { } { - let result: _.LoDashImplicitObjectWrapper<{a: number}>; + let result: _.LoDashImplicitObjectWrapper<{ a: number }>; - result = _(obj).assign(s1); + result = _(obj).assign(s1); } { - let result: _.LoDashImplicitObjectWrapper<{a: number, b: number}>; + let result: _.LoDashImplicitObjectWrapper<{ a: number, b: number }>; - result = _(obj).assign(s1, s2); + result = _(obj).assign(s1, s2); } { - let result: _.LoDashImplicitObjectWrapper<{a: number, b: number, c: number}>; + let result: _.LoDashImplicitObjectWrapper<{ a: number, b: number, c: number }>; - result = _(obj).assign(s1, s2, s3); + result = _(obj).assign(s1, s2, s3); } { - let result: _.LoDashImplicitObjectWrapper<{a: number, b: number, c: number, d: number}>; + let result: _.LoDashImplicitObjectWrapper<{ a: number, b: number, c: number, d: number }>; - result = _(obj).assign(s1, s2, s3, s4); + result = _(obj).assign(s1, s2, s3, s4); } { - let result: _.LoDashImplicitObjectWrapper<{a: number, b: number, c: number, d: number, e: number}>; + let result: _.LoDashImplicitObjectWrapper<{ a: number, b: number, c: number, d: number, e: number }>; - result = _(obj).assign<{a: number, b: number, c: number, d: number, e: number}>(s1, s2, s3, s4, s5); + result = _(obj).assign<{ a: number, b: number, c: number, d: number, e: number }>(s1, s2, s3, s4, s5); } { @@ -8109,44 +8123,44 @@ namespace TestAssign { } { - let result: _.LoDashExplicitObjectWrapper<{a: number}>; + let result: _.LoDashExplicitObjectWrapper<{ a: number }>; - result = _(obj).chain().assign(s1); + result = _(obj).chain().assign(s1); } { - let result: _.LoDashExplicitObjectWrapper<{a: number, b: number}>; + let result: _.LoDashExplicitObjectWrapper<{ a: number, b: number }>; - result = _(obj).chain().assign(s1, s2); + result = _(obj).chain().assign(s1, s2); } { - let result: _.LoDashExplicitObjectWrapper<{a: number, b: number, c: number}>; + let result: _.LoDashExplicitObjectWrapper<{ a: number, b: number, c: number }>; - result = _(obj).chain().assign(s1, s2, s3); + result = _(obj).chain().assign(s1, s2, s3); } { - let result: _.LoDashExplicitObjectWrapper<{a: number, b: number, c: number, d: number}>; + let result: _.LoDashExplicitObjectWrapper<{ a: number, b: number, c: number, d: number }>; - result = _(obj).chain().assign(s1, s2, s3, s4); + result = _(obj).chain().assign(s1, s2, s3, s4); } { - let result: _.LoDashExplicitObjectWrapper<{a: number, b: number, c: number, d: number, e: number}>; + let result: _.LoDashExplicitObjectWrapper<{ a: number, b: number, c: number, d: number, e: number }>; - result = _(obj).chain().assign<{a: number, b: number, c: number, d: number, e: number}>(s1, s2, s3, s4, s5); + result = _(obj).chain().assign<{ a: number, b: number, c: number, d: number, e: number }>(s1, s2, s3, s4, s5); } } // _.assignWith namespace TestAssignWith { - interface Obj {a: string}; - interface S1 {a: number}; - interface S2 {b: number}; - interface S3 {c: number}; - interface S4 {d: number}; - interface S5 {e: number}; + interface Obj { a: string }; + interface S1 { a: number }; + interface S2 { b: number }; + interface S3 { c: number }; + interface S4 { d: number }; + interface S5 { e: number }; let obj: Obj; let s1: S1; @@ -8160,32 +8174,32 @@ namespace TestAssignWith { { let result: Obj; - result = _.assignWith(obj); + result = _.assignWith(obj); } { - let result: {a: number}; - result = _.assignWith(obj, s1, customizer); + let result: { a: number }; + result = _.assignWith(obj, s1, customizer); } { - let result: {a: number, b: number}; - result = _.assignWith(obj, s1, s2, customizer); + let result: { a: number, b: number }; + result = _.assignWith(obj, s1, s2, customizer); } { - let result: {a: number, b: number, c: number}; - result = _.assignWith(obj, s1, s2, s3, customizer); + let result: { a: number, b: number, c: number }; + result = _.assignWith(obj, s1, s2, s3, customizer); } { - let result: {a: number, b: number, c: number, d: number}; - result = _.assignWith(obj, s1, s2, s3, s4, customizer); + let result: { a: number, b: number, c: number, d: number }; + result = _.assignWith(obj, s1, s2, s3, s4, customizer); } { - let result: {a: number, b: number, c: number, d: number, e: number}; - result = _.assignWith(obj, s1, s2, s3, s4, s5, customizer); + let result: { a: number, b: number, c: number, d: number, e: number }; + result = _.assignWith<{ a: number, b: number, c: number, d: number, e: number }>(obj, s1, s2, s3, s4, s5, customizer); } { @@ -8195,28 +8209,28 @@ namespace TestAssignWith { } { - let result: _.LoDashImplicitObjectWrapper<{a: number}>; - result = _(obj).assignWith(s1, customizer); + let result: _.LoDashImplicitObjectWrapper<{ a: number }>; + result = _(obj).assignWith(s1, customizer); } { - let result: _.LoDashImplicitObjectWrapper<{a: number, b: number}>; - result = _(obj).assignWith(s1, s2, customizer); + let result: _.LoDashImplicitObjectWrapper<{ a: number, b: number }>; + result = _(obj).assignWith(s1, s2, customizer); } { - let result: _.LoDashImplicitObjectWrapper<{a: number, b: number, c: number}>; - result = _(obj).assignWith(s1, s2, s3, customizer); + let result: _.LoDashImplicitObjectWrapper<{ a: number, b: number, c: number }>; + result = _(obj).assignWith(s1, s2, s3, customizer); } { - let result: _.LoDashImplicitObjectWrapper<{a: number, b: number, c: number, d: number}>; - result = _(obj).assignWith(s1, s2, s3, s4, customizer); + let result: _.LoDashImplicitObjectWrapper<{ a: number, b: number, c: number, d: number }>; + result = _(obj).assignWith(s1, s2, s3, s4, customizer); } { - let result: _.LoDashImplicitObjectWrapper<{a: number, b: number, c: number, d: number, e: number}>; - result = _(obj).assignWith<{a: number, b: number, c: number, d: number, e: number}>(s1, s2, s3, s4, s5, customizer); + let result: _.LoDashImplicitObjectWrapper<{ a: number, b: number, c: number, d: number, e: number }>; + result = _(obj).assignWith<{ a: number, b: number, c: number, d: number, e: number }>(s1, s2, s3, s4, s5, customizer); } { @@ -8226,39 +8240,39 @@ namespace TestAssignWith { } { - let result: _.LoDashExplicitObjectWrapper<{a: number}>; - result = _(obj).chain().assignWith(s1, customizer); + let result: _.LoDashExplicitObjectWrapper<{ a: number }>; + result = _(obj).chain().assignWith(s1, customizer); } { - let result: _.LoDashExplicitObjectWrapper<{a: number, b: number}>; - result = _(obj).chain().assignWith(s1, s2, customizer); + let result: _.LoDashExplicitObjectWrapper<{ a: number, b: number }>; + result = _(obj).chain().assignWith(s1, s2, customizer); } { - let result: _.LoDashExplicitObjectWrapper<{a: number, b: number, c: number}>; - result = _(obj).chain().assignWith(s1, s2, s3, customizer); + let result: _.LoDashExplicitObjectWrapper<{ a: number, b: number, c: number }>; + result = _(obj).chain().assignWith(s1, s2, s3, customizer); } { - let result: _.LoDashExplicitObjectWrapper<{a: number, b: number, c: number, d: number}>; - result = _(obj).chain().assignWith(s1, s2, s3, s4, customizer); + let result: _.LoDashExplicitObjectWrapper<{ a: number, b: number, c: number, d: number }>; + result = _(obj).chain().assignWith(s1, s2, s3, s4, customizer); } { - let result: _.LoDashExplicitObjectWrapper<{a: number, b: number, c: number, d: number, e: number}>; - result = _(obj).chain().assignWith<{a: number, b: number, c: number, d: number, e: number}>(s1, s2, s3, s4, s5, customizer); + let result: _.LoDashExplicitObjectWrapper<{ a: number, b: number, c: number, d: number, e: number }>; + result = _(obj).chain().assignWith<{ a: number, b: number, c: number, d: number, e: number }>(s1, s2, s3, s4, s5, customizer); } } // _.assignIn namespace TestAssignIn { - interface Obj {a: string}; - interface S1 {a: number}; - interface S2 {b: number}; - interface S3 {c: number}; - interface S4 {d: number}; - interface S5 {e: number}; + interface Obj { a: string }; + interface S1 { a: number }; + interface S2 { b: number }; + interface S3 { c: number }; + interface S4 { d: number }; + interface S5 { e: number }; let obj: Obj; let s1: S1; @@ -8272,37 +8286,37 @@ namespace TestAssignIn { { let result: Obj; - result = _.assignIn(obj); + result = _.assignIn(obj); } { - let result: {a: number}; + let result: { a: number }; - result = _.assignIn(obj, s1); + result = _.assignIn(obj, s1); } { - let result: {a: number, b: number}; + let result: { a: number, b: number }; - result = _.assignIn(obj, s1, s2); + result = _.assignIn(obj, s1, s2); } { - let result: {a: number, b: number, c: number}; + let result: { a: number, b: number, c: number }; - result = _.assignIn(obj, s1, s2, s3); + result = _.assignIn(obj, s1, s2, s3); } { - let result: {a: number, b: number, c: number, d: number}; + let result: { a: number, b: number, c: number, d: number }; - result = _.assignIn(obj, s1, s2, s3, s4); + result = _.assignIn(obj, s1, s2, s3, s4); } { - let result: {a: number, b: number, c: number, d: number, e: number}; + let result: { a: number, b: number, c: number, d: number, e: number }; - result = _.assignIn(obj, s1, s2, s3, s4, s5); + result = _.assignIn<{ a: number, b: number, c: number, d: number, e: number }>(obj, s1, s2, s3, s4, s5); } { @@ -8312,33 +8326,33 @@ namespace TestAssignIn { } { - let result: _.LoDashImplicitObjectWrapper<{a: number}>; + let result: _.LoDashImplicitObjectWrapper<{ a: number }>; - result = _(obj).assignIn(s1); + result = _(obj).assignIn(s1); } { - let result: _.LoDashImplicitObjectWrapper<{a: number, b: number}>; + let result: _.LoDashImplicitObjectWrapper<{ a: number, b: number }>; - result = _(obj).assignIn(s1, s2); + result = _(obj).assignIn(s1, s2); } { - let result: _.LoDashImplicitObjectWrapper<{a: number, b: number, c: number}>; + let result: _.LoDashImplicitObjectWrapper<{ a: number, b: number, c: number }>; - result = _(obj).assignIn(s1, s2, s3); + result = _(obj).assignIn(s1, s2, s3); } { - let result: _.LoDashImplicitObjectWrapper<{a: number, b: number, c: number, d: number}>; + let result: _.LoDashImplicitObjectWrapper<{ a: number, b: number, c: number, d: number }>; - result = _(obj).assignIn(s1, s2, s3, s4); + result = _(obj).assignIn(s1, s2, s3, s4); } { - let result: _.LoDashImplicitObjectWrapper<{a: number, b: number, c: number, d: number, e: number}>; + let result: _.LoDashImplicitObjectWrapper<{ a: number, b: number, c: number, d: number, e: number }>; - result = _(obj).assignIn<{a: number, b: number, c: number, d: number, e: number}>(s1, s2, s3, s4, s5); + result = _(obj).assignIn<{ a: number, b: number, c: number, d: number, e: number }>(s1, s2, s3, s4, s5); } { @@ -8348,44 +8362,44 @@ namespace TestAssignIn { } { - let result: _.LoDashExplicitObjectWrapper<{a: number}>; + let result: _.LoDashExplicitObjectWrapper<{ a: number }>; - result = _(obj).chain().assignIn(s1); + result = _(obj).chain().assignIn(s1); } { - let result: _.LoDashExplicitObjectWrapper<{a: number, b: number}>; + let result: _.LoDashExplicitObjectWrapper<{ a: number, b: number }>; - result = _(obj).chain().assignIn(s1, s2); + result = _(obj).chain().assignIn(s1, s2); } { - let result: _.LoDashExplicitObjectWrapper<{a: number, b: number, c: number}>; + let result: _.LoDashExplicitObjectWrapper<{ a: number, b: number, c: number }>; - result = _(obj).chain().assignIn(s1, s2, s3); + result = _(obj).chain().assignIn(s1, s2, s3); } { - let result: _.LoDashExplicitObjectWrapper<{a: number, b: number, c: number, d: number}>; + let result: _.LoDashExplicitObjectWrapper<{ a: number, b: number, c: number, d: number }>; - result = _(obj).chain().assignIn(s1, s2, s3, s4); + result = _(obj).chain().assignIn(s1, s2, s3, s4); } { - let result: _.LoDashExplicitObjectWrapper<{a: number, b: number, c: number, d: number, e: number}>; + let result: _.LoDashExplicitObjectWrapper<{ a: number, b: number, c: number, d: number, e: number }>; - result = _(obj).chain().assignIn<{a: number, b: number, c: number, d: number, e: number}>(s1, s2, s3, s4, s5); + result = _(obj).chain().assignIn<{ a: number, b: number, c: number, d: number, e: number }>(s1, s2, s3, s4, s5); } } // _.assignInWith namespace TestAssignInWith { - interface Obj {a: string}; - interface S1 {a: number}; - interface S2 {b: number}; - interface S3 {c: number}; - interface S4 {d: number}; - interface S5 {e: number}; + interface Obj { a: string }; + interface S1 { a: number }; + interface S2 { b: number }; + interface S3 { c: number }; + interface S4 { d: number }; + interface S5 { e: number }; let obj: Obj; let s1: S1; @@ -8399,32 +8413,32 @@ namespace TestAssignInWith { { let result: Obj; - result = _.assignInWith(obj); + result = _.assignInWith(obj); } { - let result: {a: number}; - result = _.assignInWith(obj, s1, customizer); + let result: { a: number }; + result = _.assignInWith(obj, s1, customizer); } { - let result: {a: number, b: number}; - result = _.assignInWith(obj, s1, s2, customizer); + let result: { a: number, b: number }; + result = _.assignInWith(obj, s1, s2, customizer); } { - let result: {a: number, b: number, c: number}; - result = _.assignInWith(obj, s1, s2, s3, customizer); + let result: { a: number, b: number, c: number }; + result = _.assignInWith(obj, s1, s2, s3, customizer); } { - let result: {a: number, b: number, c: number, d: number}; - result = _.assignInWith(obj, s1, s2, s3, s4, customizer); + let result: { a: number, b: number, c: number, d: number }; + result = _.assignInWith(obj, s1, s2, s3, s4, customizer); } { - let result: {a: number, b: number, c: number, d: number, e: number}; - result = _.assignInWith(obj, s1, s2, s3, s4, s5, customizer); + let result: { a: number, b: number, c: number, d: number, e: number }; + result = _.assignInWith<{ a: number, b: number, c: number, d: number, e: number }>(obj, s1, s2, s3, s4, s5, customizer); } { @@ -8434,28 +8448,28 @@ namespace TestAssignInWith { } { - let result: _.LoDashImplicitObjectWrapper<{a: number}>; - result = _(obj).assignInWith(s1, customizer); + let result: _.LoDashImplicitObjectWrapper<{ a: number }>; + result = _(obj).assignInWith(s1, customizer); } { - let result: _.LoDashImplicitObjectWrapper<{a: number, b: number}>; - result = _(obj).assignInWith(s1, s2, customizer); + let result: _.LoDashImplicitObjectWrapper<{ a: number, b: number }>; + result = _(obj).assignInWith(s1, s2, customizer); } { - let result: _.LoDashImplicitObjectWrapper<{a: number, b: number, c: number}>; - result = _(obj).assignInWith(s1, s2, s3, customizer); + let result: _.LoDashImplicitObjectWrapper<{ a: number, b: number, c: number }>; + result = _(obj).assignInWith(s1, s2, s3, customizer); } { - let result: _.LoDashImplicitObjectWrapper<{a: number, b: number, c: number, d: number}>; - result = _(obj).assignInWith(s1, s2, s3, s4, customizer); + let result: _.LoDashImplicitObjectWrapper<{ a: number, b: number, c: number, d: number }>; + result = _(obj).assignInWith(s1, s2, s3, s4, customizer); } { - let result: _.LoDashImplicitObjectWrapper<{a: number, b: number, c: number, d: number, e: number}>; - result = _(obj).assignInWith<{a: number, b: number, c: number, d: number, e: number}>(s1, s2, s3, s4, s5, customizer); + let result: _.LoDashImplicitObjectWrapper<{ a: number, b: number, c: number, d: number, e: number }>; + result = _(obj).assignInWith<{ a: number, b: number, c: number, d: number, e: number }>(s1, s2, s3, s4, s5, customizer); } { @@ -8465,28 +8479,28 @@ namespace TestAssignInWith { } { - let result: _.LoDashExplicitObjectWrapper<{a: number}>; - result = _(obj).chain().assignInWith(s1, customizer); + let result: _.LoDashExplicitObjectWrapper<{ a: number }>; + result = _(obj).chain().assignInWith(s1, customizer); } { - let result: _.LoDashExplicitObjectWrapper<{a: number, b: number}>; - result = _(obj).chain().assignInWith(s1, s2, customizer); + let result: _.LoDashExplicitObjectWrapper<{ a: number, b: number }>; + result = _(obj).chain().assignInWith(s1, s2, customizer); } { - let result: _.LoDashExplicitObjectWrapper<{a: number, b: number, c: number}>; - result = _(obj).chain().assignInWith(s1, s2, s3, customizer); + let result: _.LoDashExplicitObjectWrapper<{ a: number, b: number, c: number }>; + result = _(obj).chain().assignInWith(s1, s2, s3, customizer); } { - let result: _.LoDashExplicitObjectWrapper<{a: number, b: number, c: number, d: number}>; - result = _(obj).chain().assignInWith(s1, s2, s3, s4, customizer); + let result: _.LoDashExplicitObjectWrapper<{ a: number, b: number, c: number, d: number }>; + result = _(obj).chain().assignInWith(s1, s2, s3, s4, customizer); } { - let result: _.LoDashExplicitObjectWrapper<{a: number, b: number, c: number, d: number, e: number}>; - result = _(obj).chain().assignInWith<{a: number, b: number, c: number, d: number, e: number}>(s1, s2, s3, s4, s5, customizer); + let result: _.LoDashExplicitObjectWrapper<{ a: number, b: number, c: number, d: number, e: number }>; + result = _(obj).chain().assignInWith<{ a: number, b: number, c: number, d: number, e: number }>(s1, s2, s3, s4, s5, customizer); } } @@ -8520,151 +8534,153 @@ namespace TestCreate { } } + // _.defaults namespace TestDefaults { - interface Obj {a: string}; - interface S1 {a: number}; - interface S2 {b: number}; - interface S3 {c: number}; - interface S4 {d: number}; - interface S5 {e: number}; + interface Obj { a: string }; + interface S1 { a: number }; + interface S2 { b: number }; + interface S3 { c: number }; + interface S4 { d: number }; + interface S5 { e: number }; - let obj: Obj; - let s1: S1; - let s2: S2; - let s3: S3; - let s4: S4; - let s5: S5; + let obj: Obj; + let s1: S1; + let s2: S2; + let s3: S3; + let s4: S4; + let s5: S5; - { - let result: Obj; + { + let result: Obj; - result = _.defaults(obj); - } + result = _.defaults(obj); + } - { - let result: {a: string}; + { + let result: { a: string }; - result = _.defaults(obj, s1); - } + result = _.defaults(obj, s1); + } - { - let result: {a: string, b: number}; + { + let result: { a: string, b: number }; - result = _.defaults(obj, s1, s2); - } + result = _.defaults(obj, s1, s2); + } - { - let result: {a: string, b: number, c: number}; + { + let result: { a: string, b: number, c: number }; - result = _.defaults(obj, s1, s2, s3); - } + result = _.defaults(obj, s1, s2, s3); + } - { - let result: {a: string, b: number, c: number, d: number}; + { + let result: { a: string, b: number, c: number, d: number }; - result = _.defaults(obj, s1, s2, s3, s4); - } + result = _.defaults(obj, s1, s2, s3, s4); + } - { - let result: {a: string, b: number, c: number, d: number, e: number}; + { + let result: { a: string, b: number, c: number, d: number, e: number }; - result = _.defaults(obj, s1, s2, s3, s4, s5); - } + result = _.defaults<{ a: string, b: number, c: number, d: number, e: number }>(obj, s1, s2, s3, s4, s5); + } - { - let result: _.LoDashImplicitObjectWrapper; + { + let result: _.LoDashImplicitObjectWrapper; - result = _(obj).defaults(); - } + result = _(obj).defaults(); + } - { - let result: _.LoDashImplicitObjectWrapper<{a: string}>; + { + let result: _.LoDashImplicitObjectWrapper<{ a: string }>; - result = _(obj).defaults(s1); - } + result = _(obj).defaults(s1); + } - { - let result: _.LoDashImplicitObjectWrapper<{a: string, b: number}>; + { + let result: _.LoDashImplicitObjectWrapper<{ a: string, b: number }>; - result = _(obj).defaults(s1, s2); - } + result = _(obj).defaults(s1, s2); + } - { - let result: _.LoDashImplicitObjectWrapper<{a: string, b: number, c: number}>; + { + let result: _.LoDashImplicitObjectWrapper<{ a: string, b: number, c: number }>; - result = _(obj).defaults(s1, s2, s3); - } + result = _(obj).defaults(s1, s2, s3); + } - { - let result: _.LoDashImplicitObjectWrapper<{a: string, b: number, c: number, d: number}>; + { + let result: _.LoDashImplicitObjectWrapper<{ a: string, b: number, c: number, d: number }>; - result = _(obj).defaults(s1, s2, s3, s4); - } + result = _(obj).defaults(s1, s2, s3, s4); + } - { - let result: _.LoDashImplicitObjectWrapper<{a: string, b: number, c: number, d: number, e: number}>; + { + let result: _.LoDashImplicitObjectWrapper<{ a: string, b: number, c: number, d: number, e: number }>; - result = _(obj).defaults<{a: string, b: number, c: number, d: number, e: number}>(s1, s2, s3, s4, s5); - } + result = _(obj).defaults<{ a: string, b: number, c: number, d: number, e: number }>(s1, s2, s3, s4, s5); + } - { - let result: _.LoDashExplicitObjectWrapper; + { + let result: _.LoDashExplicitObjectWrapper; - result = _(obj).chain().defaults(); - } + result = _(obj).chain().defaults(); + } - { - let result: _.LoDashExplicitObjectWrapper<{a: string}>; + { + let result: _.LoDashExplicitObjectWrapper<{ a: string }>; - result = _(obj).chain().defaults(s1); - } + result = _(obj).chain().defaults(s1); + } - { - let result: _.LoDashExplicitObjectWrapper<{a: string, b: number}>; + { + let result: _.LoDashExplicitObjectWrapper<{ a: string, b: number }>; - result = _(obj).chain().defaults(s1, s2); - } + result = _(obj).chain().defaults(s1, s2); + } - { - let result: _.LoDashExplicitObjectWrapper<{a: string, b: number, c: number}>; + { + let result: _.LoDashExplicitObjectWrapper<{ a: string, b: number, c: number }>; - result = _(obj).chain().defaults(s1, s2, s3); - } + result = _(obj).chain().defaults(s1, s2, s3); + } - { - let result: _.LoDashExplicitObjectWrapper<{a: string, b: number, c: number, d: number}>; + { + let result: _.LoDashExplicitObjectWrapper<{ a: string, b: number, c: number, d: number }>; - result = _(obj).chain().defaults(s1, s2, s3, s4); - } + result = _(obj).chain().defaults(s1, s2, s3, s4); + } - { - let result: _.LoDashExplicitObjectWrapper<{a: string, b: number, c: number, d: number, e: number}>; + { + let result: _.LoDashExplicitObjectWrapper<{ a: string, b: number, c: number, d: number, e: number }>; - result = _(obj).chain().defaults<{a: string, b: number, c: number, d: number, e: number}>(s1, s2, s3, s4, s5); - } + result = _(obj).chain().defaults<{ a: string, b: number, c: number, d: number, e: number }>(s1, s2, s3, s4, s5); + } } //_.defaultsDeep interface DefaultsDeepResult { - user: { - name: string; - age: number; - } + user: { + name: string; + age: number; + } } -var TestDefaultsDeepObject = {'user': {'name': 'barney'}}; -var TestDefaultsDeepSource = {'user': {'name': 'fred', 'age': 36}}; +var TestDefaultsDeepObject = { 'user': { 'name': 'barney' } }; +var TestDefaultsDeepSource = { 'user': { 'name': 'fred', 'age': 36 } }; result = _.defaultsDeep(TestDefaultsDeepObject, TestDefaultsDeepSource); result = _(TestDefaultsDeepObject).defaultsDeep(TestDefaultsDeepSource).value(); + // _.extend namespace TestExtend { - type Obj = {a: string}; - type S1 = {a: number}; - type S2 = {b: number}; - type S3 = {c: number}; - type S4 = {d: number}; - type S5 = {e: number}; + type Obj = { a: string }; + type S1 = { a: number }; + type S2 = { b: number }; + type S3 = { c: number }; + type S4 = { d: number }; + type S5 = { e: number }; let obj: Obj; let s1: S1; @@ -8678,42 +8694,37 @@ namespace TestExtend { { let result: Obj; - result = _.extend(obj); + result = _.extend(obj); } { - let result: {a: number}; + let result: { a: number }; - result = _.extend(obj, s1); - result = _.extend(obj, s1, customizer); + result = _.extend(obj, s1); } { - let result: {a: number, b: number}; + let result: { a: number, b: number }; - result = _.extend(obj, s1, s2); - result = _.extend(obj, s1, s2, customizer); + result = _.extend(obj, s1, s2); } { - let result: {a: number, b: number, c: number}; + let result: { a: number, b: number, c: number }; - result = _.extend(obj, s1, s2, s3); - result = _.extend(obj, s1, s2, s3, customizer); + result = _.extend(obj, s1, s2, s3); } { - let result: {a: number, b: number, c: number, d: number}; + let result: { a: number, b: number, c: number, d: number }; - result = _.extend(obj, s1, s2, s3, s4); - result = _.extend(obj, s1, s2, s3, s4, customizer); + result = _.extend(obj, s1, s2, s3, s4); } { - let result: {a: number, b: number, c: number, d: number, e: number}; + let result: { a: number, b: number, c: number, d: number, e: number }; - result = _.extend(obj, s1, s2, s3, s4, s5); - result = _.extend(obj, s1, s2, s3, s4, s5, customizer); + result = _.extend<{ a: number, b: number, c: number, d: number, e: number }>(obj, s1, s2, s3, s4, s5); } { @@ -8723,38 +8734,33 @@ namespace TestExtend { } { - let result: _.LoDashImplicitObjectWrapper<{a: number}>; + let result: _.LoDashImplicitObjectWrapper<{ a: number }>; - result = _(obj).extend(s1); - result = _(obj).extend(s1, customizer); + result = _(obj).extend(s1); } { - let result: _.LoDashImplicitObjectWrapper<{a: number, b: number}>; + let result: _.LoDashImplicitObjectWrapper<{ a: number, b: number }>; - result = _(obj).extend(s1, s2); - result = _(obj).extend(s1, s2, customizer); + result = _(obj).extend(s1, s2); } { - let result: _.LoDashImplicitObjectWrapper<{a: number, b: number, c: number}>; + let result: _.LoDashImplicitObjectWrapper<{ a: number, b: number, c: number }>; - result = _(obj).extend(s1, s2, s3); - result = _(obj).extend(s1, s2, s3, customizer); + result = _(obj).extend(s1, s2, s3); } { - let result: _.LoDashImplicitObjectWrapper<{a: number, b: number, c: number, d: number}>; + let result: _.LoDashImplicitObjectWrapper<{ a: number, b: number, c: number, d: number }>; - result = _(obj).extend(s1, s2, s3, s4); - result = _(obj).extend(s1, s2, s3, s4, customizer); + result = _(obj).extend(s1, s2, s3, s4); } { - let result: _.LoDashImplicitObjectWrapper<{a: number, b: number, c: number, d: number, e: number}>; + let result: _.LoDashImplicitObjectWrapper<{ a: number, b: number, c: number, d: number, e: number }>; - result = _(obj).extend(s1, s2, s3, s4, s5); - result = _(obj).extend(s1, s2, s3, s4, s5, customizer); + result = _(obj).extend<{ a: number, b: number, c: number, d: number, e: number }>(s1, s2, s3, s4, s5); } { @@ -8764,38 +8770,161 @@ namespace TestExtend { } { - let result: _.LoDashExplicitObjectWrapper<{a: number}>; + let result: _.LoDashExplicitObjectWrapper<{ a: number }>; - result = _(obj).chain().extend(s1); - result = _(obj).chain().extend(s1, customizer); + result = _(obj).chain().extend(s1); } { - let result: _.LoDashExplicitObjectWrapper<{a: number, b: number}>; + let result: _.LoDashExplicitObjectWrapper<{ a: number, b: number }>; - result = _(obj).chain().extend(s1, s2); - result = _(obj).chain().extend(s1, s2, customizer); + result = _(obj).chain().extend(s1, s2); } { - let result: _.LoDashExplicitObjectWrapper<{a: number, b: number, c: number}>; + let result: _.LoDashExplicitObjectWrapper<{ a: number, b: number, c: number }>; - result = _(obj).chain().extend(s1, s2, s3); - result = _(obj).chain().extend(s1, s2, s3, customizer); + result = _(obj).chain().extend(s1, s2, s3); } { - let result: _.LoDashExplicitObjectWrapper<{a: number, b: number, c: number, d: number}>; + let result: _.LoDashExplicitObjectWrapper<{ a: number, b: number, c: number, d: number }>; - result = _(obj).chain().extend(s1, s2, s3, s4); - result = _(obj).chain().extend(s1, s2, s3, s4, customizer); + result = _(obj).chain().extend(s1, s2, s3, s4); } { - let result: _.LoDashExplicitObjectWrapper<{a: number, b: number, c: number, d: number, e: number}>; + let result: _.LoDashExplicitObjectWrapper<{ a: number, b: number, c: number, d: number, e: number }>; - result = _(obj).chain().extend(s1, s2, s3, s4, s5); - result = _(obj).chain().extend(s1, s2, s3, s4, s5, customizer); + result = _(obj).chain().extend<{ a: number, b: number, c: number, d: number, e: number }>(s1, s2, s3, s4, s5); + } +} + + +// _.extendWith +namespace TestExtendWith { + type Obj = { a: string }; + type S1 = { a: number }; + type S2 = { b: number }; + type S3 = { c: number }; + type S4 = { d: number }; + type S5 = { e: number }; + + let obj: Obj; + let s1: S1; + let s2: S2; + let s3: S3; + let s4: S4; + let s5: S5; + + let customizer: (objectValue: any, sourceValue: any, key?: string, object?: {}, source?: {}) => any; + + { + let result: Obj; + + result = _.extendWith(obj); + } + + { + let result: { a: number }; + + result = _.extendWith(obj, s1, customizer); + } + + { + let result: { a: number, b: number }; + + result = _.extendWith(obj, s1, s2, customizer); + } + + { + let result: { a: number, b: number, c: number }; + + result = _.extendWith(obj, s1, s2, s3, customizer); + } + + { + let result: { a: number, b: number, c: number, d: number }; + + result = _.extendWith(obj, s1, s2, s3, s4, customizer); + } + + { + let result: { a: number, b: number, c: number, d: number, e: number }; + + result = _.extendWith<{ a: number, b: number, c: number, d: number, e: number }>(obj, s1, s2, s3, s4, s5, customizer); + } + + { + let result: _.LoDashImplicitObjectWrapper; + + result = _(obj).extendWith(); + } + + { + let result: _.LoDashImplicitObjectWrapper<{ a: number }>; + + result = _(obj).extendWith(s1, customizer); + } + + { + let result: _.LoDashImplicitObjectWrapper<{ a: number, b: number }>; + + result = _(obj).extendWith(s1, s2, customizer); + } + + { + let result: _.LoDashImplicitObjectWrapper<{ a: number, b: number, c: number }>; + + result = _(obj).extendWith(s1, s2, s3, customizer); + } + + { + let result: _.LoDashImplicitObjectWrapper<{ a: number, b: number, c: number, d: number }>; + + result = _(obj).extendWith(s1, s2, s3, s4, customizer); + } + + { + let result: _.LoDashImplicitObjectWrapper<{ a: number, b: number, c: number, d: number, e: number }>; + + result = _(obj).extendWith<{ a: number, b: number, c: number, d: number, e: number }>(s1, s2, s3, s4, s5, customizer); + } + + { + let result: _.LoDashExplicitObjectWrapper; + + result = _(obj).chain().extendWith(); + } + + { + let result: _.LoDashExplicitObjectWrapper<{ a: number }>; + + result = _(obj).chain().extendWith(s1, customizer); + } + + { + let result: _.LoDashExplicitObjectWrapper<{ a: number, b: number }>; + + result = _(obj).chain().extendWith(s1, s2, customizer); + } + + { + let result: _.LoDashExplicitObjectWrapper<{ a: number, b: number, c: number }>; + + result = _(obj).chain().extendWith(s1, s2, s3, customizer); + } + + { + let result: _.LoDashExplicitObjectWrapper<{ a: number, b: number, c: number, d: number }>; + + result = _(obj).chain().extendWith(s1, s2, s3, s4, customizer); + } + + { + let result: _.LoDashExplicitObjectWrapper<{ a: number, b: number, c: number, d: number, e: number }>; + + result = _(obj).chain().extendWith<{ a: number, b: number, c: number, d: number, e: number }>(s1, s2, s3, s4, s5, customizer); } } @@ -10162,7 +10291,14 @@ namespace TestValues { { let result: TResult[]; - result = _.values(object); + result = _.values(object); + } + + { + let result: TResult[]; + + // Without this type hint, this will fail to compile, as expected. + result = _.values(new Object); } { @@ -10185,7 +10321,20 @@ namespace TestValuesIn { { let result: TResult[]; - result = _.valuesIn(object); + result = _.valuesIn(object); + } + + { + let result: TResult[]; + + // Without this type hint, this will fail to compile, as expected. + result = _.valuesIn(new Object); + } + + { + let result: TResult[]; + + result = _.values(object); } { diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 0e506e9597..52f274fd3c 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -1,6 +1,6 @@ -// Type definitions for Lo-Dash +// Type definitions for Lo-Dash 4.14 // Project: http://lodash.com/ -// Definitions by: Brian Zengel , Ilya Mochalov +// Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -2000,7 +2000,19 @@ declare module _ { flattenDeep(): LoDashExplicitArrayWrapper; } - //_.fromPairs DUMMY + // _.flattenDepth + interface LoDashStatic { + /** + * Recursively flatten array up to depth times. + * + * @param array The array to recursively flatten. + * @param number The maximum recursion depth. + * @return Returns the new flattened array. + */ + flattenDepth(array: ListOfRecursiveArraysOrValues, depth?: number): T[]; + } + + //_.fromPairs interface LoDashStatic { /** * The inverse of `_.toPairs`; this method returns an object composed @@ -2016,8 +2028,15 @@ declare module _ { * _.fromPairs([['fred', 30], ['barney', 40]]); * // => { 'fred': 30, 'barney': 40 } */ + fromPairs( + array: List<[_.StringRepresentable, T]> + ): Dictionary; + + /** + @see _.fromPairs + */ fromPairs( - array: any[]|List + array: List ): Dictionary; } @@ -8540,6 +8559,21 @@ declare module _ { callback: MemoIterator): TResult; } + interface LoDashExplicitObjectWrapper { + /** + * @see _.reduce + **/ + reduce( + callback: MemoIterator, + accumulator: TResult): LoDashExplicitObjectWrapper; + + /** + * @see _.reduce + **/ + reduce( + callback: MemoIterator): LoDashExplicitObjectWrapper; + } + //_.reduceRight interface LoDashStatic { /** @@ -10253,6 +10287,35 @@ declare module _ { * @param funcs Functions to invoke. * @return Returns the new function. */ + // 1-argument first function + flow(f1: (a1: A1) => R1, f2: (a: R1) => R2): (a1: A1) => R2; + flow(f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1) => R3; + flow(f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1) => R4; + flow(f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1) => R5; + flow(f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1) => R6; + flow(f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1) => R7; + // 2-argument first function + flow(f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2): (a1: A1, a2: A2) => R2; + flow(f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1, a2: A2) => R3; + flow(f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1, a2: A2) => R4; + flow(f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1, a2: A2) => R5; + flow(f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1, a2: A2) => R6; + flow(f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1, a2: A2) => R7; + // 3-argument first function + flow(f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2): (a1: A1, a2: A2, a3: A3) => R2; + flow(f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1, a2: A2, a3: A3) => R3; + flow(f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1, a2: A2, a3: A3) => R4; + flow(f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1, a2: A2, a3: A3) => R5; + flow(f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1, a2: A2, a3: A3) => R6; + flow(f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1, a2: A2, a3: A3) => R7; + // 4-argument first function + flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2): (a1: A1, a2: A2, a3: A3, a4: A4) => R2; + flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1, a2: A2, a3: A3, a4: A4) => R3; + flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1, a2: A2, a3: A3, a4: A4) => R4; + flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1, a2: A2, a3: A3, a4: A4) => R5; + flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1, a2: A2, a3: A3, a4: A4) => R6; + flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1, a2: A2, a3: A3, a4: A4) => R7; + // generic function flow(...funcs: Function[]): TResult; } @@ -13412,31 +13475,28 @@ declare module _ { iteratee: ListIterator ): number; - /** - * @see _.sumBy - **/ - sumBy( - collection: Dictionary, - iteratee: DictionaryIterator - ): number; - /** * @see _.sumBy */ - sumBy( - collection: List|Dictionary, + sumBy( + collection: List<{}>, iteratee: string ): number; /** * @see _.sumBy */ - sumBy(collection: List|Dictionary): number; + sumBy( + collection: List + ): number; /** * @see _.sumBy */ - sumBy(collection: List|Dictionary): number; + sumBy( + collection: List<{}>, + iteratee: Dictionary<{}> + ): number; } interface LoDashImplicitArrayWrapper { @@ -13455,15 +13515,15 @@ declare module _ { /** * @see _.sumBy */ - sumBy(): number; + sumBy(iteratee: Dictionary<{}>): number; } interface LoDashImplicitObjectWrapper { /** * @see _.sumBy - **/ - sumBy( - iteratee: ListIterator|DictionaryIterator + */ + sumBy( + iteratee: ListIterator<{}, number> ): number; /** @@ -13474,7 +13534,7 @@ declare module _ { /** * @see _.sumBy */ - sumBy(): number; + sumBy(iteratee: Dictionary<{}>): number; } interface LoDashExplicitArrayWrapper { @@ -13494,14 +13554,19 @@ declare module _ { * @see _.sumBy */ sumBy(): LoDashExplicitWrapper; + + /** + * @see _.sumBy + */ + sumBy(iteratee: Dictionary<{}>): LoDashExplicitWrapper; } interface LoDashExplicitObjectWrapper { /** * @see _.sumBy */ - sumBy( - iteratee: ListIterator|DictionaryIterator + sumBy( + iteratee: ListIterator<{}, number> ): LoDashExplicitWrapper; /** @@ -13512,7 +13577,7 @@ declare module _ { /** * @see _.sumBy */ - sumBy(): LoDashExplicitWrapper; + sumBy(iteratee: Dictionary<{}>): LoDashExplicitWrapper; } /********** @@ -13761,53 +13826,52 @@ declare module _ { * _.assign({ 'a': 1 }, new Foo, new Bar); * // => { 'a': 1, 'c': 3, 'e': 5 } */ - assign( + assign( object: TObject, source: TSource - ): TResult; + ): TObject & TSource; /** * @see assign */ - assign( + assign( object: TObject, source1: TSource1, source2: TSource2 - ): TResult; + ): TObject & TSource1 & TSource2; /** * @see assign */ - assign( + assign( object: TObject, source1: TSource1, source2: TSource2, source3: TSource3 - ): TResult; + ): TObject & TSource1 & TSource2 & TSource3; /** * @see assign */ - assign - ( + assign( object: TObject, source1: TSource1, source2: TSource2, source3: TSource3, source4: TSource4 - ): TResult; + ): TObject & TSource1 & TSource2 & TSource3 & TSource4; /** * @see _.assign */ - assign(object: TObject): TObject; + assign(object: TObject): TObject; /** * @see _.assign */ - assign( - object: TObject, ...otherArgs: any[] + assign( + object: any, + ...otherArgs: any[] ): TResult; } @@ -13815,36 +13879,36 @@ declare module _ { /** * @see _.assign */ - assign( + assign( source: TSource - ): LoDashImplicitObjectWrapper; + ): LoDashImplicitObjectWrapper; /** * @see assign */ - assign( + assign( source1: TSource1, source2: TSource2 - ): LoDashImplicitObjectWrapper; + ): LoDashImplicitObjectWrapper; /** * @see assign */ - assign( + assign( source1: TSource1, source2: TSource2, source3: TSource3 - ): LoDashImplicitObjectWrapper; + ): LoDashImplicitObjectWrapper; /** * @see assign */ - assign( + assign( source1: TSource1, source2: TSource2, source3: TSource3, source4: TSource4 - ): LoDashImplicitObjectWrapper; + ): LoDashImplicitObjectWrapper; /** * @see _.assign @@ -13854,43 +13918,43 @@ declare module _ { /** * @see _.assign */ - assign(...otherArgs: any[]): LoDashImplicitObjectWrapper; + assign(...otherArgs: any[]): LoDashImplicitObjectWrapper; } interface LoDashExplicitObjectWrapper { /** * @see _.assign */ - assign( + assign( source: TSource - ): LoDashExplicitObjectWrapper; + ): LoDashExplicitObjectWrapper; /** * @see assign */ - assign( + assign( source1: TSource1, source2: TSource2 - ): LoDashExplicitObjectWrapper; + ): LoDashExplicitObjectWrapper; /** * @see assign */ - assign( + assign( source1: TSource1, source2: TSource2, source3: TSource3 - ): LoDashExplicitObjectWrapper; + ): LoDashExplicitObjectWrapper; /** * @see assign */ - assign( + assign( source1: TSource1, source2: TSource2, source3: TSource3, source4: TSource4 - ): LoDashExplicitObjectWrapper; + ): LoDashExplicitObjectWrapper; /** * @see _.assign @@ -13900,7 +13964,7 @@ declare module _ { /** * @see _.assign */ - assign(...otherArgs: any[]): LoDashExplicitObjectWrapper; + assign(...otherArgs: any[]): LoDashExplicitObjectWrapper; } //_.assignWith @@ -13935,57 +13999,56 @@ declare module _ { * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); * // => { 'a': 1, 'b': 2 } */ - assignWith( + assignWith( object: TObject, source: TSource, customizer: AssignCustomizer - ): TResult; + ): TObject & TSource; /** * @see assignWith */ - assignWith( + assignWith( object: TObject, source1: TSource1, source2: TSource2, customizer: AssignCustomizer - ): TResult; + ): TObject & TSource1 & TSource2; /** * @see assignWith */ - assignWith( + assignWith( object: TObject, source1: TSource1, source2: TSource2, source3: TSource3, customizer: AssignCustomizer - ): TResult; + ): TObject & TSource1 & TSource2 & TSource3; /** * @see assignWith */ - assignWith - ( + assignWith( object: TObject, source1: TSource1, source2: TSource2, source3: TSource3, source4: TSource4, customizer: AssignCustomizer - ): TResult; + ): TObject & TSource1 & TSource2 & TSource3 & TSource4; /** * @see _.assignWith */ - assignWith(object: TObject): TObject; + assignWith(object: TObject): TObject; /** * @see _.assignWith */ - assignWith( - object: TObject, ...otherArgs: any[] + assignWith( + object: any, + ...otherArgs: any[] ): TResult; } @@ -13993,40 +14056,40 @@ declare module _ { /** * @see _.assignWith */ - assignWith( + assignWith( source: TSource, customizer: AssignCustomizer - ): LoDashImplicitObjectWrapper; + ): LoDashImplicitObjectWrapper; /** * @see assignWith */ - assignWith( + assignWith( source1: TSource1, source2: TSource2, customizer: AssignCustomizer - ): LoDashImplicitObjectWrapper; + ): LoDashImplicitObjectWrapper; /** * @see assignWith */ - assignWith( + assignWith( source1: TSource1, source2: TSource2, source3: TSource3, customizer: AssignCustomizer - ): LoDashImplicitObjectWrapper; + ): LoDashImplicitObjectWrapper; /** * @see assignWith */ - assignWith( + assignWith( source1: TSource1, source2: TSource2, source3: TSource3, source4: TSource4, customizer: AssignCustomizer - ): LoDashImplicitObjectWrapper; + ): LoDashImplicitObjectWrapper; /** * @see _.assignWith @@ -14036,47 +14099,47 @@ declare module _ { /** * @see _.assignWith */ - assignWith(...otherArgs: any[]): LoDashImplicitObjectWrapper; + assignWith(...otherArgs: any[]): LoDashImplicitObjectWrapper; } interface LoDashExplicitObjectWrapper { /** * @see _.assignWith */ - assignWith( + assignWith( source: TSource, customizer: AssignCustomizer - ): LoDashExplicitObjectWrapper; + ): LoDashExplicitObjectWrapper; /** * @see assignWith */ - assignWith( + assignWith( source1: TSource1, source2: TSource2, customizer: AssignCustomizer - ): LoDashExplicitObjectWrapper; + ): LoDashExplicitObjectWrapper; /** * @see assignWith */ - assignWith( + assignWith( source1: TSource1, source2: TSource2, source3: TSource3, customizer: AssignCustomizer - ): LoDashExplicitObjectWrapper; + ): LoDashExplicitObjectWrapper; /** * @see assignWith */ - assignWith( + assignWith( source1: TSource1, source2: TSource2, source3: TSource3, source4: TSource4, customizer: AssignCustomizer - ): LoDashExplicitObjectWrapper; + ): LoDashExplicitObjectWrapper; /** * @see _.assignWith @@ -14086,7 +14149,7 @@ declare module _ { /** * @see _.assignWith */ - assignWith(...otherArgs: any[]): LoDashExplicitObjectWrapper; + assignWith(...otherArgs: any[]): LoDashExplicitObjectWrapper; } //_.assignIn @@ -14120,53 +14183,52 @@ declare module _ { * _.assignIn({ 'a': 1 }, new Foo, new Bar); * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 } */ - assignIn( + assignIn( object: TObject, source: TSource - ): TResult; + ): TObject & TSource; /** * @see assignIn */ - assignIn( + assignIn( object: TObject, source1: TSource1, source2: TSource2 - ): TResult; + ): TObject & TSource1 & TSource2; /** * @see assignIn */ - assignIn( + assignIn( object: TObject, source1: TSource1, source2: TSource2, source3: TSource3 - ): TResult; + ): TObject & TSource1 & TSource2 & TSource3; /** * @see assignIn */ - assignIn - ( + assignIn( object: TObject, source1: TSource1, source2: TSource2, source3: TSource3, source4: TSource4 - ): TResult; + ): TObject & TSource1 & TSource2 & TSource3 & TSource4; /** * @see _.assignIn */ - assignIn(object: TObject): TObject; + assignIn(object: TObject): TObject; /** * @see _.assignIn */ - assignIn( - object: TObject, ...otherArgs: any[] + assignIn( + object: any, + ...otherArgs: any[] ): TResult; } @@ -14174,36 +14236,36 @@ declare module _ { /** * @see _.assignIn */ - assignIn( + assignIn( source: TSource - ): LoDashImplicitObjectWrapper; + ): LoDashImplicitObjectWrapper; /** * @see assignIn */ - assignIn( + assignIn( source1: TSource1, source2: TSource2 - ): LoDashImplicitObjectWrapper; + ): LoDashImplicitObjectWrapper; /** * @see assignIn */ - assignIn( + assignIn( source1: TSource1, source2: TSource2, source3: TSource3 - ): LoDashImplicitObjectWrapper; + ): LoDashImplicitObjectWrapper; /** * @see assignIn */ - assignIn( + assignIn( source1: TSource1, source2: TSource2, source3: TSource3, source4: TSource4 - ): LoDashImplicitObjectWrapper; + ): LoDashImplicitObjectWrapper; /** * @see _.assignIn @@ -14213,43 +14275,43 @@ declare module _ { /** * @see _.assignIn */ - assignIn(...otherArgs: any[]): LoDashImplicitObjectWrapper; + assignIn(...otherArgs: any[]): LoDashImplicitObjectWrapper; } interface LoDashExplicitObjectWrapper { /** * @see _.assignIn */ - assignIn( + assignIn( source: TSource - ): LoDashExplicitObjectWrapper; + ): LoDashExplicitObjectWrapper; /** * @see assignIn */ - assignIn( + assignIn( source1: TSource1, source2: TSource2 - ): LoDashExplicitObjectWrapper; + ): LoDashExplicitObjectWrapper; /** * @see assignIn */ - assignIn( + assignIn( source1: TSource1, source2: TSource2, source3: TSource3 - ): LoDashExplicitObjectWrapper; + ): LoDashExplicitObjectWrapper; /** * @see assignIn */ - assignIn( + assignIn( source1: TSource1, source2: TSource2, source3: TSource3, source4: TSource4 - ): LoDashExplicitObjectWrapper; + ): LoDashExplicitObjectWrapper; /** * @see _.assignIn @@ -14259,7 +14321,7 @@ declare module _ { /** * @see _.assignIn */ - assignIn(...otherArgs: any[]): LoDashExplicitObjectWrapper; + assignIn(...otherArgs: any[]): LoDashExplicitObjectWrapper; } //_.assignInWith @@ -14295,57 +14357,56 @@ declare module _ { * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); * // => { 'a': 1, 'b': 2 } */ - assignInWith( + assignInWith( object: TObject, source: TSource, customizer: AssignCustomizer - ): TResult; + ): TObject & TSource; /** * @see assignInWith */ - assignInWith( + assignInWith( object: TObject, source1: TSource1, source2: TSource2, customizer: AssignCustomizer - ): TResult; + ): TObject & TSource1 & TSource2; /** * @see assignInWith */ - assignInWith( + assignInWith( object: TObject, source1: TSource1, source2: TSource2, source3: TSource3, customizer: AssignCustomizer - ): TResult; + ): TObject & TSource1 & TSource2 & TSource3; /** * @see assignInWith */ - assignInWith - ( + assignInWith( object: TObject, source1: TSource1, source2: TSource2, source3: TSource3, source4: TSource4, customizer: AssignCustomizer - ): TResult; + ): TObject & TSource1 & TSource2 & TSource3 & TSource4; /** * @see _.assignInWith */ - assignInWith(object: TObject): TObject; + assignInWith(object: TObject): TObject; /** * @see _.assignInWith */ - assignInWith( - object: TObject, ...otherArgs: any[] + assignInWith( + object: any, + ...otherArgs: any[] ): TResult; } @@ -14353,40 +14414,40 @@ declare module _ { /** * @see _.assignInWith */ - assignInWith( + assignInWith( source: TSource, customizer: AssignCustomizer - ): LoDashImplicitObjectWrapper; + ): LoDashImplicitObjectWrapper; /** * @see assignInWith */ - assignInWith( + assignInWith( source1: TSource1, source2: TSource2, customizer: AssignCustomizer - ): LoDashImplicitObjectWrapper; + ): LoDashImplicitObjectWrapper; /** * @see assignInWith */ - assignInWith( + assignInWith( source1: TSource1, source2: TSource2, source3: TSource3, customizer: AssignCustomizer - ): LoDashImplicitObjectWrapper; + ): LoDashImplicitObjectWrapper; /** * @see assignInWith */ - assignInWith( + assignInWith( source1: TSource1, source2: TSource2, source3: TSource3, source4: TSource4, customizer: AssignCustomizer - ): LoDashImplicitObjectWrapper; + ): LoDashImplicitObjectWrapper; /** * @see _.assignInWith @@ -14396,47 +14457,47 @@ declare module _ { /** * @see _.assignInWith */ - assignInWith(...otherArgs: any[]): LoDashImplicitObjectWrapper; + assignInWith(...otherArgs: any[]): LoDashImplicitObjectWrapper; } interface LoDashExplicitObjectWrapper { /** * @see _.assignInWith */ - assignInWith( + assignInWith( source: TSource, customizer: AssignCustomizer - ): LoDashExplicitObjectWrapper; + ): LoDashExplicitObjectWrapper; /** * @see assignInWith */ - assignInWith( + assignInWith( source1: TSource1, source2: TSource2, customizer: AssignCustomizer - ): LoDashExplicitObjectWrapper; + ): LoDashExplicitObjectWrapper; /** * @see assignInWith */ - assignInWith( + assignInWith( source1: TSource1, source2: TSource2, source3: TSource3, customizer: AssignCustomizer - ): LoDashExplicitObjectWrapper; + ): LoDashExplicitObjectWrapper; /** * @see assignInWith */ - assignInWith( + assignInWith( source1: TSource1, source2: TSource2, source3: TSource3, source4: TSource4, customizer: AssignCustomizer - ): LoDashExplicitObjectWrapper; + ): LoDashExplicitObjectWrapper; /** * @see _.assignInWith @@ -14446,7 +14507,7 @@ declare module _ { /** * @see _.assignInWith */ - assignInWith(...otherArgs: any[]): LoDashExplicitObjectWrapper; + assignInWith(...otherArgs: any[]): LoDashExplicitObjectWrapper; } //_.create @@ -14479,6 +14540,7 @@ declare module _ { create(properties?: U): LoDashExplicitObjectWrapper; } + //_.defaults interface LoDashStatic { /** @@ -14492,59 +14554,52 @@ declare module _ { * @param sources The source objects. * @return The destination object. */ - defaults( - object: Obj, - ...sources: {}[] - ): TResult; + defaults( + object: TObject, + source: TSource + ): TSource & TObject; /** * @see _.defaults */ - defaults( - object: Obj, - source1: S1, - ...sources: {}[] - ): TResult; + defaults( + object: TObject, + source1: TSource1, + source2: TSource2 + ): TSource2 & TSource1 & TObject; /** * @see _.defaults */ - defaults( - object: Obj, - source1: S1, - source2: S2, - ...sources: {}[] - ): TResult; + defaults( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): TSource3 & TSource2 & TSource1 & TObject; /** * @see _.defaults */ - defaults( - object: Obj, - source1: S1, - source2: S2, - source3: S3, - ...sources: {}[] - ): TResult; + defaults( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): TSource4 & TSource3 & TSource2 & TSource1 & TObject; /** * @see _.defaults */ - defaults( - object: Obj, - source1: S1, - source2: S2, - source3: S3, - source4: S4, - ...sources: {}[] - ): TResult; + defaults(object: TObject): TObject; /** * @see _.defaults */ - defaults( - object: {}, - ...sources: {}[] + defaults( + object: any, + ...sources: any[] ): TResult; } @@ -14552,40 +14607,36 @@ declare module _ { /** * @see _.defaults */ - defaults( - source1: S1, - ...sources: {}[] - ): LoDashImplicitObjectWrapper; + defaults( + source: TSource + ): LoDashImplicitObjectWrapper; /** * @see _.defaults */ - defaults( - source1: S1, - source2: S2, - ...sources: {}[] - ): LoDashImplicitObjectWrapper; + defaults( + source1: TSource1, + source2: TSource2 + ): LoDashImplicitObjectWrapper; /** * @see _.defaults */ - defaults( - source1: S1, - source2: S2, - source3: S3, - ...sources: {}[] - ): LoDashImplicitObjectWrapper; + defaults( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashImplicitObjectWrapper; /** * @see _.defaults */ - defaults( - source1: S1, - source2: S2, - source3: S3, - source4: S4, - ...sources: {}[] - ): LoDashImplicitObjectWrapper; + defaults( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashImplicitObjectWrapper; /** * @see _.defaults @@ -14595,47 +14646,43 @@ declare module _ { /** * @see _.defaults */ - defaults(...sources: {}[]): LoDashImplicitObjectWrapper; + defaults(...sources: any[]): LoDashImplicitObjectWrapper; } interface LoDashExplicitObjectWrapper { /** * @see _.defaults */ - defaults( - source1: S1, - ...sources: {}[] - ): LoDashExplicitObjectWrapper; + defaults( + source: TSource + ): LoDashExplicitObjectWrapper; /** * @see _.defaults */ - defaults( - source1: S1, - source2: S2, - ...sources: {}[] - ): LoDashExplicitObjectWrapper; + defaults( + source1: TSource1, + source2: TSource2 + ): LoDashExplicitObjectWrapper; /** * @see _.defaults */ - defaults( - source1: S1, - source2: S2, - source3: S3, - ...sources: {}[] - ): LoDashExplicitObjectWrapper; + defaults( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashExplicitObjectWrapper; /** * @see _.defaults */ - defaults( - source1: S1, - source2: S2, - source3: S3, - source4: S4, - ...sources: {}[] - ): LoDashExplicitObjectWrapper; + defaults( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashExplicitObjectWrapper; /** * @see _.defaults @@ -14645,7 +14692,7 @@ declare module _ { /** * @see _.defaults */ - defaults(...sources: {}[]): LoDashExplicitObjectWrapper; + defaults(...sources: any[]): LoDashExplicitObjectWrapper; } //_.defaultsDeep @@ -14668,163 +14715,307 @@ declare module _ { defaultsDeep(...sources: any[]): LoDashImplicitObjectWrapper } - //_.extend + // _.extend interface LoDashStatic { /** - * @see assign + * @see _.assignIn */ - extend( + extend( object: TObject, - source: TSource, - customizer?: AssignCustomizer - ): TResult; + source: TSource + ): TObject & TSource; /** - * @see assign + * @see _.assignIn */ - extend( + extend( + object: TObject, + source1: TSource1, + source2: TSource2 + ): TObject & TSource1 & TSource2; + + /** + * @see _.assignIn + */ + extend( object: TObject, source1: TSource1, source2: TSource2, - customizer?: AssignCustomizer - ): TResult; + source3: TSource3 + ): TObject & TSource1 & TSource2 & TSource3; /** - * @see assign + * @see _.assignIn */ - extend( + extend( object: TObject, source1: TSource1, source2: TSource2, source3: TSource3, - customizer?: AssignCustomizer - ): TResult; + source4: TSource4 + ): TObject & TSource1 & TSource2 & TSource3 & TSource4; /** - * @see assign + * @see _.assignIn */ - extend - ( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4, - customizer?: AssignCustomizer - ): TResult; + extend(object: TObject): TObject; /** - * @see _.assign + * @see _.assignIn */ - extend(object: TObject): TObject; - - /** - * @see _.assign - */ - extend( - object: TObject, ...otherArgs: any[] + extend( + object: any, + ...otherArgs: any[] ): TResult; } interface LoDashImplicitObjectWrapper { /** - * @see _.assign + * @see _.assignIn */ - extend( - source: TSource, - customizer?: AssignCustomizer - ): LoDashImplicitObjectWrapper; + extend( + source: TSource + ): LoDashImplicitObjectWrapper; /** - * @see assign + * @see _.assignIn */ - extend( + extend( + source1: TSource1, + source2: TSource2 + ): LoDashImplicitObjectWrapper; + + /** + * @see _.assignIn + */ + extend( source1: TSource1, source2: TSource2, - customizer?: AssignCustomizer - ): LoDashImplicitObjectWrapper; + source3: TSource3 + ): LoDashImplicitObjectWrapper; /** - * @see assign + * @see _.assignIn */ - extend( + extend( source1: TSource1, source2: TSource2, source3: TSource3, - customizer?: AssignCustomizer - ): LoDashImplicitObjectWrapper; + source4: TSource4 + ): LoDashImplicitObjectWrapper; /** - * @see assign - */ - extend( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4, - customizer?: AssignCustomizer - ): LoDashImplicitObjectWrapper; - - /** - * @see _.assign + * @see _.assignIn */ extend(): LoDashImplicitObjectWrapper; /** - * @see _.assign + * @see _.assignIn */ - extend(...otherArgs: any[]): LoDashImplicitObjectWrapper; + extend(...otherArgs: any[]): LoDashImplicitObjectWrapper; } interface LoDashExplicitObjectWrapper { /** - * @see _.assign + * @see _.assignIn */ - extend( - source: TSource, - customizer?: AssignCustomizer - ): LoDashExplicitObjectWrapper; + extend( + source: TSource + ): LoDashExplicitObjectWrapper; /** - * @see assign + * @see _.assignIn */ - extend( + extend( + source1: TSource1, + source2: TSource2 + ): LoDashExplicitObjectWrapper; + + /** + * @see _.assignIn + */ + extend( source1: TSource1, source2: TSource2, - customizer?: AssignCustomizer - ): LoDashExplicitObjectWrapper; + source3: TSource3 + ): LoDashExplicitObjectWrapper; /** - * @see assign + * @see _.assignIn */ - extend( + extend( source1: TSource1, source2: TSource2, source3: TSource3, - customizer?: AssignCustomizer - ): LoDashExplicitObjectWrapper; + source4: TSource4 + ): LoDashExplicitObjectWrapper; /** - * @see assign - */ - extend( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4, - customizer?: AssignCustomizer - ): LoDashExplicitObjectWrapper; - - /** - * @see _.assign + * @see _.assignIn */ extend(): LoDashExplicitObjectWrapper; /** - * @see _.assign + * @see _.assignIn */ - extend(...otherArgs: any[]): LoDashExplicitObjectWrapper; + extend(...otherArgs: any[]): LoDashExplicitObjectWrapper; + } + + interface LoDashStatic { + /** + * @see _.assignInWith + */ + extendWith( + object: TObject, + source: TSource, + customizer: AssignCustomizer + ): TObject & TSource; + + /** + * @see _.assignInWith + */ + extendWith( + object: TObject, + source1: TSource1, + source2: TSource2, + customizer: AssignCustomizer + ): TObject & TSource1 & TSource2; + + /** + * @see _.assignInWith + */ + extendWith( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: AssignCustomizer + ): TObject & TSource1 & TSource2 & TSource3; + + /** + * @see _.assignInWith + */ + extendWith( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: AssignCustomizer + ): TObject & TSource1 & TSource2 & TSource3 & TSource4; + + /** + * @see _.assignInWith + */ + extendWith(object: TObject): TObject; + + /** + * @see _.assignInWith + */ + extendWith( + object: any, + ...otherArgs: any[] + ): TResult; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.assignInWith + */ + extendWith( + source: TSource, + customizer: AssignCustomizer + ): LoDashImplicitObjectWrapper; + + /** + * @see _.assignInWith + */ + extendWith( + source1: TSource1, + source2: TSource2, + customizer: AssignCustomizer + ): LoDashImplicitObjectWrapper; + + /** + * @see _.assignInWith + */ + extendWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: AssignCustomizer + ): LoDashImplicitObjectWrapper; + + /** + * @see _.assignInWith + */ + extendWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: AssignCustomizer + ): LoDashImplicitObjectWrapper; + + /** + * @see _.assignInWith + */ + extendWith(): LoDashImplicitObjectWrapper; + + /** + * @see _.assignInWith + */ + extendWith(...otherArgs: any[]): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.assignInWith + */ + extendWith( + source: TSource, + customizer: AssignCustomizer + ): LoDashExplicitObjectWrapper; + + /** + * @see _.assignInWith + */ + extendWith( + source1: TSource1, + source2: TSource2, + customizer: AssignCustomizer + ): LoDashExplicitObjectWrapper; + + /** + * @see _.assignInWith + */ + extendWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: AssignCustomizer + ): LoDashExplicitObjectWrapper; + + /** + * @see _.assignInWith + */ + extendWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: AssignCustomizer + ): LoDashExplicitObjectWrapper; + + /** + * @see _.assignInWith + */ + extendWith(): LoDashExplicitObjectWrapper; + + /** + * @see _.assignInWith + */ + extendWith(...otherArgs: any[]): LoDashExplicitObjectWrapper; } //_.findKey @@ -16878,6 +17069,11 @@ declare module _ { * @param object The object to query. * @return Returns an array of property values. */ + values(object?: Dictionary): T[]; + + /** + * @see _.values + */ values(object?: any): T[]; } @@ -16903,6 +17099,11 @@ declare module _ { * @param object The object to query. * @return Returns the array of property values. */ + valuesIn(object?: Dictionary): T[]; + + /** + * @see _.valuesIn + */ valuesIn(object?: any): T[]; } @@ -18961,6 +19162,1834 @@ declare module _ { } } +// Named exports + +declare module "lodash/after" { + const after: typeof _.after; + export = after; +} + + +declare module "lodash/ary" { + const ary: typeof _.ary; + export = ary; +} + + +declare module "lodash/assign" { + const assign: typeof _.assign; + export = assign; +} + + +declare module "lodash/assignIn" { + const assignIn: typeof _.assignIn; + export = assignIn; +} + + +declare module "lodash/assignInWith" { + const assignInWith: typeof _.assignInWith; + export = assignInWith; +} + + +declare module "lodash/assignWith" { + const assignWith: typeof _.assignWith; + export = assignWith; +} + + +declare module "lodash/at" { + const at: typeof _.at; + export = at; +} + + +declare module "lodash/before" { + const before: typeof _.before; + export = before; +} + + +declare module "lodash/bind" { + const bind: typeof _.bind; + export = bind; +} + + +declare module "lodash/bindAll" { + const bindAll: typeof _.bindAll; + export = bindAll; +} + + +declare module "lodash/bindKey" { + const bindKey: typeof _.bindKey; + export = bindKey; +} + + +declare module "lodash/castArray" { + const castArray: typeof _.castArray; + export = castArray; +} + + +declare module "lodash/chain" { + const chain: typeof _.chain; + export = chain; +} + + +declare module "lodash/chunk" { + const chunk: typeof _.chunk; + export = chunk; +} + + +declare module "lodash/compact" { + const compact: typeof _.compact; + export = compact; +} + + +declare module "lodash/concat" { + const concat: typeof _.concat; + export = concat; +} + +/** +* uncoment it if definition exists +*/ +/* +declare module "lodash/cond" { + const cond: typeof _.cond; + export = cond; +} +*/ + +/** +* uncoment it if definition exists +*/ +/* +declare module "lodash/conforms" { + const conforms: typeof _.conforms; + export = conforms; +} +*/ + +declare module "lodash/constant" { + const constant: typeof _.constant; + export = constant; +} + + +declare module "lodash/countBy" { + const countBy: typeof _.countBy; + export = countBy; +} + + +declare module "lodash/create" { + const create: typeof _.create; + export = create; +} + + +declare module "lodash/curry" { + const curry: typeof _.curry; + export = curry; +} + + +declare module "lodash/curryRight" { + const curryRight: typeof _.curryRight; + export = curryRight; +} + + +declare module "lodash/debounce" { + const debounce: typeof _.debounce; + export = debounce; +} + + +declare module "lodash/defaults" { + const defaults: typeof _.defaults; + export = defaults; +} + + +declare module "lodash/defaultsDeep" { + const defaultsDeep: typeof _.defaultsDeep; + export = defaultsDeep; +} + + +declare module "lodash/defer" { + const defer: typeof _.defer; + export = defer; +} + + +declare module "lodash/delay" { + const delay: typeof _.delay; + export = delay; +} + + +declare module "lodash/difference" { + const difference: typeof _.difference; + export = difference; +} + + +declare module "lodash/differenceBy" { + const differenceBy: typeof _.differenceBy; + export = differenceBy; +} + + +declare module "lodash/differenceWith" { + const differenceWith: typeof _.differenceWith; + export = differenceWith; +} + + +declare module "lodash/drop" { + const drop: typeof _.drop; + export = drop; +} + + +declare module "lodash/dropRight" { + const dropRight: typeof _.dropRight; + export = dropRight; +} + + +declare module "lodash/dropRightWhile" { + const dropRightWhile: typeof _.dropRightWhile; + export = dropRightWhile; +} + + +declare module "lodash/dropWhile" { + const dropWhile: typeof _.dropWhile; + export = dropWhile; +} + + +declare module "lodash/fill" { + const fill: typeof _.fill; + export = fill; +} + + +declare module "lodash/filter" { + const filter: typeof _.filter; + export = filter; +} + + +declare module "lodash/flatMap" { + const flatMap: typeof _.flatMap; + export = flatMap; +} + +/** +* uncoment it if definition exists +*/ +/* +declare module "lodash/flatMapDeep" { + const flatMapDeep: typeof _.flatMapDeep; + export = flatMapDeep; +} +*/ +/** +* uncoment it if definition exists +*/ +/* +declare module "lodash/flatMapDepth" { + const flatMapDepth: typeof _.flatMapDepth; + export = flatMapDepth; +} +*/ + +declare module "lodash/flatten" { + const flatten: typeof _.flatten; + export = flatten; +} + + +declare module "lodash/flattenDeep" { + const flattenDeep: typeof _.flattenDeep; + export = flattenDeep; +} + +declare module "lodash/flattenDepth" { + const flattenDepth: typeof _.flattenDepth; + export = flattenDepth; +} + +declare module "lodash/flip" { + const flip: typeof _.flip; + export = flip; +} + + +declare module "lodash/flow" { + const flow: typeof _.flow; + export = flow; +} + + +declare module "lodash/flowRight" { + const flowRight: typeof _.flowRight; + export = flowRight; +} + + +declare module "lodash/fromPairs" { + const fromPairs: typeof _.fromPairs; + export = fromPairs; +} + + +declare module "lodash/functions" { + const functions: typeof _.functions; + export = functions; +} + + +declare module "lodash/functionsIn" { + const functionsIn: typeof _.functionsIn; + export = functionsIn; +} + + +declare module "lodash/groupBy" { + const groupBy: typeof _.groupBy; + export = groupBy; +} + + +declare module "lodash/initial" { + const initial: typeof _.initial; + export = initial; +} + + +declare module "lodash/intersection" { + const intersection: typeof _.intersection; + export = intersection; +} + + +declare module "lodash/intersectionBy" { + const intersectionBy: typeof _.intersectionBy; + export = intersectionBy; +} + + +declare module "lodash/intersectionWith" { + const intersectionWith: typeof _.intersectionWith; + export = intersectionWith; +} + + +declare module "lodash/invert" { + const invert: typeof _.invert; + export = invert; +} + + +declare module "lodash/invertBy" { + const invertBy: typeof _.invertBy; + export = invertBy; +} + + +declare module "lodash/invokeMap" { + const invokeMap: typeof _.invokeMap; + export = invokeMap; +} + + +declare module "lodash/iteratee" { + const iteratee: typeof _.iteratee; + export = iteratee; +} + + +declare module "lodash/keyBy" { + const keyBy: typeof _.keyBy; + export = keyBy; +} + + +declare module "lodash/keys" { + const keys: typeof _.keys; + export = keys; +} + + +declare module "lodash/keysIn" { + const keysIn: typeof _.keysIn; + export = keysIn; +} + + +declare module "lodash/map" { + const map: typeof _.map; + export = map; +} + + +declare module "lodash/mapKeys" { + const mapKeys: typeof _.mapKeys; + export = mapKeys; +} + + +declare module "lodash/mapValues" { + const mapValues: typeof _.mapValues; + export = mapValues; +} + + +declare module "lodash/matches" { + const matches: typeof _.matches; + export = matches; +} + + +declare module "lodash/matchesProperty" { + const matchesProperty: typeof _.matchesProperty; + export = matchesProperty; +} + + +declare module "lodash/memoize" { + const memoize: typeof _.memoize; + export = memoize; +} + + +declare module "lodash/merge" { + const merge: typeof _.merge; + export = merge; +} + + +declare module "lodash/mergeWith" { + const mergeWith: typeof _.mergeWith; + export = mergeWith; +} + + +declare module "lodash/method" { + const method: typeof _.method; + export = method; +} + + +declare module "lodash/methodOf" { + const methodOf: typeof _.methodOf; + export = methodOf; +} + + +declare module "lodash/mixin" { + const mixin: typeof _.mixin; + export = mixin; +} + + +declare module "lodash/negate" { + const negate: typeof _.negate; + export = negate; +} + + +declare module "lodash/nthArg" { + const nthArg: typeof _.nthArg; + export = nthArg; +} + + +declare module "lodash/omit" { + const omit: typeof _.omit; + export = omit; +} + + +declare module "lodash/omitBy" { + const omitBy: typeof _.omitBy; + export = omitBy; +} + + +declare module "lodash/once" { + const once: typeof _.once; + export = once; +} + + +declare module "lodash/orderBy" { + const orderBy: typeof _.orderBy; + export = orderBy; +} + + +declare module "lodash/over" { + const over: typeof _.over; + export = over; +} + + +declare module "lodash/overArgs" { + const overArgs: typeof _.overArgs; + export = overArgs; +} + + +declare module "lodash/overEvery" { + const overEvery: typeof _.overEvery; + export = overEvery; +} + + +declare module "lodash/overSome" { + const overSome: typeof _.overSome; + export = overSome; +} + + +declare module "lodash/partial" { + const partial: typeof _.partial; + export = partial; +} + + +declare module "lodash/partialRight" { + const partialRight: typeof _.partialRight; + export = partialRight; +} + + +declare module "lodash/partition" { + const partition: typeof _.partition; + export = partition; +} + + +declare module "lodash/pick" { + const pick: typeof _.pick; + export = pick; +} + + +declare module "lodash/pickBy" { + const pickBy: typeof _.pickBy; + export = pickBy; +} + + +declare module "lodash/property" { + const property: typeof _.property; + export = property; +} + + +declare module "lodash/propertyOf" { + const propertyOf: typeof _.propertyOf; + export = propertyOf; +} + + +declare module "lodash/pull" { + const pull: typeof _.pull; + export = pull; +} + + +declare module "lodash/pullAll" { + const pullAll: typeof _.pullAll; + export = pullAll; +} + + +declare module "lodash/pullAllBy" { + const pullAllBy: typeof _.pullAllBy; + export = pullAllBy; +} + +/** +* uncoment it if definition exists +*/ +/* +declare module "lodash/pullAllWith" { + const pullAllWith: typeof _.pullAllWith; + export = pullAllWith; +} +*/ + +declare module "lodash/pullAt" { + const pullAt: typeof _.pullAt; + export = pullAt; +} + + +declare module "lodash/range" { + const range: typeof _.range; + export = range; +} + + +declare module "lodash/rangeRight" { + const rangeRight: typeof _.rangeRight; + export = rangeRight; +} + + +declare module "lodash/rearg" { + const rearg: typeof _.rearg; + export = rearg; +} + + +declare module "lodash/reject" { + const reject: typeof _.reject; + export = reject; +} + + +declare module "lodash/remove" { + const remove: typeof _.remove; + export = remove; +} + + +declare module "lodash/rest" { + const rest: typeof _.rest; + export = rest; +} + + +declare module "lodash/reverse" { + const reverse: typeof _.reverse; + export = reverse; +} + + +declare module "lodash/sampleSize" { + const sampleSize: typeof _.sampleSize; + export = sampleSize; +} + + +declare module "lodash/set" { + const set: typeof _.set; + export = set; +} + + +declare module "lodash/setWith" { + const setWith: typeof _.setWith; + export = setWith; +} + + +declare module "lodash/shuffle" { + const shuffle: typeof _.shuffle; + export = shuffle; +} + + +declare module "lodash/slice" { + const slice: typeof _.slice; + export = slice; +} + + +declare module "lodash/sortBy" { + const sortBy: typeof _.sortBy; + export = sortBy; +} + + +declare module "lodash/sortedUniq" { + const sortedUniq: typeof _.sortedUniq; + export = sortedUniq; +} + + +declare module "lodash/sortedUniqBy" { + const sortedUniqBy: typeof _.sortedUniqBy; + export = sortedUniqBy; +} + + +declare module "lodash/split" { + const split: typeof _.split; + export = split; +} + + +declare module "lodash/spread" { + const spread: typeof _.spread; + export = spread; +} + + +declare module "lodash/tail" { + const tail: typeof _.tail; + export = tail; +} + + +declare module "lodash/take" { + const take: typeof _.take; + export = take; +} + + +declare module "lodash/takeRight" { + const takeRight: typeof _.takeRight; + export = takeRight; +} + + +declare module "lodash/takeRightWhile" { + const takeRightWhile: typeof _.takeRightWhile; + export = takeRightWhile; +} + + +declare module "lodash/takeWhile" { + const takeWhile: typeof _.takeWhile; + export = takeWhile; +} + + +declare module "lodash/tap" { + const tap: typeof _.tap; + export = tap; +} + + +declare module "lodash/throttle" { + const throttle: typeof _.throttle; + export = throttle; +} + + +declare module "lodash/thru" { + const thru: typeof _.thru; + export = thru; +} + + +declare module "lodash/toArray" { + const toArray: typeof _.toArray; + export = toArray; +} + + +declare module "lodash/toPairs" { + const toPairs: typeof _.toPairs; + export = toPairs; +} + + +declare module "lodash/toPairsIn" { + const toPairsIn: typeof _.toPairsIn; + export = toPairsIn; +} + + +declare module "lodash/toPath" { + const toPath: typeof _.toPath; + export = toPath; +} + + +declare module "lodash/toPlainObject" { + const toPlainObject: typeof _.toPlainObject; + export = toPlainObject; +} + + +declare module "lodash/transform" { + const transform: typeof _.transform; + export = transform; +} + + +declare module "lodash/unary" { + const unary: typeof _.unary; + export = unary; +} + + +declare module "lodash/union" { + const union: typeof _.union; + export = union; +} + + +declare module "lodash/unionBy" { + const unionBy: typeof _.unionBy; + export = unionBy; +} + + +declare module "lodash/unionWith" { + const unionWith: typeof _.unionWith; + export = unionWith; +} + + +declare module "lodash/uniq" { + const uniq: typeof _.uniq; + export = uniq; +} + + +declare module "lodash/uniqBy" { + const uniqBy: typeof _.uniqBy; + export = uniqBy; +} + + +declare module "lodash/uniqWith" { + const uniqWith: typeof _.uniqWith; + export = uniqWith; +} + + +declare module "lodash/unset" { + const unset: typeof _.unset; + export = unset; +} + + +declare module "lodash/unzip" { + const unzip: typeof _.unzip; + export = unzip; +} + + +declare module "lodash/unzipWith" { + const unzipWith: typeof _.unzipWith; + export = unzipWith; +} + + +declare module "lodash/update" { + const update: typeof _.update; + export = update; +} + +/** +* uncoment it if definition exists +*/ +/* +declare module "lodash/updateWith" { + const updateWith: typeof _.updateWith; + export = updateWith; +} +*/ + +declare module "lodash/values" { + const values: typeof _.values; + export = values; +} + + +declare module "lodash/valuesIn" { + const valuesIn: typeof _.valuesIn; + export = valuesIn; +} + + +declare module "lodash/without" { + const without: typeof _.without; + export = without; +} + + +declare module "lodash/words" { + const words: typeof _.words; + export = words; +} + + +declare module "lodash/wrap" { + const wrap: typeof _.wrap; + export = wrap; +} + + +declare module "lodash/xor" { + const xor: typeof _.xor; + export = xor; +} + + +declare module "lodash/xorBy" { + const xorBy: typeof _.xorBy; + export = xorBy; +} + + +declare module "lodash/xorWith" { + const xorWith: typeof _.xorWith; + export = xorWith; +} + + +declare module "lodash/zip" { + const zip: typeof _.zip; + export = zip; +} + + +declare module "lodash/zipObject" { + const zipObject: typeof _.zipObject; + export = zipObject; +} + +/** +* uncoment it if definition exists +*/ +/* +declare module "lodash/zipObjectDeep" { + const zipObjectDeep: typeof _.zipObjectDeep; + export = zipObjectDeep; +} +*/ + + +declare module "lodash/zipWith" { + const zipWith: typeof _.zipWith; + export = zipWith; +} + +/** +* uncoment it if definition exists +*/ +/* +declare module "lodash/entries" { + const entries: typeof _.entries; + export = entries; +} +*/ +/** +* uncoment it if definition exists +*/ +/* +declare module "lodash/entriesIn" { + const entriesIn: typeof _.entriesIn; + export = entriesIn; +} +*/ + + +declare module "lodash/extend" { + const extend: typeof _.extend; + export = extend; +} + + +declare module "lodash/extendWith" { + const extendWith: typeof _.extendWith; + export = extendWith; +} + + +declare module "lodash/add" { + const add: typeof _.add; + export = add; +} + + +declare module "lodash/attempt" { + const attempt: typeof _.attempt; + export = attempt; +} + + +declare module "lodash/camelCase" { + const camelCase: typeof _.camelCase; + export = camelCase; +} + + +declare module "lodash/capitalize" { + const capitalize: typeof _.capitalize; + export = capitalize; +} + + +declare module "lodash/ceil" { + const ceil: typeof _.ceil; + export = ceil; +} + + +declare module "lodash/clamp" { + const clamp: typeof _.clamp; + export = clamp; +} + + +declare module "lodash/clone" { + const clone: typeof _.clone; + export = clone; +} + + +declare module "lodash/cloneDeep" { + const cloneDeep: typeof _.cloneDeep; + export = cloneDeep; +} + + +declare module "lodash/cloneDeepWith" { + const cloneDeepWith: typeof _.cloneDeepWith; + export = cloneDeepWith; +} + + +declare module "lodash/cloneWith" { + const cloneWith: typeof _.cloneWith; + export = cloneWith; +} + + +declare module "lodash/deburr" { + const deburr: typeof _.deburr; + export = deburr; +} + +/** +* uncoment it if definition exists +*/ +/* +declare module "lodash/divide" { + const divide: typeof _.divide; + export = divide; +} +*/ + +declare module "lodash/endsWith" { + const endsWith: typeof _.endsWith; + export = endsWith; +} + + +declare module "lodash/eq" { + const eq: typeof _.eq; + export = eq; +} + + +declare module "lodash/escape" { + const escape: typeof _.escape; + export = escape; +} + + +declare module "lodash/escapeRegExp" { + const escapeRegExp: typeof _.escapeRegExp; + export = escapeRegExp; +} + + +declare module "lodash/every" { + const every: typeof _.every; + export = every; +} + + +declare module "lodash/find" { + const find: typeof _.find; + export = find; +} + + +declare module "lodash/findIndex" { + const findIndex: typeof _.findIndex; + export = findIndex; +} + + +declare module "lodash/findKey" { + const findKey: typeof _.findKey; + export = findKey; +} + + +declare module "lodash/findLast" { + const findLast: typeof _.findLast; + export = findLast; +} + + +declare module "lodash/findLastIndex" { + const findLastIndex: typeof _.findLastIndex; + export = findLastIndex; +} + + +declare module "lodash/findLastKey" { + const findLastKey: typeof _.findLastKey; + export = findLastKey; +} + + +declare module "lodash/floor" { + const floor: typeof _.floor; + export = floor; +} + + +declare module "lodash/forEach" { + const forEach: typeof _.forEach; + export = forEach; +} + + +declare module "lodash/forEachRight" { + const forEachRight: typeof _.forEachRight; + export = forEachRight; +} + + +declare module "lodash/forIn" { + const forIn: typeof _.forIn; + export = forIn; +} + + +declare module "lodash/forInRight" { + const forInRight: typeof _.forInRight; + export = forInRight; +} + + +declare module "lodash/forOwn" { + const forOwn: typeof _.forOwn; + export = forOwn; +} + + +declare module "lodash/forOwnRight" { + const forOwnRight: typeof _.forOwnRight; + export = forOwnRight; +} + + +declare module "lodash/get" { + const get: typeof _.get; + export = get; +} + + +declare module "lodash/gt" { + const gt: typeof _.gt; + export = gt; +} + + +declare module "lodash/gte" { + const gte: typeof _.gte; + export = gte; +} + + +declare module "lodash/has" { + const has: typeof _.has; + export = has; +} + + +declare module "lodash/hasIn" { + const hasIn: typeof _.hasIn; + export = hasIn; +} + + +declare module "lodash/head" { + const head: typeof _.head; + export = head; +} + + +declare module "lodash/identity" { + const identity: typeof _.identity; + export = identity; +} + + +declare module "lodash/includes" { + const includes: typeof _.includes; + export = includes; +} + + +declare module "lodash/indexOf" { + const indexOf: typeof _.indexOf; + export = indexOf; +} + + +declare module "lodash/inRange" { + const inRange: typeof _.inRange; + export = inRange; +} + + +declare module "lodash/invoke" { + const invoke: typeof _.invoke; + export = invoke; +} + + +declare module "lodash/isArguments" { + const isArguments: typeof _.isArguments; + export = isArguments; +} + + +declare module "lodash/isArray" { + const isArray: typeof _.isArray; + export = isArray; +} + + +declare module "lodash/isArrayBuffer" { + const isArrayBuffer: typeof _.isArrayBuffer; + export = isArrayBuffer; +} + + +declare module "lodash/isArrayLike" { + const isArrayLike: typeof _.isArrayLike; + export = isArrayLike; +} + + +declare module "lodash/isArrayLikeObject" { + const isArrayLikeObject: typeof _.isArrayLikeObject; + export = isArrayLikeObject; +} + + +declare module "lodash/isBoolean" { + const isBoolean: typeof _.isBoolean; + export = isBoolean; +} + + +declare module "lodash/isBuffer" { + const isBuffer: typeof _.isBuffer; + export = isBuffer; +} + + +declare module "lodash/isDate" { + const isDate: typeof _.isDate; + export = isDate; +} + + +declare module "lodash/isElement" { + const isElement: typeof _.isElement; + export = isElement; +} + + +declare module "lodash/isEmpty" { + const isEmpty: typeof _.isEmpty; + export = isEmpty; +} + + +declare module "lodash/isEqual" { + const isEqual: typeof _.isEqual; + export = isEqual; +} + + +declare module "lodash/isEqualWith" { + const isEqualWith: typeof _.isEqualWith; + export = isEqualWith; +} + + +declare module "lodash/isError" { + const isError: typeof _.isError; + export = isError; +} + + +declare module "lodash/isFinite" { + const isFinite: typeof _.isFinite; + export = isFinite; +} + + +declare module "lodash/isFunction" { + const isFunction: typeof _.isFunction; + export = isFunction; +} + + +declare module "lodash/isInteger" { + const isInteger: typeof _.isInteger; + export = isInteger; +} + + +declare module "lodash/isLength" { + const isLength: typeof _.isLength; + export = isLength; +} + + +declare module "lodash/isMap" { + const isMap: typeof _.isMap; + export = isMap; +} + + +declare module "lodash/isMatch" { + const isMatch: typeof _.isMatch; + export = isMatch; +} + + +declare module "lodash/isMatchWith" { + const isMatchWith: typeof _.isMatchWith; + export = isMatchWith; +} + + +declare module "lodash/isNaN" { + const isNaN: typeof _.isNaN; + export = isNaN; +} + + +declare module "lodash/isNative" { + const isNative: typeof _.isNative; + export = isNative; +} + + +declare module "lodash/isNil" { + const isNil: typeof _.isNil; + export = isNil; +} + + +declare module "lodash/isNull" { + const isNull: typeof _.isNull; + export = isNull; +} + + +declare module "lodash/isNumber" { + const isNumber: typeof _.isNumber; + export = isNumber; +} + + +declare module "lodash/isObject" { + const isObject: typeof _.isObject; + export = isObject; +} + + +declare module "lodash/isObjectLike" { + const isObjectLike: typeof _.isObjectLike; + export = isObjectLike; +} + + +declare module "lodash/isPlainObject" { + const isPlainObject: typeof _.isPlainObject; + export = isPlainObject; +} + + +declare module "lodash/isRegExp" { + const isRegExp: typeof _.isRegExp; + export = isRegExp; +} + + +declare module "lodash/isSafeInteger" { + const isSafeInteger: typeof _.isSafeInteger; + export = isSafeInteger; +} + + +declare module "lodash/isSet" { + const isSet: typeof _.isSet; + export = isSet; +} + + +declare module "lodash/isString" { + const isString: typeof _.isString; + export = isString; +} + + +declare module "lodash/isSymbol" { + const isSymbol: typeof _.isSymbol; + export = isSymbol; +} + + +declare module "lodash/isTypedArray" { + const isTypedArray: typeof _.isTypedArray; + export = isTypedArray; +} + + +declare module "lodash/isUndefined" { + const isUndefined: typeof _.isUndefined; + export = isUndefined; +} + + +declare module "lodash/isWeakMap" { + const isWeakMap: typeof _.isWeakMap; + export = isWeakMap; +} + + +declare module "lodash/isWeakSet" { + const isWeakSet: typeof _.isWeakSet; + export = isWeakSet; +} + + +declare module "lodash/join" { + const join: typeof _.join; + export = join; +} + + +declare module "lodash/kebabCase" { + const kebabCase: typeof _.kebabCase; + export = kebabCase; +} + + +declare module "lodash/last" { + const last: typeof _.last; + export = last; +} + + +declare module "lodash/lastIndexOf" { + const lastIndexOf: typeof _.lastIndexOf; + export = lastIndexOf; +} + + +declare module "lodash/lowerCase" { + const lowerCase: typeof _.lowerCase; + export = lowerCase; +} + + +declare module "lodash/lowerFirst" { + const lowerFirst: typeof _.lowerFirst; + export = lowerFirst; +} + + +declare module "lodash/lt" { + const lt: typeof _.lt; + export = lt; +} + + +declare module "lodash/lte" { + const lte: typeof _.lte; + export = lte; +} + + +declare module "lodash/max" { + const max: typeof _.max; + export = max; +} + + +declare module "lodash/maxBy" { + const maxBy: typeof _.maxBy; + export = maxBy; +} + + +declare module "lodash/mean" { + const mean: typeof _.mean; + export = mean; +} + +/** +* uncoment it if definition exists +*/ +/* +declare module "lodash/meanBy" { + const meanBy: typeof _.meanBy; + export = meanBy; +} +*/ + +declare module "lodash/min" { + const min: typeof _.min; + export = min; +} + + +declare module "lodash/minBy" { + const minBy: typeof _.minBy; + export = minBy; +} + +/** +* uncoment it if definition exists +*/ +/* +declare module "lodash/multiply" { + const multiply: typeof _.multiply; + export = multiply; +} +*/ + +/** +* uncoment it if definition exists +*/ +/* +declare module "lodash/nth" { + const nth: typeof _.nth; + export = nth; +} +*/ + +declare module "lodash/noConflict" { + const noConflict: typeof _.noConflict; + export = noConflict; +} + + +declare module "lodash/noop" { + const noop: typeof _.noop; + export = noop; +} + + +declare module "lodash/now" { + const now: typeof _.now; + export = now; +} + + +declare module "lodash/pad" { + const pad: typeof _.pad; + export = pad; +} + + +declare module "lodash/padEnd" { + const padEnd: typeof _.padEnd; + export = padEnd; +} + + +declare module "lodash/padStart" { + const padStart: typeof _.padStart; + export = padStart; +} + + +declare module "lodash/parseInt" { + const parseInt: typeof _.parseInt; + export = parseInt; +} + + +declare module "lodash/random" { + const random: typeof _.random; + export = random; +} + + +declare module "lodash/reduce" { + const reduce: typeof _.reduce; + export = reduce; +} + + +declare module "lodash/reduceRight" { + const reduceRight: typeof _.reduceRight; + export = reduceRight; +} + + +declare module "lodash/repeat" { + const repeat: typeof _.repeat; + export = repeat; +} + + +declare module "lodash/replace" { + const replace: typeof _.replace; + export = replace; +} + + +declare module "lodash/result" { + const result: typeof _.result; + export = result; +} + + +declare module "lodash/round" { + const round: typeof _.round; + export = round; +} + + +declare module "lodash/runInContext" { + const runInContext: typeof _.runInContext; + export = runInContext; +} + + +declare module "lodash/sample" { + const sample: typeof _.sample; + export = sample; +} + + +declare module "lodash/size" { + const size: typeof _.size; + export = size; +} + + +declare module "lodash/snakeCase" { + const snakeCase: typeof _.snakeCase; + export = snakeCase; +} + + +declare module "lodash/some" { + const some: typeof _.some; + export = some; +} + + +declare module "lodash/sortedIndex" { + const sortedIndex: typeof _.sortedIndex; + export = sortedIndex; +} + + +declare module "lodash/sortedIndexBy" { + const sortedIndexBy: typeof _.sortedIndexBy; + export = sortedIndexBy; +} + + +declare module "lodash/sortedIndexOf" { + const sortedIndexOf: typeof _.sortedIndexOf; + export = sortedIndexOf; +} + + +declare module "lodash/sortedLastIndex" { + const sortedLastIndex: typeof _.sortedLastIndex; + export = sortedLastIndex; +} + + +declare module "lodash/sortedLastIndexBy" { + const sortedLastIndexBy: typeof _.sortedLastIndexBy; + export = sortedLastIndexBy; +} + + +declare module "lodash/sortedLastIndexOf" { + const sortedLastIndexOf: typeof _.sortedLastIndexOf; + export = sortedLastIndexOf; +} + + +declare module "lodash/startCase" { + const startCase: typeof _.startCase; + export = startCase; +} + + +declare module "lodash/startsWith" { + const startsWith: typeof _.startsWith; + export = startsWith; +} + + +declare module "lodash/subtract" { + const subtract: typeof _.subtract; + export = subtract; +} + + +declare module "lodash/sum" { + const sum: typeof _.sum; + export = sum; +} + + +declare module "lodash/sumBy" { + const sumBy: typeof _.sumBy; + export = sumBy; +} + + +declare module "lodash/template" { + const template: typeof _.template; + export = template; +} + + +declare module "lodash/times" { + const times: typeof _.times; + export = times; +} + + +declare module "lodash/toInteger" { + const toInteger: typeof _.toInteger; + export = toInteger; +} + + +declare module "lodash/toLength" { + const toLength: typeof _.toLength; + export = toLength; +} + + +declare module "lodash/toLower" { + const toLower: typeof _.toLower; + export = toLower; +} + + +declare module "lodash/toNumber" { + const toNumber: typeof _.toNumber; + export = toNumber; +} + + +declare module "lodash/toSafeInteger" { + const toSafeInteger: typeof _.toSafeInteger; + export = toSafeInteger; +} + + +declare module "lodash/toString" { + const toString: typeof _.toString; + export = toString; +} + + +declare module "lodash/toUpper" { + const toUpper: typeof _.toUpper; + export = toUpper; +} + + +declare module "lodash/trim" { + const trim: typeof _.trim; + export = trim; +} + + +declare module "lodash/trimEnd" { + const trimEnd: typeof _.trimEnd; + export = trimEnd; +} + + +declare module "lodash/trimStart" { + const trimStart: typeof _.trimStart; + export = trimStart; +} + + +declare module "lodash/truncate" { + const truncate: typeof _.truncate; + export = truncate; +} + + +declare module "lodash/unescape" { + const unescape: typeof _.unescape; + export = unescape; +} + + +declare module "lodash/uniqueId" { + const uniqueId: typeof _.uniqueId; + export = uniqueId; +} + + +declare module "lodash/upperCase" { + const upperCase: typeof _.upperCase; + export = upperCase; +} + + +declare module "lodash/upperFirst" { + const upperFirst: typeof _.upperFirst; + export = upperFirst; +} + + +declare module "lodash/each" { + const each: typeof _.each; + export = each; +} + + +declare module "lodash/eachRight" { + const eachRight: typeof _.eachRight; + export = eachRight; +} + + +declare module "lodash/first" { + const first: typeof _.first; + export = first; +} + +declare module "lodash/fp" { + export = _; +} + declare module "lodash" { export = _; } diff --git a/log4javascript/log4javascript-tests.ts b/log4javascript/log4javascript-tests.ts index c3b77c5b69..b05626b297 100644 --- a/log4javascript/log4javascript-tests.ts +++ b/log4javascript/log4javascript-tests.ts @@ -2,7 +2,14 @@ function aSimpleLoggingMessageString() { var log = log4javascript.getDefaultLogger(); - log.info("Hello World"); + log.info("Hello World"); +} + +function compareLogLevelsAndLog() { + var log = log4javascript.getDefaultLogger(); + if (log4javascript.Level.INFO.isGreaterOrEqual(log.getLevel())) { + log.log(log4javascript.Level.INFO, ["Info"]); + } } function loggingAnErrorWithAMessage() { diff --git a/log4javascript/log4javascript.d.ts b/log4javascript/log4javascript.d.ts index 460e17c91f..55d7726563 100644 --- a/log4javascript/log4javascript.d.ts +++ b/log4javascript/log4javascript.d.ts @@ -1,4 +1,4 @@ -// Type definitions for log4javascript v1.4.10 +// Type definitions for log4javascript v1.4.13 // Project: http://log4javascript.org/ // Definitions by: Markus Wagner // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -89,7 +89,22 @@ declare namespace log4javascript { /** * Levels are available as static properties of the log4javascript.Level object. */ - export enum Level { ALL, TRACE, DEBUG, INFO, WARN, ERROR, FATAL, OFF } + export class Level { + static ALL: Level; + static TRACE: Level; + static DEBUG: Level; + static INFO: Level; + static WARN: Level; + static ERROR: Level; + static FATAL: Level; + static OFF: Level; + + constructor(level: number, name: string); + + toString(): string; + equals(level: Level): boolean; + isGreaterOrEqual(level: Level): boolean; + } // #endregion @@ -126,6 +141,11 @@ declare namespace log4javascript { */ removeAllAppenders(): void; + /** + * Returns all appenders which will log a message. + */ + getEffectiveAppenders(): Appender[]; + /** * Sets the level. Log messages of a lower level than level will not be logged. Default value is DEBUG. */ diff --git a/log4js/log4js-tests.ts b/log4js/log4js-tests.ts index 4fefc1caab..4e4f1ce4c6 100644 --- a/log4js/log4js-tests.ts +++ b/log4js/log4js-tests.ts @@ -72,3 +72,30 @@ log4js.configure({ }); log4js.configure('file.json', { reloadSecs: 300 }); + +class MyAppenderConfig implements log4js.CustomAppenderConfig { + public type: string; + public mycfg: string; +} + +var myAppender: log4js.AppenderModule = { + + appender: function (mycfg: string): log4js.Appender { + + return function (event: log4js.LogEvent): void { + console.log(mycfg); + console.log(event); + } + }, + + shutdown: function (cb: (error: Error) => void): void { + return cb(null); + }, + + configure: function (config: MyAppenderConfig, options?: { [key: string]: any }): log4js.Appender { + var mycfg = config.mycfg; + return this.appender(mycfg); + } +} + +log4js.loadAppender("my-log4js-appender", myAppender); \ No newline at end of file diff --git a/log4js/log4js.d.ts b/log4js/log4js.d.ts index c79fd60818..38af275833 100644 --- a/log4js/log4js.d.ts +++ b/log4js/log4js.d.ts @@ -57,6 +57,16 @@ declare module "log4js" { */ export function addAppender(...appenders: any[]): void; + /** + * Load appender + * + * @param {string} appender type + * @param {AppenderModule} the appender module. by default, require('./appenders/' + appender) + * @returns {void} + * @static + */ + export function loadAppender(appenderType: string, appenderModule?: AppenderModule): void; + /** * Claer configured appenders * @@ -93,6 +103,26 @@ declare module "log4js" { export function connectLogger(logger: Logger, options: { format?: string; level?: string; nolog?: any; }): express.Handler; export function connectLogger(logger: Logger, options: { format?: string; level?: Level; nolog?: any; }): express.Handler; + export var layouts: { + basicLayout: Layout, + messagePassThroughLayout: Layout, + patternLayout: Layout, + colouredLayout: Layout, + coloredLayout: Layout, + dummyLayout: Layout, + + /** + * Register your custom layout generator + */ + addLayout: (name: string, serializerGenerator: (config?: LayoutConfig) => Layout) => void, + + /** + * Get layout. Available predified layout names: + * messagePassThrough, basic, colored, coloured, pattern, dummy + * + */ + layout: (name: string, config: LayoutConfig) => Layout + } export var appenders: any; export var levels: { @@ -147,6 +177,7 @@ declare module "log4js" { export interface AppenderConfigBase { type: string; category?: string; + layout?: { type: string;[key: string]: any } } export interface ConsoleAppenderConfig extends AppenderConfigBase {} @@ -252,4 +283,36 @@ declare module "log4js" { } type AppenderConfig = CoreAppenderConfig | CustomAppenderConfig; + + export interface LogEvent { + /** + * new Date() + */ + startTime: number; + categoryName: string; + data: any[]; + level: Level; + logger: Logger; + } + + export interface Appender { + (event: LogEvent): void; + } + + export interface AppenderModule { + appender: (...args: any[]) => Appender; + shutdown?: (cb: (error: Error) => void) => void; + configure: (config: CustomAppenderConfig, options?: { [key: string]: any }) => Appender; + } + + export interface LayoutConfig { + [key: string]: any; + } + export interface LayoutGenerator { + (config?: LayoutConfig): Layout + } + + export interface Layout { + (event: LogEvent): string; + } } diff --git a/long/long.d.ts b/long/long.d.ts index 514eb5677a..1ef1052651 100644 --- a/long/long.d.ts +++ b/long/long.d.ts @@ -348,6 +348,5 @@ declare class Long } declare module 'long' { - namespace Long {} export = Long; } diff --git a/lovefield/lovefield.d.ts b/lovefield/lovefield.d.ts index 1b28dae739..c988b6b14c 100644 --- a/lovefield/lovefield.d.ts +++ b/lovefield/lovefield.d.ts @@ -188,7 +188,7 @@ declare namespace lf { local: string ref: string action: lf.ConstraintAction - timing: lf.ConstraintAction + timing: lf.ConstraintTiming } export interface TableBuilder { diff --git a/lru-cache/lru-cache.d.ts b/lru-cache/lru-cache.d.ts index 25b9b8cf52..0f92df2f68 100644 --- a/lru-cache/lru-cache.d.ts +++ b/lru-cache/lru-cache.d.ts @@ -1,4 +1,4 @@ -// Type definitions for lru-cache v2.5.0 +// Type definitions for lru-cache v4.0.1 // Project: https://github.com/isaacs/node-lru-cache // Definitions by: Bart van der Schoor // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -12,20 +12,22 @@ declare module 'lru-cache' { max?: number; maxAge?: number; length?: (value: T) => number; - dispose?: (key: string, value: T) => void; + dispose?: (key: any, value: T) => void; stale?: boolean; } interface Cache { - set(key: string, value: T): void; - get(key: string): T; - peek(key: string): T; - has(key: string): boolean - del(key: string): void; + set(key: any, value: T, maxAge?: number): void; + get(key: any): T; + peek(key: any): T; + has(key: any): boolean + del(key: any): void; reset(): void; - forEach(iter: (value: T, key: string, cache: Cache) => void, thisp?: any): void; - - keys(): string[]; + prune(): void; + forEach(iter: (value: T, key: any, cache: Cache) => void, thisp?: any): void; + itemCount: number; + length: number + keys(): any[]; values(): T[]; } } diff --git a/mCustomScrollbar/mCustomScrollbar-tests.ts b/mCustomScrollbar/mCustomScrollbar-tests.ts index 7dcf793564..9c5f030679 100644 --- a/mCustomScrollbar/mCustomScrollbar-tests.ts +++ b/mCustomScrollbar/mCustomScrollbar-tests.ts @@ -9,7 +9,8 @@ class SimpleTest { this.element.mCustomScrollbar({ scrollButtons: { - enable: true + enable: true, + scrollAmount: 2 } }); } @@ -22,38 +23,78 @@ class SimpleTestAllParams { this.element = $(".content"); this.element.mCustomScrollbar({ - setWidth: false, - setHeight: false, + setWidth: 22, + setHeight: "40%", + setTop: 0, + setLeft: 22, axis: "y", + scrollbarPosition: "inside", scrollInertia: 950, - mouseWheel: true, - mouseWheelPixels: "auto", autoDraggerLength: true, autoHideScrollbar: false, + autoExpandScrollbar: false, + alwaysShowScrollbar: 0, + snapAmount: [3,3], + snapOffset: 3, + mouseWheel: { + enable: true, + scrollAmount: 1, + axis:"x", + preventDefault: false, + deltaFactor:12, + normalizeDelta:true, + invert: false, + disableOver: ["select","option"] + + }, scrollButtons: { enable: false, - scrollType: "continuous", - scrollSpeed: "auto", - scrollAmount: 40 + scrollType: "stepped", + scrollAmount: 40, + tabindex: 33, + }, + keyboard:{ + enable: true, + scrollAmount:5, + scrollType:"stepless" }, advanced: { updateOnBrowserResize: true, updateOnContentResize: false, + updateOnImageLoad: true, + updateOnSelectorChange: "ul li", + extraDraggableSelectors: ".myClass", + releaseDraggableSelectors: ".myClass", + autoUpdateTimeout:60, autoExpandHorizontalScroll: false, - autoScrollOnFocus: true, - normalizeMouseWheelDelta: false + autoScrollOnFocus: "input", }, contentTouchScroll: true, + documentTouchScroll: false, + callbacks: { + onCreate: () => { }, + onInit: () => { }, onScrollStart: () => { }, onScroll: () => { }, onTotalScroll: () => { }, onTotalScrollBack: () => { }, onTotalScrollOffset: 0, onTotalScrollBackOffset: 0, - whileScrolling: () => { } + whileScrolling: () => { }, + alwaysTriggerOffsets: false, + onOverflowY: () => { }, + onOverflowX: () => { }, + onOverflowYNone: () => {}, + onOverflowXNone: () => {}, + onBeforeUpdate: () => {}, + onUpdate: () => {}, + onImageLoad: () => {}, + onSelectorChange: () => {}, }, - theme: "light" + theme: "light", + live: true, + liveSelector: ".myClass" }); } } diff --git a/mCustomScrollbar/mCustomScrollbar.d.ts b/mCustomScrollbar/mCustomScrollbar.d.ts index 4aad109c66..aa088d6f5c 100644 --- a/mCustomScrollbar/mCustomScrollbar.d.ts +++ b/mCustomScrollbar/mCustomScrollbar.d.ts @@ -10,16 +10,35 @@ declare namespace MCustomScrollbar { /** * Set the width of your content (overwrites CSS width), value in pixels (integer) or percentage (string) */ - setWidth?: any; + setWidth?: boolean|number|string; /** * Set the height of your content (overwirtes CSS height), value in pixels (integer) or percentage (string) */ - setHeight?: any; + setHeight?: boolean|number|string; + /** + * Set the initial css top property of content, accepts string values (css top position). + * Example: setTop: "-100px". + */ + setTop? : number|string; + /** + * Set the initial css top property of content, accepts string values (css top position). + * Example: setTop: "-100px". + */ + setLeft? : number|string; /** * Define content’s scrolling axis (the type of scrollbars added to the element: vertical and/of horizontal). - * Available values: "y", "x", "yx". y -vertical, x - horizontal + * Available values: "y", "x", "yx". y -vertical, x - horizontal, yx - vertical and horizontal */ - axis?: string; + axis?: "x"|"y"|"yx"; + /** + * Set the position of scrollbar in relation to content. + * Available values: "inside", "outside". + * Setting scrollbarPosition: "inside" (default) makes scrollbar appear inside the element. + * Setting scrollbarPosition: "outside" makes scrollbar appear outside the element. + * Note that setting the value to "outside" requires your element (or parent elements) + * to have CSS position: relative (otherwise the scrollbar will be positioned in relation to document’s root element). + */ + scrollbarPosition?: "inside"|"outside"; /** * Always keep scrollbar(s) visible, even when there’s nothing to scroll. * 0 – disable (default) @@ -28,6 +47,18 @@ declare namespace MCustomScrollbar { */ alwaysShowScrollbar?: number; /** + * Make scrolling snap to a multiple of a fixed number of pixels. Useful in cases like scrolling tabular data, + * image thumbnails or slides and you need to prevent scrolling from stopping half-way your elements. + * Note that your elements must be of equal width or height in order for this to work properly. + * To set different values for vertical and horizontal scrolling, use an array: [y,x] + */ + snapAmount?: number|[number,number]; + /** + * Set an offset (in pixels) for the snapAmount option. Useful when for example you need to offset the + * snap amount of table rows by the table header. + */ + snapOffset?: number; + /** * Enable or disable auto-expanding the scrollbar when cursor is over or dragging the scrollbar. */ autoExpandScrollbar?: boolean; @@ -36,9 +67,68 @@ declare namespace MCustomScrollbar { */ scrollInertia?: number; /** - * Mouse wheel support, value: true, false + * Mouse wheel support */ - mouseWheel?: boolean; + mouseWheel?: { + /** + * Enable or disable content scrolling via mouse-wheel. + */ + enable?: boolean; + /** + * Set the mouse-wheel scrolling amount (in pixels). + * The default value "auto" adjusts scrolling amount according to scrollable content length. + */ + scrollAmount?: "auto"|number; + /** + * Define the mouse-wheel scrolling axis when both vertical and horizontal scrollbars are present. + * Set axis: "y" (default) for vertical or axis: "x" for horizontal scrolling. + */ + axis?: "x"|"y"; + /** + * Prevent the default behaviour which automatically scrolls the parent element when end + * or beginning of scrolling is reached (same bahavior with browser’s native scrollbar). + */ + preventDefault?: boolean; + /** + * Set the number of pixels one wheel notch scrolls. The default value “auto” uses the OS/browser value. + */ + deltaFactor?: number; + /** + * Enable or disable mouse-wheel (delta) acceleration. + * Setting normalizeDelta: true translates mouse-wheel delta value to -1 or 1. + */ + normalizeDelta?:boolean; + /** + * Invert mouse-wheel scrolling direction. + * Set to true to scroll down or right when mouse-wheel is turned upwards. + */ + invert?: boolean; + /** + * Set the tags that disable mouse-wheel when cursor is over them. + * Default value: ["select","option","keygen","datalist","textarea"] + */ + disableOver?: string[]; + } + /** + * Keyboard support + */ + keyboard?:{ + /** + * Enable or disable content scrolling via keyboard. + */ + enable?: boolean; + /** + * Set the keyboard arrows scrolling amount (in pixels). + * The default value "auto" adjusts scrolling amount according to scrollable content length. + */ + scrollAmount?: "auto"|number; + /** + * Define the buttons scrolling type/behavior. + * scrollType: "stepless" – continuously scroll content while pressing the button (default) + * scrollType: "stepped" – each button click scrolls content by a certain amount (defined in scrollAmount option above) + */ + scrollType?: "stepless"|"stepped"; + } /** * Mouse wheel scrolling pixels amount, value in pixels (integer) or "auto" (script calculates and sets pixels amount according to content length) */ @@ -57,19 +147,21 @@ declare namespace MCustomScrollbar { */ enable?: boolean; /** - * Scroll buttons scroll type, values: "continuous" (scroll continuously while pressing the button), "pixels" (scrolls by a fixed number of pixels on each click") + * Define the buttons scrolling type/behavior. + * scrollType: "stepless" – continuously scroll content while pressing the button (default) + * scrollType: "stepped" – each button click scrolls content by a certain amount (defined in scrollAmount option above) */ - scrollType?: string; + scrollType?: "stepless"|"stepped"; /** - * Scroll buttons continuous scrolling speed, integer value or "auto" (script calculates and sets the speed according to content length) + * Set a tabindex value for the buttons. */ - scrollSpeed?: number | string; + tabindex?: number; /** * Scroll buttons pixels scrolling amount, value in pixels or "auto" */ - scrollAmount?: number | string; + scrollAmount?: "auto"|number ; } - advanced?: { + advanced?: { /** * Update scrollbars on browser resize (for fluid content blocks and layouts based on percentages), values: true, false. Set to false only when you content has fixed dimensions */ @@ -80,27 +172,75 @@ declare namespace MCustomScrollbar { */ updateOnContentResize?: boolean; /** + * Update scrollbar(s) automatically each time an image inside the element is fully loaded. + * Default value is auto which triggers the function only on "x" and "yx" axis (if needed). + * The value should be true when your content contains images and you need the function to trigger on any axis. + */ + updateOnImageLoad?: "auto"|boolean; + /** + * Add extra selector(s) that’ll release scrollbar dragging upon mouseup, pointerup, touchend etc. + * Example: extraDraggableSelectors: ".myClass, #myID" + */ + extraDraggableSelectors?: string; + /** + * Add extra selector(s) that’ll allow scrollbar dragging upon mousemove/up, pointermove/up, touchend etc. + * Example: releaseDraggableSelectors: ".myClass, #myID" + */ + releaseDraggableSelectors?: string; + /** + * Set the auto-update timeout in milliseconds. + * Default timeout: 60 + */ + autoUpdateTimeout?: number; + /** + * Update scrollbar(s) automatically when the amount and size of specific selectors changes. + * Useful when you need to update the scrollbar(s) automatically, each time a type of element is added, removed or changes its size. + * For example, setting updateOnSelectorChange: "ul li" will update scrollbars each time list-items inside the element are changed. + * Setting the value to true, will update scrollbars each time any element is changed. + * To disable (default) set to false. + */ + updateOnSelectorChange?: string|boolean; + /** * Auto-expanding content's width on horizontal scrollbars, values: true, false. Set to true if you have horizontal scrollbr on content that change on-the-fly. Demo contains * blocks with images and horizontal scrollbars that use this option parameter */ autoExpandHorizontalScroll?: boolean; /** - * Auto-scrolling on elements that have focus (e.g. scrollbar automatically scrolls to form text fields when the TAB key is pressed), values: true, false + * Set the list of elements/selectors that will auto-scroll content to their position when focused. + * For example, when pressing TAB key to focus input fields, if the field is out of the viewable area the content + * will scroll to its top/left position (same bahavior with browser’s native scrollbar). + * To completely disable this functionality, set autoScrollOnFocus: false. + * Default: + * "input,textarea,select,button,datalist,keygen,a[tabindex],area,object,[contenteditable='true']" */ - autoScrollOnFocus?: boolean; + autoScrollOnFocus?: boolean|string; /** * Normalize mouse wheel delta (-1/1), values: true, false */ normalizeMouseWheelDelta?: boolean; } - /** - * Additional scrolling method by touch-swipe content (for touch enabled devices), value: true, false - */ - contentTouchScroll?: boolean; + /** + * Enable or disable content touch-swipe scrolling for touch-enabled devices. + * To completely disable, set contentTouchScroll: false. + * Integer values define the axis-specific minimum amount required for scrolling momentum (default: 25). + */ + contentTouchScroll?: boolean|number; + /** + * Enable or disable document touch-swipe scrolling for touch-enabled devices. + */ + documentTouchScroll?: boolean; /** * All of the following callbacks option have examples in the callback demo - http://manos.malihu.gr/tuts/custom-scrollbar-plugin/callbacks_example.html */ callbacks?: { + /** + * A function to call when plugin markup is created. + */ + onCreate?: () => void; + /** + * A function to call when scrollbars have initialized + */ + onInit?: () => void; /** * User defined callback function, triggered on scroll start event. You can call your own function(s) each time a scroll event begins */ @@ -137,11 +277,56 @@ declare namespace MCustomScrollbar { * Set alwaysTriggerOffsets: false when you need to trigger onTotalScroll and onTotalScrollBack callbacks once, each time scroll end or beginning is reached. */ alwaysTriggerOffsets?: boolean; + /** + * A function to call when content becomes long enough and vertical scrollbar is added. + */ + onOverflowY?: () => void; + /** + * A function to call when content becomes wide enough and horizontal scrollbar is added. + */ + onOverflowX?: () => void; + /** + * A function to call when content becomes short enough and vertical scrollbar is removed. + */ + onOverflowYNone?: () => void; + /** + * A function to call when content becomes narrow enough and horizontal scrollbar is removed. + */ + onOverflowXNone?: () => void; + /** + * A function to call right before scrollbar(s) are updated. + */ + onBeforeUpdate?: () => void; + /** + * A function to call when scrollbar(s) are updated. + */ + onUpdate?: () => void; + /** + * A function to call each time an image inside the element is fully loaded and scrollbar(s) are updated. + */ + onImageLoad?: () => void; + /** + * A function to call each time a type of element is added, removed or changes its size and scrollbar(s) are updated. + */ + onSelectorChange?: () => void; } - /** - * Set a scrollbar ready-to-use theme. See themes demo for all themes - http://manos.malihu.gr/tuts/custom-scrollbar-plugin/scrollbar_themes_demo.html - */ - theme?: string; + /** + * Set a scrollbar ready-to-use theme. See themes demo for all themes - http://manos.malihu.gr/tuts/custom-scrollbar-plugin/scrollbar_themes_demo.html + */ + theme?: string; + /** + * Enable or disable applying scrollbar(s) on all elements matching the current selector, now and in the future. + * Set live: true when you need to add scrollbar(s) on elements that do not yet exist in the page. + * These could be elements added by other scripts or plugins after some action by the user takes place (e.g. lightbox markup may not exist untill the user clicks a link). + * If you need at any time to disable or enable the live option, set live: "off" and "on" respectively. + * You can also tell the script to disable live option after the first invocation by setting live: "once". + */ + live?: string|boolean; + /** + * Set the matching set of elements (instead of the current selector) to add scrollbar(s), now and in the future. + */ + liveSelector?: string; + } interface ScrollToParameterOptions { diff --git a/mailparser/mailparser-tests.ts b/mailparser/mailparser-tests.ts index b7df9adb44..d52c011fe1 100644 --- a/mailparser/mailparser-tests.ts +++ b/mailparser/mailparser-tests.ts @@ -3,7 +3,7 @@ import mailparser_mod = require("mailparser"); import MailParser = mailparser_mod.MailParser; import ParsedMail = mailparser_mod.ParsedMail; - +import Attachment = mailparser_mod.Attachment; var mailparser = new MailParser(); @@ -61,7 +61,7 @@ var mp = new MailParser({ streamAttachments: true }) -mp.on("attachment", function(attachment, mail){ +mp.on("attachment", function(attachment : Attachment, mail : ParsedMail){ var output = fs.createWriteStream(attachment.generatedFileName); attachment.stream.pipe(output); }); diff --git a/mailparser/mailparser.d.ts b/mailparser/mailparser.d.ts index 94e99308d9..bc50dcc509 100644 --- a/mailparser/mailparser.d.ts +++ b/mailparser/mailparser.d.ts @@ -8,6 +8,8 @@ declare module 'mailparser' { + import StreamModule = require("stream"); + import Stream = StreamModule.Stream; import WritableStream = NodeJS.WritableStream; import EventEmitter = NodeJS.EventEmitter; @@ -36,6 +38,7 @@ declare module 'mailparser' { generatedFileName: string; // e.g. 'image.png' checksum: string; // the md5 hash of the file, e.g. 'e4cef4c6e26037bcf8166905207ea09b' content: Buffer; // possibly a SlowBuffer + stream: Stream; // a stream to read the attachment if streamAttachments is set to true } // emitted with the 'end' event diff --git a/mainloop.js/mainloop.js-tests.ts b/mainloop.js/mainloop.js-tests.ts new file mode 100644 index 0000000000..86a4db6240 --- /dev/null +++ b/mainloop.js/mainloop.js-tests.ts @@ -0,0 +1,95 @@ +/// + +// To see what this test does, create an HTML file with these contents and open it: +/* + + + + + + + MainLoop.js test + + + + + + + + + + +*/ + +window.addEventListener('load', () => { + + let cx = window.innerWidth / 2 - 15, + cy = window.innerHeight / 2 - 15, + x = cx + 120, + y = cy, + lx = x, + ly = y, + theta = 0 + const radius = 120, + velocity = 0.1 * Math.PI / 180; + + const actor = document.createElement('div'); + actor.style.width = '30px'; + actor.style.height = '30px'; + actor.style.backgroundColor = 'red'; + actor.style.position = 'absolute'; + actor.style.left = x + 'px'; + actor.style.top = y + 'px'; + + document.body.appendChild(actor); + + const fpsCounter = document.createElement('div'); + fpsCounter.style.position = 'absolute'; + fpsCounter.style.left = '10px'; + fpsCounter.style.top = '10px'; + + document.body.appendChild(fpsCounter); + + document.body.addEventListener('click', (event) => { + cx = event.pageX; + cy = event.pageY; + }); + + MainLoop + .setBegin((timestamp, delta) => { + lx = x; + ly = y; + x = cx + Math.cos(theta) * radius; + y = cy + Math.sin(theta) * radius; + }) + .setDraw((interpolationPercentage) => { + actor.style.left = (lx + (x - lx) * interpolationPercentage) + 'px'; + actor.style.top = (ly + (y - ly) * interpolationPercentage) + 'px'; + }) + .setUpdate((delta) => { + theta += velocity * delta; + }) + .setEnd((fps, panic) => { + fpsCounter.textContent = Math.round(fps) + ' FPS'; + if (panic) { + console.info( + `Main loop panicked; tried to simulate too much time. Discarding ${MainLoop.resetFrameDelta()}ms` + ); + } + }) + .start(); + + document.body.addEventListener('keyup', (event) => { + if ((event.which || event.keyCode) === 80) { // Hit P to toggle Pause + if (MainLoop.isRunning()) { + MainLoop.stop(); + } + else { + MainLoop.start(); + } + } + }); + +}); diff --git a/mainloop.js/mainloop.js.d.ts b/mainloop.js/mainloop.js.d.ts new file mode 100644 index 0000000000..f34d6f035a --- /dev/null +++ b/mainloop.js/mainloop.js.d.ts @@ -0,0 +1,28 @@ +// Type definitions for MainLoop.js v1.0.3 +// Project: https://github.com/IceCreamYou/MainLoop.js +// Definitions by: Isaac Sukin +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * Interface for the MainLoop.js global. + * + * See the API documentation for a detailed explanation of these methods: + * http://icecreamyou.github.com/MainLoop.js/docs/#!/api/MainLoop + */ +interface MainLoop { + getFPS(): number; + getMaxAllowedFPS(): number; + getSimulationTimestep(): number; + isRunning(): boolean; + resetFrameDelta(): number; + setBegin(begin: (timestamp: number, delta: number) => void): MainLoop; + setDraw(draw: (interpolationPercentage: number) => void): MainLoop; + setUpdate(update: (delta: number) => void): MainLoop; + setEnd(end: (fps: number, panic: boolean) => void): MainLoop; + setMaxAllowedFPS(fps?: number): MainLoop; + setSimulationTimestep(timestep: number): MainLoop; + start(): MainLoop; + stop(): MainLoop; +} + +declare var MainLoop: MainLoop; diff --git a/maker.js/makerjs-tests.ts b/maker.js/makerjs-tests.ts index e314f09669..8b75fecc8c 100644 --- a/maker.js/makerjs-tests.ts +++ b/maker.js/makerjs-tests.ts @@ -12,24 +12,30 @@ function test() { function testRoot() { makerjs.cloneObject({}); + makerjs.createRouteKey([]); makerjs.extendObject({abc:123}, {xyz:789}); + makerjs.isFunction(function(){}); + makerjs.isNumber(0); + makerjs.isObject({}); makerjs.isModel({}); makerjs.isPath({}); makerjs.isPathArc(paths.arc); + makerjs.isPathArcInBezierCurve({}); makerjs.isPathCircle(paths.circle); makerjs.isPathLine(paths.line); makerjs.isPoint([]); makerjs.pathType.Circle; makerjs.round(44.44444, .01); makerjs.unitType.Millimeter; + new makerjs.Collector(); } function testAngle() { - makerjs.angle.areEqual(12, 13); makerjs.angle.mirror(45, true, false); makerjs.angle.noRevolutions(90); makerjs.angle.ofArcEnd(paths.arc); makerjs.angle.ofArcMiddle(paths.arc); + makerjs.angle.ofArcSpan(paths.arc); makerjs.angle.ofLineInDegrees(paths.line); makerjs.angle.ofPointInDegrees([0,0], [1,1]); makerjs.angle.ofPointInRadians([0,0], [1,1]); @@ -41,6 +47,7 @@ function test() { new makerjs.exporter.Exporter({}); makerjs.exporter.toDXF(model); makerjs.exporter.toOpenJsCad(model); + makerjs.exporter.toPDF({} as PDFKit.PDFDocument, model); makerjs.exporter.toSTL(model); makerjs.exporter.toSVG(model, { @@ -58,6 +65,11 @@ function test() { makerjs.exporter.tryGetModelUnits(model); } + function testImporter() { + makerjs.importer.fromSVGPathData(''); + makerjs.importer.parseNumericList(''); + } + function testKit() { makerjs.kit.construct(null, null); makerjs.kit.getParameterValues(null); @@ -67,24 +79,42 @@ function test() { } function testMeasure() { - makerjs.measure.arcAngle(paths.arc); + makerjs.measure.increase(mp, mm); + makerjs.measure.isPointEqual(p1, p2); + makerjs.measure.isPathEqual(paths.line, paths.circle, 4); + makerjs.measure.isAngleEqual(12, 13); makerjs.measure.isArcConcaveTowardsPoint(paths.arc, [0,0]); + makerjs.measure.isArcOverlapping(paths.arc, paths.arc, true); makerjs.measure.isBetween(7, 8, 9, false); makerjs.measure.isBetweenArcAngles(7, paths.arc, false); makerjs.measure.isBetweenPoints([1,1], paths.line, true); - makerjs.measure.modelExtents(model).high[0]; - makerjs.measure.pathExtents(paths.circle).low[0]; + makerjs.measure.isBezierSeedLinear({type: '', origin:[], end:[], controls:[]}); + makerjs.measure.isLineOverlapping(paths.line, paths.line, false); + makerjs.measure.isMeasurementOverlapping(mm, mp); + var mm = makerjs.measure.modelExtents(model); + var mp = makerjs.measure.pathExtents(paths.circle); makerjs.measure.pathLength(paths.line); makerjs.measure.pointDistance([0,0], [9,9]); + new makerjs.measure.Atlas(model); + mm.low[0]; + mp.high[1]; + var s = makerjs.measure.lineSlope(paths.line); + makerjs.measure.isPointOnSlope([], s); + makerjs.measure.isSlopeEqual(s, s); } function testModel(){ makerjs.model.breakPathsAtIntersections(model, { paths:{ } }); var opts: MakerJs.ICombineOptions = { trimDeadEnds: true, pointMatchingDistance: 2 }; makerjs.model.combine(model, model, true, false, true, false, opts); + makerjs.model.combineIntersection(model, model); + makerjs.model.combineSubtraction(model, model); + makerjs.model.combineUnion(model, model); makerjs.model.convertUnits(model, makerjs.unitType.Centimeter); makerjs.model.countChildModels(model); makerjs.model.detachLoop(model); + makerjs.model.expandPaths(model, 7); + makerjs.model.findChains(model, function (chains: MakerJs.IChain[], loose: MakerJs.IWalkPath[], layer: string) {}) makerjs.model.findLoops(model); makerjs.model.getSimilarModelId(model, 'foo'); makerjs.model.getSimilarPathId(model, 'foo'); @@ -93,18 +123,26 @@ function test() { makerjs.model.move(makerjs.model.originate(model, [9,9]), [0,0]); makerjs.model.moveRelative(model, [1,1]); makerjs.model.originate(model); + makerjs.model.outline(model, 5); + makerjs.model.prefixPathIds(model, 'a'); + makerjs.model.removeDeadEnds(model); makerjs.model.rotate(makerjs.model.scale(model, 6), 45, [0,0]); makerjs.model.scale(model, 7); + makerjs.model.simplify(model); + makerjs.model.walk(model, {}); makerjs.model.walkPaths(model, (modelContext: MakerJs.IModel, pathId: string, pathContext: MakerJs.IPath) => {}); model.exporterOptions = { foo: 'bar' }; } function testModels(): MakerJs.IModel[] { return [ + new makerjs.models.BezierCurve([]), new makerjs.models.BoltCircle(7, 7, 7, 7), new makerjs.models.BoltRectangle(2, 2, 2), new makerjs.models.ConnectTheDots(true, [ [0,0], [1,1] ]), new makerjs.models.Dome(5, 7), + new makerjs.models.Ellipse(2,2), + new makerjs.models.EllipticArc(2,2,3,4), new makerjs.models.Oval(7, 7), new makerjs.models.OvalArc(6, 4, 2, 12, true), new makerjs.models.Polygon(7, 5), @@ -114,22 +152,27 @@ function test() { new makerjs.models.SCurve(5, .9), new makerjs.models.Slot([0, 0], [1, 1], 7), new makerjs.models.Square(8), - new makerjs.models.Star(5, 10, 5) + new makerjs.models.Star(5, 10, 5), + new makerjs.models.Text({} as opentypejs.Font, 'z', 12) ]; } function testPath() { - makerjs.path.areEqual(paths.line, paths.circle, 4); makerjs.path.breakAtPoint(paths.arc, [0,0]).type; + makerjs.path.clone(paths.line); + makerjs.path.converge(paths.line, paths.line); + makerjs.path.distort(paths.arc, 5, 6); makerjs.path.dogbone(paths.line, paths.line, 7); + makerjs.path.expand(paths.line, 5); makerjs.path.fillet(paths.arc, paths.line, 4); makerjs.path.intersection(paths.circle, paths.arc, { excludeTangents: true }).intersectionPoints; makerjs.path.mirror(paths.arc, true, true); makerjs.path.move(paths.line, [1,1]); makerjs.path.moveRelative(paths.circle, [0,0]); + makerjs.path.moveTemporary([], [], function(){}); makerjs.path.rotate(paths.line, 5, [0,0]); makerjs.path.scale(paths.arc, 8); - makerjs.path.slopeIntersectionPoint(paths.line, paths.line); + makerjs.path.straighten(paths.arc); } function testPaths() { @@ -141,7 +184,7 @@ function test() { new makerjs.paths.Chord(paths.arc); new makerjs.paths.Parallel(paths.line, 4, [1,1]); - + //paths.line.layer = "0"; var x: MakerJs.IPathLine = { @@ -154,23 +197,22 @@ function test() { return paths; } - function testPoint() { + function testPoint() { makerjs.point.add(p1, p2); - makerjs.point.areEqual(p1, p2); - makerjs.point.areEqualRounded(p1, p2); makerjs.point.average(p1, p2); makerjs.point.clone(p1); makerjs.point.closest([0,0], [p1, p2]); + makerjs.point.distort([1,1], 2, 3); makerjs.point.fromAngleOnCircle(22, paths.circle); makerjs.point.fromArc(paths.arc); makerjs.point.fromPathEnds(paths.line); makerjs.point.fromPolar(Math.PI, 7); + makerjs.point.fromSlopeIntersection(new makerjs.paths.Line([]), new makerjs.paths.Line([])); makerjs.point.middle(paths.line); makerjs.point.mirror(p1, true, false); makerjs.point.rotate(p1, 5, p2); makerjs.point.rounded(p1); makerjs.point.scale(p2, 8); - makerjs.point.serialize(p1); makerjs.point.subtract(p2, p1); makerjs.point.zero(); } diff --git a/maker.js/makerjs.d.ts b/maker.js/makerjs.d.ts index fdfade36da..7911249c66 100644 --- a/maker.js/makerjs.d.ts +++ b/maker.js/makerjs.d.ts @@ -2,6 +2,9 @@ // Project: https://github.com/Microsoft/maker.js // Definitions by: Dan Marshall // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// +/// +/// /** * Root module for Maker.js. * @@ -37,6 +40,13 @@ declare namespace MakerJs { * @param accuracy Optional exemplar of number of decimal places. */ function round(n: number, accuracy?: number): number; + /** + * Create a string representation of a route array. + * + * @param route Array of strings which are segments of a route. + * @returns String of the flattened array. + */ + function createRouteKey(route: string[]): string; /** * Clone an object. * @@ -57,6 +67,27 @@ declare namespace MakerJs { * @returns The original object after merging. */ function extendObject(target: Object, other: Object): Object; + /** + * Test to see if a variable is a function. + * + * @param value The object to test. + * @returns True if the object is a function type. + */ + function isFunction(value: any): boolean; + /** + * Test to see if a variable is a number. + * + * @param value The object to test. + * @returns True if the object is a number type. + */ + function isNumber(value: any): boolean; + /** + * Test to see if a variable is an object. + * + * @param value The object to test. + * @returns True if the object is an object type. + */ + function isObject(value: any): boolean; /** * An x-y point in a two-dimensional space. * Implemented as an array with 2 elements. The first element is x, the second element is y. @@ -89,6 +120,12 @@ declare namespace MakerJs { */ high: IPoint; } + /** + * A map of measurements. + */ + interface IMeasureMap { + [key: string]: IMeasure; + } /** * A line, curved line or other simple two dimensional shape. */ @@ -179,9 +216,46 @@ declare namespace MakerJs { * @param item The item to test. */ function isPathArc(item: any): boolean; + /** + * A bezier seed defines the endpoints and control points of a bezier curve. + */ + interface IPathBezierSeed extends IPathLine { + /** + * The bezier control points. One point for quadratic, 2 points for cubic. + */ + controls: IPoint[]; + /** + * T values of the parent if this is a child that represents a split. + */ + parentRange?: IBezierRange; + } + /** + * Bezier t values for an arc path segment in a bezier curve. + */ + interface IBezierRange { + /** + * The bezier t-value at the starting point. + */ + startT: number; + /** + * The bezier t-value at the end point. + */ + endT: number; + } + /** + * An arc path segment in a bezier curve. + */ + interface IPathArcInBezierCurve extends IPathArc { + bezierData: IBezierRange; + } + /** + * Test to see if an object implements the required properties of an arc in a bezier curve. + * + * @param item The item to test. + */ + function isPathArcInBezierCurve(item: any): boolean; /** * A map of functions which accept a path as a parameter. - * @private */ interface IPathFunctionMap { /** @@ -191,7 +265,6 @@ declare namespace MakerJs { } /** * A map of functions which accept a path and an origin point as parameters. - * @private */ interface IPathOriginFunctionMap { /** @@ -212,11 +285,33 @@ declare namespace MakerJs { Line: string; Circle: string; Arc: string; + BezierSeed: string; }; + /** + * Slope and y-intercept of a line. + */ + interface ISlope { + /** + * Boolean to see if line has slope or is vertical. + */ + hasSlope: boolean; + /** + * Optional value of non-vertical slope. + */ + slope?: number; + /** + * Line used to calculate this slope. + */ + line: IPathLine; + /** + * Optional value of y when x = 0. + */ + yIntercept?: number; + } /** * Options to pass to path.intersection() */ - interface IPathIntersectionOptions { + interface IPathIntersectionBaseOptions { /** * Optional boolean to only return deep intersections, i.e. not on an end point or tangent. */ @@ -226,6 +321,19 @@ declare namespace MakerJs { */ out_AreOverlapped?: boolean; } + /** + * Options to pass to path.intersection() + */ + interface IPathIntersectionOptions extends IPathIntersectionBaseOptions { + /** + * Optional boolean to only return deep intersections, i.e. not on an end point or tangent. + */ + path1Offset?: IPoint; + /** + * Optional output variable which will be set to true if the paths are overlapped. + */ + path2Offset?: IPoint; + } /** * An intersection of two paths. */ @@ -268,6 +376,14 @@ declare namespace MakerJs { * Point which is known to be outside of the model. */ farPoint?: IPoint; + /** + * Cached measurements for model A. + */ + measureA?: measure.Atlas; + /** + * Cached measurements for model B. + */ + measureB?: measure.Atlas; } /** * Options to pass to model.findLoops. @@ -278,6 +394,19 @@ declare namespace MakerJs { */ removeFromOriginal?: boolean; } + /** + * Options to pass to model.simplify() + */ + interface ISimplifyOptions { + /** + * Optional + */ + pointMatchingDistance?: number; + /** + * Optional + */ + scalarMatchingDistance?: number; + } /** * A path that may be indicated to "flow" in either direction between its endpoints. */ @@ -370,11 +499,114 @@ declare namespace MakerJs { pathId: string; } /** - * Path and its reference id within a model + * A route to either a path or a model, and the absolute offset of it. */ - interface IRefPathInModel extends IRefPathIdInModel { + interface IRouteOffset { + layer: string; + offset: IPoint; + route: string[]; + routeKey: string; + } + /** + * A path reference in a walk. + */ + interface IWalkPath extends IRefPathIdInModel, IRouteOffset { pathContext: IPath; } + /** + * Callback signature for path in model.walk(). + */ + interface IWalkPathCallback { + (context: IWalkPath): void; + } + /** + * Callback for returning a boolean from an IWalkPath. + */ + interface IWalkPathBooleanCallback { + (context: IWalkPath): boolean; + } + /** + * A link in a chain, with direction of flow. + */ + interface IChainLink { + /** + * Reference to the path. + */ + walkedPath: IWalkPath; + /** + * Path flows forwards or reverse. + */ + reversed: boolean; + /** + * The endpoints of the path, in absolute coords. + */ + endPoints: IPoint[]; + } + /** + * A chain of paths which connect end to end. + */ + interface IChain { + /** + * The links in this chain. + */ + links: IChainLink[]; + /** + * Flag if this chain forms a loop end to end. + */ + endless?: boolean; + } + /** + * Callback to model.findChains() with resulting array of chains and unchained paths. + */ + interface IChainCallback { + (chains: IChain[], loose: IWalkPath[], layer: string): void; + } + /** + * Options to pass to model.findLoops. + */ + interface IFindChainsOptions extends IPointMatchOptions { + /** + * Flag to separate chains by layers. + */ + byLayers?: boolean; + /** + * Flag to not recurse models, look only within current model's immediate paths. + */ + shallow?: boolean; + } + /** + * Reference to a model within a model. + */ + interface IRefModelInModel { + parentModel: IModel; + childId: string; + childModel: IModel; + } + /** + * A model reference in a walk. + */ + interface IWalkModel extends IRefModelInModel, IRouteOffset { + } + /** + * Callback signature for model.walk(). + */ + interface IWalkModelCallback { + (context: IWalkModel): void; + } + /** + * Callback signature for model.walk(), which may return false to halt any further walking. + */ + interface IWalkModelCancellableCallback { + (context: IWalkModel): boolean; + } + /** + * Options to pass to model.walk(). + */ + interface IWalkOptions { + onPath?: IWalkPathCallback; + beforeChildWalk?: IWalkModelCancellableCallback; + afterChildWalk?: IWalkModelCallback; + } /** * Describes a parameter and its limits. */ @@ -425,14 +657,6 @@ declare namespace MakerJs { } } declare namespace MakerJs.angle { - /** - * Find out if two angles are equal. - * - * @param a First angle. - * @param b Second angle. - * @returns true if angles are the same, false if they are not - */ - function areEqual(angle1: number, angle2: number, accuracy?: number): boolean; /** * Ensures an angle is not greater than 360 * @@ -469,6 +693,13 @@ declare namespace MakerJs.angle { * @returns Middle angle of arc. */ function ofArcMiddle(arc: IPathArc, ratio?: number): number; + /** + * Total angle of an arc between its start and end angles. + * + * @param arc The arc to measure. + * @returns Angle of arc. + */ + function ofArcSpan(arc: IPathArc): number; /** * Angle of a line path. * @@ -512,23 +743,6 @@ declare namespace MakerJs.point { * @returns A new point object. */ function add(a: IPoint, b: IPoint, subtract?: boolean): IPoint; - /** - * Find out if two points are equal. - * - * @param a First point. - * @param b Second point. - * @returns true if points are the same, false if they are not - */ - function areEqual(a: IPoint, b: IPoint, withinDistance?: number): boolean; - /** - * Find out if two points are equal after rounding. - * - * @param a First point. - * @param b Second point. - * @param accuracy Optional exemplar of number of decimal places. - * @returns true if points are the same, false if they are not - */ - function areEqualRounded(a: IPoint, b: IPoint, accuracy?: number): boolean; /** * Get the average of two points. * @@ -580,7 +794,16 @@ declare namespace MakerJs.point { * @param pathContext The path object. * @returns Array with 2 elements: [0] is the point object corresponding to the origin, [1] is the point object corresponding to the end. */ - function fromPathEnds(pathContext: IPath): IPoint[]; + function fromPathEnds(pathContext: IPath, pathOffset?: IPoint): IPoint[]; + /** + * Calculates the intersection of slopes of two lines. + * + * @param lineA First line to use for slope. + * @param lineB Second line to use for slope. + * @param options Optional IPathIntersectionOptions. + * @returns point of intersection of the two slopes, or null if the slopes did not intersect. + */ + function fromSlopeIntersection(lineA: IPathLine, lineB: IPathLine, options?: IPathIntersectionBaseOptions): IPoint; /** * Get the middle point of a path. * @@ -624,13 +847,14 @@ declare namespace MakerJs.point { */ function scale(pointToScale: IPoint, scaleValue: number): IPoint; /** - * Get a string representation of a point. + * Distort a point's coordinates. * - * @param pointContext The point to serialize. - * @param accuracy Optional exemplar of number of decimal places. - * @returns String representing the point. + * @param pointToDistort The point to distort. + * @param scaleX The amount of x scaling. + * @param scaleY The amount of y scaling. + * @returns A new point. */ - function serialize(pointContext: IPoint, accuracy?: number): string; + function distort(pointToDistort: IPoint, scaleX: number, scaleY: number): IPoint; /** * Subtract a point from another point, and return the result as a new point. Shortcut to Add(a, b, subtract = true). * @@ -649,23 +873,21 @@ declare namespace MakerJs.point { } declare namespace MakerJs.path { /** - * Find out if two paths are equal. + * Create a clone of a path. This is faster than cloneObject. * - * @param a First path. - * @param b Second path. - * @returns true if paths are the same, false if they are not + * @param pathToClone The path to clone. + * @returns Cloned path. */ - function areEqual(path1: IPath, path2: IPath, withinPointDistance?: number): boolean; + function clone(pathToClone: IPath): IPath; /** * Create a clone of a path, mirrored on either or both x and y axes. * * @param pathToMirror The path to mirror. * @param mirrorX Boolean to mirror on the x axis. * @param mirrorY Boolean to mirror on the y axis. - * @param newId Optional id to assign to the new path. * @returns Mirrored path. */ - function mirror(pathToMirror: IPath, mirrorX: boolean, mirrorY: boolean, newId?: string): IPath; + function mirror(pathToMirror: IPath, mirrorX: boolean, mirrorY: boolean): IPath; /** * Move a path to an absolute point. * @@ -679,9 +901,18 @@ declare namespace MakerJs.path { * * @param pathToMove The path to move. * @param delta The x & y adjustments as a point object. + * @param subtract Optional boolean to subtract instead of add. * @returns The original path (for chaining). */ - function moveRelative(pathToMove: IPath, delta: IPoint): IPath; + function moveRelative(pathToMove: IPath, delta: IPoint, subtract?: boolean): IPath; + /** + * Move some paths relatively during a task execution, then unmove them. + * + * @param pathsToMove The paths to move. + * @param deltas The x & y adjustments as a point object array. + * @param task The function to call while the paths are temporarily moved. + */ + function moveTemporary(pathsToMove: IPath[], deltas: IPoint[], task: Function): void; /** * Rotate a path. * @@ -699,6 +930,24 @@ declare namespace MakerJs.path { * @returns The original path (for chaining). */ function scale(pathToScale: IPath, scaleValue: number): IPath; + /** + * Distort a path - scale x and y individually. + * + * @param pathToDistort The path to distort. + * @param scaleX The amount of x scaling. + * @param scaleY The amount of y scaling. + * @returns A new IModel (for circles and arcs) or IPath (for lines and bezier seeds). + */ + function distort(pathToDistort: IPath, scaleX: number, scaleY: number): IModel | IPath; + /** + * Connect 2 lines at their slope intersection point. + * + * @param lineA First line to converge. + * @param lineB Second line to converge. + * @param useOriginA Optional flag to converge the origin point of lineA instead of the end point. + * @param useOriginB Optional flag to converge the origin point of lineB instead of the end point. + */ + function converge(lineA: IPathLine, lineB: IPathLine, useOriginA?: boolean, useOriginB?: boolean): IPoint; } declare namespace MakerJs.path { /** @@ -715,11 +964,6 @@ declare namespace MakerJs.path { declare namespace MakerJs.paths { /** * Class for arc path. - * - * @param origin The center point of the arc. - * @param radius The radius of the arc. - * @param startAngle The start angle of the arc. - * @param endAngle The end angle of the arc. */ class Arc implements IPathArc { origin: IPoint; @@ -727,30 +971,117 @@ declare namespace MakerJs.paths { startAngle: number; endAngle: number; type: string; + /** + * Class for arc path, created from origin point, radius, start angle, and end angle. + * + * @param origin The center point of the arc. + * @param radius The radius of the arc. + * @param startAngle The start angle of the arc. + * @param endAngle The end angle of the arc. + */ constructor(origin: IPoint, radius: number, startAngle: number, endAngle: number); + /** + * Class for arc path, created from 2 points, radius, large Arc flag, and clockwise flag. + * + * @param pointA First end point of the arc. + * @param pointB Second end point of the arc. + * @param radius The radius of the arc. + * @param largeArc Boolean flag to indicate clockwise direction. + * @param clockwise Boolean flag to indicate clockwise direction. + */ + constructor(pointA: IPoint, pointB: IPoint, radius: number, largeArc: boolean, clockwise: boolean); + /** + * Class for arc path, created from 2 points and optional boolean flag indicating clockwise. + * + * @param pointA First end point of the arc. + * @param pointB Second end point of the arc. + * @param clockwise Boolean flag to indicate clockwise direction. + */ + constructor(pointA: IPoint, pointB: IPoint, clockwise?: boolean); + /** + * Class for arc path, created from 3 points. + * + * @param pointA First end point of the arc. + * @param pointB Middle point on the arc. + * @param pointC Second end point of the arc. + */ + constructor(pointA: IPoint, pointB: IPoint, pointC: IPoint); } /** * Class for circle path. - * - * @param origin The center point of the circle. - * @param radius The radius of the circle. */ class Circle implements IPathCircle { + type: string; origin: IPoint; radius: number; - type: string; + /** + * Class for circle path, created from radius. Origin will be [0, 0]. + * + * Example: + * ``` + * var c = new makerjs.paths.Circle(7); + * ``` + * + * @param radius The radius of the circle. + */ + constructor(radius: number); + /** + * Class for circle path, created from origin point and radius. + * + * Example: + * ``` + * var c = new makerjs.paths.Circle([10, 10], 7); + * ``` + * + * @param origin The center point of the circle. + * @param radius The radius of the circle. + */ constructor(origin: IPoint, radius: number); + /** + * Class for circle path, created from 2 points. + * + * Example: + * ``` + * var c = new makerjs.paths.Circle([5, 15], [25, 15]); + * ``` + * + * @param pointA First point on the circle. + * @param pointB Second point on the circle. + */ + constructor(pointA: IPoint, pointB: IPoint); + /** + * Class for circle path, created from 3 points. + * + * Example: + * ``` + * var c = new makerjs.paths.Circle([0, 0], [0, 10], [20, 0]); + * ``` + * + * @param pointA First point on the circle. + * @param pointB Second point on the circle. + * @param pointC Third point on the circle. + */ + constructor(pointA: IPoint, pointB: IPoint, pointC: IPoint); } /** * Class for line path. - * - * @param origin The origin point of the line. - * @param end The end point of the line. */ class Line implements IPathLine { + type: string; origin: IPoint; end: IPoint; - type: string; + /** + * Class for line path, constructed from array of 2 points. + * + * @param points Array of 2 points. + */ + constructor(points: IPoint[]); + /** + * Class for line path, constructed from 2 points. + * + * @param origin The origin point of the line. + * @param end The end point of the line. + */ constructor(origin: IPoint, end: IPoint); } /** @@ -832,6 +1163,14 @@ declare namespace MakerJs.model { * @returns The original model (for chaining). */ function moveRelative(modelToMove: IModel, delta: IPoint): IModel; + /** + * Prefix the ids of paths in a model. + * + * @param modelToPrefix The model to prefix. + * @param prefix The prefix to prepend on paths ids. + * @returns The original model (for chaining). + */ + function prefixPathIds(modelToPrefix: IModel, prefix: string): IModel; /** * Rotate a model. * @@ -865,6 +1204,15 @@ declare namespace MakerJs.model { * @param callback Callback for each path. */ function walkPaths(modelContext: IModel, callback: IModelPathCallback): void; + /** + * Recursively walk through all paths for a given model. + * + * @param modelContext The model to walk. + * @param pathCallback Callback for each path. + * @param modelCallbackBeforeWalk Callback for each model prior to recursion, which can cancel the recursion if it returns false. + * @param modelCallbackAfterWalk Callback for each model after recursion. + */ + function walk(modelContext: IModel, options: IWalkOptions): void; } declare namespace MakerJs.model { /** @@ -875,7 +1223,7 @@ declare namespace MakerJs.model { * @param farPoint Optional point of reference which is outside the bounds of the modelContext. * @returns Boolean true if the path is inside of the modelContext. */ - function isPathInsideModel(pathContext: IPath, modelContext: IModel, farPoint?: IPoint): boolean; + function isPathInsideModel(pathContext: IPath, modelContext: IModel, pathOffset?: IPoint, farPoint?: IPoint, measureAtlas?: measure.Atlas): boolean; /** * Break a model's paths everywhere they intersect with another path. * @@ -884,7 +1232,7 @@ declare namespace MakerJs.model { */ function breakPathsAtIntersections(modelToBreak: IModel, modelToIntersect?: IModel): void; /** - * Combine 2 models. The models should be originated, and every path within each model should be part of a loop. + * Combine 2 models. * * @param modelA First model to combine. * @param modelB Second model to combine. @@ -896,6 +1244,106 @@ declare namespace MakerJs.model { * @param farPoint Optional point of reference which is outside the bounds of both models. */ function combine(modelA: IModel, modelB: IModel, includeAInsideB?: boolean, includeAOutsideB?: boolean, includeBInsideA?: boolean, includeBOutsideA?: boolean, options?: ICombineOptions): void; + /** + * Combine 2 models, resulting in a intersection. + * + * @param modelA First model to combine. + * @param modelB Second model to combine. + */ + function combineIntersection(modelA: IModel, modelB: IModel): void; + /** + * Combine 2 models, resulting in a subtraction of B from A. + * + * @param modelA First model to combine. + * @param modelB Second model to combine. + */ + function combineSubtraction(modelA: IModel, modelB: IModel): void; + /** + * Combine 2 models, resulting in a union. + * + * @param modelA First model to combine. + * @param modelB Second model to combine. + */ + function combineUnion(modelA: IModel, modelB: IModel): void; +} +declare namespace MakerJs { + /** + * Compare keys to see if they are equal. + */ + interface ICollectionKeyComparer { + (a: K, b: K): boolean; + } + /** + * A collection for items that share a common key. + */ + interface ICollection { + key: K; + items: T[]; + } + /** + * Collects items that share a common key. + */ + class Collector { + private comparer; + collections: ICollection[]; + constructor(comparer?: ICollectionKeyComparer); + addItemToCollection(key: K, item: T): void; + findCollection(key: K, action?: (index: number) => void): T[]; + removeCollection(key: K): boolean; + removeItemFromCollection(key: K, item: T): boolean; + getCollectionsOfMultiple(cb: (key: K, items: T[]) => void): void; + } +} +declare namespace MakerJs.model { + /** + * Simplify a model's paths by reducing redundancy: combine multiple overlapping paths into a single path. The model must be originated. + * + * @param modelContext The originated model to search for similar paths. + * @param options Optional options object. + * @returns The simplified model (for chaining). + */ + function simplify(modelToSimplify: IModel, options?: ISimplifyOptions): IModel; +} +declare namespace MakerJs.path { + /** + * Expand path by creating a model which surrounds it. + * + * @param pathToExpand Path to expand. + * @param expansion Distance to expand. + * @param isolateCaps Optional flag to put the end caps into a separate model named "caps". + * @returns Model which surrounds the path. + */ + function expand(pathToExpand: IPath, expansion: number, isolateCaps?: boolean): IModel; + /** + * Represent an arc using straight lines. + * + * @param arc Arc to straighten. + * @param bevel Optional flag to bevel the angle to prevent it from being too sharp. + * @param prefix Optional prefix to apply to path ids. + * @returns Model of straight lines with same endpoints as the arc. + */ + function straighten(arc: IPathArc, bevel?: boolean, prefix?: string): IModel; +} +declare namespace MakerJs.model { + /** + * Expand all paths in a model, then combine the resulting expansions. + * + * @param modelToExpand Model to expand. + * @param distance Distance to expand. + * @param joints Number of points at a joint between paths. Use 0 for round joints, 1 for pointed joints, 2 for beveled joints. + * @returns Model which surrounds the paths of the original model. + */ + function expandPaths(modelToExpand: IModel, distance: number, joints?: number, combineOptions?: ICombineOptions): IModel; + /** + * Outline a model by a specified distance. Useful for accommodating for kerf. + * + * @param modelToOutline Model to outline. + * @param distance Distance to outline. + * @param joints Number of points at a joint between paths. Use 0 for round joints, 1 for pointed joints, 2 for beveled joints. + * @param inside Optional boolean to draw lines inside the model instead of outside. + * @returns Model which surrounds the paths outside of the original model. + */ + function outline(modelToOutline: IModel, distance: number, joints?: number, inside?: boolean): IModel; } declare namespace MakerJs.units { /** @@ -909,12 +1357,56 @@ declare namespace MakerJs.units { } declare namespace MakerJs.measure { /** - * Total angle of an arc between its start and end angles. + * Find out if two angles are equal. * - * @param arc The arc to measure. - * @returns Angle of arc. + * @param angleA First angle. + * @param angleB Second angle. + * @returns true if angles are the same, false if they are not */ - function arcAngle(arc: IPathArc): number; + function isAngleEqual(angleA: number, angleB: number, accuracy?: number): boolean; + /** + * Find out if two paths are equal. + * + * @param pathA First path. + * @param pathB Second path. + * @returns true if paths are the same, false if they are not + */ + function isPathEqual(pathA: IPath, pathB: IPath, withinPointDistance?: number, pathAOffset?: IPoint, pathBOffset?: IPoint): boolean; + /** + * Find out if two points are equal. + * + * @param a First point. + * @param b Second point. + * @returns true if points are the same, false if they are not + */ + function isPointEqual(a: IPoint, b: IPoint, withinDistance?: number): boolean; + /** + * Find out if point is on a slope. + * + * @param p Point to check. + * @param b Slope. + * @returns true if point is on the slope + */ + function isPointOnSlope(p: IPoint, slope: ISlope, withinDistance?: number): boolean; + /** + * Check for slope equality. + * + * @param slopeA The ISlope to test. + * @param slopeB The ISlope to check for equality. + * @returns Boolean true if slopes are equal. + */ + function isSlopeEqual(slopeA: ISlope, slopeB: ISlope): boolean; +} +declare namespace MakerJs.measure { + /** + * Increase a measurement by an additional measurement. + * + * @param baseMeasure The measurement to increase. + * @param addMeasure The additional measurement. + * @param addOffset Optional offset point of the additional measurement. + * @returns The increased original measurement (for chaining). + */ + function increase(baseMeasure: IMeasure, addMeasure: IMeasure): IMeasure; /** * Check for arc being concave or convex towards a given point. * @@ -923,16 +1415,25 @@ declare namespace MakerJs.measure { * @returns Boolean true if arc is concave towards point. */ function isArcConcaveTowardsPoint(arc: IPathArc, towardsPoint: IPoint): boolean; + /** + * Check for arc overlapping another arc. + * + * @param arcA The arc to test. + * @param arcB The arc to check for overlap. + * @param excludeTangents Boolean to exclude exact endpoints and only look for deep overlaps. + * @returns Boolean true if arc1 is overlapped with arcB. + */ + function isArcOverlapping(arcA: IPathArc, arcB: IPathArc, excludeTangents: boolean): boolean; /** * Check if a given number is between two given limits. * * @param valueInQuestion The number to test. - * @param limit1 First limit. - * @param limit2 Second limit. + * @param limitA First limit. + * @param limitB Second limit. * @param exclusive Flag to exclude equaling the limits. * @returns Boolean true if value is between (or equal to) the limits. */ - function isBetween(valueInQuestion: number, limit1: number, limit2: number, exclusive: boolean): boolean; + function isBetween(valueInQuestion: number, limitA: number, limitB: number, exclusive: boolean): boolean; /** * Check if a given angle is between an arc's start and end angles. * @@ -951,6 +1452,34 @@ declare namespace MakerJs.measure { * @returns Boolean true if point is between (or equal to) the line's origin and end points. */ function isBetweenPoints(pointInQuestion: IPoint, line: IPathLine, exclusive: boolean): boolean; + /** + * Check if a given bezier seed is simply a line. + * + * @param seed The bezier seed to test. + * @returns Boolean true if bezier seed has control points on the line slope and between the line endpoints. + */ + function isBezierSeedLinear(seed: IPathBezierSeed): boolean; + /** + * Check for line overlapping another line. + * + * @param lineA The line to test. + * @param lineB The line to check for overlap. + * @param excludeTangents Boolean to exclude exact endpoints and only look for deep overlaps. + * @returns Boolean true if line1 is overlapped with lineB. + */ + function isLineOverlapping(lineA: IPathLine, lineB: IPathLine, excludeTangents: boolean): boolean; + /** + * Check for measurement overlapping another measurement. + * + * @param measureA The measurement to test. + * @param measureB The measurement to check for overlap. + * @returns Boolean true if measure1 is overlapped with measureB. + */ + function isMeasurementOverlapping(measureA: IMeasure, measureB: IMeasure): boolean; + /** + * Gets the slope of a line. + */ + function lineSlope(line: IPathLine): ISlope; /** * Calculates the distance between two points. * @@ -965,7 +1494,7 @@ declare namespace MakerJs.measure { * @param pathToMeasure The path to measure. * @returns object with low and high points. */ - function pathExtents(pathToMeasure: IPath): IMeasure; + function pathExtents(pathToMeasure: IPath, addOffset?: IPoint): IMeasure; /** * Measures the length of a path. * @@ -977,9 +1506,38 @@ declare namespace MakerJs.measure { * Measures the smallest rectangle which contains a model. * * @param modelToMeasure The model to measure. + * @param atlas Optional atlas to save measurements. * @returns object with low and high points. */ - function modelExtents(modelToMeasure: IModel): IMeasure; + function modelExtents(modelToMeasure: IModel, atlas?: measure.Atlas): IMeasure; + /** + * A list of maps of measurements. + * + * @param modelToMeasure The model to measure. + * @param atlas Optional atlas to save measurements. + * @returns object with low and high points. + */ + class Atlas { + modelContext: IModel; + /** + * Flag that models have been measured. + */ + modelsMeasured: boolean; + /** + * Map of model measurements, mapped by routeKey. + */ + modelMap: IMeasureMap; + /** + * Map of path measurements, mapped by routeKey. + */ + pathMap: IMeasureMap; + /** + * Constructor. + * @param modelContext The model to measure. + */ + constructor(modelContext: IModel); + measureModels(): void; + } } declare namespace MakerJs.exporter { /** @@ -1036,6 +1594,20 @@ declare namespace MakerJs.exporter { exportItem(itemId: string, itemToExport: any, origin: IPoint): void; } } +declare namespace MakerJs.importer { + /** + * Create a numeric array from a string of numbers. The numbers may be delimited by anything non-numeric. + * + * Example: + * ``` + * var n = makerjs.importer.parseNumericList('5, 10, 15.20 25-30-35 4e1 .5'); + * ``` + * + * @param s The string of numbers. + * @returns Array of numbers. + */ + function parseNumericList(s: string): number[]; +} declare namespace MakerJs.exporter { function toDXF(modelToExport: IModel, options?: IDXFRenderOptions): string; function toDXF(pathsToExport: IPath[], options?: IDXFRenderOptions): string; @@ -1050,12 +1622,12 @@ declare namespace MakerJs.solvers { /** * Solves for the angle of a triangle when you know lengths of 3 sides. * - * @param length1 Length of side of triangle, opposite of the angle you are trying to find. - * @param length2 Length of any other side of the triangle. - * @param length3 Length of the remaining side of the triangle. + * @param lengthA Length of side of triangle, opposite of the angle you are trying to find. + * @param lengthB Length of any other side of the triangle. + * @param lengthC Length of the remaining side of the triangle. * @returns Angle opposite of the side represented by the first parameter. */ - function solveTriangleSSS(length1: number, length2: number, length3: number): number; + function solveTriangleSSS(lengthA: number, lengthB: number, lengthC: number): number; /** * Solves for the length of a side of a triangle when you know length of one side and 2 angles. * @@ -1076,33 +1648,24 @@ declare namespace MakerJs.path { * @returns IPathIntersection object, with points(s) of intersection (and angles, when a path is an arc or circle); or null if the paths did not intersect. */ function intersection(path1: IPath, path2: IPath, options?: IPathIntersectionOptions): IPathIntersection; - /** - * Calculates the intersection of slopes of two lines. - * - * @param line1 First line to use for slope. - * @param line2 Second line to use for slope. - * @param options Optional IPathIntersectionOptions. - * @returns point of intersection of the two slopes, or null if the slopes did not intersect. - */ - function slopeIntersectionPoint(line1: IPathLine, line2: IPathLine, options?: IPathIntersectionOptions): IPoint; } declare namespace MakerJs.path { /** * Adds a round corner to the outside angle between 2 lines. The lines must meet at one point. * - * @param line1 First line to fillet, which will be modified to fit the fillet. - * @param line2 Second line to fillet, which will be modified to fit the fillet. + * @param lineA First line to fillet, which will be modified to fit the fillet. + * @param lineB Second line to fillet, which will be modified to fit the fillet. * @returns Arc path object of the new fillet. */ - function dogbone(line1: IPathLine, line2: IPathLine, filletRadius: number, options?: IPointMatchOptions): IPathArc; + function dogbone(lineA: IPathLine, lineB: IPathLine, filletRadius: number, options?: IPointMatchOptions): IPathArc; /** * Adds a round corner to the inside angle between 2 paths. The paths must meet at one point. * - * @param path1 First path to fillet, which will be modified to fit the fillet. - * @param path2 Second path to fillet, which will be modified to fit the fillet. + * @param pathA First path to fillet, which will be modified to fit the fillet. + * @param pathB Second path to fillet, which will be modified to fit the fillet. * @returns Arc path object of the new fillet. */ - function fillet(path1: IPath, path2: IPath, filletRadius: number, options?: IPointMatchOptions): IPathArc; + function fillet(pathA: IPath, pathB: IPath, filletRadius: number, options?: IPointMatchOptions): IPathArc; } declare namespace MakerJs.kit { /** @@ -1123,22 +1686,14 @@ declare namespace MakerJs.kit { } declare namespace MakerJs.model { /** - * @private + * Find paths that have common endpoints and form chains. + * + * @param modelContext The model to search for chains. + * @param options Optional options object. */ - interface IPointMappedItem { - averagePoint: IPoint; - item: T; - } - /** - * @private - */ - class PointMap { - matchingDistance: number; - list: IPointMappedItem[]; - constructor(matchingDistance?: number); - add(pointToAdd: IPoint, item: T): void; - find(pointToFind: IPoint, saveAverage: boolean): T; - } + function findChains(modelContext: IModel, callback: IChainCallback, options?: IFindChainsOptions): void; +} +declare namespace MakerJs.model { /** * Find paths that have common endpoints and form loops. * @@ -1153,7 +1708,14 @@ declare namespace MakerJs.model { * @param loopToDetach The model to search for loops. */ function detachLoop(loopToDetach: IModel): void; - function removeDeadEnds(modelContext: IModel, pointMatchingDistance?: number): void; + /** + * Remove paths from a model which have endpoints that do not connect to other paths. + * + * @param modelContext The model to search for dead ends. + * @param options Optional options object. + * @returns The input model (for chaining). + */ + function removeDeadEnds(modelContext: IModel, pointMatchingDistance?: any, keep?: IWalkPathBooleanCallback): IModel; } declare namespace MakerJs.exporter { /** @@ -1249,6 +1811,37 @@ declare namespace MakerJs.exporter { } } declare namespace MakerJs.exporter { + /** + * Injects drawing into a PDFKit document. + * + * @param modelToExport Model object to export. + * @param options Export options object. + * @returns String of PDF file contents. + */ + function toPDF(doc: PDFKit.PDFDocument, modelToExport: IModel, options?: IPDFRenderOptions): void; + /** + * PDF rendering options. + */ + interface IPDFRenderOptions extends IExportOptions { + /** + * Rendered reference origin. + */ + origin?: IPoint; + /** + * SVG color of the rendered paths. + */ + stroke?: string; + } +} +declare namespace MakerJs.exporter { + /** + * Convert a chain to SVG path data. + */ + function chainToSVGPathData(chain: IChain, offset: IPoint, scale: number): string; + /** + * Convert a path to SVG path data. + */ + function pathToSVGPathData(pathToExport: IPath, offset: IPoint, offset2: IPoint, scale: number): string; function toSVG(modelToExport: IModel, options?: ISVGRenderOptions): string; function toSVG(pathsToExport: IPath[], options?: ISVGRenderOptions): string; function toSVG(pathToExport: IPath, options?: ISVGRenderOptions): string; @@ -1273,6 +1866,10 @@ declare namespace MakerJs.exporter { * Optional attributes to add to the root svg tag. */ svgAttrs?: IXmlTagAttrs; + /** + * SVG fill color. + */ + fill?: string; /** * SVG font size and font size units. */ @@ -1307,16 +1904,128 @@ declare namespace MakerJs.exporter { viewBox?: boolean; } } +declare namespace MakerJs.importer { + function fromSVGPathData(pathData: string): IModel; +} +declare namespace MakerJs.models { + class BezierCurve implements IModel { + models: IModelMap; + paths: IPathMap; + origin: IPoint; + type: string; + seed: IPathBezierSeed; + accuracy: number; + constructor(points: IPoint[], accuracy?: number); + constructor(seed: IPathBezierSeed, accuracy?: number); + constructor(seed: IPathBezierSeed, isChild: boolean, accuracy?: number); + constructor(origin: IPoint, control: IPoint, end: IPoint, accuracy?: number); + constructor(origin: IPoint, controls: IPoint[], end: IPoint, accuracy?: number); + constructor(origin: IPoint, control1: IPoint, control2: IPoint, end: IPoint, accuracy?: number); + static typeName: string; + static getBezierSeeds(curve: BezierCurve, options?: IFindChainsOptions): IPathBezierSeed[]; + static computePoint(seed: IPathBezierSeed, t: number): IPoint; + } +} +declare var Bezier: typeof BezierJs.Bezier; +declare namespace MakerJs.models { + class Ellipse implements IModel { + models: IModelMap; + origin: IPoint; + /** + * Class for Ellipse created with 2 radii. + * + * @param radiusX The x radius of the ellipse. + * @param radiusY The y radius of the ellipse. + * @param accuracy Optional accuracy of the underlying BezierCurve. + */ + constructor(radiusX: number, radiusY: number, accuracy?: number); + /** + * Class for Ellipse created at a specific origin and 2 radii. + * + * @param origin The center of the ellipse. + * @param radiusX The x radius of the ellipse. + * @param radiusY The y radius of the ellipse. + * @param accuracy Optional accuracy of the underlying BezierCurve. + */ + constructor(origin: IPoint, radiusX: number, radiusY: number, accuracy?: number); + /** + * Class for Ellipse created at a specific x, y and 2 radii. + * + * @param cx The x coordinate of the center of the ellipse. + * @param cy The y coordinate of the center of the ellipse. + * @param rX The x radius of the ellipse. + * @param rY The y radius of the ellipse. + * @param accuracy Optional accuracy of the underlying BezierCurve. + */ + constructor(cx: number, cy: number, rx: number, ry: number, accuracy?: number); + } + class EllipticArc implements IModel { + models: IModelMap; + /** + * Class for Elliptic Arc created by distorting a circular arc. + * + * @param arc The circular arc to use as the basis of the elliptic arc. + * @param radiusX The x radius of the ellipse. + * @param radiusY The y radius of the ellipse. + * @param accuracy Optional accuracy of the underlying BezierCurve. + */ + constructor(startAngle: number, endAngle: number, radiusX: number, radiusY: number, accuracy?: number); + /** + * Class for Elliptic Arc created by distorting a circular arc. + * + * @param arc The circular arc to use as the basis of the elliptic arc. + * @param distortX The x scale of the ellipse. + * @param distortY The y scale of the ellipse. + * @param accuracy Optional accuracy of the underlying BezierCurve. + */ + constructor(arc: IPathArc, distortX: number, distortY: number, accuracy?: number); + } +} declare namespace MakerJs.models { class ConnectTheDots implements IModel { paths: IPathMap; + /** + * Create a model by connecting points designated in a string. The model will be 'closed' - i.e. the last point will connect to the first point. + * + * Example: + * ``` + * var c = new makerjs.models.ConnectTheDots('-10 0 10 0 0 20'); // 3 coordinates to form a triangle + * ``` + * + * @param numericList String containing a list of numbers which can be delimited by spaces, commas, or anything non-numeric (Note: [exponential notation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential) is allowed). + */ + constructor(numericList: string); + /** + * Create a model by connecting points designated in a numeric array. The model will be 'closed' - i.e. the last point will connect to the first point. + * + * Example: + * ``` + * var c = new makerjs.models.ConnectTheDots([-10, 0, 10, 0, 0, 20]); // 3 coordinates to form a triangle + * ``` + * + * @param coords Array of coordinates. + */ + constructor(coords: number[]); + /** + * Create a model by connecting points designated in an array of points. The model may be closed, or left open. + * + * Example: + * ``` + * var c = new makerjs.models.ConnectTheDots(false, [[-10, 0], [10, 0], [0, 20]]); // 3 coordinates left open + * ``` + * + * @param isClosed Flag to specify if last point should connect to the first point. + * @param points Array of IPoints. + */ constructor(isClosed: boolean, points: IPoint[]); } } declare namespace MakerJs.models { - class Polygon extends ConnectTheDots { - constructor(numberOfSides: number, radius: number, firstCornerAngleInDegrees?: number); - static getPoints(numberOfSides: number, radius: number, firstCornerAngleInDegrees?: number): IPoint[]; + class Polygon implements IModel { + paths: IPathMap; + constructor(numberOfSides: number, radius: number, firstCornerAngleInDegrees?: number, circumscribed?: boolean); + static circumscribedRadius(radius: number, angleInRadians: number): number; + static getPoints(numberOfSides: number, radius: number, firstCornerAngleInDegrees?: number, circumscribed?: boolean): IPoint[]; } } declare namespace MakerJs.models { @@ -1339,24 +2048,91 @@ declare namespace MakerJs.models { } declare namespace MakerJs.models { class RoundRectangle implements IModel { + origin: IPoint; paths: IPathMap; + /** + * Create a round rectangle from width, height, and corner radius. + * + * Example: + * ``` + * var r = new makerjs.models.RoundRectangle(100, 50, 5); + * ``` + * + * @param width Width of the rectangle. + * @param height Height of the rectangle. + * @param radius Corner radius. + */ constructor(width: number, height: number, radius: number); + /** + * Create a round rectangle which will surround a model. + * + * Example: + * ``` + * var b = new makerjs.models.BoltRectangle(30, 20, 1); //draw a bolt rectangle so we have something to surround + * var r = new makerjs.models.RoundRectangle(b, 2.5); //surround it + * ``` + * + * @param modelToSurround IModel object. + * @param margin Distance from the model. This will also become the corner radius. + */ + constructor(modelToSurround: IModel, margin: number); } } declare namespace MakerJs.models { - class Oval extends RoundRectangle { + class Oval implements IModel { + paths: IPathMap; constructor(width: number, height: number); } } declare namespace MakerJs.models { class OvalArc implements IModel { paths: IPathMap; - constructor(startAngle: number, endAngle: number, sweepRadius: number, slotRadius: number, selfIntersect?: boolean); + models: IModelMap; + constructor(startAngle: number, endAngle: number, sweepRadius: number, slotRadius: number, selfIntersect?: boolean, isolateCaps?: boolean); } } declare namespace MakerJs.models { - class Rectangle extends ConnectTheDots { + class Rectangle implements IModel { + paths: IPathMap; + origin: IPoint; + /** + * Create a rectangle from width and height. + * + * Example: + * ``` + * var r = new makerjs.models.Rectangle(100, 50); + * ``` + * + * @param width Width of the rectangle. + * @param height Height of the rectangle. + */ constructor(width: number, height: number); + /** + * Create a rectangle which will surround a model. + * + * Example: + * ``` + * var e = new makerjs.models.Ellipse(17, 10); // draw an ellipse so we have something to surround. + * var r = new makerjs.models.Rectangle(e, 3); // draws a rectangle surrounding the ellipse by 3 units. + * ``` + * + * @param modelToSurround IModel object. + * @param margin Optional distance from the model. + */ + constructor(modelToSurround: IModel, margin?: number); + /** + * Create a rectangle from a measurement. + * + * Example: + * ``` + * var e = new makerjs.models.Ellipse(17, 10); // draw an ellipse so we have something to measure. + * var m = makerjs.measure.modelExtents(e); // measure the ellipse. + * var r = new makerjs.models.Rectangle(m); // draws a rectangle surrounding the ellipse. + * ``` + * + * @param measurement IMeasure object. See http://microsoft.github.io/maker.js/docs/api/modules/makerjs.measure.html#pathextents and http://microsoft.github.io/maker.js/docs/api/modules/makerjs.measure.html#modelextents to get measurements of paths and models. + */ + constructor(measurement: IMeasure); } } declare namespace MakerJs.models { @@ -1375,11 +2151,13 @@ declare namespace MakerJs.models { class Slot implements IModel { paths: IPathMap; origin: IPoint; - constructor(origin: IPoint, endPoint: IPoint, radius: number); + models: IModelMap; + constructor(origin: IPoint, endPoint: IPoint, radius: number, isolateCaps?: boolean); } } declare namespace MakerJs.models { - class Square extends Rectangle { + class Square implements IModel { + paths: IPathMap; constructor(side: number); } } @@ -1390,3 +2168,9 @@ declare namespace MakerJs.models { static InnerRadiusRatio(numberOfPoints: number, skipPoints: number): number; } } +declare namespace MakerJs.models { + class Text implements IModel { + models: IModelMap; + constructor(font: opentypejs.Font, text: string, fontSize: number, combine?: boolean); + } +} diff --git a/marker-animate-unobtrusive/marker-animate-unobtrusive-amd-tests.ts b/marker-animate-unobtrusive/marker-animate-unobtrusive-amd-tests.ts new file mode 100644 index 0000000000..544c95af5a --- /dev/null +++ b/marker-animate-unobtrusive/marker-animate-unobtrusive-amd-tests.ts @@ -0,0 +1,8 @@ +/// +/// + +import SlidingMarker = require('SlidingMarker'); +import MarkerWithGhost = require('MarkerWithGhost'); + +SlidingMarker.initializeGlobally(); +MarkerWithGhost.initializeGlobally(); diff --git a/marker-animate-unobtrusive/marker-animate-unobtrusive-tests.ts b/marker-animate-unobtrusive/marker-animate-unobtrusive-tests.ts new file mode 100644 index 0000000000..73ad4da4b5 --- /dev/null +++ b/marker-animate-unobtrusive/marker-animate-unobtrusive-tests.ts @@ -0,0 +1,50 @@ +/// +/// + +function test_init() { + SlidingMarker.initializeGlobally(); + MarkerWithGhost.initializeGlobally(); +} + +function test_options() { + var options: SlidingMarkerOptions = { + position: new google.maps.LatLng(0, 0), + easing: "easeInOutSine", + duration: 1000, + animateFunctionAdapter: (marker, destPoint, easing, duration) => {} + }; + var m = new SlidingMarker(options); + var g = new MarkerWithGhost(options); +} + +function test_sliding_marker() { + let googleMarker: google.maps.Marker; + let p: google.maps.LatLng; + let d: number; + let e:jQuery.easing.IEasingType; + + var m = new SlidingMarker(); + googleMarker = m; + + p = m.getPosition(); + m.setDuration(d); + d = m.getDuration(); + m.setEasing(e); + e = m.getEasing(); + p = m.getAnimationPosition(); + m.setPositionNotAnimated(p); +} + +function test_marker_with_ghost() { + let p: google.maps.LatLng; + let d: number; + let e:jQuery.easing.IEasingType; + let slidingMarker: SlidingMarker; + + var g = new MarkerWithGhost(); + slidingMarker = g; + + g.setGhostPosition(p); + p = g.getGhostPosition(); + p = g.getGhostAnimationPosition(); +} diff --git a/marker-animate-unobtrusive/marker-animate-unobtrusive.d.ts b/marker-animate-unobtrusive/marker-animate-unobtrusive.d.ts new file mode 100644 index 0000000000..61a4a680df --- /dev/null +++ b/marker-animate-unobtrusive/marker-animate-unobtrusive.d.ts @@ -0,0 +1,72 @@ +// Type definitions for marker-animate-unobtrusive 0.2.8 +// Project: https://github.com/terikon/marker-animate-unobtrusive +// Definitions by: Roman Viskin +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare namespace jQuery.easing { + type IEasingType = + 'swing' | + 'easeInQuad' | + 'easeOutQuad' | + 'easeInOutQuad' | + 'easeInCubic' | + 'easeOutCubic' | + 'easeInOutCubic' | + 'easeInQuart' | + 'easeOutQuart' | + 'easeInOutQuart' | + 'easeInQuint' | + 'easeOutQuint' | + 'easeInOutQuint' | + 'easeInSine' | + 'easeOutSine' | + 'easeInOutSine' | + 'easeInExpo' | + 'easeOutExpo' | + 'easeInOutExpo' | + 'easeInCirc' | + 'easeOutCirc' | + 'easeInOutCirc' | + 'easeInElastic' | + 'easeOutElastic' | + 'easeInOutElastic' | + 'easeInBack' | + 'easeOutBack' | + 'easeInOutBack' | + 'easeInBounce' | + 'easeOutBounce' | + 'easeInOutBounce'; +} + +interface SlidingMarkerOptions extends google.maps.MarkerOptions { + easing?: jQuery.easing.IEasingType, + duration?: number, + animateFunctionAdapter?: (marker: google.maps.Marker, destPoint: google.maps.LatLng, easing: 'linear' | jQuery.easing.IEasingType, duration: number) => void +} + +declare class SlidingMarker extends google.maps.Marker { + static initializeGlobally(): void; + constructor(opts?: SlidingMarkerOptions); + setDuration(duration: number): void; + getDuration(): number; + setEasing(easing: jQuery.easing.IEasingType): void; + getEasing(): jQuery.easing.IEasingType; + getAnimationPosition(): google.maps.LatLng; + setPositionNotAnimated(position: google.maps.LatLng | google.maps.LatLngLiteral): void; +} + +declare class MarkerWithGhost extends SlidingMarker { + setGhostPosition(ghostPosition: google.maps.LatLng | google.maps.LatLngLiteral): void; + getGhostPosition(): google.maps.LatLng; + getGhostAnimationPosition(): google.maps.LatLng; +} + +declare module "SlidingMarker" { + export = SlidingMarker; +} + +declare module "MarkerWithGhost" { + export = MarkerWithGhost; +} diff --git a/match-media-mock/match-media-mock-tests.ts b/match-media-mock/match-media-mock-tests.ts new file mode 100644 index 0000000000..613996f361 --- /dev/null +++ b/match-media-mock/match-media-mock-tests.ts @@ -0,0 +1,15 @@ +/// + +import { create } from "match-media-mock"; + +const matchMediaMock = create(); +matchMediaMock.setConfig({type: 'screen', width: 1200}) + +matchMediaMock('(max-width: 991px)').matches // false +matchMediaMock('(max-width: 1240px)').matches // true + +const mediaQueryList = matchMediaMock('(max-width: 991px)'); +const listener = (mql: MediaQueryList) => { }; + +mediaQueryList.addListener(listener) +mediaQueryList.removeListener(listener) diff --git a/match-media-mock/match-media-mock.d.ts b/match-media-mock/match-media-mock.d.ts new file mode 100644 index 0000000000..7e7161c8cb --- /dev/null +++ b/match-media-mock/match-media-mock.d.ts @@ -0,0 +1,35 @@ +// Type definitions for match-media-mock 0.1.0 +// Project: https://github.com/azazdeaz/match-media-mock +// Definitions by: Alexey Svetliakov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module "match-media-mock" { + /** + * Mock configuration options + */ + interface ConfigOptions { + /** + * Screen type + */ + type?: string; + /** + * Screen height + */ + height?: number; + /** + * Screen width + */ + width?: number; + } + interface MatchMediaMock { + /** + * Set configuration + */ + setConfig(config: ConfigOptions): void; + /** + * Execute query based on provided configuration + */ + (query: string): MediaQueryList; + } + export function create(): MatchMediaMock; +} diff --git a/material-ui/legacy/material-ui-0.14.4-tests.tsx b/material-ui/legacy/material-ui-0.14.4-tests.tsx new file mode 100644 index 0000000000..0d112fcaa8 --- /dev/null +++ b/material-ui/legacy/material-ui-0.14.4-tests.tsx @@ -0,0 +1,2302 @@ +/// +/// +/// + +import * as React from "react"; +import * as LinkedStateMixin from "react-addons-linked-state-mixin"; +import * as MaterialUi from "material-ui"; +import ActionGrade from "material-ui/lib/svg-icons/action/grade"; +import AppBar from "material-ui/lib/app-bar"; +import ArrowDropRight from "material-ui/lib/svg-icons/navigation-arrow-drop-right"; +import AutoComplete from 'material-ui/lib/auto-complete'; +import Avatar from "material-ui/lib/avatar"; +import Badge from "material-ui/lib/badge"; +import Card from "material-ui/lib/card/card"; +import CardActions from "material-ui/lib/card/card-actions"; +import CardHeader from "material-ui/lib/card/card-header"; +import CardMedia from 'material-ui/lib/card/card-media'; +import CardText from "material-ui/lib/card/card-text"; +import CardTitle from 'material-ui/lib/card/card-title'; +import Checkbox from "material-ui/lib/checkbox"; +import CircularProgress from 'material-ui/lib/circular-progress'; +import ColorManipulator from 'material-ui/lib/utils/color-manipulator'; +import Colors from "material-ui/lib/styles/colors"; +import DatePicker from "material-ui/lib/date-picker/date-picker"; +import Dialog from "material-ui/lib/dialog"; +import Divider from 'material-ui/lib/divider'; +import DropDownMenu from "material-ui/lib/drop-down-menu"; +import FileFolder from "material-ui/lib/svg-icons/file/folder"; +import FlatButton from "material-ui/lib/flat-button"; +import FloatingActionButton from "material-ui/lib/floating-action-button"; +import FontIcon from "material-ui/lib/font-icon"; +import GridList from 'material-ui/lib/grid-list/grid-list'; +import GridTile from 'material-ui/lib/grid-list/grid-tile'; +import IconButton from "material-ui/lib/icon-button"; +import IconMenu from "material-ui/lib/menus/icon-menu"; +import LeftNav from 'material-ui/lib/left-nav'; +import LinearProgress from 'material-ui/lib/linear-progress'; +import List from 'material-ui/lib/lists/list'; +import ListItem from 'material-ui/lib/lists/list-item'; +import Menu from 'material-ui/lib/menus/menu'; +import MenuItem from 'material-ui/lib/menus/menu-item'; +import Paper from 'material-ui/lib/paper'; +import Popover from 'material-ui/lib/popover/popover'; +import PopoverAnimationFromTop from 'material-ui/lib/popover/popover-animation-from-top'; +import RadioButton from "material-ui/lib/radio-button"; +import RadioButtonGroup from "material-ui/lib/radio-button-group"; +import RaisedButton from "material-ui/lib/raised-button"; +import RefreshIndicator from 'material-ui/lib/refresh-indicator'; +import SelectField from "material-ui/lib/select-field"; +import Slider from 'material-ui/lib/slider'; +import Snackbar from 'material-ui/lib/snackbar'; +import Spacing from "material-ui/lib/styles/spacing"; +import Styles from 'material-ui/lib/styles'; +import SvgIcon from 'material-ui/lib/svg-icon'; +import Tab from 'material-ui/lib/tabs/tab'; +import Table from 'material-ui/lib/table/table'; +import TableBody from 'material-ui/lib/table/table-body'; +import TableFooter from 'material-ui/lib/table/table-footer'; +import TableHeader from 'material-ui/lib/table/table-header'; +import TableHeaderColumn from 'material-ui/lib/table/table-header-column'; +import TableRow from 'material-ui/lib/table/table-row'; +import TableRowColumn from 'material-ui/lib/table/table-row-column'; +import Tabs from 'material-ui/lib/tabs/tabs'; +import TextField from "material-ui/lib/text-field"; +import ThemeDecorator from 'material-ui/lib/styles/theme-decorator'; +import ThemeManager from 'material-ui/lib/styles/theme-manager'; +import TimePicker from "material-ui/lib/time-picker"; +import Toggle from "material-ui/lib/toggle"; +import ToggleStar from "material-ui/lib/svg-icons/toggle/star"; +import ToggleStarBorder from "material-ui/lib/svg-icons/toggle/star-border"; +import Toolbar from 'material-ui/lib/toolbar/toolbar'; +import ToolbarGroup from 'material-ui/lib/toolbar/toolbar-group'; +import ToolbarSeparator from 'material-ui/lib/toolbar/toolbar-separator'; +import ToolbarTitle from 'material-ui/lib/toolbar/toolbar-title'; +import Typography from "material-ui/lib/styles/typography"; +import zIndex from 'material-ui/lib/styles/zIndex'; + +import {SelectableContainerEnhance} from 'material-ui/lib/hoc/selectable-enhance'; + +import * as Icons from "material-ui/lib/svg-icons"; +import ActionAndroid from 'material-ui/lib/svg-icons/action/android'; +import ActionFavorite from 'material-ui/lib/svg-icons/action/favorite'; +import ActionFavoriteBorder from 'material-ui/lib/svg-icons/action/favorite-border'; +import ActionFlightTakeoff from 'material-ui/lib/svg-icons/action/flight-takeoff'; +import ActionHome from 'material-ui/lib/svg-icons/action/home'; +import ActionInfo from 'material-ui/lib/svg-icons/action/info'; +import CommunicationChatBubble from 'material-ui/lib/svg-icons/communication/chat-bubble'; +import ContentAdd from 'material-ui/lib/svg-icons/content/add'; +import ContentCopy from 'material-ui/lib/svg-icons/content/content-copy'; +import ContentDrafts from 'material-ui/lib/svg-icons/content/drafts'; +import ContentFilter from 'material-ui/lib/svg-icons/content/filter-list'; +import ContentInbox from 'material-ui/lib/svg-icons/content/inbox'; +import ContentLink from 'material-ui/lib/svg-icons/content/link'; +import ContentSend from 'material-ui/lib/svg-icons/content/send'; +import Delete from 'material-ui/lib/svg-icons/action/delete'; +import Download from 'material-ui/lib/svg-icons/file/file-download'; +import FileCloudDownload from 'material-ui/lib/svg-icons/file/cloud-download'; +import FolderIcon from 'material-ui/lib/svg-icons/file/folder-open'; +import HardwareVideogameAsset from 'material-ui/lib/svg-icons/hardware/videogame-asset'; +import MapsPlace from 'material-ui/lib/svg-icons/maps/place'; +import MoreVertIcon from 'material-ui/lib/svg-icons/navigation/more-vert'; +import NavigationClose from "material-ui/lib/svg-icons/navigation/close"; +import NavigationExpandMoreIcon from 'material-ui/lib/svg-icons/navigation/expand-more'; +import NotificationsIcon from 'material-ui/lib/svg-icons/social/notifications'; +import PersonAdd from 'material-ui/lib/svg-icons/social/person-add'; +import RemoveRedEye from 'material-ui/lib/svg-icons/image/remove-red-eye'; +import StarBorder from 'material-ui/lib/svg-icons/toggle/star-border'; +import UploadIcon from 'material-ui/lib/svg-icons/file/cloud-upload'; + + +type CheckboxProps = __MaterialUI.CheckboxProps; +type MuiTheme = __MaterialUI.Styles.MuiTheme; +type TouchTapEvent = __MaterialUI.TouchTapEvent; + +interface MaterialUiTestsState { + showDialogStandardActions: boolean; + showDialogCustomActions: boolean; + showDialogScrollable: boolean; + value: number; + dataSource: [string]; + minDate: Date; + maxDate: Date; + autoOk: boolean; + disableYearSelection: boolean; + open: boolean; + valueSingle: string; + valueMultiple: string[]; + anchorEl: Element; + completed: number; + message: string; + autoHideDuration: number; + fixedHeader: boolean; + fixedFooter: boolean; + stripedRows: boolean; + showRowHover: boolean; + selectable: boolean; + multiSelectable: boolean; + enableSelectAll: boolean; + deselectOnClickaway: boolean; + height: string; +} + +// "http://www.material-ui.com/#/customization/themes" +let muiTheme: MuiTheme = ThemeManager.getMuiTheme({ + spacing: Spacing, + zIndex: zIndex, + fontFamily: 'Roboto, sans-serif', + palette: { + primary1Color: Colors.cyan500, + primary2Color: Colors.cyan700, + primary3Color: Colors.lightBlack, + accent1Color: Colors.pinkA200, + accent2Color: Colors.grey100, + accent3Color: Colors.grey500, + textColor: Colors.darkBlack, + alternateTextColor: Colors.white, + canvasColor: Colors.white, + borderColor: Colors.grey300, + disabledColor: ColorManipulator.fade(Colors.darkBlack, 0.3), + pickerHeaderColor: Colors.cyan500, + } +}); + +let SelectableList = SelectableContainerEnhance(List); + +@ThemeDecorator(muiTheme) +class MaterialUiTests extends React.Component<{}, MaterialUiTestsState> implements React.LinkedStateMixin { + + // injected with mixin + linkState: (key: string) => React.ReactLink; + + private picker12hr: TimePicker; + private picker24hr: TimePicker; + + private touchTapEventHandler(e: TouchTapEvent) { + console.info("Received touch tap", e); + } + private formEventHandler(e: React.FormEvent) { + } + private selectFieldChangeHandler(e: TouchTapEvent, si: number, mi: any) { + } + private handleRequestClose(buttonClicked: boolean) { + } + private handleRequestCloseReason(reason: string) { + } + private handleToggle() { + this.setState(Object.assign({}, this.state, { open: !this.state.open })); + } + private handleClose() { + this.setState(Object.assign({}, this.state, { open: false })); + } + private handleChangeSingle(event: React.MouseEvent, value: string){ + } + private handleChangeMultiple(event: React.MouseEvent, value: string[]) { + } + + private handleChange = (e: TouchTapEvent, index: number, value: number) => this.setState(Object.assign({}, this.state, { value })); + + private handleUpdateInput(t: string) { + this.setState(Object.assign({}, this.state, { + dataSource: [t, t + t, t + t + t], + })); + } + private handleTouchTap(e: TouchTapEvent) { + alert('onTouchTap triggered on the title component'); + } + private handleActionTouchTap() { + this.setState(Object.assign({}, this.state, {open: false,})); + alert('Event removed from your calendar.'); + } + private handleChangeDuration = (event: React.FormEvent) => { + const value = event.target["value"]; + this.setState(Object.assign({}, this.state, { + autoHideDuration: value.length > 0 ? parseInt(value) : 0, + })); + } + private onRowSelection(selectedRows: number[] | string) { + } + private handleActive(tab: Tab) { + alert(`A tab with this route property ${tab.props.value} was activated.`); + } + private handleChangeTabs(value: any, e: React.FormEvent, tab: Tab) { + } + private handleChangeTimePicker12(err, time) { + this.picker12hr.setTime(time); + }; + + private handleChangeTimePicker24(err, time) { + this.picker24hr.setTime(time); + }; + + render() { + + const styles = { + title: { + cursor: 'pointer', + }, + exampleImageInput: { + cursor: 'pointer', + position: 'absolute', + top: 0, + bottom: 0, + right: 0, + left: 0, + width: '100%', + opacity: 0, + }, + button: { + margin: 12, + }, + floatingButton: { + marginRight: 20, + }, + textField: { + marginLeft: 20, + }, + floatLeft: { + float: 'left', + }, + root: { + display: 'flex', + flexWrap: 'wrap', + justifyContent: 'space-around', + }, + gridList: { + width: 500, + height: 400, + overflowY: 'auto', + marginBottom: 24, + }, + icons: { + marginRight: 24, + }, + menu: { + marginRight: 32, + marginBottom: 32, + float: 'left', + position: 'relative', + zIndex: 0, + }, + rightIcon: { + textAlign: 'center', + lineHeight: '24px', + }, + paper: { + height: 100, + width: 100, + margin: 20, + textAlign: 'center', + display: 'inline-block', + }, + popover: { + padding: 20, + }, + container: { + position: 'relative', + }, + refresh: { + display: 'inline-block', + position: 'relative', + }, + block: { + maxWidth: 250, + }, + checkbox: { + marginBottom: 16, + }, + radioButton: { + marginBottom: 16, + }, + toggle: { + marginBottom: 16, + }, + propContainerStyle: { + width: 200, + overflow: 'hidden', + margin: '20px auto 0', + }, + propToggleHeader: { + margin: '20px auto 10px', + }, + headline: { + fontSize: 24, + paddingTop: 16, + marginBottom: 12, + fontWeight: 400, + }, + errorStyle: { + color: Colors.orange500, + }, + underlineStyle: { + borderColor: Colors.orange500, + }, + }; + const colors = Styles.Colors; + + // "http://www.material-ui.com/#/customization/inline-styles" + let element: React.ReactElement; + element = + element = React.createElement(Checkbox, { + id: "checkboxId1", name: "checkboxName1", value: "checkboxValue1", label: "went for a run today", style: { + width: '50%', + margin: '0 auto' + }, iconStyle: { + fill: '#FF4081' + } + }); + + // "http://www.material-ui.com/#/components/app-bar" + const AppBarExampleIcon = () => ( + + ); + + const AppBarExampleIconButton = () => ( + Title} + onTitleTouchTap={this.handleTouchTap} + iconElementLeft={} + iconElementRight={} + /> + ); + const AppBarExampleIconMenu = () => ( + } + iconElementRight={ + + } + targetOrigin={{ horizontal: 'right', vertical: 'top' }} + anchorOrigin={{ horizontal: 'right', vertical: 'top' }} + > + + + + + } + /> + ); + + // "http://www.material-ui.com/#/components/auto-complete" + element = + + const dataSource1 = [ + { + text: 'text-value1', + value: ( + + ), + }, + { + text: 'text-value2', + value: ( + + ), + }, + ]; + + const dataSource2 = ['12345', '23456', '34567']; + + const AutoCompleteExampleNoFilter = () => ( +
      +
      + +
      + ); + + const AutoCompleteExampleFilters = () => ( +
      + +
      + +
      + ); + + // "http://www.material-ui.com/#/components/avatar" + const AvatarExampleSimple = () => ( + + + } + > + Image Avatar + + } /> + } + > + FontIcon Avatar + + } + color={colors.blue300} + backgroundColor={colors.indigo900} + /> + } + > + FontIcon Avatar with custom colors + + } /> + } + > + SvgIcon Avatar + + } + color={colors.orange200} + backgroundColor={colors.pink400} + /> + } + > + SvgIcon Avatar with custom colors + + A} + > + Letter Avatar + + + A + + } + > + Letter Avatar with custom colors + + + ); + + //image avatar + element = ; + //SvgIcon avatar + element = } />; + //SvgIcon avatar with custom colors + element = } + color={Colors.orange200} + backgroundColor={Colors.pink400} />; + //FontIcon avatar + element = + } />; + //FontIcon avatar with custom colors + element = } + color={Colors.blue300} + backgroundColor={Colors.indigo900} />; + //Letter avatar + element = A; + //Letter avatar with custom colors + element = + + + // "http://www.material-ui.com/#/components/badge" + const BadgeExampleSimple = () => ( +
      + + + + + + + + +
      + ); + const BadgeExampleContent = () => ( +
      + } + > + + + + Company Name + +
      + ); + + // "http://www.material-ui.com/#/components/flat-button" + const FlatButtonExampleSimple = () => ( +
      + + + + +
      + ); + const FlatButtonExampleComplex = () => ( +
      + + + + + } + /> + + } + /> + +
      + ); + + // "http://www.material-ui.com/#/components/raised-button" + const RaisedButtonExampleSimple = () => ( +
      + + + + +
      + ); + const RaisedButtonExampleComplex = () => ( +
      + + + + } + style={styles.button} + /> + } + /> +
      + ); + + // "http://www.material-ui.com/#/components/floating-action-button" + const FloatingActionButtonExampleSimple = () => ( +
      + + + + + + + + + + + + + + + + + + + + + + + +
      + ); + + // "http://www.material-ui.com/#/components/icon-button" + const IconButtonExampleSimple = () => ( +
      + + +
      + ); + const IconButtonExampleComplex = () => ( +
      + + + + + + + + + + home + +
      + ); + const IconButtonExampleTooltip = () => ( +
      + + + + + + +
      + ); + const IconButtonExampleTouch = () => ( +
      + + + + + + + + + + + + + + + + + + +
      + ); + //Method 1: muidocs-icon-github is defined in a style sheet. + element = ; + //Method 2: ActionGrade is a component created using mui.SvgIcon. + element = + + ; + //Method 3: Manually creating a mui.FontIcon component within IconButton + element = + + ; + //Method 4: Using Google material-icons + element = settings_system_daydream; + + + // "http://www.material-ui.com/#/components/card" + const CardExampleWithAvatar = () => ( + + + } + > + + + + + Lorem ipsum dolor sit amet, consectetur adipiscing elit. + Donec mattis pretium massa.Aliquam erat volutpat.Nulla facilisi. + Donec vulputate interdum sollicitudin.Nunc lacinia auctor quam sed pellentesque. + Aliquam dui mauris, mattis quis lacus id, pellentesque lobortis odio. + + + + + + + ); + const CardExampleWithoutAvatar = () => ( + + + + Lorem ipsum dolor sit amet, consectetur adipiscing elit. + Donec mattis pretium massa.Aliquam erat volutpat.Nulla facilisi. + Donec vulputate interdum sollicitudin.Nunc lacinia auctor quam sed pellentesque. + Aliquam dui mauris, mattis quis lacus id, pellentesque lobortis odio. + + + + + + + ); + + // "http://www.material-ui.com/#/components/date-picker" + const DatePickerExampleSimple = () => ( +
      + + + +
      + ); + const DatePickerExampleInline = () => ( +
      + + +
      + ); + element = ( +
      + +
      + ); + element = ; + element = ; + element = ; + + // "http://material-ui.com/#/components/dialog" + let standardActions = [ + { text: 'Cancel' }, + { text: 'Submit', onTouchTap: this.touchTapEventHandler, ref: 'submit' } + ]; + + element = + The actions in this window are created from the json that's passed in. + ; + + //Custom Actions + let customActions = [ + , + + ]; + + element = + The actions in this window were passed in as an array of react objects. + ; + + element = +
      + Really long content +
      +
      ; + + // "http://www.material-ui.com/#/components/divider" + const DividerExampleForm = () => ( + + + + + + + + + + + ); + const DividerExampleList = () => ( +
      + + + + + + + + + +
      + ); + const DividerExampleMenu = () => ( + + + + + + + ); + + + // "http://www.material-ui.com/#/components/grid-list" + const tilesData = [ + { + img: 'images/grid-list/00-52-29-429_640.jpg', + title: 'Breakfast', + author: 'jill111', + featured: false, + }]; + const GridListExampleSimple = () => ( +
      + + {tilesData.map(tile => ( + by {tile.author}} + actionIcon={} + > + + + )) } + +
      + ); + const GridListExampleComplex = () => ( +
      + + {tilesData.map(tile => ( + } + actionPosition="left" + titlePosition="top" + titleBackground="linear-gradient(to bottom, rgba(0,0,0,0.7) 0%,rgba(0,0,0,0.3) 70%,rgba(0,0,0,0) 100%)" + cols={tile.featured ? 2 : 1} + rows={tile.featured ? 2 : 1} + > + + + )) } + +
      + ); + + + element = ; + + element = GridTile} + actionPosition="left" + titlePosition="top" + titleBackground="rgba(0, 0, 0, 0.4)" + cols={2} + rows={1} + style={{ color: 'red' }}> +

      Children are Required!

      +
      ; + + + // "http://www.material-ui.com/#/components/font-icon" + const FontIconExampleSimple = () => ( +
      + + + + + +
      + ); + + const FontIconExampleIcons = () => ( +
      + home + flight_takeoff + cloud_download + videogame_asset +
      + ); + + + // "http://www.material-ui.com/#/components/svg-icon" + const HomeIcon = (props) => ( + + + + ); + + const SvgIconExampleSimple = () => ( +
      + + + +
      + ); + const SvgIconExampleIcons = () => ( +
      + + + + +
      + ); + element = ; + element = ; + element = home; + + + // "http://www.material-ui.com/#/components/left-nav" + element = ( +
      + + + Menu Item + Menu Item 2 + +
      + ); + element = ( +
      + + this.setState(Object.assign({}, this.state, { open })) } + > + Menu Item + Menu Item 2 + +
      + ); + element = ( +
      + + + + +
      + ); + + + // "http://material-ui.com/#/components/lists" + const ListExampleSimple = () => ( +
      + + } /> + } /> + } /> + } /> + } /> + + + + } /> + } /> + } /> + } /> + +
      + ); + const ListExampleChat = () => ( +
      + + } + rightIcon={} + /> + } + rightIcon={} + /> + } + rightIcon={} + /> + } + rightIcon={} + /> + } + rightIcon={} + /> + + + + } + /> + } + /> + +
      + ); + const ListExampleNested = () => ( +
      + + } /> + } /> + } + initiallyOpen={true} + primaryTogglesNestedList={true} + nestedItems={[ + } + />, + } + disabled={true} + nestedItems={[ + } />, + ]} + />, + ]} + /> + +
      + ); + const iconButtonElement = ( + + + + ); + const rightIconMenu = ( + + Reply + Forward + Delete + + ); + const ListExampleMessages = () => ( +
      + + } + rightIconButton={rightIconMenu} + primaryText="Brendan Lim" + secondaryText={ +

      + Brunch this weekend?
      + I' ll be in your neighborhood doing errands this weekend.Do you want to grab brunch? +

      + } + secondaryTextLines={2} + /> +
      +
      + ); + const ListExampleSelectable = () => ( +
      + + } + nestedItems={[ + } + />, + ]} + /> + } + /> + } + /> + } + /> + +
      + ); + + + // "http://www.material-ui.com/#/components/menu" + const MenuExampleSimple = () => ( +
      + + + + + + + + + + + + +
      + ); + const MenuExampleDisable = () => ( +
      + + + + + + + + + + + + + + + + +
      + ); + const MenuExampleIcons = () => ( +
      + + } /> + } /> + } /> + + } /> + } /> + + } /> + + + + } /> + settings}/> + settings + } + /> + ¶} /> + §} /> + +
      + ); + const MenuExampleSecondary = () => ( +
      + + + + + + + + + } /> + } /> + } /> + } /> + } /> + + + + + + + + + + + + + +
      + ); + const MenuExampleNested = () => ( +
      + + + + + } + menuItems={[ + } + menuItems={[ + , + , + , + , + ]} + />, + , + , + , + ]} + /> + + + + + + +
      + ); + + + // "http://www.material-ui.com/#/components/icon-menu" + const IconMenuExampleSimple = () => ( +
      + } + anchorOrigin={{ horizontal: 'left', vertical: 'top' }} + targetOrigin={{ horizontal: 'left', vertical: 'top' }} + > + + + + + + + } + anchorOrigin={{ horizontal: 'left', vertical: 'bottom' }} + targetOrigin={{ horizontal: 'left', vertical: 'bottom' }} + > + + + + + + + } + anchorOrigin={{ horizontal: 'right', vertical: 'bottom' }} + targetOrigin={{ horizontal: 'right', vertical: 'bottom' }} + > + + + + + + + } + anchorOrigin={{ horizontal: 'right', vertical: 'top' }} + targetOrigin={{ horizontal: 'right', vertical: 'top' }} + > + + + + + + +
      + ); + element = ( +
      + } + onChange={this.handleChangeSingle} + value={this.state.valueSingle} + > + + + + + + + } + onChange={this.handleChangeMultiple} + value={this.state.valueMultiple} + multiple={true} + > + + + + + + + +
      + ); + const IconMenuExampleScrollable = () => ( +
      } + anchorOrigin={{ horizontal: 'left', vertical: 'top' }} + targetOrigin={{ horizontal: 'left', vertical: 'top' }} + maxHeight={272} + > + + + + ); + + + // "http://www.material-ui.com/#/components/dropdown-menu" + element = + + + + + + ; + const menuItems = []; + element = ( + + {menuItems} + + ); + element = ( + + + + + + + ); + + // "http://material-ui.com/#/components/paper" + const PaperExampleSimple = () => ( +
      + + + + + +
      + ); + const PaperExampleRounded = () => ( +
      + + + + + +
      + ); + const PaperExampleCircle = () => ( +
      + + + + + +
      + ); + + + // "http://www.material-ui.com/#/components/popover" + element = ( +
      + + +
      + +
      +
      +
      + ); + element = ( +
      + + +
      + +
      +
      +
      + ); + + + // "http://www.material-ui.com/#/components/circular-progress" + const CircularProgressExampleSimple = () => ( +
      + + + +
      + ); + element = ( +
      + + + +
      + ); + + + // "http://www.material-ui.com/#/components/linear-progress" + const LinearProgressExampleSimple = () => ( + + ); + element = ( + + ); + + + // "http://www.material-ui.com/#/components/refresh-indicator" + const RefreshIndicatorExampleSimple = () => ( +
      + + + + +
      + ); + const RefreshIndicatorExampleLoading = () => ( +
      + + +
      + ); + + + // "http://www.material-ui.com/#/components/select-field" + element = ( +
      + + + + + + + +
      + + + + +
      + ); + element = ( + + {menuItems} + + ); + element = ( + + + + + + + ); + element = ( +
      + + {menuItems} + +
      + + {menuItems} + +
      + ); + const {value} = this.state; + const night = value === 2 || value === 3; + element = ( +
      + + {menuItems} + +
      + + {menuItems} + +
      + ); + + + // "http://www.material-ui.com/#/components/slider" + const SliderExampleSimple = () => ( +
      + + + +
      + ); + const SliderExampleDisabled = () => ( +
      + + + +
      + ); + const SliderExampleStep = () => ( + + ); + + + // "http://www.material-ui.com/#/components/checkbox" + const CheckboxExampleSimple = () => ( +
      + + + + } + unCheckedIcon={} + label="Custom icon" + style={styles.checkbox} + /> + +
      + ); + + + // "http://www.material-ui.com/#/components/radio-button" + const RadioButtonExampleSimple = () => ( +
      + + + + + + + + + +
      + ); + + + // "http://www.material-ui.com/#/components/toggle" + const ToggleExampleSimple = () => ( +
      + + + + +
      + ); + + + // "http://material-ui.com/#/components/snackbar" + element = ( +
      + + +
      + ); + element = ( +
      + +
      + + +
      + ); + + // "http://www.material-ui.com/#/components/table" + element = ( + + + + ID + Name + Status + + + + + 1 + John Smith + Employed + + + 2 + Randal White + Unemployed + + + 3 + Stephanie Sanders + Employed + + + 4 + Steve Brown + Employed + + +
      + ); + const tableData = [ + { + name: 'John Smith', + status: 'Employed', + selected: true, + }, + ]; + element = ( +
      + + + + + Super Header + + + + ID + Name + Status + + + + {tableData.map( (row, index) => ( + + {index} + {row.name} + {row.status} + + ))} + + + + ID + Name + Status + + + + Super Footer + + + +
      + +
      +

      Table Properties

      + + + + + + +

      TableBody Properties

      + + + +
      +
      + ); + + // "http://www.material-ui.com/#/components/tabs" + const TabsExampleSimple = () => ( + + +
      +

      Tab One

      +

      + This is an example tab. +

      +

      + You can put any sort of HTML or react component in here. It even keeps the component state! +

      + +
      +
      + +
      +

      Tab Two

      +

      + This is another example tab. +

      +
      +
      + +
      +

      Tab Three

      +

      + This is a third example tab. +

      +
      +
      +
      + ); + element = ( + + +
      +

      Controllable Tab A

      +

      + Tabs are also controllable if you want to programmatically pass them their values. + This allows for more functionality in Tabs such as not + having any Tab selected or assigning them different values. +

      +
      +
      + +
      +

      Controllable Tab B

      +

      + This is another example of a controllable tab. Remember, if you + use controllable Tabs, you need to give all of your tabs values or else + you wont be able to select them. +

      +
      +
      +
      + ); + const TabsExampleIcon = () => ( + + } /> + } /> + favorite} /> + + ); + + // "http://www.material-ui.com/#/components/text-field" + const TextFieldExampleSimple = () => ( +
      +
      +
      +
      +
      +
      +
      +
      + +
      + ); + const TextFieldExampleError = () => ( +
      +
      +
      +
      +
      +
      + ); + const TextFieldExampleCustomize = () => ( +
      +
      +
      +
      + +
      + ); + const TextFieldExampleDisabled = () => ( +
      +
      +
      +
      + +
      + ); + element = ; + + + // "http://www.material-ui.com/#/components/time-picker" + const TimePickerExampleSimple = () => ( +
      + + +
      + ); + element = ( +
      + this.picker12hr = t} + format="ampm" + hintText="12hr Format" + onChange={this.handleChangeTimePicker12} + /> + this.picker24hr = t} + format="24hr" + hintText="24hr Format" + onChange={this.handleChangeTimePicker24} + /> +
      + ); + + // "http://www.material-ui.com/#/components/toolbar" + const ToolbarExamplesSimple = () => ( + + + + + + + + + + + + + + + + + + + } + > + + + + + + + + ); + + return element; + } +} diff --git a/material-ui/legacy/material-ui-0.14.4-tests.tsx.tscparams b/material-ui/legacy/material-ui-0.14.4-tests.tsx.tscparams new file mode 100644 index 0000000000..855355b85f --- /dev/null +++ b/material-ui/legacy/material-ui-0.14.4-tests.tsx.tscparams @@ -0,0 +1 @@ +--experimentalDecorators \ No newline at end of file diff --git a/material-ui/legacy/material-ui-0.14.4.d.ts b/material-ui/legacy/material-ui-0.14.4.d.ts new file mode 100644 index 0000000000..29eeb225bd --- /dev/null +++ b/material-ui/legacy/material-ui-0.14.4.d.ts @@ -0,0 +1,8246 @@ +// Type definitions for material-ui v0.14.4 +// Project: https://github.com/callemall/material-ui +// Definitions by: Nathan Brown , Oliver Herrmann +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module "material-ui" { + export import AppBar = __MaterialUI.AppBar; // require('material-ui/lib/app-bar'); + export import AppCanvas = __MaterialUI.AppCanvas; // require('material-ui/lib/app-canvas'); + export import AutoComplete = __MaterialUI.AutoComplete; // require('material-ui/lib/auto-complete'); + export import Avatar = __MaterialUI.Avatar; // require('material-ui/lib/avatar'); + export import Badge = __MaterialUI.Badge; // require('material-ui/lib/badge'); + export import BeforeAfterWrapper = __MaterialUI.BeforeAfterWrapper; // require('material-ui/lib/before-after-wrapper'); + export import Card = __MaterialUI.Card.Card; // require('material-ui/lib/card/card'); + export import CardActions = __MaterialUI.Card.CardActions; // require('material-ui/lib/card/card-actions'); + export import CardExpandable = __MaterialUI.Card.CardExpandable; // require('material-ui/lib/card/card-expandable'); + export import CardHeader = __MaterialUI.Card.CardHeader; // require('material-ui/lib/card/card-header'); + export import CardMedia = __MaterialUI.Card.CardMedia; // require('material-ui/lib/card/card-media'); + export import CardText = __MaterialUI.Card.CardText; // require('material-ui/lib/card/card-text'); + export import CardTitle = __MaterialUI.Card.CardTitle; // require('material-ui/lib/card/card-title'); + export import Checkbox = __MaterialUI.Checkbox; // require('material-ui/lib/checkbox'); + export import CircularProgress = __MaterialUI.CircularProgress; // require('material-ui/lib/circular-progress'); + export import ClearFix = __MaterialUI.ClearFix; // require('material-ui/lib/clearfix'); + export import DatePicker = __MaterialUI.DatePicker.DatePicker; // require('material-ui/lib/date-picker/date-picker'); + export import DatePickerDialog = __MaterialUI.DatePicker.DatePickerDialog; // require('material-ui/lib/date-picker/date-picker-dialog'); + export import Dialog = __MaterialUI.Dialog // require('material-ui/lib/dialog'); + export import Divider = __MaterialUI.Divider // require('material-ui/lib/divider'); + export import DropDownMenu = __MaterialUI.Menus.DropDownMenu; // require('material-ui/lib/DropDownMenu/DropDownMenu'); + export import EnhancedButton = __MaterialUI.EnhancedButton; // require('material-ui/lib/enhanced-button'); + export import FlatButton = __MaterialUI.FlatButton; // require('material-ui/lib/flat-button'); + export import FloatingActionButton = __MaterialUI.FloatingActionButton; // require('material-ui/lib/floating-action-button'); + export import FontIcon = __MaterialUI.FontIcon; // require('material-ui/lib/font-icon'); + export import GridList = __MaterialUI.GridList.GridList; // require('material-ui/lib/gridlist/grid-list'); + export import GridTile = __MaterialUI.GridList.GridTile; // require('material-ui/lib/gridlist/grid-tile'); + export import IconButton = __MaterialUI.IconButton; // require('material-ui/lib/icon-button'); + export import IconMenu = __MaterialUI.Menus.IconMenu; // require('material-ui/lib/menus/icon-menu'); + export import LeftNav = __MaterialUI.LeftNav; // require('material-ui/lib/left-nav'); + export import LinearProgress = __MaterialUI.LinearProgress; // require('material-ui/lib/linear-progress'); + export import List = __MaterialUI.Lists.List; // require('material-ui/lib/lists/list'); + export import ListDivider = __MaterialUI.Lists.ListDivider; // require('material-ui/lib/lists/list-divider'); + export import ListItem = __MaterialUI.Lists.ListItem; // require('material-ui/lib/lists/list-item'); + export import Menu = __MaterialUI.Menus.Menu; // require('material-ui/lib/menus/menu'); + export import MenuItem = __MaterialUI.Menus.MenuItem; // require('material-ui/lib/menus/menu-item'); + export import Mixins = __MaterialUI.Mixins; // require('material-ui/lib/mixins'); + export import Overlay = __MaterialUI.Overlay; // require('material-ui/lib/overlay'); + export import Paper = __MaterialUI.Paper; // require('material-ui/lib/paper'); + export import Popover = __MaterialUI.Popover.Popover; // require('material-ui/lib/popover/popover'); + export import RadioButton = __MaterialUI.RadioButton; // require('material-ui/lib/radio-button'); + export import RadioButtonGroup = __MaterialUI.RadioButtonGroup; // require('material-ui/lib/radio-button-group'); + export import RaisedButton = __MaterialUI.RaisedButton; // require('material-ui/lib/raised-button'); + export import RefreshIndicator = __MaterialUI.RefreshIndicator; // require('material-ui/lib/refresh-indicator'); + export import Ripples = __MaterialUI.Ripples; // require('material-ui/lib/ripples'); + export import SelectField = __MaterialUI.SelectField; // require('material-ui/lib/select-field'); + export import SelectableContainerEnhance = __MaterialUI.Hoc.SelectableContainerEnhance; // require('material-ui/lib/hoc/selectable-enhance'); + export import Slider = __MaterialUI.Slider; // require('material-ui/lib/slider'); + export import SvgIcon = __MaterialUI.SvgIcon; // require('material-ui/lib/svg-icon'); + export import Styles = __MaterialUI.Styles; // require('material-ui/lib/styles'); + export import Snackbar = __MaterialUI.Snackbar; // require('material-ui/lib/snackbar'); + export import Tab = __MaterialUI.Tabs.Tab; // require('material-ui/lib/tabs/tab'); + export import Tabs = __MaterialUI.Tabs.Tabs; // require('material-ui/lib/tabs/tabs'); + export import Table = __MaterialUI.Table.Table; // require('material-ui/lib/table/table'); + export import TableBody = __MaterialUI.Table.TableBody; // require('material-ui/lib/table/table-body'); + export import TableFooter = __MaterialUI.Table.TableFooter; // require('material-ui/lib/table/table-footer'); + export import TableHeader = __MaterialUI.Table.TableHeader; // require('material-ui/lib/table/table-header'); + export import TableHeaderColumn = __MaterialUI.Table.TableHeaderColumn; // require('material-ui/lib/table/table-header-column'); + export import TableRow = __MaterialUI.Table.TableRow; // require('material-ui/lib/table/table-row'); + export import TableRowColumn = __MaterialUI.Table.TableRowColumn; // require('material-ui/lib/table/table-row-column'); + export import Toggle = __MaterialUI.Toggle; // require('material-ui/lib/toggle'); + export import ThemeWrapper = __MaterialUI.ThemeWrapper; // require('material-ui/lib/theme-wrapper'); + export import TimePicker = __MaterialUI.TimePicker; // require('material-ui/lib/time-picker'); + export import TextField = __MaterialUI.TextField; // require('material-ui/lib/text-field'); + export import Toolbar = __MaterialUI.Toolbar.Toolbar; // require('material-ui/lib/toolbar/toolbar'); + export import ToolbarGroup = __MaterialUI.Toolbar.ToolbarGroup; // require('material-ui/lib/toolbar/toolbar-group'); + export import ToolbarSeparator = __MaterialUI.Toolbar.ToolbarSeparator; // require('material-ui/lib/toolbar/toolbar-separator'); + export import ToolbarTitle = __MaterialUI.Toolbar.ToolbarTitle; // require('material-ui/lib/toolbar/toolbar-title'); + export import Tooltip = __MaterialUI.Tooltip; // require('material-ui/lib/tooltip'); + export import Utils = __MaterialUI.Utils; // require('material-ui/lib/utils'); + + // svg icons + import NavigationMenu = __MaterialUI.SvgIcon; // require('material-ui/lib/svg-icon/navigation/menu'); + import NavigationChevronLeft = __MaterialUI.SvgIcon; // require('material-ui/lib/svg-icon/navigation/chevron-left'); + import NavigationChevronRight = __MaterialUI.SvgIcon; // require('material-ui/lib/svg-icon/navigation/chevron-right'); + + export const Icons: { + NavigationMenu: NavigationMenu, + NavigationChevronLeft: NavigationChevronLeft, + NavigationChevronRight: NavigationChevronRight, + }; + + // export type definitions + export type TouchTapEvent = __MaterialUI.TouchTapEvent; + export type TouchTapEventHandler = __MaterialUI.TouchTapEventHandler; + export type DialogAction = __MaterialUI.DialogAction; +} + +declare namespace __MaterialUI { + export import React = __React; + + // ReactLink is from "react/addons" + interface ReactLink { + value: T; + requestChange(newValue: T): void; + } + + // What's common between React.TouchEvent and React.MouseEvent + interface TouchTapEvent extends React.SyntheticEvent { + altKey: boolean; + ctrlKey: boolean; + getModifierState(key: string): boolean; + metaKey: boolean; + shiftKey: boolean; + } + + // What's common between React.TouchEventHandler and React.MouseEventHandler + interface TouchTapEventHandler extends React.EventHandler { } + + interface ThemeWrapperProps extends React.Props { + theme: Styles.MuiTheme; + } + export class ThemeWrapper extends React.Component { + } + + export namespace Styles { + interface AutoPrefix { + all(styles: React.CSSProperties): React.CSSProperties; + set(style: React.CSSProperties, key: string, value: string | number): void; + single(key: string): string; + singleHyphened(key: string): string; + } + export var AutoPrefix: AutoPrefix; + + interface Spacing { + iconSize?: number; + + desktopGutter?: number; + desktopGutterMore?: number; + desktopGutterLess?: number; + desktopGutterMini?: number; + desktopKeylineIncrement?: number; + desktopDropDownMenuItemHeight?: number; + desktopDropDownMenuFontSize?: number; + desktopLeftNavMenuItemHeight?: number; + desktopSubheaderHeight?: number; + desktopToolbarHeight?: number; + } + export var Spacing: Spacing; + + interface ThemePalette { + primary1Color?: string; + primary2Color?: string; + primary3Color?: string; + accent1Color?: string; + accent2Color?: string; + accent3Color?: string; + textColor?: string; + alternateTextColor?: string; + canvasColor?: string; + borderColor?: string; + disabledColor?: string; + pickerHeaderColor?: string; + clockCircleColor?: string; + shadowColor?: string; + } + interface MuiTheme { + isRtl?: boolean; + userAgent?: any; + zIndex?: zIndex; + baseTheme?: RawTheme; + rawTheme?: RawTheme; + appBar?: { + color?: string, + textColor?: string, + height?: number, + }; + avatar?: { + borderColor?: string, + } + badge?: { + color?: string, + textColor?: string, + primaryColor?: string, + primaryTextColor?: string, + secondaryColor?: string, + secondaryTextColor?: string, + }, + button?: { + height?: number, + minWidth?: number, + iconButtonSize?: number, + }, + cardText?: { + textColor?: string, + }, + checkbox?: { + boxColor?: string, + checkedColor?: string, + requiredColor?: string, + disabledColor?: string, + labelColor?: string, + labelDisabledColor?: string, + }, + datePicker?: { + color?: string, + textColor?: string, + calendarTextColor?: string, + selectColor?: string, + selectTextColor?: string, + }, + dropDownMenu?: { + accentColor?: string, + }, + flatButton?: { + color?: string, + buttonFilterColor?: string, + disabledColor?: string, + textColor?: string, + primaryTextColor?: string, + secondaryTextColor?: string, + }, + floatingActionButton?: { + buttonSize?: number, + miniSize?: number, + color?: string, + iconColor?: string, + secondaryColor?: string, + secondaryIconColor?: string, + disabledColor?: string, + disabledTextColor?: string, + }, + gridTile?: { + textColor?: string, + }, + inkBar?: { + backgroundColor?: string, + }, + leftNav?: { + width?: number, + color?: string, + }, + listItem?: { + nestedLevelDepth?: number, + }, + menu?: { + backgroundColor?: string, + containerBackgroundColor?: string, + }, + menuItem?: { + dataHeight?: number, + height?: number, + hoverColor?: string, + padding?: number, + selectedTextColor?: string, + }, + menuSubheader?: { + padding?: number, + borderColor?: string, + textColor?: string, + }, + paper?: { + backgroundColor?: string, + zDepthShadows?: string[], + }, + radioButton?: { + borderColor?: string, + backgroundColor?: string, + checkedColor?: string, + requiredColor?: string, + disabledColor?: string, + size?: number, + labelColor?: string, + labelDisabledColor?: string, + }, + raisedButton?: { + color?: string, + textColor?: string, + primaryColor?: string, + primaryTextColor?: string, + secondaryColor?: string, + secondaryTextColor?: string, + disabledColor?: string, + disabledTextColor?: string, + }, + refreshIndicator?: { + strokeColor?: string, + loadingStrokeColor?: string, + }; + slider?: { + trackSize?: number, + trackColor?: string, + trackColorSelected?: string, + handleSize?: number, + handleSizeDisabled?: number, + handleSizeActive?: number, + handleColorZero?: string, + handleFillColor?: string, + selectionColor?: string, + rippleColor?: string, + }, + snackbar?: { + textColor?: string, + backgroundColor?: string, + actionColor?: string, + }, + table?: { + backgroundColor?: string; + }; + tableHeader?: { + borderColor?: string; + }; + tableHeaderColumn?: { + textColor?: string; + height?: number; + spacing?: number; + }; + tableFooter?: { + borderColor?: string; + textColor?: string; + }; + tableRow?: { + hoverColor?: string; + stripeColor?: string; + selectedColor?: string; + textColor?: string; + borderColor?: string; + height?: number; + }; + tableRowColumn?: { + height?: number; + spacing?: number; + }; + timePicker?: { + color?: string; + textColor?: string; + accentColor?: string; + clockColor?: string; + clockCircleColor?: string; + headerColor?: string; + selectColor?: string; + selectTextColor?: string; + }; + toggle?: { + thumbOnColor?: string, + thumbOffColor?: string, + thumbDisabledColor?: string, + thumbRequiredColor?: string, + trackOnColor?: string, + trackOffColor?: string, + trackDisabledColor?: string, + labelColor?: string, + labelDisabledColor?: string + trackRequiredColor?: string, + }, + toolbar?: { + backgroundColor?: string, + height?: number, + titleFontSize?: number, + iconColor?: string, + separatorColor?: string, + menuHoverColor?: string, + }; + tabs?: { + backgroundColor?: string, + textColor?: string, + selectedTextColor?: string, + }; + textField?: { + textColor?: string; + hintColor?: string; + floatingLabelColor?: string; + disabledTextColor?: string; + errorColor?: string; + focusColor?: string; + backgroundColor?: string; + borderColor?: string; + }; + } + + interface zIndex { + menu: number; + appBar: number; + leftNavOverlay: number; + leftNav: number; + dialogOverlay: number; + dialog: number; + layer: number; + popover: number; + snackbar: number; + tooltip: number; + } + export var zIndex: zIndex; + + interface RawTheme { + spacing?: Spacing; + fontFamily?: string; + palette?: ThemePalette; + zIndex?: zIndex; + } + var lightBaseTheme: RawTheme; + var darkBaseTheme: RawTheme; + + export function ThemeDecorator(muiTheme: Styles.MuiTheme): (Component: TFunction) => TFunction; + + export function getMuiTheme(baseTheme: RawTheme, muiTheme ?: MuiTheme): MuiTheme; + + interface ThemeManager { + getMuiTheme(baseTheme: RawTheme, muiTheme?: MuiTheme): MuiTheme; + modifyRawThemeSpacing(muiTheme: MuiTheme, newSpacing: Spacing): MuiTheme; + modifyRawThemePalette(muiTheme: MuiTheme, newPaletteKeys: ThemePalette): MuiTheme; + modifyRawThemeFontFamily(muiTheme: MuiTheme, newFontFamily: string): MuiTheme; + } + export var ThemeManager: ThemeManager; + + interface Transitions { + easeOut(duration?: string, property?: string | string[], delay?: string, easeFunction?: string): string; + create(duration?: string, property?: string, delay?: string, easeFunction?: string): string; + easeOutFunction: string; + easeInOutFunction: string; + } + export var Transitions: Transitions; + + interface Typography { + textFullBlack: string; + textDarkBlack: string; + textLightBlack: string; + textMinBlack: string; + textFullWhite: string; + textDarkWhite: string; + textLightWhite: string; + + // font weight + fontWeightLight: number; + fontWeightNormal: number; + fontWeightMedium: number; + + fontStyleButtonFontSize: number; + } + export var Typography: Typography; + + export var DarkRawTheme: RawTheme; + export var LightRawTheme: RawTheme; + } + + interface AppBarProps extends React.Props { + className?: string; + iconClassNameLeft?: string; + iconClassNameRight?: string; + iconElementLeft?: React.ReactElement; + iconElementRight?: React.ReactElement; + iconStyleRight?: string; + onLeftIconButtonTouchTap?: TouchTapEventHandler; + onRightIconButtonTouchTap?: TouchTapEventHandler; + onTitleTouchTap?: TouchTapEventHandler; + showMenuIconButton?: boolean; + style?: React.CSSProperties; + title?: React.ReactNode; + titleStyle?: React.CSSProperties; + zDepth?: number; + } + export class AppBar extends React.Component{ + } + + interface AppCanvasProps extends React.Props { + } + export class AppCanvas extends React.Component { + } + + interface Origin { + horizontal: string; // oneOf(['left', 'middle', 'right']) + vertical: string; // oneOf(['top', 'center', 'bottom']) + } + + type AutoCompleteDataItem = { text: string, value: React.ReactNode } | string; + type AutoCompleteDataSource = { text: string, value: React.ReactNode }[] | string[]; + interface AutoCompleteProps extends React.Props { + anchorOrigin?: Origin; + animated?: boolean; + dataSource?: AutoCompleteDataSource; + disableFocusRipple?: boolean; + errorStyle?: React.CSSProperties; + errorText?: string; + filter?: (searchText: string, key: string, item: AutoCompleteDataItem) => boolean; + floatingLabelText?: string; + fullWidth?: boolean; + hintText?: string; + listStyle?: React.CSSProperties; + menuCloseDelay?: number; + menuProps?: any; + menuStyle?: React.CSSProperties; + onNewRequest?: (chosenRequest: string, index: number) => void; + onUpdateInput?: (searchText: string, dataSource: AutoCompleteDataSource) => void; + open?: boolean; + searchText?: string; + /** @deprecated use noFilter instead */ + showAllItems?: boolean; + style?: React.CSSProperties; + targetOrigin?: Origin; + touchTapCloseDelay?: number; + triggerUpdateOnFocus?: boolean; + /** @deprecated updateWhenFocused has been renamed to triggerUpdateOnFocus */ + updateWhenFocused?: boolean; + } + export class AutoComplete extends React.Component { + static noFilter: () => boolean; + static defaultFilter: (searchText: string, key: string) => boolean; + static caseSensitiveFilter: (searchText: string, key: string) => boolean; + static caseInsensitiveFilter: (searchText: string, key: string) => boolean; + static levenshteinDistanceFilter(distanceLessThan: number): (searchText: string, key: string) => boolean; + static fuzzyFilter: (searchText: string, key: string) => boolean; + static Item: Menus.MenuItem; + static Divider: Divider; + } + + interface AvatarProps extends React.Props { + backgroundColor?: string; + className?: string; + color?: string; + icon?: React.ReactElement; + size?: number; + src?: string; + style?: React.CSSProperties; + } + export class Avatar extends React.Component { + } + + interface BadgeProps extends React.Props { + badgeContent: React.ReactNode; + badgeStyle?: React.CSSProperties; + className?: string; + primary?: boolean; + secondary?: boolean; + style?: React.CSSProperties; + } + export class Badge extends React.Component { + } + + interface BeforeAfterWrapperProps extends React.Props { + afterElementType?: string; + afterStyle?: React.CSSProperties; + beforeElementType?: string; + beforeStyle?: React.CSSProperties; + elementType?: string; + style?: React.CSSProperties; + } + export class BeforeAfterWrapper extends React.Component { + } + + // non generally overridden elements of EnhancedButton + interface SharedEnhancedButtonProps extends React.Props { + centerRipple?: boolean; + disableFocusRipple?: boolean; + disableKeyboardFocus?: boolean; + disableTouchRipple?: boolean; + focusRippleColor?: string; + focusRippleOpacity?: number; + keyboardFocused?: boolean; + linkButton?: boolean; + onBlur?: React.FocusEventHandler; + onFocus?: React.FocusEventHandler; + onKeyboardFocus?: (e: React.FocusEvent, isKeyboardFocused: boolean) => void; + onKeyDown?: React.KeyboardEventHandler; + onKeyUp?: React.KeyboardEventHandler; + onTouchTap?: TouchTapEventHandler; + style?: React.CSSProperties; + tabIndex?: number; + touchRippleColor?: string; + touchRippleOpacity?: number; + type?: string; + } + + interface EnhancedButtonProps extends React.HTMLAttributes, SharedEnhancedButtonProps { + // container element,